From 3261fe0ed3eb86a36a8d51f5d2af6fa869939407 Mon Sep 17 00:00:00 2001
From: zhang_li
Date: Wed, 7 May 2025 17:02:32 +0800
Subject: [PATCH] =?UTF-8?q?YT-2401=E3=80=8A=E4=BE=9B=E5=BA=94=E5=95=86?=
=?UTF-8?q?=E5=8F=91=E7=A5=A8=E7=94=B3=E8=AF=B7=E3=80=8B=E3=80=8A=E4=BE=9B?=
=?UTF-8?q?=E5=BA=94=E5=95=86=E5=8F=91=E7=A5=A8=E8=AE=B0=E5=BD=95=E3=80=8B?=
=?UTF-8?q?=E6=98=8E=E7=BB=86=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0=E5=AD=97?=
=?UTF-8?q?=E6=AE=B5YT-2391SCP=E4=BE=9B=E5=BA=94=E5=95=86=E5=BC=80?=
=?UTF-8?q?=E7=A5=A8=E7=94=B3=E8=AF=B7=E6=98=8E=E7=BB=86=E4=B8=AD=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E5=AD=97=E6=AE=B5=EF=BC=8C=E5=85=B7=E4=BD=93=E8=A7=81?=
=?UTF-8?q?=E5=9B=BE=EF=BC=8C=E5=AF=BC=E5=87=BA=E6=98=8E=E7=BB=86=E6=97=B6?=
=?UTF-8?q?=E4=B9=9F=E8=A6=81=E5=AF=BC=E5=87=BA=E6=96=B0=E5=8A=A0=E7=9A=84?=
=?UTF-8?q?=E5=AD=97=E6=AE=B5=E3=80=82=E4=BE=9B=E5=BA=94=E5=95=86=E5=BC=80?=
=?UTF-8?q?=E7=A5=A8=E8=AE=B0=E5=BD=95=E9=A1=B5=E9=9D=A2=E4=B9=9F=E8=A6=81?=
=?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../supplierinvoiceRecordMain.data.ts | 101 +++++++++
.../supplierinvoiceRequestMain/index.vue | 43 +++-
.../supplierinvoiceRequestMain.data.ts | 196 +++++++++++++++++-
3 files changed, 333 insertions(+), 7 deletions(-)
diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts
index 268dfd5a4..0394af3f3 100644
--- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts
+++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRecordMain/supplierinvoiceRecordMain.data.ts
@@ -1691,6 +1691,30 @@ export const SupplierinvoiceRecordDetail = useCrudSchemas(reactive
isDetail: false,
isTable: true,
},
+ {
+ label: '受入号',
+ field: 'receivedNumber',
+ table: {
+ width: 150
+ },
+ sortTableDefault: 4,
+ isForm: false,
+ isTableForm: false,
+ isDetail: false,
+ isTable: true,
+ },
+ {
+ label: '车型',
+ field: 'project',
+ table: {
+ width: 150
+ },
+ sortTableDefault: 4,
+ isForm: false,
+ isTableForm: false,
+ isDetail: false,
+ isTable: true,
+ },
{
label: '到货时间',
field: 'planArriveTime',
@@ -1799,6 +1823,59 @@ export const SupplierinvoiceRecordDetail = useCrudSchemas(reactive
disabled: true
}
},
+
+ {
+ label: '税率(%)',
+ field: 'taxRate',
+ dictType: DICT_TYPE.TAX_RATE_DICT,
+ dictClass: 'string',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isForm: false,
+ isTableForm: false,
+ isDetail: false,
+ isTable: true,
+ },
+ {
+ label: '金额(税额)',
+ field: 'singleAndAllocateTaxAmount',
+ dictClass: 'string',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isForm: false,
+ isTableForm: false,
+ isDetail: false,
+ isTable: true,
+ },
+ {
+ label: '金额(合计金额)',
+ field: 'singleAndAllocateTotal',
+ dictClass: 'string',
+ sort: 'custom',
+ table: {
+ width: 150
+ },
+ isForm: false,
+ isTableForm: false,
+ isDetail: false,
+ isTable: true,
+ },
+ {
+ label: '金额(含模具费)',
+ field: 'singleAndAllocateAmount',
+ formatter: singlePriceFormart,
+ table: {
+ width: 150
+ },
+ isForm: false,
+ isTableForm: false,
+ isDetail: false,
+ isTable: true,
+ },
{
label: '总差额',
field: 'differencePriceTotal',
@@ -1826,6 +1903,18 @@ export const SupplierinvoiceRecordDetail = useCrudSchemas(reactive
disabled: true
}
},
+ {
+ label: '金额(模具费)',
+ field: 'allocationAmount',
+ formatter: singlePriceFormart,
+ table: {
+ width: 150
+ },
+ isForm: false,
+ isTableForm: false,
+ isDetail: false,
+ isTable: true,
+ },
{
label: '模具分摊单价',
field: 'allocationPrice',
@@ -1846,6 +1935,18 @@ export const SupplierinvoiceRecordDetail = useCrudSchemas(reactive
precision: 2,
}
},
+ {
+ label: '含模具费单价',
+ field: 'singleAndAllocatePrice',
+ formatter: singlePriceFormart,
+ table: {
+ width: 150
+ },
+ isForm: false,
+ isTableForm: false,
+ isDetail: false,
+ isTable: true,
+ },
// {
// label: '未税差额',
// field: 'untaxedDifference',
diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
index a5b04cfd2..a77f8f391 100644
--- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
+++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/index.vue
@@ -556,7 +556,8 @@ const detailData = ref()
const detailOpenForm = (type, row) => {
detailData.value = row
}
-const detailBasicFormOnChange = (field, cur) => {
+const detailBasicFormOnChange = (field, cur, detailFormRef) => {
+
console.log('detailBasicFormOnChange', field, cur)
if (field == 'invoicableQuantity') {
// 负数:默认默认开票数~0
@@ -572,8 +573,27 @@ const detailBasicFormOnChange = (field, cur) => {
}
}
}
+ detailData.value['invoicableQuantity'] = cur
+ handleDetailAllocationPrice(detailFormRef)
+ } else if (field == 'singlePrice') {
+ detailData.value['singlePrice'] = cur
+ handleDetailAllocationPrice(detailFormRef)
}
}
+const handleDetailAllocationPrice = async (detailFormRef) => {
+console.log(777,detailFormRef.value.formModel)
+ //含模具费单价=发票价格(合同价格) + 模具分摊单价(保留5位小数)
+ detailFormRef.value.formModel['singleAndAllocatePrice'] = Number((Number(detailFormRef.value.formModel['singlePrice']) + Number(detailFormRef.value.formModel['allocationPrice'])).toFixed(5))
+ //金额(模具费)=模具分摊单价*开票数量(保留2位小数)
+ detailFormRef.value.formModel['allocationAmount'] = Number((Number(detailFormRef.value.formModel['allocationPrice']) * Number(detailFormRef.value.formModel['invoicableQuantity'])).toFixed(2))
+ //金额(含模具费)=含模具费单价*开票数量(保留2位小数)
+ detailFormRef.value.formModel['singleAndAllocateAmount'] = Number((Number(detailFormRef.value.formModel['singleAndAllocatePrice']) * Number(detailFormRef.value.formModel['invoicableQuantity'])).toFixed(2))
+ //金额(税额) = 金额(含模具费)*税率保留两位小数
+ detailFormRef.value.formModel['singleAndAllocateTaxAmount'] = Number((Number(detailFormRef.value.formModel['singleAndAllocateAmount']) * Number(detailFormRef.value.formModel.taxRate) * 0.01).toFixed(5))
+ //金额(合计金额) = 金额(税额) + 金额(含模具费) 保留两位小数
+ detailFormRef.value.formModel['singleAndAllocateTotal'] =Number((Number(detailFormRef.value.formModel['singleAndAllocateTaxAmount'])+Number(detailFormRef.value.formModel['singleAndAllocateAmount'])).toFixed(2))
+
+}
const handleDetailSubmitForm = async (formType, data) => {
if (formType === 'update') {
console.log('handleDetailSubmitForm', data)
@@ -611,12 +631,19 @@ const inputNumberChange = (field, index, row, val) => {
}
}
handleAllocationPrice()
+ }else if (field == 'singlePrice') {
+ handleAllocationPrice()
}
}
const onChange = (field, cur) => {
console.log('onChange', field)
if (field == 'orderType') {
tableData.value = []
+ } else if (field == 'taxRate') {
+ if (tableData.value.length > 0) {
+ tableData.value.forEach(item=>item.taxRate =cur)
+ handleAllocationPrice()
+ }
}
}
@@ -658,6 +685,9 @@ const searchTableSuccess = (formField, searchField, val, searchFormRef, type, ro
newRow['id'] = item['id']
newRow['backNumber'] = item['backNumber']
newRow['currency'] = item['currency']
+ newRow['receivedNumber'] = item['receivedNumber']
+ newRow['project'] = item['project']
+ newRow['taxRate'] = formRef.value.formRef.formModel.taxRate
}
tableData.value.push(newRow)
})
@@ -691,7 +721,18 @@ const handleAllocationPrice = async () => {
tableData.value.forEach((item) => {
let findItem = res.find((item1) => item1.id == item?.id)
if (findItem) {
+ // 模具分摊单价
item['allocationPrice'] = findItem['allocationPrice']
+ //含模具费单价=发票价格(合同价格) + 模具分摊单价(保留5位小数)
+ item['singleAndAllocatePrice'] = Number((Number(item['singlePrice']) + Number(item['allocationPrice'])).toFixed(5))
+ //金额(模具费)=模具分摊单价*开票数量(保留2位小数)
+ item['allocationAmount'] = Number((Number(item['allocationPrice']) * Number(item['invoicableQuantity'])).toFixed(2))
+ //金额(含模具费)=含模具费单价*开票数量(保留2位小数)
+ item['singleAndAllocateAmount'] = Number((Number(item['singleAndAllocatePrice']) * Number(item['invoicableQuantity'])).toFixed(2))
+ //金额(税额) = 金额(含模具费)*税率保留两位小数
+ item['singleAndAllocateTaxAmount'] = Number((Number(item['singleAndAllocateAmount']) * Number(formRef.value.formRef.formModel.taxRate) * 0.01).toFixed(5))
+ //金额(合计金额) = 金额(税额) + 金额(含模具费) 保留两位小数
+ item['singleAndAllocateTotal'] =Number((Number(item['singleAndAllocateTaxAmount'])+Number(item['singleAndAllocateAmount'])).toFixed(2))
}
})
console.log('模具分摊单价', res)
diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts
index d98ea3621..2f2b4c609 100644
--- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts
+++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts
@@ -130,6 +130,14 @@ export const PurchaseReceiptOrReturnRecordDetail = useCrudSchemas(reactive(
form: {
component: 'InputNumber',
componentProps: {
- precision: 5,
+ precision: 2,
disabled: true,
}
},
@@ -1768,7 +1776,7 @@ export const SupplierinvoiceRequestDetailMain = useCrudSchemas(reactive {
}
return x1+x2
}
+const singlePriceFormart1 = (row, column, cellValue) => {
+ cellValue = Number(cellValue).toFixed(2)
+ cellValue = cellValue + '' || ''
+ let x = cellValue.split('.')
+ let x1 = x[0]
+ let x2 = x.length > 1 ? '.' + x[1] : ''
+ const reg = /(\d+)(\d{3})/
+ while (reg.test(x1)) {
+ x1 = x1.replace(reg, '$1,$2')
+ }
+ return x1 + x2
+}
function validateTaxRate(rule, value, callback) {
if (value>0) {
callback()
@@ -2130,7 +2150,36 @@ export const SupplierinvoiceRequestDetail = useCrudSchemas(reactive