Commit 5532c55e8048d77b2e6ee681d4c7ffd3e5d236ec

Authored by zhangzzzz
1 parent d1a9aac5

新增文件上传按钮;

修改数据后不清空多数量表;
src/components/QuickQuote/index.jsx
1 /* eslint-disable */ 1 /* eslint-disable */
2 import { useRef, useEffect, useState, useCallback, useMemo } from "react"; 2 import { useRef, useEffect, useState, useCallback, useMemo } from "react";
3 import { Button, Divider, Tabs, Tree, Radio, Image, Modal, Input, message, Badge, Checkbox, Carousel } from "antd-v4"; 3 import { Button, Divider, Tabs, Tree, Radio, Image, Modal, Input, message, Badge, Checkbox, Carousel } from "antd-v4";
4 -import { ArrowLeftOutlined, FolderFilled, FolderOpenFilled, FileTextFilled, PlusOutlined, MinusOutlined } from "@ant-design/icons"; 4 +import { ArrowLeftOutlined, FolderFilled, FolderOpenFilled, FileTextFilled, PlusOutlined, MinusOutlined, UploadOutlined } from "@ant-design/icons";
5 import { cloneDeep } from "lodash"; 5 import { cloneDeep } from "lodash";
6 import commonConfig from "@/utils/config"; 6 import commonConfig from "@/utils/config";
7 import * as commonUtils from "@/utils/utils"; 7 import * as commonUtils from "@/utils/utils";
@@ -263,9 +263,9 @@ const QuickQuoteEvent = props => { @@ -263,9 +263,9 @@ const QuickQuoteEvent = props => {
263 calcPriceFinished: false, 263 calcPriceFinished: false,
264 }; 264 };
265 265
266 - if (manyData.some(item => Object.keys(item).length > 4)) {  
267 - extraState.manyData = [];  
268 - } 266 + // if (manyData.some(item => Object.keys(item).length > 4)) {
  267 + // extraState.manyData = [];
  268 + // }
269 269
270 if (name === "master") { 270 if (name === "master") {
271 const { showName: sTreeNodeName } = selectedNode; 271 const { showName: sTreeNodeName } = selectedNode;
@@ -562,7 +562,7 @@ const QuickQuoteEvent = props => { @@ -562,7 +562,7 @@ const QuickQuoteEvent = props => {
562 props.onAdd(); 562 props.onAdd();
563 setState(pre => ({ 563 setState(pre => ({
564 ...pre, 564 ...pre,
565 - manyData: [], 565 + // manyData: [],
566 calcPriceFinished: false, 566 calcPriceFinished: false,
567 })); 567 }));
568 return true; 568 return true;
@@ -1475,7 +1475,7 @@ const ContentComponent = props => { @@ -1475,7 +1475,7 @@ const ContentComponent = props => {
1475 [showName]: extraPartsList, 1475 [showName]: extraPartsList,
1476 }, 1476 },
1477 calcPriceFinished: false, 1477 calcPriceFinished: false,
1478 - manyData: [], 1478 + // manyData: [],
1479 })); 1479 }));
1480 setActiveKey(targetKey - 1); 1480 setActiveKey(targetKey - 1);
1481 } 1481 }
@@ -1566,6 +1566,16 @@ const MasterComponent = props => { @@ -1566,6 +1566,16 @@ const MasterComponent = props => {
1566 iColValueView: 24, 1566 iColValueView: 24,
1567 viewRow: { ...masterData, sProductClassifyId: selectedNode.sId }, 1567 viewRow: { ...masterData, sProductClassifyId: selectedNode.sId },
1568 tableName: "master", 1568 tableName: "master",
  1569 + extraContent: child => {
  1570 + if (child.sName === "sProductName") {
  1571 + return (
  1572 + <div className={styles.productNameBtns}>
  1573 + <Button type="link" icon={<UploadOutlined />}></Button>
  1574 + </div>
  1575 + );
  1576 + }
  1577 + return "";
  1578 + },
1569 }; 1579 };
1570 1580
1571 return ( 1581 return (
@@ -2219,11 +2229,11 @@ const BoxComponent = props =&gt; { @@ -2219,11 +2229,11 @@ const BoxComponent = props =&gt; {
2219 { src: slaveRowData.sPackPath, alt: "立体图" }, 2229 { src: slaveRowData.sPackPath, alt: "立体图" },
2220 ]; 2230 ];
2221 const { activeKey = 0 } = state; 2231 const { activeKey = 0 } = state;
2222 - useEffect(()=>{  
2223 - props.setState(pre => {  
2224 - return { ...pre, activeKey:0 };  
2225 - });  
2226 - },[selectedNode]) 2232 + useEffect(() => {
  2233 + props.setState(pre => {
  2234 + return { ...pre, activeKey: 0 };
  2235 + });
  2236 + }, [selectedNode]);
2227 return ( 2237 return (
2228 <Tabs 2238 <Tabs
2229 key={boxModel} 2239 key={boxModel}
@@ -2594,13 +2604,13 @@ const MaterialsComponent = props =&gt; { @@ -2594,13 +2604,13 @@ const MaterialsComponent = props =&gt; {
2594 calcPriceFinished: false, 2604 calcPriceFinished: false,
2595 }; 2605 };
2596 2606
2597 - if (manyData.some(item => Object.keys(item).length > 4)) {  
2598 - extraState.manyData = [];  
2599 - } 2607 + // if (manyData.some(item => Object.keys(item).length > 4)) {
  2608 + // extraState.manyData = [];
  2609 + // }
2600 2610
2601 return materialsInfo.map((item, index) => { 2611 return materialsInfo.map((item, index) => {
2602 // let viewRow = { ...materialsInfo[index], sProductClassifyId: selectedNode.sId,sId: selectedNode.sId}; 2612 // let viewRow = { ...materialsInfo[index], sProductClassifyId: selectedNode.sId,sId: selectedNode.sId};
2603 - let viewRow = { ...materialsInfo[index], sProductClassifyId: selectedNode.sId}; 2613 + let viewRow = { ...materialsInfo[index], sProductClassifyId: selectedNode.sId };
2604 viewRow = { ...viewRow, sMaterialsName0: viewRow.showName || "" }; 2614 viewRow = { ...viewRow, sMaterialsName0: viewRow.showName || "" };
2605 let materialsConfigNew = cloneDeep(materialsConfig); 2615 let materialsConfigNew = cloneDeep(materialsConfig);
2606 if (viewRow.showName) { 2616 if (viewRow.showName) {
@@ -3202,6 +3212,9 @@ const BackendParamsExtraComponent = props =&gt; { @@ -3202,6 +3212,9 @@ const BackendParamsExtraComponent = props =&gt; {
3202 return props.getSqlDropDownData(...args); 3212 return props.getSqlDropDownData(...args);
3203 }, 3213 },
3204 onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => { 3214 onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => {
  3215 + const extraState = {
  3216 + calcPriceFinished: false,
  3217 + };
3205 const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId); 3218 const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
3206 3219
3207 if (sParentFieldsName === "sPrint") { 3220 if (sParentFieldsName === "sPrint") {
@@ -3214,7 +3227,7 @@ const BackendParamsExtraComponent = props =&gt; { @@ -3214,7 +3227,7 @@ const BackendParamsExtraComponent = props =&gt; {
3214 let sBackProcessDataNew = [...sBackProcessData]; 3227 let sBackProcessDataNew = [...sBackProcessData];
3215 sBackProcessDataNew[iIndex1] = { ...sBackProcessDataNew[iIndex1], ...changeValue }; 3228 sBackProcessDataNew[iIndex1] = { ...sBackProcessDataNew[iIndex1], ...changeValue };
3216 slaveData[iIndex].sBackProcessData = sBackProcessDataNew; 3229 slaveData[iIndex].sBackProcessData = sBackProcessDataNew;
3217 - props.setState(pre => ({ ...pre, slaveData })); 3230 + props.setState(pre => ({ ...pre, slaveData, ...extraState }));
3218 } 3231 }
3219 return; 3232 return;
3220 } 3233 }
@@ -3247,7 +3260,7 @@ const BackendParamsExtraComponent = props =&gt; { @@ -3247,7 +3260,7 @@ const BackendParamsExtraComponent = props =&gt; {
3247 slaveData[iIndex].sBackProcessData[iIndex1].dManualValue = dManualLength * dManualWidth; 3260 slaveData[iIndex].sBackProcessData[iIndex1].dManualValue = dManualLength * dManualWidth;
3248 } 3261 }
3249 } 3262 }
3250 - props.setState(pre => ({ ...pre, slaveData })); 3263 + props.setState(pre => ({ ...pre, slaveData, ...extraState }));
3251 }, 3264 },
3252 }; 3265 };
3253 3266
src/components/QuickQuote/index.less
@@ -225,13 +225,15 @@ @@ -225,13 +225,15 @@
225 width: 100%; 225 width: 100%;
226 height: auto; 226 height: auto;
227 display: flex; 227 display: flex;
  228 +
228 // align-items: center; 229 // align-items: center;
229 - .svgBox{ 230 + .svgBox {
230 position: absolute; 231 position: absolute;
231 left: 50%; 232 left: 50%;
232 top: 50%; 233 top: 50%;
233 - transform: translate(-50%, -50%); 234 + transform: translate(-50%, -50%);
234 } 235 }
  236 +
235 :global .ant-carousel .slick-dots li button { 237 :global .ant-carousel .slick-dots li button {
236 background-color: #000; 238 background-color: #000;
237 /* 未激活时的指示器颜色 */ 239 /* 未激活时的指示器颜色 */
@@ -410,6 +412,18 @@ @@ -410,6 +412,18 @@
410 } 412 }
411 } 413 }
412 } 414 }
  415 +
  416 + .productNameBtns {
  417 + position: absolute;
  418 + top: 1px;
  419 + right: 2px;
  420 +
  421 + :global {
  422 + button {
  423 + width: 20px;
  424 + }
  425 + }
  426 + }
413 } 427 }
414 } 428 }
415 } 429 }