Jelajahi Sumber

1.添加调仓页面。2.返库逻辑修改。

jiaxiaoqiang 1 tahun lalu
induk
melakukan
f8774cbc06

+ 1 - 0
src/store/modules/common.ts

@@ -10,6 +10,7 @@ export const useCommonStore = defineStore("commonStore", {
     loadingMap: new Map<string, boolean>(),
     storageInOrderId: -1, // 入库界面的出库使用
     orderId: -1, // 出库后在检料位使用,派发后重置。
+    changeBoxType: 1, // 1: 入库,2:出库
   }),
   actions: {
     // 获取当前时间格式的函数

+ 26 - 23
src/views/prepare-complete-suit/components/first.vue

@@ -2,13 +2,13 @@
   <el-row :gutter="20">
     <el-col :span="5" class="elColClasss">
       <el-input
-        class="searchInput"
-        style="margin-bottom: 10px"
         v-model="seachInput"
+        class="searchInput"
         placeholder="搜索工单编号"
+        style="margin-bottom: 10px"
       >
-        <template #prefix> </template
-      ></el-input>
+        <template #prefix></template>
+      </el-input>
       <el-scrollbar class="scrollbarSty">
         <Order
           v-for="(item, index) in seachOrderData"
@@ -22,23 +22,22 @@
     </el-col>
     <el-col :span="5" class="elColClasss">
       <el-scrollbar>
-  
         <Steps
           :opsArray="opsArray"
-          @setstepindex="setSelectStepIndex"
           :selectStepIndex="selectStepIndex"
+          @setstepindex="setSelectStepIndex"
         />
       </el-scrollbar>
     </el-col>
     <el-col :span="14" class="elColClasss">
       <div class="rightCol">
         <div class="showTable">
-          <el-table id="table" :height="tableFlexHeight" :data="tableData">
-            <el-table-column prop="materialName" label="物料名称" width="180" />
-            <el-table-column prop="spec" label="规格" width="180" />
-            <el-table-column prop="totalMaterial" label="所需总数" />
-            <el-table-column prop="completeNum" label="已经装箱数量" />
-            <el-table-column prop="" label="还需装箱数量">
+          <el-table id="table" :data="tableData" :height="tableFlexHeight">
+            <el-table-column label="物料名称" prop="materialName" width="180" />
+            <el-table-column label="规格" prop="spec" width="180" />
+            <el-table-column label="所需总数" prop="totalMaterial" />
+            <el-table-column label="已经装箱数量" prop="completeNum" />
+            <el-table-column label="还需装箱数量" prop="">
               <template #default="scope">
                 <span
                   :class="
@@ -69,9 +68,9 @@
             </template>
           </el-table>
           <Pagination
-            :position="'right'"
-            :page="page"
             :limit="limit"
+            :page="page"
+            :position="'right'"
             :total="total"
             @pagination="getPagination"
           />
@@ -84,21 +83,22 @@
   </el-row>
   <div class="scanBox">
     <el-button
-      type="primary"
       :disabled="disabled"
-      @click="openPop('扫描料箱')"
       plain
-      >扫描料箱</el-button
-    >
+      type="primary"
+      @click="openPop('扫描料箱')"
+      >扫描料箱
+    </el-button>
   </div>
   <Transition>
     <ScanCode
       v-model="modelValue"
-      :title="scanCodeTitle"
       :operationId="operationId"
+      :title="scanCodeTitle"
       :workOrderCode="workOrderCode"
       @gettable="getTableData"
-  /></Transition>
+    />
+  </Transition>
   <Transition>
     <ShowInfo
       :key="showInfoKey"
@@ -116,11 +116,12 @@ import Steps from "./steps.vue";
 import ScanCode from "../firstPopUpView/scanCode.vue";
 import ShowInfo from "../firstPopUpView/showInfo.vue";
 import {
+  getBoxInfo,
+  getListData,
   getStation,
   workOrderPage,
-  getListData,
-  getBoxInfo,
 } from "@/api/prepare";
+
 const orderData = ref([]);
 const opsArray = ref([]);
 const tableData = ref([]);
@@ -250,7 +251,7 @@ watch(infoModelValue, () => {
 }
 
 .scanBox {
-  width: calc(100vw - 942px);
+  width: calc(100vw - 1342px);
   height: 80px;
   position: fixed;
   right: 24px;
@@ -273,6 +274,7 @@ watch(infoModelValue, () => {
 
 .elColClasss {
   padding-bottom: 69px;
+
   .rightCol {
     display: flex;
     flex-direction: column;
@@ -302,6 +304,7 @@ watch(infoModelValue, () => {
     }
   }
 }
+
 .scrollbarSty {
   height: calc(100vh - 260px);
 }

+ 8 - 1
src/views/prepare-complete-suit/index.vue

@@ -27,6 +27,13 @@
           </div>
         </Transition>
       </el-tab-pane>
+      <el-tab-pane label="调仓" name="tiaocang">
+        <Transition name="tab">
+          <div v-if="activeName == 'tiaocang'" class="contentBox">
+            <StorageChange />
+          </div>
+        </Transition>
+      </el-tab-pane>
     </el-tabs>
   </div>
 </template>
@@ -35,8 +42,8 @@
 import First from "./components/first.vue";
 import StorageOut from "@/views/storage-out/index.vue";
 import StorageIn from "@/views/storage-in/index.vue";
-import Third from "./components/third.vue";
 import { TabsPaneContext } from "element-plus";
+import StorageChange from "@/views/storage-change/index.vue";
 
 const activeName = ref("first");
 const handleClick = (tab: TabsPaneContext, event: Event) => {};

+ 7 - 0
src/views/storage-change/index.vue

@@ -0,0 +1,7 @@
+<template>
+  <div>src/views/storage-change /index</div>
+</template>
+
+<script lang="ts" setup></script>
+
+<style lang="scss" scoped></style>

+ 29 - 19
src/views/storage-out/index.vue

@@ -171,6 +171,7 @@ const sureToOut = async () => {
     houseNo: currentBox.value.houseNo,
   });
   commonS.orderId = res.data.orderId;
+  commonS.changeBoxType = 2; // 2出库
   ElMessage.success("出库成功,等待料箱到达捡料位置");
   checkHasOuting();
 };
@@ -193,23 +194,27 @@ const checkHasOuting = () => {
               clearInterval(outInterval);
               commonS.orderId = -1;
 
-              outingBox.value = { ...res.data };
-              toSendBoxInfo.value = { ...outingBox.value }; //默认派发出库的盒子,如果返库了,扫码物料上方的载具信息则需要重新获取
               // 同时也刷新左侧列表数据
               getStorageBoxesList({}).then((res: any) => {
                 boxesList.value = res.data;
               });
-              if (res.data.detailsList.length > 0) {
-                outingMaterials.value = outingBox.value.detailsList;
-                outingRawBoxList = JSON.parse(
-                  JSON.stringify(outingBox.value.detailsList)
-                );
-                materialList.value = JSON.parse(
-                  JSON.stringify(outingBox.value.detailsList)
-                );
-              } else {
-                outingRawBoxList = [];
-                outingMaterials.value = [];
+
+              if (commonS.changeBoxType === 2) {
+                outingBox.value = { ...res.data };
+                toSendBoxInfo.value = { ...outingBox.value }; //默认派发出库的盒子,如果返库了,扫码物料上方的载具信息则需要重新获取
+
+                if (res.data.detailsList.length > 0) {
+                  outingMaterials.value = outingBox.value.detailsList;
+                  outingRawBoxList = JSON.parse(
+                    JSON.stringify(outingBox.value.detailsList)
+                  );
+                  materialList.value = JSON.parse(
+                    JSON.stringify(outingBox.value.detailsList)
+                  );
+                } else {
+                  outingRawBoxList = [];
+                  outingMaterials.value = [];
+                }
               }
             }
           } else {
@@ -225,21 +230,26 @@ const checkHasOuting = () => {
 };
 const backToStorage = async () => {
   console.log("back to storage");
-  await backToStorageAPI({
-    vehicleCode: outingBox.value.vehicleNo,
+  let res: any = await backToStorageAPI({
+    vehicleCode: outingBox.value.vehicleCode,
     houseNo: outingBox.value.houseNo,
     detailsList: outingMaterials.value,
   });
+  commonS.orderId = res.data.orderId;
+  commonS.changeBoxType = 1; // 2出库
+
+  ElMessage.success("返库成功,等待料箱到达");
+  checkHasOuting();
   outingBox.value = {};
   toSendBoxInfo.value = {};
   outingMaterials.value = [];
-  ElMessage.success("返库成功");
+
   currentBox.value = {};
   currentBoxIndex.value = -1;
   boxSearch.value = "";
-  getStorageBoxesList({}).then((res: any) => {
-    boxesList.value = res.data;
-  });
+  // getStorageBoxesList({}).then((res: any) => {
+  //   boxesList.value = res.data;
+  // });
 };
 
 // 物料