diff --git a/src/views/operation/CustomerReconciliation/detail/detailColumns.tsx b/src/views/operation/CustomerReconciliation/detail/detailColumns.tsx index e46df75f..2191db2d 100644 --- a/src/views/operation/CustomerReconciliation/detail/detailColumns.tsx +++ b/src/views/operation/CustomerReconciliation/detail/detailColumns.tsx @@ -59,6 +59,7 @@ export const schemas: FormSchema[] = [ field: 'customerName', component: 'ApiSelect', colProps: { span: 4 }, + required: true, componentProps: (a) => { return { api: GetAllClientList, diff --git a/src/views/operation/CustomerReconciliation/detail/index.vue b/src/views/operation/CustomerReconciliation/detail/index.vue index a26484f1..2bb0874e 100644 --- a/src/views/operation/CustomerReconciliation/detail/index.vue +++ b/src/views/operation/CustomerReconciliation/detail/index.vue @@ -303,7 +303,7 @@ // console.log(res, '右侧列表数据') // }) } else { - addDetail() + // addDetail() } } function RauditClass() { @@ -320,7 +320,7 @@ } // 头部表格 - const [registerForm, { getFieldsValue, setFieldsValue, updateSchema }] = useForm({ + const [registerForm, { getFieldsValue, validate, setFieldsValue, updateSchema }] = useForm({ labelWidth: 120, schemas: id.value ? Editschemas : schemas, showActionButtonGroup: false, @@ -494,7 +494,9 @@ // 点击新增 打开弹窗 function addDetail() { - openModalAdd(true, {}) + openModalAdd(true, { + customerId: getFieldsValue().customerId, + }) } // 新增 编辑 function GoDetailed() { @@ -596,8 +598,9 @@ } // 保存 async function Save() { + const values = await validate() let ApiData = { - ...getFieldsValue(), + ...values, businessIds: [], } let res = await EditCheckBill(ApiData) diff --git a/src/views/operation/CustomerReconciliation/detail/info/index.vue b/src/views/operation/CustomerReconciliation/detail/info/index.vue index 954158f6..6bd94683 100644 --- a/src/views/operation/CustomerReconciliation/detail/info/index.vue +++ b/src/views/operation/CustomerReconciliation/detail/info/index.vue @@ -92,7 +92,7 @@ const spinningL = ref(false) const emit = defineEmits(['AddDetailL', 'AddDetailR']) // 头部表单 - const [registerForm, { getFieldsValue }] = useForm({ + const [registerForm, { getFieldsValue, setFieldsValue }] = useForm({ labelWidth: 120, schemas, showActionButtonGroup: false, @@ -244,10 +244,11 @@ // 弹窗 const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { spinningL.value = true + setFieldsValue({ customerId: data.customerId }) dataSourceL.value = [] setTableData([]) setModalProps({ confirmLoading: true, loading: true }) - const res: API.DataResult = await GetBusinessQueryList(beforeFetch(null)) + const res: API.DataResult = await GetBusinessQueryList(beforeFetch(getFieldsValue())) if (res.succeeded) { dataSourceL.value = res.data setTableData([...res.data]) diff --git a/src/views/operation/CustomerReconciliation/detail/info/infoColumns.tsx b/src/views/operation/CustomerReconciliation/detail/info/infoColumns.tsx index c438b523..e9cea2bf 100644 --- a/src/views/operation/CustomerReconciliation/detail/info/infoColumns.tsx +++ b/src/views/operation/CustomerReconciliation/detail/info/infoColumns.tsx @@ -6,6 +6,7 @@ useComponentRegister('Button', Button) import { GetFeeCodeSelectList, GetFeeCurrencySelectList, + GetAllClientList, } from '/@/views/operation/CustomerReconciliation/api.js' import { GetClientStlModeSelectList, @@ -43,18 +44,13 @@ export const schemas: FormSchema[] = [ colProps: { span: 4 }, componentProps: () => { return { - api: () => { - return new Promise((resolve) => { - GetClientListByCode().then((res) => { - console.log(res) - resolve(res) - }) - }) - }, - immediate: false, + api: GetAllClientList, labelField: 'shortName', - valueField: 'codeName', + valueField: 'id', resultField: 'data', + immediate: true, + allowClear: true, + showSearch: true, filterOption: (input: string, option: any) => { return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 },