diff --git a/src/locales/lang/zh-CN/routes/invite.ts b/src/locales/lang/zh-CN/routes/invite.ts new file mode 100644 index 0000000..7b87cd3 --- /dev/null +++ b/src/locales/lang/zh-CN/routes/invite.ts @@ -0,0 +1,5 @@ +export default { + invite: '电邀管理', + index: '线索分配', + list: '我的线索' +} diff --git a/src/router/menu.ts b/src/router/menu.ts index 1621aab..e3097cb 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -4,9 +4,9 @@ const clueMenu: Menu = { path: '/clue', name: 'clue', component: 'LAYOUT', - redirect: '/clue/messageList', + redirect: '/clue/cluePool', meta: { - orderNo: 90013, + orderNo: 90003, hideChildrenInMenu: false, icon: 'ant-design:dribbble-circle-filled', title: 'routes.clue.clue', @@ -40,13 +40,44 @@ const clueMenu: Menu = { ], } +const inviteMenu: Menu = { + path: '/invite', + name: 'Invite', + component: 'LAYOUT', + redirect: '/invite/index', + meta: { + orderNo: 90004, + hideChildrenInMenu: false, + icon: 'ant-design:whats-app-outlined', + title: 'routes.invite.invite', + }, + children: [ + { + path: 'index', + name: 'Index', + component: '/invite/index/index.vue', + meta: { + title: 'routes.invite.index', + }, + }, + { + path: 'list', + name: 'List', + component: '/invite/list/index.vue', + meta: { + title: 'routes.invite.list', + }, + }, + ], +} + const systemMenu: Menu = { path: '/system', name: 'System', component: 'LAYOUT', redirect: '/system/role', meta: { - orderNo: 90014, + orderNo: 91014, hideChildrenInMenu: false, icon: 'ion:settings-outline', title: 'routes.system.system', @@ -81,6 +112,7 @@ const systemMenu: Menu = { const appMenuList: Menu[] = [ clueMenu, + inviteMenu, systemMenu, ] // 测试账号:15014242835 diff --git a/src/router/menus/modules/invite.ts b/src/router/menus/modules/invite.ts new file mode 100644 index 0000000..7d13d95 --- /dev/null +++ b/src/router/menus/modules/invite.ts @@ -0,0 +1,20 @@ +import type { MenuModule } from '/@/router/types' +import { t } from '/@/hooks/web/useI18n' +const inviteMenu: MenuModule = { + orderNo: 90004, + menu: { + path: '/invite', + name: t('routes.invite.invite'), + children: [ + { + path: 'index', + name: t('routes.invite.index'), + }, + { + path: 'list', + name: t('routes.invite.list'), + }, + ], + }, +} +export default inviteMenu diff --git a/src/router/routes/modules/clue.ts b/src/router/routes/modules/clue.ts index f26162f..11b351e 100644 --- a/src/router/routes/modules/clue.ts +++ b/src/router/routes/modules/clue.ts @@ -3,7 +3,7 @@ import type { AppRouteModule } from '/@/router/types' import { LAYOUT } from '/@/router/constant' import { t } from '/@/hooks/web/useI18n' -const messageRoute: AppRouteModule = { +const clueRoute: AppRouteModule = { path: '/clue', name: 'Clue', component: LAYOUT, @@ -20,7 +20,6 @@ const messageRoute: AppRouteModule = { name: 'CluePool', component: () => import('/src/views/clue/cluePool/index.vue'), meta: { - // roles: ['/staff/staff'], title: t('routes.clue.cluePool'), }, }, @@ -29,7 +28,6 @@ const messageRoute: AppRouteModule = { name: 'ClueList', component: () => import('/src/views/clue/clueList/index.vue'), meta: { - // roles: ['/staff/staff'], title: t('routes.clue.clueList'), }, }, @@ -46,4 +44,4 @@ const messageRoute: AppRouteModule = { ], } -export default messageRoute +export default clueRoute diff --git a/src/router/routes/modules/invite.ts b/src/router/routes/modules/invite.ts new file mode 100644 index 0000000..402d132 --- /dev/null +++ b/src/router/routes/modules/invite.ts @@ -0,0 +1,37 @@ +import type { AppRouteModule } from '/@/router/types' + +import { LAYOUT } from '/@/router/constant' +import { t } from '/@/hooks/web/useI18n' + +const inviteRoute: AppRouteModule = { + path: '/invite', + name: 'Invite', + component: LAYOUT, + redirect: '/invite/index', + meta: { + orderNo: 90014, + hideChildrenInMenu: false, + icon: 'ant-design:whats-app-outlined', + title: t('routes.invite.invite'), + }, + children: [ + { + path: 'index', + name: 'Index', + component: () => import('/src/views/invite/index/index.vue'), + meta: { + title: t('routes.invite.index'), + }, + }, + { + path: 'list', + name: 'List', + component: () => import('/src/views/invite/list/index.vue'), + meta: { + title: t('routes.invite.list'), + }, + }, + ], +} + +export default inviteRoute diff --git a/src/views/invite/index/data.ts b/src/views/invite/index/data.ts new file mode 100644 index 0000000..b59a2a5 --- /dev/null +++ b/src/views/invite/index/data.ts @@ -0,0 +1,693 @@ +import { BasicColumn, FormSchema } from '/@/components/Table' +import moment from 'moment'; + +export const tableColumns: BasicColumn[] = [ + { title: '用户信息', dataIndex: 'userinfo', slots: { customRender: 'userinfo' } }, + { width: 60, title: '性别', dataIndex: 'genderCode', customRender: ({ text }) => { return genderList.find((find) => find.value === text)?.label} }, + { width: 120, title: '手机号码', dataIndex: 'phone' }, + { width: 90, title: '渠道来源', dataIndex: 'channelType', + customRender: ({ text }) => { + return channelList.find((find) => find.value === text)?.label + }, + }, + { width: 80, title: '状态', dataIndex: 'allocationStatus', + customRender: ({ text }) => { + return clueStatusList.find((find) => find.value === text)?.label + }, + }, + { width: 100, title: '创建人', dataIndex: 'creatorName' }, + { width: 100, title: '核验人', dataIndex: 'verifierName' }, + { width: 90, title: '跟进状态', dataIndex: 'followStatus', + customRender: ({ text }) => { + return followStatusList.find((find) => find.value === text)?.label + }, + }, + { width: 150, title: '最后跟进时间', dataIndex: 'finalFollowTime' }, + { width: 90, title: '跟进结果', dataIndex: 'validStatus', + customRender: ({ text }) => { + return validStatusList.find((find) => find.value === text)?.label + }, + }, + { width: 150, title: '录入时间', dataIndex: 'createTime' }, +] + +export const tableFormSchema: FormSchema[] = [ + { + field: 'genderCode', + label: '用户性别', + colProps: { span: 6 }, + component: 'Select', + componentProps: { + options: genderList, + }, + }, + { + field: 'channelType', + label: '渠道来源', + colProps: { span: 6 }, + component: 'Select', + componentProps: { + options: channelList, + }, + }, + // { + // field: 'status', + // label: '状态', + // component: 'Input', + // colProps: { span: 6 }, + // }, + { + field: 'nickName', + label: '用户昵称', + component: 'Input', + colProps: { span: 6 }, + }, + { + field: 'phone', + label: '电话号码', + component: 'Input', + colProps: { span: 6 }, + }, + { + field: 'maritalStatusCode', + label: '婚姻状况', + colProps: { span: 6 }, + component: 'ApiSelect', + componentProps: { + labelField: 'desc', + api: getMaritalStatusList, + }, + }, + { + field: 'age', + label: '年龄', + slot: 'age', + component: 'InputNumber', + colProps: { span: 6 }, + }, + { + field: 'educationCode', + label: '学历', + colProps: { span: 6 }, + component: 'ApiSelect', + componentProps: { + labelField: 'desc', + api: getEducationList, + }, + }, + { + field: 'createTime', + label: '创建时间', + component: 'RangePicker', + colProps: { span: 6 }, + }, + { + field: 'creatorName', + label: '创建人名称', + component: 'Input', + colProps: { span: 6}, + }, + { + field: 'followTime', + label: '最后跟进时间', + component: 'RangePicker', + colProps: { span: 6 }, + }, + { + field: 'verifierName', + label: '核验人名称', + component: 'Input', + colProps: { span: 6}, + }, +] + +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({}) +// 获取地区数据 +const { addressList, domicilePlaceList } = useAddressData() + +// 获取职业列表 +export const occupationList = ref([]) +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([]) +// 基本信息 +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: 'age', label: '年龄', component: 'InputNumber', colProps: { span: 8 },}, + { 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%' }, + // disabled: !!formModel.name && formModel.name !== -1, + // disabledDate: (current: Dayjs) => { + // const date: Dayjs = dayjs().subtract(18, 'year') + // return current && current > date.endOf('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: 'describeInfo', + label: '个人描述', + component: 'InputTextArea', + colProps: { span: 16 }, + componentProps: ({ formModel }) => { + return { + autoSize: { + minRows: 4, + }, + disabled: formModel?.describeAudit, + } + }, + }, +] + +// 择偶标准的额外数据 +export const demandMarriageMoreData = ref({}) +// 择偶标准 +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 + }, + }, + }, +] diff --git a/src/views/invite/index/index.vue b/src/views/invite/index/index.vue new file mode 100644 index 0000000..cc663d2 --- /dev/null +++ b/src/views/invite/index/index.vue @@ -0,0 +1,228 @@ + + + + + diff --git a/src/views/invite/index/modal.vue b/src/views/invite/index/modal.vue new file mode 100644 index 0000000..60f9546 --- /dev/null +++ b/src/views/invite/index/modal.vue @@ -0,0 +1,211 @@ + + + + + diff --git a/src/views/invite/list/data.ts b/src/views/invite/list/data.ts new file mode 100644 index 0000000..b59a2a5 --- /dev/null +++ b/src/views/invite/list/data.ts @@ -0,0 +1,693 @@ +import { BasicColumn, FormSchema } from '/@/components/Table' +import moment from 'moment'; + +export const tableColumns: BasicColumn[] = [ + { title: '用户信息', dataIndex: 'userinfo', slots: { customRender: 'userinfo' } }, + { width: 60, title: '性别', dataIndex: 'genderCode', customRender: ({ text }) => { return genderList.find((find) => find.value === text)?.label} }, + { width: 120, title: '手机号码', dataIndex: 'phone' }, + { width: 90, title: '渠道来源', dataIndex: 'channelType', + customRender: ({ text }) => { + return channelList.find((find) => find.value === text)?.label + }, + }, + { width: 80, title: '状态', dataIndex: 'allocationStatus', + customRender: ({ text }) => { + return clueStatusList.find((find) => find.value === text)?.label + }, + }, + { width: 100, title: '创建人', dataIndex: 'creatorName' }, + { width: 100, title: '核验人', dataIndex: 'verifierName' }, + { width: 90, title: '跟进状态', dataIndex: 'followStatus', + customRender: ({ text }) => { + return followStatusList.find((find) => find.value === text)?.label + }, + }, + { width: 150, title: '最后跟进时间', dataIndex: 'finalFollowTime' }, + { width: 90, title: '跟进结果', dataIndex: 'validStatus', + customRender: ({ text }) => { + return validStatusList.find((find) => find.value === text)?.label + }, + }, + { width: 150, title: '录入时间', dataIndex: 'createTime' }, +] + +export const tableFormSchema: FormSchema[] = [ + { + field: 'genderCode', + label: '用户性别', + colProps: { span: 6 }, + component: 'Select', + componentProps: { + options: genderList, + }, + }, + { + field: 'channelType', + label: '渠道来源', + colProps: { span: 6 }, + component: 'Select', + componentProps: { + options: channelList, + }, + }, + // { + // field: 'status', + // label: '状态', + // component: 'Input', + // colProps: { span: 6 }, + // }, + { + field: 'nickName', + label: '用户昵称', + component: 'Input', + colProps: { span: 6 }, + }, + { + field: 'phone', + label: '电话号码', + component: 'Input', + colProps: { span: 6 }, + }, + { + field: 'maritalStatusCode', + label: '婚姻状况', + colProps: { span: 6 }, + component: 'ApiSelect', + componentProps: { + labelField: 'desc', + api: getMaritalStatusList, + }, + }, + { + field: 'age', + label: '年龄', + slot: 'age', + component: 'InputNumber', + colProps: { span: 6 }, + }, + { + field: 'educationCode', + label: '学历', + colProps: { span: 6 }, + component: 'ApiSelect', + componentProps: { + labelField: 'desc', + api: getEducationList, + }, + }, + { + field: 'createTime', + label: '创建时间', + component: 'RangePicker', + colProps: { span: 6 }, + }, + { + field: 'creatorName', + label: '创建人名称', + component: 'Input', + colProps: { span: 6}, + }, + { + field: 'followTime', + label: '最后跟进时间', + component: 'RangePicker', + colProps: { span: 6 }, + }, + { + field: 'verifierName', + label: '核验人名称', + component: 'Input', + colProps: { span: 6}, + }, +] + +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({}) +// 获取地区数据 +const { addressList, domicilePlaceList } = useAddressData() + +// 获取职业列表 +export const occupationList = ref([]) +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([]) +// 基本信息 +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: 'age', label: '年龄', component: 'InputNumber', colProps: { span: 8 },}, + { 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%' }, + // disabled: !!formModel.name && formModel.name !== -1, + // disabledDate: (current: Dayjs) => { + // const date: Dayjs = dayjs().subtract(18, 'year') + // return current && current > date.endOf('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: 'describeInfo', + label: '个人描述', + component: 'InputTextArea', + colProps: { span: 16 }, + componentProps: ({ formModel }) => { + return { + autoSize: { + minRows: 4, + }, + disabled: formModel?.describeAudit, + } + }, + }, +] + +// 择偶标准的额外数据 +export const demandMarriageMoreData = ref({}) +// 择偶标准 +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 + }, + }, + }, +] diff --git a/src/views/invite/list/index.vue b/src/views/invite/list/index.vue new file mode 100644 index 0000000..cc663d2 --- /dev/null +++ b/src/views/invite/list/index.vue @@ -0,0 +1,228 @@ + + + + + diff --git a/src/views/invite/list/modal.vue b/src/views/invite/list/modal.vue new file mode 100644 index 0000000..60f9546 --- /dev/null +++ b/src/views/invite/list/modal.vue @@ -0,0 +1,211 @@ + + + + +