From 8ae9391e7619d1f0d4c7c24c9b4f7a43897134ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <14166000+zhangtonghai@user.noreply.gitee.com> Date: Mon, 30 Sep 2024 17:54:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=AF=B9=E8=B4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Form/src/Ds/components/DEdit.vue | 22 +++++++- .../operation/CustomerReconciliation/api.js | 1 - .../detail/detailColumns.tsx | 53 ++++++++++++------- .../CustomerReconciliation/detail/index.vue | 18 ++++--- 4 files changed, 66 insertions(+), 28 deletions(-) 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 @@ --> -
对账编号:{{ billNo }}
+
对账编号:{{ billNo }}
- 合计:
-
+ +
@@ -254,6 +259,7 @@ const spinningT = ref(false) const billNo = ref() const isLocking = ref(false) + const calcData = ref([]) init() // ------------------------------------- const RefActionBar = ref() @@ -309,7 +315,7 @@ // 头部表格 const [registerForm, { getFieldsValue, setFieldsValue, updateSchema }] = useForm({ labelWidth: 120, - schemas: id.value ? schemas : Editschemas, + schemas: id.value ? Editschemas : schemas, showActionButtonGroup: false, actionColOptions: { span: 5, @@ -720,7 +726,7 @@ .CsHeader { padding-bottom: 0 !important; margin: 0 0 10px 0 !important; - border: 1px solid #e8ebed; + // border: 1px solid #e8ebed; .headerForm { background: #fff; padding: 5px 15px 10px 15px !important;