diff --git a/src/components/Common/CommonBillEvent.js b/src/components/Common/CommonBillEvent.js index 89bd8ce..8eef526 100644 --- a/src/components/Common/CommonBillEvent.js +++ b/src/components/Common/CommonBillEvent.js @@ -4591,23 +4591,9 @@ export default (ChildComponent) => { } /* 各种金额,税额,价格计算 */ let models = name === 'materials' ? 'Materials' : - sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials'; + sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('cashier/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials'; - if( sModelsType?.includes('cashier/')) { - tableDataRow.bSettleMoney = true;/* 收付款单 */ - if(sFieldName === 'dTotalMoney') { - tableDataRow[`d${models}Money`] =tableDataRow.dTotalMoney; - sFieldName = `d${models}Money`; - } else if(sFieldName === 'dTotalForeignPrice') { - tableDataRow[`d${models}ForeignPrice`] = tableDataRow.dTotalForeignPrice; - sFieldName = `d${models}ForeignPrice` - } - } - if( sModelsType === 'sales/adjust') { - tableDataRow.dProductMoney = tableDataRow.dTotalMoney; - sFieldName = 'dProductMoney'; - } 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') { @@ -5046,9 +5032,9 @@ export default (ChildComponent) => { tableDataRow[`d${models}Money`] = tableDataRow.dTotalMoney; } - if( sModelsType === 'sales/adjust') { - tableDataRow.dProductMoney = tableDataRow.dTotalMoney; - controlField = 'dProductMoney'; + if( sModelsType === 'sales/adjust') { /* 财务调整单 */ + // tableDataRow.dProductMoney = tableDataRow.dTotalMoney; + controlField = 'dProductForeignMoney'; } tableDataRow = commonBusiness.getCalculateAllMoney(app, models, controlField, returnData.masterData, tableDataRow); tableDataRow.handleType = commonUtils.isEmpty(tableDataRow.handleType) ? 'update' : tableDataRow.handleType; diff --git a/src/components/QuickQuote/index.jsx b/src/components/QuickQuote/index.jsx index 3e11a4e..abd9293 100644 --- a/src/components/QuickQuote/index.jsx +++ b/src/components/QuickQuote/index.jsx @@ -30,7 +30,7 @@ const QuickQuoteEvent = props => { return pre; }, {}); - const { slaveData = [], manyData = [] } = result; + const { slaveData = [], manyData = [], masterData = {} } = result; const materialInfoFields = [ "sMaterialsName", "sMaterialsNo", @@ -75,7 +75,14 @@ const QuickQuoteEvent = props => { return item; }); - return { ...result, slaveData: slaveDataNew, manyData: manyDataNew }; + const { sType, sCustomerId, sCustomerName } = props.app.userinfo; + const bCustomer = sType === "Customer"; + if (bCustomer && !masterData.sCustomerId) { + masterData.sCustomerName = sCustomerName; + masterData.sCustomerId = sCustomerId; + } + + return { ...result, masterData, slaveData: slaveDataNew, manyData: manyDataNew }; }; const sQuoConfig = commonUtils.convertStrToObj(props.masterData.sQuoConfig, {}); @@ -1233,12 +1240,25 @@ const QuickQuoteEvent = props => { sParentId: newState.masterData.sId, })); + let hasCalled = false; + setState(pre => { - const preNew = { ...pre, manyData: result.manyqtysData, calcPriceLoading: false, calcPriceFinished: true }; + const preNew = { + ...pre, + manyData: result.manyqtysData, + calcPriceLoading: false, + calcPriceFinished: true, + }; + const stateNew = { ...newState, ...result }; + + if (hasCalled) return preNew; // 防止重复执行 + hasCalled = true; + props.onSaveState(stateNew, () => { onSaveDraft(preNew, stateNew); }); + return preNew; }); } else { @@ -1640,7 +1660,22 @@ const MasterComponent = props => { const { app } = props; if (!masterConfig) return ""; - const ableConfigs = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible); + const { userinfo } = app; + const { sType } = userinfo; + const bCustomer = sType === "Customer"; + + const ableConfigs = masterConfig.gdsconfigformslave + .filter(item => item.sName && item.bVisible) + .map(item => { + if (item.sName === "sCustomerName" && bCustomer) { + return { + ...item, + iTag: 1, + }; + } else { + return item; + } + }); const JosnAbleConfigs = JSON.parse(JSON.stringify(ableConfigs)); // 处理长宽样式 // selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sProductType !== "不干胶"