中介新增 修改接口
This commit is contained in:
101
ruoyi-ui/src/api/dpcEnum.js
Normal file
101
ruoyi-ui/src/api/dpcEnum.js
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 查询人员类型选项
|
||||
*/
|
||||
export function getIndivTypeOptions() {
|
||||
return request({
|
||||
url: '/dpc/enum/indivType',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询人员子类型选项
|
||||
*/
|
||||
export function getIndivSubTypeOptions() {
|
||||
return request({
|
||||
url: '/dpc/enum/indivSubType',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询性别选项
|
||||
*/
|
||||
export function getGenderOptions() {
|
||||
return request({
|
||||
url: '/dpc/enum/gender',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询证件类型选项
|
||||
*/
|
||||
export function getCertTypeOptions() {
|
||||
return request({
|
||||
url: '/dpc/enum/certType',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询关联关系选项
|
||||
*/
|
||||
export function getRelationTypeOptions() {
|
||||
return request({
|
||||
url: '/dpc/enum/relationType',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询主体类型选项
|
||||
*/
|
||||
export function getCorpTypeOptions() {
|
||||
return request({
|
||||
url: '/dpc/enum/corpType',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询企业性质选项
|
||||
*/
|
||||
export function getCorpNatureOptions() {
|
||||
return request({
|
||||
url: '/dpc/enum/corpNature',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询中介类型选项
|
||||
*/
|
||||
export function getIntermediaryTypeOptions() {
|
||||
return request({
|
||||
url: '/dpc/enum/intermediaryType',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询中介状态选项
|
||||
*/
|
||||
export function getIntermediaryStatusOptions() {
|
||||
return request({
|
||||
url: '/dpc/enum/intermediaryStatus',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数据来源选项
|
||||
*/
|
||||
export function getDataSourceOptions() {
|
||||
return request({
|
||||
url: '/dpc/enum/dataSource',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -26,6 +26,24 @@ export function addIntermediary(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 新增个人中介黑名单
|
||||
export function addPersonIntermediary(data) {
|
||||
return request({
|
||||
url: '/dpc/intermediary/person',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增机构中介黑名单
|
||||
export function addEntityIntermediary(data) {
|
||||
return request({
|
||||
url: '/dpc/intermediary/entity',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改中介黑名单
|
||||
export function updateIntermediary(data) {
|
||||
return request({
|
||||
@@ -35,6 +53,24 @@ export function updateIntermediary(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 修改个人中介黑名单
|
||||
export function updatePersonIntermediary(data) {
|
||||
return request({
|
||||
url: '/dpc/intermediary/person',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改机构中介黑名单
|
||||
export function updateEntityIntermediary(data) {
|
||||
return request({
|
||||
url: '/dpc/intermediary/entity',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除中介黑名单
|
||||
export function delIntermediary(intermediaryIds) {
|
||||
return request({
|
||||
@@ -43,16 +79,7 @@ export function delIntermediary(intermediaryIds) {
|
||||
})
|
||||
}
|
||||
|
||||
// 导出中介黑名单
|
||||
export function exportIntermediary(query) {
|
||||
return request({
|
||||
url: '/dpc/intermediary/export',
|
||||
method: 'post',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 下载导入模板
|
||||
// 下载导入模板(已废弃,保留以兼容旧代码)
|
||||
export function importTemplate() {
|
||||
return request({
|
||||
url: '/dpc/intermediary/importTemplate',
|
||||
@@ -68,3 +95,37 @@ export function importData(data, updateSupport) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 下载个人中介导入模板
|
||||
export function importPersonTemplate() {
|
||||
return request({
|
||||
url: '/dpc/intermediary/importPersonTemplate',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 下载机构中介导入模板
|
||||
export function importEntityTemplate() {
|
||||
return request({
|
||||
url: '/dpc/intermediary/importEntityTemplate',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 导入个人中介黑名单
|
||||
export function importPersonData(data, updateSupport) {
|
||||
return request({
|
||||
url: '/dpc/intermediary/importPersonData?updateSupport=' + updateSupport,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 导入机构中介黑名单
|
||||
export function importEntityData(data, updateSupport) {
|
||||
return request({
|
||||
url: '/dpc/intermediary/importEntityData?updateSupport=' + updateSupport,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
82
ruoyi-ui/src/views/dpcIntermediary/components/DataTable.vue
Normal file
82
ruoyi-ui/src/views/dpcIntermediary/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="['dpc:intermediary:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="$emit('delete', scope.row)"
|
||||
v-hasPermi="['dpc: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/dpcIntermediary/components/EditDialog.vue
Normal file
639
ruoyi-ui/src/views/dpcIntermediary/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/dpcIntermediary/components/ImportDialog.vue
Normal file
303
ruoyi-ui/src/views/dpcIntermediary/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}/dpc/intermediary/importPersonData?updateSupport=${updateSupport}`;
|
||||
} else {
|
||||
return `${baseUrl}/dpc/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>
|
||||
65
ruoyi-ui/src/views/dpcIntermediary/components/SearchForm.vue
Normal file
65
ruoyi-ui/src/views/dpcIntermediary/components/SearchForm.vue
Normal file
@@ -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>
|
||||
@@ -1,44 +1,13 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<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>
|
||||
<!-- 搜索表单 -->
|
||||
<search-form
|
||||
:query-params="queryParams"
|
||||
:show-search="showSearch"
|
||||
@query="handleQuery"
|
||||
/>
|
||||
|
||||
<!-- 工具栏 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@@ -60,160 +29,101 @@
|
||||
v-hasPermi="['dpc:intermediary:import']"
|
||||
>导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['dpc:intermediary:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="intermediaryList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="中介ID" align="center" prop="intermediaryId" width="80"/>
|
||||
<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="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['dpc:intermediary:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['dpc:intermediary:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
<!-- 数据表格 -->
|
||||
<data-table
|
||||
:loading="loading"
|
||||
:data-list="intermediaryList"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:page-params="queryParams"
|
||||
@selection-change="handleSelectionChange"
|
||||
@pagination="getList"
|
||||
@detail="handleDetail"
|
||||
@update="handleUpdate"
|
||||
@delete="handleDelete"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="姓名/机构名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名/机构名称" maxlength="100"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="证件号" prop="certificateNo">
|
||||
<el-input v-model="form.certificateNo" placeholder="请输入证件号" maxlength="50"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="中介类型" prop="intermediaryType">
|
||||
<el-radio-group v-model="form.intermediaryType">
|
||||
<el-radio label="1">个人</el-radio>
|
||||
<el-radio label="2">机构</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio label="0">正常</el-radio>
|
||||
<el-radio label="1">停用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" maxlength="500"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 编辑对话框 -->
|
||||
<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"
|
||||
/>
|
||||
|
||||
<!-- 导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
accept=".xlsx, .xls"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
: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">
|
||||
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的中介黑名单数据
|
||||
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
<span>仅允许导入"xls"或"xlsx"格式文件。</span>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<import-dialog
|
||||
:visible.sync="upload.open"
|
||||
:title="upload.title"
|
||||
@close="handleImportDialogClose"
|
||||
@success="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addIntermediary,
|
||||
addEntityIntermediary,
|
||||
addPersonIntermediary,
|
||||
delIntermediary,
|
||||
getIntermediary,
|
||||
listIntermediary,
|
||||
updateIntermediary
|
||||
updateEntityIntermediary,
|
||||
updatePersonIntermediary
|
||||
} from "@/api/dpcIntermediary";
|
||||
import {getToken} from "@/utils/auth";
|
||||
import {
|
||||
getCertTypeOptions,
|
||||
getCorpNatureOptions,
|
||||
getCorpTypeOptions,
|
||||
getGenderOptions,
|
||||
getIndivSubTypeOptions,
|
||||
getIndivTypeOptions,
|
||||
getRelationTypeOptions
|
||||
} from "@/api/dpcEnum";
|
||||
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,
|
||||
@@ -222,48 +132,49 @@ export default {
|
||||
intermediaryType: null,
|
||||
status: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: "姓名/机构名称不能为空", trigger: "blur" },
|
||||
{ max: 100, message: "姓名/机构名称长度不能超过100个字符", trigger: "blur" }
|
||||
],
|
||||
certificateNo: [
|
||||
{ max: 50, message: "证件号长度不能超过50个字符", trigger: "blur" }
|
||||
],
|
||||
intermediaryType: [
|
||||
{ required: true, message: "请选择中介类型", trigger: "change" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "请选择状态", trigger: "change" }
|
||||
],
|
||||
remark: [
|
||||
{ max: 500, message: "备注长度不能超过500个字符", trigger: "blur" }
|
||||
]
|
||||
},
|
||||
// 导入参数
|
||||
upload: {
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/dpc/intermediary/importData"
|
||||
}
|
||||
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;
|
||||
@@ -273,33 +184,11 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
intermediaryId: null,
|
||||
name: null,
|
||||
certificateNo: null,
|
||||
intermediaryType: "1",
|
||||
status: "0",
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 多选框选中数据 */
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.intermediaryId);
|
||||
@@ -312,6 +201,58 @@ export default {
|
||||
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();
|
||||
@@ -324,23 +265,41 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.intermediaryId != null) {
|
||||
updateIntermediary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addIntermediary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
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) {
|
||||
@@ -352,35 +311,14 @@ export default {
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('dpc/intermediary/export', {
|
||||
...this.queryParams
|
||||
}, `中介黑名单_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = "中介黑名单数据导入";
|
||||
this.upload.open = true;
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download('dpc/intermediary/importTemplate', {}, `中介黑名单模板_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.isUploading = false;
|
||||
this.upload.open = false;
|
||||
this.getList();
|
||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果");
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
/** 导入对话框关闭处理 */
|
||||
handleImportDialogClose() {
|
||||
// 子组件已处理文件清理
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
205
ruoyi-ui/src/views/dpcIntermediary/test_edit_dialog_fix.html
Normal file
205
ruoyi-ui/src/views/dpcIntermediary/test_edit_dialog_fix.html
Normal file
@@ -0,0 +1,205 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>中介黑名单编辑对话框修复测试</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
padding: 20px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.test-container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
padding: 30px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
h1 {
|
||||
color: #303133;
|
||||
border-bottom: 2px solid #409eff;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
h2 {
|
||||
color: #606266;
|
||||
margin-top: 30px;
|
||||
}
|
||||
.test-case {
|
||||
background: #f9f9f9;
|
||||
padding: 15px;
|
||||
margin: 15px 0;
|
||||
border-left: 4px solid #409eff;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.test-case.success {
|
||||
border-left-color: #67c23a;
|
||||
}
|
||||
.test-case.error {
|
||||
border-left-color: #f56c6c;
|
||||
}
|
||||
.code {
|
||||
background: #282c34;
|
||||
color: #abb2bf;
|
||||
padding: 15px;
|
||||
border-radius: 4px;
|
||||
overflow-x: auto;
|
||||
font-family: 'Courier New', monospace;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.fix-description {
|
||||
background: #ecf5ff;
|
||||
padding: 20px;
|
||||
border-left: 4px solid #409eff;
|
||||
border-radius: 4px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.fix-description h3 {
|
||||
color: #409eff;
|
||||
margin-top: 0;
|
||||
}
|
||||
ul {
|
||||
line-height: 1.8;
|
||||
}
|
||||
.status-badge {
|
||||
display: inline-block;
|
||||
padding: 4px 12px;
|
||||
border-radius: 12px;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.status-badge.fixed {
|
||||
background: #67c23a;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="test-container">
|
||||
<h1>中介黑名单编辑对话框修复测试报告 <span class="status-badge fixed">已修复</span></h1>
|
||||
|
||||
<div class="fix-description">
|
||||
<h3>问题描述</h3>
|
||||
<p>在中介黑名单列表中点击修改按钮时,该行的信息没有正确反显到输入框内。</p>
|
||||
|
||||
<h3>根本原因</h3>
|
||||
<ul>
|
||||
<li><strong>时序问题</strong>:当 <code>visible</code> 从 false 变为 true 时,触发 <code>initDialogState()</code>,但此时 <code>form</code> 数据可能还没有完全传递到子组件</li>
|
||||
<li><strong>缺少监听</strong>:没有监听 <code>form.intermediaryType</code> 的变化,导致数据加载后无法更新 <code>selectedType</code></li>
|
||||
<li><strong>判断不完整</strong>:在 <code>initDialogState()</code> 中直接使用 <code>this.form.intermediaryType</code> 而没有检查是否存在</li>
|
||||
</ul>
|
||||
|
||||
<h3>修复方案</h3>
|
||||
<ul>
|
||||
<li>添加对 <code>form.intermediaryType</code> 的 watch 监听</li>
|
||||
<li>在 <code>initDialogState()</code> 中添加存在性检查</li>
|
||||
<li>确保修改模式下正确设置 <code>selectedType</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h2>修复内容</h2>
|
||||
|
||||
<div class="test-case success">
|
||||
<h3>1. 添加 form.intermediaryType 监听器</h3>
|
||||
<p><strong>文件:</strong> ruoyi-ui/src/views/dpcIntermediary/components/EditDialog.vue</p>
|
||||
<div class="code">
|
||||
watch: {
|
||||
// 原有的 visible 和 form.intermediaryId 监听...
|
||||
|
||||
// 新增:监听 form.intermediaryType 变化
|
||||
'form.intermediaryType': {
|
||||
handler(newVal) {
|
||||
if (!this.isAddMode && newVal) {
|
||||
// 修改模式下,类型加载后设置 selectedType
|
||||
this.selectedType = newVal;
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="test-case success">
|
||||
<h3>2. 改进 initDialogState 方法</h3>
|
||||
<p><strong>文件:</strong> ruoyi-ui/src/views/dpcIntermediary/components/EditDialog.vue</p>
|
||||
<div class="code">
|
||||
initDialogState() {
|
||||
if (this.isAddMode) {
|
||||
// 新增模式:重置选择状态
|
||||
this.selectedType = null;
|
||||
this.tempSelectedType = null;
|
||||
this.shouldAnimate = false;
|
||||
this.form.intermediaryType = '1';
|
||||
} else {
|
||||
// 修改模式:设置已选择的类型(添加存在性检查)
|
||||
if (this.form.intermediaryType) {
|
||||
this.selectedType = this.form.intermediaryType;
|
||||
}
|
||||
this.shouldAnimate = false;
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>测试场景</h2>
|
||||
|
||||
<div class="test-case">
|
||||
<h3>场景 1:修改个人中介信息</h3>
|
||||
<p><strong>步骤:</strong></p>
|
||||
<ol>
|
||||
<li>打开中介黑名单列表页面</li>
|
||||
<li>找到一条个人类型的记录(intermediaryType = '1')</li>
|
||||
<li>点击"修改"按钮</li>
|
||||
<li>验证:对话框应直接显示个人信息表单</li>
|
||||
<li>验证:姓名、证件号等字段应正确反显</li>
|
||||
</ol>
|
||||
<p><strong>预期结果:</strong> ✅ 个人信息表单正确显示,所有字段数据正确反显</p>
|
||||
</div>
|
||||
|
||||
<div class="test-case">
|
||||
<h3>场景 2:修改机构中介信息</h3>
|
||||
<p><strong>步骤:</strong></p>
|
||||
<ol>
|
||||
<li>打开中介黑名单列表页面</li>
|
||||
<li>找到一条机构类型的记录(intermediaryType = '2')</li>
|
||||
<li>点击"修改"按钮</li>
|
||||
<li>验证:对话框应直接显示机构信息表单</li>
|
||||
<li>验证:机构名称、统一社会信用代码等字段应正确反显</li>
|
||||
</ol>
|
||||
<p><strong>预期结果:</strong> ✅ 机构信息表单正确显示,所有字段数据正确反显</p>
|
||||
</div>
|
||||
|
||||
<div class="test-case">
|
||||
<h3>场景 3:新增中介信息</h3>
|
||||
<p><strong>步骤:</strong></p>
|
||||
<ol>
|
||||
<li>打开中介黑名单列表页面</li>
|
||||
<li>点击"新增"按钮</li>
|
||||
<li>验证:对话框应显示类型选择卡片(个人/机构)</li>
|
||||
<li>选择类型后,显示对应表单</li>
|
||||
</ol>
|
||||
<p><strong>预期结果:</strong> ✅ 类型选择卡片正确显示,选择后表单正常显示</p>
|
||||
</div>
|
||||
|
||||
<h2>验证要点</h2>
|
||||
<ul>
|
||||
<li>✅ 修改模式下,不需要选择类型,直接显示对应表单</li>
|
||||
<li>✅ 表单字段数据正确反显</li>
|
||||
<li>✅ 新增模式下,类型选择卡片正常显示</li>
|
||||
<li>✅ 新增和修改模式切换正常</li>
|
||||
<li>✅ 枚举字段(下拉框)正确显示选中值</li>
|
||||
</ul>
|
||||
|
||||
<h2>相关文件</h2>
|
||||
<ul>
|
||||
<li><strong>修改文件:</strong> ruoyi-ui/src/views/dpcIntermediary/components/EditDialog.vue</li>
|
||||
<li><strong>关联文件:</strong> ruoyi-ui/src/views/dpcIntermediary/index.vue</li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user