haoxuan
2023-10-11 a1a6630f2eabfc78a379b5808b1bf7231a084d0b
src/components/TaskControlModal.vue
@@ -160,9 +160,9 @@
          </template>
        </div>
        <!--左翻页按钮-->
        <div v-show="showPreviousTaskBtn" class="paginator-btn previous" @click="previousTask">&lt;</div>
        <div v-show="showPreviousTaskBtn" class="paginator-btn previous" :class="{disabled:showBtn ===2 ||messageError}" @click="previousTask">&lt;</div>
        <!--右翻页按钮-->
        <div v-show="showNextTaskBtn" class="paginator-btn next" @click="nextTask">&gt;</div>
        <div v-show="showNextTaskBtn" class="paginator-btn next" :class="{disabled:showBtn ===2 ||messageError}" @click="nextTask">&gt;</div>
      </div>
      <div slot="footer" :class="messageError?'dialog-footer tac btn-error':'dialog-footer tac'"
           style="overflow: hidden">
@@ -212,6 +212,7 @@
<script>
import {getTaskInfo, sendProcessParams, startTask,} from "@/api/home"; // 产线
import {channelNameConfig} from "@/common/constants";
export default {
  name: 'TaskControlModal',
  components: {},
@@ -243,11 +244,7 @@
      isLoading: false,
      second: 0,
      secondTimer: null,
      // 通道名称配置 Channel 0 对应展示 0, Channel 1 对应展示 A,暂时忽略其余情况
      channelNameConfig: {
        0: '0',
        1: 'A'
      }
      channelNameConfig: channelNameConfig
    };
  },
  mounted() {
@@ -366,6 +363,8 @@
    getCurrentTaskProduceParams(id) {
      // const id = this.currentTaskData?.Procedure?.ID
      if (id) {
        this.currentProcessParams = []
        this.getProcessParamsErrMsg = ""
        startTask({id}).then((res) => {
          if (res.code === 200) {
            this.currentProcessParams = res.data.Params ?? []
@@ -387,6 +386,10 @@
     * 前翻页
     */
    previousTask() {
      // 生产准备倒计时中和下发失败禁止翻页
      if (this.showBtn === 2 || this.messageError){
        return
      }
      if (this.currentTaskIndex - 1 >= 0) {
        this.currentTaskIndex -= 1
        this.$nextTick(() => {
@@ -401,6 +404,10 @@
     * 后翻页
     */
    nextTask() {
      // 生产准备倒计时中和下发失败禁止翻页
      if (this.showBtn === 2 || this.messageError){
        return
      }
      if (this.currentTaskIndex + 1 <= this.taskList.length - 1) {
        this.currentTaskIndex += 1
        this.$nextTick(() => {
@@ -416,7 +423,7 @@
      if (this.currentTaskData?.Procedure?.ID && this.currentTaskData?.Procedure?.Status === 1) {
        this.num = 0;
        this.showBtn = 1;
        this.show = true;
        // this.show = true;
      } else {
        this.show = false;
      }
@@ -917,6 +924,12 @@
  &.next {
    right: -60px;
    padding-left: 4px;
  }
  &.disabled{
    background-color: #cccccc;
    opacity: 0.8;
    cursor: not-allowed;
  }
}
@@ -937,6 +950,7 @@
    color: #ffffffaa;
    font-size: 16px;
  }
}
.process-err-tip{
  box-sizing: border-box;