变更项目缩写
This commit is contained in:
82
ruoyi-ui/src/views/ccdiIntermediary/components/DataTable.vue
Normal file
82
ruoyi-ui/src/views/ccdiIntermediary/components/DataTable.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="姓名/机构名称" align="center" prop="name" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="证件号" align="center" prop="certificateNo" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="中介类型" align="center" prop="intermediaryTypeName" width="100"/>
|
||||
<el-table-column label="状态" align="center" prop="status" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === '0'" type="success">正常</el-tag>
|
||||
<el-tag v-else type="danger">停用</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="240">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="$emit('detail', scope.row)"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="$emit('update', scope.row)"
|
||||
v-hasPermi="['ccdi:intermediary:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="$emit('delete', scope.row)"
|
||||
v-hasPermi="['ccdi:intermediary:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="pageParams.pageNum"
|
||||
:limit.sync="pageParams.pageSize"
|
||||
@pagination="$emit('pagination')"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "DataTable",
|
||||
props: {
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
dataList: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
total: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
pageParams: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(selection) {
|
||||
this.$emit("selection-change", selection);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<el-dialog title="中介黑名单详情" :visible.sync="visible" width="800px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<!-- 核心字段 -->
|
||||
<el-descriptions-item label="中介ID">{{ detailData.intermediaryId }}</el-descriptions-item>
|
||||
<el-descriptions-item label="中介类型">{{ detailData.intermediaryTypeName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名/机构名称">{{ detailData.name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="证件号/信用代码">{{ detailData.certificateNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
<el-tag v-if="detailData.status === '0'" type="success">正常</el-tag>
|
||||
<el-tag v-else type="danger">停用</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="数据来源">{{ detailData.dataSourceName || '-' }}</el-descriptions-item>
|
||||
|
||||
<!-- 个人类型专属字段 -->
|
||||
<template v-if="detailData.intermediaryType === '1'">
|
||||
<el-descriptions-item label="人员类型">{{ detailData.indivType || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="人员子类型">{{ detailData.indivSubType || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">{{ detailData.indivGenderName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="证件类型">{{ detailData.indivCertType || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="手机号码">{{ detailData.indivPhone || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="微信号">{{ detailData.indivWechat || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系地址" :span="2">{{ detailData.indivAddress || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所在公司">{{ detailData.indivCompany || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="职位">{{ detailData.indivPosition || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="关联人员ID">{{ detailData.indivRelatedId || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="关联关系">{{ detailData.indivRelation || '-' }}</el-descriptions-item>
|
||||
</template>
|
||||
|
||||
<!-- 机构类型专属字段 -->
|
||||
<template v-if="detailData.intermediaryType === '2'">
|
||||
<el-descriptions-item label="统一社会信用代码" :span="2">{{ detailData.corpCreditCode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="主体类型">{{ detailData.corpType || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="企业性质">{{ detailData.corpNature || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="行业分类">{{ detailData.corpIndustryCategory || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属行业">{{ detailData.corpIndustry || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="成立日期">{{ detailData.corpEstablishDate || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="注册地址" :span="2">{{ detailData.corpAddress || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="法定代表人">{{ detailData.corpLegalRep || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="法定代表人证件类型">{{ detailData.corpLegalCertType || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="法定代表人证件号码" :span="2">{{ detailData.corpLegalCertNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="股东1">{{ detailData.corpShareholder1 || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="股东2">{{ detailData.corpShareholder2 || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="股东3">{{ detailData.corpShareholder3 || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="股东4">{{ detailData.corpShareholder4 || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="股东5">{{ detailData.corpShareholder5 || '-' }}</el-descriptions-item>
|
||||
</template>
|
||||
|
||||
<!-- 通用字段 -->
|
||||
<el-descriptions-item label="备注" :span="2">{{ detailData.remark || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{ detailData.createTime }}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建人">{{ detailData.createBy || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "DetailDialog",
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
detailData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
this.$emit("update:visible", val);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
639
ruoyi-ui/src/views/ccdiIntermediary/components/EditDialog.vue
Normal file
639
ruoyi-ui/src/views/ccdiIntermediary/components/EditDialog.vue
Normal file
@@ -0,0 +1,639 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="visible" width="900px" append-to-body @close="handleClose">
|
||||
<!-- 新增模式:显示类型选择卡片 -->
|
||||
<div v-if="isAddMode && !selectedType" class="type-selector">
|
||||
<div class="type-cards">
|
||||
<div
|
||||
class="type-card"
|
||||
:class="{ 'selected': tempSelectedType === '1' }"
|
||||
@click="handleTypeSelect('1')"
|
||||
>
|
||||
<i class="el-icon-user type-card-icon"></i>
|
||||
<div class="type-card-title">个人</div>
|
||||
<div class="type-card-desc">添加个人中介信息</div>
|
||||
</div>
|
||||
<div
|
||||
class="type-card"
|
||||
:class="{ 'selected': tempSelectedType === '2' }"
|
||||
@click="handleTypeSelect('2')"
|
||||
>
|
||||
<i class="el-icon-office-building type-card-icon"></i>
|
||||
<div class="type-card-title">机构</div>
|
||||
<div class="type-card-desc">添加机构中介信息</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 表单区域:选择类型后或修改模式显示 -->
|
||||
<div v-show="selectedType || !isAddMode" class="form-container" :class="{ 'fade-in': shouldAnimate }">
|
||||
<el-divider v-if="isAddMode" content-position="left">{{ getTypeDividerText }}</el-divider>
|
||||
|
||||
<!-- 个人类型表单 -->
|
||||
<el-form
|
||||
v-if="form.intermediaryType === '1'"
|
||||
ref="indivForm"
|
||||
:model="form"
|
||||
:rules="indivRules"
|
||||
label-width="120px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名" maxlength="100" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="证件号" prop="certificateNo">
|
||||
<el-input v-model="form.certificateNo" placeholder="请输入证件号码" maxlength="50" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="人员类型">
|
||||
<el-select v-model="form.indivType" placeholder="请选择人员类型" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in indivTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="人员子类型">
|
||||
<el-select v-model="form.indivSubType" placeholder="请选择人员子类型" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in indivSubTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别">
|
||||
<el-select v-model="form.indivGender" placeholder="请选择性别" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in genderOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="证件类型">
|
||||
<el-select v-model="form.indivCertType" placeholder="请选择证件类型" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in certTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码">
|
||||
<el-input v-model="form.indivPhone" placeholder="请输入手机号码" maxlength="20" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="微信号">
|
||||
<el-input v-model="form.indivWechat" placeholder="请输入微信号" maxlength="50" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="联系地址">
|
||||
<el-input v-model="form.indivAddress" placeholder="请输入联系地址" maxlength="200" clearable/>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所在公司">
|
||||
<el-input v-model="form.indivCompany" placeholder="请输入所在公司" maxlength="100" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职位">
|
||||
<el-input v-model="form.indivPosition" placeholder="请输入职位" maxlength="100" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="关联人员ID">
|
||||
<el-input v-model="form.indivRelatedId" placeholder="请输入关联人员ID" maxlength="20" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="关联关系">
|
||||
<el-select v-model="form.indivRelation" placeholder="请选择关联关系" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in relationTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入备注"
|
||||
maxlength="500"
|
||||
:rows="3"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 机构类型表单 -->
|
||||
<el-form
|
||||
v-else-if="form.intermediaryType === '2'"
|
||||
ref="corpForm"
|
||||
:model="form"
|
||||
:rules="corpRules"
|
||||
label-width="140px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="机构名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入机构名称" maxlength="100" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="证件号" prop="certificateNo">
|
||||
<el-input
|
||||
v-model="form.certificateNo"
|
||||
@input="handleCertificateNoChange"
|
||||
placeholder="统一社会信用代码(18位)"
|
||||
maxlength="18"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主体类型">
|
||||
<el-select v-model="form.corpType" placeholder="请选择主体类型" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in corpTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="企业性质">
|
||||
<el-select v-model="form.corpNature" placeholder="请选择企业性质" clearable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in corpNatureOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成立日期">
|
||||
<el-date-picker
|
||||
v-model="form.corpEstablishDate"
|
||||
type="date"
|
||||
placeholder="选择成立日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="行业分类">
|
||||
<el-input v-model="form.corpIndustryCategory" placeholder="请输入行业分类" maxlength="100" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属行业">
|
||||
<el-input v-model="form.corpIndustry" placeholder="请输入所属行业" maxlength="100" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="注册地址">
|
||||
<el-input v-model="form.corpAddress" type="textarea" placeholder="请输入注册地址" maxlength="500" :rows="2"/>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="法定代表人">
|
||||
<el-input v-model="form.corpLegalRep" placeholder="请输入法定代表人" maxlength="50" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="法定代表人证件类型">
|
||||
<el-input v-model="form.corpLegalCertType" placeholder="请输入证件类型" maxlength="30" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="法定代表人证件号码">
|
||||
<el-input v-model="form.corpLegalCertNo" placeholder="请输入法定代表人证件号码" maxlength="30" clearable/>
|
||||
</el-form-item>
|
||||
<el-divider content-position="left">股东信息</el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="股东1">
|
||||
<el-input v-model="form.corpShareholder1" placeholder="请输入股东1" maxlength="30" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="股东2">
|
||||
<el-input v-model="form.corpShareholder2" placeholder="请输入股东2" maxlength="30" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="股东3">
|
||||
<el-input v-model="form.corpShareholder3" placeholder="请输入股东3" maxlength="30" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="股东4">
|
||||
<el-input v-model="form.corpShareholder4" placeholder="请输入股东4" maxlength="30" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="股东5">
|
||||
<el-input v-model="form.corpShareholder5" placeholder="请输入股东5" maxlength="30" clearable/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入备注"
|
||||
maxlength="500"
|
||||
:rows="3"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="isAddMode && !selectedType"
|
||||
@click="handleSubmit"
|
||||
>确 定</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "EditDialog",
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
form: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
indivTypeOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
indivSubTypeOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
genderOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
certTypeOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
relationTypeOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
corpTypeOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
corpNatureOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 新增模式:是否为新增操作(通过 computed 动态计算)
|
||||
// isAddMode: true,
|
||||
// 已选择的类型(确认后的类型)
|
||||
selectedType: null,
|
||||
// 临时选择的类型(用于卡片高亮)
|
||||
tempSelectedType: null,
|
||||
// 是否需要显示淡入动画
|
||||
shouldAnimate: false,
|
||||
// 个人类型验证规则
|
||||
indivRules: {
|
||||
name: [
|
||||
{ required: true, message: "姓名不能为空", trigger: "blur" },
|
||||
{ max: 100, message: "姓名长度不能超过100个字符", trigger: "blur" }
|
||||
],
|
||||
certificateNo: [
|
||||
{ required: true, message: "证件号不能为空", trigger: "blur" },
|
||||
{ max: 50, message: "证件号长度不能超过50个字符", trigger: "blur" }
|
||||
],
|
||||
remark: [
|
||||
{ max: 500, message: "备注长度不能超过500个字符", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
// 机构类型验证规则
|
||||
corpRules: {
|
||||
name: [
|
||||
{ required: true, message: "机构名称不能为空", trigger: "blur" },
|
||||
{ max: 100, message: "机构名称长度不能超过100个字符", trigger: "blur" }
|
||||
],
|
||||
certificateNo: [
|
||||
{ required: true, message: "证件号不能为空", trigger: "blur" },
|
||||
{ max: 18, message: "统一社会信用代码长度为18位", trigger: "blur" }
|
||||
],
|
||||
remark: [
|
||||
{ max: 500, message: "备注长度不能超过500个字符", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// 判断是否为新增模式
|
||||
isAddMode() {
|
||||
return !this.form || !this.form.intermediaryId;
|
||||
},
|
||||
// 根据选择的类型返回分隔线文本
|
||||
getTypeDividerText() {
|
||||
if (this.form.intermediaryType === '1') {
|
||||
return '个人信息';
|
||||
} else if (this.form.intermediaryType === '2') {
|
||||
return '机构信息';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 监听 visible 变化,重置状态
|
||||
visible(newVal) {
|
||||
if (newVal) {
|
||||
// 延迟初始化,确保 form 数据已经传入
|
||||
this.$nextTick(() => {
|
||||
this.initDialogState();
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 初始化弹窗状态
|
||||
*/
|
||||
initDialogState() {
|
||||
// 始终基于当前的 form 状态判断
|
||||
const isAdd = !this.form || !this.form.intermediaryId;
|
||||
|
||||
if (isAdd) {
|
||||
// 新增模式:重置选择状态
|
||||
this.selectedType = null;
|
||||
this.tempSelectedType = null;
|
||||
this.shouldAnimate = false;
|
||||
// 重置为个人类型(默认)
|
||||
if (this.form) {
|
||||
this.form.intermediaryType = '1';
|
||||
}
|
||||
} else {
|
||||
// 修改模式:设置已选择的类型
|
||||
if (this.form && this.form.intermediaryType) {
|
||||
this.selectedType = this.form.intermediaryType;
|
||||
}
|
||||
this.shouldAnimate = false;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理类型选择
|
||||
*/
|
||||
handleTypeSelect(type) {
|
||||
this.tempSelectedType = type;
|
||||
this.form.intermediaryType = type;
|
||||
// 延迟设置 selectedType,使表单显示带动画效果
|
||||
setTimeout(() => {
|
||||
this.selectedType = type;
|
||||
this.shouldAnimate = true;
|
||||
// 清除表单验证状态,避免立即显示验证错误
|
||||
this.$nextTick(() => {
|
||||
const formRef = type === '1' ? 'indivForm' : 'corpForm';
|
||||
if (this.$refs[formRef]) {
|
||||
this.$refs[formRef].clearValidate();
|
||||
}
|
||||
});
|
||||
}, 50);
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理机构类型证件号变更
|
||||
* 同步到统一社会信用代码字段
|
||||
*/
|
||||
handleCertificateNoChange(value) {
|
||||
if (this.form.intermediaryType === '2') {
|
||||
this.form.corpCreditCode = value;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 提交表单
|
||||
*/
|
||||
handleSubmit() {
|
||||
// 未选择类型时不提交
|
||||
if (this.isAddMode && !this.selectedType) {
|
||||
this.$message.warning('请先选择中介类型');
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据类型验证不同的表单
|
||||
const formRef = this.form.intermediaryType === '1' ? 'indivForm' : 'corpForm';
|
||||
const rules = this.form.intermediaryType === '1' ? this.indivRules : this.corpRules;
|
||||
|
||||
// 机构类型:同步证件号到统一社会信用代码
|
||||
if (this.form.intermediaryType === '2') {
|
||||
this.form.corpCreditCode = this.form.certificateNo;
|
||||
}
|
||||
|
||||
this.$refs[formRef].validate(valid => {
|
||||
if (valid) {
|
||||
this.$emit("submit");
|
||||
} else {
|
||||
// 验证失败:滚动到第一个错误字段
|
||||
this.scrollToFirstError();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 滚动到第一个错误字段
|
||||
*/
|
||||
scrollToFirstError() {
|
||||
const firstError = document.querySelector('.el-form-item__error');
|
||||
if (firstError) {
|
||||
firstError.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 关闭弹窗
|
||||
*/
|
||||
handleClose() {
|
||||
// 清除表单验证状态
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.indivForm) {
|
||||
this.$refs.indivForm.clearValidate();
|
||||
}
|
||||
if (this.$refs.corpForm) {
|
||||
this.$refs.corpForm.clearValidate();
|
||||
}
|
||||
});
|
||||
this.$emit("close");
|
||||
},
|
||||
|
||||
/**
|
||||
* 验证表单(供父组件调用)
|
||||
*/
|
||||
validateForm() {
|
||||
const formRef = this.form.intermediaryType === '1' ? 'indivForm' : 'corpForm';
|
||||
return this.$refs[formRef] ? this.$refs[formRef].validate() : Promise.reject();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/* 类型选择器区域 */
|
||||
.type-selector {
|
||||
padding: 20px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.type-cards {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 30px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.type-card {
|
||||
flex: 1;
|
||||
max-width: 200px;
|
||||
padding: 30px 20px;
|
||||
border: 2px solid #e4e7ed;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
background-color: #fff;
|
||||
|
||||
&:hover {
|
||||
border-color: #409eff;
|
||||
box-shadow: 0 2px 12px rgba(64, 158, 255, 0.2);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
&.selected {
|
||||
border-color: #409eff;
|
||||
background-color: #ecf5ff;
|
||||
box-shadow: 0 4px 16px rgba(64, 158, 255, 0.3);
|
||||
}
|
||||
|
||||
&-icon {
|
||||
font-size: 48px;
|
||||
color: #909399;
|
||||
margin-bottom: 10px;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
&.selected &-icon {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
&-title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
&-desc {
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
/* 表单容器 */
|
||||
.form-container {
|
||||
padding: 10px 0;
|
||||
|
||||
&.fade-in {
|
||||
animation: fadeIn 0.3s ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-10px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* 分隔线样式 */
|
||||
::v-deep .el-divider {
|
||||
margin: 20px 0;
|
||||
|
||||
.el-divider__text {
|
||||
font-weight: bold;
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
/* 必填项星号样式 */
|
||||
::v-deep .el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label::before {
|
||||
color: #f56c6c;
|
||||
}
|
||||
</style>
|
||||
303
ruoyi-ui/src/views/ccdiIntermediary/components/ImportDialog.vue
Normal file
303
ruoyi-ui/src/views/ccdiIntermediary/components/ImportDialog.vue
Normal file
@@ -0,0 +1,303 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="visible"
|
||||
width="550px"
|
||||
center
|
||||
append-to-body
|
||||
@open="handleDialogOpen"
|
||||
@close="handleDialogClose"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
custom-class="import-dialog-wrapper"
|
||||
>
|
||||
<!-- 全屏Loading遮罩层 -->
|
||||
<div v-show="isUploading" class="import-loading-overlay">
|
||||
<i class="el-icon-loading"></i>
|
||||
<p>正在导入中,请稍候...</p>
|
||||
</div>
|
||||
|
||||
<el-form :model="formData" label-position="top" size="medium">
|
||||
<!-- 导入类型 -->
|
||||
<el-form-item label="导入类型">
|
||||
<el-radio-group v-model="formData.importType" @change="handleImportTypeChange" style="width: 100%">
|
||||
<el-radio label="person" border>个人中介</el-radio>
|
||||
<el-radio label="entity" border>机构中介</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 文件上传 -->
|
||||
<el-form-item label="选择文件">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="headers"
|
||||
:action="uploadUrl"
|
||||
:disabled="isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:on-error="handleFileError"
|
||||
:on-change="handleFileChange"
|
||||
:on-remove="handleFileRemove"
|
||||
:auto-upload="false"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
仅支持 .xls 和 .xlsx 格式,文件大小不超过 10MB
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 其他选项 -->
|
||||
<el-form-item>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-checkbox v-model="formData.updateSupport" :disabled="isUploading">
|
||||
更新已存在的数据
|
||||
</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="12" style="text-align: right">
|
||||
<el-link type="primary" :underline="false" @click="handleDownloadTemplate">
|
||||
<i class="el-icon-download"></i>
|
||||
下载导入模板
|
||||
</el-link>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-upload2"
|
||||
:loading="isUploading"
|
||||
:disabled="!isFileSelected"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
{{ isUploading ? '导入中...' : '开始导入' }}
|
||||
</el-button>
|
||||
<el-button icon="el-icon-close" @click="visible = false" :disabled="isUploading">
|
||||
取 消
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getToken} from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
name: "ImportDialog",
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "数据导入"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
importType: "person",
|
||||
updateSupport: 0
|
||||
},
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
isUploading: false,
|
||||
isFileSelected: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
uploadUrl() {
|
||||
const baseUrl = process.env.VUE_APP_BASE_API;
|
||||
const updateSupport = this.formData.updateSupport ? 1 : 0;
|
||||
if (this.formData.importType === 'person') {
|
||||
return `${baseUrl}/ccdi/intermediary/importPersonData?updateSupport=${updateSupport}`;
|
||||
} else {
|
||||
return `${baseUrl}/ccdi/intermediary/importEntityData?updateSupport=${updateSupport}`;
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
visible(val) {
|
||||
this.$emit("update:visible", val);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleDialogOpen() {
|
||||
this.isFileSelected = false;
|
||||
},
|
||||
handleDialogClose() {
|
||||
if (this.$refs.upload) {
|
||||
this.$refs.upload.clearFiles();
|
||||
}
|
||||
this.isFileSelected = false;
|
||||
this.$emit("close");
|
||||
},
|
||||
handleImportTypeChange() {
|
||||
if (this.$refs.upload) {
|
||||
this.$refs.upload.clearFiles();
|
||||
}
|
||||
this.isFileSelected = false;
|
||||
},
|
||||
handleDownloadTemplate() {
|
||||
if (this.formData.importType === 'person') {
|
||||
this.download('dpc/intermediary/importPersonTemplate', {}, `个人中介黑名单模板_${new Date().getTime()}.xlsx`);
|
||||
} else {
|
||||
this.download('dpc/intermediary/importEntityTemplate', {}, `机构中介黑名单模板_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
},
|
||||
handleFileUploadProgress() {
|
||||
this.isUploading = true;
|
||||
},
|
||||
handleFileChange(file, fileList) {
|
||||
this.isFileSelected = fileList.length > 0;
|
||||
},
|
||||
handleFileRemove(file, fileList) {
|
||||
this.isFileSelected = fileList.length > 0;
|
||||
},
|
||||
handleFileSuccess(response) {
|
||||
this.isUploading = false;
|
||||
this.visible = false;
|
||||
this.$emit("success");
|
||||
this.$msgbox({
|
||||
title: '导入结果',
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: `<div style="overflow-y: auto; max-height: 60vh; padding-right: 10px; line-height: 1.6;">${response.msg}</div>`,
|
||||
confirmButtonText: '确定',
|
||||
customClass: 'import-result-dialog'
|
||||
});
|
||||
this.$refs.upload.clearFiles();
|
||||
},
|
||||
handleFileError() {
|
||||
this.isUploading = false;
|
||||
this.$modal.msgError("导入失败,请检查文件格式是否正确");
|
||||
this.$refs.upload.clearFiles();
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.upload.submit();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .el-form {
|
||||
.el-form-item {
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
|
||||
.el-radio-group {
|
||||
display: flex;
|
||||
|
||||
.el-radio {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
margin-right: 0;
|
||||
|
||||
&:first-child {
|
||||
.el-radio__label {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
.el-radio__label {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&.is-bordered {
|
||||
padding: 10px 0;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-upload {
|
||||
width: 100%;
|
||||
|
||||
.el-upload-dragger {
|
||||
width: 100% !important;
|
||||
height: 140px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.el-icon-upload {
|
||||
font-size: 50px;
|
||||
color: #409EFF;
|
||||
margin: 15px 0 10px;
|
||||
}
|
||||
|
||||
.el-upload__text {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
|
||||
em {
|
||||
color: #409EFF;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-upload__tip {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
margin-top: 8px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: center;
|
||||
padding: 5px 0 0;
|
||||
|
||||
.el-button {
|
||||
min-width: 110px;
|
||||
margin: 0 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.import-loading-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 10000;
|
||||
|
||||
.el-icon-loading {
|
||||
font-size: 48px;
|
||||
color: #409EFF;
|
||||
animation: rotating 2s linear infinite;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 15px;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes rotating {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="姓名/机构名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入姓名/机构名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="证件号" prop="certificateNo">
|
||||
<el-input
|
||||
v-model="queryParams.certificateNo"
|
||||
placeholder="请输入证件号"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="中介类型" prop="intermediaryType">
|
||||
<el-select v-model="queryParams.intermediaryType" placeholder="中介类型" clearable style="width: 240px">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="个人" value="1" />
|
||||
<el-option label="机构" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="状态" clearable style="width: 240px">
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="正常" value="0" />
|
||||
<el-option label="停用" value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "SearchForm",
|
||||
props: {
|
||||
queryParams: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
showSearch: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleQuery() {
|
||||
this.$emit("query");
|
||||
},
|
||||
resetQuery() {
|
||||
this.$refs.queryForm.resetFields();
|
||||
this.$emit("query");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
325
ruoyi-ui/src/views/ccdiIntermediary/index.vue
Normal file
325
ruoyi-ui/src/views/ccdiIntermediary/index.vue
Normal file
@@ -0,0 +1,325 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索表单 -->
|
||||
<search-form
|
||||
:query-params="queryParams"
|
||||
:show-search="showSearch"
|
||||
@query="handleQuery"
|
||||
/>
|
||||
|
||||
<!-- 工具栏 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['ccdi:intermediary:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="handleImport"
|
||||
v-hasPermi="['ccdi:intermediary:import']"
|
||||
>导入</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<data-table
|
||||
:loading="loading"
|
||||
:data-list="intermediaryList"
|
||||
:total="total"
|
||||
:page-params="queryParams"
|
||||
@selection-change="handleSelectionChange"
|
||||
@pagination="getList"
|
||||
@detail="handleDetail"
|
||||
@update="handleUpdate"
|
||||
@delete="handleDelete"
|
||||
/>
|
||||
|
||||
<!-- 编辑对话框 -->
|
||||
<edit-dialog
|
||||
:visible.sync="open"
|
||||
:title="title"
|
||||
:form="form"
|
||||
:indiv-type-options="indivTypeOptions"
|
||||
:indiv-sub-type-options="indivSubTypeOptions"
|
||||
:gender-options="genderOptions"
|
||||
:cert-type-options="certTypeOptions"
|
||||
:relation-type-options="relationTypeOptions"
|
||||
:corp-type-options="corpTypeOptions"
|
||||
:corp-nature-options="corpNatureOptions"
|
||||
@submit="submitForm"
|
||||
@close="cancel"
|
||||
/>
|
||||
|
||||
<!-- 详情对话框 -->
|
||||
<detail-dialog
|
||||
:visible.sync="detailOpen"
|
||||
:detail-data="detailData"
|
||||
/>
|
||||
|
||||
<!-- 导入对话框 -->
|
||||
<import-dialog
|
||||
:visible.sync="upload.open"
|
||||
:title="upload.title"
|
||||
@close="handleImportDialogClose"
|
||||
@success="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addEntityIntermediary,
|
||||
addPersonIntermediary,
|
||||
delIntermediary,
|
||||
getIntermediary,
|
||||
listIntermediary,
|
||||
updateEntityIntermediary,
|
||||
updatePersonIntermediary
|
||||
} from "@/api/ccdiIntermediary";
|
||||
import {
|
||||
getCertTypeOptions,
|
||||
getCorpNatureOptions,
|
||||
getCorpTypeOptions,
|
||||
getGenderOptions,
|
||||
getIndivSubTypeOptions,
|
||||
getIndivTypeOptions,
|
||||
getRelationTypeOptions
|
||||
} from "@/api/ccdiEnum";
|
||||
import SearchForm from "./components/SearchForm";
|
||||
import DataTable from "./components/DataTable";
|
||||
import EditDialog from "./components/EditDialog";
|
||||
import DetailDialog from "./components/DetailDialog";
|
||||
import ImportDialog from "./components/ImportDialog";
|
||||
|
||||
export default {
|
||||
name: "Intermediary",
|
||||
components: {
|
||||
SearchForm,
|
||||
DataTable,
|
||||
EditDialog,
|
||||
DetailDialog,
|
||||
ImportDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
ids: [],
|
||||
single: true,
|
||||
multiple: true,
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
intermediaryList: [],
|
||||
title: "",
|
||||
open: false,
|
||||
detailOpen: false,
|
||||
detailData: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
certificateNo: null,
|
||||
intermediaryType: null,
|
||||
status: null
|
||||
},
|
||||
form: {},
|
||||
upload: {
|
||||
open: false,
|
||||
title: ""
|
||||
},
|
||||
indivTypeOptions: [],
|
||||
indivSubTypeOptions: [],
|
||||
genderOptions: [],
|
||||
certTypeOptions: [],
|
||||
relationTypeOptions: [],
|
||||
corpTypeOptions: [],
|
||||
corpNatureOptions: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.loadEnumOptions();
|
||||
},
|
||||
methods: {
|
||||
/** 加载枚举选项 */
|
||||
loadEnumOptions() {
|
||||
getIndivTypeOptions().then(response => {
|
||||
this.indivTypeOptions = response.data;
|
||||
});
|
||||
getIndivSubTypeOptions().then(response => {
|
||||
this.indivSubTypeOptions = response.data;
|
||||
});
|
||||
getGenderOptions().then(response => {
|
||||
this.genderOptions = response.data;
|
||||
});
|
||||
getCertTypeOptions().then(response => {
|
||||
this.certTypeOptions = response.data;
|
||||
});
|
||||
getRelationTypeOptions().then(response => {
|
||||
this.relationTypeOptions = response.data;
|
||||
});
|
||||
getCorpTypeOptions().then(response => {
|
||||
this.corpTypeOptions = response.data;
|
||||
});
|
||||
getCorpNatureOptions().then(response => {
|
||||
this.corpNatureOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 查询中介黑名单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listIntermediary(this.queryParams).then(response => {
|
||||
this.intermediaryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 多选框选中数据 */
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.intermediaryId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加中介黑名单";
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
intermediaryId: null,
|
||||
name: null,
|
||||
certificateNo: null,
|
||||
intermediaryType: "1",
|
||||
status: "0",
|
||||
remark: null,
|
||||
indivType: null,
|
||||
indivSubType: null,
|
||||
indivGender: null,
|
||||
indivCertType: null,
|
||||
indivPhone: null,
|
||||
indivWechat: null,
|
||||
indivAddress: null,
|
||||
indivCompany: null,
|
||||
indivPosition: null,
|
||||
indivRelatedId: null,
|
||||
indivRelation: null,
|
||||
corpCreditCode: null,
|
||||
corpType: null,
|
||||
corpNature: null,
|
||||
corpIndustryCategory: null,
|
||||
corpIndustry: null,
|
||||
corpEstablishDate: null,
|
||||
corpAddress: null,
|
||||
corpLegalRep: null,
|
||||
corpLegalCertType: null,
|
||||
corpLegalCertNo: null,
|
||||
corpShareholder1: null,
|
||||
corpShareholder2: null,
|
||||
corpShareholder3: null,
|
||||
corpShareholder4: null,
|
||||
corpShareholder5: null
|
||||
};
|
||||
// 注意:不调用 this.resetForm("form")
|
||||
// EditDialog 组件会在 visible 变化时自动处理表单验证状态的重置
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 查看详情操作 */
|
||||
handleDetail(row) {
|
||||
const intermediaryId = row.intermediaryId;
|
||||
getIntermediary(intermediaryId).then(response => {
|
||||
this.detailData = response.data;
|
||||
this.detailOpen = true;
|
||||
});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const intermediaryId = row.intermediaryId || this.ids[0];
|
||||
getIntermediary(intermediaryId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改中介黑名单";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
if (this.form.intermediaryId != null) {
|
||||
// 修改模式:根据中介类型调用不同的接口
|
||||
if (this.form.intermediaryType === '1') {
|
||||
// 个人中介
|
||||
updatePersonIntermediary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else if (this.form.intermediaryType === '2') {
|
||||
// 机构中介
|
||||
updateEntityIntermediary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// 新增模式:根据中介类型调用不同的接口
|
||||
if (this.form.intermediaryType === '1') {
|
||||
// 个人中介
|
||||
addPersonIntermediary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else if (this.form.intermediaryType === '2') {
|
||||
// 机构中介
|
||||
addEntityIntermediary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const intermediaryIds = row.intermediaryId || this.ids;
|
||||
this.$modal.confirm('是否确认删除中介黑名单编号为"' + intermediaryIds + '"的数据项?').then(function() {
|
||||
return delIntermediary(intermediaryIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = "中介黑名单数据导入";
|
||||
this.upload.open = true;
|
||||
},
|
||||
/** 导入对话框关闭处理 */
|
||||
handleImportDialogClose() {
|
||||
// 子组件已处理文件清理
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user