Browse Source

销售开票问题

intex_online20250427
张立 1 month ago
parent
commit
fec4a79cc4
  1. 4
      src/api/wms/customerSaleInvoiceMain/index.ts
  2. 1
      src/components/BasicForm/src/BasicForm.vue
  3. 82
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue

4
src/api/wms/customerSaleInvoiceMain/index.ts

@ -101,6 +101,6 @@ export const getRecordCustomerList = async () => {
}
// 选择税率获取模具税额和模具含税金额
export const getAllocationAmount = async (customerNumber: string, rate: any) => {
return await request.get({ url: `/wms/customer-tool-apport-statement-detail/getAllocationAmount?customerNumber=` + customerNumber + '&rate=' + rate })
export const getAllocationAmount = async (number: string, customerNumber: string, rate: any) => {
return await request.get({ url: `/wms/customer-tool-apport-statement-detail/getAllocationAmount?number=${number}&customerNumber=${customerNumber}&rate=${rate}` })
}

1
src/components/BasicForm/src/BasicForm.vue

@ -721,6 +721,7 @@ const sumFormDataHandle1 = () => {
watch(
() => unref(formRef)?.formModel,
async () => {
console.log(877,unref(formRef)?.formModel)
if (props?.sumFormDataByForm && unref(formRef)?.formModel) {
props?.sumFormDataByForm(
formRef,

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

@ -22,7 +22,7 @@
@inputNumberChange="inputNumberChange"
@onChange="onChange"
:sumFormDataByForm="
(
async (
formRef,
formModel,
tableData,
@ -54,14 +54,6 @@
}
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 curNumber = ref('')
const openType = ref('')
const openForm =async (type: string, row?: any) => {
CustomerSaleInvoiceMain.allSchemas.formSchema.forEach((item) => {
if(item.field == 'customerStatementNumber'){
@ -139,6 +133,8 @@ const openForm =async (type: string, row?: any) => {
}
})
tableData.value = [] //
curNumber.value = type == 'update' ? row.number : ''
openType.value = type
formRef.value.open(type, row)
}
@ -159,7 +155,7 @@ const openFormTable =async (type: string, row?: any, list?:any) => {
})
}
const showTypeList = ref([])
const onChange =async (field, cur, formRef)=>{
const onChange =async (field, cur, formRefParams)=>{
if(field == 'taxRate'){
// taxAmount */100,2
tableData.value.forEach(item=>{
@ -167,6 +163,39 @@ const onChange =async (field, cur, formRef)=>{
// = +,2
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') {
showTypeList.value = cur
// if (cur == '') {
@ -352,12 +381,35 @@ const tableSelectionDelete = (selection) => {
tableData.value = tableData.value.filter(item => !selection.includes(item))
}
// ,
const getAllocationAmount = async (number) => {
const res = await CustomerSaleInvoiceMainApi.getAllocationAmount(number, formRef.value.formRef.formModel.taxRate)
const getAllocationAmount = async (customerStatementNumber) => {
const res = await CustomerSaleInvoiceMainApi.getAllocationAmount(curNumber.value,customerStatementNumber, formRef.value.formRef.formModel.taxRate)
return {
moldUntaxedAmount:res.moldUntaxedAmount.toFixed(2),//
moldTaxAmount:res.moldTaxAmount.toFixed(2),// *
moldTaxTotal:res.moldTaxTotal.toFixed(2),//+
//
beforeTaxAmount:res?.mainBeforeTaxAmount?.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})

Loading…
Cancel
Save