|
|
|
@ -1801,7 +1801,8 @@ export default {
|
|
|
|
|
settlementTotalNoOptions: [],
|
|
|
|
|
remark: '',
|
|
|
|
|
remarkOptions: [],
|
|
|
|
|
enabledmark: undefined
|
|
|
|
|
enabledmark: undefined,
|
|
|
|
|
businessOrderId: undefined
|
|
|
|
|
},
|
|
|
|
|
cwaccountsummaryList: {
|
|
|
|
|
productId: '',
|
|
|
|
@ -2956,8 +2957,12 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
sameReduce(arr) {
|
|
|
|
|
let result = arr.reduce((acc, cur) => {
|
|
|
|
|
// let found = acc.find((item) => {
|
|
|
|
|
// return item.productId === cur.productId
|
|
|
|
|
// })
|
|
|
|
|
debugger
|
|
|
|
|
let found = acc.find((item) => {
|
|
|
|
|
return item.productId === cur.productId
|
|
|
|
|
return item.businessOrderId === cur.businessOrderId && item.productId === cur.productId
|
|
|
|
|
})
|
|
|
|
|
if (found) {
|
|
|
|
|
found.settlementSum = this.jnpf.floatAdd(Number(found.settlementSum), Number(cur.settlementSum)).toFixed(4);
|
|
|
|
@ -2971,7 +2976,7 @@ export default {
|
|
|
|
|
found.otherExpenses = this.jnpf.floatSub(Number(found.otherExpenses), Number(cur.otherExpenses)).toFixed(2);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
acc.push({ productId: cur.productId, productName: cur.productName, spec: cur.spec, rate: cur.rate, settlementSum: cur.settlementSum, settlementTotal: cur.settlementTotal, settlementUnit: cur.unit, settlementPrice: cur.settlementPrice, settlementSubtotal: cur.settlementSubtotal, settlementPriceNo: cur.settlementPriceNo, settlementSubtotalNo: cur.settlementSubtotalNo, otherType: cur.otherType, otherExpenses: cur.otherExpenses, settlementTotal: cur.settlementTotal, settlementTotalNo: cur.settlementTotalNo })
|
|
|
|
|
acc.push({ productId: cur.productId, productName: cur.productName, spec: cur.spec, rate: cur.rate, settlementSum: cur.settlementSum, settlementTotal: cur.settlementTotal, settlementUnit: cur.unit, settlementPrice: cur.settlementPrice, settlementSubtotal: cur.settlementSubtotal, settlementPriceNo: cur.settlementPriceNo, settlementSubtotalNo: cur.settlementSubtotalNo, otherType: cur.otherType, otherExpenses: cur.otherExpenses, settlementTotal: cur.settlementTotal, settlementTotalNo: cur.settlementTotalNo, businessOrderId: cur.businessOrderId })
|
|
|
|
|
}
|
|
|
|
|
return acc
|
|
|
|
|
}, [])
|
|
|
|
@ -2986,32 +2991,32 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
debugger
|
|
|
|
|
var data = JSON.parse(JSON.stringify(this.dataForm.cwaccountstorageList))
|
|
|
|
|
var order = this.dataForm.cwaccountstorageList[0].orderCode
|
|
|
|
|
console.log(order);
|
|
|
|
|
var dataProduct = JSON.parse(JSON.stringify(this.dataForm.cwaccountvoucherList))
|
|
|
|
|
var productid = this.dataForm.cwaccountvoucherList[0].productId
|
|
|
|
|
|
|
|
|
|
// var data = JSON.parse(JSON.stringify(this.dataForm.cwaccountstorageList))
|
|
|
|
|
// var order = this.dataForm.cwaccountstorageList[0].orderCode
|
|
|
|
|
// console.log(order);
|
|
|
|
|
// var dataProduct = JSON.parse(JSON.stringify(this.dataForm.cwaccountvoucherList))
|
|
|
|
|
// var productid = this.dataForm.cwaccountvoucherList[0].productId
|
|
|
|
|
// data.forEach(item => {
|
|
|
|
|
// dataProduct.forEach(item1 => {
|
|
|
|
|
// // const flag = this.dataForm.cwaccountstorageList.find(e => e.orderCode == order)
|
|
|
|
|
// // if (item.orderCode == order && item1.productId == productid) {
|
|
|
|
|
// if (item.orderCode == order) {
|
|
|
|
|
// this.dataForm.cwaccountsummaryList = this.sameReduce(this.dataForm.cwaccountvoucherList);
|
|
|
|
|
// } else {
|
|
|
|
|
// this.dataForm.cwaccountsummaryList = this.dataForm.cwaccountvoucherList;
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
data.forEach(item => {
|
|
|
|
|
dataProduct.forEach(item1 => {
|
|
|
|
|
debugger
|
|
|
|
|
// const flag = this.dataForm.cwaccountstorageList.find(e => e.orderCode == order)
|
|
|
|
|
if (item.orderCode == order && item1.productId == productid) {
|
|
|
|
|
this.dataForm.cwaccountsummaryList = this.sameReduce(this.dataForm.cwaccountvoucherList);
|
|
|
|
|
} else {
|
|
|
|
|
this.dataForm.cwaccountsummaryList = this.dataForm.cwaccountvoucherList;
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.dataForm.cwaccountsummaryList = this.sameReduce(this.dataForm.cwaccountvoucherList);
|
|
|
|
|
this.dataForm.cwaccountsummaryList.forEach(item => {
|
|
|
|
|
item.settlementPrice = this.jnpf.floatDiv(item.settlementSubtotal, item.settlementSum);
|
|
|
|
|
item.settlementPriceNo = this.jnpf.floatDiv(item.settlementSubtotalNo, item.settlementSum);
|
|
|
|
|
console.log(item.settlementPriceNo + "111");
|
|
|
|
|
})
|
|
|
|
|
// this.dataForm.cwaccountsummaryList = this.sameReduce(this.dataForm.cwaccountvoucherList);
|
|
|
|
|
// this.dataForm.cwaccountsummaryList.forEach(item => {
|
|
|
|
|
// item.settlementPrice = this.jnpf.floatDiv(item.settlementSubtotal, item.settlementSum);
|
|
|
|
|
// item.settlementPriceNo = this.jnpf.floatDiv(item.settlementSubtotalNo, item.settlementSum);
|
|
|
|
|
// console.log(item.settlementPriceNo + "111");
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
// console.log(this.dataForm.cwaccountsummaryList + "111");
|
|
|
|
|
/* let item = {
|
|
|
|
|
productId: undefined,
|
|
|
|
|