Commit 7957bae65cf25a19a8dece4a4393010b8f3280e4

Authored by chenxt
1 parent 639d3886

隐藏快速报价app模块

Too many changes to show.

To preserve performance only 6 of 11 files are displayed.

src/mobile/quotation/detail.jsx
  1 +/* eslint-disable */
1 import { useRef, useEffect, useState, useCallback, useMemo } from "react"; 2 import { useRef, useEffect, useState, useCallback, useMemo } from "react";
2 -import { history } from "umi";  
3 import { Tabs, Selector, Grid, Image, Button, Checkbox, Switch, Dialog, Toast } from "antd-mobile"; 3 import { Tabs, Selector, Grid, Image, Button, Checkbox, Switch, Dialog, Toast } from "antd-mobile";
4 import { AddOutline, MinusOutline } from "antd-mobile-icons"; 4 import { AddOutline, MinusOutline } from "antd-mobile-icons";
5 import commonConfig from "@/utils/config"; 5 import commonConfig from "@/utils/config";
src/mobile/quotation/detailNew.jsx
  1 +/* eslint-disable */
1 import { useRef, useEffect, useState, useCallback, useMemo } from "react"; 2 import { useRef, useEffect, useState, useCallback, useMemo } from "react";
2 -import { history } from "umi";  
3 -import { Toast, Input, Tabs, Selector, Grid, Image, Button, Checkbox, Switch, Dialog, Radio, Space, CenterPopup } from "antd-mobile"; 3 +import { Toast, Input, Tabs, Selector, Grid, Image, Button, Checkbox, Switch, Dialog, Radio, Space, CenterPopup, ImageViewer, Collapse, CapsuleTabs } from "antd-mobile";
4 import { AddOutline, MinusOutline, EditFill, CloseOutline } from "antd-mobile-icons"; 4 import { AddOutline, MinusOutline, EditFill, CloseOutline } from "antd-mobile-icons";
5 import commonConfig from "@/utils/config"; 5 import commonConfig from "@/utils/config";
6 import * as commonServices from "@/services/services"; 6 import * as commonServices from "@/services/services";
@@ -15,6 +15,7 @@ import ShowImgM from "@/components/Common/BoxShowImgMaterial/indexNew"; @@ -15,6 +15,7 @@ import ShowImgM from "@/components/Common/BoxShowImgMaterial/indexNew";
15 import CommonBase from "@/components/Common/CommonBase"; 15 import CommonBase from "@/components/Common/CommonBase";
16 import { cloneDeep, isEqual } from "lodash"; 16 import { cloneDeep, isEqual } from "lodash";
17 import moment from "moment"; 17 import moment from "moment";
  18 +import { transform } from "@antv/g2/lib/util/transform";
18 const QuickQuoteEvent = props => { 19 const QuickQuoteEvent = props => {
19 const { location, selectedNode, sModelsId } = props; 20 const { location, selectedNode, sModelsId } = props;
20 // const selectedNode = JSON.parse(location.state).quotationData; 21 // const selectedNode = JSON.parse(location.state).quotationData;
@@ -30,7 +31,7 @@ const QuickQuoteEvent = props => { @@ -30,7 +31,7 @@ const QuickQuoteEvent = props => {
30 return pre; 31 return pre;
31 }, {}); 32 }, {});
32 33
33 - const { slaveData = [], manyData = [] } = result; 34 + const { slaveData = [], manyData = [], masterData = {} } = result;
34 const materialInfoFields = [ 35 const materialInfoFields = [
35 "sMaterialsName", 36 "sMaterialsName",
36 "sMaterialsNo", 37 "sMaterialsNo",
@@ -53,21 +54,21 @@ const QuickQuoteEvent = props => { @@ -53,21 +54,21 @@ const QuickQuoteEvent = props => {
53 ]; 54 ];
54 const slaveDataNew = bInit 55 const slaveDataNew = bInit
55 ? slaveData.map(item => { 56 ? slaveData.map(item => {
56 - const { materialsInfo = [], sMaterialsName } = item;  
57 - if (!materialsInfo.length && sMaterialsName) {  
58 - return {  
59 - ...item,  
60 - materialsInfo: [  
61 - materialInfoFields.reduce((pre, cur) => {  
62 - pre[cur] = item[cur];  
63 - return pre;  
64 - }, {}),  
65 - ],  
66 - };  
67 - } else {  
68 - return item;  
69 - }  
70 - }) 57 + const { materialsInfo = [], sMaterialsName } = item;
  58 + if (!materialsInfo.length && sMaterialsName) {
  59 + return {
  60 + ...item,
  61 + materialsInfo: [
  62 + materialInfoFields.reduce((pre, cur) => {
  63 + pre[cur] = item[cur];
  64 + return pre;
  65 + }, {}),
  66 + ],
  67 + };
  68 + } else {
  69 + return item;
  70 + }
  71 + })
71 : slaveData; 72 : slaveData;
72 73
73 const manyDataNew = manyData.map(item => { 74 const manyDataNew = manyData.map(item => {
@@ -75,10 +76,16 @@ const QuickQuoteEvent = props => { @@ -75,10 +76,16 @@ const QuickQuoteEvent = props => {
75 return item; 76 return item;
76 }); 77 });
77 78
78 - return { ...result, slaveData: slaveDataNew, manyData: manyDataNew }; 79 + const { sType, sCustomerId, sCustomerName } = props.app.userinfo;
  80 + const bCustomer = sType === "Customer";
  81 + if (bCustomer && !masterData.sCustomerId) {
  82 + masterData.sCustomerName = sCustomerName;
  83 + masterData.sCustomerId = sCustomerId;
  84 + }
  85 + return { ...result, masterData, slaveData: slaveDataNew, manyData: manyDataNew };
79 }; 86 };
80 87
81 - const sQuoConfig = commonUtils.convertStrToObj(props.masterData.sQuoConfig, {}); 88 + const sQuoConfig = commonUtils.convertStrToObj(props.masterData?.sQuoConfig, {});
82 89
83 const [state, setState] = useState(addState.onGetFilterState(sQuoConfig, true)); 90 const [state, setState] = useState(addState.onGetFilterState(sQuoConfig, true));
84 91
@@ -86,6 +93,7 @@ const QuickQuoteEvent = props => { @@ -86,6 +93,7 @@ const QuickQuoteEvent = props => {
86 const { bLinkFieledClick } = props; 93 const { bLinkFieledClick } = props;
87 const [hideBackBtn, setHideBackBtn] = useState(false); 94 const [hideBackBtn, setHideBackBtn] = useState(false);
88 const [enabled, setEnabled] = useState(props.enabled); 95 const [enabled, setEnabled] = useState(props.enabled);
  96 +
89 useEffect(() => { 97 useEffect(() => {
90 setHideBackBtn(!bLinkFieledClick); 98 setHideBackBtn(!bLinkFieledClick);
91 setEnabled(!bLinkFieledClick || props.enabled); 99 setEnabled(!bLinkFieledClick || props.enabled);
@@ -105,9 +113,9 @@ const QuickQuoteEvent = props => { @@ -105,9 +113,9 @@ const QuickQuoteEvent = props => {
105 }, []); 113 }, []);
106 // 获取盒型定义配置 114 // 获取盒型定义配置
107 useEffect(() => { 115 useEffect(() => {
108 - if (!formData.length) return; 116 + if (!formData.length) return '';
109 const sBoxActiveId = formData.find(item => item.sGrd === "slave")?.gdsconfigformslave?.find(item => item.sName === "sName")?.sActiveId; 117 const sBoxActiveId = formData.find(item => item.sGrd === "slave")?.gdsconfigformslave?.find(item => item.sName === "sName")?.sActiveId;
110 - if (!sBoxActiveId) return; 118 + if (!sBoxActiveId) return '';
111 const { token } = props; 119 const { token } = props;
112 const configUrl = `${commonConfig.server_host}business/getModelBysId/${sBoxActiveId}?sModelsId=${sBoxActiveId}`; 120 const configUrl = `${commonConfig.server_host}business/getModelBysId/${sBoxActiveId}?sModelsId=${sBoxActiveId}`;
113 commonServices.getService(token, configUrl).then(({ data: configReturn }) => { 121 commonServices.getService(token, configUrl).then(({ data: configReturn }) => {
@@ -120,7 +128,7 @@ const QuickQuoteEvent = props => { @@ -120,7 +128,7 @@ const QuickQuoteEvent = props => {
120 128
121 // 获取column 129 // 获取column
122 useEffect(() => { 130 useEffect(() => {
123 - if (!formData.length) return; 131 + if (!formData.length) return '';
124 132
125 let result = {}; 133 let result = {};
126 for (let i = 0; i < formData.length; i++) { 134 for (let i = 0; i < formData.length; i++) {
@@ -136,60 +144,150 @@ const QuickQuoteEvent = props =&gt; { @@ -136,60 +144,150 @@ const QuickQuoteEvent = props =&gt; {
136 } 144 }
137 setState(pre => ({ ...pre, ...result })); 145 setState(pre => ({ ...pre, ...result }));
138 }, [formData.length]); 146 }, [formData.length]);
  147 + const { slaveData = [], masterData = {} } = state;
  148 + useEffect(() => {
  149 + if (!slaveData.length) return;
  150 + const bNotInit = slaveData.some(item => item.sBackProcessData);
  151 + if (!bNotInit) {
  152 + const { downAbleConfigs = [] } = state;
  153 + const downAbleConfigsNew = downAbleConfigs.filter(item => item.sDefaultProcessId);
  154 + if (downAbleConfigsNew.length) {
  155 + const slaveDataNew = slaveData.map(item => {
  156 + let sBackProcessData = [];
  157 + downAbleConfigsNew.forEach(({ sChineseDropDown: sChineseDropDownStr, sDefaultProcessId, sName, sId }) => {
  158 + const sChineseDropDown = commonUtils.convertStrToObj(sChineseDropDownStr, []);
  159 + const defaultProcess = sChineseDropDown.find(item => item.sId === sDefaultProcessId);
  160 + const name = `slaveDown${item.sBoxModel}`;
  161 + const sFieldName = sName;
  162 + const changeValue = { [sFieldName]: defaultProcess.sId };
  163 + const dropDownData = sChineseDropDown.map(item => ({
  164 + ...item,
  165 + sProductClassifyId: sId,
  166 + }));
  167 + const slaveDataReturn = onDataChange(name, sFieldName, changeValue, item.sId, dropDownData, true);
  168 + sBackProcessData = [...sBackProcessData, ...(slaveDataReturn?.sBackProcessData?.filter(item => item.sProductClassifyId === sId) || [])];
  169 + });
  170 + return {
  171 + ...item,
  172 + sBackProcessData,
  173 + };
  174 + });
  175 + setState(pre => {
  176 + return { ...pre, slaveData: slaveDataNew };
  177 + });
  178 + }
  179 + }
139 180
  181 + const bNotInit1 = !!masterData.cpProcessName;
  182 + if (!bNotInit1) {
  183 + const { finishedConfigs = [] } = state;
  184 + const finishedConfigsNew = finishedConfigs.filter(item => item.sDefaultProcessId);
  185 + if (finishedConfigsNew.length) {
  186 + let [cpProcessNameList, productProcessInfo] = [[], []];
  187 + finishedConfigsNew.forEach(({ sChineseDropDown: sChineseDropDownStr, sDefaultProcessId, sName, sId }) => {
  188 + const sChineseDropDown = commonUtils.convertStrToObj(sChineseDropDownStr, []);
  189 + const defaultProcess = sChineseDropDown.find(item => item.sId === sDefaultProcessId);
  190 + const name = "finished";
  191 + const sFieldName = sName;
  192 + const changeValue = { [sFieldName]: defaultProcess.sId };
  193 + const dropDownData = sChineseDropDown.map(item => ({
  194 + ...item,
  195 + sProductClassifyId: sId,
  196 + }));
  197 + const { cpProcessName: cpProcessNameNew, productProcessInfo: productProcessInfoNew } = onDataChange(
  198 + name,
  199 + sFieldName,
  200 + changeValue,
  201 + masterData.sId,
  202 + dropDownData,
  203 + true
  204 + );
  205 + cpProcessNameNew.split(",").forEach((item, index) => {
  206 + if (!cpProcessNameList.includes(item)) {
  207 + cpProcessNameList.push(item);
  208 + productProcessInfo.push(productProcessInfoNew[index]);
  209 + }
  210 + });
  211 + });
  212 + setState(pre => ({
  213 + ...pre,
  214 + masterData: {
  215 + ...masterData,
  216 + cpProcessName: cpProcessNameList.join(","),
  217 + productProcessInfo,
  218 + },
  219 + }));
  220 + }
  221 + }
  222 + }, [slaveData.map(item => item.sId).toString()]);
140 addState.onBackClick = () => { 223 addState.onBackClick = () => {
141 props.onSaveState({ masterData: { ...props.masterData, sQuoConfig: JSON.stringify(addState.onGetFilterState(state)) }, quickQuoteModel: false }); 224 props.onSaveState({ masterData: { ...props.masterData, sQuoConfig: JSON.stringify(addState.onGetFilterState(state)) }, quickQuoteModel: false });
142 }; 225 };
143 226
144 - addState.onDataChange = (name, sFieldName, changeValue, sId, dropDownData, isWait) => {  
145 - const { masterData = {}, slaveData = [], selectedNode = {} } = state; 227 + const onDataChange = (name, sFieldName, changeValue, sId, dropDownData, isWait) => {
  228 + const { masterData = {}, slaveData = [], selectedNode = {}, manyData = [] } = state;
146 const extraState = { 229 const extraState = {
147 calcPriceFinished: false, 230 calcPriceFinished: false,
148 - manyData: [],  
149 }; 231 };
150 232
151 if (name === "master") { 233 if (name === "master") {
152 - const { showName: sTreeNodeName } = selectedNode;  
153 - let masterDataNew = { ...masterData, ...changeValue }; 234 +
  235 + const { showName: sTreeNodeName } = selectedNode || {};
  236 + const masterDataNew = { ...masterData, ...changeValue };
154 masterDataNew.handleType = masterDataNew.handleType || "update"; 237 masterDataNew.handleType = masterDataNew.handleType || "update";
155 - masterDataNew.sId = commonUtils.createSid(); 238 + masterDataNew.sId = masterDataNew.sId || commonUtils.createSid();
  239 +
156 if (sFieldName === "dProductQty") { 240 if (sFieldName === "dProductQty") {
157 setState(pre => ({ 241 setState(pre => ({
158 ...pre, 242 ...pre,
159 dProductQty: changeValue.dProductQty, 243 dProductQty: changeValue.dProductQty,
160 })); 244 }));
161 } 245 }
162 - if (sFieldName === "sCustomerName") {  
163 - masterDataNew = { ...masterDataNew, sCustomerId: changeValue.sId };  
164 - }  
165 if (sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight") { 246 if (sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight") {
166 - if (props.currentBoxModel) {  
167 - const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", "");  
168 - const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel);  
169 - const sColumnNameConfig = commonUtils.convertStrToObj(slaveData[iIndex].sColumnNameConfig, []).map(item => ({  
170 - ...item,  
171 - iColValue: item.iColValue || 6,  
172 - }));  
173 - slaveData[iIndex] = {  
174 - ...slaveData[iIndex],  
175 - upAbleConfigsExtra: sColumnNameConfig,  
176 - }; 247 + if (sTreeNodeName) {
  248 + if (props.currentBoxModel) {
  249 + const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", "");
  250 + const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel);
  251 + const sColumnNameConfig = commonUtils.convertStrToObj(slaveData[iIndex].sColumnNameConfig, []).map(item => ({
  252 + ...item,
  253 + iColValue: item.iColValue || 6,
  254 + }));
  255 + slaveData[iIndex] = {
  256 + ...slaveData[iIndex],
  257 + upAbleConfigsExtra: sColumnNameConfig,
  258 + };
  259 + } else {
  260 + if (!slaveData[0]) return;
  261 + const sColumnNameConfig = commonUtils.convertStrToObj(slaveData[0].sColumnNameConfig, []).map(item => ({
  262 + ...item,
  263 + iColValue: item.iColValue || 6,
  264 + }));
  265 + slaveData[0] = {
  266 + ...slaveData[0],
  267 + upAbleConfigsExtra: sColumnNameConfig,
  268 + };
  269 + }
177 } else { 270 } else {
178 - if (!slaveData[0]) return;  
179 - const sColumnNameConfig = commonUtils.convertStrToObj(slaveData[0].sColumnNameConfig, []).map(item => ({  
180 - ...item,  
181 - iColValue: item.iColValue || 6,  
182 - }));  
183 - slaveData[0] = {  
184 - ...slaveData[0],  
185 - upAbleConfigsExtra: sColumnNameConfig,  
186 - }; 271 + masterDataNew[sFieldName] = changeValue[sFieldName];
  272 + }
  273 + if (masterData?.sMReserve3) {
  274 + const result1 = masterData?.sMReserve3.split('(')[0];
  275 + masterDataNew.sMReserve3 = `${result1}(${masterDataNew.dLength}*${masterDataNew.dWidth}*${masterDataNew.dHeight})`;
  276 + }
  277 + const num = Number(changeValue[sFieldName])
  278 + if (Number.isNaN(num)) {
  279 + masterDataNew[sFieldName] = null
187 } 280 }
188 } 281 }
  282 +
189 setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState })); 283 setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState }));
190 } else if (name.includes("slave")) { 284 } else if (name.includes("slave")) {
  285 +
191 const boxModel = name.replace("slaveUp", "").replace("slaveDown", ""); 286 const boxModel = name.replace("slaveUp", "").replace("slaveDown", "");
  287 +
192 if (sFieldName === "sName") { 288 if (sFieldName === "sName") {
  289 + let upAbleConfigsList = []
  290 +
193 if (!changeValue.sName) return; 291 if (!changeValue.sName) return;
194 const dropDownDataSelected = dropDownData.find(item => item.sName === changeValue.sName); 292 const dropDownDataSelected = dropDownData.find(item => item.sName === changeValue.sName);
195 const { sColumnNameConfig, sColumnNameConfigExclusion, sColumnNameConfigPic } = dropDownDataSelected; 293 const { sColumnNameConfig, sColumnNameConfigExclusion, sColumnNameConfigPic } = dropDownDataSelected;
@@ -200,11 +298,31 @@ const QuickQuoteEvent = props =&gt; { @@ -200,11 +298,31 @@ const QuickQuoteEvent = props =&gt; {
200 const defaultData = commonFunc.getDefaultData({ gdsconfigformslave: upAbleConfigsExtra }); 298 const defaultData = commonFunc.getDefaultData({ gdsconfigformslave: upAbleConfigsExtra });
201 delete defaultData.sId; 299 delete defaultData.sId;
202 delete dropDownDataSelected.sId; 300 delete dropDownDataSelected.sId;
  301 + upAbleConfigsExtra?.forEach(item => {
  302 + if (item.sTypes && item.sTypes.includes('09')) {
  303 + const list = ['iSLength', 'iSWidth', 'iCLength', 'iCWidth']
  304 + const nameList = ['层1长', '层1宽', '层2长', '层2宽']
  305 + for (let index = 0; index < 4; index++) {
  306 + upAbleConfigsList.push({
  307 + ...item,
  308 + sName: item.sName + list[index],
  309 + sDefault: item[list[index]],
  310 + showName: item.showName + nameList[index]
  311 + })
  312 + }
  313 + } else {
  314 + upAbleConfigsList.push(item)
  315 + }
  316 + })
203 changeValue = { 317 changeValue = {
204 ...changeValue, 318 ...changeValue,
205 ...defaultData, 319 ...defaultData,
206 ...dropDownDataSelected, 320 ...dropDownDataSelected,
207 upAbleConfigsExtra, 321 upAbleConfigsExtra,
  322 + ...upAbleConfigsList.reduce((acc, item) => {
  323 + acc[item.sName] = item.sDefault;
  324 + return acc;
  325 + }, {}),
208 calcMethodData: commonUtils.convertStrToObj(sColumnNameConfigExclusion, []), 326 calcMethodData: commonUtils.convertStrToObj(sColumnNameConfigExclusion, []),
209 boxPicData: commonUtils.convertStrToObj(sColumnNameConfigPic, []), 327 boxPicData: commonUtils.convertStrToObj(sColumnNameConfigPic, []),
210 }; 328 };
@@ -212,41 +330,47 @@ const QuickQuoteEvent = props =&gt; { @@ -212,41 +330,47 @@ const QuickQuoteEvent = props =&gt; {
212 330
213 const { selectedNode = {}, slaveConfig } = state; 331 const { selectedNode = {}, slaveConfig } = state;
214 const { showName: sTreeNodeName } = selectedNode; 332 const { showName: sTreeNodeName } = selectedNode;
215 - const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel); 333 +
  334 +
216 if (sFieldName === "dSumPQty" && (sTreeNodeName.includes("骑马") || sTreeNodeName.includes("锁线"))) { 335 if (sFieldName === "dSumPQty" && (sTreeNodeName.includes("骑马") || sTreeNodeName.includes("锁线"))) {
217 - if (!changeValue.dSumPQty || changeValue.dSumPQty % 4 !== 0) {  
218 - message.info("P数要为4的倍数!");  
219 - changeValue.dSumPQty = 4;  
220 - extraState.slaveUpKey = `key_${commonUtils.createSid()}`; 336 + changeValue.dSumPQty = Number(changeValue.dSumPQty);
  337 + if (changeValue.dSumPQty !== 0) {
  338 + if (!changeValue.dSumPQty || changeValue.dSumPQty % 4 !== 0) {
  339 + Toast.show({
  340 + content: "P数要为4的倍数",
  341 + });
  342 + changeValue.dSumPQty = 4;
  343 + extraState.slaveUpKey = `key_${commonUtils.createSid()}`;
  344 + }
221 } 345 }
  346 +
222 } 347 }
  348 + const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel);
223 if (name.includes("slaveDown")) { 349 if (name.includes("slaveDown")) {
224 - const dropDownDataSelected = dropDownData.find(item => item.sId === changeValue.sId);  
225 - dropDownDataSelected && (dropDownDataSelected[sFieldName] = dropDownDataSelected.sProcessName); 350 +
  351 + let dropDownDataSelected = dropDownData.find(item => item.sId === changeValue[sFieldName] || item.sId === changeValue.value);
  352 + // dropDownDataSelected.sProductClassifyId = dropDownDataSelected.sProductClassifyId ? dropDownDataSelected.sProductClassifyId : dropDownDataSelected.sId
226 const extraRowData = {}; 353 const extraRowData = {};
227 - // if (dropDownDataSelected.sProcessName === "胶印") {  
228 - // extraRowData.sPrintProcessId = dropDownDataSelected.sId;  
229 - // }  
230 if (dropDownDataSelected !== undefined) { 354 if (dropDownDataSelected !== undefined) {
231 dropDownDataSelected[sFieldName] = dropDownDataSelected.sProcessName; 355 dropDownDataSelected[sFieldName] = dropDownDataSelected.sProcessName;
232 // 后道参数额外配置 356 // 后道参数额外配置
233 const { sParamConfig: sParamConfigStr } = dropDownDataSelected || {}; 357 const { sParamConfig: sParamConfigStr } = dropDownDataSelected || {};
234 const sParamConfig = commonUtils.convertStrToObj(sParamConfigStr, []); 358 const sParamConfig = commonUtils.convertStrToObj(sParamConfigStr, []);
235 extraState.backendParamsConfig = sParamConfig; 359 extraState.backendParamsConfig = sParamConfig;
236 - extraState.backendConfig = { sParentFieldsName: sFieldName, sBoxModel: boxModel }; 360 + extraState.backendConfig = { sParentFieldsName: sFieldName, sBoxModel: boxModel, typeName: 'slave', dropDownDataSelected };
237 const sBackendParams = sParamConfig 361 const sBackendParams = sParamConfig
238 - .map((item, index) => {  
239 - const { sParamDefault, sParam,iOrder} = item; 362 + .map(item => {
  363 + const { sParamDefault, sParam, sFieldName, iOrder } = item;
240 return !sParamDefault 364 return !sParamDefault
241 ? "" 365 ? ""
242 : { 366 : {
243 - sId: commonUtils.createSid(),  
244 - value: sParamDefault,  
245 - sParam: sParam,  
246 - [`sParams${iOrder}`]: sParamDefault,  
247 - sParamKey: `sParam${index}`,  
248 - sParamKeyNew: sFieldName || `sParam${iOrder}`,  
249 - }; 367 + sId: commonUtils.createSid(),
  368 + value: sParamDefault,
  369 + sParam: sParam,
  370 + [`sParam${iOrder}`]: sParamDefault,
  371 + ...(sFieldName ? { [sFieldName]: sParamDefault } : {}),
  372 + sParamKey: sFieldName || `sParam${iOrder}`,
  373 + };
250 }) 374 })
251 .filter(item => item !== ""); 375 .filter(item => item !== "");
252 dropDownDataSelected.sBackendParams = sBackendParams; 376 dropDownDataSelected.sBackendParams = sBackendParams;
@@ -261,8 +385,9 @@ const QuickQuoteEvent = props =&gt; { @@ -261,8 +385,9 @@ const QuickQuoteEvent = props =&gt; {
261 ...extraRowData, 385 ...extraRowData,
262 }); 386 });
263 } else { 387 } else {
  388 +
264 const sBackProcessData = slaveData[iIndex].sBackProcessData || []; 389 const sBackProcessData = slaveData[iIndex].sBackProcessData || [];
265 - const iIndex1 = sBackProcessData.findIndex(item => item[sFieldName]); 390 + const iIndex1 = sBackProcessData.findIndex(item => item.sProductClassifyId === changeValue.sProductClassifyId);
266 if (iIndex1 === -1) { 391 if (iIndex1 === -1) {
267 dropDownDataSelected !== undefined && sBackProcessData.push(dropDownDataSelected); 392 dropDownDataSelected !== undefined && sBackProcessData.push(dropDownDataSelected);
268 } else { 393 } else {
@@ -283,6 +408,7 @@ const QuickQuoteEvent = props =&gt; { @@ -283,6 +408,7 @@ const QuickQuoteEvent = props =&gt; {
283 } else { 408 } else {
284 if (iIndex === -1) { 409 if (iIndex === -1) {
285 slaveData.push({ 410 slaveData.push({
  411 + ...commonFunc.getDefaultData(slaveConfig, { tree: selectedNode }),
286 ...changeValue, 412 ...changeValue,
287 sId: commonUtils.createSid(), 413 sId: commonUtils.createSid(),
288 handleType: "add", 414 handleType: "add",
@@ -293,33 +419,43 @@ const QuickQuoteEvent = props =&gt; { @@ -293,33 +419,43 @@ const QuickQuoteEvent = props =&gt; {
293 slaveData[iIndex] = { 419 slaveData[iIndex] = {
294 ...(sFieldName === "sName" 420 ...(sFieldName === "sName"
295 ? { 421 ? {
296 - sId: slaveData[iIndex].sId,  
297 - sBoxModel: boxModel,  
298 - sTreeNodeName,  
299 - ...commonFunc.getDefaultData(slaveConfig),  
300 - } 422 + sId: slaveData[iIndex].sId,
  423 + sBoxModel: boxModel,
  424 + sTreeNodeName,
  425 + ...commonFunc.getDefaultData(slaveConfig, { tree: selectedNode }),
  426 + sBackProcessData: slaveData[iIndex].sBackProcessData,
  427 + }
301 : slaveData[iIndex]), 428 : slaveData[iIndex]),
302 ...changeValue, 429 ...changeValue,
303 handleType: slaveData[iIndex].handleType || "update", 430 handleType: slaveData[iIndex].handleType || "update",
304 }; 431 };
  432 +
305 } 433 }
306 } 434 }
307 const saveIndex = slaveData.findIndex(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel); 435 const saveIndex = slaveData.findIndex(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel);
308 const materialStyleLength = slaveData[saveIndex].materialLength || 0; 436 const materialStyleLength = slaveData[saveIndex].materialLength || 0;
309 const materialStyleWidth = slaveData[saveIndex].materialWidth || 0; 437 const materialStyleWidth = slaveData[saveIndex].materialWidth || 0;
  438 +
  439 +
310 slaveData[saveIndex] = { 440 slaveData[saveIndex] = {
311 ...slaveData[saveIndex], 441 ...slaveData[saveIndex],
312 sMachineStyle: materialStyleLength + "*" + materialStyleWidth, 442 sMachineStyle: materialStyleLength + "*" + materialStyleWidth,
313 - dMachineQty: slaveData[saveIndex].dProductQty ? slaveData[saveIndex].dProductQty : masterData.dProductQty, 443 + dMachineQty: masterData.sBillNo && slaveData[saveIndex].dMachineQty ? slaveData[saveIndex].dMachineQty : slaveData[saveIndex].dProductQty ? slaveData[saveIndex].dProductQty : masterData.dProductQty,
314 }; 444 };
  445 +
315 if (sFieldName === "dWlcd" || sFieldName === "dWlkd") { 446 if (sFieldName === "dWlcd" || sFieldName === "dWlkd") {
316 - const horizontalBoxes = Math.floor(slaveData[saveIndex]?.dWlkd / slaveData[saveIndex]?.materialWidth);  
317 - const verticalBoxes = Math.floor(slaveData[saveIndex]?.dWlcd / slaveData[saveIndex]?.materialLength); 447 + const horizontalBoxes = Math.floor(slaveData[saveIndex]?.dWlkd / Number(slaveData[saveIndex]?.dMachineWidth));
  448 + const verticalBoxes = Math.floor(slaveData[saveIndex]?.dWlcd / Number(slaveData[saveIndex]?.dMachineLength));
318 const newDMaterialsKQty = horizontalBoxes * verticalBoxes; 449 const newDMaterialsKQty = horizontalBoxes * verticalBoxes;
319 slaveData[saveIndex] = { 450 slaveData[saveIndex] = {
320 ...slaveData[saveIndex], 451 ...slaveData[saveIndex],
321 - dMachineQty: Math.floor(slaveData[saveIndex].dMachineQty / slaveData[saveIndex].dSinglePQty), 452 + dMachineQty: masterData.sBillNo && slaveData[saveIndex].dMachineQty ? slaveData[saveIndex].dMachineQty : Math.floor(slaveData[saveIndex].dMachineQty / slaveData[saveIndex].dSinglePQty),
322 dMaterialsKQty: newDMaterialsKQty, 453 dMaterialsKQty: newDMaterialsKQty,
  454 + newMaterialLength: sFieldName === "dWlcd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlcd,
  455 + newMaterialWidth: sFieldName === "dWlkd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlkd,
  456 + materialLength: sFieldName === "dWlcd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlcd,
  457 + materialWidth: sFieldName === "dWlkd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlkd,
  458 + sMaterialsStyle: `${sFieldName === "dWlcd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlcd || 0}*${sFieldName === "dWlkd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlkd || 0}`,
323 }; 459 };
324 } 460 }
325 461
@@ -331,23 +467,6 @@ const QuickQuoteEvent = props =&gt; { @@ -331,23 +467,6 @@ const QuickQuoteEvent = props =&gt; {
331 }; 467 };
332 } 468 }
333 469
334 - // if (sFieldName === "sPrint") {  
335 - // slaveData[saveIndex] = {  
336 - // ...slaveData[saveIndex],  
337 - // sProcessId: changeValue.sId,  
338 - // sPrintProcessId: changeValue.sId,  
339 - // dMachineWidth: slaveData[saveIndex].dWlkd,  
340 - // dMachineLength: slaveData[saveIndex].dWlcd,  
341 - // };  
342 - // }  
343 -  
344 - // if (sFieldName === "dMaxLength") {  
345 - // slaveData[saveIndex] = {  
346 - // ...slaveData[saveIndex],  
347 - // dMaxLength: changeValue.dMachineLength,  
348 - // dMaxWidth: changeValue.dMachineWidth,  
349 - // };  
350 - // }  
351 if (sFieldName === "bFlap") { 470 if (sFieldName === "bFlap") {
352 slaveData[saveIndex] = { 471 slaveData[saveIndex] = {
353 ...slaveData[saveIndex], 472 ...slaveData[saveIndex],
@@ -364,6 +483,13 @@ const QuickQuoteEvent = props =&gt; { @@ -364,6 +483,13 @@ const QuickQuoteEvent = props =&gt; {
364 dFlap: "", 483 dFlap: "",
365 }; 484 };
366 } 485 }
  486 + if (sFieldName === "iPrintModePo") {
  487 + slaveData[saveIndex] = {
  488 + ...slaveData[saveIndex],
  489 + iPrintModePo: Number(changeValue.value),
  490 + };
  491 + }
  492 +
367 const { upAbleConfigsExtra = [] } = slaveData[saveIndex] || {}; 493 const { upAbleConfigsExtra = [] } = slaveData[saveIndex] || {};
368 494
369 upAbleConfigsExtra.forEach(item => { 495 upAbleConfigsExtra.forEach(item => {
@@ -371,11 +497,40 @@ const QuickQuoteEvent = props =&gt; { @@ -371,11 +497,40 @@ const QuickQuoteEvent = props =&gt; {
371 item.sAssignFormula = null; 497 item.sAssignFormula = null;
372 } 498 }
373 }); 499 });
  500 +
  501 + if (isWait) {
  502 + return slaveData.find(item => item.sBoxModel === boxModel);
  503 + }
  504 +
374 setState(pre => ({ ...pre, slaveData, ...extraState })); 505 setState(pre => ({ ...pre, slaveData, ...extraState }));
375 } else if (name === "finished") { 506 } else if (name === "finished") {
376 const { productProcessInfo = [] } = masterData; 507 const { productProcessInfo = [] } = masterData;
377 - const dropDownDataSelected = dropDownData.find(item => item.sId === changeValue.sId);  
378 - dropDownDataSelected && (dropDownDataSelected[sFieldName] = dropDownDataSelected.sProcessName); 508 + const dropDownDataSelected = dropDownData.find(item => item.sId === changeValue[sFieldName] || item.sId === changeValue.value);
  509 + if (dropDownDataSelected !== undefined) {
  510 + dropDownDataSelected[sFieldName] = dropDownDataSelected.sProcessName;
  511 + // 后道参数额外配置
  512 + const { sParamConfig: sParamConfigStr } = dropDownDataSelected || {};
  513 + const sParamConfig = commonUtils.convertStrToObj(sParamConfigStr, []);
  514 + extraState.backendParamsConfig = sParamConfig;
  515 + extraState.backendConfig = { sParentFieldsName: sFieldName, typeName: 'finished', dropDownDataSelected };
  516 + const sBackendParams = sParamConfig
  517 + .map(item => {
  518 + const { sParamDefault, sParam, sFieldName, iOrder } = item;
  519 + return !sParamDefault
  520 + ? ""
  521 + : {
  522 + sId: commonUtils.createSid(),
  523 + value: sParamDefault,
  524 + sParam: sParam,
  525 + [`sParam${iOrder}`]: sParamDefault,
  526 + ...(sFieldName ? { [sFieldName]: sParamDefault } : {}),
  527 + sParamKey: sFieldName || `sParam${iOrder}`,
  528 + };
  529 + })
  530 + .filter(item => item !== "");
  531 + dropDownDataSelected.sBackendParams = sBackendParams;
  532 + }
  533 +
379 const iIndex = productProcessInfo.findIndex(item => item.sProductClassifyId === dropDownData[0].sProductClassifyId); 534 const iIndex = productProcessInfo.findIndex(item => item.sProductClassifyId === dropDownData[0].sProductClassifyId);
380 if (iIndex === -1) { 535 if (iIndex === -1) {
381 dropDownDataSelected !== undefined && productProcessInfo.push(dropDownDataSelected); 536 dropDownDataSelected !== undefined && productProcessInfo.push(dropDownDataSelected);
@@ -389,11 +544,15 @@ const QuickQuoteEvent = props =&gt; { @@ -389,11 +544,15 @@ const QuickQuoteEvent = props =&gt; {
389 const cpProcessName = productProcessInfo.map(item => item.sProcessName).join(","); 544 const cpProcessName = productProcessInfo.map(item => item.sProcessName).join(",");
390 const masterDataNew = { ...masterData, cpProcessName, productProcessInfo }; 545 const masterDataNew = { ...masterData, cpProcessName, productProcessInfo };
391 masterDataNew.handleType = masterDataNew.handleType || "update"; 546 masterDataNew.handleType = masterDataNew.handleType || "update";
392 - masterDataNew.sId = commonUtils.createSid(); // 目前默认是新增 547 + masterDataNew.sId = masterDataNew.sId || commonUtils.createSid();
  548 + if (isWait) {
  549 + return masterDataNew;
  550 + }
393 setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState })); 551 setState(pre => ({ ...pre, masterData: masterDataNew, ...extraState }));
394 } 552 }
395 - };  
396 553
  554 + };
  555 + addState.onDataChange = onDataChange;
397 addState.onGetAllDelData = () => { 556 addState.onGetAllDelData = () => {
398 const { 557 const {
399 slaveData = [], 558 slaveData = [],
@@ -411,17 +570,69 @@ const QuickQuoteEvent = props =&gt; { @@ -411,17 +570,69 @@ const QuickQuoteEvent = props =&gt; {
411 packData = [], 570 packData = [],
412 packDelData: packDelDataOld = [], 571 packDelData: packDelDataOld = [],
413 } = props; 572 } = props;
  573 +
414 const addState = { 574 const addState = {
415 - slaveDelData: [...slaveDelDataOld, ...slaveData.map(item => ({ ...item, handleType: "del" }))],  
416 - controlDelData: [...controlDelDataOld, ...controlData.map(item => ({ ...item, handleType: "del" }))],  
417 - materialsDelData: [...materialsDelDataOld, ...materialsData.map(item => ({ ...item, handleType: "del" }))],  
418 - processDelData: [...processDelDataOld, ...processData.map(item => ({ ...item, handleType: "del" }))],  
419 - manyqtysDelData: [...manyqtysDelDataOld, ...manyqtysData.map(item => ({ ...item, handleType: "del" }))],  
420 - colorDelData: [...colorDelDataOld, ...colorData.map(item => ({ ...item, handleType: "del" }))],  
421 - packDelData: [...packDelDataOld, ...packData.map(item => ({ ...item, handleType: "del" }))], 575 + slaveDelData: [
  576 + ...slaveDelDataOld,
  577 + ...slaveData.filter(item => !slaveDelDataOld.map(item1 => item1.sId).includes(item.sId)).map(item => ({ ...item, handleType: "del" })),
  578 + ],
  579 + controlDelData: [
  580 + ...controlDelDataOld,
  581 + ...controlData.filter(item => !controlDelDataOld.map(item1 => item1.sId).includes(item.sId)).map(item => ({ ...item, handleType: "del" })),
  582 + ],
  583 + materialsDelData: [
  584 + ...materialsDelDataOld,
  585 + ...materialsData
  586 + .filter(item => !materialsDelDataOld.map(item1 => item1.sId).includes(item.sId))
  587 + .map(item => ({ ...item, handleType: "del" })),
  588 + ],
  589 + processDelData: [
  590 + ...processDelDataOld,
  591 + ...processData.filter(item => !processDelDataOld.map(item1 => item1.sId).includes(item.sId)).map(item => ({ ...item, handleType: "del" })),
  592 + ],
  593 + manyqtysDelData: [
  594 + ...manyqtysDelDataOld,
  595 + ...manyqtysData.filter(item => !manyqtysDelDataOld.map(item1 => item1.sId).includes(item.sId)).map(item => ({ ...item, handleType: "del" })),
  596 + ],
  597 + colorDelData: [
  598 + ...colorDelDataOld,
  599 + ...colorData.filter(item => !colorDelDataOld.map(item1 => item1.sId).includes(item.sId)).map(item => ({ ...item, handleType: "del" })),
  600 + ],
  601 + packDelData: [
  602 + ...packDelDataOld,
  603 + ...packData.filter(item => !packDelDataOld.map(item1 => item1.sId).includes(item.sId)).map(item => ({ ...item, handleType: "del" })),
  604 + ],
422 }; 605 };
  606 +
423 return addState; 607 return addState;
424 }; 608 };
  609 + // 判断单据是否被删除
  610 + const bDataDeleted = async () => {
  611 + const { masterConfig, currentId, masterData = {}, slaveConfig } = props;
  612 + if (!masterData.sBillNo) return false;
  613 + const sId = currentId || masterData.sId || "";
  614 + const returnData = await props.handleGetDataOne({
  615 + name: "master",
  616 + configData: masterConfig,
  617 + condition: { sId, pageSize: "", pageNum: "" },
  618 + bEditClick: false,
  619 + slaveConfig,
  620 + isWait: true,
  621 + });
  622 +
  623 + if (returnData) return false;
  624 + Toast.show({
  625 + content: "当前报价单已被删除!请重新核价以生成新的报价单!"
  626 + });
  627 + props.onAdd();
  628 + setState(pre => ({
  629 + ...pre,
  630 + // manyData: [],
  631 + calcPriceFinished: false,
  632 + }));
  633 + return true;
  634 + };
  635 + addState.bDataDeleted = bDataDeleted;
425 636
426 // 存草稿 637 // 存草稿
427 const onSaveDraft = (nextState = state, nextProps = props) => { 638 const onSaveDraft = (nextState = state, nextProps = props) => {
@@ -503,66 +714,152 @@ const QuickQuoteEvent = props =&gt; { @@ -503,66 +714,152 @@ const QuickQuoteEvent = props =&gt; {
503 }; 714 };
504 715
505 addState.onSaveDraft = onSaveDraft; 716 addState.onSaveDraft = onSaveDraft;
506 - 717 + // 获取国际化名称
  718 + const getI18nName = (sFieldName, sDefault) => {
  719 + return commonFunc.showMessage(props.app?.commonConst, sFieldName) || sDefault;
  720 + };
507 // 核价按钮 721 // 核价按钮
508 addState.handleCalcPrice = async () => { 722 addState.handleCalcPrice = async () => {
509 - const { masterData = {}, slaveData = [], selectedNode = {}, extraParts = {} } = state; 723 + if (props.app.webSocket === null || props.app.webSocket?.readyState !== WebSocket.OPEN) {
  724 + console.log("================webSocket连接======================");
  725 + props.dispatch({
  726 + type: "app/createWebSocket",
  727 + payload: { reStart: true, dispatch: props.dispatch },
  728 + });
  729 +
  730 + // 暂停2秒
  731 + await new Promise(resolve => setTimeout(resolve, 2000));
  732 + }
  733 +
  734 + // const { masterData = {}, slaveData = [], selectedNode = {}, extraParts = {} } = state;
  735 + // const selectProduct = commonFunc.showLocalMessage(props, "selectProduct", "请先选择产品");
  736 + // const selectCustomer = commonFunc.showLocalMessage(props, "selectCustomer", "请先选择客户名称");
  737 + // const selectProductUnit = commonFunc.showLocalMessage(props, "selectProductUnit", "请先输入产品单位");
  738 + // const inputLength = commonFunc.showLocalMessage(props, "inputLength", "请先输入长度");
  739 + // const inputWidth = commonFunc.showLocalMessage(props, "inputWidth", "请先输入宽度");
  740 + // const inputQty = commonFunc.showLocalMessage(props, "inputQty", "请先输入数量");
  741 + // if (commonUtils.isEmptyObject(selectedNode)) {
  742 + // // message.error("请先选择产品");
  743 + // Toast.show({
  744 + // icon: "fail",
  745 + // content: selectProduct,
  746 + // });
  747 + // return;
  748 + // }
  749 + const {
  750 + masterConfig,
  751 + masterData = {},
  752 + slaveConfig,
  753 + slaveData = [],
  754 + selectedNode = {},
  755 + extraParts = {},
  756 + downAbleConfigs = [],
  757 + downAbleExtraConfigs = [],
  758 + finishedConfigs = [],
  759 + } = state;
510 const selectProduct = commonFunc.showLocalMessage(props, "selectProduct", "请先选择产品"); 760 const selectProduct = commonFunc.showLocalMessage(props, "selectProduct", "请先选择产品");
511 - const selectCustomer = commonFunc.showLocalMessage(props, "selectCustomer", "请先选择客户名称");  
512 - const selectProductUnit = commonFunc.showLocalMessage(props, "selectProductUnit", "请先输入产品单位");  
513 - const inputLength = commonFunc.showLocalMessage(props, "inputLength", "请先输入长度");  
514 - const inputWidth = commonFunc.showLocalMessage(props, "inputWidth", "请先输入宽度");  
515 - const inputQty = commonFunc.showLocalMessage(props, "inputQty", "请先输入数量");  
516 if (commonUtils.isEmptyObject(selectedNode)) { 761 if (commonUtils.isEmptyObject(selectedNode)) {
517 - // message.error("请先选择产品");  
518 Toast.show({ 762 Toast.show({
519 icon: "fail", 763 icon: "fail",
520 content: selectProduct, 764 content: selectProduct,
521 }); 765 });
522 return; 766 return;
523 } 767 }
524 - const mustFieldsMap = {  
525 - sCustomerName: selectCustomer,  
526 - sProductName: selectCustomer,  
527 - sProductUnit: selectProductUnit,  
528 - dLength: inputLength,  
529 - dWidth: inputWidth,  
530 - dProductQty: inputQty,  
531 - };  
532 768
533 - const checkResult = Object.keys(mustFieldsMap).find(item => masterData[item] === undefined);  
534 - if (checkResult) {  
535 - Toast.show({  
536 - icon: "fail",  
537 - content: mustFieldsMap[checkResult],  
538 - });  
539 - return; 769 + const errMsgList = [];
  770 + const masterConfigMust = masterConfig?.gdsconfigformslave.filter(item => item.bVisible && item.bNotEmpty);
  771 + if (!masterConfigMust) return;
  772 + const checkResult = masterConfigMust.filter(item => !masterData[item.sName]);
  773 + if (checkResult.length) {
  774 + errMsgList.push(
  775 + checkResult.map(item => <span>【{item.showName}】</span>),
  776 + <span>{getI18nName("isNotNull")}</span>,
  777 + <br />
  778 + );
540 } 779 }
  780 + // const mustFieldsMap = {
  781 + // sCustomerName: selectCustomer,
  782 + // sProductName: selectCustomer,
  783 + // sProductUnit: selectProductUnit,
  784 + // dLength: inputLength,
  785 + // dWidth: inputWidth,
  786 + // dProductQty: inputQty,
  787 + // };
  788 +
  789 + // const checkResult = Object.keys(mustFieldsMap).find(item => masterData[item] === undefined);
  790 + // if (checkResult) {
  791 + // Toast.show({
  792 + // icon: "fail",
  793 + // content: mustFieldsMap[checkResult],
  794 + // });
  795 + // return;
  796 + // }
541 797
542 const { bBox, showName, sId } = selectedNode; 798 const { bBox, showName, sId } = selectedNode;
543 let { sAllPartsName } = selectedNode; 799 let { sAllPartsName } = selectedNode;
544 if (!sAllPartsName) { 800 if (!sAllPartsName) {
545 sAllPartsName = showName; 801 sAllPartsName = showName;
546 } 802 }
  803 + const slaveConfigMust = slaveConfig.gdsconfigformslave
  804 + .filter(item => item.bVisible && item.iTag && item.bNotEmpty && item.sName !== "sMaterialsName")
  805 + .filter(item => (bBox ? true : item.sName !== "sName"));
  806 +
  807 + const sMaterialsNameConfig = slaveConfig.gdsconfigformslave.find(item => item.sName === "sMaterialsName");
  808 + const downAbleConfigMust = [...downAbleConfigs, ...downAbleExtraConfigs].filter(item => item.bNotEmpty);
  809 +
  810 + const errorList = [];
  811 + const partsList = [];
  812 + slaveData.forEach(slaveRowData => {
  813 + const list = slaveConfigMust.filter(item => !slaveRowData[item.sName]);
  814 + if (!slaveRowData.materialsInfo || slaveRowData.materialsInfo.some(item => !item.sMaterialsName)) {
  815 + list.push(sMaterialsNameConfig);
  816 + }
  817 + const { sBackProcessData = [] } = slaveRowData;
  818 + downAbleConfigMust.forEach(item => {
  819 + if (!sBackProcessData.some(x => x.sProductClassifyId === item.sId)) {
  820 + list.push(item);
  821 + }
  822 + });
  823 + errorList.push(list);
  824 + partsList.push(slaveRowData.sBoxModel);
  825 + });
  826 +
  827 + if (!errorList.some(item => !item.length)) {
  828 + errMsgList.push(
  829 + errorList.map((item, index0) => [
  830 + <span>{partsList[index0]}:</span>,
  831 + ...item.map(config => <span>【{config.showName}】</span>),
  832 + <span>{getI18nName("isNotNull")}</span>,
  833 + <br />,
  834 + ])
  835 + );
  836 + }
  837 +
  838 + const finishedConfigMust = finishedConfigs.filter(item => item.bNotEmpty);
  839 + const { productProcessInfo = [] } = masterData;
  840 +
  841 + const checkResult1 = finishedConfigMust.filter(item => !productProcessInfo.some(x => x.sProductClassifyId === item.sId));
  842 + if (checkResult1.length) {
  843 + errMsgList.push(
  844 + checkResult1.map(item => <span>【{item.showName}】</span>),
  845 + <span>{getI18nName("isNotNull")}</span>,
  846 + <br />
  847 + );
  848 + }
547 849
548 - const slaveRowDataList =  
549 - slaveData  
550 - .filter(item => item.sTreeNodeName === showName && item.materialsInfo && !item.materialsInfo.some(x => !x.sMaterialsName))  
551 - .filter(item => (bBox ? item.sName : true))  
552 - .filter(item => item.sPrint !== undefined && item.sColor !== undefined && item.iPrintModePo !== undefined) || [];  
553 - if (!slaveRowDataList.length) {  
554 - // message.error("请至少保证一个部件的材料信息填写完整"); 850 + if (errMsgList.length) {
  851 + // message.error(errMsgList, 3);
555 Toast.show({ 852 Toast.show({
556 icon: "fail", 853 icon: "fail",
557 - content: "请至少保证一个部件的材料信息填写完整", 854 + content: errMsgList,
558 }); 855 });
559 return; 856 return;
560 } 857 }
561 858
562 setState(pre => ({ ...pre, calcPriceLoading: true, calcPriceFinished: false })); 859 setState(pre => ({ ...pre, calcPriceLoading: true, calcPriceFinished: false }));
563 -  
564 const { sModelsId, token, sBoxModel } = props; 860 const { sModelsId, token, sBoxModel } = props;
565 - const extraPartsList = extraParts[showName] || []; 861 + const extraPartsList = extraParts?.[showName] || [];
  862 +
566 const sAllPartsNameList = [...sAllPartsName.split(","), ...extraPartsList]; 863 const sAllPartsNameList = [...sAllPartsName.split(","), ...extraPartsList];
567 864
568 const masterDataNew = { 865 const masterDataNew = {
@@ -574,13 +871,12 @@ const QuickQuoteEvent = props =&gt; { @@ -574,13 +871,12 @@ const QuickQuoteEvent = props =&gt; {
574 dProductWidth: masterData.dWidth, 871 dProductWidth: masterData.dWidth,
575 dProductLength: masterData.dLength, 872 dProductLength: masterData.dLength,
576 dProductHeight: masterData.dHeight, 873 dProductHeight: masterData.dHeight,
577 - sConsigneeMobile: masterData.sMobile,  
578 - sConsignee: masterData.sContacts,  
579 sProductStyle: 874 sProductStyle:
580 masterData.dHeight !== undefined 875 masterData.dHeight !== undefined
581 ? `${masterData.dLength}*${masterData.dWidth}*${masterData.dHeight}` 876 ? `${masterData.dLength}*${masterData.dWidth}*${masterData.dHeight}`
582 : `${masterData.dLength}*${masterData.dWidth}`, 877 : `${masterData.dLength}*${masterData.dWidth}`,
583 }; 878 };
  879 +
584 const paramMap = { 880 const paramMap = {
585 bQuotation: true, 881 bQuotation: true,
586 ...masterDataNew, 882 ...masterDataNew,
@@ -602,22 +898,25 @@ const QuickQuoteEvent = props =&gt; { @@ -602,22 +898,25 @@ const QuickQuoteEvent = props =&gt; {
602 } 898 }
603 return pre; 899 return pre;
604 }, {}), 900 }, {}),
  901 + iOrder: 1,
605 dPartsQty: masterData.dProductQty, 902 dPartsQty: masterData.dProductQty,
606 // iPositiveColor: Number(item.sColor), 903 // iPositiveColor: Number(item.sColor),
607 iOppositeColor: item.sBackProcessData?.find(item => item.bPrintParams)?.iPositiveColor || 0, 904 iOppositeColor: item.sBackProcessData?.find(item => item.bPrintParams)?.iPositiveColor || 0,
608 iOppositeSpecialColor: item.sBackProcessData?.find(item => item.bPrintParams)?.iPositiveSpecialColor || 0, 905 iOppositeSpecialColor: item.sBackProcessData?.find(item => item.bPrintParams)?.iPositiveSpecialColor || 0,
609 sPartsName: item.sBoxModel, 906 sPartsName: item.sBoxModel,
610 materialsInfo: item.materialsInfo?.filter(x => commonUtils.isNotEmptyObject(x)), 907 materialsInfo: item.materialsInfo?.filter(x => commonUtils.isNotEmptyObject(x)),
611 - iPrintModePo: Number(item.value),  
612 processInfo: 908 processInfo:
613 item.sBackProcessData?.map(item => ({ 909 item.sBackProcessData?.map(item => ({
614 ...item, 910 ...item,
615 - sProcessId: item.sId, 911 + sProcessId: item.sProcessId || item.sId,
616 })) || [], 912 })) || [],
617 }; 913 };
618 }), 914 }),
619 }; 915 };
620 - paramMap.sPartsStyle = (paramMap.partsInfo[0].dPartsLength || 0) + "*" + (paramMap.partsInfo[0].dPartsWidth || 0); 916 +
  917 + const firstPart = paramMap.partsInfo && paramMap.partsInfo[0];
  918 + paramMap.sPartsStyle =
  919 + ((firstPart && firstPart.dPartsLength) || 0) + "*" + ((firstPart && firstPart.dPartsWidth) || 0);
621 if (paramMap.sPartsStyle === "0*0") { 920 if (paramMap.sPartsStyle === "0*0") {
622 delete paramMap.sPartsStyle; 921 delete paramMap.sPartsStyle;
623 } 922 }
@@ -755,12 +1054,13 @@ const QuickQuoteEvent = props =&gt; { @@ -755,12 +1054,13 @@ const QuickQuoteEvent = props =&gt; {
755 partsDataRow.iOppositeColor = partsDataRow.iPositiveColor; 1054 partsDataRow.iOppositeColor = partsDataRow.iPositiveColor;
756 } 1055 }
757 delete partsDataRow.dMaterialsKQty; 1056 delete partsDataRow.dMaterialsKQty;
758 - delete partsDataRow.dMaterialsLength;  
759 - delete partsDataRow.dMaterialsWidth; 1057 + // delete partsDataRow.dMaterialsLength;
  1058 + // delete partsDataRow.dMaterialsWidth;
760 // if (productClassify.bSpecialRules) { 1059 // if (productClassify.bSpecialRules) {
761 // partsDataRow.dMachineLength = partsDataRow.dMaxMachineLength; 1060 // partsDataRow.dMachineLength = partsDataRow.dMaxMachineLength;
762 // partsDataRow.dMachineWidth = partsDataRow.dMaxMachineWidth; 1061 // partsDataRow.dMachineWidth = partsDataRow.dMaxMachineWidth;
763 // } 1062 // }
  1063 +
764 controlData.push(partsDataRow); 1064 controlData.push(partsDataRow);
765 // 材料信息 1065 // 材料信息
766 for (let i = 0; i < partInfo.materialsInfo.length; i++) { 1066 for (let i = 0; i < partInfo.materialsInfo.length; i++) {
@@ -808,6 +1108,9 @@ const QuickQuoteEvent = props =&gt; { @@ -808,6 +1108,9 @@ const QuickQuoteEvent = props =&gt; {
808 processPrintDataRow.sId = commonUtils.createSid(); 1108 processPrintDataRow.sId = commonUtils.createSid();
809 processPrintDataRow.sParentId = masterData.sId; 1109 processPrintDataRow.sParentId = masterData.sId;
810 processPrintDataRow.sControlId = partsDataRow.sId; 1110 processPrintDataRow.sControlId = partsDataRow.sId;
  1111 + const iSpecialColor = partInfo.iSpecialColor !== undefined ? partInfo.iSpecialColor : partInfo.partInfoiSpecialColor;
  1112 + processPrintDataRow.sColorSerialMemo = JSON.stringify([{ sId: partInfo.sColorId, sName: partInfo.sColor, dColor: partInfo.iColor, iSpecialColor }]);
  1113 +
811 // processPrintDataRow.sSlaveId = ' '; 1114 // processPrintDataRow.sSlaveId = ' ';
812 processData.push(processPrintDataRow); 1115 processData.push(processPrintDataRow);
813 // 配套工序 1116 // 配套工序
@@ -859,6 +1162,20 @@ const QuickQuoteEvent = props =&gt; { @@ -859,6 +1162,20 @@ const QuickQuoteEvent = props =&gt; {
859 processAfterDataRow.sId = commonUtils.createSid(); 1162 processAfterDataRow.sId = commonUtils.createSid();
860 processAfterDataRow.sParentId = masterData.sId; 1163 processAfterDataRow.sParentId = masterData.sId;
861 processAfterDataRow.sControlId = partsDataRow.sId; 1164 processAfterDataRow.sControlId = partsDataRow.sId;
  1165 +
  1166 + const sBackendParams = process.sBackendParams || [];
  1167 + if (sBackendParams.length) {
  1168 + const sQuoParams = sBackendParams.map(item => ({
  1169 + sParamKey: item.sParamKey,
  1170 + sParamName: item.sParam,
  1171 + sParamValue: item.value !== undefined ? item.value : "",
  1172 + bSelfCbx: !(item.value === "" || item.value === undefined),
  1173 + }));
  1174 + processAfterDataRow.sQuoParams = JSON.stringify(sQuoParams);
  1175 + }
  1176 + if (process.sColor) {
  1177 + processAfterDataRow.sColorSerialMemo = JSON.stringify([{ sId: process.sColorId, sName: process.sColor, dColor: process.iColor }]);
  1178 + }
862 // processAfterDataRow.sSlaveId = ' '; 1179 // processAfterDataRow.sSlaveId = ' ';
863 processData.push(processAfterDataRow); 1180 processData.push(processAfterDataRow);
864 // 配套工序 1181 // 配套工序
@@ -909,6 +1226,18 @@ const QuickQuoteEvent = props =&gt; { @@ -909,6 +1226,18 @@ const QuickQuoteEvent = props =&gt; {
909 processProductDataRow.iOrder = iOrder + 1; 1226 processProductDataRow.iOrder = iOrder + 1;
910 processProductDataRow.sId = commonUtils.createSid(); 1227 processProductDataRow.sId = commonUtils.createSid();
911 processProductDataRow.sParentId = masterData.sId; 1228 processProductDataRow.sParentId = masterData.sId;
  1229 +
  1230 + const sBackendParams = process.sBackendParams || [];
  1231 + if (sBackendParams.length) {
  1232 + const sQuoParams = sBackendParams.map(item => ({
  1233 + sParamKey: item.sParamKey,
  1234 + sParamName: item.sParam,
  1235 + sParamValue: item.value !== undefined ? item.value : "",
  1236 + bSelfCbx: !(item.value === "" || item.value === undefined),
  1237 + }));
  1238 + processProductDataRow.sQuoParams = JSON.stringify(sQuoParams);
  1239 + }
  1240 +
912 // processProductDataRow.sSlaveId = ' '; 1241 // processProductDataRow.sSlaveId = ' ';
913 processData.push(processProductDataRow); 1242 processData.push(processProductDataRow);
914 // 配套工序 1243 // 配套工序
@@ -937,6 +1266,18 @@ const QuickQuoteEvent = props =&gt; { @@ -937,6 +1266,18 @@ const QuickQuoteEvent = props =&gt; {
937 if (!commonUtils.isEmptyArr(slaveData)) { 1266 if (!commonUtils.isEmptyArr(slaveData)) {
938 addState.slaveSelectedRowKeys = [slaveData[0].sId]; 1267 addState.slaveSelectedRowKeys = [slaveData[0].sId];
939 } 1268 }
  1269 + const { sPrintConfig = {}, downAbleConfigs = [], finishedConfigs = [] } = state;
  1270 + const processConfigs = [sPrintConfig, ...downAbleConfigs, ...finishedConfigs];
  1271 +
  1272 + const configOrderMap = {};
  1273 + processConfigs.forEach((config, index) => {
  1274 + configOrderMap[config.sId] = index;
  1275 + });
  1276 +
  1277 + processData.sort((a, b) => {
  1278 + return configOrderMap[a.sProcessClassifyId] - configOrderMap[b.sProcessClassifyId];
  1279 + });
  1280 + processData = processData.map((item, index) => ({ ...item, iOrder: index + 1 }));
940 1281
941 const newState = { 1282 const newState = {
942 materialsConfig, 1283 materialsConfig,
@@ -952,47 +1293,56 @@ const QuickQuoteEvent = props =&gt; { @@ -952,47 +1293,56 @@ const QuickQuoteEvent = props =&gt; {
952 sInfoArr, 1293 sInfoArr,
953 // bVisiblesInfo: !!commonUtils.isNotEmptyArr(sInfoArr), 1294 // bVisiblesInfo: !!commonUtils.isNotEmptyArr(sInfoArr),
954 Loading: false, 1295 Loading: false,
  1296 + dQuickQuoteProductQty: state?.dQuickQuoteProductQty
955 // quickQuoteModel: false, 1297 // quickQuoteModel: false,
956 }; 1298 };
  1299 +
957 delete newState.masterData.sQuoConfig; 1300 delete newState.masterData.sQuoConfig;
958 - const masterProps = {  
959 - ...props,  
960 - }; 1301 +
961 setState(pre => ({ 1302 setState(pre => ({
962 ...pre, 1303 ...pre,
963 newNextProps: { 1304 newNextProps: {
964 dQuickQuoteProductQty: state.dQuickQuoteProductQty, 1305 dQuickQuoteProductQty: state.dQuickQuoteProductQty,
965 - ...masterProps, 1306 + ...props,
966 ...newState, 1307 ...newState,
967 - manyqtysConfig: state.manyConfig,  
968 - manyqtysData: state.manyData, 1308 + // manyqtysConfig: state.manyConfig,
  1309 + // manyqtysData: state.manyData,
969 }, 1310 },
970 })); 1311 }));
971 1312
972 const result = await props.handleCalculation( 1313 const result = await props.handleCalculation(
973 false, 1314 false,
974 - { ...masterProps, ...newState, manyqtysConfig: state.manyConfig, manyqtysData: state.manyData, state }, 1315 + { ...props, ...newState, manyqtysConfig: state.manyConfig, manyqtysData: state.manyData, manyqtysDelData: state.manyData, state },
975 true, 1316 true,
976 { ...props, state } 1317 { ...props, state }
977 ); 1318 );
978 -  
979 if (commonUtils.isEmptyObject(result)) { 1319 if (commonUtils.isEmptyObject(result)) {
980 setState(pre => ({ ...pre, calcPriceLoading: false })); 1320 setState(pre => ({ ...pre, calcPriceLoading: false }));
981 return; 1321 return;
982 } 1322 }
983 - 1323 + let hasCalled = false;
984 const { manyqtysData = [] } = result; 1324 const { manyqtysData = [] } = result;
985 result.manyqtysData = manyqtysData.map(item => ({ 1325 result.manyqtysData = manyqtysData.map(item => ({
986 ...item, 1326 ...item,
987 sParentId: newState.masterData.sId, 1327 sParentId: newState.masterData.sId,
988 })); 1328 }));
989 setState(pre => { 1329 setState(pre => {
990 - const preNew = { ...pre, manyData: result.manyqtysData, calcPriceLoading: false, calcPriceFinished: true }; 1330 + const preNew = {
  1331 + ...pre,
  1332 + manyData: result.manyqtysData,
  1333 + calcPriceLoading: false,
  1334 + calcPriceFinished: true,
  1335 + };
  1336 +
991 const stateNew = { ...newState, ...result }; 1337 const stateNew = { ...newState, ...result };
  1338 +
  1339 + if (hasCalled) return preNew; // 防止重复执行
  1340 + hasCalled = true;
  1341 +
992 props.onSaveState(stateNew, () => { 1342 props.onSaveState(stateNew, () => {
993 - // stateNew nextProps  
994 onSaveDraft(preNew, stateNew); 1343 onSaveDraft(preNew, stateNew);
995 }); 1344 });
  1345 +
996 return preNew; 1346 return preNew;
997 }); 1347 });
998 } else { 1348 } else {
@@ -1028,6 +1378,7 @@ const QuickQuoteEvent = props =&gt; { @@ -1028,6 +1378,7 @@ const QuickQuoteEvent = props =&gt; {
1028 } 1378 }
1029 }; 1379 };
1030 1380
  1381 +
1031 return { 1382 return {
1032 ...props, 1383 ...props,
1033 onDataChange0: props.onDataChange, 1384 onDataChange0: props.onDataChange,
@@ -1041,22 +1392,25 @@ const QuickQuoteEvent = props =&gt; { @@ -1041,22 +1392,25 @@ const QuickQuoteEvent = props =&gt; {
1041 // 入口 1392 // 入口
1042 const QuotationAllprogressDetail = baseProps => { 1393 const QuotationAllprogressDetail = baseProps => {
1043 const props = QuickQuoteEvent(baseProps); 1394 const props = QuickQuoteEvent(baseProps);
1044 - const { selectedNode, slaveConfig, quotationData, app, sModelsId, masterData } = props; 1395 + const { selectedNode, quotationData, app, sModelsId, masterData, state } = props;
  1396 + const { slaveConfig, slaveData = [] } = state
1045 const { showName, sUnit } = quotationData; 1397 const { showName, sUnit } = quotationData;
1046 const timeRef = useRef(0); 1398 const timeRef = useRef(0);
1047 -  
1048 useEffect(() => { 1399 useEffect(() => {
  1400 +
  1401 + if (!selectedNode.sId || commonUtils.isEmptyObject(slaveConfig)) return '';
  1402 + timeRef.current += 1;
1049 const getDropDownData = async props => { 1403 const getDropDownData = async props => {
1050 - const showDownConfig = props.state.slaveConfig?.gdsconfigformslave.find(item => item.sControlName === "BtnDownConfig"); 1404 + const showDownConfig = slaveConfig?.gdsconfigformslave.find(item => item.sControlName === "BtnDownConfig");
1051 const downAbleConfigs = await getSqlDropDownData({ ...showDownConfig }); 1405 const downAbleConfigs = await getSqlDropDownData({ ...showDownConfig });
1052 props.setState(pre => { 1406 props.setState(pre => {
1053 const { slaveData = [], slaveConfig } = pre; 1407 const { slaveData = [], slaveConfig } = pre;
1054 const addState = {}; 1408 const addState = {};
1055 - const defaultData = commonFunc.getDefaultData(slaveConfig); 1409 + const defaultData = commonFunc.getDefaultData(slaveConfig, { tree: selectedNode });
1056 const slaveDataNew = slaveData.filter(item => item.sTreeNodeName === selectedNode.showName); 1410 const slaveDataNew = slaveData.filter(item => item.sTreeNodeName === selectedNode.showName);
1057 if (!slaveDataNew.length) { 1411 if (!slaveDataNew.length) {
1058 const sAllPartsName = selectedNode.sAllPartsName || selectedNode.showName; 1412 const sAllPartsName = selectedNode.sAllPartsName || selectedNode.showName;
1059 - sAllPartsName.split(",").forEach((item, index) => { 1413 + sAllPartsName?.split(",").forEach((item, index) => {
1060 const tempData = { 1414 const tempData = {
1061 sId: commonUtils.createSid(), 1415 sId: commonUtils.createSid(),
1062 handleType: "add", 1416 handleType: "add",
@@ -1079,10 +1433,32 @@ const QuotationAllprogressDetail = baseProps =&gt; { @@ -1079,10 +1433,32 @@ const QuotationAllprogressDetail = baseProps =&gt; {
1079 addState.slaveData = slaveDataNew; 1433 addState.slaveData = slaveDataNew;
1080 addState.extraParts = {}; 1434 addState.extraParts = {};
1081 } 1435 }
  1436 + let sQuoConfigData = {}
  1437 + if (props?.sQuoData) {
  1438 + const sQuoConfig = commonUtils.convertStrToObj(props.masterData?.sQuoConfig, {});
  1439 + sQuoConfigData = props.onGetFilterState(sQuoConfig, true)
  1440 + sQuoConfigData = {
  1441 + ...sQuoConfigData,
  1442 + masterData: { ...sQuoConfigData?.masterData, handleType: masterData?.handleType, sBillNo: masterData?.sBillNo },
  1443 + slaveData: sQuoConfigData?.slaveData?.map((item, i) => {
  1444 + return {
  1445 + ...item,
  1446 + sId: props?.slaveData[i] ? sQuoConfigData?.slaveData[i]?.sId : item.sId
  1447 + }
  1448 + })
  1449 + }
  1450 + } else {
  1451 + sQuoConfigData = {
  1452 + masterData: {
  1453 + ...masterData,
  1454 + sProductName: showName, sProductUnit: sUnit,
  1455 + }
  1456 + }
  1457 + }
  1458 +
1082 return { 1459 return {
1083 ...pre, 1460 ...pre,
1084 ...addState, 1461 ...addState,
1085 - masterData: { sProductName: showName, sProductUnit: sUnit, ...masterData },  
1086 downAbleConfigs: downAbleConfigs 1462 downAbleConfigs: downAbleConfigs
1087 .filter(item => item.sType === "2") 1463 .filter(item => item.sType === "2")
1088 .map((item, index) => ({ 1464 .map((item, index) => ({
@@ -1099,16 +1475,25 @@ const QuotationAllprogressDetail = baseProps =&gt; { @@ -1099,16 +1475,25 @@ const QuotationAllprogressDetail = baseProps =&gt; {
1099 iColValue: item.iColValue || 4, 1475 iColValue: item.iColValue || 4,
1100 sVisColumnName: "sProcessName", 1476 sVisColumnName: "sProcessName",
1101 })), 1477 })),
  1478 + ...sQuoConfigData,
  1479 + // masterData: { sProductName: showName, sProductUnit: sUnit, handleType: masterData?.handleType, sBillNo: masterData?.sBillNo },
  1480 +
1102 }; 1481 };
1103 }); 1482 });
  1483 +
1104 }; 1484 };
1105 if (selectedNode.sTypeKey === "juantong") { 1485 if (selectedNode.sTypeKey === "juantong") {
1106 props.onSaveState({ 1486 props.onSaveState({
1107 masterData: { ...props.masterData, sFormId: "101251240115016002356125200" }, 1487 masterData: { ...props.masterData, sFormId: "101251240115016002356125200" },
1108 }); 1488 });
  1489 + } else {
  1490 + props.onSaveState({
  1491 + masterData: { ...props.masterData, sFormId: "101251240115016076506222050" },
  1492 + });
1109 } 1493 }
1110 getDropDownData(props); 1494 getDropDownData(props);
1111 - }, [props.state.slaveConfig]); 1495 + }, [selectedNode.sId, commonUtils.isEmptyObject(slaveConfig)]);
  1496 +
1112 const getSqlDropDownData = async ({ sId }) => { 1497 const getSqlDropDownData = async ({ sId }) => {
1113 const url = `${commonConfig.server_host}business/getSelectLimit/${sId}`; 1498 const url = `${commonConfig.server_host}business/getSelectLimit/${sId}`;
1114 const body = { 1499 const body = {
@@ -1124,7 +1509,7 @@ const QuotationAllprogressDetail = baseProps =&gt; { @@ -1124,7 +1509,7 @@ const QuotationAllprogressDetail = baseProps =&gt; {
1124 // 取上机尺寸 1509 // 取上机尺寸
1125 return commonUtils.convertStrToObj(sColumnNameConfigStr, []); 1510 return commonUtils.convertStrToObj(sColumnNameConfigStr, []);
1126 }; 1511 };
1127 - 1512 +
1128 return ( 1513 return (
1129 <div className={styles.quotationDetailBox}> 1514 <div className={styles.quotationDetailBox}>
1130 <QuotationDetail {...props} /> 1515 <QuotationDetail {...props} />
@@ -1179,11 +1564,13 @@ const QuotationDetail = props =&gt; { @@ -1179,11 +1564,13 @@ const QuotationDetail = props =&gt; {
1179 viewRow: { ...masterData, sProductClassifyId: selectedNode.sId }, 1564 viewRow: { ...masterData, sProductClassifyId: selectedNode.sId },
1180 tableName: "master", 1565 tableName: "master",
1181 }; 1566 };
  1567 +
  1568 +
1182 return ( 1569 return (
1183 <div className={styles.quotationBody}> 1570 <div className={styles.quotationBody}>
1184 <div className={styles.boxTitle}> 1571 <div className={styles.boxTitle}>
1185 - {selectedNode?.showName || "Loading..."}  
1186 - <EditFill color="#BFBFBF" style={{ marginLeft: "1rem" }} /> 1572 + {selectedNode?.showName || selectedNode?.sProductName}
  1573 + <EditFill color="#BFBFBF" style={{ marginLeft: "16px" }} />
1187 </div> 1574 </div>
1188 <div> 1575 <div>
1189 <MasterComponent {...viewProps} /> 1576 <MasterComponent {...viewProps} />
@@ -1237,7 +1624,6 @@ const MasterComponent = props =&gt; { @@ -1237,7 +1624,6 @@ const MasterComponent = props =&gt; {
1237 ...props, 1624 ...props,
1238 itemDetail: sDeliverName, 1625 itemDetail: sDeliverName,
1239 }; 1626 };
1240 - console.log(viewConfigs, "viewConfigs");  
1241 const viewConfigsList = viewConfigs.filter( 1627 const viewConfigsList = viewConfigs.filter(
1242 x => x.sName !== "sCustomerName" && x.sName !== "sProductName" && x.sName !== "dLength" && x.sName !== "dWidth" && x.sName !== "dHeight" 1628 x => x.sName !== "sCustomerName" && x.sName !== "sProductName" && x.sName !== "dLength" && x.sName !== "dWidth" && x.sName !== "dHeight"
1243 ); 1629 );
@@ -1303,12 +1689,29 @@ const MasterComponent = props =&gt; { @@ -1303,12 +1689,29 @@ const MasterComponent = props =&gt; {
1303 }; 1689 };
1304 const QuotationTabs = props => { 1690 const QuotationTabs = props => {
1305 const { state } = props; 1691 const { state } = props;
1306 - const { selectedNode } = state;  
1307 - const [sAllPartsNameList, setSAllPartsNameList] = useState(selectedNode?.sAllPartsName?.split(",") || []);  
1308 - const [activeKey, setActiveKey] = useState(sAllPartsNameList.length ? sAllPartsNameList[0] : null); 1692 + const { selectedNode, extraParts = {}, slaveData } = state;
  1693 + const [sAllPartsNameList, setSAllPartsNameList] = useState([]);
  1694 + const [activeKey, setActiveKey] = useState(sAllPartsNameList?.length ? sAllPartsNameList[0] : null);
1309 const [visible, setVisible] = useState(false); 1695 const [visible, setVisible] = useState(false);
1310 const [value, setValue] = useState(""); 1696 const [value, setValue] = useState("");
1311 - const partsList = selectedNode?.sAllPartsName?.split(","); 1697 + const partsList = selectedNode?.sAllPartsName ? selectedNode?.sAllPartsName?.split(",") : [selectedNode?.showName];
  1698 + const { showName, sAllPartsNameDefault } = selectedNode;
  1699 + const extraPartsList = extraParts[showName] || [];
  1700 + useEffect(() => {
  1701 + let nameList = selectedNode?.sAllPartsName || ''
  1702 + if (nameList === '') {
  1703 + nameList = selectedNode?.showName
  1704 + }
  1705 + const list = nameList?.split(",")
  1706 + if (list && list.length) {
  1707 + const lists = [...list, ...extraPartsList];
  1708 + setSAllPartsNameList(lists)
  1709 + setTimeout(() => {
  1710 + setActiveKey(list[0])
  1711 +
  1712 + }, 200);
  1713 + }
  1714 + }, [selectedNode])
1312 useEffect(() => { 1715 useEffect(() => {
1313 // 更新父组件的状态 1716 // 更新父组件的状态
1314 props.setState(pre => ({ ...pre, boxModel: activeKey })); 1717 props.setState(pre => ({ ...pre, boxModel: activeKey }));
@@ -1323,64 +1726,92 @@ const QuotationTabs = props =&gt; { @@ -1323,64 +1726,92 @@ const QuotationTabs = props =&gt; {
1323 const handleAdd = () => { 1726 const handleAdd = () => {
1324 // 弹窗 1727 // 弹窗
1325 setVisible(true); 1728 setVisible(true);
1326 - // const newSAllPartsNameList = [...sAllPartsNameList, '111']; // 创建一个新的数组,包含新增的元素  
1327 - // setSAllPartsNameList(newSAllPartsNameList); // 更新状态,触发组件重新渲染  
1328 }; 1729 };
  1730 + const manyqtysInfo = commonFunc.showLocalMessage(props, "manyqtysInfo", "多数量报价");
1329 1731
1330 return ( 1732 return (
1331 <div> 1733 <div>
1332 <div className={styles.tabsBox}> 1734 <div className={styles.tabsBox}>
1333 - <Tabs  
1334 - activeKey={activeKey}  
1335 - onChange={key => {  
1336 - setActiveKey(key);  
1337 - }}  
1338 - >  
1339 - {sAllPartsNameList.length  
1340 - ? sAllPartsNameList.map((pane, index) => (  
1341 - <>  
1342 - <Tabs.Tab  
1343 - key={pane}  
1344 - title={  
1345 - <div className={styles.tabTitle}>  
1346 - <div>{pane}</div>  
1347 - {partsList.includes(pane) ? (  
1348 - ""  
1349 - ) : (  
1350 - <CloseOutline  
1351 - style={{ marginLeft: "1rem", position: "absolute", top: "0", right: "-2.5rem" }}  
1352 - onClick={() => {  
1353 - const newTabs = sAllPartsNameList.filter(panes => panes !== pane);  
1354 - setSAllPartsNameList(newTabs);  
1355 - // 如果删除的是当前活动的 Tab,选择新的活动 Tab  
1356 - setActiveKey(0);  
1357 - }}  
1358 - />  
1359 - )}  
1360 - </div>  
1361 - }  
1362 - >  
1363 - <BoxComponent {...tabsProps} paneKey={pane} />  
1364 - </Tabs.Tab>  
1365 - </> 1735 +
  1736 + <div className={styles.tabsContainer}>
  1737 + <CapsuleTabs
  1738 + activeKey={activeKey}
  1739 + onChange={key => {
  1740 + setActiveKey(key);
  1741 + }}
  1742 + >
  1743 + {sAllPartsNameList?.length
  1744 + ? sAllPartsNameList.map((pane, index) => (
  1745 + <CapsuleTabs.Tab
  1746 + key={pane}
  1747 + title={
  1748 + <div className={styles.tabTitle}>
  1749 + <div className={styles.tabText}>{pane}</div>
  1750 + {partsList.includes(pane) ? (
  1751 + ""
  1752 + ) : (
  1753 + <CloseOutline
  1754 + className={styles.closeIcon}
  1755 + onClick={(e) => {
  1756 + e.stopPropagation();
  1757 + const newTabs = sAllPartsNameList.filter(panes => panes !== pane);
  1758 + setSAllPartsNameList(newTabs);
  1759 + const index1 = slaveData.findIndex(item => item.sBoxModel === pane && item.sTreeNodeName === selectedNode.showName);
  1760 + if (index1 > -1) {
  1761 + props.setState(pre => {
  1762 + const newSlaveData = [...pre.slaveData];
  1763 + newSlaveData.splice(index1, 1);
  1764 + return {
  1765 + ...pre,
  1766 + slaveData: newSlaveData,
  1767 + };
  1768 + });
  1769 + }
  1770 + if (activeKey === pane) {
  1771 + setActiveKey(newTabs[0] || null);
  1772 + }
  1773 + }}
  1774 + />
  1775 + )}
  1776 + </div>
  1777 + }
  1778 + style={{
  1779 + maxWidth: '150px',
  1780 + minWidth: '150px',
  1781 + flexShrink: 0,
  1782 + }}
  1783 + >
  1784 + {activeKey === pane && <BoxComponent {...tabsProps} paneKey={pane} />}
  1785 + </CapsuleTabs.Tab>
1366 )) 1786 ))
1367 - : ""}  
1368 - </Tabs> 1787 + : ""}
  1788 + </CapsuleTabs>
  1789 + </div>
  1790 + <FinishedProcessComponent {...tabsProps}></FinishedProcessComponent>
  1791 + <div>
  1792 + <div className={styles.projectBtn}>
  1793 + <div className={styles.boxTitle} style={{ marginTop: "32px" }}>
  1794 + {manyqtysInfo}
  1795 + <EditFill color="#BFBFBF" style={{ marginLeft: "16px" }} />
  1796 + </div>
  1797 + </div>
  1798 + <ManyComponent {...props}></ManyComponent>
  1799 + </div>
1369 <Button 1800 <Button
1370 className={styles.tabAddBtn} 1801 className={styles.tabAddBtn}
1371 color="primary" 1802 color="primary"
1372 fill="solid" 1803 fill="solid"
1373 size="small" 1804 size="small"
1374 - style={{ width: "1.93rem", height: "1.93rem", display: "flex", justifyContent: "center", alignItems: "center", textAlign: "center" }} 1805 + style={{ width: "30px", height: "30px", display: "flex", justifyContent: "center", alignItems: "center", textAlign: "center" }}
1375 onClick={handleAdd} // 调用 handleAdd 方法 1806 onClick={handleAdd} // 调用 handleAdd 方法
1376 > 1807 >
1377 <AddOutline /> 1808 <AddOutline />
1378 </Button> 1809 </Button>
1379 <CenterPopup 1810 <CenterPopup
1380 visible={visible} 1811 visible={visible}
1381 - // onMaskClick={() => {  
1382 - // setVisible(false);  
1383 - // }} 1812 + // onMaskClick={() => {
  1813 + // setVisible(false);
  1814 + // }}
1384 > 1815 >
1385 <div className={styles.addTabs}> 1816 <div className={styles.addTabs}>
1386 <div>请输入新标签名称:</div> 1817 <div>请输入新标签名称:</div>
@@ -1397,7 +1828,7 @@ const QuotationTabs = props =&gt; { @@ -1397,7 +1828,7 @@ const QuotationTabs = props =&gt; {
1397 color="primary" 1828 color="primary"
1398 fill="outline" 1829 fill="outline"
1399 size="small" 1830 size="small"
1400 - style={{ marginRight: "1rem" }} 1831 + style={{ marginRight: "16px" }}
1401 onClick={() => { 1832 onClick={() => {
1402 setValue(""); 1833 setValue("");
1403 setVisible(false); 1834 setVisible(false);
@@ -1410,10 +1841,31 @@ const QuotationTabs = props =&gt; { @@ -1410,10 +1841,31 @@ const QuotationTabs = props =&gt; {
1410 fill="solid" 1841 fill="solid"
1411 size="small" 1842 size="small"
1412 onClick={() => { 1843 onClick={() => {
  1844 + if (value === '') {
  1845 + Toast.show({
  1846 + content: "标签名称不能为空",
  1847 + });
  1848 + return
  1849 + }
  1850 + if ([...sAllPartsNameList, ...extraPartsList].includes(value)) {
  1851 + Toast.show({
  1852 + content: "标签名称已存在!",
  1853 + });
  1854 + return;
  1855 + }
1413 const newSAllPartsNameList = [...sAllPartsNameList, value]; // 创建一个新的数组,包含新增的元素 1856 const newSAllPartsNameList = [...sAllPartsNameList, value]; // 创建一个新的数组,包含新增的元素
1414 setSAllPartsNameList(newSAllPartsNameList); // 更新状态,触发组件重新渲染 1857 setSAllPartsNameList(newSAllPartsNameList); // 更新状态,触发组件重新渲染
1415 setVisible(false); 1858 setVisible(false);
1416 setValue(""); 1859 setValue("");
  1860 + extraPartsList.push(value);
  1861 + props.setState(pre => ({
  1862 + ...pre,
  1863 + extraParts: {
  1864 + ...pre.extraParts,
  1865 + [showName]: extraPartsList,
  1866 + },
  1867 + }));
  1868 + // props.setState(pre => {})
1417 }} 1869 }}
1418 > 1870 >
1419 确认 1871 确认
@@ -1441,19 +1893,17 @@ const BoxComponent = props =&gt; { @@ -1441,19 +1893,17 @@ const BoxComponent = props =&gt; {
1441 slaveData, 1893 slaveData,
1442 } = state || {}; 1894 } = state || {};
1443 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; 1895 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {};
1444 - 1896 + const { sBillNo } = slaveRowData;
1445 const { sModelsId } = props; 1897 const { sModelsId } = props;
1446 const [selectList, setSelectList] = useState([]); 1898 const [selectList, setSelectList] = useState([]);
1447 const [boxTypeList, setBoxTypeList] = useState([]); 1899 const [boxTypeList, setBoxTypeList] = useState([]);
1448 const [searchValue, setSearchValue] = useState(""); 1900 const [searchValue, setSearchValue] = useState("");
1449 const [boxPopup, setBoxPopup] = useState(false); 1901 const [boxPopup, setBoxPopup] = useState(false);
1450 const [boxsList, setBoxsList] = useState([]); 1902 const [boxsList, setBoxsList] = useState([]);
1451 - const [selected, setSelected] = useState(null);  
1452 - 1903 + const [selected, setSelected] = useState(slaveRowData?.sBoxType);
1453 // 获取盒型信息 1904 // 获取盒型信息
1454 useEffect(() => { 1905 useEffect(() => {
1455 const sId = "17428091410008594700322758474000"; 1906 const sId = "17428091410008594700322758474000";
1456 - console.log(props, "props");  
1457 const { selectedNode } = props; 1907 const { selectedNode } = props;
1458 const url = `${commonConfig.server_host}business/getSelectLimit/${sId}`; 1908 const url = `${commonConfig.server_host}business/getSelectLimit/${sId}`;
1459 const body = { 1909 const body = {
@@ -1495,6 +1945,41 @@ const BoxComponent = props =&gt; { @@ -1495,6 +1945,41 @@ const BoxComponent = props =&gt; {
1495 // 获取盒型 1945 // 获取盒型
1496 }, [sModelsId]); 1946 }, [sModelsId]);
1497 1947
  1948 + useEffect(() => {
  1949 + if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") {
  1950 + const { sBillNo } = slaveRowData;
  1951 + if (sBillNo) return;
  1952 + const getSqlDropDownData = async ({ sId, sSqlCondition = {} }, cb) => {
  1953 + const url = `${commonConfig.server_host}business/getSelectLimit/${sId}`;
  1954 + const body = {
  1955 + sKeyUpFilterName: "",
  1956 + pageNum: 1,
  1957 + pageSize: 1000,
  1958 + sSqlCondition,
  1959 + };
  1960 + const retrunData = await commonServices.postValueService(props.app.token, body, url);
  1961 + const dropDownData = retrunData.data?.dataset?.rows;
  1962 + if (dropDownData) {
  1963 + const box = dropDownData.find(box => box.sId === '17551384620004172929247856556500'); // Define 'box' here
  1964 + const boxData = dropDownData.map((itemBox, indexBox) => ({
  1965 + ...itemBox,
  1966 + iOrder: indexBox + 1,
  1967 + }));
  1968 + if (box) { // Check if 'box' exists before using it
  1969 + props.onDataChange("slaveUp" + boxModel, "sName", { sName: box.sName }, box.sId, boxData);
  1970 + }
  1971 + }
  1972 +
  1973 + };
  1974 +
  1975 + getSqlDropDownData({
  1976 + sId: '17428091410008594700322758474000',
  1977 + sSqlCondition: { sProductClassifyId: selectedNode.sId },
  1978 + });
  1979 +
  1980 + }
  1981 + }, [boxModel]);
  1982 +
1498 const { sColumnNameConfig } = slaveRowData || {}; 1983 const { sColumnNameConfig } = slaveRowData || {};
1499 const upAbleConfigsExtra = commonUtils.convertStrToObj(sColumnNameConfig, []).map(item => ({ 1984 const upAbleConfigsExtra = commonUtils.convertStrToObj(sColumnNameConfig, []).map(item => ({
1500 ...item, 1985 ...item,
@@ -1609,6 +2094,7 @@ const BoxComponent = props =&gt; { @@ -1609,6 +2094,7 @@ const BoxComponent = props =&gt; {
1609 // 印刷参数 2094 // 印刷参数
1610 const getUpViewPropsByITag = iTag => { 2095 const getUpViewPropsByITag = iTag => {
1611 if (!slaveConfig) return; 2096 if (!slaveConfig) return;
  2097 +
1612 const config = slaveConfig.gdsconfigformslave 2098 const config = slaveConfig.gdsconfigformslave
1613 .filter(item => !["sPrint", "sColor", "iPrintModePo"].includes(item.sName)) 2099 .filter(item => !["sPrint", "sColor", "iPrintModePo"].includes(item.sName))
1614 .filter(item => { 2100 .filter(item => {
@@ -1617,7 +2103,9 @@ const BoxComponent = props =&gt; { @@ -1617,7 +2103,9 @@ const BoxComponent = props =&gt; {
1617 } 2103 }
1618 const { bAdvancedSetting, bFlap, bFold } = slaveRowData; 2104 const { bAdvancedSetting, bFlap, bFold } = slaveRowData;
1619 const shouldExcludeItem = (condition, itemNameList) => !condition && itemNameList.includes(item.sName); 2105 const shouldExcludeItem = (condition, itemNameList) => !condition && itemNameList.includes(item.sName);
1620 - 2106 + if (selectedNode.showName === "封套") {
  2107 + slaveRowData.bFold = true;
  2108 + }
1621 if ( 2109 if (
1622 shouldExcludeItem(bAdvancedSetting, ["dPortrait", "dHorizontal"]) || 2110 shouldExcludeItem(bAdvancedSetting, ["dPortrait", "dHorizontal"]) ||
1623 shouldExcludeItem(bFlap, ["dFlap"]) || 2111 shouldExcludeItem(bFlap, ["dFlap"]) ||
@@ -1625,50 +2113,71 @@ const BoxComponent = props =&gt; { @@ -1625,50 +2113,71 @@ const BoxComponent = props =&gt; {
1625 ) { 2113 ) {
1626 return false; 2114 return false;
1627 } 2115 }
1628 - const rateList = [  
1629 - { id: 0, name: "不显示倍率" },  
1630 - { id: 1, name: "每本张数" },  
1631 - { id: 2, name: "片数" },  
1632 - ];  
1633 - if (Number(selectedNode.iRateType) === 0 && item.sName === "sMagnification") { 2116 + if (Number(selectedNode.iRateType) === 0 && item.sName === "iPage") {
1634 return false; 2117 return false;
1635 } else { 2118 } else {
1636 - if (item.sName === "sMagnification") {  
1637 - item.showName = rateList.find(rate => rate.id === Number(selectedNode.iRateType))?.name || "倍率"; 2119 + if (item.sName === "iPage") {
  2120 + const rateList = JSON.parse(slaveConfig.gdsconfigformslave.find(x => x.sName === "iRateType")?.showDropDown) || [];
  2121 + item.showName = rateList[Number(selectedNode.iRateType)] || "倍率";
  2122 + }
  2123 + }
  2124 +
  2125 + if (item.sName === "dWlcd" && selectedNode.sTypeKey === "juantong") {
  2126 + return false;
  2127 + }
  2128 + if (item.sName === "dAuxiliaryQty" && selectedNode.sTypeKey !== "juantong") {
  2129 + return false;
  2130 + }
  2131 + if (item.sName === "dWlkd") {
  2132 + if (selectedNode.sTypeKey === "juantong") {
  2133 + const FabricWidth = commonFunc.showLocalMessage(props, "FabricWidth", "门幅");
  2134 + item.showName = FabricWidth;
  2135 + } else {
  2136 + const MaterialWidth = commonFunc.showLocalMessage(props, "MaterialWidth", "材料宽");
  2137 + item.showName = MaterialWidth;
1638 } 2138 }
1639 } 2139 }
1640 if (item.sName === "sPaperDirection" && selectedNode.sTypeKey === "huace") { 2140 if (item.sName === "sPaperDirection" && selectedNode.sTypeKey === "huace") {
1641 return false; 2141 return false;
1642 } 2142 }
  2143 +
1643 // 判断bPartsDimension 是否显示展长展宽,0不显示,1显示 2144 // 判断bPartsDimension 是否显示展长展宽,0不显示,1显示
1644 2145
1645 if (selectedNode.bPartsDimension === false && (item.sName === "dPartsLength" || item.sName === "dPartsWidth")) { 2146 if (selectedNode.bPartsDimension === false && (item.sName === "dPartsLength" || item.sName === "dPartsWidth")) {
1646 return false; 2147 return false;
1647 } 2148 }
  2149 +
1648 if (!selectedNode.bBleed && item.sName === "dBleed") { 2150 if (!selectedNode.bBleed && item.sName === "dBleed") {
1649 return false; 2151 return false;
1650 } 2152 }
1651 if (selectedNode.sTypeKey !== "juantong" && item.sName === "sPaperDirection") { 2153 if (selectedNode.sTypeKey !== "juantong" && item.sName === "sPaperDirection") {
1652 return false; 2154 return false;
1653 } 2155 }
  2156 + if ((selectedNode.showName === "封套" && item.sName === "dSpine") || (selectedNode.showName === "封套" && item.sName === "bFlap")) {
  2157 + return false;
  2158 + }
  2159 +
1654 return item.iTag === iTag; 2160 return item.iTag === iTag;
1655 }); 2161 });
  2162 +
1656 let boxConfigList = []; 2163 let boxConfigList = [];
1657 if (iTag === 20) { 2164 if (iTag === 20) {
1658 let showNameKeyList = ["dZBLB", "dSBLB", "dYBLB", "dXBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"]; 2165 let showNameKeyList = ["dZBLB", "dSBLB", "dYBLB", "dXBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"];
1659 if (selectedNode.sTypeKey === "juantong") { 2166 if (selectedNode.sTypeKey === "juantong") {
1660 - showNameKeyList = ["dZBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"]; 2167 + showNameKeyList = ["dSBLB", "dZBJJ", "dYBJJ", "dSBJJ", "dXBJJ"];
1661 } 2168 }
1662 const UlToolPosition = commonFunc.showLocalMessage(props, "UlToolPosition", "上下刀位"); 2169 const UlToolPosition = commonFunc.showLocalMessage(props, "UlToolPosition", "上下刀位");
1663 const RLToolPosition = commonFunc.showLocalMessage(props, "RLToolPosition", "左右刀位"); 2170 const RLToolPosition = commonFunc.showLocalMessage(props, "RLToolPosition", "左右刀位");
1664 - const LeftMargin = commonFunc.showLocalMessage(props, "LeftMargin", "左右刀位");  
1665 - 2171 + const LeftMargin = commonFunc.showLocalMessage(props, "LeftMargin", "左右留白");
  2172 + const StayOnTheEdge = commonFunc.showLocalMessage(props, "StayOnTheEdge", "留边");
  2173 + const Spacing = commonFunc.showLocalMessage(props, "Spacing", "间距");
  2174 + const HopDistance = commonFunc.showLocalMessage(props, "HopDistance", "跳距");
1666 boxConfigList = boxConfig?.gdsconfigformslave?.filter(item => item.bVisible && showNameKeyList.includes(item.sName)) || []; 2175 boxConfigList = boxConfig?.gdsconfigformslave?.filter(item => item.bVisible && showNameKeyList.includes(item.sName)) || [];
1667 if (selectedNode.sTypeKey === "juantong") { 2176 if (selectedNode.sTypeKey === "juantong") {
1668 const mappings = { 2177 const mappings = {
1669 - dZBLB: "留边",  
1670 - dXBJJ: "跳距",  
1671 - dYBJJ: "间距", 2178 + dZBLB: StayOnTheEdge,
  2179 + dXBJJ: Spacing,
  2180 + dYBJJ: HopDistance,
1672 }; 2181 };
1673 2182
1674 boxConfigList.forEach(item => { 2183 boxConfigList.forEach(item => {
@@ -1691,12 +2200,13 @@ const BoxComponent = props =&gt; { @@ -1691,12 +2200,13 @@ const BoxComponent = props =&gt; {
1691 } 2200 }
1692 } 2201 }
1693 const newConfig = [...boxConfigList, ...config]; 2202 const newConfig = [...boxConfigList, ...config];
  2203 +
1694 return { 2204 return {
1695 ...props, 2205 ...props,
1696 viewConfigs: newConfig, 2206 viewConfigs: newConfig,
1697 tableConfig: { ...slaveConfig, gdsconfigformslave: newConfig }, 2207 tableConfig: { ...slaveConfig, gdsconfigformslave: newConfig },
1698 iColValueView: 24, 2208 iColValueView: 24,
1699 - viewRow: slaveRowData, 2209 + viewRow: { ...slaveRowData, sProductClassifyId: selectedNode.sId },
1700 tableName: `slaveUp${boxModel}`, 2210 tableName: `slaveUp${boxModel}`,
1701 }; 2211 };
1702 }; 2212 };
@@ -1748,11 +2258,41 @@ const BoxComponent = props =&gt; { @@ -1748,11 +2258,41 @@ const BoxComponent = props =&gt; {
1748 // 后道参数 2258 // 后道参数
1749 const { sBackProcessData } = slaveRowData || []; 2259 const { sBackProcessData } = slaveRowData || [];
1750 const [downAbleConfigsNew, setDownAbleConfigsNew] = useState([]); 2260 const [downAbleConfigsNew, setDownAbleConfigsNew] = useState([]);
  2261 +
1751 const computedDownAbleConfigsNew = useMemo(() => { 2262 const computedDownAbleConfigsNew = useMemo(() => {
1752 - return downAbleConfigs.reduce((pre, cur) => { 2263 + const arr = downAbleConfigs.reduce((pre, cur) => {
1753 const childConfigs = downAbleExtraConfigs.filter(item => item.sParentName === cur.showName); 2264 const childConfigs = downAbleExtraConfigs.filter(item => item.sParentName === cur.showName);
1754 return [...pre, cur, ...childConfigs]; 2265 return [...pre, cur, ...childConfigs];
1755 - }, []); 2266 + }, [])
  2267 + const sortBySName = (arr) => {
  2268 + return arr.slice().sort((a, b) => {
  2269 + // 分割前缀和后缀
  2270 + const aParts = a.sName.split('_');
  2271 + const bParts = b.sName.split('_');
  2272 + const aParamsNum = parseInt(aParts[0].replace('sParams', '')) || 0;
  2273 + const bParamsNum = parseInt(bParts[0].replace('sParams', '')) || 0;
  2274 +
  2275 + if (aParamsNum !== bParamsNum) {
  2276 + return aParamsNum - bParamsNum;
  2277 + }
  2278 + const aHasSuffix = aParts.length > 1;
  2279 + const bHasSuffix = bParts.length > 1;
  2280 + if (!aHasSuffix && bHasSuffix) return -1;
  2281 + if (aHasSuffix && !bHasSuffix) return 1;
  2282 + if (aHasSuffix && bHasSuffix) {
  2283 + return aParts[1].localeCompare(bParts[1], undefined, { numeric: true });
  2284 + }
  2285 + return 0;
  2286 + });
  2287 + }
  2288 + const sortedData = arr.reduce((prev, cur) => {
  2289 + const exists = prev.find(item => item.sName === cur.sName);
  2290 + if (!exists) {
  2291 + prev.push(cur);
  2292 + }
  2293 + return prev;
  2294 + }, [])
  2295 + return sortBySName(sortedData);
1756 }, [downAbleConfigs, downAbleExtraConfigs]); 2296 }, [downAbleConfigs, downAbleExtraConfigs]);
1757 2297
1758 // 使用 useEffect 设置 downAbleConfigsNew 状态 2298 // 使用 useEffect 设置 downAbleConfigsNew 状态
@@ -1764,16 +2304,38 @@ const BoxComponent = props =&gt; { @@ -1764,16 +2304,38 @@ const BoxComponent = props =&gt; {
1764 2304
1765 // 初始化状态,存储每个 Switch 的状态 2305 // 初始化状态,存储每个 Switch 的状态
1766 const [switchStates, setSwitchStates] = useState(null); 2306 const [switchStates, setSwitchStates] = useState(null);
1767 - 2307 + // 初始化成品工序
  2308 + const [finishedStates, setFinishedStates] = useState(null);
1768 // 处理 Switch 变化的函数 2309 // 处理 Switch 变化的函数
1769 const handleSwitchChange = (item, val) => { 2310 const handleSwitchChange = (item, val) => {
1770 setSwitchStates({ 2311 setSwitchStates({
1771 ...switchStates, 2312 ...switchStates,
1772 [item.sName]: val, 2313 [item.sName]: val,
1773 }); 2314 });
  2315 + const iIndex = downAbleExtraConfigs.findIndex(x => x.sId === item.sId);
  2316 + const slaveRowIndex = slaveData.findIndex(x => x.sId === slaveRowData.sId);
  2317 + const { sBackProcessData = [] } = slaveData[slaveRowIndex] || {};
  2318 + const iIndex1 = sBackProcessData.findIndex(x => x.sProductClassifyId === item.sId);
  2319 + // 如果是添加的工序 并且switch为关闭的状态下 需要删除已选过的数据
  2320 + if (!val) {
  2321 + if (iIndex1 !== -1) {
  2322 + props.setState(pre => {
  2323 + slaveData[slaveRowIndex].sBackProcessData?.splice(iIndex1, 1);
  2324 + return {
  2325 + ...pre,
  2326 + // downAbleExtraConfigs: [...downAbleExtraConfigs.slice(0, iIndex), ...downAbleExtraConfigs.slice(iIndex + 1)],
  2327 + slaveData,
  2328 + calcPriceFinished: false
  2329 + };
  2330 + });
  2331 + }
  2332 + }
  2333 +
1774 }; 2334 };
  2335 +
1775 // 过滤后的数据 2336 // 过滤后的数据
1776 - const downViewConfigs = downAbleConfigsNew 2337 +
  2338 + let downViewConfigs = downAbleConfigsNew
1777 .filter(item => item.sPartsName === boxModel || !item.sPartsName) 2339 .filter(item => item.sPartsName === boxModel || !item.sPartsName)
1778 .map((item, i) => ({ 2340 .map((item, i) => ({
1779 ...item, 2341 ...item,
@@ -1781,6 +2343,39 @@ const BoxComponent = props =&gt; { @@ -1781,6 +2343,39 @@ const BoxComponent = props =&gt; {
1781 // sName: "sParams" + i, 2343 // sName: "sParams" + i,
1782 sProductClassifyId: item.sId, 2344 sProductClassifyId: item.sId,
1783 })); 2345 }));
  2346 +
  2347 + useEffect(() => {
  2348 + if (!switchStates) return ''
  2349 + downViewConfigs = downAbleConfigsNew
  2350 + .filter(item => item.sPartsName === boxModel || !item.sPartsName)
  2351 + .map((item, i) => ({
  2352 + ...item,
  2353 + isSelect: switchStates ? switchStates[item.sName] : false,
  2354 + // sName: "sParams" + i,
  2355 + sProductClassifyId: item.sId,
  2356 + }));
  2357 + }, [switchStates])
  2358 + const hasProcessedRef = useRef(false);
  2359 + useEffect(() => {
  2360 + hasProcessedRef.current = false;
  2361 + if (!sBackProcessData?.length || !downViewConfigs) return;
  2362 + // 批量状态更新
  2363 + const updates = sBackProcessData.reduce((acc, item) => {
  2364 + const sName = downViewConfigs.find(x => x.showName === item.sProcessName)?.sName;
  2365 + if (sName) acc[sName] = true;
  2366 + Object.keys(item).forEach(key => {
  2367 + if (/^sParams\d+/.test(key)) {
  2368 + acc[key] = true;
  2369 + }
  2370 + });
  2371 + return acc;
  2372 + }, {});
  2373 + if (Object.keys(updates).length > 0) {
  2374 + setSwitchStates(prev => ({ ...prev, ...updates }));
  2375 + hasProcessedRef.current = true;
  2376 + }
  2377 + }, [sBackProcessData, downAbleConfigsNew]);
  2378 +
1784 const downViewProps = { 2379 const downViewProps = {
1785 ...props, 2380 ...props,
1786 viewConfigs: downViewConfigs, 2381 viewConfigs: downViewConfigs,
@@ -1790,28 +2385,65 @@ const BoxComponent = props =&gt; { @@ -1790,28 +2385,65 @@ const BoxComponent = props =&gt; {
1790 tableName: `slaveDown${boxModel}`, 2385 tableName: `slaveDown${boxModel}`,
1791 }; 2386 };
1792 2387
1793 - // 获取sType为3的  
1794 - // const { productProcessInfo = [] } = masterData;  
1795 - // const finishedViewProps = {  
1796 - // ...props,  
1797 - // viewConfigs: finishedConfigs  
1798 - // .filter(item => item.sPartsName === boxModel || !item.sPartsName)  
1799 - // .map((item, i) => ({  
1800 - // ...item,  
1801 - // isSelect: switchStates ? switchStates[item.sName] : false,  
1802 - // // sName: "sParams" + i,  
1803 - // sProductClassifyId: item.sId,  
1804 - // })),  
1805 - // tableConfig: { ...slaveConfig, gdsconfigformslave: finishedConfigs },  
1806 - // iColValueView: 24,  
1807 - // viewRow: masterData,  
1808 - // tableName: "finished",  
1809 - // }; 2388 + const { productProcessInfo = [] } = masterData;
  2389 + const finishedViewProps = {
  2390 + ...props,
  2391 + viewConfigs: finishedConfigs.map(config => ({
  2392 + ...config,
  2393 + isSelect: finishedStates ? finishedStates[config.sName] : false,
  2394 + costomStyle: productProcessInfo.find(item => item[config.sName])?.sParamConfig ? styles.sParamConfig : "",
  2395 + })),
  2396 + tableConfig: { ...slaveConfig, gdsconfigformslave: finishedConfigs },
  2397 + iColValueView: 24,
  2398 + viewRow: { ...masterData, sId: masterData.sId || "123" },
  2399 + getViewRow: config => {
  2400 + return productProcessInfo.find(item => item[config.sName]) || {};
  2401 + },
  2402 +
  2403 + tableName: "finished",
  2404 + onCostomClick: (showConfig) => {
  2405 + props.setState(pre => ({
  2406 + ...pre,
  2407 + backendParamsConfig: commonUtils.convertStrToObj(productProcessInfo.find(item => item[showConfig.sName])?.sParamConfig, []),
  2408 + backendConfig: { sParentFieldsName: showConfig.sName, typeName: "finished", dropDownDataSelected: showConfig },
  2409 + }));
  2410 + },
  2411 + };
  2412 + useEffect(() => {
  2413 + if (!productProcessInfo?.length || !finishedConfigs) return;
  2414 + const updates = productProcessInfo.reduce((acc, item) => {
  2415 + const sName = downViewConfigs.find(x => x.showName === item.sProcessName)?.sName;
  2416 + if (sName) acc[sName] = true;
  2417 + Object.keys(item).forEach(key => {
  2418 + if (/^sParams\d+/.test(key)) {
  2419 + acc[key] = true;
  2420 + }
  2421 + });
  2422 + return acc;
  2423 + }, {});
  2424 + if (Object.keys(updates).length > 0) {
  2425 + setFinishedStates(prev => ({ ...prev, ...updates }));
  2426 + }
  2427 + }, [productProcessInfo, finishedConfigs])
  2428 +
1810 const calcMethodData = commonUtils.convertStrToObj(slaveRowData?.sColumnNameConfigExclusion, []); 2429 const calcMethodData = commonUtils.convertStrToObj(slaveRowData?.sColumnNameConfigExclusion, []);
1811 // const radioValue = null; 2430 // const radioValue = null;
1812 const { radioValue = calcMethodData[0]?.sCode } = slaveRowData; 2431 const { radioValue = calcMethodData[0]?.sCode } = slaveRowData;
1813 const [materialLength, setMaterialLength] = useState(0); 2432 const [materialLength, setMaterialLength] = useState(0);
1814 const [materialWidth, setMaterialWidth] = useState(0); 2433 const [materialWidth, setMaterialWidth] = useState(0);
  2434 +
  2435 +
  2436 + // 使用 防抖防止输出数据错误
  2437 + const debounceTimer = useRef(null);
  2438 + const debouncedHandleSaveState = useCallback(
  2439 + (...args) => {
  2440 + clearTimeout(debounceTimer.current);
  2441 + debounceTimer.current = setTimeout(() => {
  2442 + handleSaveState(...args);
  2443 + }, 500);
  2444 + },
  2445 + [handleSaveState]
  2446 + );
1815 // 使用 useCallback 确保回调函数的稳定性 2447 // 使用 useCallback 确保回调函数的稳定性
1816 const handleSaveState = ( 2448 const handleSaveState = (
1817 length, 2449 length,
@@ -1835,25 +2467,22 @@ const BoxComponent = props =&gt; { @@ -1835,25 +2467,22 @@ const BoxComponent = props =&gt; {
1835 const { selectedNode } = props.state; 2467 const { selectedNode } = props.state;
1836 2468
1837 const index = slaveData?.findIndex(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel); 2469 const index = slaveData?.findIndex(x => x.sTreeNodeName === selectedNode.showName && x.sBoxModel === props.boxModel);
1838 - // 判断展长展宽是否可以放下原纸  
1839 - const isDPartsLength =  
1840 - slaveData[index]?.dPartsLength < slaveData[index]?.dMaxLength && slaveData[index]?.dPartsWidth < slaveData[index]?.dMaxWidth;  
1841 - 2470 + const { isRadio } = slaveData[index] || false
1842 if (index !== undefined && index !== -1) { 2471 if (index !== undefined && index !== -1) {
1843 // 计算开数 2472 // 计算开数
1844 2473
1845 // 获取原始对象并创建一个新的对象进行更新 2474 // 获取原始对象并创建一个新的对象进行更新
1846 const updatedProduct = { 2475 const updatedProduct = {
1847 ...slaveData[index], 2476 ...slaveData[index],
1848 - materialLength: length,  
1849 - materialWidth: width,  
1850 - dMachineLength: length, // 上机长  
1851 - dMachineWidth: width, // 上机宽  
1852 - sMaterialsStyle: `${slaveData[index]?.dWlcd || 0}*${slaveData[index]?.dWlkd || 0}`, // 原纸尺寸 2477 + materialLength: dWlcd,
  2478 + materialWidth: dWlkd,
  2479 + dMachineLength: dWlcd, // 上机长
  2480 + dMachineWidth: dWlkd, // 上机宽
  2481 + sMaterialsStyle: `${slaveData[index]?.dWlcd || dWlcd}*${slaveData[index]?.dWlkd || dWlkd}`, // 原纸尺寸
1853 sMachineStyle: `${length || slaveData[index].materialLength}*${width || slaveData[index].materialWidth}`, // 开料尺寸为计算的排版尺寸 2482 sMachineStyle: `${length || slaveData[index].materialLength}*${width || slaveData[index].materialWidth}`, // 开料尺寸为计算的排版尺寸
1854 - sMaterialRate: (((length * width) / (dWlcd * dWlkd)) * 100).toFixed(2),  
1855 - newMaterialLength: length,  
1856 - newMaterialWidth: width, 2483 + sMaterialRate: (((length * width) / ((slaveData[index].dWlcd || dWlcd) * (slaveData[index].dWlkd || dWlkd))) * 100).toFixed(2),
  2484 + newMaterialLength: dWlcd,
  2485 + newMaterialWidth: dWlkd,
1857 sLayoutRate: Number( 2486 sLayoutRate: Number(
1858 ( 2487 (
1859 (((length || slaveData[index].materialLength) * (width || slaveData[index].materialWidth)) / 2488 (((length || slaveData[index].materialLength) * (width || slaveData[index].materialWidth)) /
@@ -1861,9 +2490,11 @@ const BoxComponent = props =&gt; { @@ -1861,9 +2490,11 @@ const BoxComponent = props =&gt; {
1861 100 2490 100
1862 ).toFixed(2) 2491 ).toFixed(2)
1863 ), 2492 ),
1864 - dWlcd: dWlcd,  
1865 - dWlkd: dWlkd,  
1866 - dMachineQty: Math.floor(dProductQty / dSinglePQty), 2493 + // dWlcd: selectedNode.sTypeKey === 'juantong' ? Math.floor(dProductQty / dSinglePQty * ( length/ 1000)) : dWlcd,
  2494 + dWlcd: isRadio ? dWlcd : sBillNo ? slaveData[index]?.dWlcd : dWlcd,
  2495 + dWlkd: isRadio ? dWlkd : sBillNo ? slaveData[index]?.dWlkd : dWlkd,
  2496 + dAuxiliaryQty: Math.floor((dProductQty / dSinglePQty) * (length / 1000)),
  2497 + dMachineQty: sBillNo && slaveData[index].dMachineQty ? slaveData[index].dMachineQty : Math.floor(dProductQty / dSinglePQty),
1867 dSinglePQty: dSinglePQty, 2498 dSinglePQty: dSinglePQty,
1868 dMaterialsKQty: dMaterialsKQty, 2499 dMaterialsKQty: dMaterialsKQty,
1869 scale: scale, 2500 scale: scale,
@@ -1873,6 +2504,7 @@ const BoxComponent = props =&gt; { @@ -1873,6 +2504,7 @@ const BoxComponent = props =&gt; {
1873 dPortrait: dPortraitType, 2504 dPortrait: dPortraitType,
1874 dHorizontalType: dHorizontalType, // 判断 2505 dHorizontalType: dHorizontalType, // 判断
1875 dPortraitType: dPortraitType, 2506 dPortraitType: dPortraitType,
  2507 + isRadio: false,
1876 }; 2508 };
1877 let juantongConfig = {}; 2509 let juantongConfig = {};
1878 2510
@@ -1891,10 +2523,12 @@ const BoxComponent = props =&gt; { @@ -1891,10 +2523,12 @@ const BoxComponent = props =&gt; {
1891 ...juantongConfig, 2523 ...juantongConfig,
1892 }; 2524 };
1893 // 更新状态 2525 // 更新状态
1894 - props.setState(prevState => ({  
1895 - ...prevState,  
1896 - slaveData: slaveData.map((item, i) => (i === index ? newSlaveData : item)),  
1897 - })); 2526 + setTimeout(() => {
  2527 + props.setState(prevState => ({
  2528 + ...prevState,
  2529 + slaveData: slaveData.map((item, i) => (i === index ? newSlaveData : item)),
  2530 + }));
  2531 + }, 200);
1898 } 2532 }
1899 2533
1900 setMaterialLength(length); 2534 setMaterialLength(length);
@@ -1945,9 +2579,10 @@ const BoxComponent = props =&gt; { @@ -1945,9 +2579,10 @@ const BoxComponent = props =&gt; {
1945 materialLength, 2579 materialLength,
1946 materialWidth, 2580 materialWidth,
1947 bBox: true, // 快速报价盒型展示 2581 bBox: true, // 快速报价盒型展示
1948 - width: 200, 2582 + width: 180,
1949 height: 150, 2583 height: 150,
1950 - size: 9, 2584 + size: 7,
  2585 + isMobile: true,
1951 }; 2586 };
1952 2587
1953 const handleChange = v => { 2588 const handleChange = v => {
@@ -1968,75 +2603,7 @@ const BoxComponent = props =&gt; { @@ -1968,75 +2603,7 @@ const BoxComponent = props =&gt; {
1968 } 2603 }
1969 }; 2604 };
1970 2605
1971 - const getTableCloum = (i, child) => {  
1972 - if (!sBackProcessData) return;  
1973 - const value = sBackProcessData.find(item => item[child.sName]) || {};  
1974 - if (!value) return;  
1975 - const { bSetArea, bSetQty, sName, sSetQtyUnt } = value;  
1976 - const viewConfigs = [];  
1977 - if (bSetArea) {  
1978 - viewConfigs.push({  
1979 - sName: "dManualLength",  
1980 - showName: "x",  
1981 - iColValue: bSetQty ? 8 : 12,  
1982 - placeholder: "长",  
1983 - value: value.dManualLength ? value.dManualLength + "" : "",  
1984 - });  
1985 - viewConfigs.push({  
1986 - sName: "dManualWidth",  
1987 - showName: "mm",  
1988 - iColValue: bSetQty ? 8 : 12,  
1989 - placeholder: "宽",  
1990 - value: value.dManualWidth ? value.dManualWidth + "" : "",  
1991 - });  
1992 - }  
1993 - if (bSetQty) {  
1994 - viewConfigs.push({  
1995 - sName: "dManualQty",  
1996 - showName: sSetQtyUnt || "",  
1997 - iColValue: bSetArea ? 8 : 24,  
1998 - placeholder: "数量",  
1999 - value: value.dManualQty ? value.dManualQty + "" : "",  
2000 - });  
2001 - }  
2002 - const viewProps = {  
2003 - ...props,  
2004 - viewConfigs: viewConfigs,  
2005 - tableConfig: { ...slaveConfig, gdsconfigformslave: viewConfigs },  
2006 - iColValueView: 24,  
2007 - viewRow: value,  
2008 - tableName: `slaveDown${boxModel}${sName}`,  
2009 - };  
2010 - const onDataChange = (name, sFieldName, changeValue) => {  
2011 - const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);  
2012 - const iIndex1 = slaveData[iIndex].sBackProcessData.findIndex(item => item[child.sName]);  
2013 - slaveData[iIndex].sBackProcessData[iIndex1][sFieldName] = changeValue;  
2014 - const { dManualLength, dManualWidth } = slaveData[iIndex].sBackProcessData[iIndex1];  
2015 - if (dManualLength !== undefined && dManualWidth !== undefined) {  
2016 - slaveData[iIndex].sBackProcessData[iIndex1].dManualValue = dManualLength * dManualWidth;  
2017 - }  
2018 - props.setState(pre => ({ ...pre, slaveData }));  
2019 - };  
2020 - return viewConfigs.length ? (  
2021 - <Grid columns={3} gap={8}>  
2022 - {viewProps.viewConfigs.map(x => (  
2023 - <Grid.Item>  
2024 - <div className={styles.customer} key={x.id || x.showName} style={{ marginTop: "0", display: "flex", alignItems: "center" }}>  
2025 - <Input  
2026 - placeholder=""  
2027 - onChange={e => {  
2028 - onDataChange(viewProps.tableName, x.sName, e, x);  
2029 - }}  
2030 - ></Input>  
2031 - <div style={{ width: "30%", textAlign: "center" }}>{x.showName}</div>  
2032 - </div>  
2033 - </Grid.Item>  
2034 - ))}  
2035 - </Grid>  
2036 - ) : (  
2037 - ""  
2038 - );  
2039 - }; 2606 +
2040 const { loading } = props; 2607 const { loading } = props;
2041 const calcMethod = calcMethodData.map(item => ({ 2608 const calcMethod = calcMethodData.map(item => ({
2042 value: item.sCode, 2609 value: item.sCode,
@@ -2044,24 +2611,51 @@ const BoxComponent = props =&gt; { @@ -2044,24 +2611,51 @@ const BoxComponent = props =&gt; {
2044 })); 2611 }));
2045 2612
2046 const onCostomClick = showConfig => { 2613 const onCostomClick = showConfig => {
2047 - console.log(showConfig,sBackProcessData,'showConfig');  
2048 -  
2049 props.setState(pre => ({ 2614 props.setState(pre => ({
2050 ...pre, 2615 ...pre,
2051 - backendParamsConfig: commonUtils.convertStrToObj(sBackProcessData.find(item => item[showConfig.sName0 || showConfig.sName])?.sParamConfig, []),  
2052 - backendConfig: { sParentFieldsName: showConfig.sName, sBoxModel: boxModel }, 2616 + backendParamsConfig: commonUtils.convertStrToObj(sBackProcessData?.find(item => item[showConfig.sName0 || showConfig.sName])?.sParamConfig, []),
  2617 + backendConfig: { sParentFieldsName: showConfig.sName, sBoxModel: boxModel, typeName: 'slave', dropDownDataSelected: showConfig },
2053 })); 2618 }));
2054 }; 2619 };
2055 2620
2056 useEffect(() => { 2621 useEffect(() => {
2057 if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") { 2622 if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") {
2058 const data = selectList.find(x => x.sTypes === "6"); 2623 const data = selectList.find(x => x.sTypes === "6");
2059 - if (!data) return; 2624 + if (!data) return '';
2060 const currentBoxModel = "slaveUp" + props.boxModel; 2625 const currentBoxModel = "slaveUp" + props.boxModel;
2061 props.onDataChange(currentBoxModel, "sName", { sName: data.sName }, data.sId, selectList); 2626 props.onDataChange(currentBoxModel, "sName", { sName: data.sName }, data.sId, selectList);
2062 } 2627 }
2063 }, [selectedNode.sTypeKey, selectList]); 2628 }, [selectedNode.sTypeKey, selectList]);
2064 - 2629 + const getImageUrl = (sName) => {
  2630 + const imageUrlNew = `${commonConfig.server_host}file/downloadPrice?sLogoName=${sName}&date=${new Date().getTime()}`;
  2631 + return imageUrlNew;
  2632 + };
  2633 + const removeExtension = (filename) => {
  2634 + if (!filename) return
  2635 + const lastDotIndex = filename.lastIndexOf('.');
  2636 + if (lastDotIndex === -1) {
  2637 + // 如果字符串中没有点,则返回原字符串
  2638 + return filename;
  2639 + }
  2640 + return filename.substring(0, lastDotIndex);
  2641 + }
  2642 + let imagesData = useMemo(() => {
  2643 + if (!slaveRowData) return [];
  2644 + return [
  2645 + { src: getImageUrl(removeExtension(slaveRowData.sPackDetailPathUpLoad)), alt: "展开图" },
  2646 + { src: getImageUrl(removeExtension(slaveRowData.sPackPath)), alt: "立体图" },
  2647 + ];
  2648 + }, [slaveRowData?.sPackDetailPathUpLoad, slaveRowData?.sPackPath]);
  2649 + if (!slaveRowData.sPackDetailPathUpLoad) {
  2650 + imagesData = [{ src: getImageUrl(removeExtension(slaveRowData.sPackPath)), alt: "立体图" }];
  2651 + } else if (!slaveRowData.sPackPath) {
  2652 + imagesData = [{ src: getImageUrl(removeExtension(slaveRowData.sPackPath)), alt: "立体图" }];
  2653 + }
  2654 + const [imgVisible, setImgVisible] = useState(false)
  2655 + const impositionDetails = commonFunc.showLocalMessage(props, "impositionDetails", "拼版详情");
  2656 + const PrintedInformation = commonFunc.showLocalMessage(props, "PrintedInformation", "印刷信息");
  2657 + const backEndParameters = commonFunc.showLocalMessage(props, "backEndParameters", "后道参数");
  2658 + const choose = commonFunc.showLocalMessage(props, "choose", "选择");
2065 return ( 2659 return (
2066 <div> 2660 <div>
2067 {selectedNode.bBox ? ( 2661 {selectedNode.bBox ? (
@@ -2071,7 +2665,7 @@ const BoxComponent = props =&gt; { @@ -2071,7 +2665,7 @@ const BoxComponent = props =&gt; {
2071 <Selector 2665 <Selector
2072 columns={4} 2666 columns={4}
2073 options={boxTypeList} 2667 options={boxTypeList}
2074 - style={{ "--padding": "0.8rem 0" }} 2668 + style={{ "--padding": "12px 0" }}
2075 value={selected ? [selected] : []} 2669 value={selected ? [selected] : []}
2076 onChange={v => handleChange(v)} 2670 onChange={v => handleChange(v)}
2077 /> 2671 />
@@ -2084,22 +2678,88 @@ const BoxComponent = props =&gt; { @@ -2084,22 +2678,88 @@ const BoxComponent = props =&gt; {
2084 <Grid columns={4} gap={8}> 2678 <Grid columns={4} gap={8}>
2085 {upViewProps 2679 {upViewProps
2086 ? upViewProps.viewConfigs.map(x => ( 2680 ? upViewProps.viewConfigs.map(x => (
2087 - <Grid.Item>  
2088 - <div className={styles.customer} key={x.id || x.sBig5}>  
2089 - <div>{x.sBig5}</div>  
2090 - <SelectInput {...upViewProps} itemDetail={x} bCanInput={true} />  
2091 - </div>  
2092 - </Grid.Item>  
2093 - )) 2681 + <Grid.Item>
  2682 + <div className={styles.customer} key={x.id || x.sBig5}>
  2683 + <div className={styles.label}>{x.sBig5}</div>
  2684 + <SelectInput {...upViewProps} itemDetail={x} bCanInput={true} />
  2685 + </div>
  2686 + </Grid.Item>
  2687 + ))
2094 : ""} 2688 : ""}
2095 </Grid> 2689 </Grid>
2096 </div> 2690 </div>
2097 <div className={styles.svgBox}> 2691 <div className={styles.svgBox}>
2098 - <div style={{ width: "9.375rem", height: "9.375rem" }}> 2692 + <div style={{ width: "150px", height: "150px" }}>
2099 <DynamicSVG {...svgProps} /> 2693 <DynamicSVG {...svgProps} />
2100 </div> 2694 </div>
2101 - {slaveRowData && slaveRowData.sPackPath ? <Image src={slaveRowData.sPackPath} width={125} height={125} fit="fill" /> : ""} 2695 + {slaveRowData && slaveRowData.sPackPath ? <Image src={imagesData[0].src} width={125} height={125} fit="fill" onClick={() => {
  2696 + setImgVisible(true)
  2697 + }} /> : ""}
  2698 + <ImageViewer.Multi
  2699 + images={imagesData.map(item => item.src)}
  2700 + visible={imgVisible}
  2701 + defaultIndex={1}
  2702 + onClose={() => {
  2703 + setImgVisible(false)
  2704 + }}
  2705 + />
2102 </div> 2706 </div>
  2707 +
  2708 + <Collapse style={{ width: '300px' }} className={styles.CollapseBox} >
  2709 + <Collapse.Panel key='1' title={impositionDetails} forceRender>
  2710 + <div>
  2711 + <Grid columns={3} gap={8}>
  2712 + {upViewProps20
  2713 + ? upViewProps20.viewConfigs.map(x => (
  2714 + <Grid.Item>
  2715 + <div className={styles.customer} key={x.id || x.showName}>
  2716 + <div>{x.showName}</div>
  2717 + <SelectInput {...upViewProps20} itemDetail={x} bCanInput={false} />
  2718 + </div>
  2719 + </Grid.Item>
  2720 + ))
  2721 + : ""}
  2722 + </Grid>
  2723 + {selectedNode.bBox ? (
  2724 + <div style={{ width: '300px' }}>
  2725 + <div className={styles.svgBox1}>
  2726 + <div style={{ width: "49%", height: "49%", position: "relative" }}>
  2727 + {
  2728 + boxProps.slaveRowData && boxProps.state.masterData ?
  2729 + <Typesetting {...boxProps} onSaveStates={debouncedHandleSaveState} onSaveDPartsLength={onSaveDPartsLength} />
  2730 + : ''
  2731 + }
  2732 + </div>
  2733 + <div style={{ width: "47%", height: "47%", position: "relative", fontWeight: '500' }}>
  2734 + <ShowImgM {...showImgMProps} />
  2735 + </div>
  2736 + </div>
  2737 + <Radio.Group
  2738 + value={radioValue}
  2739 + onChange={e => {
  2740 + const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
  2741 + slaveData[iIndex].radioValue = e;
  2742 + slaveData[iIndex].isRadio = true;
  2743 + props.setState(pre => ({
  2744 + ...pre,
  2745 + slaveData: slaveData,
  2746 + }));
  2747 + }}
  2748 + >
  2749 + {calcMethod.map(item => (
  2750 + <Radio value={item.value} style={{ marginRight: "8px" }}>
  2751 + {" "}
  2752 + {item.label}
  2753 + </Radio>
  2754 + ))}
  2755 + </Radio.Group>
  2756 + </div>
  2757 + ) : (
  2758 + ""
  2759 + )}
  2760 + </div>
  2761 + </Collapse.Panel>
  2762 + </Collapse>
2103 </div> 2763 </div>
2104 ) : ( 2764 ) : (
2105 "" 2765 ""
@@ -2107,213 +2767,134 @@ const BoxComponent = props =&gt; { @@ -2107,213 +2767,134 @@ const BoxComponent = props =&gt; {
2107 2767
2108 <div> 2768 <div>
2109 <div className={styles.boxTitle}> 2769 <div className={styles.boxTitle}>
2110 - 印刷信息  
2111 - <EditFill color="#BFBFBF" style={{ marginLeft: "1rem" }} /> 2770 + {PrintedInformation}
  2771 + <EditFill color="#BFBFBF" style={{ marginLeft: "16px" }} />
2112 </div> 2772 </div>
2113 <PrintParamsComponent {...props} /> 2773 <PrintParamsComponent {...props} />
2114 <Grid columns={3} gap={8}> 2774 <Grid columns={3} gap={8}>
2115 {upViewProps12 2775 {upViewProps12
2116 ? upViewProps12.viewConfigs.map(x => ( 2776 ? upViewProps12.viewConfigs.map(x => (
2117 - <Grid.Item>  
2118 - <div className={styles.customer} key={x.id || x.showName}>  
2119 - <div>{x.showName}</div>  
2120 - <SelectInput {...upViewProps12} itemDetail={x} bCanInput={false} />  
2121 - </div>  
2122 - </Grid.Item>  
2123 - )) 2777 + <Grid.Item>
  2778 + <div className={styles.customer} key={x.id || x.showName}>
  2779 + <div>{x.showName}</div>
  2780 + <SelectInput {...upViewProps12} itemDetail={x} bCanInput={false} />
  2781 + </div>
  2782 + </Grid.Item>
  2783 + ))
2124 : ""} 2784 : ""}
2125 </Grid> 2785 </Grid>
2126 </div> 2786 </div>
2127 - <div>  
2128 - {selectedNode.bBox ? (  
2129 - <div>  
2130 - <div>  
2131 - <div className={styles.boxTitle}>  
2132 - 拼版信息  
2133 - <EditFill color="#BFBFBF" style={{ marginLeft: "1rem" }} />  
2134 - </div>  
2135 2787
2136 - <Grid columns={3} gap={8}>  
2137 - {upViewProps20  
2138 - ? upViewProps20.viewConfigs.map(x => (  
2139 - <Grid.Item>  
2140 - <div className={styles.customer} key={x.id || x.showName}>  
2141 - <div>{x.showName}</div>  
2142 - <SelectInput  
2143 - {...upViewProps20}  
2144 - itemDetail={x}  
2145 - bCanInput={() => {  
2146 - // if (x.showDropDown) return false;  
2147 - return true;  
2148 - }}  
2149 - />  
2150 - </div>  
2151 - </Grid.Item>  
2152 - ))  
2153 - : ""}  
2154 - </Grid>  
2155 - </div>  
2156 - <div className={styles.svgBox1}>  
2157 - <div style={{ width: "49%", height: "49%", position: "relative" }}>  
2158 - <Typesetting {...boxProps} onSaveStates={handleSaveState} onSaveDPartsLength={onSaveDPartsLength} />  
2159 - </div>  
2160 - <div style={{ width: "47%", height: "47%", position: "relative" }}>  
2161 - <ShowImgM {...showImgMProps} />  
2162 - </div>  
2163 - </div>  
2164 - <Radio.Group  
2165 - value={radioValue}  
2166 - onChange={e => {  
2167 - const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);  
2168 - slaveData[iIndex].radioValue = e;  
2169 - props.setState(pre => ({  
2170 - ...pre,  
2171 - slaveData: slaveData,  
2172 - }));  
2173 - }}  
2174 - >  
2175 - {calcMethod.map(item => (  
2176 - <Radio value={item.value} style={{ marginRight: "0.5rem" }}>  
2177 - {" "}  
2178 - {item.label}  
2179 - </Radio>  
2180 - ))}  
2181 - </Radio.Group>  
2182 - </div>  
2183 - ) : (  
2184 - ""  
2185 - )}  
2186 - </div>  
2187 <div> 2788 <div>
2188 <MaterialsComponent {...props} slaveRowData={slaveRowData} boxModel={boxModel} /> 2789 <MaterialsComponent {...props} slaveRowData={slaveRowData} boxModel={boxModel} />
2189 </div> 2790 </div>
2190 <div> 2791 <div>
2191 <div className={styles.boxTitle}> 2792 <div className={styles.boxTitle}>
2192 - 后道参数  
2193 - <EditFill color="#BFBFBF" style={{ marginLeft: "1rem" }} /> 2793 + {backEndParameters}
  2794 + <EditFill color="#BFBFBF" style={{ marginLeft: "16px" }} />
2194 </div> 2795 </div>
2195 2796
2196 {downViewProps && downViewProps.viewConfigs && downViewProps.viewConfigs.length 2797 {downViewProps && downViewProps.viewConfigs && downViewProps.viewConfigs.length
2197 ? downViewProps.viewConfigs.map((x, i) => ( 2798 ? downViewProps.viewConfigs.map((x, i) => (
2198 - <div>  
2199 - <div className={styles.backBox}>  
2200 - <div className={styles.backEnd}>{x.showName}</div>  
2201 - <Switch checked={switchStates ? switchStates[x.sName] : ""} onChange={val => handleSwitchChange(x, val)} />  
2202 - <div className={styles.customer} style={{ marginTop: "0", marginLeft: "2rem", width: "40%" }}>  
2203 - {switchStates && switchStates[x.sName] ? (  
2204 - // 这里需要数组遍历 多个工序  
2205 - <div className={styles.processFlex}>  
2206 - <SelectInput  
2207 - {...downViewProps}  
2208 - itemDetail={{ ...x, sVisColumnName: "sProcessName" }}  
2209 - downIndex={i}  
2210 - onCostomClick={onCostomClick}  
2211 - />  
2212 - <div className={styles.processBtn}>  
2213 - {!x.sParentName ? (  
2214 - <Button  
2215 - color="primary"  
2216 - fill="solid"  
2217 - size="small"  
2218 - style={{  
2219 - width: "1.93rem",  
2220 - height: "1.93rem",  
2221 - display: "flex",  
2222 - justifyContent: "center",  
2223 - alignItems: "center",  
2224 - textAlign: "center",  
2225 - }}  
2226 - onClick={() => {  
2227 - props.setState(pre => {  
2228 - const newSId = commonUtils.createSid();  
2229 - const newConfig = {  
2230 - ...x,  
2231 - sId: newSId,  
2232 - sParentName: x.showName,  
2233 - sName: `${x.sName}_${newSId}`,  
2234 - };  
2235 - return {  
2236 - ...pre,  
2237 - downAbleExtraConfigs: [...downAbleExtraConfigs, newConfig],  
2238 - };  
2239 - });  
2240 - }}  
2241 - >  
2242 - <AddOutline />  
2243 - </Button>  
2244 - ) : (  
2245 - <Button  
2246 - color="danger"  
2247 - fill="solid"  
2248 - size="small"  
2249 - style={{  
2250 - width: "1.93rem",  
2251 - height: "1.93rem",  
2252 - display: "flex",  
2253 - justifyContent: "center",  
2254 - alignItems: "center",  
2255 - textAlign: "center",  
2256 - }}  
2257 - onClick={() => {  
2258 - props.setState(pre => {  
2259 - const iIndex = downAbleExtraConfigs.findIndex(item => item.sId === x.sId);  
2260 -  
2261 - const slaveRowIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);  
2262 - const { sBackProcessData = [] } = slaveData[slaveRowIndex];  
2263 - const iIndex1 = sBackProcessData.findIndex(item => item[x.sName]); 2799 + <div key={x.sId}>
  2800 + <div className={styles.backBox}>
  2801 + <div className={styles.backEnd}>{x.showName}</div>
  2802 + <Switch checked={!!(switchStates && switchStates[x.sName])} onChange={val => handleSwitchChange(x, val)} />
  2803 + <div className={styles.customer} style={{ marginTop: "0", marginLeft: "32px", width: "40%" }}>
  2804 + {switchStates && switchStates[x.sName] ? (
  2805 + // 这里需要数组遍历 多个工序
  2806 + <div className={styles.processFlex}>
  2807 + <SelectInput
  2808 + {...downViewProps}
  2809 + itemDetail={{ ...x, sVisColumnName: "sProcessName" }}
  2810 + downIndex={i}
  2811 + onCostomClick={onCostomClick}
  2812 + />
  2813 + <div className={styles.processBtn}>
  2814 + {!x.sParentName ? (
  2815 + <Button
  2816 + color="primary"
  2817 + fill="solid"
  2818 + size="small"
  2819 + style={{
  2820 + width: "30px",
  2821 + height: "30px",
  2822 + display: "flex",
  2823 + justifyContent: "center",
  2824 + alignItems: "center",
  2825 + textAlign: "center",
  2826 + }}
  2827 + onClick={() => {
  2828 + props.setState(pre => {
  2829 + const newSId = commonUtils.createSid();
  2830 + const newConfig = {
  2831 + ...x,
  2832 + sId: newSId,
  2833 + sParentName: x.showName,
  2834 + sName: `${x.sName}_${newSId}`,
  2835 + };
  2836 +
  2837 + return {
  2838 + ...pre,
  2839 + downAbleExtraConfigs: [...downAbleExtraConfigs, newConfig],
  2840 + };
  2841 + });
  2842 + }}
  2843 + >
  2844 + <AddOutline />
  2845 + </Button>
  2846 + ) : (
  2847 + <Button
  2848 + color="danger"
  2849 + fill="solid"
  2850 + size="small"
  2851 + style={{
  2852 + width: "30px",
  2853 + height: "30px",
  2854 + display: "flex",
  2855 + justifyContent: "center",
  2856 + alignItems: "center",
  2857 + textAlign: "center",
  2858 + }}
  2859 + onClick={() => {
  2860 + const updateSwitch = { ...switchStates };
  2861 + delete updateSwitch[x.sName];
  2862 + setSwitchStates({ ...updateSwitch })
  2863 + props.setState(pre => {
  2864 + const iIndex = downAbleExtraConfigs.findIndex(item => item.sId === x.sId);
  2865 + const slaveRowIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
  2866 + const { sBackProcessData = [] } = slaveData[slaveRowIndex];
  2867 + const iIndex1 = sBackProcessData.findIndex(item => item.sProductClassifyId === x.sId);
  2868 + if (iIndex1 !== -1) {
2264 slaveData[slaveRowIndex].sBackProcessData?.splice(iIndex1, 1); 2869 slaveData[slaveRowIndex].sBackProcessData?.splice(iIndex1, 1);
2265 - return {  
2266 - ...pre,  
2267 - downAbleExtraConfigs: [...downAbleExtraConfigs.slice(0, iIndex), ...downAbleExtraConfigs.slice(iIndex + 1)],  
2268 - slaveData,  
2269 - };  
2270 - });  
2271 - }}  
2272 - >  
2273 - <MinusOutline />  
2274 - </Button>  
2275 - )}  
2276 - </div> 2870 + }
  2871 +
  2872 + return {
  2873 + ...pre,
  2874 + downAbleExtraConfigs: [...downAbleExtraConfigs.slice(0, iIndex), ...downAbleExtraConfigs.slice(iIndex + 1)],
  2875 + slaveData,
  2876 + };
  2877 + });
  2878 + }}
  2879 + >
  2880 + <MinusOutline />
  2881 + </Button>
  2882 + )}
2277 </div> 2883 </div>
2278 - ) : (  
2279 - ""  
2280 - )}  
2281 - </div>  
2282 - </div>  
2283 - {/* {getTableCloum(i, x)} */}  
2284 - <BackendParamsExtraComponent {...props} itemDetail={x} onCostomClick={onCostomClick} />  
2285 - </div>  
2286 - ))  
2287 - : ""}  
2288 - {finishedConfigs && finishedConfigs.viewConfigs && finishedConfigs.viewConfigs.length  
2289 - ? finishedConfigs.viewConfigs.map((x, i) => (  
2290 - <div>  
2291 - <div className={styles.backBox}>  
2292 - <div className={styles.backEnd}>{x.showName}</div>  
2293 - <Switch checked={switchStates ? switchStates[x.sName] : ""} onChange={val => handleSwitchChange(x, val)} />  
2294 - <div className={styles.customer} style={{ marginTop: "0", marginLeft: "2rem", width: "40%" }}>  
2295 - {switchStates && switchStates[x.sName] ? (  
2296 - <SelectInput {...downViewProps} itemDetail={{ ...x, sVisColumnName: "sProcessName", sDropDownType: "sql" }} downIndex={i} />  
2297 - ) : (  
2298 - ""  
2299 - )}  
2300 - </div> 2884 + </div>
  2885 + ) : (
  2886 + ""
  2887 + )}
2301 </div> 2888 </div>
2302 - {getTableCloum(i, x)}  
2303 </div> 2889 </div>
2304 - )) 2890 + <BackendParamsExtraComponent {...props} itemDetail={x} onCostomClick={onCostomClick} backType={'slave'} />
  2891 + </div>
  2892 + ))
2305 : ""} 2893 : ""}
2306 - </div>  
2307 2894
2308 - <div>  
2309 - <div className={styles.projectBtn}>  
2310 - <div className={styles.boxTitle} style={{ marginTop: "2rem" }}>  
2311 - 多数量报价  
2312 - <EditFill color="#BFBFBF" style={{ marginLeft: "1rem" }} />  
2313 - </div>  
2314 - </div>  
2315 - <ManyComponent {...props}></ManyComponent> 2895 +
2316 </div> 2896 </div>
  2897 +
2317 <Dialog 2898 <Dialog
2318 visible={boxPopup} 2899 visible={boxPopup}
2319 closeOnAction 2900 closeOnAction
@@ -2333,7 +2914,7 @@ const BoxComponent = props =&gt; { @@ -2333,7 +2914,7 @@ const BoxComponent = props =&gt; {
2333 <div className={styles.boxListBody}> 2914 <div className={styles.boxListBody}>
2334 <div> 2915 <div>
2335 {item.sName} 2916 {item.sName}
2336 - <Image src={item.sPackPath} width={100} height={100}></Image> 2917 + <Image src={getImageUrl(removeExtension(item.sPackPath))} width={100} height={100}></Image>
2337 </div> 2918 </div>
2338 <Button 2919 <Button
2339 color="primary" 2920 color="primary"
@@ -2345,7 +2926,7 @@ const BoxComponent = props =&gt; { @@ -2345,7 +2926,7 @@ const BoxComponent = props =&gt; {
2345 setBoxPopup(false); 2926 setBoxPopup(false);
2346 }} 2927 }}
2347 > 2928 >
2348 - 选择 2929 + {choose}
2349 </Button> 2930 </Button>
2350 </div> 2931 </div>
2351 ); 2932 );
@@ -2356,12 +2937,218 @@ const BoxComponent = props =&gt; { @@ -2356,12 +2937,218 @@ const BoxComponent = props =&gt; {
2356 </div> 2937 </div>
2357 ); 2938 );
2358 }; 2939 };
  2940 +// 成品工序
  2941 +const FinishedProcessComponent = props => {
  2942 + const { state, boxModel } = props;
  2943 + const {
  2944 + activeKey,
  2945 + slaveConfig,
  2946 + masterData,
  2947 + selectedNode,
  2948 + boxConfig,
  2949 + downAbleConfigs = [],
  2950 + downAbleExtraConfigs = [],
  2951 + finishedConfigs = [],
  2952 + slaveData,
  2953 + } = state || {};
  2954 + const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {};
  2955 +
  2956 + // 后道参数
  2957 + const { sBackProcessData } = slaveRowData || [];
  2958 + const [downAbleConfigsNew, setDownAbleConfigsNew] = useState([]);
  2959 +
  2960 + const computedDownAbleConfigsNew = useMemo(() => {
  2961 + const arr = downAbleConfigs.reduce((pre, cur) => {
  2962 + const childConfigs = downAbleExtraConfigs.filter(item => item.sParentName === cur.showName);
  2963 + return [...pre, cur, ...childConfigs];
  2964 + }, [])
  2965 + const sortBySName = (arr) => {
  2966 + return arr.slice().sort((a, b) => {
  2967 + // 分割前缀和后缀
  2968 + const aParts = a.sName.split('_');
  2969 + const bParts = b.sName.split('_');
  2970 + const aParamsNum = parseInt(aParts[0].replace('sParams', '')) || 0;
  2971 + const bParamsNum = parseInt(bParts[0].replace('sParams', '')) || 0;
  2972 +
  2973 + if (aParamsNum !== bParamsNum) {
  2974 + return aParamsNum - bParamsNum;
  2975 + }
  2976 + const aHasSuffix = aParts.length > 1;
  2977 + const bHasSuffix = bParts.length > 1;
  2978 + if (!aHasSuffix && bHasSuffix) return -1;
  2979 + if (aHasSuffix && !bHasSuffix) return 1;
  2980 + if (aHasSuffix && bHasSuffix) {
  2981 + return aParts[1].localeCompare(bParts[1], undefined, { numeric: true });
  2982 + }
  2983 + return 0;
  2984 + });
  2985 + }
  2986 + const sortedData = arr.reduce((prev, cur) => {
  2987 + const exists = prev.find(item => item.sName === cur.sName);
  2988 + if (!exists) {
  2989 + prev.push(cur);
  2990 + }
  2991 + return prev;
  2992 + }, [])
  2993 + return sortBySName(sortedData);
  2994 + }, [downAbleConfigs, downAbleExtraConfigs]);
  2995 +
  2996 + // 使用 useEffect 设置 downAbleConfigsNew 状态
  2997 + useEffect(() => {
  2998 + if (!isEqual(downAbleConfigsNew, computedDownAbleConfigsNew)) {
  2999 + setDownAbleConfigsNew(computedDownAbleConfigsNew);
  3000 + }
  3001 + }, [computedDownAbleConfigsNew, downAbleConfigsNew]);
2359 3002
  3003 + // 初始化状态,存储每个 Switch 的状态
  3004 + const [switchStates, setSwitchStates] = useState(null);
  3005 + // 初始化成品工序
  3006 + const [finishedStates, setFinishedStates] = useState(null);
  3007 + // 处理成品工序 Switch 变化的函数
  3008 + const handleSwitchFinishedChange = (item, val) => {
  3009 + setFinishedStates({
  3010 + ...finishedStates,
  3011 + [item.sName]: val,
  3012 + });
  3013 + const iIndex = downAbleExtraConfigs.findIndex(x => x.sId === item.sId);
  3014 + const slaveRowIndex = slaveData.findIndex(x => x.sId === slaveRowData.sId);
  3015 + const { productProcessInfo = [] } = masterData
  3016 + const iIndex1 = productProcessInfo.findIndex(x => x.sProductClassifyId === item.sId);
  3017 + if (!val) {
  3018 + if (iIndex1 !== -1) {
  3019 + props.setState(pre => {
  3020 + masterData.productProcessInfo?.splice(iIndex1, 1);
  3021 + return {
  3022 + ...pre,
  3023 + masterData,
  3024 + calcPriceFinished: false
  3025 + };
  3026 + });
  3027 + }
  3028 + }
  3029 + };
  3030 + // 过滤后的数据
  3031 +
  3032 + let downViewConfigs = downAbleConfigsNew
  3033 + .filter(item => item.sPartsName === boxModel || !item.sPartsName)
  3034 + .map((item, i) => ({
  3035 + ...item,
  3036 + isSelect: switchStates ? switchStates[item.sName] : false,
  3037 + // sName: "sParams" + i,
  3038 + sProductClassifyId: item.sId,
  3039 + }));
  3040 +
  3041 + useEffect(() => {
  3042 + if (!switchStates) return ''
  3043 + downViewConfigs = downAbleConfigsNew
  3044 + .filter(item => item.sPartsName === boxModel || !item.sPartsName)
  3045 + .map((item, i) => ({
  3046 + ...item,
  3047 + isSelect: switchStates ? switchStates[item.sName] : false,
  3048 + // sName: "sParams" + i,
  3049 + sProductClassifyId: item.sId,
  3050 + }));
  3051 + }, [switchStates])
  3052 + const hasProcessedRef = useRef(false);
  3053 + useEffect(() => {
  3054 + hasProcessedRef.current = false;
  3055 + if (!sBackProcessData?.length || !downViewConfigs) return;
  3056 + // 批量状态更新
  3057 + const updates = sBackProcessData.reduce((acc, item) => {
  3058 + const sName = downViewConfigs.find(x => x.showName === item.sProcessName)?.sName;
  3059 + if (sName) acc[sName] = true;
  3060 + Object.keys(item).forEach(key => {
  3061 + if (/^sParams\d+/.test(key)) {
  3062 + acc[key] = true;
  3063 + }
  3064 + });
  3065 + return acc;
  3066 + }, {});
  3067 + if (Object.keys(updates).length > 0) {
  3068 + setSwitchStates(prev => ({ ...prev, ...updates }));
  3069 + hasProcessedRef.current = true;
  3070 + }
  3071 + }, [sBackProcessData, downAbleConfigsNew]);
  3072 +
  3073 +
  3074 +
  3075 + const { productProcessInfo = [] } = masterData;
  3076 + const finishedViewProps = {
  3077 + ...props,
  3078 + viewConfigs: finishedConfigs.map(config => ({
  3079 + ...config,
  3080 + isSelect: finishedStates ? finishedStates[config.sName] : false,
  3081 + costomStyle: productProcessInfo.find(item => item[config.sName])?.sParamConfig ? styles.sParamConfig : "",
  3082 + })),
  3083 + tableConfig: { ...slaveConfig, gdsconfigformslave: finishedConfigs },
  3084 + iColValueView: 24,
  3085 + viewRow: { ...masterData, sId: masterData.sId || "123" },
  3086 + getViewRow: config => {
  3087 + return productProcessInfo.find(item => item[config.sName]) || {};
  3088 + },
  3089 +
  3090 + tableName: "finished",
  3091 + onCostomClick: (showConfig) => {
  3092 + props.setState(pre => ({
  3093 + ...pre,
  3094 + backendParamsConfig: commonUtils.convertStrToObj(productProcessInfo.find(item => item[showConfig.sName])?.sParamConfig, []),
  3095 + backendConfig: { sParentFieldsName: showConfig.sName, typeName: "finished", dropDownDataSelected: showConfig },
  3096 + }));
  3097 + },
  3098 + };
  3099 + useEffect(() => {
  3100 + if (!productProcessInfo?.length || !finishedConfigs) return;
  3101 + const updates = productProcessInfo.reduce((acc, item) => {
  3102 + const sName = downViewConfigs.find(x => x.showName === item.sProcessName)?.sName;
  3103 + if (sName) acc[sName] = true;
  3104 + Object.keys(item).forEach(key => {
  3105 + if (/^sParams\d+/.test(key)) {
  3106 + acc[key] = true;
  3107 + }
  3108 + });
  3109 + return acc;
  3110 + }, {});
  3111 + if (Object.keys(updates).length > 0) {
  3112 + setFinishedStates(prev => ({ ...prev, ...updates }));
  3113 + }
  3114 + }, [productProcessInfo, finishedConfigs])
  3115 +
  3116 +
  3117 +
  3118 + return <div style={{ padding: '0 12px', transform: 'translateY(-12px)' }}>
  3119 + {finishedViewProps && finishedViewProps.viewConfigs && finishedViewProps.viewConfigs.length
  3120 + ? finishedViewProps.viewConfigs.map((x, i) => (
  3121 + <div key={x.sId}>
  3122 + <div className={styles.backBox}>
  3123 + <div className={styles.backEnd}>{x.showName}</div>
  3124 + <Switch checked={!!(finishedStates && finishedStates[x.sName])} onChange={val => handleSwitchFinishedChange(x, val)} />
  3125 + <div className={styles.customer} style={{ marginTop: "0", marginLeft: "32px", width: "40%" }}>
  3126 + {finishedStates && finishedStates[x.sName] ? (
  3127 + // 这里需要数组遍历 多个工序
  3128 + <div className={styles.processFlex}>
  3129 + <SelectInput
  3130 + {...finishedViewProps}
  3131 + itemDetail={{ ...x, sVisColumnName: "sProcessName" }}
  3132 + downIndex={i}
  3133 + onCostomClick={finishedViewProps.onCostomClick}
  3134 + />
  3135 + </div>
  3136 + ) : (
  3137 + ""
  3138 + )}
  3139 + </div>
  3140 + </div>
  3141 + <BackendParamsExtraComponent {...props} itemDetail={x} onCostomClick={finishedViewProps.onCostomClick} backType={'finished'} />
  3142 + </div>
  3143 + ))
  3144 + : ""}
  3145 + </div>
  3146 +}
2360 // 印刷参数组件(印刷、颜色、单双面) 3147 // 印刷参数组件(印刷、颜色、单双面)
2361 const PrintParamsComponent = props => { 3148 const PrintParamsComponent = props => {
2362 const { state, setState, boxModel } = props; 3149 const { state, setState, boxModel } = props;
2363 const { slaveConfig, slaveData, selectedNode } = state; 3150 const { slaveConfig, slaveData, selectedNode } = state;
2364 - if (!slaveConfig) return; 3151 + if (!slaveConfig) return '';
2365 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {}; 3152 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {};
2366 const slaveRowDataIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); 3153 const slaveRowDataIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
2367 const { sBackProcessData = [] } = slaveRowData; 3154 const { sBackProcessData = [] } = slaveRowData;
@@ -2375,33 +3162,30 @@ const PrintParamsComponent = props =&gt; { @@ -2375,33 +3162,30 @@ const PrintParamsComponent = props =&gt; {
2375 iColValue: 8, 3162 iColValue: 8,
2376 }; 3163 };
2377 }); 3164 });
2378 - console.log("🚀 ~ printParamsConfig:", printParamsConfig);  
2379 - printParamsConfig.forEach(item => {  
2380 - // const showDropDown = commonUtils.isNotEmptyArr(item.dropDownData)  
2381 - // ? props.showConfig.dropDownData  
2382 - // : typeof props.showConfig.showDropDown === "object"  
2383 - // ? props.showConfig.showDropDown  
2384 - // : commonUtils.objectToArr(commonUtils.convertStrToObj(props.showConfig.showDropDown));  
2385 - const showDropDown = item.showDropDown;  
2386 - console.log("🚀 ~ showDropDown:", showDropDown, props.showConfig);  
2387 - });  
2388 const result = []; 3165 const result = [];
2389 for (let i = 0; i < printParams.length + 1; i++) { 3166 for (let i = 0; i < printParams.length + 1; i++) {
2390 const printParamsItem = printParams[i - 1]; 3167 const printParamsItem = printParams[i - 1];
2391 - const viewRow = {  
2392 - ...(i === 0 ? slaveRowData : printParamsItem),  
2393 - sProductClassifyId: selectedNode.sId,  
2394 - sProcessId: i === 0 ? slaveRowData.sId : printParamsItem.sId,  
2395 - }; 3168 + // const viewRow = {
  3169 + // ...(i === 0 ? slaveRowData : printParamsItem),
  3170 + // sProductClassifyId: selectedNode.sId,
  3171 + // sProcessId: i === 0 ? slaveRowData.sId : printParamsItem.sId,
  3172 + // };
  3173 + const viewRow = { ...(i === 0 ? slaveRowData : printParamsItem), sProductClassifyId: selectedNode.sId };
  3174 + const viewTableId = "viewTableId_" + viewRow.sId;
2396 3175
2397 const viewProps = { 3176 const viewProps = {
2398 ...props, 3177 ...props,
2399 - viewConfigs: printParamsConfig, 3178 + viewConfigs: printParamsConfig.map(item => ({ ...item, costomStyle: `xlyPrintParams${i}` })),
2400 tableConfig: { ...slaveConfig, gdsconfigformslave: printParamsConfig }, 3179 tableConfig: { ...slaveConfig, gdsconfigformslave: printParamsConfig },
2401 iColValueView: 24, 3180 iColValueView: 24,
2402 viewRow, 3181 viewRow,
2403 tableName: `${i === 0 ? "slaveUp" : "slaveDown"}${boxModel}`, 3182 tableName: `${i === 0 ? "slaveUp" : "slaveDown"}${boxModel}`,
2404 onDataChange: (...args) => { 3183 onDataChange: (...args) => {
  3184 + // setTimeout(() => {
  3185 + // const oLabel = document.querySelector(`#${viewTableId}`)?.querySelector(`.xlyPrintParams${i}`)?.querySelector(".ant-form-item-label");
  3186 + // oLabel?.click();
  3187 + // }, 200);
  3188 +
2405 if (i === 0) { 3189 if (i === 0) {
2406 props.onDataChange(...args); 3190 props.onDataChange(...args);
2407 return; 3191 return;
@@ -2414,6 +3198,37 @@ const PrintParamsComponent = props =&gt; { @@ -2414,6 +3198,37 @@ const PrintParamsComponent = props =&gt; {
2414 return { ...pre, slaveData }; 3198 return { ...pre, slaveData };
2415 }); 3199 });
2416 }, 3200 },
  3201 + onCostomClick: (showConfig) => {
  3202 + if (showConfig.sName !== "sPrint") return;
  3203 +
  3204 +
  3205 + const { sPrintConfig } = state;
  3206 +
  3207 + if (!sPrintConfig) return;
  3208 + const backendConfigNew = {
  3209 + sParentFieldsName: "sPrint",
  3210 + sBoxModel: boxModel,
  3211 + printParamsId: viewRow.sId,
  3212 + };
  3213 +
  3214 + const dropDownData = commonUtils.convertStrToObj(sPrintConfig.sChineseDropDown, []);
  3215 + const dropDownDataSelected = dropDownData.find(item => item.sId === viewRow.sProcessId);
  3216 + if (!dropDownDataSelected) {
  3217 + props.setState(pre => ({
  3218 + ...pre,
  3219 + backendParamsConfig: [],
  3220 + backendConfig: {},
  3221 + }));
  3222 + return;
  3223 + }
  3224 + const backendParamsConfigNew = commonUtils.convertStrToObj(dropDownDataSelected.sParamConfig, []);
  3225 +
  3226 + props.setState(pre => ({
  3227 + ...pre,
  3228 + backendParamsConfig: backendParamsConfigNew,
  3229 + backendConfig: backendConfigNew,
  3230 + }));
  3231 + },
2417 }; 3232 };
2418 3233
2419 result.push( 3234 result.push(
@@ -2422,13 +3237,13 @@ const PrintParamsComponent = props =&gt; { @@ -2422,13 +3237,13 @@ const PrintParamsComponent = props =&gt; {
2422 <Grid columns={3} gap={8}> 3237 <Grid columns={3} gap={8}>
2423 {viewProps 3238 {viewProps
2424 ? viewProps.viewConfigs.map(x => ( 3239 ? viewProps.viewConfigs.map(x => (
2425 - <Grid.Item>  
2426 - <div className={styles.customer} key={x.id || x.showName}>  
2427 - <div>{x.showName}</div>  
2428 - <SelectInput {...viewProps} itemDetail={x} bCanInput={false} />  
2429 - </div>  
2430 - </Grid.Item>  
2431 - )) 3240 + <Grid.Item>
  3241 + <div className={styles.customer} key={x.id || x.showName}>
  3242 + <div>{x.showName}</div>
  3243 + <SelectInput {...viewProps} itemDetail={x} bCanInput={false} />
  3244 + </div>
  3245 + </Grid.Item>
  3246 + ))
2432 : ""} 3247 : ""}
2433 </Grid> 3248 </Grid>
2434 {/* <CommonViewTable {...viewProps} /> */} 3249 {/* <CommonViewTable {...viewProps} /> */}
@@ -2438,11 +3253,13 @@ const PrintParamsComponent = props =&gt; { @@ -2438,11 +3253,13 @@ const PrintParamsComponent = props =&gt; {
2438 color="primary" 3253 color="primary"
2439 fill="solid" 3254 fill="solid"
2440 size="small" 3255 size="small"
2441 - style={{ width: "1.93rem", height: "1.93rem", display: "flex", justifyContent: "center", alignItems: "center", textAlign: "center" }} 3256 + style={{ width: "30px", height: "30px", display: "flex", justifyContent: "center", alignItems: "center", textAlign: "center" }}
2442 onClick={() => { 3257 onClick={() => {
  3258 + const defaultData = commonFunc.getDefaultData({ ...slaveConfig, gdsconfigformslave: printParamsConfig }, { tree: selectedNode });
2443 sBackProcessData.push({ 3259 sBackProcessData.push({
2444 sId: commonUtils.createSid(), 3260 sId: commonUtils.createSid(),
2445 bPrintParams: true, 3261 bPrintParams: true,
  3262 + ...defaultData,
2446 }); 3263 });
2447 slaveData[slaveRowDataIndex] = { ...slaveRowData, sBackProcessData }; 3264 slaveData[slaveRowDataIndex] = { ...slaveRowData, sBackProcessData };
2448 setState(pre => { 3265 setState(pre => {
@@ -2455,13 +3272,13 @@ const PrintParamsComponent = props =&gt; { @@ -2455,13 +3272,13 @@ const PrintParamsComponent = props =&gt; {
2455 {i !== 0 ? ( 3272 {i !== 0 ? (
2456 <Button 3273 <Button
2457 style={{ 3274 style={{
2458 - width: "1.93rem",  
2459 - height: "1.93rem", 3275 + width: "30px",
  3276 + height: "30px",
2460 display: "flex", 3277 display: "flex",
2461 justifyContent: "center", 3278 justifyContent: "center",
2462 alignItems: "center", 3279 alignItems: "center",
2463 textAlign: "center", 3280 textAlign: "center",
2464 - marginTop: "0.3rem", 3281 + marginTop: "5px",
2465 }} 3282 }}
2466 onClick={() => { 3283 onClick={() => {
2467 const iIndex = sBackProcessData.findIndex(item => item.sId === printParamsItem.sId); 3284 const iIndex = sBackProcessData.findIndex(item => item.sId === printParamsItem.sId);
@@ -2517,6 +3334,7 @@ const MaterialsComponent = props =&gt; { @@ -2517,6 +3334,7 @@ const MaterialsComponent = props =&gt; {
2517 calcPriceFinished: false, 3334 calcPriceFinished: false,
2518 manyData: [], 3335 manyData: [],
2519 }; 3336 };
  3337 + const materialsInfoName = commonFunc.showLocalMessage(props, "materialsInfo", "材料信息");
2520 return materialsInfo.map((item, index) => { 3338 return materialsInfo.map((item, index) => {
2521 let viewRow = { ...materialsInfo[index], sProductClassifyId: selectedNode.sId }; 3339 let viewRow = { ...materialsInfo[index], sProductClassifyId: selectedNode.sId };
2522 viewRow = { ...viewRow, sMaterialsName0: viewRow.showName || "" }; 3340 viewRow = { ...viewRow, sMaterialsName0: viewRow.showName || "" };
@@ -2538,19 +3356,9 @@ const MaterialsComponent = props =&gt; { @@ -2538,19 +3356,9 @@ const MaterialsComponent = props =&gt; {
2538 onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => { 3356 onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => {
2539 const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); 3357 const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
2540 const { sMaterialsName, sMaterialsNo, sAuxiliaryUnit, sMaterialsUnit, dGramWeight, sMaterialsType, dWlkd, dWlcd } = changeValue; 3358 const { sMaterialsName, sMaterialsNo, sAuxiliaryUnit, sMaterialsUnit, dGramWeight, sMaterialsType, dWlkd, dWlcd } = changeValue;
2541 - const masterials = {  
2542 - sMaterialsName,  
2543 - sMaterialsNo,  
2544 - sMaterialsId: changeValue.sId,  
2545 - sAuxiliaryUnit,  
2546 - sMaterialsUnit,  
2547 - dGramWeight,  
2548 - sMaterialsType,  
2549 - dWlkd,  
2550 - dWlcd,  
2551 - }; 3359 +
2552 if (iIndex !== -1) { 3360 if (iIndex !== -1) {
2553 - slaveData[iIndex].materialsInfo = materialsInfo.map((item, i) => (i === index ? { ...item, ...masterials } : item)); 3361 + slaveData[iIndex].materialsInfo = materialsInfo.map((item, i) => (i === index ? { ...item, ...changeValue } : item));
2554 slaveRowData = slaveData[iIndex]; 3362 slaveRowData = slaveData[iIndex];
2555 } else { 3363 } else {
2556 const { selectedNode = {} } = state; 3364 const { selectedNode = {} } = state;
@@ -2561,7 +3369,7 @@ const MaterialsComponent = props =&gt; { @@ -2561,7 +3369,7 @@ const MaterialsComponent = props =&gt; {
2561 handleType: "add", 3369 handleType: "add",
2562 sBoxModel: boxModel, 3370 sBoxModel: boxModel,
2563 sTreeNodeName, 3371 sTreeNodeName,
2564 - materialsInfo: materialsInfo.map((item, i) => (i === index ? { ...item, ...masterials } : item)), 3372 + materialsInfo: materialsInfo.map((item, i) => (i === index ? { ...item, ...changeValue } : item)),
2565 }); 3373 });
2566 } 3374 }
2567 props.setState(pre => ({ ...pre, slaveData, slaveRowData, ...extraState })); 3375 props.setState(pre => ({ ...pre, slaveData, slaveRowData, ...extraState }));
@@ -2569,25 +3377,30 @@ const MaterialsComponent = props =&gt; { @@ -2569,25 +3377,30 @@ const MaterialsComponent = props =&gt; {
2569 }; 3377 };
2570 3378
2571 return ( 3379 return (
2572 - <div> 3380 + <div className={styles.materialBox}>
2573 <div className={styles.boxTitle}> 3381 <div className={styles.boxTitle}>
2574 - 材料信息  
2575 - <EditFill color="#BFBFBF" style={{ marginLeft: "1rem" }} /> 3382 + {materialsInfoName}
  3383 + <EditFill color="#BFBFBF" style={{ marginLeft: "16px" }} />
2576 </div> 3384 </div>
2577 <div className={styles.materialsLine}> 3385 <div className={styles.materialsLine}>
2578 - <div className={styles.selectInput} style={{ width: "50%" }}>  
2579 - <SelectInput {...viewProps} itemDetail={materialsConfigNew[0]} /> 3386 + <div className={styles.materialsViewTable}>
  3387 + <Grid columns={7} gap={8}>
  3388 + {viewProps?.viewConfigs && viewProps?.viewConfigs.length ?
  3389 + viewProps?.viewConfigs.map((x, i) => {
  3390 + return <div style={{ gridColumn: i > 0 ? 'span 2' : 'span 3' }}>
  3391 + <div className={styles.selectInput} >
  3392 + <SelectInput {...viewProps} itemDetail={{ ...x, sVisColumnName: "sMaterials" }} />
  3393 + </div>
  3394 + </div>
  3395 + }) : ''}
  3396 + </Grid>
2580 </div> 3397 </div>
2581 - <div className={styles.materialBtns}>  
2582 - <div className={styles.materialBtns}>  
2583 - <span>来料</span>  
2584 - <Checkbox />  
2585 - </div> 3398 + <div className={styles.materialsBtns} style={{ width: "10%" }}>
2586 <Button 3399 <Button
2587 color="primary" 3400 color="primary"
2588 fill="solid" 3401 fill="solid"
2589 size="small" 3402 size="small"
2590 - style={{ width: "1.93rem", height: "1.93rem", display: "flex", justifyContent: "center", alignItems: "center", textAlign: "center" }} 3403 + style={{ width: "30px", height: "30px", display: "flex", justifyContent: "center", alignItems: "center", textAlign: "center" }}
2591 onClick={() => { 3404 onClick={() => {
2592 const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); 3405 const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
2593 const rowIndex = materialsInfo.findIndex((item, i) => i === index); 3406 const rowIndex = materialsInfo.findIndex((item, i) => i === index);
@@ -2612,32 +3425,32 @@ const MaterialsComponent = props =&gt; { @@ -2612,32 +3425,32 @@ const MaterialsComponent = props =&gt; {
2612 > 3425 >
2613 <AddOutline /> 3426 <AddOutline />
2614 </Button> 3427 </Button>
2615 - <Button  
2616 - style={  
2617 - index === 0 || viewRow.showName  
2618 - ? {  
2619 - visibility: "hidden",  
2620 - width: "1.93rem",  
2621 - height: "1.93rem",  
2622 - display: "flex",  
2623 - justifyContent: "center",  
2624 - alignItems: "center",  
2625 - textAlign: "center",  
2626 - }  
2627 - : { width: "1.93rem", height: "1.93rem", display: "flex", justifyContent: "center", alignItems: "center", textAlign: "center" }  
2628 - }  
2629 - onClick={() => {  
2630 - const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);  
2631 - const rowIndex = materialsInfo.findIndex((item, i) => i === index);  
2632 - const materialsInfoNew = [...materialsInfo];  
2633 - materialsInfoNew.splice(rowIndex, 1);  
2634 - slaveData[iIndex].materialsInfo = materialsInfoNew;  
2635 - slaveRowData.materialsInfo = materialsInfoNew;  
2636 - props.setState(pre => ({ ...pre, slaveData, slaveRowData, ...extraState }));  
2637 - }}  
2638 - >  
2639 - <MinusOutline />  
2640 - </Button> 3428 + {index !== 0 ? (
  3429 + <Button
  3430 + style={{
  3431 + width: "30px",
  3432 + height: "30px",
  3433 + display: "flex",
  3434 + justifyContent: "center",
  3435 + alignItems: "center",
  3436 + textAlign: "center",
  3437 + marginTop: "5px",
  3438 + }}
  3439 + onClick={() => {
  3440 + const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
  3441 + const rowIndex = materialsInfo.findIndex((item, i) => i === index);
  3442 + const materialsInfoNew = [...materialsInfo];
  3443 + materialsInfoNew.splice(rowIndex, 1);
  3444 + slaveData[iIndex].materialsInfo = materialsInfoNew;
  3445 + slaveRowData.materialsInfo = materialsInfoNew;
  3446 + props.setState(pre => ({ ...pre, slaveData, slaveRowData, ...extraState }));
  3447 + }}
  3448 + >
  3449 + <MinusOutline />
  3450 + </Button>
  3451 + ) : (
  3452 + ""
  3453 + )}
2641 </div> 3454 </div>
2642 </div> 3455 </div>
2643 </div> 3456 </div>
@@ -2647,7 +3460,7 @@ const MaterialsComponent = props =&gt; { @@ -2647,7 +3460,7 @@ const MaterialsComponent = props =&gt; {
2647 // 多数量组件 3460 // 多数量组件
2648 const ManyComponent = props => { 3461 const ManyComponent = props => {
2649 const { state, setState, enabled, loading } = props; 3462 const { state, setState, enabled, loading } = props;
2650 - const { masterData = {}, calcPriceLoading, calcPriceFinished, manyData = [], dQuickQuoteProductQty } = state; 3463 + const { masterData = {}, calcPriceLoading, calcPriceFinished, manyData = [], slaveData } = state;
2651 const [submitLoading, setSubmitLoading] = useState(false); 3464 const [submitLoading, setSubmitLoading] = useState(false);
2652 const [processPercent, setProcessPercent] = useState(0); 3465 const [processPercent, setProcessPercent] = useState(0);
2653 const [selectedRadio, setSelectedRadio] = useState(null); 3466 const [selectedRadio, setSelectedRadio] = useState(null);
@@ -2656,8 +3469,9 @@ const ManyComponent = props =&gt; { @@ -2656,8 +3469,9 @@ const ManyComponent = props =&gt; {
2656 const [changeValue, setChangeValue] = useState(""); 3469 const [changeValue, setChangeValue] = useState("");
2657 // 根据主表数量更改多数量表 3470 // 根据主表数量更改多数量表
2658 useEffect(() => { 3471 useEffect(() => {
  3472 + // if (props?.masterData?.sBillNo) return ''
2659 const baseCount = masterData.dProductQty || 1000; 3473 const baseCount = masterData.dProductQty || 1000;
2660 - if (manyData[0]?.dManyQty === baseCount) return; 3474 + if (manyData.find(x => x.dManyQty === baseCount)) return;
2661 3475
2662 const manyDataNew = Array(5) 3476 const manyDataNew = Array(5)
2663 .fill("") 3477 .fill("")
@@ -2703,54 +3517,102 @@ const ManyComponent = props =&gt; { @@ -2703,54 +3517,102 @@ const ManyComponent = props =&gt; {
2703 }, [props.state.dQuickQuoteProductQty]); // 直接监听父组件的 3517 }, [props.state.dQuickQuoteProductQty]); // 直接监听父组件的
2704 // 核价事件 3518 // 核价事件
2705 const onCalcPrice = () => { 3519 const onCalcPrice = () => {
  3520 + const { state } = props;
  3521 + const { masterData = {}, slaveConfig, slaveData = [], selectedNode = {}, backendConfig = {}, boxModelKey = 0, bestAlgorithm, activeKey } = state;
2706 const addState = { 3522 const addState = {
2707 ...props.onGetAllDelData(), 3523 ...props.onGetAllDelData(),
2708 manyDataCache: [], 3524 manyDataCache: [],
2709 }; 3525 };
2710 props.onSaveState( 3526 props.onSaveState(
2711 { 3527 {
2712 - masterData: { ...props.masterData, handleType: props.isDraftSaved ? "add" : "update" }, 3528 + masterData: { ...props.masterData, handleType: props.handleType || "update" },
2713 ...addState, 3529 ...addState,
2714 }, 3530 },
2715 () => { 3531 () => {
2716 props.handleCalcPrice(); 3532 props.handleCalcPrice();
2717 } 3533 }
2718 ); 3534 );
  3535 + props.setState(pre => ({ ...pre, onCalcPrices: false }));
2719 }; 3536 };
2720 - const handleRadioChange = selectedRowKeys => { 3537 +
  3538 + const handleRadioChange = (selectedRowKeys, dManyQty) => {
2721 const dProductQty = manyData.find(item => item.sId === selectedRowKeys.sId).dManyQty; 3539 const dProductQty = manyData.find(item => item.sId === selectedRowKeys.sId).dManyQty;
2722 - console.log("🚀 ~ dProductQty:", dProductQty);  
2723 // 这一步导致了点击数量没有变化 3540 // 这一步导致了点击数量没有变化
2724 // props.slaveData?.forEach(slaveRowData => { 3541 // props.slaveData?.forEach(slaveRowData => {
2725 // props.onDataChange0("slave", "dProductQty", { dProductQty }, slaveRowData.sId, [], props); 3542 // props.onDataChange0("slave", "dProductQty", { dProductQty }, slaveRowData.sId, [], props);
2726 // }); 3543 // });
2727 - 3544 + // props.onDataChange(currentBoxModel, "sName", { sName: item.sName }, item.sId, boxsList);
  3545 + slaveData?.forEach(slaveRowData => {
  3546 + slaveRowData.dProductQty = dProductQty
  3547 + }
  3548 + )
2728 props.setState(pre => ({ 3549 props.setState(pre => ({
2729 ...pre, 3550 ...pre,
2730 - manySelectedRowKeys: selectedRowKeys.sId, 3551 + manySelectedRowKeys: [selectedRowKeys.sId],
2731 dQuickQuoteProductQty: dProductQty, 3552 dQuickQuoteProductQty: dProductQty,
  3553 + slaveData,
  3554 + dProductQty,
  3555 + calcPriceFinished: false,
  3556 + isChangeDProductQty: dManyQty
2732 })); 3557 }));
  3558 +
2733 setSelectedRadio(dProductQty); 3559 setSelectedRadio(dProductQty);
2734 }; 3560 };
2735 3561
2736 - const changrManyQty = item => {  
2737 - setChangeValue(item); 3562 + const changrManyQty = (item, x) => {
  3563 + if (x.dataIndex !== 'dManyQty') return ''
  3564 + setValue(item.dManyQty);
2738 setVisible(true); 3565 setVisible(true);
  3566 + setChangeValue(item);
2739 }; 3567 };
  3568 +
  3569 + const getSize = (num) => {
  3570 + return num ? Number(num).toFixed(2) : 0;
  3571 + }
  3572 + const BtnPriceverification = commonFunc.showLocalMessage(props, "BtnPriceverification", "核价");
  3573 + const sNuclearPricing = commonFunc.showLocalMessage(props, "sNuclearPricing", "核价中");
  3574 + const BtnConfirmQuantity = commonFunc.showLocalMessage(props, "BtnConfirmQuantity", "确认下单数量");
  3575 + data.sort((a, b) => a.dManyQty - b.dManyQty);
2740 return ( 3576 return (
2741 - <div>  
2742 - <div style={{ marginBottom: "1rem", textAlign: "right" }}> 3577 + <div style={{ padding: '0 0' }}>
  3578 + <div style={{ marginBottom: "16px", textAlign: "right" }}>
2743 <Button 3579 <Button
2744 color="primary" 3580 color="primary"
2745 fill="solid" 3581 fill="solid"
2746 loading={loading || calcPriceLoading} 3582 loading={loading || calcPriceLoading}
2747 - loadingText="核价中" 3583 + loadingText={sNuclearPricing}
2748 onClick={onCalcPrice} 3584 onClick={onCalcPrice}
2749 size="small" 3585 size="small"
2750 - style={{ marginRight: "1rem" }} 3586 + style={{ marginRight: "16px" }}
2751 > 3587 >
2752 - 核价 3588 + {BtnPriceverification}
2753 </Button> 3589 </Button>
  3590 + </div>
  3591 + <div className={styles.tableBox}>
  3592 + <div style={{ width: "16px" }}></div>
  3593 + {headerColumn?.map((item, i) => {
  3594 + return <div className={styles.tableHeader} style={{ width: ['dManyPrice', "dMaterialsRate"].includes(item.dataIndex) ? '10%' : '16%' }}>{item.title}</div>;
  3595 + })}
  3596 + </div>
  3597 + <div>
  3598 + {data && data.length
  3599 + ? data.map(item => {
  3600 + return (
  3601 + <div className={styles.tableBox}>
  3602 + <div style={{ width: "16px", "--icon-size": "22px", "--font-size": "16px", "--gap": "8px", lineHeight: '20px', transform: 'translateX(-10px)' }}>
  3603 + <Radio checked={selectedRadio === item.dManyQty} onClick={() => handleRadioChange(item)} style={{ fontSize: '20px' }} />
  3604 + </div>
  3605 + {
  3606 + headerColumn.map(x=>{
  3607 + return <div className={styles.tableBody} onClick={() => changrManyQty(item, x)} style={{ width: ['dManyPrice', "dMaterialsRate"].includes(x.dataIndex) ? '10%' : '16%' }}>{ x.dataIndex === 'dManyQty' ? item[x.dataIndex]: getSize(item[x.dataIndex])}</div>
  3608 + })
  3609 + }
  3610 + </div>
  3611 + );
  3612 + })
  3613 + : ""}
  3614 + </div>
  3615 + <div style={{ marginTop: "16px", textAlign: "right" }}>
2754 <Button 3616 <Button
2755 color="success" 3617 color="success"
2756 size="small" 3618 size="small"
@@ -2768,43 +3630,21 @@ const ManyComponent = props =&gt; { @@ -2768,43 +3630,21 @@ const ManyComponent = props =&gt; {
2768 dQuickQuoteProductQty: state.dQuickQuoteProductQty, 3630 dQuickQuoteProductQty: state.dQuickQuoteProductQty,
2769 loading: true, 3631 loading: true,
2770 }, 3632 },
2771 - () => { 3633 + (newState) => {
2772 setSubmitLoading(true); 3634 setSubmitLoading(true);
2773 - props.onSubmit(undefined, props); 3635 + props.onSubmit(undefined, {
  3636 + ...props, ...newState, state, manyqtysConfig: state.manyConfig, manyqtysData: state.manyData, manyqtysDelData: state.manyData.map(item => {
  3637 + item.handleType = 'del'
  3638 + return item
  3639 + }),
  3640 + });
2774 } 3641 }
2775 ); 3642 );
2776 }} 3643 }}
2777 > 3644 >
2778 - 确认下单数量 3645 + {BtnConfirmQuantity}
2779 </Button> 3646 </Button>
2780 </div> 3647 </div>
2781 - <div className={styles.tableBox}>  
2782 - <div style={{ width: "1rem" }}></div>  
2783 - {headerColumn.map(item => {  
2784 - return <div className={styles.tableHeader}>{item.title}</div>;  
2785 - })}  
2786 - </div>  
2787 - <div>  
2788 - {data && data.length  
2789 - ? data.map(item => {  
2790 - return (  
2791 - <div className={styles.tableBox}>  
2792 - <div style={{ width: "1rem", "--icon-size": "1.375rem", "--font-size": "1rem", "--gap": "0.5rem" }}>  
2793 - <Radio checked={selectedRadio === item.dManyQty} onClick={() => handleRadioChange(item)} />  
2794 - </div>  
2795 - <div className={styles.tableBody} onClick={() => changrManyQty(item)}>  
2796 - {item.dManyQty}  
2797 - </div>  
2798 - <div className={styles.tableBody}>{item.dPrintMoney}</div>  
2799 - <div className={styles.tableBody}>{item.dAfterProcessMoney}</div>  
2800 - <div className={styles.tableBody}>{item.dMaterialsMoney}</div>  
2801 - <div className={styles.tableBody}>{item.dManyPrice}</div>  
2802 - <div className={styles.tableBody}> {item.dDiscountMoney}</div>  
2803 - </div>  
2804 - );  
2805 - })  
2806 - : ""}  
2807 - </div>  
2808 <CenterPopup visible={visible}> 3648 <CenterPopup visible={visible}>
2809 <div className={styles.addTabs}> 3649 <div className={styles.addTabs}>
2810 <div>请输入数量:</div> 3650 <div>请输入数量:</div>
@@ -2821,7 +3661,7 @@ const ManyComponent = props =&gt; { @@ -2821,7 +3661,7 @@ const ManyComponent = props =&gt; {
2821 color="primary" 3661 color="primary"
2822 fill="outline" 3662 fill="outline"
2823 size="small" 3663 size="small"
2824 - style={{ marginRight: "1rem" }} 3664 + style={{ marginRight: "16px" }}
2825 onClick={() => { 3665 onClick={() => {
2826 setValue(""); 3666 setValue("");
2827 setVisible(false); 3667 setVisible(false);
@@ -2834,14 +3674,31 @@ const ManyComponent = props =&gt; { @@ -2834,14 +3674,31 @@ const ManyComponent = props =&gt; {
2834 fill="solid" 3674 fill="solid"
2835 size="small" 3675 size="small"
2836 onClick={() => { 3676 onClick={() => {
2837 - console.log(data, changeValue, value, "asdasdasd");  
2838 - const i = data.findIndex(item => item.sId === changeValue.sId); 3677 + const i = data.findIndex(item => {
  3678 + return item.sId === changeValue.sId;
  3679 + });
2839 if (i !== -1) { 3680 if (i !== -1) {
2840 data[i].dManyQty = Number(value); 3681 data[i].dManyQty = Number(value);
2841 - handleRadioChange(data[i]); 3682 + handleRadioChange(data[i], data[i].dManyQty);
2842 } 3683 }
2843 setVisible(false); 3684 setVisible(false);
2844 setValue(""); 3685 setValue("");
  3686 + const iIndex = state.manyData.findIndex(item => item.sId === data[i].sId);
  3687 + const rowData = { ...state.manyData[iIndex] };
  3688 + state.manyData[iIndex] = {
  3689 + sId: rowData.sId,
  3690 + iRowNum: rowData.iRowNum,
  3691 + sParentId: rowData.sParentId,
  3692 + handleType: rowData.handleType,
  3693 + dManyQty: Number(value),
  3694 + };
  3695 +
  3696 + props.setState(pre => ({
  3697 + ...pre,
  3698 + calcPriceFinished: false,
  3699 + manyData: state.manyData,
  3700 + }));
  3701 +
2845 }} 3702 }}
2846 > 3703 >
2847 确认 3704 确认
@@ -2855,18 +3712,23 @@ const ManyComponent = props =&gt; { @@ -2855,18 +3712,23 @@ const ManyComponent = props =&gt; {
2855 // 后道参数额外配置 3712 // 后道参数额外配置
2856 const BackendParamsExtraComponent = props => { 3713 const BackendParamsExtraComponent = props => {
2857 const { state, slaveConfig, boxModel } = props; 3714 const { state, slaveConfig, boxModel } = props;
2858 - const { backendParamsConfig = [], backendConfig = {}, slaveData, selectedNode } = state; 3715 + const { backendParamsConfig = [], backendConfig = {}, slaveData, selectedNode, masterData = {} } = state;
2859 const { sParentFieldsName, sBoxModel } = backendConfig; 3716 const { sParentFieldsName, sBoxModel } = backendConfig;
2860 if (!backendParamsConfig.length) return ""; 3717 if (!backendParamsConfig.length) return "";
2861 - if (sParentFieldsName !== props.itemDetail.sName) return; 3718 + if (sParentFieldsName !== props.itemDetail.sName) return '';
  3719 + if (props.backType !== backendConfig.typeName) return '';
  3720 + if (!props.itemDetail.isSelect) return '';
2862 // 使用 useMemo 缓存计算结果 3721 // 使用 useMemo 缓存计算结果
2863 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === sBoxModel) || {}; 3722 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === sBoxModel) || {};
2864 3723
2865 const { sBackProcessData = [] } = slaveRowData; 3724 const { sBackProcessData = [] } = slaveRowData;
  3725 + const { productProcessInfo = [] } = masterData;
  3726 +
  3727 + if (sParentFieldsName !== "sPrint" && ![...sBackProcessData, ...productProcessInfo].some(item => item[sParentFieldsName])) return ""
2866 const viewConfigs = backendParamsConfig.map((item, index) => ({ 3728 const viewConfigs = backendParamsConfig.map((item, index) => ({
2867 ...item, 3729 ...item,
2868 - sName0: `sParam${index + 1}`,  
2869 - sName: item.sFieldName || `sParam${index + 1}`, 3730 + // sName0: `sParam${item.iOrder}`,
  3731 + sName: item.sFieldName || `sParam${item.iOrder}`,
2870 showName: item.sParam, 3732 showName: item.sParam,
2871 sDropDownType: item.sParamDropDown ? "sql" : "", 3733 sDropDownType: item.sParamDropDown ? "sql" : "",
2872 iColValue: 4, 3734 iColValue: 4,
@@ -2883,25 +3745,54 @@ const BackendParamsExtraComponent = props =&gt; { @@ -2883,25 +3745,54 @@ const BackendParamsExtraComponent = props =&gt; {
2883 })), 3745 })),
2884 tableConfig: { ...slaveConfig, gdsconfigformslave: viewConfigs }, 3746 tableConfig: { ...slaveConfig, gdsconfigformslave: viewConfigs },
2885 iColValueView: 24, 3747 iColValueView: 24,
2886 - sBackProcessData, 3748 + sBackProcessData: [...sBackProcessData, ...productProcessInfo],
2887 sParentFieldsName, 3749 sParentFieldsName,
  3750 + viewRow: { sId: slaveRowData.sId },
2888 getViewRow: config => { 3751 getViewRow: config => {
2889 - return sBackProcessData.find(item => item[sParentFieldsName])?.sBackendParams?.find(item => item.sParam === config.showName) || {}; 3752 + if (sParentFieldsName === "sPrint") {
  3753 + return [slaveRowData, ...sBackProcessData].find(item => item.sId === printParamsId);
  3754 + }
  3755 + return (
  3756 + [...sBackProcessData, ...productProcessInfo]
  3757 + .find(item => item[sParentFieldsName])
  3758 + ?.sBackendParams?.find(item => item.sParam === config.showName) || {}
  3759 + );
2890 }, 3760 },
2891 tableName: `sBackendParams${boxModel}`, 3761 tableName: `sBackendParams${boxModel}`,
2892 - getSqlDropDownData: (...args) => { 3762 + getSqlDropDownData: async (...args) => {
2893 const showConfig = args[2]; 3763 const showConfig = args[2];
2894 - const { sParamDropDown = "", sName0, sName } = showConfig; 3764 + const { sDropDownType, sParamDropDown = "", sName, sFieldName } = showConfig;
  3765 + if (sDropDownType === "sql" && sParamDropDown?.toLowerCase()?.includes("select")) {
  3766 + args[2] = {
  3767 + ...showConfig,
  3768 + showDropDown: sParamDropDown,
  3769 + };
  3770 + delete args[2].sId;
  3771 + const result = await props.getSqlDropDownData(...args);
  3772 + const { dropDownData } = result;
  3773 + const temp = {
  3774 + ...result,
  3775 + dropDownData: dropDownData.map(item => ({
  3776 + ...item,
  3777 + // sId: item.sValue,
  3778 + value: item.sValue,
  3779 + sParam: showConfig.sParam,
  3780 + [sName]: item.sValue,
  3781 + sParamKey: sName,
  3782 + sFieldName,
  3783 + })),
  3784 + };
  3785 + return temp;
  3786 + }
2895 const dropDownData = sParamDropDown.split(","); 3787 const dropDownData = sParamDropDown.split(",");
2896 if (dropDownData?.length) { 3788 if (dropDownData?.length) {
2897 return { 3789 return {
2898 dropDownData: dropDownData.map(item => ({ 3790 dropDownData: dropDownData.map(item => ({
2899 - sId: commonUtils.createSid(), 3791 + sId: item,
2900 value: item, 3792 value: item,
2901 sParam: showConfig.sParam, 3793 sParam: showConfig.sParam,
2902 [sName]: item, 3794 [sName]: item,
2903 - sParamKey: sName0,  
2904 - sParamKeyNew: sName, 3795 + sParamKey: sName,
2905 })), 3796 })),
2906 totalPageCount: 1, 3797 totalPageCount: 1,
2907 currentPageNo: 1, 3798 currentPageNo: 1,
@@ -2912,57 +3803,85 @@ const BackendParamsExtraComponent = props =&gt; { @@ -2912,57 +3803,85 @@ const BackendParamsExtraComponent = props =&gt; {
2912 return props.getSqlDropDownData(...args); 3803 return props.getSqlDropDownData(...args);
2913 }, 3804 },
2914 onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => { 3805 onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => {
  3806 + const extraState = {
  3807 + calcPriceFinished: false,
  3808 + };
2915 const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); 3809 const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
2916 - const iIndex1 = slaveData[iIndex].sBackProcessData.findIndex(item => item[sParentFieldsName]); 3810 + if (sParentFieldsName === "sPrint") {
  3811 + if (slaveData[iIndex].sId === printParamsId) {
  3812 + let slaveDataNew = [...slaveData];
  3813 + slaveDataNew[iIndex] = { ...slaveDataNew[iIndex], ...changeValue };
  3814 + props.setState(pre => ({ ...pre, slaveData: slaveDataNew }));
  3815 + } else {
  3816 + const iIndex1 = sBackProcessData.findIndex(item => item.sId === printParamsId);
  3817 + let sBackProcessDataNew = [...sBackProcessData];
  3818 + sBackProcessDataNew[iIndex1] = { ...sBackProcessDataNew[iIndex1], ...changeValue };
  3819 + slaveData[iIndex].sBackProcessData = sBackProcessDataNew;
  3820 + props.setState(pre => ({ ...pre, slaveData, ...extraState }));
  3821 + }
  3822 + return '';
  3823 + }
  3824 + const sBData = sBoxModel ? slaveData[iIndex].sBackProcessData : productProcessInfo;
  3825 + const iIndex1 = sBData.findIndex(item => item[sParentFieldsName]);
2917 const showConfig = viewConfigs.find(item => item.sName === sFieldName); 3826 const showConfig = viewConfigs.find(item => item.sName === sFieldName);
2918 - let extraState = {};  
2919 -  
2920 - const dropDownDataSelected = dropDownData?.length  
2921 - ? dropDownData.find(item => item.label === changeValue[sFieldName]) 3827 + let dropDownDataSelected = dropDownData?.length
  3828 + ? dropDownData.find(item => item.sId === changeValue.sId)
2922 : { 3829 : {
2923 - sId: commonUtils.createSid(),  
2924 - value: changeValue[sFieldName],  
2925 - sParam: showConfig.sParam,  
2926 - [sFieldName]: changeValue[sFieldName],  
2927 - sParamKey: showConfig.sName0,  
2928 - sParamKeyNew: sFieldName,  
2929 - }; 3830 + sId: commonUtils.createSid(),
  3831 + value: changeValue.label || changeValue[sFieldName],
  3832 + sParam: showConfig.sParam,
  3833 + sParamKey: sFieldName,
  3834 + };
  3835 + if (isWait) {
  3836 + dropDownDataSelected = {
  3837 + ...changeValue,
  3838 + value: changeValue.label || changeValue.sValue,
  3839 + sParamKey: sFieldName,
  3840 + sParam: showConfig.sParam,
  3841 + }
  3842 + }
  3843 + if (!dropDownDataSelected) return '';
  3844 + dropDownDataSelected[sFieldName] = dropDownDataSelected.value || dropDownDataSelected.sValue;
2930 const { sParam } = dropDownDataSelected; 3845 const { sParam } = dropDownDataSelected;
2931 - const { sBackendParams = [] } = slaveData[iIndex].sBackProcessData[iIndex1]; 3846 + const { sBackendParams = [] } = sBData[iIndex1];
2932 const iIndex2 = sBackendParams.findIndex(item => item.sParam === sParam); 3847 const iIndex2 = sBackendParams.findIndex(item => item.sParam === sParam);
2933 if (iIndex2 !== -1) { 3848 if (iIndex2 !== -1) {
2934 sBackendParams[iIndex2] = dropDownDataSelected; 3849 sBackendParams[iIndex2] = dropDownDataSelected;
2935 } else { 3850 } else {
2936 sBackendParams.push(dropDownDataSelected); 3851 sBackendParams.push(dropDownDataSelected);
2937 } 3852 }
2938 - slaveData[iIndex].sBackProcessData[iIndex1].sBackendParams = sBackendParams; 3853 + sBData[iIndex1].sBackendParams = sBackendParams;
2939 if (!showConfig.sName?.startsWith("sParams")) { 3854 if (!showConfig.sName?.startsWith("sParams")) {
2940 - slaveData[iIndex].sBackProcessData[iIndex1][showConfig.sName] = dropDownDataSelected[showConfig.sName];  
2941 - const { dManualLength, dManualWidth } = slaveData[iIndex].sBackProcessData[iIndex1]; 3855 + sBData[iIndex1][showConfig.sName] = dropDownDataSelected[showConfig.sName];
  3856 + const { dManualLength, dManualWidth } = sBData[iIndex1];
2942 if (dManualLength !== undefined && dManualWidth !== undefined) { 3857 if (dManualLength !== undefined && dManualWidth !== undefined) {
2943 - slaveData[iIndex].sBackProcessData[iIndex1].dManualValue = dManualLength * dManualWidth; 3858 + sBData[iIndex1].dManualValue = dManualLength * dManualWidth;
2944 } 3859 }
2945 } 3860 }
2946 3861
2947 - const itemDetail = viewProps.viewConfigs.find(x => x.sName === sFieldName);  
2948 - props.setState(pre => ({ ...pre, slaveData }));  
2949 - // props.onCostomClick(itemDetail); 3862 + if (sBoxModel) {
  3863 + slaveData[iIndex].sBackProcessData = sBData;
  3864 + props.setState(pre => ({ ...pre, slaveData, ...extraState }));
  3865 + } else {
  3866 + masterData.productProcessInfo = sBData;
  3867 + props.setState(pre => ({ ...pre, masterData, ...extraState }));
  3868 + }
2950 }, 3869 },
2951 }; 3870 };
2952 3871
2953 - if (!viewConfigs.length) return; 3872 + if (!viewConfigs.length) return '';
  3873 + const longestConfig = viewProps.viewConfigs.reduce((prev, current) =>
  3874 + current.showName.length > prev.showName.length ? current : prev
  3875 + );
  3876 +
2954 return ( 3877 return (
2955 <div> 3878 <div>
2956 - {/* <div className={styles.boxTitle}>  
2957 - 后道参数额外配置  
2958 - <EditFill color="#BFBFBF" style={{ marginLeft: "1rem" }} />  
2959 - </div> */}  
2960 <div> 3879 <div>
2961 <Grid columns={3} gap={8}> 3880 <Grid columns={3} gap={8}>
2962 {viewProps.viewConfigs.map(x => ( 3881 {viewProps.viewConfigs.map(x => (
2963 <Grid.Item> 3882 <Grid.Item>
2964 <div className={styles.customer} key={x.id || x.showName}> 3883 <div className={styles.customer} key={x.id || x.showName}>
2965 - <div>{x.showName}</div> 3884 + <div style={{ height: longestConfig?.showName?.length > 5 ? 50 : '' }}>{x.showName}</div>
2966 <SelectInput 3885 <SelectInput
2967 {...viewProps} 3886 {...viewProps}
2968 itemDetail={x} 3887 itemDetail={x}
src/mobile/quotation/index.css
@@ -14,6 +14,9 @@ @@ -14,6 +14,9 @@
14 .quotationBox .quotationNavigation :global .adm-side-bar { 14 .quotationBox .quotationNavigation :global .adm-side-bar {
15 background-color: #ebf2fd; 15 background-color: #ebf2fd;
16 } 16 }
  17 +.quotationBox :global .adm-capsule-tabs-content {
  18 + padding: 0;
  19 +}
17 .quotationBox .quotationContent { 20 .quotationBox .quotationContent {
18 width: 70%; 21 width: 70%;
19 height: 100%; 22 height: 100%;
@@ -21,23 +24,23 @@ @@ -21,23 +24,23 @@
21 } 24 }
22 .quotationBox .quotationContent .contentItem { 25 .quotationBox .quotationContent .contentItem {
23 width: 92%; 26 width: 92%;
24 - height: 7.5rem; 27 + height: 120px !important;
25 border-radius: 10px; 28 border-radius: 10px;
26 background-color: #fff; 29 background-color: #fff;
27 margin: 0 auto; 30 margin: 0 auto;
28 - margin-bottom: 1rem; 31 + margin-bottom: 16px !important;
29 display: flex; 32 display: flex;
30 - padding: 0.625rem; 33 + padding: 10px !important;
31 } 34 }
32 .quotationBox .quotationContent .contentItem .contentItemImg { 35 .quotationBox .quotationContent .contentItem .contentItemImg {
33 - width: 6rem;  
34 - height: 6rem; 36 + width: 80px !important;
  37 + height: 80px !important;
35 border-radius: 10px; 38 border-radius: 10px;
36 } 39 }
37 .quotationBox .quotationContent .contentItem .contentItemTitle { 40 .quotationBox .quotationContent .contentItem .contentItemTitle {
38 - font-size: 1.1rem; 41 + font-size: 17px !important;
39 color: #333; 42 color: #333;
40 - margin-left: 0.625rem; 43 + margin-left: 10px !important;
41 font-weight: 700; 44 font-weight: 700;
42 } 45 }
43 .quotationBox .quotationContent .nestedItems .contentItem { 46 .quotationBox .quotationContent .nestedItems .contentItem {
src/mobile/quotation/index.jsx
  1 +/* eslint-disable */
1 import React, { useEffect, useState } from "react"; 2 import React, { useEffect, useState } from "react";
2 -import { history } from "umi";  
3 import { SideBar } from "antd-mobile"; 3 import { SideBar } from "antd-mobile";
4 import styles from "./index.less"; 4 import styles from "./index.less";
5 -import Icon5 from "@/assets/mobile/20.png";  
6 import commonConfig from "@/utils/config"; 5 import commonConfig from "@/utils/config";
7 import * as commonServices from "@/services/services"; 6 import * as commonServices from "@/services/services";
8 -import quotation from "@/routes/mobile/quotation";  
9 const QuotationAllprogress = baseProps => { 7 const QuotationAllprogress = baseProps => {
10 const { sModelsId } = baseProps; 8 const { sModelsId } = baseProps;
11 const { token } = baseProps.app; 9 const { token } = baseProps.app;
@@ -97,23 +95,14 @@ const TreeComponent = props =&gt; { @@ -97,23 +95,14 @@ const TreeComponent = props =&gt; {
97 // 内容 95 // 内容
98 const ContentComponent = props => { 96 const ContentComponent = props => {
99 const { contentList = [], selectedKey } = props.state || {}; 97 const { contentList = [], selectedKey } = props.state || {};
100 - console.log("🚀 ~ contentList:", contentList);  
101 // 路由 98 // 路由
102 const handleGridClick = item => () => { 99 const handleGridClick = item => () => {
103 - if (item.children && item.children.length > 0) return;  
104 - props.dispatch({  
105 - type: "content/onRouterMobile",  
106 - payload: {  
107 - url: "/indexMobile/quotationDetail" /* 接口地址 */,  
108 - urlKey: undefined,  
109 - sModelsId: props.sModelsId,  
110 - sModelType: props.sModelType,  
111 - quotationData: { 100 + if (item.children && item.children.length > 0) return '';
  101 + const quotationData = {
112 ...item, 102 ...item,
113 sProductClassifyId: selectedKey, 103 sProductClassifyId: selectedKey,
114 - },  
115 - },  
116 - }); 104 + }
  105 + props.dispatch(history.push('/indexMobile/quotationDetail',quotationData));
117 }; 106 };
118 107
119 return ( 108 return (
@@ -131,19 +120,6 @@ const RecursiveItemList = ({ items, handleGridClick }) =&gt; { @@ -131,19 +120,6 @@ const RecursiveItemList = ({ items, handleGridClick }) =&gt; {
131 onClick={handleGridClick(item)} 120 onClick={handleGridClick(item)}
132 style={{ marginLeft: level * 20 }} // 根据层级添加缩进 121 style={{ marginLeft: level * 20 }} // 根据层级添加缩进
133 > 122 >
134 - {/* {  
135 - item.children && item.children.length > 0 ?  
136 - <div style={{width:'2rem',}}>{item.showName}</div>  
137 - :  
138 - <div>  
139 - <img  
140 - src={'http://8.130.144.93:8088/xlyEntry/file/downloadLogo?sLogoName=logosPackPath%E9%A3%9E%E6%9C%BA%E7%9B%92&date=1747049329258'}  
141 - alt=""  
142 - className={styles.contentItemImg}  
143 - />  
144 - <span className={styles.contentItemTitle}>{item.showName}</span>  
145 - </div>  
146 - } */}  
147 <div className={styles.contentItem}> 123 <div className={styles.contentItem}>
148 <img 124 <img
149 src={"http://8.130.144.93:8088/xlyEntry/file/downloadLogo?sLogoName=logosPackPath%E9%A3%9E%E6%9C%BA%E7%9B%92&date=1747049329258"} 125 src={"http://8.130.144.93:8088/xlyEntry/file/downloadLogo?sLogoName=logosPackPath%E9%A3%9E%E6%9C%BA%E7%9B%92&date=1747049329258"}
src/mobile/quotation/index.less
@@ -13,28 +13,31 @@ @@ -13,28 +13,31 @@
13 background-color: #ebf2fd; 13 background-color: #ebf2fd;
14 } 14 }
15 } 15 }
  16 + :global .adm-capsule-tabs-content{
  17 + padding: 0;
  18 + }
16 .quotationContent { 19 .quotationContent {
17 width: 70%; 20 width: 70%;
18 height: 100%; 21 height: 100%;
19 overflow-y: auto; 22 overflow-y: auto;
20 .contentItem { 23 .contentItem {
21 width: 92%; 24 width: 92%;
22 - height: 7.5rem; 25 + height: 120px !important;
23 border-radius: 10px; 26 border-radius: 10px;
24 background-color: #fff; 27 background-color: #fff;
25 margin: 0 auto; 28 margin: 0 auto;
26 - margin-bottom: 1rem; 29 + margin-bottom: 16px !important;
27 display: flex; 30 display: flex;
28 - padding: 0.625rem; 31 + padding: 10px !important;
29 .contentItemImg { 32 .contentItemImg {
30 - width: 6rem;  
31 - height: 6rem; 33 + width: 80px !important;
  34 + height: 80px !important;
32 border-radius: 10px; 35 border-radius: 10px;
33 } 36 }
34 .contentItemTitle { 37 .contentItemTitle {
35 - font-size: 1.1rem; 38 + font-size: 17px !important;
36 color: #333; 39 color: #333;
37 - margin-left: 0.625rem; 40 + margin-left: 10px !important;
38 font-weight: 700; 41 font-weight: 700;
39 } 42 }
40 } 43 }
src/mobile/quotation/master.jsx
  1 +/* eslint-disable */
1 import React, { useEffect, useState } from "react"; 2 import React, { useEffect, useState } from "react";
2 import QuotationAllprogressDetail from "./detailNew"; 3 import QuotationAllprogressDetail from "./detailNew";
3 import commonConfig from "@/utils/config"; 4 import commonConfig from "@/utils/config";
@@ -8,14 +9,18 @@ import * as commonBusiness from &quot;@/components/Common/commonBusiness&quot;; @@ -8,14 +9,18 @@ import * as commonBusiness from &quot;@/components/Common/commonBusiness&quot;;
8 import * as commonUtils from "@/utils/utils"; 9 import * as commonUtils from "@/utils/utils";
9 import { cloneDeep } from "lodash"; 10 import { cloneDeep } from "lodash";
10 import moment from "moment"; 11 import moment from "moment";
11 - 12 +import CommobileBase from '@/mobile/common/CommobileBase';
  13 +import CommobileBillEvent from '@/mobile/common/CommobileBillEvent';
12 const masterEvent = props => { 14 const masterEvent = props => {
13 const { location, quotationData, app, sModelsId } = props; 15 const { location, quotationData, app, sModelsId } = props;
14 const selectedNode = quotationData; 16 const selectedNode = quotationData;
15 const { token } = app; 17 const { token } = app;
16 const [state, setState] = useState(null); 18 const [state, setState] = useState(null);
17 const [isInitialized, setIsInitialized] = useState(false); 19 const [isInitialized, setIsInitialized] = useState(false);
  20 + const [isQuoConfig, setIsQuoConfig] = useState(false);
18 const [isDraftSaved, setIsDraftSaved] = useState(false); 21 const [isDraftSaved, setIsDraftSaved] = useState(false);
  22 + const [reloadTrigger, setReloadTrigger] = useState(0);
  23 +
19 24
20 const getSqlDropDownData = async (formId, name, showConfig, record, sKeyUpFilterName, pageNum) => { 25 const getSqlDropDownData = async (formId, name, showConfig, record, sKeyUpFilterName, pageNum) => {
21 const url = `${commonConfig.server_host}business/getSelectLimit/${showConfig.sId}?sModelsId=${sModelsId}`; 26 const url = `${commonConfig.server_host}business/getSelectLimit/${showConfig.sId}?sModelsId=${sModelsId}`;
@@ -53,22 +58,30 @@ const masterEvent = props =&gt; { @@ -53,22 +58,30 @@ const masterEvent = props =&gt; {
53 const slaveConfig = formData.find(x => x.sTbName === "QuoQuotationslave"); 58 const slaveConfig = formData.find(x => x.sTbName === "QuoQuotationslave");
54 const controlConfig = formData.find(x => x.sTbName === "QuoQuotationcontrol"); 59 const controlConfig = formData.find(x => x.sTbName === "QuoQuotationcontrol");
55 60
56 - let colorConfig = {};  
57 - // const colorConfigTrue = formData.find(item => item.sTbName === "quoquotationparam");  
58 - // if (commonUtils.isNotEmptyObject(colorConfigTrue)) {  
59 - // colorConfig = { ...colorConfigTrue };  
60 - // }  
61 - 61 + let colorConfig = formData.find(x => x.sTbName === "quoquotationparam");
62 const packConfig = formData.find(item => item.sTbName === "quoquotationcontrolcombine"); 62 const packConfig = formData.find(item => item.sTbName === "quoquotationcontrolcombine");
63 63
  64 + const manyqtysConfig = commonUtils.isNotEmptyArr(formData.filter(item => item.sTbName.toUpperCase() === 'QuoQuotationManyQtys'.toUpperCase() && item.bGrdVisible)) ?
  65 + formData.filter(item => item.sTbName.toUpperCase() === 'QuoQuotationManyQtys'.toUpperCase() && item.bGrdVisible)[0] : {};
64 let checkConfig = {}; 66 let checkConfig = {};
65 let checkColumn = {}; 67 let checkColumn = {};
66 if (commonUtils.isNotEmptyArr(formData.filter(item => item.bGrd && item.sTbName === "sysbillcheckresult"))) { 68 if (commonUtils.isNotEmptyArr(formData.filter(item => item.bGrd && item.sTbName === "sysbillcheckresult"))) {
67 checkConfig = formData.find(item => item.bGrd && item.sTbName === "sysbillcheckresult"); 69 checkConfig = formData.find(item => item.bGrd && item.sTbName === "sysbillcheckresult");
68 checkColumn = commonFunc.getHeaderConfig(checkConfig); 70 checkColumn = commonFunc.getHeaderConfig(checkConfig);
69 } 71 }
  72 +
  73 +
  74 + let masterData = {
  75 + handleType: "add",
  76 + iPositiveColor: 4,
  77 + sFormId: sModelsId,
  78 + maxBillNo: "sBillNo",
  79 + sId: commonUtils.createSid(),
  80 + };
  81 +
70 setState(prevState => ({ 82 setState(prevState => ({
71 ...prevState, 83 ...prevState,
  84 + masterData,
72 formData, 85 formData,
73 masterConfig, 86 masterConfig,
74 processConfig, 87 processConfig,
@@ -78,8 +91,11 @@ const masterEvent = props =&gt; { @@ -78,8 +91,11 @@ const masterEvent = props =&gt; {
78 colorConfig, 91 colorConfig,
79 packConfig, 92 packConfig,
80 checkConfig, 93 checkConfig,
  94 + manyqtysConfig,
81 selectedNode, 95 selectedNode,
82 })); 96 }));
  97 +
  98 +
83 } 99 }
84 }) 100 })
85 .catch(error => { 101 .catch(error => {
@@ -147,13 +163,14 @@ const masterEvent = props =&gt; { @@ -147,13 +163,14 @@ const masterEvent = props =&gt; {
147 dPartsQty: 0, 163 dPartsQty: 0,
148 }; 164 };
149 controlData.push(controlRow); 165 controlData.push(controlRow);
150 - const masterData = { 166 + let masterData = {
151 handleType: "add", 167 handleType: "add",
152 iPositiveColor: 4, 168 iPositiveColor: 4,
153 maxBillNo: "sBillNo", 169 maxBillNo: "sBillNo",
154 sFormId: sModelsId, 170 sFormId: sModelsId,
155 sId: commonUtils.createSid(), 171 sId: commonUtils.createSid(),
156 }; 172 };
  173 +
157 setState(prevState => ({ 174 setState(prevState => ({
158 ...prevState, 175 ...prevState,
159 slaveData, 176 slaveData,
@@ -163,12 +180,206 @@ const masterEvent = props =&gt; { @@ -163,12 +180,206 @@ const masterEvent = props =&gt; {
163 processData, 180 processData,
164 materialsData, 181 materialsData,
165 masterData, 182 masterData,
166 - mastersId: masterData.sId, 183 + refreshData: true
167 })); 184 }));
168 185
169 setIsInitialized(true); 186 setIsInitialized(true);
170 } 187 }
171 }, [isInitialized, slaveData, packData, controlData, colorData, processData, materialsData]); 188 }, [isInitialized, slaveData, packData, controlData, colorData, processData, materialsData]);
  189 + useEffect(() => {
  190 + if (isQuoConfig) return ''
  191 + if (!state?.masterConfig) return ''
  192 + if (!state?.masterData?.sId) return ''
  193 + const handleGetDataOne = async (sId, configDataId) => {
  194 + const dataUrl = `${commonConfig.server_host}business/getBusinessDataByFormcustomId/${configDataId}?sModelsId=${sModelsId}`;
  195 + const condition = {
  196 + pageNum: '',
  197 + pageSize: '',
  198 + sId
  199 + }
  200 + const dataReturn = (await commonServices.postValueService(token, condition, dataUrl)).data;
  201 + if (dataReturn.code === 1) {
  202 + const returnData = dataReturn.dataset.rows[0].dataSet;
  203 + if (returnData && returnData.length) {
  204 + const { masterData } = state
  205 + const masterNew = {
  206 + ...masterData,
  207 + ...returnData[0],
  208 + }
  209 +
  210 + const onGetFilterState = (state, bInit) => {
  211 + const result = Object.keys(state).reduce((pre, cur) => {
  212 + if (cur.endsWith("Column") || cur.endsWith("Config") || ["formData", "treeData", "downAbleConfigs", "finishedConfigs"].includes(cur)) {
  213 + return pre;
  214 + }
  215 +
  216 + pre[cur] = state[cur];
  217 + return pre;
  218 + }, {});
  219 +
  220 + const { slaveData = [], manyData = [], masterData = {} } = result;
  221 + const materialInfoFields = [
  222 + "sMaterialsName",
  223 + "sMaterialsNo",
  224 + "sMaterialsId",
  225 + "sAuxiliaryUnit",
  226 + "sMaterialsUnit",
  227 + "bReel",
  228 + "dCoefficient",
  229 + "bInverse",
  230 + "sMaterialsStyle",
  231 + "sComputeId",
  232 + "sReComputeId",
  233 + "dGramWeight",
  234 + "sReConversionComputeId",
  235 + "sConversionComputeId",
  236 + "sMaterialsType",
  237 + "bComMaterials",
  238 + "dWlcd",
  239 + "dWlkd",
  240 + ];
  241 + const slaveDataNew = bInit
  242 + ? slaveData.map(item => {
  243 + const { materialsInfo = [], sMaterialsName } = item;
  244 + if (!materialsInfo.length && sMaterialsName) {
  245 + return {
  246 + ...item,
  247 + materialsInfo: [
  248 + materialInfoFields.reduce((pre, cur) => {
  249 + pre[cur] = item[cur];
  250 + return pre;
  251 + }, {}),
  252 + ],
  253 + };
  254 + } else {
  255 + return item;
  256 + }
  257 + })
  258 + : slaveData;
  259 +
  260 + const manyDataNew = manyData.map(item => {
  261 + delete item.manyData;
  262 + return item;
  263 + });
  264 +
  265 + const { sType, sCustomerId, sCustomerName } = props.app.userinfo;
  266 + const bCustomer = sType === "Customer";
  267 + if (bCustomer && !masterData.sCustomerId) {
  268 + masterData.sCustomerName = sCustomerName;
  269 + masterData.sCustomerId = sCustomerId;
  270 +
  271 + }
  272 + return { ...result, masterData, slaveData: slaveDataNew, manyData: manyDataNew };
  273 + };
  274 + const masterNewData = {
  275 + ...masterNew,
  276 + handleType: masterNew.sBillNo ? 'update' : 'add'
  277 + }
  278 + masterNew.sBillNo && delete masterNewData.maxBillNo;
  279 + const sQuoConfig = commonUtils.convertStrToObj(masterNewData.sQuoConfig, {});
  280 + const sQuoData = onGetFilterState(sQuoConfig, true)
  281 + const { selectedNode, slaveData } = sQuoData
  282 + if (sQuoData) {
  283 + setState(prevState => ({
  284 + ...prevState,
  285 + masterData: masterNewData,
  286 + selectedNode,
  287 + // slaveData,
  288 + // ...addStateSlave,
  289 + sQuoData: true,
  290 + isSlave: false,
  291 + }));
  292 + } else {
  293 + setState(prevState => ({
  294 + ...prevState,
  295 + masterData: masterNewData,
  296 + sQuoData: false,
  297 + isSlave: false,
  298 + }));
  299 + }
  300 + setIsQuoConfig(true)
  301 + }
  302 + }
  303 + }
  304 + handleGetDataOne(quotationData?.sId, state?.masterConfig?.sId)
  305 + }, [state?.masterData?.sId]);
  306 + useEffect(() => {
  307 + if (!state?.masterData?.sId && !state?.slaveConfig && !state?.controlConfig && !state?.materialsConfig && !state?.processConfig && !state?.packConfig && !state?.colorConfig) return
  308 +
  309 + const sId = state?.masterData?.sId || '';
  310 + const handleGetDataSets = async () => {
  311 + const addStateSlave = await props?.handleGetDataSet({
  312 + name: 'slave', configData: state?.slaveConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true,
  313 + });
  314 + const addStateControl = await props?.handleGetDataSet({
  315 + name: 'control', configData: state?.controlConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true,
  316 + });
  317 + const addStateMaterials = await props?.handleGetDataSet({
  318 + name: 'materials', configData: state?.materialsConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true,
  319 + });
  320 + const addStateProcess = await props?.handleGetDataSet({
  321 + name: 'process', configData: state?.processConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true,
  322 + });
  323 + const addStatePack = await props?.handleGetDataSet({
  324 + name: 'pack', configData: state?.packConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true,
  325 + });
  326 + const addStateSlave2 = await props?.handleGetDataSet({
  327 + name: 'slave', configData: state?.slaveConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true,
  328 + });
  329 + let addStateColor = {}
  330 + if (state?.colorConfig) {
  331 + addStateColor = await props.handleGetDataSet({
  332 + name: 'color', configData: state?.colorConfig, condition: { sSqlCondition: { sParentId: sId } }, isWait: true,
  333 + });
  334 + }
  335 +
  336 +
  337 + setState(prevState => ({
  338 + ...prevState,
  339 + // ...addStateMaster,
  340 + ...addStateSlave,
  341 + // ...addStateCheck,
  342 + ...addStateProcess,
  343 + ...addStateControl,
  344 + ...addStateMaterials,
  345 + ...addStatePack,
  346 + ...addStateColor,
  347 + ...addStateSlave2,
  348 + // ...addStateManyqtys,
  349 + isSlave: false,
  350 + loading: false,
  351 + }));
  352 +
  353 + }
  354 + const { masterData } = state
  355 + const handleGetDataOne = async (sId, configDataId) => {
  356 + const dataUrl = `${commonConfig.server_host}business/getBusinessDataByFormcustomId/${configDataId}?sModelsId=${sModelsId}`;
  357 + const condition = {
  358 + pageNum: '',
  359 + pageSize: '',
  360 + sId
  361 + }
  362 + const dataReturn = (await commonServices.postValueService(token, condition, dataUrl)).data;
  363 + if (dataReturn.code === 1) {
  364 + const returnData = dataReturn.dataset.rows[0].dataSet;
  365 + if (returnData && returnData.length) {
  366 + const masterNew = {
  367 + ...masterData,
  368 + sBillNo: returnData[0]?.sBillNo
  369 + }
  370 + delete masterNew.maxBillNo;
  371 + setState(prevState => ({
  372 + ...prevState,
  373 + masterData: masterNew,
  374 + }));
  375 + await handleGetDataSets()
  376 +
  377 + }
  378 + }
  379 + }
  380 + handleGetDataOne(state?.masterData?.sId, state?.masterConfig?.sId)
  381 + }, [reloadTrigger, state?.masterData?.sId])
  382 + const triggerReload = () => setReloadTrigger(prev => prev + 1);
172 383
173 // 确保 state 数据已加载 384 // 确保 state 数据已加载
174 if (!state) { 385 if (!state) {
@@ -189,26 +400,50 @@ const masterEvent = props =&gt; { @@ -189,26 +400,50 @@ const masterEvent = props =&gt; {
189 onSubmit: handleSave, 400 onSubmit: handleSave,
190 isDraftSaved, 401 isDraftSaved,
191 setIsDraftSaved, 402 setIsDraftSaved,
  403 + triggerReload,
192 // onButtonClick: handleButtonClick, 404 // onButtonClick: handleButtonClick,
193 ...state, 405 ...state,
194 }; 406 };
195 }; 407 };
196 // 遍历下所有配置sButtonEnabled的字段,生成配置 408 // 遍历下所有配置sButtonEnabled的字段,生成配置
  409 +/* 获取表数据 */
197 410
  411 +/** 获取部件树 */
  412 +const handleGetControlTreeData = (props, controlData, isWait) => {
  413 + /* 生成部件树结构 */
  414 + let treeData = [];
  415 + if (isWait) {
  416 + return { treeData };
  417 + } else {
  418 + props.onSaveState({
  419 + treeData,
  420 + // expandedKeys,
  421 + });
  422 + }
  423 +};
198 const sortData = (tableData, processData) => { 424 const sortData = (tableData, processData) => {
199 processData.sort((g1, g2) => { 425 processData.sort((g1, g2) => {
200 const iIndex1 = tableData.findIndex(item => item.sId === g1.sControlId) === -1 ? 999 : tableData.findIndex(item => item.sId === g1.sControlId); 426 const iIndex1 = tableData.findIndex(item => item.sId === g1.sControlId) === -1 ? 999 : tableData.findIndex(item => item.sId === g1.sControlId);
  427 + if (g1.iOrder === undefined) {
  428 + g1.iOrder = '';
  429 + }
  430 + if (g2.iOrder === undefined) {
  431 + g2.iOrder = '';
  432 + }
201 let sPartOrder1 = `0000${iIndex1}`; 433 let sPartOrder1 = `0000${iIndex1}`;
202 sPartOrder1 = sPartOrder1.substring(sPartOrder1.length - 3); 434 sPartOrder1 = sPartOrder1.substring(sPartOrder1.length - 3);
203 - let sOrder1 = `000${g1.iOrder}`;  
204 - sOrder1 = sOrder1.substring(sOrder1.length - 3);  
205 - 435 + let sOrder1 = `00000${g1.iOrder.toString()}`;
  436 + sOrder1 = sOrder1.indexOf('.') > -1 ? sOrder1 : `${sOrder1}.00`;
  437 + sOrder1 = sOrder1.replace('.', '');
  438 + sOrder1 = sOrder1.substring(sOrder1.length - 5);
206 const iIndex2 = tableData.findIndex(item => item.sId === g2.sControlId) === -1 ? 999 : tableData.findIndex(item => item.sId === g2.sControlId); 439 const iIndex2 = tableData.findIndex(item => item.sId === g2.sControlId) === -1 ? 999 : tableData.findIndex(item => item.sId === g2.sControlId);
207 let sPartOrder2 = `0000${iIndex2}`; 440 let sPartOrder2 = `0000${iIndex2}`;
208 sPartOrder2 = sPartOrder2.substring(sPartOrder2.length - 3); 441 sPartOrder2 = sPartOrder2.substring(sPartOrder2.length - 3);
209 - let sOrder2 = `000${g2.iOrder}`;  
210 - sOrder2 = sOrder2.substring(sOrder2.length - 3);  
211 - return parseInt(sPartOrder1 + g1.sType + sOrder1, 10) - parseInt(sPartOrder2 + g2.sType + sOrder2, 10); 442 + let sOrder2 = `00000${g2.iOrder.toString()}`;
  443 + sOrder2 = sOrder2.indexOf('.') > -1 ? sOrder2 : `${sOrder2}.00`;
  444 + sOrder2 = sOrder2.replace('.', '');
  445 + sOrder2 = sOrder2.substring(sOrder2.length - 5);
  446 + return parseFloat(sPartOrder1 + sOrder1) - parseFloat(sPartOrder2 + sOrder2);
212 }); 447 });
213 return processData; 448 return processData;
214 }; 449 };
@@ -362,10 +597,15 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; { @@ -362,10 +597,15 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; {
362 packDelData, 597 packDelData,
363 manyDataCache = [], 598 manyDataCache = [],
364 } = nextProps; 599 } = nextProps;
365 - const { dQuickQuoteProductQty } = props.state; 600 + const { dQuickQuoteProductQty, isChangeDProductQty } = props.state;
366 let { slaveData, controlData, materialsData, processData, masterData, manyqtysData, packData } = nextProps; 601 let { slaveData, controlData, materialsData, processData, masterData, manyqtysData, packData } = nextProps;
367 const sMakePerson = masterData.sMakePerson; 602 const sMakePerson = masterData.sMakePerson;
368 const data = []; 603 const data = [];
  604 + slaveData.forEach(item => {
  605 + if (dQuickQuoteProductQty) {
  606 + item.dProductQty = dQuickQuoteProductQty;
  607 + }
  608 + })
369 data.push(commonBusiness.mergeData("master", `${masterConfig.sTbName.toLowerCase()}_Tmp`, [masterData], [], true)); 609 data.push(commonBusiness.mergeData("master", `${masterConfig.sTbName.toLowerCase()}_Tmp`, [masterData], [], true));
370 data.push(commonBusiness.mergeData("slave", `${slaveConfig.sTbName.toLowerCase()}_tmp`, slaveData, [], true)); 610 data.push(commonBusiness.mergeData("slave", `${slaveConfig.sTbName.toLowerCase()}_tmp`, slaveData, [], true));
371 data.push(commonBusiness.mergeData("control", `${controlConfig.sTbName.toLowerCase()}_tmp`, controlData, [], true)); 611 data.push(commonBusiness.mergeData("control", `${controlConfig.sTbName.toLowerCase()}_tmp`, controlData, [], true));
@@ -378,6 +618,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; { @@ -378,6 +618,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; {
378 `${manyqtysConfig.sTbName.toLowerCase()}_tmp`, 618 `${manyqtysConfig.sTbName.toLowerCase()}_tmp`,
379 manyqtysData?.map(item => { 619 manyqtysData?.map(item => {
380 delete item.manyData; 620 delete item.manyData;
  621 + item.handleType = item.handleType || 'update';
381 return item; 622 return item;
382 }), 623 }),
383 [], 624 [],
@@ -387,15 +628,21 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; { @@ -387,15 +628,21 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; {
387 } 628 }
388 629
389 data.push(commonBusiness.mergeData("pack", `${packConfig.sTbName.toLowerCase()}_tmp`, packData, [], true)); 630 data.push(commonBusiness.mergeData("pack", `${packConfig.sTbName.toLowerCase()}_tmp`, packData, [], true));
  631 + // 默认添加一个handleType状态
  632 + data.forEach(item => {
  633 + item.column.forEach(col => {
  634 + col.handleType = col.handleType || 'add'
  635 + })
  636 + })
390 const value = { data, sClientType: "1", sGuid: masterData.sId }; 637 const value = { data, sClientType: "1", sGuid: masterData.sId };
391 638
392 - const cacheIndex = dQuickQuoteProductQty === undefined ? -1 : manyDataCache.findIndex(item => item.dManyQty === dQuickQuoteProductQty);  
393 - if (cacheIndex === -1) {  
394 - // message.warning("自动计算中,请稍后再试。");  
395 - Toast.show({  
396 - content: "自动计算中,请稍后再试。",  
397 - });  
398 - } 639 + // const cacheIndex = dQuickQuoteProductQty === undefined ? -1 : manyDataCache.findIndex(item => item.dManyQty === dQuickQuoteProductQty);
  640 + const cacheIndex = -1
  641 + const calculating = commonFunc.showLocalMessage(props, 'calculating', '自动计算中,请稍后再试。');
  642 + Toast.show({
  643 + content: calculating,
  644 + });
  645 +
399 const dataReturn = cacheIndex === -1 ? (await commonServices.postValueService(props.app.token, value, dataUrl)).data : manyDataCache[cacheIndex]; 646 const dataReturn = cacheIndex === -1 ? (await commonServices.postValueService(props.app.token, value, dataUrl)).data : manyDataCache[cacheIndex];
400 if (dataReturn.code === 1) { 647 if (dataReturn.code === 1) {
401 /* 成功 */ 648 /* 成功 */
@@ -411,58 +658,48 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; { @@ -411,58 +658,48 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; {
411 masterData.sBillNo = nextProps.masterData.sBillNo; 658 masterData.sBillNo = nextProps.masterData.sBillNo;
412 } 659 }
413 // masterData.handleType = nextProps.handleType && nextProps.handleType === "update" ? "update" : "add"; 660 // masterData.handleType = nextProps.handleType && nextProps.handleType === "update" ? "update" : "add";
  661 + masterData.handleType = masterData.sBillNo ? "update" : props.handleType ? props.handleType : 'add';
414 if (masterData.handleType === "update" && !commonUtils.isEmpty(sMakePerson)) { 662 if (masterData.handleType === "update" && !commonUtils.isEmpty(sMakePerson)) {
415 masterData.sMakePerson = sMakePerson; 663 masterData.sMakePerson = sMakePerson;
416 - if (masterData.sBillNo === "") {  
417 - const slaveUrl = `${commonConfig.server_host}business/getBusinessDataByFormcustomId/${"172129113112117410664746760"}?sModelsId=${  
418 - props.sModelsId  
419 - }`;  
420 - const value = { sId: masterData.sId };  
421 - const slaveReturnData = (await commonServices.postValueService(props.app.token, value, slaveUrl)).data;  
422 - const data = slaveReturnData.dataset.rows[0].dataSet[0];  
423 - masterData = { ...data };  
424 - }  
425 } 664 }
426 slaveData = valueReturn[`${slaveConfig.sTbName.toLowerCase()}_tmp`].map(item => { 665 slaveData = valueReturn[`${slaveConfig.sTbName.toLowerCase()}_tmp`].map(item => {
427 - item.handleType = dQuickQuoteProductQty ? "update" : item.handleType; 666 + item.handleType = dQuickQuoteProductQty ? "add" : item.handleType;
428 item.sId = commonUtils.createSid(); 667 item.sId = commonUtils.createSid();
429 if (dQuickQuoteProductQty) { 668 if (dQuickQuoteProductQty) {
430 item.dProductQty = dQuickQuoteProductQty; 669 item.dProductQty = dQuickQuoteProductQty;
431 } 670 }
432 // 这里需要改变数量 看看是否是多数量报价dProductQty 671 // 这里需要改变数量 看看是否是多数量报价dProductQty
433 - console.log(props,nextProps, "dQuickQuoteProductQty");  
434 -  
435 return item; 672 return item;
436 }); 673 });
437 674
438 controlData = valueReturn[`${controlConfig.sTbName.toLowerCase()}_tmp`].map(item => { 675 controlData = valueReturn[`${controlConfig.sTbName.toLowerCase()}_tmp`].map(item => {
439 - item.handleType = dQuickQuoteProductQty ? "update" : item.handleType;  
440 - item.sId = commonUtils.createSid(); 676 + item.handleType = dQuickQuoteProductQty ? "add" : item.handleType;
  677 + // item.sId = commonUtils.createSid();
441 return item; 678 return item;
442 }); 679 });
443 materialsData = valueReturn[`${materialsConfig.sTbName.toLowerCase()}_tmp`].map(item => { 680 materialsData = valueReturn[`${materialsConfig.sTbName.toLowerCase()}_tmp`].map(item => {
444 item.handleType = dQuickQuoteProductQty ? "add" : item.handleType; 681 item.handleType = dQuickQuoteProductQty ? "add" : item.handleType;
445 - item.sId = commonUtils.createSid(); 682 + // item.sId = commonUtils.createSid();
446 return item; 683 return item;
447 }); 684 });
448 processData = valueReturn[`${processConfig.sTbName.toLowerCase()}_tmp`].map(item => { 685 processData = valueReturn[`${processConfig.sTbName.toLowerCase()}_tmp`].map(item => {
449 item.handleType = dQuickQuoteProductQty ? "add" : item.handleType; 686 item.handleType = dQuickQuoteProductQty ? "add" : item.handleType;
450 - item.sId = commonUtils.createSid(); 687 + // item.sId = commonUtils.createSid();
451 return item; 688 return item;
452 }); 689 });
453 - processData = props.sortData(controlData, processData); 690 + processData = sortData(controlData, processData);
  691 + processData = processData.map((item, index) => ({
  692 + ...item,
  693 + sCombinePartsName: slaveData[0].sId
  694 + }));
454 const addState = {}; 695 const addState = {};
455 if (commonUtils.isNotEmptyObject(manyqtysConfig)) { 696 if (commonUtils.isNotEmptyObject(manyqtysConfig)) {
  697 + const manyqtysDataOld = cloneDeep(manyqtysData);
456 manyqtysData = valueReturn[`${manyqtysConfig.sTbName.toLowerCase()}_tmp`]?.map((item, index) => { 698 manyqtysData = valueReturn[`${manyqtysConfig.sTbName.toLowerCase()}_tmp`]?.map((item, index) => {
457 return { 699 return {
458 ...item, 700 ...item,
459 sId: manyqtysData[index] ? manyqtysData[index].sId : item.sId, 701 sId: manyqtysData[index] ? manyqtysData[index].sId : item.sId,
460 - handleType: dQuickQuoteProductQty ? "update" : item.handleType,  
461 - };  
462 - });  
463 - manyqtysData.forEach((x, i) => {  
464 - if (i !== 0) {  
465 - x.sParentId = manyqtysData[0].sParentId; 702 + handleType: dQuickQuoteProductQty ? 'add' : (manyqtysDataOld[index]?.handleType || item.handleType)
466 } 703 }
467 }); 704 });
468 705
@@ -475,7 +712,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; { @@ -475,7 +712,7 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; {
475 pre[cur] = valueReturn[cur]; 712 pre[cur] = valueReturn[cur];
476 } 713 }
477 return pre; 714 return pre;
478 - }, {}); 715 + }, {})
479 } else { 716 } else {
480 result = commonUtils.convertStrToObj(item.manyData); 717 result = commonUtils.convertStrToObj(item.manyData);
481 } 718 }
@@ -494,12 +731,12 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; { @@ -494,12 +731,12 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; {
494 sBillNo: sBillNo || item.sBillNo, 731 sBillNo: sBillNo || item.sBillNo,
495 sFormId, 732 sFormId,
496 })); 733 }));
497 - } else if (cur.includes("_tmp")) { 734 + } else if (cur.includes('_tmp')) {
498 pre[cur] = result[cur].map(item => ({ 735 pre[cur] = result[cur].map(item => ({
499 ...item, 736 ...item,
500 sParentId: sId, 737 sParentId: sId,
501 - handleType: "add",  
502 - })); 738 + handleType: "add"
  739 + }))
503 } else { 740 } else {
504 pre[cur] = result[cur]; 741 pre[cur] = result[cur];
505 } 742 }
@@ -511,19 +748,22 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; { @@ -511,19 +748,22 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; {
511 dManyQty: item.dManyQty, 748 dManyQty: item.dManyQty,
512 dataset: { 749 dataset: {
513 rows: [row], 750 rows: [row],
514 - },  
515 - }; 751 + }
  752 + }
516 }); 753 });
517 } 754 }
518 } 755 }
519 -  
520 packData = valueReturn[`${packConfig.sTbName.toLowerCase()}_tmp`]; 756 packData = valueReturn[`${packConfig.sTbName.toLowerCase()}_tmp`];
  757 +
521 /* 计算成功后自动调用保存 */ 758 /* 计算成功后自动调用保存 */
522 if (bSave) { 759 if (bSave) {
523 const data = []; 760 const data = [];
524 // masterData.handleType = "update"; 761 // masterData.handleType = "update";
525 // masterData.sFormId = commonUtils.createSid() 762 // masterData.sFormId = commonUtils.createSid()
526 - masterData.sId = commonUtils.createSid(); 763 + // masterData.sId = commonUtils.createSid();
  764 + if (masterData.sBillNo !== '') {
  765 + delete masterData.maxBillNo;
  766 + }
527 data.push(commonBusiness.mergeData("master", masterConfig.sTbName, [masterData])); 767 data.push(commonBusiness.mergeData("master", masterConfig.sTbName, [masterData]));
528 data.push(commonBusiness.mergeData("slave", slaveConfig.sTbName, slaveData, slaveDelData)); 768 data.push(commonBusiness.mergeData("slave", slaveConfig.sTbName, slaveData, slaveDelData));
529 data.push(commonBusiness.mergeData("control", controlConfig.sTbName, controlData, controlDelData)); 769 data.push(commonBusiness.mergeData("control", controlConfig.sTbName, controlData, controlDelData));
@@ -554,8 +794,13 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; { @@ -554,8 +794,13 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; {
554 processData, 794 processData,
555 masterData, 795 masterData,
556 manyqtysData, 796 manyqtysData,
  797 + manyData: manyqtysData,
557 ...addState, 798 ...addState,
558 }); 799 });
  800 + // nextProps?.state?.setState({
  801 + // manyData:manyqtysData,
  802 + // })
  803 +
559 } else { 804 } else {
560 // masterData.handleType = "update"; 805 // masterData.handleType = "update";
561 if (isWait) { 806 if (isWait) {
@@ -589,10 +834,15 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; { @@ -589,10 +834,15 @@ const handleCalculation = async (bSave, nextProps, isWait, props) =&gt; {
589 } 834 }
590 } else { 835 } else {
591 /* 失败 */ 836 /* 失败 */
592 - props.onSaveState({  
593 - loading: false, 837 + // props.onSaveState({
  838 + // loading: false,
  839 + // });
  840 + Toast.show({
  841 + content: dataReturn.erroMsg,
594 }); 842 });
595 - // this.props.getServiceError(dataReturn); 843 + props.triggerReload();
  844 +
  845 + // props.getServiceError(dataReturn);
596 } 846 }
597 }; 847 };
598 /** 按钮操作事件 */ 848 /** 按钮操作事件 */
@@ -632,12 +882,12 @@ const handleButtonClick = async (name, props) =&gt; { @@ -632,12 +882,12 @@ const handleButtonClick = async (name, props) =&gt; {
632 firstDataIndex === "s" 882 firstDataIndex === "s"
633 ? "" 883 ? ""
634 : firstDataIndex === "d" || firstDataIndex === "i" 884 : firstDataIndex === "d" || firstDataIndex === "i"
635 - ? 0  
636 - : firstDataIndex === "b"  
637 - ? false  
638 - : firstDataIndex === "t"  
639 - ? moment(new Date()).format(props.app.dateFormat)  
640 - : undefined; 885 + ? 0
  886 + : firstDataIndex === "b"
  887 + ? false
  888 + : firstDataIndex === "t"
  889 + ? moment(new Date()).format(props.app.dateFormat)
  890 + : undefined;
641 } 891 }
642 }); 892 });
643 }); 893 });
@@ -652,12 +902,12 @@ const handleButtonClick = async (name, props) =&gt; { @@ -652,12 +902,12 @@ const handleButtonClick = async (name, props) =&gt; {
652 firstDataIndex === "s" 902 firstDataIndex === "s"
653 ? "" 903 ? ""
654 : firstDataIndex === "d" || firstDataIndex === "i" 904 : firstDataIndex === "d" || firstDataIndex === "i"
655 - ? 0  
656 - : firstDataIndex === "b"  
657 - ? false  
658 - : firstDataIndex === "t"  
659 - ? moment(new Date()).format(props.app.dateFormat)  
660 - : undefined; 905 + ? 0
  906 + : firstDataIndex === "b"
  907 + ? false
  908 + : firstDataIndex === "t"
  909 + ? moment(new Date()).format(props.app.dateFormat)
  910 + : undefined;
661 } 911 }
662 }); 912 });
663 }); 913 });
@@ -673,12 +923,12 @@ const handleButtonClick = async (name, props) =&gt; { @@ -673,12 +923,12 @@ const handleButtonClick = async (name, props) =&gt; {
673 firstDataIndex === "s" 923 firstDataIndex === "s"
674 ? "" 924 ? ""
675 : firstDataIndex === "d" || firstDataIndex === "i" 925 : firstDataIndex === "d" || firstDataIndex === "i"
676 - ? 0  
677 - : firstDataIndex === "b"  
678 - ? false  
679 - : firstDataIndex === "t"  
680 - ? moment(new Date()).format(props.app.dateFormat)  
681 - : undefined; 926 + ? 0
  927 + : firstDataIndex === "b"
  928 + ? false
  929 + : firstDataIndex === "t"
  930 + ? moment(new Date()).format(props.app.dateFormat)
  931 + : undefined;
682 } 932 }
683 }); 933 });
684 }); 934 });
@@ -694,12 +944,12 @@ const handleButtonClick = async (name, props) =&gt; { @@ -694,12 +944,12 @@ const handleButtonClick = async (name, props) =&gt; {
694 firstDataIndex === "s" 944 firstDataIndex === "s"
695 ? "" 945 ? ""
696 : firstDataIndex === "d" || firstDataIndex === "i" 946 : firstDataIndex === "d" || firstDataIndex === "i"
697 - ? 0  
698 - : firstDataIndex === "b"  
699 - ? false  
700 - : firstDataIndex === "t"  
701 - ? moment(new Date()).format(props.app.dateFormat)  
702 - : undefined; 947 + ? 0
  948 + : firstDataIndex === "b"
  949 + ? false
  950 + : firstDataIndex === "t"
  951 + ? moment(new Date()).format(props.app.dateFormat)
  952 + : undefined;
703 } 953 }
704 }); 954 });
705 }); 955 });
@@ -716,12 +966,12 @@ const handleButtonClick = async (name, props) =&gt; { @@ -716,12 +966,12 @@ const handleButtonClick = async (name, props) =&gt; {
716 firstDataIndex === "s" 966 firstDataIndex === "s"
717 ? "" 967 ? ""
718 : firstDataIndex === "d" || firstDataIndex === "i" 968 : firstDataIndex === "d" || firstDataIndex === "i"
719 - ? 0  
720 - : firstDataIndex === "b"  
721 - ? false  
722 - : firstDataIndex === "t"  
723 - ? moment(new Date()).format(props.app.dateFormat)  
724 - : undefined; 969 + ? 0
  970 + : firstDataIndex === "b"
  971 + ? false
  972 + : firstDataIndex === "t"
  973 + ? moment(new Date()).format(props.app.dateFormat)
  974 + : undefined;
725 } 975 }
726 }); 976 });
727 }); 977 });
@@ -730,7 +980,7 @@ const handleButtonClick = async (name, props) =&gt; { @@ -730,7 +980,7 @@ const handleButtonClick = async (name, props) =&gt; {
730 if (commonUtils.isNotEmptyObject(colorConfig)) { 980 if (commonUtils.isNotEmptyObject(colorConfig)) {
731 colorConfig.gdsconfigformslave.forEach(itemConfig => { 981 colorConfig.gdsconfigformslave.forEach(itemConfig => {
732 colorData 982 colorData
733 - .filter(itemData => itemData.handleType === "add" || itemData.handleType === "update") 983 + ?.filter(itemData => itemData.handleType === "add" || itemData.handleType === "update")
734 .forEach(itemData => { 984 .forEach(itemData => {
735 itemData.NoVerify = "NoVerify"; 985 itemData.NoVerify = "NoVerify";
736 const firstDataIndex = itemConfig.sName.substring(0, 1); 986 const firstDataIndex = itemConfig.sName.substring(0, 1);
@@ -739,17 +989,19 @@ const handleButtonClick = async (name, props) =&gt; { @@ -739,17 +989,19 @@ const handleButtonClick = async (name, props) =&gt; {
739 firstDataIndex === "s" 989 firstDataIndex === "s"
740 ? "" 990 ? ""
741 : firstDataIndex === "d" || firstDataIndex === "i" 991 : firstDataIndex === "d" || firstDataIndex === "i"
742 - ? 0  
743 - : firstDataIndex === "b"  
744 - ? false  
745 - : firstDataIndex === "t"  
746 - ? moment(new Date()).format(props.app.dateFormat)  
747 - : undefined; 992 + ? 0
  993 + : firstDataIndex === "b"
  994 + ? false
  995 + : firstDataIndex === "t"
  996 + ? moment(new Date()).format(props.app.dateFormat)
  997 + : undefined;
748 } 998 }
749 }); 999 });
750 }); 1000 });
751 } 1001 }
752 - 1002 + if (masterData.sBillNo !== '') {
  1003 + delete masterData.maxBillNo;
  1004 + }
753 data.push(commonBusiness.mergeData("master", masterConfig.sTbName, [masterData])); 1005 data.push(commonBusiness.mergeData("master", masterConfig.sTbName, [masterData]));
754 data.push(commonBusiness.mergeData("slave", slaveConfig.sTbName, slaveData, slaveDelData)); 1006 data.push(commonBusiness.mergeData("slave", slaveConfig.sTbName, slaveData, slaveDelData));
755 data.push(commonBusiness.mergeData("control", controlConfig.sTbName, controlData, controlDelData)); 1007 data.push(commonBusiness.mergeData("control", controlConfig.sTbName, controlData, controlDelData));
@@ -771,10 +1023,16 @@ const handleButtonClick = async (name, props) =&gt; { @@ -771,10 +1023,16 @@ const handleButtonClick = async (name, props) =&gt; {
771 bIsUnCcg: false, 1023 bIsUnCcg: false,
772 }, 1024 },
773 props 1025 props
774 - ); 1026 + ), () => {
  1027 + props.onSaveState({
  1028 + masterData: { ...masterData },
  1029 + });
  1030 + };
775 } 1031 }
776 }; 1032 };
  1033 +
777 const handleSaveData = async (params, props) => { 1034 const handleSaveData = async (params, props) => {
  1035 +
778 const { 1036 const {
779 token, 1037 token,
780 sModelsId, 1038 sModelsId,
@@ -821,7 +1079,7 @@ const handleSaveData = async (params, props) =&gt; { @@ -821,7 +1079,7 @@ const handleSaveData = async (params, props) =&gt; {
821 props.onSaveState({ 1079 props.onSaveState({
822 enabled: false, 1080 enabled: false,
823 currentId: masterData.sId, 1081 currentId: masterData.sId,
824 - masterData, 1082 + masterData: { ...masterData },
825 }); 1083 });
826 // 保存后更新panes,currentPane的checkedId,防止浏览器刷新时重新又变成新增。 1084 // 保存后更新panes,currentPane的checkedId,防止浏览器刷新时重新又变成新增。
827 const iPaneIndex = app.panes.findIndex(item => item.key === app.currentPane.key); 1085 const iPaneIndex = app.panes.findIndex(item => item.key === app.currentPane.key);
@@ -840,13 +1098,15 @@ const handleSaveData = async (params, props) =&gt; { @@ -840,13 +1098,15 @@ const handleSaveData = async (params, props) =&gt; {
840 // } else if (sModelsType === "sales/salesSgoods" && !commonUtils.isEmpty(slaveChildConfig)) { 1098 // } else if (sModelsType === "sales/salesSgoods" && !commonUtils.isEmpty(slaveChildConfig)) {
841 // await this.handleGetOneMemoData("slaveChild", slaveChildConfig); 1099 // await this.handleGetOneMemoData("slaveChild", slaveChildConfig);
842 // } 1100 // }
843 - // if (this.props.app.currentPane.refresh !== undefined) {  
844 - // this.props.app.currentPane.refresh(); 1101 + // if (props.app.currentPane.refresh !== undefined) {
  1102 + // props.app.currentPane.refresh();
845 // } 1103 // }
846 // } 1104 // }
847 - props.onSaveState({  
848 - loading: false,  
849 - }); 1105 +
  1106 + // props.masterConfig.sId sModelsId
  1107 +
  1108 + props.triggerReload();
  1109 +
850 return true; 1110 return true;
851 } else { 1111 } else {
852 props.onSaveState({ 1112 props.onSaveState({
@@ -883,6 +1143,7 @@ const handleSave = async (skipCalculation, props) =&gt; { @@ -883,6 +1143,7 @@ const handleSave = async (skipCalculation, props) =&gt; {
883 packConfig, 1143 packConfig,
884 packData, 1144 packData,
885 packDelData, 1145 packDelData,
  1146 + state
886 } = props; 1147 } = props;
887 if (commonUtils.isEmptyArr(slaveData)) { 1148 if (commonUtils.isEmptyArr(slaveData)) {
888 // message.warning(`从表${commonFunc.showMessage(props.app.commonConst, "isNotNull")}`); 1149 // message.warning(`从表${commonFunc.showMessage(props.app.commonConst, "isNotNull")}`);
@@ -905,7 +1166,10 @@ const handleSave = async (skipCalculation, props) =&gt; { @@ -905,7 +1166,10 @@ const handleSave = async (skipCalculation, props) =&gt; {
905 return; 1166 return;
906 } 1167 }
907 const data = []; 1168 const data = [];
908 - 1169 +
  1170 + if (masterData.sBillNo !== '') {
  1171 + delete masterData.maxBillNo;
  1172 + }
909 data.push(commonBusiness.mergeData("master", masterConfig.sTbName, [masterData])); 1173 data.push(commonBusiness.mergeData("master", masterConfig.sTbName, [masterData]));
910 data.push(commonBusiness.mergeData("slave", slaveConfig.sTbName, slaveData, slaveDelData)); 1174 data.push(commonBusiness.mergeData("slave", slaveConfig.sTbName, slaveData, slaveDelData));
911 data.push(commonBusiness.mergeData("control", controlConfig.sTbName, controlData, controlDelData)); 1175 data.push(commonBusiness.mergeData("control", controlConfig.sTbName, controlData, controlDelData));
@@ -937,14 +1201,34 @@ const handleSave = async (skipCalculation, props) =&gt; { @@ -937,14 +1201,34 @@ const handleSave = async (skipCalculation, props) =&gt; {
937 } 1201 }
938 } 1202 }
939 if ((skipFlag === 0 || masterData.bNoVerify) && !skipCalculation) { 1203 if ((skipFlag === 0 || masterData.bNoVerify) && !skipCalculation) {
940 - handleCalculation(true, props.state.newNextProps, false, props); 1204 + const { masterData: masterData1 } = props
  1205 + const newState = {
  1206 + materialsConfig,
  1207 + masterData: { ...masterData1, ...masterData },
  1208 + slaveData,
  1209 + controlData,
  1210 + materialsData,
  1211 + processData,
  1212 + fastOrderModalVisible: false,
  1213 + quotationAllprogress: 0,
  1214 + materialsSelectedRowKeys: [],
  1215 + ...state.addState,
  1216 + // bVisiblesInfo: !!commonUtils.isNotEmptyArr(sInfoArr),
  1217 + Loading: false,
  1218 + // quickQuoteModel: false,
  1219 + };
  1220 + delete newState.masterData.sQuoConfig;
  1221 + const masterProps = {
  1222 + ...props,
  1223 + };
  1224 + handleCalculation(true, { ...masterProps, ...newState, state }, false, props);
941 } else { 1225 } else {
942 props.onSaveData({ 1226 props.onSaveData({
943 data, 1227 data,
944 sClientType: "1", 1228 sClientType: "1",
945 loading: false, 1229 loading: false,
946 sSysLogSrcId: masterData.sId, 1230 sSysLogSrcId: masterData.sId,
947 - }); 1231 + }, props);
948 } 1232 }
949 }; 1233 };
950 /** 表格数据更改 */ 1234 /** 表格数据更改 */
@@ -1040,18 +1324,18 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat @@ -1040,18 +1324,18 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat
1040 if (bCkxNoTaxProcessPrice === "0") { 1324 if (bCkxNoTaxProcessPrice === "0") {
1041 tableDataRow.dProfitMoney = commonUtils.convertFixNum( 1325 tableDataRow.dProfitMoney = commonUtils.convertFixNum(
1042 commonUtils.isNull(dProductMoney, 0) - 1326 commonUtils.isNull(dProductMoney, 0) -
1043 - commonUtils.isNull(tableDataRow.dStandardMoney, 0) -  
1044 - commonUtils.isNull(masterData.dPackMoney, 0) -  
1045 - commonUtils.isNull(masterData.dTransportMoney, 0), 1327 + commonUtils.isNull(tableDataRow.dStandardMoney, 0) -
  1328 + commonUtils.isNull(masterData.dPackMoney, 0) -
  1329 + commonUtils.isNull(masterData.dTransportMoney, 0),
1046 dNetMoney 1330 dNetMoney
1047 ); 1331 );
1048 } else { 1332 } else {
1049 tableDataRow.dProfitMoney = commonUtils.convertFixNum( 1333 tableDataRow.dProfitMoney = commonUtils.convertFixNum(
1050 commonUtils.isNull(dProductMoney, 0) - 1334 commonUtils.isNull(dProductMoney, 0) -
1051 - commonUtils.isNull(tableDataRow.dProductTaxMoney, 0) -  
1052 - commonUtils.isNull(tableDataRow.dStandardMoney, 0) -  
1053 - commonUtils.isNull(masterData.dPackMoney, 0) -  
1054 - commonUtils.isNull(masterData.dTransportMoney, 0), 1335 + commonUtils.isNull(tableDataRow.dProductTaxMoney, 0) -
  1336 + commonUtils.isNull(tableDataRow.dStandardMoney, 0) -
  1337 + commonUtils.isNull(masterData.dPackMoney, 0) -
  1338 + commonUtils.isNull(masterData.dTransportMoney, 0),
1055 dNetMoney 1339 dNetMoney
1056 ); 1340 );
1057 } 1341 }
@@ -1059,9 +1343,9 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat @@ -1059,9 +1343,9 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat
1059 tableDataRow.dProfitRate = 1343 tableDataRow.dProfitRate =
1060 commonUtils.isNull(tableDataRow.dStandardMoney, 0) !== 0 1344 commonUtils.isNull(tableDataRow.dStandardMoney, 0) !== 0
1061 ? commonUtils.convertFixNum( 1345 ? commonUtils.convertFixNum(
1062 - (commonUtils.isNull(tableDataRow.dProfitMoney, 0) / commonUtils.isNull(tableDataRow.dStandardMoney, 0)) * 100,  
1063 - 2  
1064 - ) 1346 + (commonUtils.isNull(tableDataRow.dProfitMoney, 0) / commonUtils.isNull(tableDataRow.dStandardMoney, 0)) * 100,
  1347 + 2
  1348 + )
1065 : 0; 1349 : 0;
1066 } else if (sFieldName === "dProfitRate" && !commonUtils.isEmpty(tableDataRow.dStandardMoney)) { 1350 } else if (sFieldName === "dProfitRate" && !commonUtils.isEmpty(tableDataRow.dStandardMoney)) {
1067 /* 利润 = 标准金额 dStandMoney * 利润率 dProfitRate */ 1351 /* 利润 = 标准金额 dStandMoney * 利润率 dProfitRate */
@@ -1093,7 +1377,7 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat @@ -1093,7 +1377,7 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat
1093 // eslint-disable-next-line no-mixed-operators 1377 // eslint-disable-next-line no-mixed-operators
1094 tableDataRow.dProductMoney = commonUtils.convertFixNum( 1378 tableDataRow.dProductMoney = commonUtils.convertFixNum(
1095 (commonUtils.isNull(tableDataRow.dStandardMoney, 0) + commonUtils.isNull(tableDataRow.dProfitMoney, 0)) * 1379 (commonUtils.isNull(tableDataRow.dStandardMoney, 0) + commonUtils.isNull(tableDataRow.dProfitMoney, 0)) *
1096 - (1 + tableDataRow.dTaxRate / 100), 1380 + (1 + tableDataRow.dTaxRate / 100),
1097 dNetMoney 1381 dNetMoney
1098 ); 1382 );
1099 tableDataRow = commonBusiness.getCalculateAllMoney(app, "Product", "dProductMoney", masterData, tableDataRow); 1383 tableDataRow = commonBusiness.getCalculateAllMoney(app, "Product", "dProductMoney", masterData, tableDataRow);
@@ -1420,7 +1704,7 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat @@ -1420,7 +1704,7 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat
1420 // const dMaterialsWidth = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.dMaterialsWidth, 0)); /* 材料宽 */ 1704 // const dMaterialsWidth = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.dMaterialsWidth, 0)); /* 材料宽 */
1421 1705
1422 /* 算材料开数 */ 1706 /* 算材料开数 */
1423 - // const mapMaterialsKQty = this.props.onResolveMachineComposing(dMachineLength, dMachineWidth, dMaterialsLength, dMaterialsWidth); 1707 + // const mapMaterialsKQty = props.onResolveMachineComposing(dMachineLength, dMachineWidth, dMaterialsLength, dMaterialsWidth);
1424 // if (commonUtils.isNotEmptyObject(mapMaterialsKQty)) { 1708 // if (commonUtils.isNotEmptyObject(mapMaterialsKQty)) {
1425 // const dMaterialsKQty = mapMaterialsKQty.totalNum; 1709 // const dMaterialsKQty = mapMaterialsKQty.totalNum;
1426 // tableDataRow.dMaterialsKQty = dMaterialsKQty; 1710 // tableDataRow.dMaterialsKQty = dMaterialsKQty;
@@ -1435,7 +1719,7 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat @@ -1435,7 +1719,7 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat
1435 } 1719 }
1436 /* 算拼版数 */ 1720 /* 算拼版数 */
1437 // if (dProductLength !== 0 && dProductWidth !== 0) { 1721 // if (dProductLength !== 0 && dProductWidth !== 0) {
1438 - // const mapSinglePQty = this.props.onResolveMachineComposing(dProductLength, dProductWidth, dMachineLength, dMachineWidth); 1722 + // const mapSinglePQty = props.onResolveMachineComposing(dProductLength, dProductWidth, dMachineLength, dMachineWidth);
1439 // if (commonUtils.isNotEmptyObject(mapSinglePQty)) { 1723 // if (commonUtils.isNotEmptyObject(mapSinglePQty)) {
1440 // const dSinglePQty = mapSinglePQty.totalNum; 1724 // const dSinglePQty = mapSinglePQty.totalNum;
1441 // tableDataRow.dSinglePQty = dSinglePQty; 1725 // tableDataRow.dSinglePQty = dSinglePQty;
@@ -1512,7 +1796,7 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat @@ -1512,7 +1796,7 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat
1512 // const dMaterialsWidth = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.dMaterialsWidth, 0)); /* 材料宽 */ 1796 // const dMaterialsWidth = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.dMaterialsWidth, 0)); /* 材料宽 */
1513 // 1797 //
1514 // /* 算材料开数 */ 1798 // /* 算材料开数 */
1515 - // const mapMaterialsKQty = this.props.onResolveMachineComposing(dMachineLength, dMachineWidth, dMaterialsLength, dMaterialsWidth); 1799 + // const mapMaterialsKQty = props.onResolveMachineComposing(dMachineLength, dMachineWidth, dMaterialsLength, dMaterialsWidth);
1516 // if (commonUtils.isNotEmptyObject(mapMaterialsKQty)) { 1800 // if (commonUtils.isNotEmptyObject(mapMaterialsKQty)) {
1517 // const dMaterialsKQty = mapMaterialsKQty.totalNum; 1801 // const dMaterialsKQty = mapMaterialsKQty.totalNum;
1518 // tableDataRow.dMaterialsKQty = dMaterialsKQty; 1802 // tableDataRow.dMaterialsKQty = dMaterialsKQty;
@@ -1520,7 +1804,7 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat @@ -1520,7 +1804,7 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat
1520 // 1804 //
1521 // /* 算拼版数 */ 1805 // /* 算拼版数 */
1522 // if (dProductLength !== 0 && dProductWidth !== 0) { 1806 // if (dProductLength !== 0 && dProductWidth !== 0) {
1523 - // const mapSinglePQty = this.props.onResolveMachineComposing(dProductLength, dProductWidth, dMachineLength, dMachineWidth); 1807 + // const mapSinglePQty = props.onResolveMachineComposing(dProductLength, dProductWidth, dMachineLength, dMachineWidth);
1524 // if (commonUtils.isNotEmptyObject(mapSinglePQty)) { 1808 // if (commonUtils.isNotEmptyObject(mapSinglePQty)) {
1525 // const dSinglePQty = mapSinglePQty.totalNum; 1809 // const dSinglePQty = mapSinglePQty.totalNum;
1526 // tableDataRow.dSinglePQty = dSinglePQty; 1810 // tableDataRow.dSinglePQty = dSinglePQty;
@@ -1778,8 +2062,8 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat @@ -1778,8 +2062,8 @@ const handleTableChange = async (name, sFieldName, changeValue, sId, dropDownDat
1778 dropDownDataProcessName[iIndex].sType === "3" 2062 dropDownDataProcessName[iIndex].sType === "3"
1779 ? tableData.findIndex(item => item.sProcessId === itemProcessAssort.sProcessId) 2063 ? tableData.findIndex(item => item.sProcessId === itemProcessAssort.sProcessId)
1780 : tableData.findIndex( 2064 : tableData.findIndex(
1781 - item => item.sProcessId === itemProcessAssort.sProcessId && item.sControlId === controlData[iControlIndex].sId  
1782 - ); 2065 + item => item.sProcessId === itemProcessAssort.sProcessId && item.sControlId === controlData[iControlIndex].sId
  2066 + );
1783 if (iIndex > -1 && iNewProcessIndex < 0) { 2067 if (iIndex > -1 && iNewProcessIndex < 0) {
1784 let processRow = commonFunc.getDefaultData(processConfig, newCopyTo); // 取默认值 2068 let processRow = commonFunc.getDefaultData(processConfig, newCopyTo); // 取默认值
1785 processRow = { ...processRow, ...commonFunc.getAssignFieldValue(processAssignAssort, dropDownDataProcessName[iIndex], newCopyTo) }; // 取赋值字段 2069 processRow = { ...processRow, ...commonFunc.getAssignFieldValue(processAssignAssort, dropDownDataProcessName[iIndex], newCopyTo) }; // 取赋值字段
@@ -1917,8 +2201,8 @@ const singlePQtyChange = tableDataRow =&gt; { @@ -1917,8 +2201,8 @@ const singlePQtyChange = tableDataRow =&gt; {
1917 if (tableDataRow.iStick > 0 && tableDataRow.dSinglePQty > 0) { 2201 if (tableDataRow.iStick > 0 && tableDataRow.dSinglePQty > 0) {
1918 tableDataRow.dMachineQty = commonUtils.convertFixNum( 2202 tableDataRow.dMachineQty = commonUtils.convertFixNum(
1919 (commonUtils.isNull(tableDataRow.dPartsQty, 0) * commonUtils.isNull(tableDataRow.dSumPQty, 0) * 0.5) / 2203 (commonUtils.isNull(tableDataRow.dPartsQty, 0) * commonUtils.isNull(tableDataRow.dSumPQty, 0) * 0.5) /
1920 - tableDataRow.dSinglePQty /  
1921 - tableDataRow.iStick, 2204 + tableDataRow.dSinglePQty /
  2205 + tableDataRow.iStick,
1922 0 2206 0
1923 ); 2207 );
1924 tableDataRow.dSumMachineQty = tableDataRow.dMachineQty * tableDataRow.iStick; 2208 tableDataRow.dSumMachineQty = tableDataRow.dMachineQty * tableDataRow.iStick;
@@ -1961,7 +2245,7 @@ const singlePQtyChange = tableDataRow =&gt; { @@ -1961,7 +2245,7 @@ const singlePQtyChange = tableDataRow =&gt; {
1961 // const dMachineWidth = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.dMachineWidth, 0)); /* 上机宽 */ 2245 // const dMachineWidth = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.dMachineWidth, 0)); /* 上机宽 */
1962 // const dMaterialsLength = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.dMaterialsLength, 0)); /* 材料长 */ 2246 // const dMaterialsLength = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.dMaterialsLength, 0)); /* 材料长 */
1963 // const dMaterialsWidth = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.dMaterialsWidth, 0)); /* 材料宽 */ 2247 // const dMaterialsWidth = commonUtils.convertStrToNumber(commonUtils.isNull(tableDataRow.dMaterialsWidth, 0)); /* 材料宽 */
1964 - // const sResult = this.props.onResolveMachineComposing(dMachineLength, dMachineWidth, dMaterialsLength, dMaterialsWidth); 2248 + // const sResult = props.onResolveMachineComposing(dMachineLength, dMachineWidth, dMaterialsLength, dMaterialsWidth);
1965 // if (commonUtils.isNotEmptyObject(sResult)) { 2249 // if (commonUtils.isNotEmptyObject(sResult)) {
1966 // const dMaterialsKQty = sResult.totalNum; 2250 // const dMaterialsKQty = sResult.totalNum;
1967 // tableDataRow.dMaterialsKQty = dMaterialsKQty; 2251 // tableDataRow.dMaterialsKQty = dMaterialsKQty;
@@ -2007,6 +2291,8 @@ const handlePackDataAdd = (item, index, sControlId, handleType) =&gt; { @@ -2007,6 +2291,8 @@ const handlePackDataAdd = (item, index, sControlId, handleType) =&gt; {
2007 tableDataRow.sProductStyle = item.sProductStyle; /* 产品规格 */ 2291 tableDataRow.sProductStyle = item.sProductStyle; /* 产品规格 */
2008 return tableDataRow; 2292 return tableDataRow;
2009 }; 2293 };
  2294 +
  2295 +
2010 const QuotationAllMaster = baseProps => { 2296 const QuotationAllMaster = baseProps => {
2011 const props = masterEvent(baseProps); 2297 const props = masterEvent(baseProps);
2012 if (!props) { 2298 if (!props) {
@@ -2016,6 +2302,8 @@ const QuotationAllMaster = baseProps =&gt; { @@ -2016,6 +2302,8 @@ const QuotationAllMaster = baseProps =&gt; {
2016 return null; 2302 return null;
2017 } 2303 }
2018 2304
  2305 +
2019 return <QuotationAllprogressDetail {...props} onDataChange={handleTableChange} onButtonClick={handleButtonClick} />; 2306 return <QuotationAllprogressDetail {...props} onDataChange={handleTableChange} onButtonClick={handleButtonClick} />;
2020 }; 2307 };
2021 -export default QuotationAllMaster; 2308 +// export default QuotationAllMaster;
  2309 +export default CommobileBase(CommobileBillEvent(QuotationAllMaster));