Commit 62fe6076329a34fe6c64a3dc728cf9828664f867

Authored by chenxt
1 parent aac55454

机台任务开工按钮展示与禁用

src/mes/scheduledTasks/machineTasks/index.js
@@ -565,7 +565,7 @@ const MachineTasks = baseProps => { @@ -565,7 +565,7 @@ const MachineTasks = baseProps => {
565 }, 565 },
566 tableBtnsConfig: params => { 566 tableBtnsConfig: params => {
567 const { record, index } = params; 567 const { record, index } = params;
568 - const { iStar, bManual } = record; 568 + const { iStar, bManual , bSample} = record;
569 569
570 let showName, btnBgColor, sDefault, finishBtnBgColor, finishSdefault; 570 let showName, btnBgColor, sDefault, finishBtnBgColor, finishSdefault;
571 if (iStar === 1) { 571 if (iStar === 1) {
@@ -595,9 +595,20 @@ const MachineTasks = baseProps => { @@ -595,9 +595,20 @@ const MachineTasks = baseProps => {
595 finishBtnBgColor = "#1890FF" 595 finishBtnBgColor = "#1890FF"
596 finishSdefault = "${true}"; 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 const outPut = bManual ? [actProduceReportConfig, 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 { showName: "完工", btnBgColor: finishBtnBgColor, sDefault: finishSdefault }] 612 { showName: "完工", btnBgColor: finishBtnBgColor, sDefault: finishSdefault }]
602 return [ 613 return [
603 ...outPut, 614 ...outPut,
@@ -606,12 +617,14 @@ const MachineTasks = baseProps => { @@ -606,12 +617,14 @@ const MachineTasks = baseProps => {
606 ]; 617 ];
607 }, 618 },
608 onTableBtnClick: item => { 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 if (sInstruct) { 624 if (sInstruct) {
612 props.onExecInstructSet({ 625 props.onExecInstructSet({
613 ...props, 626 ...props,
614 - btnConfig: item.config 627 + btnConfig: item?.config
615 }); 628 });
616 } 629 }
617 630