Ver Fonte

作业日志获取operationType为9或者10就禁止操作按钮

pm há 3 meses atrás
pai
commit
6ac615874d
1 ficheiros alterados com 18 adições e 20 exclusões
  1. 18 20
      src/views/mes/job/jobm/NewMarsJob.vue

+ 18 - 20
src/views/mes/job/jobm/NewMarsJob.vue

@@ -443,12 +443,13 @@
               </div>
             </el-tab-pane>
           </el-tabs>
-          <el-button style="float: right" type="primary" @click="finshJobticket"
+          <el-button style="float: right" type="primary" @click="finshJobticket"  :disabled="operationTypeVisible"
           >结束作业
           </el-button>
           <el-button
             style="float: right; margin-right: 10px"
             type="danger"
+            :disabled="operationTypeVisible"
             @click="cancelJobticket"
           >取消作业
           </el-button>
@@ -928,6 +929,7 @@ export default {
   dicts: ['sop_type', 'ticket_status', 'ticket_user_type'],
   data() {
     return {
+      operationTypeVisible: false,//控制作业日志如果是取消作业或者结束作业 9/10就禁止点击按钮
       ticketVisible: false,//正在进行作业票的弹窗标记
       currentWorkstationId: null,//当前点击的岗位Id
       currentWorkstationName: null,//当前点击的岗位的名称
@@ -1657,7 +1659,7 @@ export default {
       const code= this.ticketId;
       const address='sys.websocket.address'
       getIsSystemAttributeByKey(address).then((res) => {
-        // console.log(res, 'websocket地址');
+        console.log(res, 'websocket地址');
         this.websocketAddress = res.data.sysAttrValue
         const isLocalDev = window.location.hostname === 'localhost'
 
@@ -1669,7 +1671,15 @@ export default {
           { w: 'S' },
           async (res) => {
             console.log(res, 'websocket接收服务器的作业日志数据');
-            if (res !== 'heartbeat') {
+            const parts = res.split('operationType=');
+            if (parts.length > 1) {
+              const operationTypeStr = parts[1].split(',')[0]; // Get the part before the next comma
+              console.log("operationType =", operationTypeStr);
+              if(operationTypeStr=='9'||operationTypeStr=='10'){
+                this.operationTypeVisible=true
+              }
+            }
+              if (res !== 'heartbeat') {
               // 判断是否需要弹窗显示
               await this.onNewSocketLog(res);  // 👈传入最新的 WebSocket 消息
               await this.getJoblogs(); // 抽出专用接口函数
@@ -1687,13 +1697,14 @@ export default {
 
   //   查询作业日志接口获取
     async getJoblogs() {
+      console.log(this.ticketId,'aaaa')
       const joblogdata = {
         ticketId: this.ticketId,
         current: 1,
         size: -1,
       };
       const res = await getIsTicketOperLogPage(joblogdata);
-      // console.log('接口返回日志:', res.data.records);
+      console.log('接口返回日志:', res.data.records);
       this.joblogList = res.data.records;
       // ✨强制刷新筛选后的列表
       this.filterJoblogs();
@@ -1908,7 +1919,7 @@ div[ref="mapContainer"] {
     //background: greenyellow;
     .joblogTop{
       width: 100%;
-      height: 600px;
+      height: 580px;
       margin: auto;
       overflow-y: auto;
       //background: cadetblue;
@@ -1919,10 +1930,11 @@ div[ref="mapContainer"] {
     }
     .bottomCheck{
       width:100%;
-      height: 50px;
+      height: 80px;
       line-height: 50px;
       font-size: 23px;
       display: flex;
+      padding: 5px 0;
       margin: auto;
       //background: forestgreen;
 
@@ -1930,20 +1942,6 @@ div[ref="mapContainer"] {
         font-size: 23px; /* 字体大小 */
       }
 
-      /* 调整实际复选框的大小 */
-      //.big-checkbox >>> .el-checkbox__inner {
-      //  width: 25px;
-      //  height: 25px;
-      //}
-      .big-checkbox ::v-deep(.el-checkbox__inner) {
-        width: 25px;
-        height: 25px;
-      }
-
-      .big-checkbox >>> .el-checkbox__label {
-        font-size: 23px;
-        padding-left: 8px;
-      }
     }