瀏覽代碼

拉料添加

dengrui 4 月之前
父節點
當前提交
1b1a9258cc
共有 2 個文件被更改,包括 48 次插入15 次删除
  1. 18 11
      src/api/process/index.ts
  2. 30 4
      src/views/process/components/transferNum.vue

+ 18 - 11
src/api/process/index.ts

@@ -59,17 +59,24 @@ export function maintenanceCheck(data: any) {
   });
 }
 
-export function querySeqInfo(workOrderCode: string,seqNo: string) {
-    return request({
-        url: "/api/v1/plan/seq/query/" + workOrderCode + "/" + seqNo,
-        method: "get",
-    });
+export function querySeqInfo(workOrderCode: string, seqNo: string) {
+  return request({
+    url: "/api/v1/plan/seq/query/" + workOrderCode + "/" + seqNo,
+    method: "get",
+  });
 }
 export function saveSeqInfo(data: any) {
-    return request({
-        url: "/api/v1/plan/seq/update",
-        method: "post",
-        data: data,
-    });
+  return request({
+    url: "/api/v1/plan/seq/update",
+    method: "post",
+    data: data,
+  });
+}
+//拉料
+export function getPull(data: any) {
+  return request({
+    url: "/api/v1/process/vehicleOperation/callSeq",
+    method: "post",
+    data: data,
+  });
 }
-

+ 30 - 4
src/views/process/components/transferNum.vue

@@ -39,10 +39,26 @@
                 >{{ item.seqNo }}</span
               >
             </el-tooltip>
-            <div :class="item.state == '2' ? 'status success' : 'status'">
-              {{
-                dictS.getLableByValue("station_task_state", String(item.state))
-              }}
+            <div
+              style="display: flex; flex-direction: column; align-items: end"
+            >
+              <div :class="item.state == '2' ? 'status success' : 'status'">
+                {{
+                  dictS.getLableByValue(
+                    "station_task_state",
+                    String(item.state)
+                  )
+                }}
+              </div>
+              <el-button
+                class="btn"
+                style="margin-bottom: 5px"
+                color="#0A59F7"
+                @click="pull(item.seqNo)"
+                v-if="item.state != '2'"
+              >
+                拉料
+              </el-button>
             </div>
           </div>
         </div>
@@ -54,11 +70,21 @@
 <script lang="ts" setup>
 import { useDictionaryStore, useProcessStore } from "@/store";
 import { Transition } from "vue";
+import { getPull } from "@/api/process";
 const refArray = ref([]);
 const store = useProcessStore();
 const dictS = useDictionaryStore();
 const selectSeqIndex = inject("selectSeqIndex");
 const selectSeqArray = inject("selectSeqArray");
+const pull = async (seq: string) => {
+  const { data, code } = await getPull({ seqNo: seq });
+  if (code == "200") {
+    ElMessage.success("拉料成功!");
+  } else {
+    ElMessage.error("拉料失败!");
+  }
+};
+
 const fz = (index: any) => {
   const text = refArray.value[index].textContent;
   copyTextUsingTextarea(text);