|
|
|
@ -87,11 +87,11 @@ |
|
|
|
import { BasicForm, useForm } from '/@/components/Form' |
|
|
|
import { BasicModal, useModalInner } from '/@/components/Modal' |
|
|
|
import { CropperAvatar } from '/@/components/Cropper'; |
|
|
|
import { createClueRecord, editClueRecord } from '/@/api/clue' |
|
|
|
import { createClueRecord, importClueRecord } from '/@/api/clue' |
|
|
|
|
|
|
|
const activeKey2 = ref<string>('1') |
|
|
|
|
|
|
|
const [registerForm, { setFieldsValue, resetFields, validate, getFieldsValue, updateSchema }] = |
|
|
|
const [registerForm, { setFieldsValue, resetFields, validate, getFieldsValue }] = |
|
|
|
useForm({ |
|
|
|
labelWidth: 108, |
|
|
|
schemas: modalFormSchema, |
|
|
|
@ -116,17 +116,6 @@ |
|
|
|
confirmLoading: false, |
|
|
|
title: ifUpdate.value ? '导入线索' : '新增线索', |
|
|
|
}) |
|
|
|
await updateSchema({ |
|
|
|
field: 'franchiseFee', |
|
|
|
componentProps: { |
|
|
|
disabled: ifUpdate.value, |
|
|
|
}, |
|
|
|
}) |
|
|
|
if (unref(ifUpdate)) { |
|
|
|
await setFieldsValue({ |
|
|
|
...data.record, |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 择偶标准表单配置 |
|
|
|
@ -153,6 +142,12 @@ |
|
|
|
const emits = defineEmits(['success']) |
|
|
|
async function handleOk() { |
|
|
|
try { |
|
|
|
if(ifUpdate.value){ |
|
|
|
await importClueRecord({keyList: tableListRef.value[0].header, dataList: tableListRef.value[0].dataSource}) |
|
|
|
createMessage.success(`导入成功!`) |
|
|
|
emits('success') |
|
|
|
return |
|
|
|
} |
|
|
|
await validate() |
|
|
|
const values: any = getFieldsValue() |
|
|
|
// console.log({...values, ...basicInfoData.value}) |
|
|
|
@ -183,17 +178,15 @@ |
|
|
|
domicilePlaceCityCode: domicilePlace?.[1], |
|
|
|
domicilePlaceProvinceCode: domicilePlace?.[0] |
|
|
|
} |
|
|
|
|
|
|
|
const fun = unref(ifUpdate) ? editClueRecord : createClueRecord |
|
|
|
await fun(param) |
|
|
|
createMessage.success(`${unref(ifUpdate) ? '编辑' : '新增'}成功!`) |
|
|
|
await createClueRecord(param) |
|
|
|
createMessage.success(`新增成功!`) |
|
|
|
emits('success') |
|
|
|
} finally { |
|
|
|
setModalProps({ confirmLoading: false }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const tableListRef = ref<{ title: string; columns?: any[]; dataSource?: any[];}[]>([]); |
|
|
|
const tableListRef = ref<{ title: string; columns?: any[]; dataSource?: any[]; header:any[];}[]>([]); |
|
|
|
|
|
|
|
function loadDataSuccess(excelDataList: ExcelData[]) { |
|
|
|
tableListRef.value = []; |
|
|
|
@ -204,7 +197,7 @@ |
|
|
|
for (const title of header) { |
|
|
|
columns.push({ title, dataIndex: title }); |
|
|
|
} |
|
|
|
tableListRef.value.push({ title: sheetName, dataSource: results, columns }); |
|
|
|
tableListRef.value.push({ title: sheetName, dataSource: results, columns, header }); |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|