From 570967e42a08897987fd3d08df82121aab9e5fc5 Mon Sep 17 00:00:00 2001 From: yufei_wang <2267742828@qq.com> Date: Thu, 21 Nov 2024 14:31:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=88=9B=E5=BB=BA=E5=BC=80?= =?UTF-8?q?=E7=A5=A8=E7=94=B3=E8=AF=B7=E6=97=A0=E5=8F=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/supplierinvoiceRequestDetail/index.ts | 5 ++ .../CustomerSaleInvoiceBasicForm.vue | 49 +++++++++++++------ .../customerSaleInvoiceRequestMain.data.ts | 1 + .../customerStatement/index.vue | 12 +++++ 4 files changed, 53 insertions(+), 14 deletions(-) diff --git a/src/api/wms/supplierinvoiceRequestDetail/index.ts b/src/api/wms/supplierinvoiceRequestDetail/index.ts index cab62a1d5..a5a8f8ea0 100644 --- a/src/api/wms/supplierinvoiceRequestDetail/index.ts +++ b/src/api/wms/supplierinvoiceRequestDetail/index.ts @@ -80,3 +80,8 @@ export const exportSupplierinvoiceRequestDetail = async (params) => { export const importTemplate = () => { return request.download({ url: '/wms/supplierinvoice-request-detail/get-import-template' }) } + +// 模具分摊单价 +export const handleAllocationPrice = async (data) => { + return await request.post({ url: `/wms/supplierinvoice-request-detail/handleAllocationPrice`, data }) +} diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue index b5c6e245b..e80d16e30 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue @@ -70,6 +70,23 @@ const openForm =async (type: string, row?: any) => { formRef.value.open(type, row) } +const openFormTable =async (type: string, row?: any, list?:any) => { + row['customerStatementNumber'] = row['number'] // 客户对账单 + CustomerSaleInvoiceMain.allSchemas.formSchema.forEach((item) => { + if(item.field == 'customerStatementNumber'){ + item.componentProps.disabled = true + item.componentProps.isSearchList = false + item.componentProps.enterSearch = false + + } + }) + tableData.value = list // 重置明细数据 + formRef.value.open(type, row) + nextTick(()=>{ + initTableDataPrice() + }) +} + const onChange = (field, cur, formRef)=>{ console.log('onChange',field, cur, formRef) @@ -205,19 +222,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => }).then((res) => { console.log(55,res) tableData.value = res.list && res.list.length > 0 ?res.list : [] - tableData.value.forEach(item=>{ - item['sumPrice'] = item['price'] + item['allocationPrice'] - // 未税金额 默认等于数量*合计单价,可修改,必填,最多可输入2位小数 - item['beforeTaxAmount'] = item['sumPrice']*item['qty'] - - // 税额:taxAmount 未税价格*税率/100,四舍五入保留2位小数 - item['taxAmount'] = (item['beforeTaxAmount'] * formRef.formModel['taxRate'])/100 //含税金额 - - // 含税金额 未税价格+税额,四舍五入保留2位小数 - item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //含税金额 - - - }) + initTableDataPrice() }) // tableData.value = [] @@ -229,6 +234,22 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => }) } +// 初始化计算子表 +const initTableDataPrice = ()=>{ + tableData.value.forEach(item=>{ + item['sumPrice'] = item['price'] + item['allocationPrice'] + // 未税金额 默认等于数量*合计单价,可修改,必填,最多可输入2位小数 + item['beforeTaxAmount'] = item['sumPrice']*item['qty'] + + // 税额:taxAmount 未税价格*税率/100,四舍五入保留2位小数 + item['taxAmount'] = (item['beforeTaxAmount'] * formRef.value.formRef.formModel['taxRate'])/100 //含税金额 + + // 含税金额 未税价格+税额,四舍五入保留2位小数 + item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //含税金额 + }) + +} + const tableData = ref([]) const tableFormKeys = {} @@ -250,6 +271,6 @@ const tableSelectionDelete = (selection) => { tableData.value = tableData.value.filter(item => !selection.includes(item)) } -defineExpose({openForm}) +defineExpose({openForm,openFormTable}) \ No newline at end of file diff --git a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts index 48a011078..bd8cfc7f2 100644 --- a/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts +++ b/src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts @@ -478,6 +478,7 @@ export const CustomerSaleInvoiceDetail = useCrudSchemas(reactive([ label: '操作', field: 'action', isForm: false, + isTableForm: false, table: { width: 150, fixed: 'right' diff --git a/src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue b/src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue index 66fdd1265..c1e6d7c39 100644 --- a/src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue +++ b/src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue @@ -131,10 +131,14 @@ :importTemplateData="importShareTemplateData" @success="importSuccess" /> + + +