Commit 83fcc1d495a7f8d4197bf1ba85518597812ad383
Merge branch 'main' of http://git.xlyprint.cn/zhangz/xlyUmi into main
Showing
2 changed files
with
43 additions
and
22 deletions
src/components/Common/CommonBillEvent.js
| ... | ... | @@ -4591,23 +4591,9 @@ export default (ChildComponent) => { |
| 4591 | 4591 | } |
| 4592 | 4592 | /* 各种金额,税额,价格计算 */ |
| 4593 | 4593 | let models = name === 'materials' ? 'Materials' : |
| 4594 | - sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials'; | |
| 4594 | + sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('quotation/') || sModelsType.includes('cashier/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials'; | |
| 4595 | 4595 | |
| 4596 | - if( sModelsType?.includes('cashier/')) { | |
| 4597 | - tableDataRow.bSettleMoney = true;/* 收付款单 */ | |
| 4598 | - if(sFieldName === 'dTotalMoney') { | |
| 4599 | - tableDataRow[`d${models}Money`] =tableDataRow.dTotalMoney; | |
| 4600 | - sFieldName = `d${models}Money`; | |
| 4601 | - } else if(sFieldName === 'dTotalForeignPrice') { | |
| 4602 | - tableDataRow[`d${models}ForeignPrice`] = tableDataRow.dTotalForeignPrice; | |
| 4603 | - sFieldName = `d${models}ForeignPrice` | |
| 4604 | - } | |
| 4605 | 4596 | |
| 4606 | - } | |
| 4607 | - if( sModelsType === 'sales/adjust') { | |
| 4608 | - tableDataRow.dProductMoney = tableDataRow.dTotalMoney; | |
| 4609 | - sFieldName = 'dProductMoney'; | |
| 4610 | - } | |
| 4611 | 4597 | |
| 4612 | 4598 | if (sModelsType.includes('purchase/') || sModelsType.includes('quotation/') || sModelsType.includes('manufacture/') || sModelsType.includes('materialsStock/') |
| 4613 | 4599 | || sModelsType.includes('outside/') || sModelsType.includes('semigoodsStock/') || sModelsType.includes('sales/materials') || sModelsType === 'sales/salesCheck') { |
| ... | ... | @@ -5046,9 +5032,9 @@ export default (ChildComponent) => { |
| 5046 | 5032 | tableDataRow[`d${models}Money`] = tableDataRow.dTotalMoney; |
| 5047 | 5033 | |
| 5048 | 5034 | } |
| 5049 | - if( sModelsType === 'sales/adjust') { | |
| 5050 | - tableDataRow.dProductMoney = tableDataRow.dTotalMoney; | |
| 5051 | - controlField = 'dProductMoney'; | |
| 5035 | + if( sModelsType === 'sales/adjust') { /* 财务调整单 */ | |
| 5036 | + // tableDataRow.dProductMoney = tableDataRow.dTotalMoney; | |
| 5037 | + controlField = 'dProductForeignMoney'; | |
| 5052 | 5038 | } |
| 5053 | 5039 | tableDataRow = commonBusiness.getCalculateAllMoney(app, models, controlField, returnData.masterData, tableDataRow); |
| 5054 | 5040 | tableDataRow.handleType = commonUtils.isEmpty(tableDataRow.handleType) ? 'update' : tableDataRow.handleType; | ... | ... |
src/components/QuickQuote/index.jsx
| ... | ... | @@ -30,7 +30,7 @@ const QuickQuoteEvent = props => { |
| 30 | 30 | return pre; |
| 31 | 31 | }, {}); |
| 32 | 32 | |
| 33 | - const { slaveData = [], manyData = [] } = result; | |
| 33 | + const { slaveData = [], manyData = [], masterData = {} } = result; | |
| 34 | 34 | const materialInfoFields = [ |
| 35 | 35 | "sMaterialsName", |
| 36 | 36 | "sMaterialsNo", |
| ... | ... | @@ -75,7 +75,14 @@ const QuickQuoteEvent = props => { |
| 75 | 75 | return item; |
| 76 | 76 | }); |
| 77 | 77 | |
| 78 | - return { ...result, slaveData: slaveDataNew, manyData: manyDataNew }; | |
| 78 | + const { sType, sCustomerId, sCustomerName } = props.app.userinfo; | |
| 79 | + const bCustomer = sType === "Customer"; | |
| 80 | + if (bCustomer && !masterData.sCustomerId) { | |
| 81 | + masterData.sCustomerName = sCustomerName; | |
| 82 | + masterData.sCustomerId = sCustomerId; | |
| 83 | + } | |
| 84 | + | |
| 85 | + return { ...result, masterData, slaveData: slaveDataNew, manyData: manyDataNew }; | |
| 79 | 86 | }; |
| 80 | 87 | |
| 81 | 88 | const sQuoConfig = commonUtils.convertStrToObj(props.masterData.sQuoConfig, {}); |
| ... | ... | @@ -1233,12 +1240,25 @@ const QuickQuoteEvent = props => { |
| 1233 | 1240 | sParentId: newState.masterData.sId, |
| 1234 | 1241 | })); |
| 1235 | 1242 | |
| 1243 | + let hasCalled = false; | |
| 1244 | + | |
| 1236 | 1245 | setState(pre => { |
| 1237 | - const preNew = { ...pre, manyData: result.manyqtysData, calcPriceLoading: false, calcPriceFinished: true }; | |
| 1246 | + const preNew = { | |
| 1247 | + ...pre, | |
| 1248 | + manyData: result.manyqtysData, | |
| 1249 | + calcPriceLoading: false, | |
| 1250 | + calcPriceFinished: true, | |
| 1251 | + }; | |
| 1252 | + | |
| 1238 | 1253 | const stateNew = { ...newState, ...result }; |
| 1254 | + | |
| 1255 | + if (hasCalled) return preNew; // 防止重复执行 | |
| 1256 | + hasCalled = true; | |
| 1257 | + | |
| 1239 | 1258 | props.onSaveState(stateNew, () => { |
| 1240 | 1259 | onSaveDraft(preNew, stateNew); |
| 1241 | 1260 | }); |
| 1261 | + | |
| 1242 | 1262 | return preNew; |
| 1243 | 1263 | }); |
| 1244 | 1264 | } else { |
| ... | ... | @@ -1640,7 +1660,22 @@ const MasterComponent = props => { |
| 1640 | 1660 | const { app } = props; |
| 1641 | 1661 | if (!masterConfig) return ""; |
| 1642 | 1662 | |
| 1643 | - const ableConfigs = masterConfig.gdsconfigformslave.filter(item => item.sName && item.bVisible); | |
| 1663 | + const { userinfo } = app; | |
| 1664 | + const { sType } = userinfo; | |
| 1665 | + const bCustomer = sType === "Customer"; | |
| 1666 | + | |
| 1667 | + const ableConfigs = masterConfig.gdsconfigformslave | |
| 1668 | + .filter(item => item.sName && item.bVisible) | |
| 1669 | + .map(item => { | |
| 1670 | + if (item.sName === "sCustomerName" && bCustomer) { | |
| 1671 | + return { | |
| 1672 | + ...item, | |
| 1673 | + iTag: 1, | |
| 1674 | + }; | |
| 1675 | + } else { | |
| 1676 | + return item; | |
| 1677 | + } | |
| 1678 | + }); | |
| 1644 | 1679 | const JosnAbleConfigs = JSON.parse(JSON.stringify(ableConfigs)); |
| 1645 | 1680 | // 处理长宽样式 |
| 1646 | 1681 | // selectedNode?.bBox && selectedNode.sTypeKey !== "kapai" && selectedNode?.bBox && selectedNode.sProductType !== "不干胶" | ... | ... |