|
@ -22,7 +22,7 @@ |
|
|
@inputNumberChange="inputNumberChange" |
|
|
@inputNumberChange="inputNumberChange" |
|
|
@onChange="onChange" |
|
|
@onChange="onChange" |
|
|
:sumFormDataByForm=" |
|
|
:sumFormDataByForm=" |
|
|
( |
|
|
async ( |
|
|
formRef, |
|
|
formRef, |
|
|
formModel, |
|
|
formModel, |
|
|
tableData, |
|
|
tableData, |
|
@ -54,14 +54,6 @@ |
|
|
} |
|
|
} |
|
|
updateOriginFormModel(formModel) |
|
|
updateOriginFormModel(formModel) |
|
|
} |
|
|
} |
|
|
// 2.主数据税额 mainTaxAmount = 未税金额*税率/100 保留两位小数 |
|
|
|
|
|
let mainTaxAmount = Number(beforeTaxAmount*taxRate*0.01).toFixed(2) |
|
|
|
|
|
formRef.value.setValues({ |
|
|
|
|
|
// 主数据税额 |
|
|
|
|
|
taxAmount:mainTaxAmount, |
|
|
|
|
|
// 主数据价税合计金额:mainAdTaxAmount =未税金额+税额 |
|
|
|
|
|
adTaxAmount: (beforeTaxAmount + parseFloat(taxAmount)).toFixed(2), |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
" |
|
|
" |
|
@ -129,6 +121,8 @@ const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const formRef = ref() |
|
|
const formRef = ref() |
|
|
|
|
|
const curNumber = ref('') |
|
|
|
|
|
const openType = ref('') |
|
|
const openForm =async (type: string, row?: any) => { |
|
|
const openForm =async (type: string, row?: any) => { |
|
|
CustomerSaleInvoiceMain.allSchemas.formSchema.forEach((item) => { |
|
|
CustomerSaleInvoiceMain.allSchemas.formSchema.forEach((item) => { |
|
|
if(item.field == 'customerStatementNumber'){ |
|
|
if(item.field == 'customerStatementNumber'){ |
|
@ -139,6 +133,8 @@ const openForm =async (type: string, row?: any) => { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
tableData.value = [] // 重置明细数据 |
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
|
|
curNumber.value = type == 'update' ? row.number : '' |
|
|
|
|
|
openType.value = type |
|
|
formRef.value.open(type, row) |
|
|
formRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -159,7 +155,7 @@ const openFormTable =async (type: string, row?: any, list?:any) => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
const showTypeList = ref([]) |
|
|
const showTypeList = ref([]) |
|
|
const onChange =async (field, cur, formRef)=>{ |
|
|
const onChange =async (field, cur, formRefParams)=>{ |
|
|
if(field == 'taxRate'){ |
|
|
if(field == 'taxRate'){ |
|
|
// 税额:taxAmount 未税价格*税率/100,四舍五入保留2位小数 |
|
|
// 税额:taxAmount 未税价格*税率/100,四舍五入保留2位小数 |
|
|
tableData.value.forEach(item=>{ |
|
|
tableData.value.forEach(item=>{ |
|
@ -167,6 +163,39 @@ const onChange =async (field, cur, formRef)=>{ |
|
|
// 含税金额 = 未税价格+税额,四舍五入保留2位小数 |
|
|
// 含税金额 = 未税价格+税额,四舍五入保留2位小数 |
|
|
item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] |
|
|
item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] |
|
|
}) |
|
|
}) |
|
|
|
|
|
if (openType.value == 'update') { |
|
|
|
|
|
const allAmountNum = await getAllocationAmount(formRef.value.formRef.formModel.customerStatementNumber) |
|
|
|
|
|
console.log(99,allAmountNum) |
|
|
|
|
|
// // 2.主数据税额 mainTaxAmount = 未税金额*税率/100 保留两位小数 |
|
|
|
|
|
// let mainTaxAmount = Number(beforeTaxAmount*taxRate*0.01).toFixed(2) |
|
|
|
|
|
formRef.value.formRef.setValues({ |
|
|
|
|
|
beforeTaxAmount: allAmountNum.beforeTaxAmount, |
|
|
|
|
|
// 主数据税额 |
|
|
|
|
|
taxAmount:allAmountNum.taxAmount, |
|
|
|
|
|
// 主数据价税合计金额:mainAdTaxAmount =未税金额+税额 |
|
|
|
|
|
adTaxAmount: allAmountNum.adTaxAmount, |
|
|
|
|
|
// 主数据模具未税金额 |
|
|
|
|
|
moldUntaxedAmount:allAmountNum.moldUntaxedAmount, |
|
|
|
|
|
// 主数据模具税额 |
|
|
|
|
|
moldTaxAmount:allAmountNum.moldTaxAmount, |
|
|
|
|
|
// 主数据模具含税金额 |
|
|
|
|
|
moldTaxTotal:allAmountNum.moldTaxTotal, |
|
|
|
|
|
// 主数据-材料未税金额 |
|
|
|
|
|
materialsUntaxedAmount: allAmountNum.materialsUntaxedAmount, |
|
|
|
|
|
// 主数据-材料金额 |
|
|
|
|
|
materialsTaxAmount: allAmountNum.materialsTaxAmount, |
|
|
|
|
|
// 主数据-材料含税金额= 材料未税金额+材料税额 |
|
|
|
|
|
materialsTaxTotal:allAmountNum.materialsTaxTotal, |
|
|
|
|
|
// 主数据已分摊模具未税金额 |
|
|
|
|
|
alreadyMoldUntaxedAmount: allAmountNum.alreadyMoldUntaxedAmount, |
|
|
|
|
|
// 主数据已分摊模具税额 |
|
|
|
|
|
alreadyMoldTaxAmount: allAmountNum.alreadyMoldTaxAmount, |
|
|
|
|
|
// 主数据模具未税差异=已分摊模具未税金额-模具未税金额 |
|
|
|
|
|
moldTaxAmountDiff: allAmountNum.moldTaxAmountDiff, |
|
|
|
|
|
// 主数据已分摊价税合计=已分摊模具未税金额+已分摊模具税额 |
|
|
|
|
|
alreadyMoldTaxTotal: allAmountNum.alreadyMoldTaxTotal, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} else if (field == 'invoiceType') { |
|
|
} else if (field == 'invoiceType') { |
|
|
showTypeList.value = cur |
|
|
showTypeList.value = cur |
|
|
// if (cur == '补给品') { |
|
|
// if (cur == '补给品') { |
|
@ -352,12 +381,35 @@ const tableSelectionDelete = (selection) => { |
|
|
tableData.value = tableData.value.filter(item => !selection.includes(item)) |
|
|
tableData.value = tableData.value.filter(item => !selection.includes(item)) |
|
|
} |
|
|
} |
|
|
// 选择税率获取模具未税金额,模具税额和模具含税金额 |
|
|
// 选择税率获取模具未税金额,模具税额和模具含税金额 |
|
|
const getAllocationAmount = async (number) => { |
|
|
const getAllocationAmount = async (customerStatementNumber) => { |
|
|
const res = await CustomerSaleInvoiceMainApi.getAllocationAmount(number, formRef.value.formRef.formModel.taxRate) |
|
|
const res = await CustomerSaleInvoiceMainApi.getAllocationAmount(curNumber.value,customerStatementNumber, formRef.value.formRef.formModel.taxRate) |
|
|
return { |
|
|
return { |
|
|
moldUntaxedAmount:res.moldUntaxedAmount.toFixed(2),//模具未税金额(模具分摊对账单中各明细行的模具费用之和,先保留两位小数后再相加) |
|
|
// 主数据未税金额 |
|
|
moldTaxAmount:res.moldTaxAmount.toFixed(2),//模具税额(所关联的模具分摊对账单中所有明细行的(模具未税金额 * 税率),先保留两位小数再求和) |
|
|
beforeTaxAmount:res?.mainBeforeTaxAmount?.toFixed(2) || '', |
|
|
moldTaxTotal:res.moldTaxTotal.toFixed(2),//模具含税金额(模具未税金额+模具税额) |
|
|
// 主数据税额 |
|
|
|
|
|
taxAmount:res?.mainTaxAmount?.toFixed(2) || '', |
|
|
|
|
|
// 主数据价税合计金额:mainAdTaxAmount =未税金额+税额 |
|
|
|
|
|
adTaxAmount: res?.mainAdTaxAmount?.toFixed(2) || '', |
|
|
|
|
|
// 主数据模具未税金额 |
|
|
|
|
|
moldUntaxedAmount:res?.moldUntaxedAmount?.toFixed(2) || '', |
|
|
|
|
|
// 主数据模具税额 |
|
|
|
|
|
moldTaxAmount:res?.moldTaxAmount?.toFixed(2) || '', |
|
|
|
|
|
// 主数据模具含税金额 |
|
|
|
|
|
moldTaxTotal:res?.moldTaxTotal?.toFixed(2) || '', |
|
|
|
|
|
// 主数据-材料未税金额 |
|
|
|
|
|
materialsUntaxedAmount: res?.materialsUntaxedAmount?.toFixed(2) || '', |
|
|
|
|
|
// 主数据-材料金额 |
|
|
|
|
|
materialsTaxAmount: res?.materialsTaxAmount?.toFixed(2) || '', |
|
|
|
|
|
// 主数据-材料含税金额= 材料未税金额+材料税额 |
|
|
|
|
|
materialsTaxTotal:res?.materialsTaxTotal?.toFixed(2) || '', |
|
|
|
|
|
// 主数据已分摊模具未税金额 |
|
|
|
|
|
alreadyMoldUntaxedAmount: res?.alreadyMoldUntaxedAmount?.toFixed(2) || '', |
|
|
|
|
|
// 主数据已分摊模具税额 |
|
|
|
|
|
alreadyMoldTaxAmount: res?.alreadyMoldTaxAmount?.toFixed(2) || '', |
|
|
|
|
|
// 主数据模具未税差异=已分摊模具未税金额-模具未税金额 |
|
|
|
|
|
moldTaxAmountDiff: res?.moldTaxAmountDiff?.toFixed(2) || '', |
|
|
|
|
|
// 主数据已分摊价税合计=已分摊模具未税金额+已分摊模具税额 |
|
|
|
|
|
alreadyMoldTaxTotal: res?.alreadyMoldTaxTotal?.toFixed(2) || '', |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
defineExpose({openForm,openFormTable}) |
|
|
defineExpose({openForm,openFormTable}) |
|
|