Browse Source

no message

master
xpz2018 9 months ago
parent
commit
e4cabe6b8c
2 changed files with 14 additions and 19 deletions
  1. 2
      src/api/clue/index.ts
  2. 31
      src/views/clue/cluePool/modal.vue

2
src/api/clue/index.ts

@ -17,6 +17,8 @@ export const createClueRecord = (params: any) => defHttp.post({ url: '/dating-cl
export const editClueRecord = (params: any) => defHttp.post({ url: '/dating-clue-service/user/edit/dating-clue', params }) export const editClueRecord = (params: any) => defHttp.post({ url: '/dating-clue-service/user/edit/dating-clue', params })
export const importClueRecord = (params: any) => defHttp.post({ url: '/dating-clue-service/user/import/dating-clue', params })
export const allocateCluing = (params: any) => defHttp.post({ url: '/dating-clue-service/user/batch-allocate/dating-clue', params }) export const allocateCluing = (params: any) => defHttp.post({ url: '/dating-clue-service/user/batch-allocate/dating-clue', params })
export const getClueInfo = (id: string) => defHttp.get<any>({ url: '/dating-clue-service/user/get/dating-clue-detail', params: { id } }) export const getClueInfo = (id: string) => defHttp.get<any>({ url: '/dating-clue-service/user/get/dating-clue-detail', params: { id } })

31
src/views/clue/cluePool/modal.vue

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

Loading…
Cancel
Save