feat信贷客户家庭关系
This commit is contained in:
46
ruoyi-ui/src/components/EnumTag/index.vue
Normal file
46
ruoyi-ui/src/components/EnumTag/index.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<span v-if="displayLabel">{{ displayLabel }}</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'EnumTag',
|
||||
props: {
|
||||
// 枚举类型:relationType | certType
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
// 枚举值
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('ccdiEnum', ['relationTypeOptions', 'certTypeOptions']),
|
||||
|
||||
// 获取对应的选项列表
|
||||
options() {
|
||||
switch (this.type) {
|
||||
case 'relationType':
|
||||
return this.relationTypeOptions
|
||||
case 'certType':
|
||||
return this.certTypeOptions
|
||||
default:
|
||||
return []
|
||||
}
|
||||
},
|
||||
|
||||
// 查找对应的显示标签
|
||||
displayLabel() {
|
||||
if (!this.value) return ''
|
||||
const option = this.options.find(item => item.value === this.value)
|
||||
return option ? option.label : this.value
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -6,6 +6,7 @@ import user from './modules/user'
|
||||
import tagsView from './modules/tagsView'
|
||||
import permission from './modules/permission'
|
||||
import settings from './modules/settings'
|
||||
import ccdiEnum from './modules/ccdiEnum'
|
||||
import getters from './getters'
|
||||
|
||||
Vue.use(Vuex)
|
||||
@@ -17,7 +18,8 @@ const store = new Vuex.Store({
|
||||
user,
|
||||
tagsView,
|
||||
permission,
|
||||
settings
|
||||
settings,
|
||||
ccdiEnum
|
||||
},
|
||||
getters
|
||||
})
|
||||
|
||||
85
ruoyi-ui/src/store/modules/ccdiEnum.js
Normal file
85
ruoyi-ui/src/store/modules/ccdiEnum.js
Normal file
@@ -0,0 +1,85 @@
|
||||
import {getCertTypeOptions, getRelationTypeOptions} from '@/api/ccdiEnum'
|
||||
|
||||
const ccdiEnum = {
|
||||
namespaced: true,
|
||||
|
||||
state: {
|
||||
// 关系类型选项
|
||||
relationTypeOptions: [],
|
||||
relationTypeLoadedTime: null,
|
||||
|
||||
// 证件类型选项
|
||||
certTypeOptions: [],
|
||||
certTypeLoadedTime: null,
|
||||
|
||||
// 缓存过期时间(毫秒)- 默认1小时
|
||||
cacheExpireTime: 60 * 60 * 1000
|
||||
},
|
||||
|
||||
mutations: {
|
||||
SET_RELATION_TYPE_OPTIONS: (state, options) => {
|
||||
state.relationTypeOptions = options
|
||||
state.relationTypeLoadedTime = Date.now()
|
||||
},
|
||||
SET_CERT_TYPE_OPTIONS: (state, options) => {
|
||||
state.certTypeOptions = options
|
||||
state.certTypeLoadedTime = Date.now()
|
||||
},
|
||||
CLEAR_CACHE: (state) => {
|
||||
state.relationTypeOptions = []
|
||||
state.relationTypeLoadedTime = null
|
||||
state.certTypeOptions = []
|
||||
state.certTypeLoadedTime = null
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
/**
|
||||
* 获取关系类型选项(带缓存检查)
|
||||
*/
|
||||
async getRelationTypeOptions({ commit, state }) {
|
||||
// 检查缓存是否有效
|
||||
if (state.relationTypeOptions.length > 0 &&
|
||||
state.relationTypeLoadedTime &&
|
||||
Date.now() - state.relationTypeLoadedTime < state.cacheExpireTime) {
|
||||
return state.relationTypeOptions
|
||||
}
|
||||
|
||||
// 调用接口获取数据
|
||||
const response = await getRelationTypeOptions()
|
||||
commit('SET_RELATION_TYPE_OPTIONS', response.data)
|
||||
return response.data
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取证件类型选项(带缓存检查)
|
||||
*/
|
||||
async getCertTypeOptions({ commit, state }) {
|
||||
// 检查缓存是否有效
|
||||
if (state.certTypeOptions.length > 0 &&
|
||||
state.certTypeLoadedTime &&
|
||||
Date.now() - state.certTypeLoadedTime < state.cacheExpireTime) {
|
||||
return state.certTypeOptions
|
||||
}
|
||||
|
||||
// 调用接口获取数据
|
||||
const response = await getCertTypeOptions()
|
||||
commit('SET_CERT_TYPE_OPTIONS', response.data)
|
||||
return response.data
|
||||
},
|
||||
|
||||
/**
|
||||
* 清除缓存
|
||||
*/
|
||||
clearCache({ commit }) {
|
||||
commit('CLEAR_CACHE')
|
||||
}
|
||||
},
|
||||
|
||||
getters: {
|
||||
relationTypeOptions: state => state.relationTypeOptions,
|
||||
certTypeOptions: state => state.certTypeOptions
|
||||
}
|
||||
}
|
||||
|
||||
export default ccdiEnum
|
||||
@@ -13,10 +13,10 @@
|
||||
<el-form-item label="关系类型" prop="relationType">
|
||||
<el-select v-model="queryParams.relationType" placeholder="请选择关系类型" clearable style="width: 240px">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ccdi_relation_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="item in relationTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -94,7 +94,7 @@
|
||||
<el-table-column label="信贷客户身份证号" align="center" prop="personId" width="180"/>
|
||||
<el-table-column label="关系类型" align="center" prop="relationType" width="100">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ccdi_relation_type" :value="scope.row.relationType"/>
|
||||
<enum-tag type="relationType" :value="scope.row.relationType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="关系人姓名" align="center" prop="relationName" :show-overflow-tooltip="true"/>
|
||||
@@ -170,10 +170,10 @@
|
||||
<el-form-item label="关系类型" prop="relationType">
|
||||
<el-select v-model="form.relationType" placeholder="请选择关系类型" style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ccdi_relation_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="item in relationTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -203,10 +203,10 @@
|
||||
<el-form-item label="关系人证件类型" prop="relationCertType">
|
||||
<el-select v-model="form.relationCertType" placeholder="请选择证件类型" style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ccdi_certificate_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="item in certTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -319,13 +319,15 @@
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="信贷客户身份证号">{{ relationDetail.personId || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="关系类型">
|
||||
<dict-tag :options="dict.type.ccdi_relation_type" :value="relationDetail.relationType"/>
|
||||
<enum-tag type="relationType" :value="relationDetail.relationType"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="关系人姓名">{{ relationDetail.relationName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">
|
||||
<dict-tag :options="dict.type.ccdi_indiv_gender" :value="relationDetail.gender"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="关系人证件类型">{{ relationDetail.relationCertType || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="关系人证件类型">
|
||||
<enum-tag type="certType" :value="relationDetail.relationCertType"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="关系人证件号码" :span="2">{{ relationDetail.relationCertNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="出生日期">{{ relationDetail.birthDate || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="手机号码1">{{ relationDetail.mobilePhone1 || '-' }}</el-descriptions-item>
|
||||
@@ -438,26 +440,30 @@
|
||||
|
||||
<script>
|
||||
import {
|
||||
listRelation,
|
||||
getRelation,
|
||||
addRelation,
|
||||
updateRelation,
|
||||
delRelation,
|
||||
exportRelation,
|
||||
importTemplate,
|
||||
importData,
|
||||
getImportFailures,
|
||||
getImportStatus,
|
||||
getImportFailures
|
||||
getRelation,
|
||||
listRelation,
|
||||
updateRelation
|
||||
} from "@/api/ccdiCustFmyRelation";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import {getToken} from "@/utils/auth";
|
||||
import EnumTag from '@/components/EnumTag'
|
||||
|
||||
const STORAGE_KEY = 'cust_fmy_relation_import_last_task';
|
||||
|
||||
export default {
|
||||
name: "CustFmyRelation",
|
||||
dicts: ['ccdi_relation_type', 'ccdi_indiv_gender', 'ccdi_certificate_type'],
|
||||
dicts: ['ccdi_indiv_gender'],
|
||||
components: {
|
||||
EnumTag
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 枚举选项
|
||||
relationTypeOptions: [],
|
||||
certTypeOptions: [],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
@@ -593,6 +599,7 @@ export default {
|
||||
created() {
|
||||
this.getList();
|
||||
this.restoreImportState();
|
||||
this.loadEnumOptions();
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.importPollingTimer) {
|
||||
@@ -601,6 +608,17 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 加载枚举选项
|
||||
*/
|
||||
async loadEnumOptions() {
|
||||
try {
|
||||
this.relationTypeOptions = await this.$store.dispatch('ccdiEnum/getRelationTypeOptions')
|
||||
this.certTypeOptions = await this.$store.dispatch('ccdiEnum/getCertTypeOptions')
|
||||
} catch (error) {
|
||||
console.error('加载枚举选项失败:', error)
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 校验证件号码
|
||||
* 根据证件类型进行不同的校验
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
<el-form-item label="关系类型" prop="relationType">
|
||||
<el-select v-model="queryParams.relationType" placeholder="请选择关系类型" clearable style="width: 240px">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ccdi_relation_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="item in relationTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -95,7 +95,7 @@
|
||||
<el-table-column label="员工身份证号" align="center" prop="personId" width="180"/>
|
||||
<el-table-column label="关系类型" align="center" prop="relationType" width="100">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ccdi_relation_type" :value="scope.row.relationType"/>
|
||||
<enum-tag type="relationType" :value="scope.row.relationType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="关系人姓名" align="center" prop="relationName" :show-overflow-tooltip="true"/>
|
||||
@@ -187,10 +187,10 @@
|
||||
<el-form-item label="关系类型" prop="relationType">
|
||||
<el-select v-model="form.relationType" placeholder="请选择关系类型" style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ccdi_relation_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="item in relationTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -220,10 +220,10 @@
|
||||
<el-form-item label="关系人证件类型" prop="relationCertType">
|
||||
<el-select v-model="form.relationCertType" placeholder="请选择证件类型" style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in dict.type.ccdi_certificate_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="item in certTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -337,13 +337,15 @@
|
||||
<el-descriptions-item label="员工姓名">{{ relationDetail.personName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="员工身份证号">{{ relationDetail.personId || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="关系类型">
|
||||
<dict-tag :options="dict.type.ccdi_relation_type" :value="relationDetail.relationType"/>
|
||||
<enum-tag type="relationType" :value="relationDetail.relationType"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="关系人姓名">{{ relationDetail.relationName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">
|
||||
<dict-tag :options="dict.type.ccdi_indiv_gender" :value="relationDetail.gender"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="关系人证件类型">{{ relationDetail.relationCertType || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="关系人证件类型">
|
||||
<enum-tag type="certType" :value="relationDetail.relationCertType"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="关系人证件号码" :span="2">{{ relationDetail.relationCertNo || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="出生日期">{{ relationDetail.birthDate || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="手机号码1">{{ relationDetail.mobilePhone1 || '-' }}</el-descriptions-item>
|
||||
@@ -466,12 +468,19 @@ import {
|
||||
} from "@/api/ccdiStaffFmyRelation";
|
||||
import {listBaseStaff} from "@/api/ccdiBaseStaff";
|
||||
import {getToken} from "@/utils/auth";
|
||||
import EnumTag from '@/components/EnumTag'
|
||||
|
||||
export default {
|
||||
name: "StaffFmyRelation",
|
||||
dicts: ['ccdi_relation_type', 'ccdi_indiv_gender', 'ccdi_certificate_type'],
|
||||
dicts: ['ccdi_indiv_gender'],
|
||||
components: {
|
||||
EnumTag
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 枚举选项
|
||||
relationTypeOptions: [],
|
||||
certTypeOptions: [],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
@@ -580,6 +589,7 @@ export default {
|
||||
created() {
|
||||
this.getList();
|
||||
this.restoreImportState();
|
||||
this.loadEnumOptions();
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.importPollingTimer) {
|
||||
@@ -588,6 +598,17 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 加载枚举选项
|
||||
*/
|
||||
async loadEnumOptions() {
|
||||
try {
|
||||
this.relationTypeOptions = await this.$store.dispatch('ccdiEnum/getRelationTypeOptions')
|
||||
this.certTypeOptions = await this.$store.dispatch('ccdiEnum/getCertTypeOptions')
|
||||
} catch (error) {
|
||||
console.error('加载枚举选项失败:', error)
|
||||
}
|
||||
},
|
||||
/** 查询员工亲属关系列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
||||
Reference in New Issue
Block a user