瀏覽代碼

添加批量报工

qinhb 11 月之前
父節點
當前提交
51b730e2cc
共有 2 個文件被更改,包括 36 次插入2 次删除
  1. 7 0
      src/api/prosteps/index.ts
  2. 29 2
      src/views/pro-operation/report-work/index.vue

+ 7 - 0
src/api/prosteps/index.ts

@@ -22,3 +22,10 @@ export function getProcessInfo(id: any) {
     method: "get",
   });
 }
+// 获取当前工序未报工的流水号
+export function getunProcessedList(processId: string) {
+  return request({
+    url: `/api/v1/process/info/queryCanReportSeq/${processId}`,
+    method: "get",
+  });
+}

+ 29 - 2
src/views/pro-operation/report-work/index.vue

@@ -20,6 +20,24 @@
             label-width="auto"
             size="large"
           >
+            <el-select
+                v-if="processStore.scanInfo.batchReport == 1"
+                v-model="selectedProcess"
+                :filterable="true"
+                multiple
+                placeholder="请选择流转卡号,可以输入或者扫码筛选"
+                style="margin-bottom: 20px"
+            >
+              <template #prefix
+              ><img src="@/assets/icons/shaoma.svg"
+              /></template>
+              <el-option
+                  v-for="item in processList"
+                  :key="item"
+                  :label="item"
+                  :value="item"
+              />
+            </el-select>
             <el-row
               v-for="(per, index) in persons"
               :key="per.userName"
@@ -102,7 +120,7 @@
 <script lang="ts" setup>
 import { useProcessStore } from "@/store/modules/processView";
 import { useDictionaryStore } from "@/store/modules/dictionary";
-import { getProcessInfo } from "@/api/prosteps";
+import { getProcessInfo,getunProcessedList } from "@/api/prosteps";
 import { emitter, EventsNames } from "@/utils/common";
 import { CirclePlus, Remove } from "@element-plus/icons-vue";
 import { useUserStore } from "@/store/modules/user";
@@ -111,7 +129,9 @@ import { reportWork } from "@/api/process/reportBreak";
 const processStore = useProcessStore();
 const dictStroe = useDictionaryStore();
 const userStore = useUserStore();
-
+// ================= 选择工序相关
+const selectedProcess = ref<any[]>([]);
+const processList = ref<any[]>([]);
 const router = useRouter();
 
 const drawerVisible = ref(false);
@@ -139,7 +159,13 @@ const openReportWorkDrawer = () => {
       drawerVisible.value = true;
       formDisabled.value = false;
     }
+    if (processStore.scanInfo.batchReport === 1) {
+      getunProcessedList(processStore.scanInfo.id).then((res: any) => {
+        processList.value = res.data ?? [];
+      });
+    }
   });
+
 };
 
 const cancelClick = () => {
@@ -159,6 +185,7 @@ const confirmClick = () => {
   let params = {
     processId: processStore.scanInfo.id,
     processUserReportList: persons.value,
+    seqList: selectedProcess.value,
   };
 
   reportWork(params).then((res: any) => {