|
|
|
@ -14,6 +14,7 @@ |
|
|
|
<ImpExcel @success="loadDataSuccess" dateFormat="YYYY-MM-DD"> |
|
|
|
<Button>导入Excel</Button> |
|
|
|
</ImpExcel> |
|
|
|
<Button type="link" style="margin-top: 16px;" @click="exportExcel">下载线索导入模板</Button> |
|
|
|
</template> |
|
|
|
</Result> |
|
|
|
<BasicTable v-for="(table, index) in tableListRef" |
|
|
|
@ -29,6 +30,9 @@ |
|
|
|
<Tabs tab-position="left" v-model:activeKey="activeKey2" :animated="false" @change="onInfoChange"> |
|
|
|
<TabPane key="1" tab="个人资料"> |
|
|
|
<BasicForm @register="registerForm" style="padding: 16px 48px 0px 0px;" > |
|
|
|
<!-- <template #birthYear="{ model, field }"> |
|
|
|
<DatePicker v-model:value="model[field]" mode="year" :open="open" format="YYYY" @openChange="openChange" @panelChange="panelChange"/> |
|
|
|
</template> --> |
|
|
|
<template #profilePhoto="{ model, field }"> |
|
|
|
<CropperAvatar :value="model[field]" @change="uploadAvatarAfter"/> |
|
|
|
</template> |
|
|
|
@ -78,8 +82,11 @@ |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import { ref, unref, nextTick } from 'vue' |
|
|
|
import { Tabs, TabPane, Button, Result, InputNumber } from 'ant-design-vue' |
|
|
|
import moment from 'moment/moment' |
|
|
|
import dayjs, { Dayjs } from 'dayjs' |
|
|
|
import { Tabs, TabPane, Button, Result, InputNumber, DatePicker } from 'ant-design-vue' |
|
|
|
import Icon from '/@/components/Icon' |
|
|
|
import { downloadByUrl } from '/@/utils/file/download' |
|
|
|
import { modalFormSchema, basicInfoData, demandMarriageSchema, demandMarriageMoreData } from './data' |
|
|
|
import { ImpExcel, ExcelData } from '/@/components/Excel'; |
|
|
|
import { BasicTable, BasicColumn } from '/@/components/Table' |
|
|
|
@ -88,6 +95,7 @@ |
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal' |
|
|
|
import { CropperAvatar } from '/@/components/Cropper'; |
|
|
|
import { createClueRecord, importClueRecord, getClueInfo, editClueRecord } from '/@/api/clue' |
|
|
|
import { formatToDate } from '/@/utils/dateUtil' |
|
|
|
|
|
|
|
const activeKey2 = ref<string>('1') |
|
|
|
|
|
|
|
@ -100,6 +108,7 @@ |
|
|
|
}) |
|
|
|
|
|
|
|
const ifUpdate = ref<boolean>(false) |
|
|
|
const open = ref<boolean>(false) |
|
|
|
const details = ref<any>() |
|
|
|
const [registerModal, { closeModal, setModalProps }] = useModalInner(async (data) => { |
|
|
|
ifUpdate.value = !!data.ifUpdate |
|
|
|
@ -143,11 +152,28 @@ |
|
|
|
closeModal() |
|
|
|
} |
|
|
|
|
|
|
|
function openChange(status) { |
|
|
|
if (status) { |
|
|
|
open.value = true; |
|
|
|
} else { |
|
|
|
open.value = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function disabledDate (current: any) { |
|
|
|
const date: Dayjs = dayjs().subtract(18, 'year') |
|
|
|
return current && current > date.endOf('year') |
|
|
|
} |
|
|
|
|
|
|
|
function panelChange(value) { |
|
|
|
// 获取到的时间赋值给widgetVal |
|
|
|
setFieldsValue({ birthYear: String(value.year()) }); |
|
|
|
open.value = false; |
|
|
|
} |
|
|
|
|
|
|
|
function uploadAvatarAfter(value) { |
|
|
|
//修改表单的值 |
|
|
|
setFieldsValue({ |
|
|
|
profilePhoto: value, |
|
|
|
}); |
|
|
|
setFieldsValue({ profilePhoto: value }); |
|
|
|
} |
|
|
|
|
|
|
|
async function onInfoChange(){ |
|
|
|
@ -174,8 +200,9 @@ |
|
|
|
await validate() |
|
|
|
const values: any = getFieldsValue() |
|
|
|
// console.log({...values, ...basicInfoData.value}) |
|
|
|
|
|
|
|
const { clueTime } = values |
|
|
|
setModalProps({ confirmLoading: true }) |
|
|
|
values.clueTime = formatToDate(clueTime) |
|
|
|
const { domicilePlace, address } = values || {} |
|
|
|
|
|
|
|
const demandInfo: any = getFieldsValue3() |
|
|
|
@ -196,9 +223,14 @@ |
|
|
|
channelType: 1, |
|
|
|
datingClueDemand, |
|
|
|
cityCode: address?.[1], |
|
|
|
cityName: basicInfoData.value.cityName, |
|
|
|
provinceCode: address?.[0], |
|
|
|
provinceName: basicInfoData.value.provinceName, |
|
|
|
districtCode: address?.[2], |
|
|
|
districtName: basicInfoData.value.districtName, |
|
|
|
domicilePlaceCityCode: domicilePlace?.[1], |
|
|
|
domicilePlaceCityName: basicInfoData.value.domicilePlaceCityName, |
|
|
|
domicilePlaceProvinceName: basicInfoData.value.domicilePlaceProvinceName, |
|
|
|
domicilePlaceProvinceCode: domicilePlace?.[0] |
|
|
|
} |
|
|
|
if(details.value && details.value.id){ |
|
|
|
@ -229,6 +261,10 @@ |
|
|
|
tableListRef.value.push({ title: sheetName, dataSource: results, columns, header }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function exportExcel() { |
|
|
|
downloadByUrl({url: `https://dating-agency-prod.oss-cn-shenzhen.aliyuncs.com/template/线索导入模板.xlsx`}); |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="less"> |
|
|
|
|