Ver código fonte

1.报工增加可以选择多个物流卡号

jiaxiaoqiang 10 meses atrás
pai
commit
bbded2e738

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

@@ -11,6 +11,7 @@ export function getOpCompent(queryPath: any) {
     method: "get",
   });
 }
+
 /**
  * 通过生产ID获取生产过程详情
  *
@@ -22,3 +23,11 @@ export function getProcessInfo(id: any) {
     method: "get",
   });
 }
+
+// 获取当前工序未报工的流水号
+export function getunProcessedList(processId: string) {
+  return request({
+    url: `/api/v1/process/info/queryCanReportSeq/${processId}`,
+    method: "get",
+  });
+}

+ 3 - 3
src/views/login/index.vue

@@ -376,9 +376,9 @@ onMounted?.(() => {
 </script>
 
 <style lang="scss" scoped>
-html.dark .login-container {
-  background: url("@/assets/images/login-bg.png") no-repeat center right;
-}
+//html.dark .login-container {
+//  //background: url("@/assets/images/login-bg.png") no-repeat center right;
+//}
 
 .login-container {
   overflow-y: auto;

+ 33 - 3
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"
@@ -85,8 +103,8 @@
     <template #footer>
       <div class="bottom-btns">
         <el-button class="cancelBtn el-button-big" @click="cancelClick"
-          >取消</el-button
-        >
+          >取消
+        </el-button>
         <el-button
           v-if="!formDisabled"
           class="sureBtn el-button-big"
@@ -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";
@@ -127,6 +145,7 @@ const persons = ref<
 >([{ userName: userStore.user.username ?? "", workingHoursRate: 100 }]);
 
 const openReportWorkDrawer = () => {
+  selectedProcess.value = []; //需要清空已经选择的流转卡号
   getProcessInfo(processStore.scanInfo.id).then((res) => {
     processStore.scanInfo.currentState = res.data.currentState;
     if (res.data.currentState !== "start") {
@@ -140,6 +159,12 @@ const openReportWorkDrawer = () => {
       formDisabled.value = false;
     }
   });
+
+  if (processStore.scanInfo.batchReport === 1) {
+    getunProcessedList(processStore.scanInfo.id).then((res: any) => {
+      processList.value = res.data ?? [];
+    });
+  }
 };
 
 const cancelClick = () => {
@@ -159,6 +184,7 @@ const confirmClick = () => {
   let params = {
     processId: processStore.scanInfo.id,
     processUserReportList: persons.value,
+    seqList: selectedProcess.value,
   };
 
   reportWork(params).then((res: any) => {
@@ -189,6 +215,10 @@ const rateArray: { label: string; value: number }[] = [
   { label: "90%", value: 90 },
   { label: "100%", value: 100 },
 ];
+
+// ================= 选择工序相关
+const selectedProcess = ref<any[]>([]);
+const processList = ref<any[]>([]);
 </script>
 
 <style lang="scss" scoped>