Commit 4bbfa94128fb327fd13efc3dc65999c1ba849caf

Authored by 陈鑫涛
1 parent b3ddd4a4

矩形选择

src/components/Common/Typesetting/typesetting.js
... ... @@ -612,6 +612,8 @@ const Typesetting = props => {
612 612 }
613 613 const newDProductQty = masterData.dProductQty;
614 614 const dMaterialsKQty = slaveDataDetail.dMaterialsKQty || 1;
  615 +
  616 +
615 617 if (
616 618 dPartsLength !== innerWidth ||
617 619 newMaterialLength !== materialLength ||
... ... @@ -621,6 +623,8 @@ const Typesetting = props => {
621 623 newDPortraitType !== dPortraitType ||
622 624 (!dWlcd && sBillNo)
623 625 ) {
  626 + console.log(slaveRowData.dMachineLength,'slaveRowData.dMachineLengthss');
  627 +
624 628 setMaterialLength(newMaterialLength);
625 629 setMaterialWidth(newMaterialWidth);
626 630 setMaterialName(sMaterialsName);
... ...
src/components/QuickQuote/index.jsx
... ... @@ -274,7 +274,7 @@ const QuickQuoteEvent = props => {
274 274 dProductQty: changeValue.dProductQty,
275 275 }));
276 276 }
277   -
  277 +
278 278 if (sFieldName === "dLength" || sFieldName === "dWidth" || sFieldName === "dHeight") {
279 279 if (props.currentBoxModel) {
280 280 const boxModel = props.currentBoxModel.replace("slaveUp", "").replace("slaveDown", "");
... ... @@ -445,23 +445,7 @@ const QuickQuoteEvent = props => {
445 445 materialWidth: sFieldName === "dWlkd" ? changeValue[sFieldName] : slaveData[saveIndex]?.dWlkd,
446 446 };
447 447 }
448   - // 如果是卡牌那么赋值sMachineStyle
449   - // if (selectedNode.sTypeKey === 'kapai' || selectedNode.sTypeKey === 'juantong') {
450   - // console.log(slaveData[saveIndex].dMaxLength,'juantong');
451   -
452   - // if (slaveData[saveIndex].dMaxLength === undefined) {
453   - // slaveData[saveIndex] = {
454   - // ...slaveData[saveIndex],
455   - // dMaxLength: Number(selectedNode.sMachineStyle.split("*")[0]),
456   - // };
457   - // }
458   - // if (slaveData[saveIndex].dMaxWidth === undefined) {
459   - // slaveData[saveIndex] = {
460   - // ...slaveData[saveIndex],
461   - // dMaxWidth: Number(selectedNode.sMachineStyle.split("*")[1]),
462   - // };
463   - // }
464   - // }
  448 +
465 449 if (sFieldName === "sName") {
466 450 slaveData[saveIndex] = {
467 451 ...slaveData[saveIndex],
... ... @@ -1162,6 +1146,7 @@ const QuickQuoteEvent = props => {
1162 1146 // 入口
1163 1147 const QuickQuote = baseProps => {
1164 1148 const props = QuickQuoteEvent(baseProps);
  1149 + console.log("🚀 ~ QuickQuote:", props);
1165 1150 const [treeClassName, setTreeClassName] = useState("");
1166 1151  
1167 1152 // 监听页面滚动事件
... ... @@ -1320,7 +1305,6 @@ const TreeComponent = props => {
1320 1305 return {
1321 1306 ...pre,
1322 1307 ...addState,
1323   - sPrintConfig: downAbleConfigs.find(item => item.sType === "1" && item.sName === "胶印"),
1324 1308 downAbleConfigs: downAbleConfigs
1325 1309 .filter(item => item.sType === "2")
1326 1310 .map((item, index) => ({
... ... @@ -1516,7 +1500,7 @@ const MasterComponent = props => {
1516 1500 item.iColValue = 4;
1517 1501 }
1518 1502 });
1519   - }
  1503 + }
1520 1504 const lengthData = viewConfigs.find(x => x.sName === "dLength");
1521 1505  
1522 1506 if (selectedNode && selectedNode.sTypeKey && selectedNode.sTypeKey !== "danye") {
... ... @@ -1572,10 +1556,13 @@ const BoxComponent = props => {
1572 1556 const { bBox } = selectedNode;
1573 1557 const [boxTypeList, setBoxTypeList] = useState([]);
1574 1558 // 卡牌类卷筒类默认使用矩形 当是核价保存过的需要在主表数据加载完后在赋值
  1559 + console.log(props, "asdadasd");
1575 1560 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {};
1576 1561 const { sBillNo } = slaveRowData;
1577 1562 useEffect(() => {
1578 1563 if (selectedNode.sTypeKey === "kapai" || selectedNode.sTypeKey === "juantong") {
  1564 + const {sBillNo} = slaveRowData
  1565 + if(sBillNo) return
1579 1566 let dropDownData = [];
1580 1567 dropDownData.push(KapaiJson);
1581 1568 const boxData = (dropDownData || []).map((item, index) => ({
... ... @@ -2415,19 +2402,14 @@ const PrintParamsComponent = props => {
2415 2402 const printParamsItem = printParams[i - 1];
2416 2403 const viewRow = { ...(i === 0 ? slaveRowData : printParamsItem), sProductClassifyId: selectedNode.sId };
2417 2404  
2418   - const viewTableId = "viewTableId_" + viewRow.sId;
2419 2405 const viewProps = {
2420 2406 ...props,
2421   - viewConfigs: printParamsConfig.map(item => ({ ...item, costomStyle: `xlyPrintParams${i}` })),
  2407 + viewConfigs: printParamsConfig,
2422 2408 tableConfig: { ...slaveConfig, gdsconfigformslave: printParamsConfig },
2423 2409 iColValueView: 24,
2424 2410 viewRow,
2425 2411 tableName: `${i === 0 ? "slaveUp" : "slaveDown"}${boxModel}`,
2426 2412 onDataChange: (...args) => {
2427   - setTimeout(() => {
2428   - const oLabel = document.querySelector(`#${viewTableId}`)?.querySelector(`.xlyPrintParams${i}`)?.querySelector(".ant-form-item-label");
2429   - oLabel?.click();
2430   - }, 200);
2431 2413 if (i === 0) {
2432 2414 props.onDataChange(...args);
2433 2415 return;
... ... @@ -2440,37 +2422,11 @@ const PrintParamsComponent = props => {
2440 2422 return { ...pre, slaveData };
2441 2423 });
2442 2424 },
2443   - onCostomClick: (showConfig, { target }) => {
2444   - if (showConfig.sName !== "sPrint") return;
2445   - const className = target.getAttribute("class");
2446   - const nodeName = target.nodeName;
2447   - if (className?.includes("select") && nodeName === "DIV") return;
2448   -
2449   - const { sPrintConfig } = state;
2450   -
2451   - if (!sPrintConfig) return;
2452   - const backendConfigNew = {
2453   - sParentFieldsName: "sPrint",
2454   - sBoxModel: boxModel,
2455   - printParamsId: viewRow.sId,
2456   - };
2457   -
2458   - const dropDownData = commonUtils.convertStrToObj(sPrintConfig.sChineseDropDown, []);
2459   - const dropDownDataSelected = dropDownData.find(item => item.sId === viewRow.sProcessId);
2460   - if (!dropDownDataSelected) return;
2461   - const backendParamsConfigNew = commonUtils.convertStrToObj(dropDownDataSelected.sParamConfig, []);
2462   -
2463   - props.setState(pre => ({
2464   - ...pre,
2465   - backendParamsConfig: backendParamsConfigNew,
2466   - backendConfig: backendConfigNew,
2467   - }));
2468   - },
2469 2425 };
2470 2426  
2471 2427 result.push(
2472 2428 <div className={styles.materialsLine}>
2473   - <div className={styles.materialsViewTable} id={viewTableId}>
  2429 + <div className={styles.materialsViewTable}>
2474 2430 <CommonViewTable {...viewProps} />
2475 2431 </div>
2476 2432 <div className={styles.materialsBtns} style={{ width: "10%" }}>
... ... @@ -3082,11 +3038,11 @@ const BoxModelSelectedModal = props =&gt; {
3082 3038  
3083 3039 // 后道参数额外配置
3084 3040 const BackendParamsExtraComponent = props => {
3085   - const { state, slaveConfig } = props;
  3041 + const { state, slaveConfig, boxModel } = props;
3086 3042 const { backendParamsConfig = [], backendConfig = {}, slaveData, selectedNode } = state;
3087 3043 if (!backendParamsConfig.length) return "";
3088 3044  
3089   - const { sParentFieldsName, sBoxModel, printParamsId } = backendConfig;
  3045 + const { sParentFieldsName, sBoxModel } = backendConfig;
3090 3046  
3091 3047 const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === sBoxModel) || {};
3092 3048 const { sBackProcessData = [] } = slaveRowData;
... ... @@ -3108,12 +3064,9 @@ const BackendParamsExtraComponent = props =&gt; {
3108 3064 tableConfig: { ...slaveConfig, gdsconfigformslave: viewConfigs },
3109 3065 iColValueView: 24,
3110 3066 getViewRow: config => {
3111   - if (sParentFieldsName === "sPrint") {
3112   - return [slaveRowData, ...sBackProcessData].find(item => item.sId === printParamsId);
3113   - }
3114 3067 return sBackProcessData.find(item => item[sParentFieldsName])?.sBackendParams?.find(item => item.sParam === config.showName) || {};
3115 3068 },
3116   - tableName: `sBackendParams${sBoxModel}`,
  3069 + tableName: `sBackendParams${boxModel}`,
3117 3070 getSqlDropDownData: (...args) => {
3118 3071 const showConfig = args[2];
3119 3072 const { sParamDropDown = "", sName } = showConfig;
... ... @@ -3137,22 +3090,6 @@ const BackendParamsExtraComponent = props =&gt; {
3137 3090 },
3138 3091 onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => {
3139 3092 const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
3140   -
3141   - if (sParentFieldsName === "sPrint") {
3142   - if (slaveData[iIndex].sId === printParamsId) {
3143   - let slaveDataNew = [...slaveData];
3144   - slaveDataNew[iIndex] = { ...slaveDataNew[iIndex], ...changeValue };
3145   - props.setState(pre => ({ ...pre, slaveData: slaveDataNew }));
3146   - } else {
3147   - const iIndex1 = sBackProcessData.findIndex(item => item.sId === printParamsId);
3148   - let sBackProcessDataNew = [...sBackProcessData];
3149   - sBackProcessDataNew[iIndex1] = { ...sBackProcessDataNew[iIndex1], ...changeValue };
3150   - slaveData[iIndex].sBackProcessData = sBackProcessDataNew;
3151   - props.setState(pre => ({ ...pre, slaveData }));
3152   - }
3153   - return;
3154   - }
3155   -
3156 3093 const iIndex1 = slaveData[iIndex].sBackProcessData.findIndex(item => item[sParentFieldsName]);
3157 3094 const showConfig = viewConfigs.find(item => item.sName === sFieldName);
3158 3095 const dropDownDataSelected = dropDownData?.length
... ...