Browse Source

供应商发票金额计算

master_hella_20240701
yufei0306 7 months ago
parent
commit
338f83ab30
  1. 10
      src/components/BasicForm/src/BasicForm.vue
  2. 15
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

10
src/components/BasicForm/src/BasicForm.vue

@ -292,6 +292,11 @@ const props = defineProps({
type:Function,
required: false,
default: null
},
sumFormDataByTableCustom:{
type:Function,
required: false,
default: null
}
})
@ -419,7 +424,10 @@ const sumFormDataByTable = () => {
}
watch(()=>props.tableData,() => {
sumFormDataByTable()
if(props?.sumFormDataByTableCustom&&unref(formRef)?.formModel&&props.tableData){
props?.sumFormDataByTableCustom(formRef,unref(formRef)?.formModel,props.tableData)
}
},{
deep:true
})

15
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

@ -45,17 +45,20 @@
:tableAllSchemas="SupplierinvoiceRequestDetail.allSchemas"
:tableFormRules="SupplierinvoiceRequestDetailRules"
:tableData="tableData"
:sumFormDataField = "[{
formField:'amount',
tableField:'singlePrice'
}]"
:sumFormDataByForm ="(formRef,formModel)=>{
const {taxRate=0,amount=0} = formModel
formRef.value.setValues({
taxAmount:taxRate*amount,
afterTaxAmount:amount+taxRate*amount
taxAmount:taxRate*amount*0.01,
afterTaxAmount:amount+taxRate*amount*0.01
})
}"
:sumFormDataByTableCustom ="(formRef,formModel,tableData)=>{
const sumObject = {
amount:tableData.reduce((prev, item) => prev + (item['singlePrice']*item['invoicableQuantity']),0)
}
formRef.value.setValues(sumObject)
}"
:apiUpdate="SupplierinvoiceRequestMainApi.updateSupplierinvoiceRequestMain"
:apiCreate="SupplierinvoiceRequestMainApi.createSupplierinvoiceRequestMain"
:isBusiness="true"

Loading…
Cancel
Save