浏览代码

feat:增加开工暂停

lupeng 2 天之前
父节点
当前提交
1d5d8a2756
共有 2 个文件被更改,包括 26 次插入1 次删除
  1. 8 0
      src/api/process/index.ts
  2. 18 1
      src/views/pro-steps/index.vue

+ 8 - 0
src/api/process/index.ts

@@ -102,6 +102,14 @@ export function getJYNum(workOrderCode: any) {
   });
 }
 
+export function updatePause(data: any) {
+    return request({
+        url: `/api/v1/process/info/updatePause`,
+        method: "post",
+        data: data
+    });
+}
+
 export function sendJYData(data: any) {
   return request({
     url: `/api/v1/plan/workOrder/updateCheckCode`,

+ 18 - 1
src/views/pro-steps/index.vue

@@ -8,6 +8,10 @@
       </div>
       <div class="info">
         <div class="item">
+          <el-button type="primary" size="small" v-if="startWork===0" @click="pauseChange">暂停</el-button>
+          <el-button type="success" size="small" v-if="startWork===1" @click="pauseChange">开工</el-button>
+        </div>
+        <div class="item">
           当前工序:
           {{
             store.scanInfo.operationName ? store.scanInfo.operationName : "-"
@@ -38,7 +42,7 @@
         </div>
       </div>
     </div>
-    <div class="mainContentBox">
+    <div class="mainContentBox" :style="{ pointerEvents: startWork===1 ? 'none' : 'auto' }">
       <el-row :gutter="20">
         <el-col :span="4" class="boxStyle">
           <!-- 侧边栏盒子 -->
@@ -91,6 +95,7 @@
 import OperationBar from "@/views/pro-steps/operationBar.vue";
 import { useProcessStore } from "@/store";
 import { getOpCompent } from "@/api/prosteps";
+import {updatePause} from "@/api/process";
 defineOptions({ name: "ProSteps" });
 const store = useProcessStore();
 const key = ref(false);
@@ -101,6 +106,8 @@ const recondOPId = ref(null);
 const qrCode = ref(null);
 //配置标签信息Data
 const stepComponents = ref([]);
+const startWork =ref(store.scanInfo.isPause);
+
 const defaultComponents = [
   {
     compentName: "物料采集",
@@ -212,6 +219,16 @@ const getOpCompentArray = async () => {
 const setSelectIndex = (index) => {
   selectIndex.value = index;
 };
+
+const pauseChange=()=>{
+  updatePause({id:store.scanInfo.id}).then(
+      (res)=>{
+         if(res.code==='200'){
+           startWork.value=res.data.isPause
+         }
+      }
+  )
+}
 // const setSelectTag = () => {
 //   const nowRouteName = route.name;
 //   stepComponents.value.forEach((item, index) => {