diff --git a/src/mes/scheduledTasks/machineTasks/index.js b/src/mes/scheduledTasks/machineTasks/index.js index 80ccde8..1271f7a 100644 --- a/src/mes/scheduledTasks/machineTasks/index.js +++ b/src/mes/scheduledTasks/machineTasks/index.js @@ -565,7 +565,7 @@ const MachineTasks = baseProps => { }, tableBtnsConfig: params => { const { record, index } = params; - const { iStar, bManual } = record; + const { iStar, bManual , bSample} = record; let showName, btnBgColor, sDefault, finishBtnBgColor, finishSdefault; if (iStar === 1) { @@ -595,9 +595,20 @@ const MachineTasks = baseProps => { finishBtnBgColor = "#1890FF" finishSdefault = "${true}"; } + let otherConfigs = { + ...otherConfig, + btnBgColor: "#1890FF", + } + if (bSample) { + otherConfigs = { + ...otherConfigs, + sDefault: "${true}", + btnBgColor: "#AAA" + } + } const outPut = bManual ? [actProduceReportConfig, - { showName: "完工", btnBgColor: finishBtnBgColor, sDefault: finishSdefault }] : [otherConfig, { showName, btnBgColor, sDefault, startWorkConfig, pauseWorkConfig }, + { showName: "完工", btnBgColor: finishBtnBgColor, sDefault: finishSdefault }] : [otherConfigs, { showName, btnBgColor, sDefault, startWorkConfig, pauseWorkConfig }, { showName: "完工", btnBgColor: finishBtnBgColor, sDefault: finishSdefault }] return [ ...outPut, @@ -606,12 +617,14 @@ const MachineTasks = baseProps => { ]; }, onTableBtnClick: item => { - if (item.config.sControlName.includes("BtnTableSample")) { - const { sInstruct } = item.config; + if (item?.config?.sControlName?.includes("BtnTableSample")) { + const { bSample } = item?.record + if (bSample) return + const { sInstruct } = item?.config; if (sInstruct) { props.onExecInstructSet({ ...props, - btnConfig: item.config + btnConfig: item?.config }); }