Commit 5532c55e8048d77b2e6ee681d4c7ffd3e5d236ec

Authored by zhangzzzz
1 parent d1a9aac5

新增文件上传按钮;

修改数据后不清空多数量表;
src/components/QuickQuote/index.jsx
1 1 /* eslint-disable */
2 2 import { useRef, useEffect, useState, useCallback, useMemo } from "react";
3 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 5 import { cloneDeep } from "lodash";
6 6 import commonConfig from "@/utils/config";
7 7 import * as commonUtils from "@/utils/utils";
... ... @@ -263,9 +263,9 @@ const QuickQuoteEvent = props => {
263 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 270 if (name === "master") {
271 271 const { showName: sTreeNodeName } = selectedNode;
... ... @@ -562,7 +562,7 @@ const QuickQuoteEvent = props => {
562 562 props.onAdd();
563 563 setState(pre => ({
564 564 ...pre,
565   - manyData: [],
  565 + // manyData: [],
566 566 calcPriceFinished: false,
567 567 }));
568 568 return true;
... ... @@ -1475,7 +1475,7 @@ const ContentComponent = props => {
1475 1475 [showName]: extraPartsList,
1476 1476 },
1477 1477 calcPriceFinished: false,
1478   - manyData: [],
  1478 + // manyData: [],
1479 1479 }));
1480 1480 setActiveKey(targetKey - 1);
1481 1481 }
... ... @@ -1566,6 +1566,16 @@ const MasterComponent = props => {
1566 1566 iColValueView: 24,
1567 1567 viewRow: { ...masterData, sProductClassifyId: selectedNode.sId },
1568 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 1581 return (
... ... @@ -2219,11 +2229,11 @@ const BoxComponent = props =&gt; {
2219 2229 { src: slaveRowData.sPackPath, alt: "立体图" },
2220 2230 ];
2221 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 2237 return (
2228 2238 <Tabs
2229 2239 key={boxModel}
... ... @@ -2594,13 +2604,13 @@ const MaterialsComponent = props =&gt; {
2594 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 2611 return materialsInfo.map((item, index) => {
2602 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 2614 viewRow = { ...viewRow, sMaterialsName0: viewRow.showName || "" };
2605 2615 let materialsConfigNew = cloneDeep(materialsConfig);
2606 2616 if (viewRow.showName) {
... ... @@ -3202,6 +3212,9 @@ const BackendParamsExtraComponent = props =&gt; {
3202 3212 return props.getSqlDropDownData(...args);
3203 3213 },
3204 3214 onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => {
  3215 + const extraState = {
  3216 + calcPriceFinished: false,
  3217 + };
3205 3218 const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
3206 3219  
3207 3220 if (sParentFieldsName === "sPrint") {
... ... @@ -3214,7 +3227,7 @@ const BackendParamsExtraComponent = props =&gt; {
3214 3227 let sBackProcessDataNew = [...sBackProcessData];
3215 3228 sBackProcessDataNew[iIndex1] = { ...sBackProcessDataNew[iIndex1], ...changeValue };
3216 3229 slaveData[iIndex].sBackProcessData = sBackProcessDataNew;
3217   - props.setState(pre => ({ ...pre, slaveData }));
  3230 + props.setState(pre => ({ ...pre, slaveData, ...extraState }));
3218 3231 }
3219 3232 return;
3220 3233 }
... ... @@ -3247,7 +3260,7 @@ const BackendParamsExtraComponent = props =&gt; {
3247 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 225 width: 100%;
226 226 height: auto;
227 227 display: flex;
  228 +
228 229 // align-items: center;
229   - .svgBox{
  230 + .svgBox {
230 231 position: absolute;
231 232 left: 50%;
232 233 top: 50%;
233   - transform: translate(-50%, -50%);
  234 + transform: translate(-50%, -50%);
234 235 }
  236 +
235 237 :global .ant-carousel .slick-dots li button {
236 238 background-color: #000;
237 239 /* 未激活时的指示器颜色 */
... ... @@ -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 }
... ...