From d7d4f20033cab7091b6c5e9e8ceba121f6ce0e3a Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Fri, 28 Jun 2024 10:47:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=A7=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/supplierinvoiceRequestDetail/index.ts | 8 +++- src/components/BasicForm/src/BasicForm.vue | 8 +++- .../supplierinvoiceRecordMain.data.ts | 48 +++++++++---------- .../supplierinvoiceRequestMain/index.vue | 11 ++--- 4 files changed, 42 insertions(+), 33 deletions(-) diff --git a/src/api/wms/supplierinvoiceRequestDetail/index.ts b/src/api/wms/supplierinvoiceRequestDetail/index.ts index 0dd4c5343..f20a6fe16 100644 --- a/src/api/wms/supplierinvoiceRequestDetail/index.ts +++ b/src/api/wms/supplierinvoiceRequestDetail/index.ts @@ -41,7 +41,13 @@ export const getPoNumber = async (params) => { // 查询供应商发票明细数据 export const getPoNumberPoLineInfo = async (params) => { - return await request.get({ url: `/wms/supplierinvoice-request-detail/getPoNumberPoLineInfo`, params}) + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: `/wms/supplierinvoice-request-detail/getPoNumbersenior`, data}) + }else{ + return await request.get({ url: `/wms/supplierinvoice-request-detail/getPoNumberPoLineInfo`, params}) + } } diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 933b07128..6ec7b387c 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -492,9 +492,13 @@ watch(()=>props.tableData,() => { },{ deep:true }) -watch(()=>unref(formRef)?.formModel,() => { +let originFormModel = {} +const updateOriginFormModel = (data)=>{ + originFormModel = JSON.parse(JSON.stringify(data)) +} +watch(()=>unref(formRef)?.formModel,async () => { if(props?.sumFormDataByForm&&unref(formRef)?.formModel){ - props?.sumFormDataByForm(formRef,unref(formRef)?.formModel,props.tableData,formType.value) + props?.sumFormDataByForm(formRef,unref(formRef)?.formModel,props.tableData,formType.value,originFormModel,updateOriginFormModel) } },{ deep:true diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts index 028abb8dc..5314ed1dd 100644 --- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts @@ -553,30 +553,30 @@ export const SupplierinvoiceRecordMain = useCrudSchemas(reactive([ }, isForm: false, }, - { - label: '采购驳回原因', - field: 'purchaseRejectCause', - table: { - width: 180 - }, - sortTableDefault:14, - isTable: true, - isSearch: false, - isForm: false, - isDetail:false, - }, - { - label: '财务驳回原因', - field: 'financeRejectCause', - table: { - width: 180 - }, - sortTableDefault:15, - isTable: true, - isSearch: false, - isForm: false, - isDetail:false, - }, + // { + // label: '采购驳回原因', + // field: 'purchaseRejectCause', + // table: { + // width: 180 + // }, + // sortTableDefault:14, + // isTable: true, + // isSearch: false, + // isForm: false, + // isDetail:false, + // }, + // { + // label: '财务驳回原因', + // field: 'financeRejectCause', + // table: { + // width: 180 + // }, + // sortTableDefault:15, + // isTable: true, + // isSearch: false, + // isForm: false, + // isDetail:false, + // }, { label: '供应商审批人代码', field: 'supplierCreator', diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue index cfdfb6c81..fdbdb1e01 100644 --- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue @@ -53,19 +53,18 @@ :tableAllSchemas="SupplierinvoiceRequestDetail.allSchemas" :tableFormRules="SupplierinvoiceRequestDetailRules" :tableData="tableData" - :sumFormDataByForm ="(formRef,formModel,tableData,formType)=>{ + :sumFormDataByForm ="(formRef,formModel,tableData,formType,originFormModel,updateOriginFormModel)=>{ const {taxRate=0,amount=0,taxAmount=0,beforeTaxAmount=0,totalTaxAmount=0,discountAmount1=0,beforeTaxDiffAmount=0,taxAmountDiff=0} = formModel // 2、系统税额:每条数据的合同价格X可开票数量,计算结果取两位小数之后*税率的计算结果,再保留2位。所有子表数据再求和 let taxAmount_ = 0.00 if(formType=='update'){ // 编辑 taxAmount_ = taxAmount }else if(formType=='create'){ // 新增 - taxAmount_ = tableData.reduce((prev, item) => prev + Number(Number(taxRate*0.01*Number(Number(item['singlePrice']*item['invoicableQuantity']).toFixed(2))).toFixed(2)),0) + if(taxRate!=originFormModel.taxRate){ + taxAmount_ = tableData.reduce((prev, item) => prev + Number(Number(taxRate*0.01*Number(Number(item['singlePrice']*item['invoicableQuantity']).toFixed(2))).toFixed(2)),0) + updateOriginFormModel(formModel) + } } - console.log('sumFormDataByForm',tableData) - console.log('taxAmount_',taxAmount_) - - if(tableData) formRef.value.setValues({ taxAmount:taxAmount_, afterTaxAmount:amount+taxAmount, // 3、系统价税合计:系统未税金额+系统税额