Commit c66b7f63b9ab51b5d43073204c772fbaaf7fb512

Authored by zhangzzzz
1 parent 484c5ff1

新增后道参数必填样式及保存校验;

src/components/QuickQuote/index.jsx
@@ -702,7 +702,17 @@ const QuickQuoteEvent = props => { @@ -702,7 +702,17 @@ const QuickQuoteEvent = props => {
702 await new Promise(resolve => setTimeout(resolve, 2000)); 702 await new Promise(resolve => setTimeout(resolve, 2000));
703 } 703 }
704 704
705 - const { masterConfig, masterData = {}, slaveConfig, slaveData = [], selectedNode = {}, extraParts = {} } = state; 705 + const {
  706 + masterConfig,
  707 + masterData = {},
  708 + slaveConfig,
  709 + slaveData = [],
  710 + selectedNode = {},
  711 + extraParts = {},
  712 + downAbleConfigs = [],
  713 + downAbleExtraConfigs = [],
  714 + finishedConfigs = [],
  715 + } = state;
706 const selectProduct = commonFunc.showLocalMessage(props, "selectProduct", "请先选择产品"); 716 const selectProduct = commonFunc.showLocalMessage(props, "selectProduct", "请先选择产品");
707 if (commonUtils.isEmptyObject(selectedNode)) { 717 if (commonUtils.isEmptyObject(selectedNode)) {
708 message.error(selectProduct, 2); 718 message.error(selectProduct, 2);
@@ -732,6 +742,7 @@ const QuickQuoteEvent = props => { @@ -732,6 +742,7 @@ const QuickQuoteEvent = props => {
732 .filter(item => (bBox ? true : item.sName !== "sName")); 742 .filter(item => (bBox ? true : item.sName !== "sName"));
733 743
734 const sMaterialsNameConfig = slaveConfig.gdsconfigformslave.find(item => item.sName === "sMaterialsName"); 744 const sMaterialsNameConfig = slaveConfig.gdsconfigformslave.find(item => item.sName === "sMaterialsName");
  745 + const downAbleConfigMust = [...downAbleConfigs, ...downAbleExtraConfigs].filter(item => item.bNotEmpty);
735 746
736 const errorList = []; 747 const errorList = [];
737 const partsList = []; 748 const partsList = [];
@@ -740,6 +751,12 @@ const QuickQuoteEvent = props => { @@ -740,6 +751,12 @@ const QuickQuoteEvent = props => {
740 if (!slaveRowData.materialsInfo || slaveRowData.materialsInfo.some(item => !item.sMaterialsName)) { 751 if (!slaveRowData.materialsInfo || slaveRowData.materialsInfo.some(item => !item.sMaterialsName)) {
741 list.push(sMaterialsNameConfig); 752 list.push(sMaterialsNameConfig);
742 } 753 }
  754 + const { sBackProcessData = [] } = slaveRowData;
  755 + downAbleConfigMust.forEach(item => {
  756 + if (!sBackProcessData.some(x => x.sProductClassifyId === item.sId)) {
  757 + list.push(item);
  758 + }
  759 + });
743 errorList.push(list); 760 errorList.push(list);
744 partsList.push(slaveRowData.sBoxModel); 761 partsList.push(slaveRowData.sBoxModel);
745 }); 762 });
@@ -755,6 +772,18 @@ const QuickQuoteEvent = props => { @@ -755,6 +772,18 @@ const QuickQuoteEvent = props => {
755 ); 772 );
756 } 773 }
757 774
  775 + const finishedConfigMust = finishedConfigs.filter(item => item.bNotEmpty);
  776 + const { productProcessInfo = [] } = masterData;
  777 +
  778 + const checkResult1 = finishedConfigMust.filter(item => !productProcessInfo.some(x => x.sProductClassifyId === item.sId));
  779 + if (checkResult1.length) {
  780 + errMsgList.push(
  781 + checkResult1.map(item => <span>【{item.showName}】</span>),
  782 + <span>{getI18nName("isNotNull")}</span>,
  783 + <br />
  784 + );
  785 + }
  786 +
758 if (errMsgList.length) { 787 if (errMsgList.length) {
759 message.error(errMsgList, 3); 788 message.error(errMsgList, 3);
760 return; 789 return;
src/components/QuickQuote/index.less
@@ -100,7 +100,7 @@ @@ -100,7 +100,7 @@
100 100
101 .ant-form-item-control { 101 .ant-form-item-control {
102 flex: 1; 102 flex: 1;
103 - max-width: calc(100% - 70px); 103 + max-width: calc(100% - 70px) !important;
104 } 104 }
105 105
106 .viewStyle { 106 .viewStyle {
@@ -131,6 +131,14 @@ @@ -131,6 +131,14 @@
131 max-width: calc(100% - 95px); 131 max-width: calc(100% - 95px);
132 } 132 }
133 } 133 }
  134 +
  135 + .ant-form-item-required {
  136 + &::before {
  137 + content: '' !important;
  138 + }
  139 +
  140 + color: #ff4d4f !important;
  141 + }
134 } 142 }
135 143
136 .subViewTable { 144 .subViewTable {
@@ -546,13 +554,14 @@ @@ -546,13 +554,14 @@
546 .ant-form-item-label { 554 .ant-form-item-label {
547 label { 555 label {
548 &::before { 556 &::before {
549 - content: "";  
550 - display: block;  
551 - width: 5px;  
552 - height: 5px;  
553 - border-radius: 50%;  
554 - background-color: #ff4d4f;  
555 - margin-right: 2px; 557 + content: "" !important;
  558 + display: block !important;
  559 + width: 5px !important;
  560 + min-width: 5px;
  561 + height: 5px !important;
  562 + border-radius: 50% !important;
  563 + background-color: #ff4d4f !important;
  564 + margin-right: 2px !important;
556 } 565 }
557 } 566 }
558 } 567 }