Browse Source

Merge branch 'intex' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into intex

intex_online20250522
songguoqiang 3 weeks ago
parent
commit
ad38745f4d
  1. 60
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue
  2. 8
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue
  3. 4
      src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

60
src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue

@ -61,17 +61,17 @@
async (formRef, formModel, tableData) => { async (formRef, formModel, tableData) => {
const { taxRate = 0,moldUntaxedAmount=0 } = formModel const { taxRate = 0,moldUntaxedAmount=0 } = formModel
// 1 mainBeforeTaxAmount : * // 1 mainBeforeTaxAmount : *
let mainBeforeTaxAmount = tableData.reduce((prev, item) =>prev + Number((Number(item['sumPrice'])*Number(item['qty'])).toFixed(2)),0).toFixed(2) let mainBeforeTaxAmount = Math.round(tableData.reduce((prev, item) =>prev + Number( Math.round((Number(item['sumPrice'])*Number(item['qty'])) * 100) / 100),0) * 100) / 100
// 2 mainTaxAmount = * // 2 mainTaxAmount = *
let mainTaxAmount = tableData.reduce((prev, item) =>prev + Number((Number(item['beforeTaxAmount'])*Number(taxRate)*0.01).toFixed(2)),0).toFixed(2) let mainTaxAmount = Math.round(tableData.reduce((prev, item) =>prev + Number(Math.round((Number(item['beforeTaxAmount'])*Number(taxRate)*0.01)* 100) / 100),0)* 100) / 100
// 5 materialsUntaxedAmount : * // 5 materialsUntaxedAmount : *
let materialsUntaxedAmount = tableData.reduce((prev, item) =>prev + Number((Number(item['price'])*Number(item['qty'])).toFixed(2)),0).toFixed(2) let materialsUntaxedAmount = Math.round(tableData.reduce((prev, item) =>prev + Number(Math.round((Number(item['price'])*Number(item['qty']))* 100) / 100),0)* 100) / 100
// 6 materialsTaxAmount = * * // 6 materialsTaxAmount = * *
let materialsTaxAmount = tableData.reduce((prev, item) => prev + Number((Number((Number(item['price']) * Number(item['qty'])).toFixed(2)) * Number(taxRate) * 0.01).toFixed(2)), 0).toFixed(2) let materialsTaxAmount = Math.round(tableData.reduce((prev, item) => prev + Number(Math.round((Number(Math.round((Number(item['price']) * Number(item['qty']))* 100) / 100) * Number(taxRate) * 0.01)* 100) / 100), 0)* 100) / 100
//  7= * //  7= *
let alreadyMoldUntaxedAmount = tableData.reduce((prev, item) =>prev + Number((Number(item['allocationPrice'])*Number(item['qty'])).toFixed(2)),0).toFixed(2) let alreadyMoldUntaxedAmount = Math.round(tableData.reduce((prev, item) =>prev + Number(Math.round((Number(item['allocationPrice'])*Number(item['qty']))* 100) / 100),0)* 100) / 100
// 8 alreadyMoldTaxAmount == * * // 8 alreadyMoldTaxAmount == * *
let alreadyMoldTaxAmount = tableData.reduce((prev, item) => prev + Number((Number((Number(item['allocationPrice']) * Number(item['qty'])).toFixed(2)) * Number(taxRate) * 0.01).toFixed(2)), 0).toFixed(2) let alreadyMoldTaxAmount = Math.round(tableData.reduce((prev, item) => prev + Number(Math.round((Number(Math.round((Number(item['allocationPrice']) * Number(item['qty']))* 100) / 100) * Number(taxRate) * 0.01)* 100) / 100), 0)* 100) / 100
const allAmountNum = await getAllocationAmount(formModel.customerStatementNumber) const allAmountNum = await getAllocationAmount(formModel.customerStatementNumber)
const sumObject = { const sumObject = {
@ -80,7 +80,7 @@
// //
taxAmount:mainTaxAmount, taxAmount:mainTaxAmount,
// mainAdTaxAmount =+ // mainAdTaxAmount =+
adTaxAmount: (Number(mainBeforeTaxAmount) + Number(mainTaxAmount)).toFixed(2), adTaxAmount: Math.round((Number(mainBeforeTaxAmount) + Number(mainTaxAmount))* 100) / 100,
// //
moldUntaxedAmount:allAmountNum.moldUntaxedAmount, moldUntaxedAmount:allAmountNum.moldUntaxedAmount,
// //
@ -92,17 +92,17 @@
// - // -
materialsTaxAmount: materialsTaxAmount, materialsTaxAmount: materialsTaxAmount,
// -= + // -= +
materialsTaxTotal: (Number(materialsUntaxedAmount) + Number(materialsTaxAmount)).toFixed(2), materialsTaxTotal: Math.round((Number(materialsUntaxedAmount) + Number(materialsTaxAmount))* 100) / 100,
// //
alreadyMoldUntaxedAmount: alreadyMoldUntaxedAmount, alreadyMoldUntaxedAmount: alreadyMoldUntaxedAmount,
// //
alreadyMoldTaxAmount: alreadyMoldTaxAmount, alreadyMoldTaxAmount: alreadyMoldTaxAmount,
// =- // =-
moldTaxAmountDiff: (Number(alreadyMoldUntaxedAmount) - Number(allAmountNum.moldUntaxedAmount)).toFixed(2), moldTaxAmountDiff: Math.round((Number(alreadyMoldUntaxedAmount) - Number(allAmountNum.moldUntaxedAmount))* 100) / 100,
// =+ // =+
alreadyMoldTaxTotal: (Number(alreadyMoldUntaxedAmount) + Number(alreadyMoldTaxAmount)).toFixed(2), alreadyMoldTaxTotal: Math.round((Number(alreadyMoldUntaxedAmount) + Number(alreadyMoldTaxAmount))* 100) / 100,
// alreadyMoldTaxAmount = - // alreadyMoldTaxAmount = -
moldTaxAmountDifference: (Number(allAmountNum.moldTaxAmount) - Number(alreadyMoldTaxAmount)).toFixed(2), moldTaxAmountDifference: Math.round((Number(allAmountNum.moldTaxAmount) - Number(alreadyMoldTaxAmount))* 100) / 100,
} }
formRef.value.setValues(sumObject) formRef.value.setValues(sumObject)
} }
@ -169,7 +169,7 @@ const onChange =async (field, cur, formRefParams)=>{
const allAmountNum = await getAllocationAmount(formRef.value.formRef.formModel.customerStatementNumber) const allAmountNum = await getAllocationAmount(formRef.value.formRef.formModel.customerStatementNumber)
console.log(99,allAmountNum) console.log(99,allAmountNum)
// // 2. mainTaxAmount = */100 // // 2. mainTaxAmount = */100
// let mainTaxAmount = Number(beforeTaxAmount*taxRate*0.01).toFixed(2) // let mainTaxAmount = Math.round(Number(beforeTaxAmount*taxRate*0.01)* 100) / 100
formRef.value.formRef.setValues({ formRef.value.formRef.setValues({
beforeTaxAmount: allAmountNum.beforeTaxAmount, beforeTaxAmount: allAmountNum.beforeTaxAmount,
// //
@ -196,8 +196,8 @@ const onChange =async (field, cur, formRefParams)=>{
moldTaxAmountDiff: allAmountNum.moldTaxAmountDiff, moldTaxAmountDiff: allAmountNum.moldTaxAmountDiff,
// =+ // =+
alreadyMoldTaxTotal: allAmountNum.alreadyMoldTaxTotal, alreadyMoldTaxTotal: allAmountNum.alreadyMoldTaxTotal,
// alreadyMoldTaxAmount = - // alreadyMoldTaxAmount = -
moldTaxAmountDifference: (Number(allAmountNum.moldTaxAmount) - Number(allAmountNum.alreadyMoldTaxAmount)).toFixed(2), moldTaxAmountDifference: Math.round((Number(allAmountNum.moldTaxAmount) - Number(allAmountNum.alreadyMoldTaxAmount))* 100) / 100,
}) })
} }
} else if (field == 'invoiceType') { } else if (field == 'invoiceType') {
@ -214,7 +214,7 @@ const inputNumberChange = (field, index, row, val) => {
row['allocationPrice'] = row['beforeTaxAmount']/row['qty'] - row['price'] row['allocationPrice'] = row['beforeTaxAmount']/row['qty'] - row['price']
// = + // = +
row['sumPrice'] = (row['price'] + row['allocationPrice']).toFixed(11) row['sumPrice'] =Math.round((row['price'] + row['allocationPrice'])* 100000000000) / 100000000000
// taxAmount */100,2 // taxAmount */100,2
row['taxAmount'] = (row['beforeTaxAmount'] * formRef.value.formRef.formModel['taxRate'])/100 // row['taxAmount'] = (row['beforeTaxAmount'] * formRef.value.formRef.formModel['taxRate'])/100 //
@ -349,9 +349,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
// //
const initTableDataPrice = ()=>{ const initTableDataPrice = ()=>{
tableData.value.forEach(item=>{ tableData.value.forEach(item=>{
item['sumPrice'] = (item['price'] + item['allocationPrice']).toFixed(11) item['sumPrice'] = Math.round((item['price'] + item['allocationPrice'])* 100000000000) / 100000000000
// *2 // *2
item['beforeTaxAmount'] = Number(new Decimal(Number(item['sumPrice'])).mul(new Decimal(item['qty'])).toNumber().toFixed(2)) item['beforeTaxAmount'] = Math.round((new Decimal(Number(item['sumPrice'])).mul(new Decimal(item['qty'])).toNumber())* 100) / 100
// taxAmount */100,2 // taxAmount */100,2
item['taxAmount'] = (item['beforeTaxAmount'] * formRef.value.formRef.formModel['taxRate'])/100 // item['taxAmount'] = (item['beforeTaxAmount'] * formRef.value.formRef.formModel['taxRate'])/100 //
@ -389,31 +389,31 @@ const getAllocationAmount = async (customerStatementNumber) => {
const res = await CustomerSaleInvoiceMainApi.getAllocationAmount(curNumber.value,customerStatementNumber, formRef.value.formRef.formModel.taxRate) const res = await CustomerSaleInvoiceMainApi.getAllocationAmount(curNumber.value,customerStatementNumber, formRef.value.formRef.formModel.taxRate)
return { return {
// //
beforeTaxAmount:res?.mainBeforeTaxAmount?.toFixed(2) || '', beforeTaxAmount:res?.mainBeforeTaxAmount ? Math.round(res?.mainBeforeTaxAmount * 100) / 100 : '',
// //
taxAmount:res?.mainTaxAmount?.toFixed(2) || '', taxAmount:res?.mainTaxAmount ? Math.round(res?.mainTaxAmount * 100) / 100 : '',
// mainAdTaxAmount =+ // mainAdTaxAmount =+
adTaxAmount: res?.mainAdTaxAmount?.toFixed(2) || '', adTaxAmount: res?.mainAdTaxAmount?Math.round(res?.mainAdTaxAmount * 100) / 100 : '',
// //
moldUntaxedAmount:res?.moldUntaxedAmount?.toFixed(2) || '', moldUntaxedAmount:res?.moldUntaxedAmount? Math.round(res?.moldUntaxedAmount * 100) / 100 :'',
// //
moldTaxAmount:res?.moldTaxAmount?.toFixed(2) || '', moldTaxAmount:res?.moldTaxAmount?Math.round(res?.moldTaxAmount * 100) / 100 : '',
// //
moldTaxTotal:res?.moldTaxTotal?.toFixed(2) || '', moldTaxTotal:res?.moldTaxTotal?Math.round(res?.moldTaxTotal * 100) / 100: '',
// - // -
materialsUntaxedAmount: res?.materialsUntaxedAmount?.toFixed(2) || '', materialsUntaxedAmount: res?.materialsUntaxedAmount?Math.round(res?.materialsUntaxedAmount * 100) / 100 : '',
// - // -
materialsTaxAmount: res?.materialsTaxAmount?.toFixed(2) || '', materialsTaxAmount: res?.materialsTaxAmount? Math.round(res?.materialsTaxAmount * 100) / 100 : '',
// -= + // -= +
materialsTaxTotal:res?.materialsTaxTotal?.toFixed(2) || '', materialsTaxTotal:res?.materialsTaxTotal? Math.round(res?.materialsTaxTotal * 100) / 100: '',
// //
alreadyMoldUntaxedAmount: res?.alreadyMoldUntaxedAmount?.toFixed(2) || '', alreadyMoldUntaxedAmount: res?.alreadyMoldUntaxedAmount? Math.round(res?.alreadyMoldUntaxedAmount * 100) / 100 :'',
// //
alreadyMoldTaxAmount: res?.alreadyMoldTaxAmount?.toFixed(2) || '', alreadyMoldTaxAmount: res?.alreadyMoldTaxAmount ? Math.round(res?.alreadyMoldTaxAmount * 100) / 100: '',
// =- // =-
moldTaxAmountDiff: res?.moldTaxAmountDiff?.toFixed(2) || '', moldTaxAmountDiff: res?.moldTaxAmountDiff?Math.round(res?.moldTaxAmountDiff * 100) / 100: '',
// =+ // =+
alreadyMoldTaxTotal: res?.alreadyMoldTaxTotal?.toFixed(2) || '', alreadyMoldTaxTotal: res?.alreadyMoldTaxTotal? Math.round(res?.alreadyMoldTaxTotal * 100) / 100 : '',
} }
} }
defineExpose({openForm,openFormTable}) defineExpose({openForm,openFormTable})

8
src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/index.vue

@ -64,13 +64,13 @@
@handleMainFefresh='handleMainFefresh' @handleMainFefresh='handleMainFefresh'
> >
<template #taxAmount="scrop"> <template #taxAmount="scrop">
{{scrop.row.taxAmount.toFixed(2)}} {{ Math.round(scrop.row.taxAmount * 100) / 100}}
</template> </template>
<template #afterTaxAmount="scrop"> <template #afterTaxAmount="scrop">
{{scrop.row.afterTaxAmount.toFixed(2)}} {{Math.round(scrop.row.afterTaxAmount * 100) / 100}}
</template> </template>
<template #beforeTaxAmount="scrop"> <template #beforeTaxAmount="scrop">
{{scrop.row.beforeTaxAmount.toFixed(2)}} {{Math.round(scrop.row.beforeTaxAmount * 100) / 100}}
</template> </template>
</Detail> </Detail>
@ -351,7 +351,7 @@ const detailBasicFormOnChange = (field, cur, formRef1) => {
const { beforeTaxAmount = 0, taxAmount = 0, qty = 0, price, allocationPrice, taxRate = 1 } = formRef1.value.formModel const { beforeTaxAmount = 0, taxAmount = 0, qty = 0, price, allocationPrice, taxRate = 1 } = formRef1.value.formModel
formRef1.value.setValues({ formRef1.value.setValues({
// = +,2 // = +,2
afterTaxAmount: Number((Number(beforeTaxAmount) + Number(taxAmount)).toFixed(2)), afterTaxAmount: Math.round((Number(beforeTaxAmount) + Number(taxAmount)) * 100) / 100,
// /- // /-
allocationPrice: Number(Number(Number(beforeTaxAmount)/Number(qty)) - Number(price)), allocationPrice: Number(Number(Number(beforeTaxAmount)/Number(qty)) - Number(price)),
// = + // = +

4
src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts

@ -1299,7 +1299,7 @@ export const accountantFormartDetail = ( cellValue) => {
return '' return ''
} }
cellValue = cellValue + '' || '' cellValue = cellValue + '' || ''
cellValue = Math.round(Number(cellValue) * 100) / 100 cellValue = String(Math.round(Number(cellValue) * 100) / 100)
let x = cellValue.split('.') let x = cellValue.split('.')
let x1 = x[0] let x1 = x[0]
let x2 = x.length > 1 ? '.' + x[1] : '' let x2 = x.length > 1 ? '.' + x[1] : ''
@ -1942,7 +1942,7 @@ export const SupplierinvoiceRequestDetailMain = useCrudSchemas(reactive<CrudSche
])) ]))
const singlePriceFormart = (row, column, cellValue) => { const singlePriceFormart = (row, column, cellValue) => {
cellValue = Math.round(Number(cellValue) * 100000) / 100000 cellValue = String(Math.round(Number(cellValue) * 100000) / 100000)
cellValue = cellValue + '' || '' cellValue = cellValue + '' || ''
let x = cellValue.split('.') let x = cellValue.split('.')

Loading…
Cancel
Save