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) => { export const getAllocationAmount = async (number: string, customerNumber: string, rate: any) => {
return await request.get({ url: `/wms/customer-tool-apport-statement-detail/getAllocationAmount?customerNumber=` + customerNumber + '&rate=' + rate }) 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( watch(
() => unref(formRef)?.formModel, () => unref(formRef)?.formModel,
async () => { async () => {
console.log(877,unref(formRef)?.formModel)
if (props?.sumFormDataByForm && unref(formRef)?.formModel) { if (props?.sumFormDataByForm && unref(formRef)?.formModel) {
props?.sumFormDataByForm( props?.sumFormDataByForm(
formRef, formRef,

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

@ -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})

Loading…
Cancel
Save