diff --git a/src/components/Common/CommonBillEvent.js b/src/components/Common/CommonBillEvent.js index 8eef526..041887e 100644 --- a/src/components/Common/CommonBillEvent.js +++ b/src/components/Common/CommonBillEvent.js @@ -4593,7 +4593,11 @@ export default (ChildComponent) => { let models = name === 'materials' ? 'Materials' : sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('cashier/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials'; - + if(sModelsType.includes('cashier/receipt') ) { /* 收款单 */ + models = 'Product'; + } else if(sModelsType.includes('cashier/payment') ) { /* 付款单 */ + models = 'Materials'; + } if (sModelsType.includes('purchase/') || sModelsType.includes('quotation/') || sModelsType.includes('manufacture/') || sModelsType.includes('materialsStock/') || sModelsType.includes('outside/') || sModelsType.includes('semigoodsStock/') || sModelsType.includes('sales/materials') || sModelsType === 'sales/salesCheck') { @@ -5775,7 +5779,17 @@ export default (ChildComponent) => { }); } - const dTotalMoney = masterData.dTotalMoney !== undefined ? masterData.dTotalMoney : 0; + let dTotalMoney = masterData.dTotalMoney !== undefined ? masterData.dTotalMoney : 0; + + if (dTotalMoney === 0) { + if (sModelsType === "cashier/payment") { + /* 付款单1 */ + dTotalMoney = masterData.dMaterialsMoney; + } else { + dTotalMoney = masterData.dProductMoney; + } + } + const models = sModelsType.includes("cashier/receipt") ? "Product" : "Materials"; let minusSum = 0; /* 负数求和 */ let minusRoundingSum = 0; /* 负数舍入求和 */ const minusData = []; /* 负数集 */ @@ -5785,6 +5799,8 @@ export default (ChildComponent) => { if (commonUtils.isNotEmptyArr(slaveData) && slaveData.length > 0) { slaveData.forEach((child) => { child.dTotalMoney = 0; + child.dProductMoney = 0; + child.dMaterialsMoney = 0; child.handleType = commonUtils.isEmpty(child.handleType) ? 'update' : child.handleType; child.dRoundingMoney = commonUtils.isNum(child.dRoundingMoney) ? child.dRoundingMoney : 0; child.dBalanceMoney = commonUtils.convertFixNum(child.dBalanceMoney, dNetMoney); /* 根据系统设定位数格式未付款金额*/ @@ -5864,6 +5880,25 @@ export default (ChildComponent) => { if (commonUtils.isNotEmptyArr(slaveData) && slaveData.length > 0) { slaveData.forEach((item, index) => { slaveData[index].dTotalForeignMoney = commonUtils.convertFixNum(dCurrencyRate !== 0 ? item.dTotalMoney / dCurrencyRate : 0, dNetMoney); + slaveData[index].dProductForeignMoney = slaveData[index].dTotalForeignMoney; + slaveData[index].dMaterialsForeignMoney = slaveData[index].dTotalForeignMoney; + slaveData[index].dMaterialsMoney = slaveData[index].dTotalMoney; + slaveData[index].dProductMoney = slaveData[index].dTotalMoney; + console.log("111", slaveData[index]); + console.log("222", models); + if (models === "Materials" && commonUtils.isNotEmptyNumber(slaveData[index].dMaterialsQty)) { + const dQty = slaveData[index].dMaterialsQty; + const dMoney = slaveData[index].dMaterialsMoney; + slaveData[index].dMaterialsPrice = commonUtils.convertFixNum(dMoney / dQty, 6); + slaveData[index].dMaterialsForeignPrice = commonUtils.convertFixNum(slaveData[index].dMaterialsForeignMoney / dQty, 6); + } else if (commonUtils.isNotEmptyNumber(slaveData[index].dProductQty)) { + const dQty = slaveData[index].dProductQty; + const dMoney = slaveData[index].dProductMoney; + slaveData[index].dProductPrice = commonUtils.convertFixNum(dMoney / dQty, 6); + slaveData[index].dProductForeignPrice = commonUtils.convertFixNum(slaveData[index].dProductForeignMoney / dQty, 6); + } + + console.log("eeeee", slaveData[index]); }); } masterData.handleType = commonUtils.isEmpty(masterData.handleType) ? 'update' : masterData.handleType; @@ -5906,6 +5941,23 @@ export default (ChildComponent) => { if (commonUtils.isNotEmptyArr(slaveData) && slaveData.length > 0) { slaveData.forEach((item, index) => { slaveData[index].dTotalForeignMoney = commonUtils.convertFixNum(dCurrencyRate !== 0 ? item.dTotalMoney / dCurrencyRate : 0, dNetMoney); + slaveData[index].dProductForeignMoney = slaveData[index].dTotalForeignMoney; + slaveData[index].dMaterialsForeignMoney = slaveData[index].dTotalForeignMoney; + slaveData[index].dMaterialsMoney = slaveData[index].dTotalMoney; + slaveData[index].dProductMoney = slaveData[index].dTotalMoney; + console.log("333", slaveData[index].dMaterialsQty); + console.log("441", models); + if (models === "Materials" && commonUtils.isNotEmptyNumber(slaveData[index].dMaterialsQty)) { + const dQty = slaveData[index].dMaterialsQty; + const dMoney = slaveData[index].dMaterialsMoney; + slaveData[index].dMaterialsPrice = commonUtils.convertFixNum(dMoney / dQty, 6); + slaveData[index].dMaterialsForeignPrice = commonUtils.convertFixNum(slaveData[index].dMaterialsForeignMoney / dQty, 6); + } else if (commonUtils.isNotEmptyNumber(slaveData[index].dProductQty)) { + const dQty = slaveData[index].dProductQty; + const dMoney = slaveData[index].dProductMoney; + slaveData[index].dProductPrice = commonUtils.convertFixNum(dMoney / dQty, 6); + slaveData[index].dProductForeignPrice = commonUtils.convertFixNum(slaveData[index].dProductForeignMoney / dQty, 6); + } }); } masterData.dAdvanceMoney = 0;