songshankun
2023-10-08 d13e81614e75fce2f4cc7b08dbd477219339c808
src/components/TaskControlModal.vue
@@ -74,7 +74,7 @@
                  客户名称:{{ currentTaskData.Order.customer || "" }}
                </div>
                <div class="title-item title-item-two">
                  货物描述: {{ currentTaskData.Order.orderAttr || "" }}
                  通道: {{ channelNameConfig[currentTaskData.Channel] || "" }}
                </div>
                <div class="title-item title-item-two">
@@ -101,6 +101,14 @@
                  {{ item.Key }}:{{ item.Value || "" }}
                </div>
              </div>
            </div>
            <div class="process-err-tip" v-if="getProcessParamsErrMsg">
              <div class="tip-icon">
                <span class="el-icon-error color_error"></span>
              </div>
              <div class="tip-content">
                提示: {{getProcessParamsErrMsg}}
              </div>
            </div>
            <div class="process-box" v-if="showBtn === 2 || showBtn === 3">
@@ -158,7 +166,7 @@
      </div>
      <div slot="footer" :class="messageError?'dialog-footer tac btn-error':'dialog-footer tac'"
           style="overflow: hidden">
        <template v-if="messageError">
        <template v-if="messageError || getProcessParamsErrMsg">
          <div class="btn" v-if="messageError ==='下发成功!'||getProcessParamsErrMsg" @click="closeClick">
            <img src="../../public/close-btn.png"/>
          </div>
@@ -228,13 +236,18 @@
      showBtn: 1,
      num: 0,
      timer: null,
      safeProduce:'',
      safeProduce: '',
      message: this.safeProduce,
      messageError: "",
      resParams: {},
      isLoading: false,
      second: 0,
      secondTimer: null,
      // 通道名称配置 Channel 0 对应展示 0, Channel 1 对应展示 A,暂时忽略其余情况
      channelNameConfig: {
        0: '0',
        1: 'A'
      }
    };
  },
  mounted() {
@@ -271,10 +284,6 @@
    }
  },
  watch: {
    taskData(val) {
      this.message = this.safeProduce;
      this.getInfo();
    },
    num() {
      if (this.num === 30) {
        clearInterval(this.timer);
@@ -291,6 +300,9 @@
      if (this.timer) {
        clearInterval(this.timer);
      }
      if (this.secondTimer) {
        clearInterval(this.secondTimer)
      }
      this.num = 0;
      this.showBtn = 1;
      this.isLoading = false
@@ -298,7 +310,7 @@
      this.secondTimer = null
      this.messageError = ''
      this.resParams = {};
      if (newVal){
      if (newVal) {
        this.getTaskList().then(() => {
          const firstData = this.taskList[0]
          const id = firstData?.Procedure?.ID
@@ -357,12 +369,20 @@
        startTask({id}).then((res) => {
          if (res.code === 200) {
            this.currentProcessParams = res.data.Params ?? []
            this.getProcessParamsErrMsg =''
          } else {
            this.currentProcessParams = []
            this.getProcessParamsErrMsg = res.msg ?? '获取工艺参数失败!';
          }
          this.getInfo()
        },err=>{
          console.error(err)
          this.currentProcessParams = []
          this.getProcessParamsErrMsg = '获取工艺参数失败!'
        });
      }
    },
    /**
     * 前翻页
     */
@@ -399,9 +419,6 @@
        this.show = true;
      } else {
        this.show = false;
      }
      if (this.getProcessParamsErrMsg) {
        this.messageError = this.getProcessParamsErrMsg;
      }
    },
    getDateObj(date, fmt) {
@@ -470,9 +487,10 @@
          }
        }, err => {
          console.error(err)
        }).finally(() => {
          this.isLoading = false
        });
        setTimeout(() => {
          this.isLoading = false;
        }, 30000)
      }
    },
    getCode(res) {
@@ -920,4 +938,28 @@
    font-size: 16px;
  }
}
.process-err-tip{
  box-sizing: border-box;
  padding-top: 10px;
  height: 160px;
  width: 100%;
  .tip-icon{
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;
    .el-icon-error{
      font-size: 70px;
    }
  }
  .tip-content{
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    font-weight: 500;
  }
}
</style>