From 82d58894b60227e4605ec665be50833d74bd3479 Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Wed, 3 Apr 2024 16:11:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=94=B6=E8=B4=A7=E7=AE=A1?= =?UTF-8?q?=E7=90=86--=E4=BE=9B=E5=BA=94=E5=95=86=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E7=94=B3=E8=AF=B7--=E6=96=B0=E5=A2=9E--form=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=EF=BC=9Asearchtable=E4=B8=AD=E5=8D=95?= =?UTF-8?q?=E4=BB=B7=E6=80=BB=E5=92=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 24 +++++++++++++++++++ .../supplierinvoiceRequestMain/index.vue | 5 ++++ .../supplierinvoiceRequestMain.data.ts | 1 + 3 files changed, 30 insertions(+) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 4977efef5..bd9bdbf47 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -271,6 +271,11 @@ const props = defineProps({ type: Number, required: false, default: 0 + }, + sumFormData:{ + type: Array, + required: false, + default: null } }) @@ -383,6 +388,25 @@ const opensearchTable = ( _searchCondition ) } + + +const changeSumFormData = () => { + if(props.sumFormData){ + const sumObject = {} + props.sumFormData.forEach(sumItem=>{ + sumObject[sumItem?.formField]= props.tableData.reduce((prev, item) => prev + item[sumItem?.valueField],0) + }) + nextTick(()=>{ + formRef.value.setValues(sumObject) + }) + } +} +watch(()=>props.tableData,() => { + changeSumFormData() +},{ + deep:true +}) + // 弹层确定返回所选数据 // val : 弹层列表row 数据 const searchTableSuccess = (formField, searchField, val, type, row) => { diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue index 30e09f66a..5415a44be 100644 --- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue @@ -43,6 +43,10 @@ :tableAllSchemas="SupplierinvoiceRequestDetail.allSchemas" :tableFormRules="SupplierinvoiceRequestDetailRules" :tableData="tableData" + :sumFormData = "[{ + formField:'amount', + valueField:'singlePrice' + }]" :apiUpdate="SupplierinvoiceRequestMainApi.updateSupplierinvoiceRequestMain" :apiCreate="SupplierinvoiceRequestMainApi.createSupplierinvoiceRequestMain" :isBusiness="true" @@ -148,6 +152,7 @@ newRow['recvBillNum'] = item['recvBillNum'] newRow['asnBillNum'] = item['asnBillNum'] newRow['supplierCode'] = item['supplierCode'] + newRow['singlePrice'] = item['purchasePrice']//单价默认值 = 采购价格 newRow['purchasePrice'] = item['purchasePrice'] newRow['invoicableQuantity'] = item['invoicableQuantity'] newRow['itemCode'] = item['itemCode'] diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts index a6f9f7e6d..8ad864b0a 100644 --- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts @@ -148,6 +148,7 @@ export const SupplierinvoiceRequestMain = useCrudSchemas(reactive( componentProps: { min: 0, precision: 6, + disabled: true, } }, tableForm: {