diff --git a/src/components/Form/src/Ds/components/DEdit.vue b/src/components/Form/src/Ds/components/DEdit.vue index 2ee9f79b..37b907f7 100644 --- a/src/components/Form/src/Ds/components/DEdit.vue +++ b/src/components/Form/src/Ds/components/DEdit.vue @@ -46,6 +46,20 @@ return [] }, }, + checkedChildren: { type: String }, + checkedValue: { + type: Boolean, + default: () => { + return true + }, + }, + unCheckedChildren: { type: String }, + unCheckedValue: { + type: Boolean, + default: () => { + return false + }, + }, formModel: { type: Object }, }, emits: ['change', 'update:value', 'edit'], @@ -59,7 +73,7 @@ } function GetState() { let RData: any = null - if (state.value) { + if (state.value || state.value === false) { if (props.treeData.length) { let FnFor = (Data) => { Data.forEach((item: any) => { @@ -86,6 +100,12 @@ }) } else if (state.value.$d && state.value.$isDayjsObject) { RData = dayjs(state.value.$d).format('YYYY-MM-DD') + } else if (props.checkedChildren) { + if (state.value == props.checkedValue) { + RData = props.checkedChildren + } else if (state.value == props.unCheckedValue) { + RData = props.unCheckedChildren + } } else { if (props.label == '来源明细') { appStore.getSourceData.forEach((item) => { diff --git a/src/views/operation/CustomerReconciliation/api.js b/src/views/operation/CustomerReconciliation/api.js index 3bbad3c7..c4d2f191 100644 --- a/src/views/operation/CustomerReconciliation/api.js +++ b/src/views/operation/CustomerReconciliation/api.js @@ -8,7 +8,6 @@ export function GetCheckBillList(parameter) { data: parameter, }) } - // 客户对账编辑 (Auth) # export function EditCheckBill(parameter) { return request({ diff --git a/src/views/operation/CustomerReconciliation/detail/detailColumns.tsx b/src/views/operation/CustomerReconciliation/detail/detailColumns.tsx index da2083f0..e46df75f 100644 --- a/src/views/operation/CustomerReconciliation/detail/detailColumns.tsx +++ b/src/views/operation/CustomerReconciliation/detail/detailColumns.tsx @@ -48,31 +48,33 @@ export const schemas: FormSchema[] = [ colProps: { span: 4 }, }, { - field: 'customerName', + field: 'customerId', component: 'Input', - label: '对账客户Name', + label: '对账客户', colProps: { span: 4 }, show: false, }, { - field: 'customerId', - component: 'ApiSelect', label: '对账客户', + field: 'customerName', + component: 'ApiSelect', colProps: { span: 4 }, - componentProps: ({ formModel }) => { + componentProps: (a) => { return { - allowClear: true, - showSearch: true, api: GetAllClientList, labelField: 'shortName', - valueField: 'id', + valueField: 'shortName', resultField: 'data', + immediate: true, + allowClear: true, + showSearch: true, filterOption: (input: string, option: any) => { return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 }, onChange: (e, obj) => { if (e && obj) { - formModel.customerName = obj.label + console.log(obj) + a.formModel.customerId = obj.id } }, } @@ -97,6 +99,12 @@ export const schemas: FormSchema[] = [ label: '是否不含税', defaultValue: false, colProps: { span: 2 }, + componentProps: { + checkedChildren: '是', + checkedValue: true, + unCheckedChildren: '否', + unCheckedValue: false, + }, }, // isLocking // { field: 'billName', component: 'Input', label: '对账单名称', colProps: { span: 4 } }, @@ -171,9 +179,9 @@ export const Editschemas: FormSchema[] = [ }, }, { - field: 'customerName', + field: 'customerId', component: 'DEdit', - label: '对账客户Name', + label: '对账客户', colProps: { span: 4 }, show: false, componentProps: (e) => { @@ -186,29 +194,30 @@ export const Editschemas: FormSchema[] = [ }, }, { - field: 'customerId', - component: 'DEdit', label: '对账客户', + field: 'customerName', + component: 'DEdit', colProps: { span: 4 }, - componentProps: ({ formModel }) => { + componentProps: (a) => { return { - allowClear: true, - showSearch: true, api: GetAllClientList, labelField: 'shortName', - valueField: 'id', + valueField: 'shortName', resultField: 'data', + immediate: true, + allowClear: true, + showSearch: true, filterOption: (input: string, option: any) => { return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 }, onChange: (e, obj) => { if (e && obj) { - formModel.customerName = obj.label + a.formModel.customerId = obj.id } }, onEdit: () => { - const { formActionType } = e - formActionType ? formActionType.linkageForm(e) : null + const { formActionType } = a + formActionType ? formActionType.linkageForm(a) : null }, } }, @@ -221,6 +230,10 @@ export const Editschemas: FormSchema[] = [ colProps: { span: 2 }, componentProps: (e) => { return { + checkedChildren: '是', + checkedValue: true, + unCheckedChildren: '否', + unCheckedValue: false, onEdit: () => { const { formActionType } = e formActionType ? formActionType.linkageForm(e) : null diff --git a/src/views/operation/CustomerReconciliation/detail/index.vue b/src/views/operation/CustomerReconciliation/detail/index.vue index f2ae74a7..9c93c2ba 100644 --- a/src/views/operation/CustomerReconciliation/detail/index.vue +++ b/src/views/operation/CustomerReconciliation/detail/index.vue @@ -93,7 +93,7 @@ --> -