You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
590 lines
15 KiB
590 lines
15 KiB
import { FormSchema } from '/@/components/Table'
|
|
import { ref } from 'vue'
|
|
import dayjs, { Dayjs } from 'dayjs'
|
|
import { genderList, channelList, clueStatusList, followStatusList, validStatusList } from '/@/enums/customerEnum'
|
|
import { useAddressData } from '/@/hooks/common'
|
|
import {
|
|
getIncomeList,
|
|
getNationList,
|
|
getEducationList,
|
|
getFamilyTiesList,
|
|
getOccupationList,
|
|
getBodilyFormList,
|
|
getPropertyPermits,
|
|
getAccountTypeList,
|
|
getIdentityTypeList,
|
|
getMaritalStatusList,
|
|
getConstellationList,
|
|
getCarPurchaseSituation,
|
|
} from '/@/api/essentialData'
|
|
|
|
// 基础信息的额外数据
|
|
export const basicInfoData = ref<any>({})
|
|
// 获取地区数据
|
|
const { addressList, domicilePlaceList } = useAddressData()
|
|
|
|
// 获取职业列表
|
|
export const occupationList = ref<any>([])
|
|
getOccupationList().then((res) => {
|
|
handleOccupationList(res)
|
|
occupationList.value = res || []
|
|
})
|
|
function handleOccupationList(data: any, ifFirst = true) {
|
|
data?.forEach?.((item: any) => {
|
|
const { industry, industryCode, occupation, occupationCode, occupationList } = item
|
|
item.label = ifFirst ? industry : occupation
|
|
item.value = ifFirst ? industryCode : occupationCode
|
|
if (occupationList?.length) {
|
|
item.children = occupationList
|
|
handleOccupationList(occupationList, false)
|
|
}
|
|
})
|
|
}
|
|
|
|
export const addressName = ref<string[]>([])
|
|
// 基本信息
|
|
export const modalFormSchema: FormSchema[] = [
|
|
{
|
|
field: 'genderCode',
|
|
label: '性别',
|
|
colProps: { span: 8 },
|
|
component: 'Select',
|
|
required: true,
|
|
componentProps: ({ formModel }) => {
|
|
return {
|
|
options: genderList,
|
|
disabled: !!formModel.name && formModel.name !== -1,
|
|
onChange: (_: any, v: any) => {
|
|
basicInfoData.value.genderValue = v?.label
|
|
},
|
|
}
|
|
},
|
|
},
|
|
{
|
|
field: 'birthYear',
|
|
label: '出生年份',
|
|
component: 'InputNumber',
|
|
colProps: { span: 8 },
|
|
componentProps: {
|
|
min: 1920,
|
|
max: 2007
|
|
}
|
|
},
|
|
{ field: 'nickName', label: '昵称', component: 'Input', colProps: { span: 8 },},
|
|
{ field: 'phone', label: '电话号码', component: 'Input', colProps: { span: 8 },},
|
|
{ field: 'weChatId', label: '微信号', component: 'Input', colProps: { span: 8 }, },
|
|
{ field: 'height', label: '身高(cm)', component: 'InputNumber', colProps: { span: 8 }, },
|
|
{ field: 'weight', label: '体重(kg)', component: 'InputNumber', colProps: { span: 8 }, },
|
|
// {
|
|
// field: 'birthDate',
|
|
// label: '出生日期',
|
|
// colProps: { span: 8 },
|
|
// component: 'DatePicker',
|
|
// defaultValue: moment('2001-06-05').format('YYYY-MM-DD 00:00:00'),
|
|
// componentProps: ({ formModel }) => {
|
|
// return {
|
|
// style: { width: '100%' },
|
|
// disabledDate: (current: Dayjs) => {
|
|
// const date: Dayjs = dayjs().subtract(18, 'year')
|
|
// return current && current > date.endOf('year')
|
|
// },
|
|
// }
|
|
// },
|
|
// },
|
|
{
|
|
label: '线索时间',
|
|
colProps: { span: 8 },
|
|
component: 'DatePicker',
|
|
field: 'clueTime',
|
|
componentProps: {
|
|
// showTime: true,
|
|
style: { width: '100%' },
|
|
// mode: 'year'
|
|
},
|
|
},
|
|
|
|
{
|
|
field: 'educationCode',
|
|
label: '学历',
|
|
colProps: { span: 8 },
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
labelField: 'desc',
|
|
api: getEducationList,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
basicInfoData.value.education = v?.label
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'incomeCode',
|
|
label: '月收入',
|
|
colProps: { span: 8 },
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
labelField: 'desc',
|
|
api: getIncomeList,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
basicInfoData.value.income = v?.label
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'maritalStatusCode',
|
|
label: '婚姻状况',
|
|
colProps: { span: 8 },
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
labelField: 'desc',
|
|
api: getMaritalStatusList,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
basicInfoData.value.maritalStatusName = v?.label
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'address',
|
|
label: '现居住地',
|
|
colProps: { span: 8 },
|
|
component: 'Cascader',
|
|
componentProps: {
|
|
options: addressList,
|
|
onChange: (_: any, v: any) => {
|
|
basicInfoData.value.provinceName = v?.[0]?.label
|
|
basicInfoData.value.cityName = v?.[1]?.label
|
|
basicInfoData.value.districtName = v?.[2]?.label
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'domicilePlace',
|
|
label: '户口所在地',
|
|
colProps: { span: 8 },
|
|
component: 'Cascader',
|
|
componentProps: () => {
|
|
return {
|
|
options: domicilePlaceList.value,
|
|
onChange: (_: any, v: any) => {
|
|
basicInfoData.value.domicilePlaceProvinceName = v?.[0]?.label
|
|
basicInfoData.value.domicilePlaceCityName = v?.[1]?.label
|
|
},
|
|
}
|
|
},
|
|
},
|
|
{
|
|
field: 'hometown',
|
|
label: '家乡',
|
|
colProps: { span: 8 },
|
|
component: 'Cascader',
|
|
componentProps: () => {
|
|
return {
|
|
options: domicilePlaceList.value,
|
|
onChange: (_: any, v: any) => {
|
|
basicInfoData.value.hometownProvinceName = v?.[0]?.label
|
|
basicInfoData.value.hometownCityName = v?.[1]?.label
|
|
},
|
|
}
|
|
},
|
|
},
|
|
{ field: 'childrenNum', label: '孩子数量', component: 'InputNumber', colProps: { span: 8 }, },
|
|
{
|
|
field: 'nationCode',
|
|
label: '民族',
|
|
colProps: { span: 8 },
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
labelField: 'cn',
|
|
valueField: 'id',
|
|
api: getNationList,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
basicInfoData.value.nation = v?.label
|
|
},
|
|
},
|
|
},
|
|
// {
|
|
// field: 'bodilyFormCode',
|
|
// label: '体型',
|
|
// colProps: { span: 8 },
|
|
// component: 'ApiSelect',
|
|
// componentProps: {
|
|
// labelField: 'desc',
|
|
// api: getBodilyFormList,
|
|
// getPopupContainer: () => document.body,
|
|
// onChange: (_: any, v: any) => {
|
|
// basicInfoData.value.bodilyForm = v?.label
|
|
// },
|
|
// },
|
|
// },
|
|
// {
|
|
// field: 'accountTypeCode',
|
|
// label: '户口',
|
|
// colProps: { span: 8 },
|
|
// component: 'ApiSelect',
|
|
// componentProps: {
|
|
// labelField: 'desc',
|
|
// api: getAccountTypeList,
|
|
// getPopupContainer: () => document.body,
|
|
// onChange: (_: any, v: any) => {
|
|
// basicInfoData.value.accountTypeName = v?.label
|
|
// },
|
|
// },
|
|
// },
|
|
// {
|
|
// field: 'nativePlaceCode',
|
|
// label: '籍贯',
|
|
// colProps: { span: 8 },
|
|
// component: 'Select',
|
|
// componentProps: {
|
|
// options: domicilePlaceList,
|
|
// getPopupContainer: () => document.body,
|
|
// onChange: (_: any, v: any) => {
|
|
// basicInfoData.value.nativePlaceName = v?.label
|
|
// },
|
|
// },
|
|
// },
|
|
{
|
|
label: '职业',
|
|
field: 'occupationList',
|
|
colProps: { span: 8 },
|
|
component: 'Cascader',
|
|
componentProps: {
|
|
options: occupationList,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
const industry = v?.[0] || {}
|
|
const occupation = v?.[1] || {}
|
|
basicInfoData.value.industry = industry.label
|
|
basicInfoData.value.industryCode = industry.value
|
|
basicInfoData.value.occupation = occupation.label
|
|
basicInfoData.value.occupationCode = occupation.value
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'onlyChild',
|
|
label: '是否独生子女',
|
|
colProps: { span: 8 },
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: [
|
|
{ label: '是', value: 1 },
|
|
{ label: '否', value: 0 },
|
|
],
|
|
},
|
|
},
|
|
{
|
|
field: 'propertyPermitsCode',
|
|
label: '购房情况',
|
|
colProps: { span: 8 },
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
labelField: 'desc',
|
|
api: getPropertyPermits,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
basicInfoData.value.propertyPermits = v?.label
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'carPurchaseSituationCode',
|
|
label: '购车情况',
|
|
colProps: { span: 8 },
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
labelField: 'desc',
|
|
api: getCarPurchaseSituation,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
basicInfoData.value.carPurchaseSituation = v?.label
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'constellationCode',
|
|
label: '星座',
|
|
colProps: { span: 8 },
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
labelField: 'desc',
|
|
api: getConstellationList,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
basicInfoData.value.constellation = v?.label
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'profilePhoto',
|
|
component: 'Upload',
|
|
label: '资料头像',
|
|
colProps: { span: 8 },
|
|
slot: 'profilePhoto',
|
|
},
|
|
{
|
|
field: 'remark',
|
|
label: '个人描述',
|
|
component: 'InputTextArea',
|
|
colProps: { span: 16 },
|
|
componentProps: ({ formModel }) => {
|
|
return {
|
|
autoSize: {
|
|
minRows: 4,
|
|
},
|
|
disabled: formModel?.describeAudit,
|
|
}
|
|
},
|
|
},
|
|
]
|
|
|
|
// 择偶标准的额外数据
|
|
export const demandMarriageMoreData = ref<any>({})
|
|
// 择偶标准
|
|
export const demandMarriageSchema: FormSchema[] = [
|
|
{
|
|
field: 'maritalStatusCode',
|
|
label: '婚姻状况',
|
|
colProps: { span: 8 },
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
labelField: 'desc',
|
|
api: getMaritalStatusList,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
demandMarriageMoreData.value.maritalStatusName = v?.label
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'minAge',
|
|
label: '年龄',
|
|
colProps: { span: 8 },
|
|
component: 'InputNumber',
|
|
slot: 'age',
|
|
},
|
|
{
|
|
field: 'maxAge',
|
|
label: '年龄',
|
|
colProps: { span: 8 },
|
|
component: 'InputNumber',
|
|
ifShow: false,
|
|
},
|
|
{
|
|
field: 'minHeight',
|
|
label: '身高',
|
|
colProps: { span: 8 },
|
|
component: 'InputNumber',
|
|
slot: 'height',
|
|
},
|
|
{
|
|
field: 'maxHeight',
|
|
label: '身高',
|
|
colProps: { span: 8 },
|
|
component: 'InputNumber',
|
|
ifShow: false,
|
|
},
|
|
{
|
|
field: 'educationCode',
|
|
label: '学历',
|
|
colProps: { span: 8 },
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
labelField: 'desc',
|
|
api: getEducationList,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
demandMarriageMoreData.value.education = v?.label
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'minimumIncome',
|
|
label: '月收入',
|
|
colProps: { span: 8 },
|
|
component: 'InputNumber',
|
|
slot: 'income',
|
|
},
|
|
{
|
|
field: 'maximumIncome',
|
|
label: '月收入',
|
|
colProps: { span: 8 },
|
|
component: 'InputNumber',
|
|
ifShow: false,
|
|
},
|
|
{ field: 'childrenNum', label: '孩子数量', component: 'InputNumber', colProps: { span: 8 }, },
|
|
{
|
|
field: 'address',
|
|
label: '现居住地',
|
|
colProps: { span: 8 },
|
|
component: 'Cascader',
|
|
componentProps: {
|
|
options: addressList,
|
|
onChange: (_: any, v: any) => {
|
|
demandMarriageMoreData.value.provinceName = v?.[0]?.label
|
|
demandMarriageMoreData.value.cityName = v?.[1]?.label
|
|
demandMarriageMoreData.value.districtName = v?.[2]?.label
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'domicilePlace',
|
|
label: '户口所在地',
|
|
colProps: { span: 8 },
|
|
component: 'Cascader',
|
|
componentProps: {
|
|
options: domicilePlaceList,
|
|
onChange: (_: any, v: any) => {
|
|
demandMarriageMoreData.value.domicilePlaceProvinceName = v?.[0]?.label
|
|
demandMarriageMoreData.value.domicilePlaceCityName = v?.[1]?.label
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'hometown',
|
|
label: '家乡',
|
|
colProps: { span: 8 },
|
|
component: 'Cascader',
|
|
componentProps: () => {
|
|
return {
|
|
options: domicilePlaceList.value,
|
|
onChange: (_: any, v: any) => {
|
|
demandMarriageMoreData.value.hometownProvinceName = v?.[0]?.label
|
|
demandMarriageMoreData.value.hometownCityName = v?.[1]?.label
|
|
},
|
|
}
|
|
},
|
|
},
|
|
{
|
|
field: 'nationCode',
|
|
label: '民族',
|
|
colProps: { span: 8 },
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
labelField: 'cn',
|
|
valueField: 'id',
|
|
api: getNationList,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
demandMarriageMoreData.value.nation = v?.label
|
|
},
|
|
},
|
|
},
|
|
// {
|
|
// field: 'bodilyFormCode',
|
|
// label: '体型',
|
|
// colProps: { span: 8 },
|
|
// component: 'ApiSelect',
|
|
// componentProps: {
|
|
// labelField: 'desc',
|
|
// api: getBodilyFormList,
|
|
// getPopupContainer: () => document.body,
|
|
// onChange: (_: any, v: any) => {
|
|
// demandMarriageMoreData.value.bodilyForm = v?.label
|
|
// },
|
|
// },
|
|
// },
|
|
// {
|
|
// field: 'accountTypeCode',
|
|
// label: '户口',
|
|
// colProps: { span: 8 },
|
|
// component: 'ApiSelect',
|
|
// componentProps: {
|
|
// labelField: 'desc',
|
|
// api: getAccountTypeList,
|
|
// getPopupContainer: () => document.body,
|
|
// onChange: (_: any, v: any) => {
|
|
// demandMarriageMoreData.value.accountTypeName = v?.label
|
|
// },
|
|
// },
|
|
// },
|
|
{
|
|
field: 'nativePlaceCode',
|
|
label: '籍贯',
|
|
colProps: { span: 8 },
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: domicilePlaceList,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
demandMarriageMoreData.value.nativePlaceName = v?.label
|
|
},
|
|
},
|
|
},
|
|
{
|
|
label: '职业',
|
|
field: 'occupationList',
|
|
colProps: { span: 8 },
|
|
component: 'Cascader',
|
|
componentProps: {
|
|
options: occupationList,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
const industry = v?.[0] || {}
|
|
const occupation = v?.[1] || {}
|
|
demandMarriageMoreData.value.industry = industry.label
|
|
demandMarriageMoreData.value.industryCode = industry.value
|
|
demandMarriageMoreData.value.occupation = occupation.label
|
|
demandMarriageMoreData.value.occupationCode = occupation.value
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'onlyChild',
|
|
label: '是否独生子女',
|
|
colProps: { span: 8 },
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: [
|
|
{ label: '是', value: 1 },
|
|
{ label: '否', value: 0 },
|
|
],
|
|
},
|
|
},
|
|
{
|
|
field: 'propertyPermitsCode',
|
|
label: '购房情况',
|
|
colProps: { span: 8 },
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
labelField: 'desc',
|
|
api: getPropertyPermits,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
demandMarriageMoreData.value.propertyPermits = v?.label
|
|
},
|
|
},
|
|
},
|
|
{
|
|
field: 'carPurchaseSituationCode',
|
|
label: '购车情况',
|
|
colProps: { span: 8 },
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
labelField: 'desc',
|
|
api: getCarPurchaseSituation,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
demandMarriageMoreData.value.carPurchaseSituation = v?.label
|
|
},
|
|
},
|
|
},
|
|
|
|
{
|
|
field: 'constellationCode',
|
|
label: '星座',
|
|
colProps: { span: 8 },
|
|
component: 'ApiSelect',
|
|
componentProps: {
|
|
labelField: 'desc',
|
|
api: getConstellationList,
|
|
getPopupContainer: () => document.body,
|
|
onChange: (_: any, v: any) => {
|
|
demandMarriageMoreData.value.constellation = v?.label
|
|
},
|
|
},
|
|
},
|
|
]
|