Commit 62fe6076329a34fe6c64a3dc728cf9828664f867
1 parent
aac55454
机台任务开工按钮展示与禁用
Showing
1 changed file
with
18 additions
and
5 deletions
src/mes/scheduledTasks/machineTasks/index.js
| ... | ... | @@ -565,7 +565,7 @@ const MachineTasks = baseProps => { |
| 565 | 565 | }, |
| 566 | 566 | tableBtnsConfig: params => { |
| 567 | 567 | const { record, index } = params; |
| 568 | - const { iStar, bManual } = record; | |
| 568 | + const { iStar, bManual , bSample} = record; | |
| 569 | 569 | |
| 570 | 570 | let showName, btnBgColor, sDefault, finishBtnBgColor, finishSdefault; |
| 571 | 571 | if (iStar === 1) { |
| ... | ... | @@ -595,9 +595,20 @@ const MachineTasks = baseProps => { |
| 595 | 595 | finishBtnBgColor = "#1890FF" |
| 596 | 596 | finishSdefault = "${true}"; |
| 597 | 597 | } |
| 598 | + let otherConfigs = { | |
| 599 | + ...otherConfig, | |
| 600 | + btnBgColor: "#1890FF", | |
| 601 | + } | |
| 598 | 602 | |
| 603 | + if (bSample) { | |
| 604 | + otherConfigs = { | |
| 605 | + ...otherConfigs, | |
| 606 | + sDefault: "${true}", | |
| 607 | + btnBgColor: "#AAA" | |
| 608 | + } | |
| 609 | + } | |
| 599 | 610 | const outPut = bManual ? [actProduceReportConfig, |
| 600 | - { showName: "完工", btnBgColor: finishBtnBgColor, sDefault: finishSdefault }] : [otherConfig, { showName, btnBgColor, sDefault, startWorkConfig, pauseWorkConfig }, | |
| 611 | + { showName: "完工", btnBgColor: finishBtnBgColor, sDefault: finishSdefault }] : [otherConfigs, { showName, btnBgColor, sDefault, startWorkConfig, pauseWorkConfig }, | |
| 601 | 612 | { showName: "完工", btnBgColor: finishBtnBgColor, sDefault: finishSdefault }] |
| 602 | 613 | return [ |
| 603 | 614 | ...outPut, |
| ... | ... | @@ -606,12 +617,14 @@ const MachineTasks = baseProps => { |
| 606 | 617 | ]; |
| 607 | 618 | }, |
| 608 | 619 | onTableBtnClick: item => { |
| 609 | - if (item.config.sControlName.includes("BtnTableSample")) { | |
| 610 | - const { sInstruct } = item.config; | |
| 620 | + if (item?.config?.sControlName?.includes("BtnTableSample")) { | |
| 621 | + const { bSample } = item?.record | |
| 622 | + if (bSample) return | |
| 623 | + const { sInstruct } = item?.config; | |
| 611 | 624 | if (sInstruct) { |
| 612 | 625 | props.onExecInstructSet({ |
| 613 | 626 | ...props, |
| 614 | - btnConfig: item.config | |
| 627 | + btnConfig: item?.config | |
| 615 | 628 | }); |
| 616 | 629 | } |
| 617 | 630 | ... | ... |