Browse Source

Merge remote-tracking branch 'remotes/origin/intex_online20250427' into intex

intex
刘忱 3 days ago
parent
commit
3120699678
  1. 7
      src/api/wms/customerSaleInvoiceMain/index.ts
  2. 13
      src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts
  3. 95
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/CustomerSaleInvoiceBasicForm.vue
  4. 27
      src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts

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

@ -98,4 +98,9 @@ export const getCustomerList = async () => {
// 从客户对账单中获取客户代码 -- 销售记录 // 从客户对账单中获取客户代码 -- 销售记录
export const getRecordCustomerList = async () => { export const getRecordCustomerList = async () => {
return await request.get({ url: `/wms/customer-sale-invoice-record-main/getCustomerList`}) return await request.get({ url: `/wms/customer-sale-invoice-record-main/getCustomerList`})
} }
// 选择税率获取模具税额和模具含税金额
export const getAllocationAmount = async (customerNumber: string, rate: any) => {
return await request.get({ url: `/wms/customer-tool-apport-statement-detail/getAllocationAmount?customerNumber=` + customerNumber + '&rate=' + rate })
}

13
src/views/wms/deliversettlementManage/customerSaleInvoiceRecordMain/customerSaleInvoiceRecordMain.data.ts

@ -325,7 +325,20 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
disabled: true, disabled: true,
} }
}, },
},
{
label: '已分摊价税合计',
field: 'alreadyMoldTaxTotal',
formatter: accountantFormart,
table: {
width: 160
}, },
form: {
componentProps: {
disabled: true,
}
},
},
{ {
label: '模具未税差异', label: '模具未税差异',
field: 'moldTaxAmountDiff', field: 'moldTaxAmountDiff',

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

@ -44,14 +44,10 @@
moldUntaxedAmount=0, moldUntaxedAmount=0,
materialsUntaxedAmount=0, materialsUntaxedAmount=0,
alreadyMoldUntaxedAmount=0 alreadyMoldUntaxedAmount=0
} = formModel } = formModel
// 2X*2 // 2X*2
if (formType == 'update') { if (formType == 'update') {
// //
console.log('taxRate', taxRate)
console.log('originFormModel', originFormModel.taxRate)
console.log('taxAmount', taxAmount)
if (taxRate != originFormModel.taxRate) { if (taxRate != originFormModel.taxRate) {
if (originFormModel) { if (originFormModel) {
sumFormDataHandle1() sumFormDataHandle1()
@ -86,51 +82,49 @@
} }
" "
:sumFormDataByTableCustom=" :sumFormDataByTableCustom="
(formRef, formModel, tableData) => { async (formRef, formModel, tableData) => {
const { taxRate = 0 } = formModel const { taxRate = 0,moldUntaxedAmount=0 } = formModel
// 1 mainBeforeTaxAmount : // 1 mainBeforeTaxAmount : *
let mainBeforeTaxAmount = tableData.reduce((prev, item) =>prev + Number(item['beforeTaxAmount'].toFixed(2)),0).toFixed(2) let mainBeforeTaxAmount = tableData.reduce((prev, item) =>prev + Number((Number(item['sumPrice'])*Number(item['qty'])).toFixed(2)),0).toFixed(2)
// 2 mainTaxAmount = */100 // 2 mainTaxAmount = *
let mainTaxAmount = Number(mainBeforeTaxAmount * taxRate * 0.01).toFixed(2) let mainTaxAmount = tableData.reduce((prev, item) =>prev + Number((Number(item['beforeTaxAmount'])*Number(taxRate)*0.01).toFixed(2)),0).toFixed(2)
// 3 moldUntaxedAmount : moldUntaxedAmount
let moldUntaxedAmount = tableData[0].moldUntaxedAmount
// 4 moldTaxAmount = */100
let moldTaxAmount = Number(Number(moldUntaxedAmount) * Number(taxRate) * 0.01).toFixed(2)
// 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 = tableData.reduce((prev, item) =>prev + Number((Number(item['price'])*Number(item['qty'])).toFixed(2)),0).toFixed(2)
// 6 materialsTaxAmount = */100 // 6 materialsTaxAmount = *
let materialsTaxAmount = Number(Number(materialsUntaxedAmount) * Number(taxRate) * 0.01).toFixed(2) let materialsTaxAmount =tableData.reduce((prev, item) =>prev + Number((Number(item['beforeTaxAmount'])*Number(taxRate)*0.01).toFixed(2)),0).toFixed(2)
//  7=* //  7= *
let alreadyMoldUntaxedAmount = tableData.reduce((prev, item) =>prev + Number((Number(item['allocationPrice'])*Number(item['qty'])).toFixed(2)),0).toFixed(2) let alreadyMoldUntaxedAmount = tableData.reduce((prev, item) =>prev + Number((Number(item['allocationPrice'])*Number(item['qty'])).toFixed(2)),0).toFixed(2)
// 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 = tableData.reduce((prev, item) => prev + Number((Number((Number(item['allocationPrice']) * Number(item['qty'])).toFixed(2)) * Number(taxRate) * 0.01).toFixed(2)), 0).toFixed(2)
const allAmountNum = await getAllocationAmount(formModel.customerStatementNumber)
const sumObject = { const sumObject = {
// //
beforeTaxAmount:mainBeforeTaxAmount, beforeTaxAmount:mainBeforeTaxAmount,
// //
taxAmount:mainTaxAmount, taxAmount:mainTaxAmount,
// mainAdTaxAmount =+ // mainAdTaxAmount =+
adTaxAmount:(Number(mainBeforeTaxAmount)+Number(mainTaxAmount)).toFixed(2), adTaxAmount: (Number(mainBeforeTaxAmount) + Number(mainTaxAmount)).toFixed(2),
// - //
moldUntaxedAmount: moldUntaxedAmount, moldUntaxedAmount:allAmountNum.moldUntaxedAmount,
// - //
moldTaxAmount:moldTaxAmount, moldTaxAmount:allAmountNum.moldTaxAmount,
// - = + //
moldTaxTotal: (Number(moldUntaxedAmount) + Number(moldTaxAmount)).toFixed(2), moldTaxTotal:allAmountNum.moldTaxTotal,
// - // -
materialsUntaxedAmount: materialsUntaxedAmount, materialsUntaxedAmount: materialsUntaxedAmount,
// - // -
materialsTaxAmount: materialsTaxAmount, materialsTaxAmount: materialsTaxAmount,
// -= + // -= +
materialsTaxTotal: (Number(materialsUntaxedAmount) + Number(materialsTaxAmount)).toFixed(2), materialsTaxTotal: (Number(materialsUntaxedAmount) + Number(materialsTaxAmount)).toFixed(2),
// //
alreadyMoldUntaxedAmount: alreadyMoldUntaxedAmount, alreadyMoldUntaxedAmount: alreadyMoldUntaxedAmount,
// //
alreadyMoldTaxAmount: alreadyMoldTaxAmount, alreadyMoldTaxAmount: alreadyMoldTaxAmount,
// =- // =-
moldTaxAmountDiff: (Number(alreadyMoldUntaxedAmount) - Number(moldUntaxedAmount)).toFixed(2), moldTaxAmountDiff: (Number(alreadyMoldUntaxedAmount) - Number(allAmountNum.moldUntaxedAmount)).toFixed(2),
// =+
alreadyMoldTaxTotal: (Number(alreadyMoldUntaxedAmount) + Number(alreadyMoldTaxAmount)).toFixed(2),
} }
formRef.value.setValues(sumObject) formRef.value.setValues(sumObject)
} }
@ -176,13 +170,12 @@ const openFormTable =async (type: string, row?: any, list?:any) => {
}) })
tableData.value = list // tableData.value = list //
formRef.value.open(type, row) formRef.value.open(type, row)
nextTick(()=>{ nextTick(async()=>{
initTableDataPrice() initTableDataPrice()
}) })
} }
const showTypeList = ref([]) const showTypeList = ref([])
const onChange = (field, cur, formRef)=>{ const onChange =async (field, cur, formRef)=>{
console.log('onChange',field, cur, formRef)
if(field == 'taxRate'){ if(field == 'taxRate'){
// taxAmount */100,2 // taxAmount */100,2
tableData.value.forEach(item=>{ tableData.value.forEach(item=>{
@ -198,9 +191,6 @@ const onChange = (field, cur, formRef)=>{
} }
} }
const inputNumberChange = (field, index, row, val) => { const inputNumberChange = (field, index, row, val) => {
console.log('inputNumberChange',field, index, row, val)
console.log(row['beforeTaxAmount'])
console.log(row['taxAmount'])
// /- // /-
@ -258,7 +248,6 @@ const submitForm = async (formType, submitData) => {
return; return;
} }
} }
console.log(data.beginTime)
if(!data.beginTime)data.beginTime = null; if(!data.beginTime)data.beginTime = null;
if(!data.planDate)data.planDate = null; if(!data.planDate)data.planDate = null;
if(!data.endTime)data.endTime = null; if(!data.endTime)data.endTime = null;
@ -317,16 +306,20 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
// //
setV['customerCode'] = val[0]['customerCode'] setV['customerCode'] = val[0]['customerCode']
setV['customerName'] = val[0]['customerName'] setV['customerName'] = val[0]['customerName']
CustomerStatementDetailApi.getCustomerStatementDetailPage({
pageNo:1, let detailRes = await CustomerStatementDetailApi.pageInvoice(val[0].id)
pageSize: 50000, tableData.value = detailRes.list && detailRes.list.length > 0 ? detailRes.list : []
masterId:val[0]['id'] initTableDataPrice()
}).then((res) => { // CustomerStatementDetailApi.getCustomerStatementDetailPage({
console.log(55,res) // pageNo:1,
tableData.value = res.list && res.list.length > 0 ?res.list : [] // pageSize: 50000,
initTableDataPrice() // masterId:val[0]['id']
// }).then((res) => {
// console.log(55,res)
// tableData.value = res.list && res.list.length > 0 ?res.list : []
// initTableDataPrice()
}) // })
// tableData.value = [] // tableData.value = []
} }
@ -348,6 +341,8 @@ const initTableDataPrice = ()=>{
// +,2 // +,2
item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] // item['afterTaxAmount'] = item['beforeTaxAmount'] + item['taxAmount'] //
// 0
item['allocationPrice'] = item['allocationPrice'] || 0
}) })
} }
@ -372,7 +367,15 @@ const handleDeleteTable = (item, index) => {
const tableSelectionDelete = (selection) => { 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 res = await CustomerSaleInvoiceMainApi.getAllocationAmount(number, formRef.value.formRef.formModel.taxRate)
return {
moldUntaxedAmount:res.moldUntaxedAmount.toFixed(2),//
moldTaxAmount:res.moldTaxAmount.toFixed(2),// *
moldTaxTotal:res.moldTaxTotal.toFixed(2),//+
}
}
defineExpose({openForm,openFormTable}) defineExpose({openForm,openFormTable})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

27
src/views/wms/deliversettlementManage/customerSaleInvoiceRequestMain/customerSaleInvoiceRequestMain.data.ts

@ -330,6 +330,19 @@ export const CustomerSaleInvoiceMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
}, },
{
label: '已分摊价税合计',
field: 'alreadyMoldTaxTotal',
formatter: accountantFormart,
table: {
width: 160
},
form: {
componentProps: {
disabled: true,
}
},
},
{ {
label: '模具未税差异', label: '模具未税差异',
field: 'moldTaxAmountDiff', field: 'moldTaxAmountDiff',
@ -622,12 +635,14 @@ form:{
form: { form: {
componentProps: { componentProps: {
type: 'InputNumber', type: 'InputNumber',
disabled: true disabled: true,
precision: 5
} }
}, },
tableForm: { tableForm: {
type: 'InputNumber', type: 'InputNumber',
disabled: true disabled: true,
precision: 5
} }
}, },
{ {
@ -638,13 +653,13 @@ form:{
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
disabled: true, disabled: true,
precision: 5 precision: 11
} }
}, },
tableForm: { tableForm: {
disabled: true, disabled: true,
type: 'InputNumber', type: 'InputNumber',
precision: 5, precision: 11,
} }
}, },
{ {
@ -654,12 +669,14 @@ form:{
form: { form: {
component: 'InputNumber', component: 'InputNumber',
componentProps: { componentProps: {
disabled: true disabled: true,
precision: 11,
} }
}, },
tableForm: { tableForm: {
disabled: true, disabled: true,
type: 'InputNumber', type: 'InputNumber',
precision: 11,
} }
}, },
{ {

Loading…
Cancel
Save