Browse Source

性能优化

master_hella_20240701
wangyufei 5 months ago
parent
commit
d7d4f20033
  1. 6
      src/api/wms/supplierinvoiceRequestDetail/index.ts
  2. 8
      src/components/BasicForm/src/BasicForm.vue
  3. 48
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts
  4. 9
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

6
src/api/wms/supplierinvoiceRequestDetail/index.ts

@ -41,8 +41,14 @@ export const getPoNumber = async (params) => {
// 查询供应商发票明细数据 // 查询供应商发票明细数据
export const getPoNumberPoLineInfo = async (params) => { export const getPoNumberPoLineInfo = async (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}) return await request.get({ url: `/wms/supplierinvoice-request-detail/getPoNumberPoLineInfo`, params})
} }
}
// 查询供应商发票申请子详情 // 查询供应商发票申请子详情

8
src/components/BasicForm/src/BasicForm.vue

@ -492,9 +492,13 @@ watch(()=>props.tableData,() => {
},{ },{
deep:true 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){ 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 deep:true

48
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts

@ -553,30 +553,30 @@ export const SupplierinvoiceRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isForm: false, isForm: false,
}, },
{ // {
label: '采购驳回原因', // label: '采购驳回原因',
field: 'purchaseRejectCause', // field: 'purchaseRejectCause',
table: { // table: {
width: 180 // width: 180
}, // },
sortTableDefault:14, // sortTableDefault:14,
isTable: true, // isTable: true,
isSearch: false, // isSearch: false,
isForm: false, // isForm: false,
isDetail:false, // isDetail:false,
}, // },
{ // {
label: '财务驳回原因', // label: '财务驳回原因',
field: 'financeRejectCause', // field: 'financeRejectCause',
table: { // table: {
width: 180 // width: 180
}, // },
sortTableDefault:15, // sortTableDefault:15,
isTable: true, // isTable: true,
isSearch: false, // isSearch: false,
isForm: false, // isForm: false,
isDetail:false, // isDetail:false,
}, // },
{ {
label: '供应商审批人代码', label: '供应商审批人代码',
field: 'supplierCreator', field: 'supplierCreator',

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

@ -53,19 +53,18 @@
:tableAllSchemas="SupplierinvoiceRequestDetail.allSchemas" :tableAllSchemas="SupplierinvoiceRequestDetail.allSchemas"
:tableFormRules="SupplierinvoiceRequestDetailRules" :tableFormRules="SupplierinvoiceRequestDetailRules"
:tableData="tableData" :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 const {taxRate=0,amount=0,taxAmount=0,beforeTaxAmount=0,totalTaxAmount=0,discountAmount1=0,beforeTaxDiffAmount=0,taxAmountDiff=0} = formModel
// 2X*2 // 2X*2
let taxAmount_ = 0.00 let taxAmount_ = 0.00
if(formType=='update'){ // if(formType=='update'){ //
taxAmount_ = taxAmount taxAmount_ = taxAmount
}else if(formType=='create'){ // }else if(formType=='create'){ //
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) 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({ formRef.value.setValues({
taxAmount:taxAmount_, taxAmount:taxAmount_,
afterTaxAmount:amount+taxAmount, // 3+ afterTaxAmount:amount+taxAmount, // 3+

Loading…
Cancel
Save