Browse Source

性能优化

master_hella_20240701
wangyufei 5 months ago
parent
commit
d7d4f20033
  1. 8
      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. 11
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue

8
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})
}
}

8
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

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

@ -553,30 +553,30 @@ export const SupplierinvoiceRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
},
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',

11
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
// 2X*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+

Loading…
Cancel
Save