diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js
index 8c4355e..1302953 100644
--- a/src/components/Common/CommonComponent/index.js
+++ b/src/components/Common/CommonComponent/index.js
@@ -3173,7 +3173,7 @@ export default class CommonComponent extends Component {
/* 页面输出 */
return (
-
diff --git a/src/components/Common/CommonNewBillEvent.js b/src/components/Common/CommonNewBillEvent.js
index 55ca6f0..2c81487 100644
--- a/src/components/Common/CommonNewBillEvent.js
+++ b/src/components/Common/CommonNewBillEvent.js
@@ -414,8 +414,8 @@ export default (ChildComponent) => {
/** 获取主表、从表、审核表数据 */
handleGetData = async (masterConfig, slaveConfig, slave0Config, slave1Config, slave2Config, slave3Config, slave4Config, bEditClick, slave5Config, slave6Config, slave7Config, slave8Config, slave9Config, slave10Config) => {
const { currentId, app } = this.props; /* 当前页签数据 */
- const sId = currentId !== undefined ? currentId : '';
const { sModelsId, masterData, sModelsType, slaveSelectedRowKeys } = this.props;
+ const sId = currentId || masterData.sId || "";
await this.props.handleGetDataOne({ name: 'master', configData: masterConfig, condition: { sId, pageSize: '', pageNum: '' }, bEditClick });
let addStateSlave = {};
if (!commonUtils.isEmptyObject(slaveConfig)) {
diff --git a/src/components/Common/CommonViewTable/index.js b/src/components/Common/CommonViewTable/index.js
index 09e7b83..3e932f0 100644
--- a/src/components/Common/CommonViewTable/index.js
+++ b/src/components/Common/CommonViewTable/index.js
@@ -394,6 +394,7 @@ export default class CommonViewTable extends Component {
sBtnSendDialogConfigList: this.props.sBtnSendDialogConfigList, // 校验并获取物料主数据按钮配置
onToolBarBtnClick: this.props.onToolBarBtnClick, // 工具栏按钮事件
onExecInstructSet: this.props.onExecInstructSet, // 调用指令集
+ onCostomClick: this.props.onCostomClick,
};
return (
diff --git a/src/components/QuickQuote/index.jsx b/src/components/QuickQuote/index.jsx
index 55a94fc..897109e 100644
--- a/src/components/QuickQuote/index.jsx
+++ b/src/components/QuickQuote/index.jsx
@@ -212,11 +212,34 @@ const QuickQuoteEvent = props => {
const iIndex = slaveData.findIndex(item => item.sTreeNodeName === sTreeNodeName && item.sBoxModel === boxModel);
if (name.includes("slaveDown")) {
const dropDownDataSelected = dropDownData.find(item => item.sId === changeValue[sFieldName]);
- dropDownDataSelected && (dropDownDataSelected[sFieldName] = dropDownDataSelected.sProcessName);
const extraRowData = {};
// if (dropDownDataSelected.sProcessName === "胶印") {
// extraRowData.sPrintProcessId = dropDownDataSelected.sId;
// }
+
+ if (dropDownDataSelected !== undefined) {
+ dropDownDataSelected[sFieldName] = dropDownDataSelected.sProcessName;
+ // 后道参数额外配置
+ const { sParamConfig: sParamConfigStr } = dropDownDataSelected || {};
+ const sParamConfig = commonUtils.convertStrToObj(sParamConfigStr, []);
+ extraState.backendParamsConfig = sParamConfig;
+ extraState.backendConfig = { sParentFieldsName: sFieldName, sBoxModel: boxModel };
+ const sBackendParams = sParamConfig
+ .map((item, index) => {
+ const { sParamDefault, sParam } = item;
+ return !sParamDefault
+ ? ""
+ : {
+ sId: commonUtils.createSid(),
+ value: sParamDefault,
+ sParam: sParam,
+ [`sParams${index}`]: sParamDefault,
+ };
+ })
+ .filter(item => item !== "");
+ dropDownDataSelected.sBackendParams = sBackendParams;
+ }
+
if (iIndex === -1) {
slaveData.push({
sId: commonUtils.createSid(),
@@ -501,7 +524,7 @@ const QuickQuoteEvent = props => {
return pre;
}, {}),
dPartsQty: masterData.dProductQty,
- iPositiveColor: Number(item.sColor),
+ // iPositiveColor: Number(item.sColor),
sPartsName: item.sBoxModel,
materialsInfo: item.materialsInfo?.filter(x => commonUtils.isNotEmptyObject(x)),
processInfo:
@@ -1183,6 +1206,7 @@ const ContentComponent = props => {
};
})}
/>
+
多数量报价
>
@@ -1227,7 +1251,16 @@ const MasterComponent = props => {
// 盒型组件
const BoxComponent = props => {
const { dividerProps, state, boxModel } = props;
- const { masterData = {}, slaveConfig, slaveData = [], selectedNode = {}, downAbleConfigs = [], finishedConfigs = [], boxConfig = {} } = state;
+ const {
+ masterData = {},
+ slaveConfig,
+ slaveData = [],
+ selectedNode = {},
+ downAbleConfigs = [],
+ downAbleExtraConfigs = [],
+ finishedConfigs = [],
+ boxConfig = {},
+ } = state;
if (!slaveConfig) return "";
const { bBox } = selectedNode;
@@ -1287,15 +1320,21 @@ const BoxComponent = props => {
const { sBackProcessData = [] } = slaveRowData;
- const [downAbleConfigsNew, setDownAbleConfigsNew] = useState([]);
- useEffect(() => {
- setDownAbleConfigsNew(downAbleConfigs);
- }, [selectedNode.showName, boxModel, downAbleConfigs.length]);
+ const downAbleConfigsNew = downAbleConfigs.reduce((pre, cur) => {
+ const childConfigs = downAbleExtraConfigs.filter(item => item.sParentName === cur.showName);
+ pre.push(cur, ...childConfigs);
+ return pre;
+ }, []);
// 获取sType为2的
const downViewProps = {
...props,
- viewConfigs: downAbleConfigsNew.filter(item => item.sPartsName === boxModel || !item.sPartsName),
+ viewConfigs: downAbleConfigsNew
+ .filter(item => item.sPartsName === boxModel || !item.sPartsName)
+ .map(config => ({
+ ...config,
+ costomStyle: sBackProcessData.find(item => item[config.sName0 || config.sName])?.sParamConfig ? styles.sParamConfig : "",
+ })),
tableConfig: { ...slaveConfig, gdsconfigformslave: downAbleConfigsNew },
iColValueView: 24,
viewRow: slaveRowData,
@@ -1382,11 +1421,9 @@ const BoxComponent = props => {
{!child.sParentName ? (
}
- type="link"
+ type="primary"
onClick={() => {
- setDownAbleConfigsNew(pre => {
- const iIndex = pre.findIndex(item => item.sId === child.sId);
- const childLen = pre.filter(item => item.sParentName === child.showName).length;
+ props.setState(pre => {
const newSId = commonUtils.createSid();
const newConfig = {
...child,
@@ -1394,26 +1431,31 @@ const BoxComponent = props => {
sParentName: child.showName,
sName: `${child.sName}_${newSId}`,
};
- return [...pre.slice(0, iIndex + childLen + 1), newConfig, ...pre.slice(iIndex + childLen + 1)];
+ return {
+ ...pre,
+ downAbleExtraConfigs: [...downAbleExtraConfigs, newConfig],
+ };
});
}}
/>
) : (
}
- type="link"
+ type="primary"
+ danger
onClick={() => {
- setDownAbleConfigsNew(pre => {
- const iIndex = pre.findIndex(item => item.sId === child.sId);
- return [...pre.slice(0, iIndex), ...pre.slice(iIndex + 1)];
- });
-
- const slaveRowIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
props.setState(pre => {
+ const iIndex = downAbleExtraConfigs.findIndex(item => item.sId === child.sId);
+
+ const slaveRowIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
const { sBackProcessData = [] } = slaveData[slaveRowIndex];
- const iIndex = sBackProcessData.findIndex(item => item[child.sName]);
- slaveData[slaveRowIndex].sBackProcessData?.splice(iIndex, 1);
- return { ...pre, slaveData };
+ const iIndex1 = sBackProcessData.findIndex(item => item[child.sName]);
+ slaveData[slaveRowIndex].sBackProcessData?.splice(iIndex1, 1);
+ return {
+ ...pre,
+ downAbleExtraConfigs: [...downAbleExtraConfigs.slice(0, iIndex), ...downAbleExtraConfigs.slice(iIndex + 1)],
+ slaveData,
+ };
});
}}
/>
@@ -1421,6 +1463,20 @@ const BoxComponent = props => {
);
},
+ onCostomClick: (showConfig, { target }) => {
+ const className = target.getAttribute("class");
+ const nodeName = target.nodeName;
+ if (className?.includes("select") && nodeName === "DIV") return;
+
+ props.setState(pre => ({
+ ...pre,
+ backendParamsConfig: commonUtils.convertStrToObj(
+ sBackProcessData.find(item => item[showConfig.sName0 || showConfig.sName])?.sParamConfig,
+ []
+ ),
+ backendConfig: { sParentFieldsName: showConfig.sName, sBoxModel: boxModel },
+ }));
+ },
};
// 获取sType为3的
@@ -1724,7 +1780,7 @@ const BoxComponent = props => {
-
@@ -2334,4 +2390,79 @@ const BoxModelSelectedModal = props => {
);
};
+// 后道参数额外配置
+const BackendParamsExtraComponent = props => {
+ const { state, slaveConfig, boxModel } = props;
+ const { backendParamsConfig = [], backendConfig = {}, slaveData, selectedNode } = state;
+ if (!backendParamsConfig.length) return "";
+
+ const { sParentFieldsName, sBoxModel } = backendConfig;
+
+ const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === sBoxModel) || {};
+ const { sBackProcessData = [] } = slaveRowData;
+
+ const viewConfigs = backendParamsConfig.map((item, index) => ({
+ ...item,
+ sName: `sParams${index}`,
+ showName: item.sParam,
+ sDropDownType: "sql",
+ iColValue: 4,
+ }));
+
+ const viewProps = {
+ ...props,
+ viewConfigs: viewConfigs,
+ tableConfig: { ...slaveConfig, gdsconfigformslave: viewConfigs },
+ iColValueView: 24,
+ getViewRow: config => {
+ return sBackProcessData.find(item => item[sParentFieldsName])?.sBackendParams?.find(item => item.sParam === config.showName) || {};
+ },
+ tableName: `sBackendParams${boxModel}`,
+ getSqlDropDownData: (...args) => {
+ const showConfig = args[2];
+ const { sParamDropDown = "", sName } = showConfig;
+ const dropDownData = sParamDropDown.split(",");
+ if (dropDownData?.length) {
+ return {
+ dropDownData: dropDownData.map(item => ({
+ sId: commonUtils.createSid(),
+ value: item,
+ sParam: showConfig.sParam,
+ [sName]: item,
+ })),
+ totalPageCount: 1,
+ currentPageNo: 1,
+ conditonValues: {},
+ };
+ }
+
+ return props.getSqlDropDownData(...args);
+ },
+ onDataChange: (name, sFieldName, changeValue, sId, dropDownData, isWait) => {
+ const iIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
+ const iIndex1 = slaveData[iIndex].sBackProcessData.findIndex(item => item[sParentFieldsName]);
+ const dropDownDataSelected = dropDownData.find(item => item.sId === changeValue[sFieldName]);
+ const { sParam } = dropDownDataSelected;
+ const { sBackendParams = [] } = slaveData[iIndex].sBackProcessData[iIndex1];
+ const iIndex2 = sBackendParams.findIndex(item => item.sParam === sParam);
+ if (iIndex2 !== -1) {
+ sBackendParams[iIndex2] = dropDownDataSelected;
+ } else {
+ sBackendParams.push(dropDownDataSelected);
+ }
+ slaveData[iIndex].sBackProcessData[iIndex1].sBackendParams = sBackendParams;
+ props.setState(pre => ({ ...pre, slaveData }));
+ },
+ };
+
+ return (
+ <>
+
+
+
+
+ >
+ );
+};
+
export default QuickQuote;
diff --git a/src/components/QuickQuote/index.less b/src/components/QuickQuote/index.less
index f009e9e..e2481d7 100644
--- a/src/components/QuickQuote/index.less
+++ b/src/components/QuickQuote/index.less
@@ -101,6 +101,25 @@
}
}
+ }
+
+ .viewTableDownView,
+ .viewTableDownView1 {
+ :global {
+ .viewStyle {
+ padding-right: 14px;
+
+ .ant-form-item-label {
+ flex: 0 0 70px !important;
+ max-width: 70px !important;
+ }
+
+ .ant-form-item-control {
+ max-width: calc(100% - 95px);
+ }
+ }
+ }
+
.subViewTable {
width: 100%;
height: auto;
@@ -144,10 +163,12 @@
}
}
- .viewTableDownView {
+ .viewTableDownView1 {
:global {
.viewStyle {
- padding-right: 14px;
+ .ant-form-item-control {
+ max-width: calc(100% - 60px);
+ }
}
}
}
@@ -425,8 +446,8 @@
.downOperations {
position: absolute;
- top: -4px;
- right: -14px;
+ top: 6px;
+ right: 6px;
display: flex;
flex-direction: column;
z-index: 1;
@@ -442,4 +463,22 @@
}
}
}
+}
+
+.sParamConfig {
+ :global {
+ .ant-form-item-label {
+ label {
+ &::before {
+ content: '';
+ display: block;
+ width: 5px;
+ height: 5px;
+ border-radius: 50%;
+ background-color: #ff4d4f;
+ margin-right: 2px;
+ }
+ }
+ }
+ }
}
\ No newline at end of file