فهرست منبع

feature/物料采集添加参数

dy 11 ماه پیش
والد
کامیت
437b70e6bd
4فایلهای تغییر یافته به همراه70 افزوده شده و 3 حذف شده
  1. 3 0
      .vscode/settings.json
  2. 7 0
      src/api/prepare/index.ts
  3. 1 0
      src/views/pro-steps/components/wuliaocaiji.vue
  4. 59 3
      src/views/storage-in/index.vue

+ 3 - 0
.vscode/settings.json

@@ -77,4 +77,7 @@
   "i18n-ally.localesPaths": [
     "src/lang"
   ],
+  "[vue]": {
+    "editor.defaultFormatter": "esbenp.prettier-vscode"
+  },
 }

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

@@ -70,3 +70,10 @@ export function addOperation(data: any) {
     data,
   });
 }
+//扫盒子
+export function getVehicleInfo(id: any) {
+  return request({
+    url: "/api/v1/wms/vehicle/getVehicleInfo/" + `${id}`,
+    method: "get",
+  });
+}

+ 1 - 0
src/views/pro-steps/components/wuliaocaiji.vue

@@ -140,6 +140,7 @@ const getOpCompentData = async () => {
     operationId: store.odersData.operationId,
     workOrderCode: store.odersData.workOrderCode,
     seqNo: store.scanInfo.seqNo,
+    processId: store.scanInfo.id,
     pageNo: 1,
     pageSize: 9999,
   });

+ 59 - 3
src/views/storage-in/index.vue

@@ -9,7 +9,7 @@
           :showSuffix="true"
           placeholder="请扫描或输入料箱编号"
           @keyup.enter="enterBox"
-          :disabled="outStatus"
+          :disabled="outStatus || addStatus"
         />
         <el-scrollbar class="boxes-container base-container">
           <div
@@ -33,7 +33,7 @@
         <el-button
           class="sureBtn"
           type="primary"
-          :disabled="outStatus"
+          :disabled="outStatus || addStatus"
           @click="sureToOut"
           >出库
         </el-button>
@@ -41,6 +41,25 @@
       <el-col :span="8">
         <div class="type-title">盒内原有物料</div>
         <el-scrollbar class="outing-container">
+          <div v-if="!outStatus">
+            <div class="addbox" v-if="addSuccessStatus">
+              扫码的盒子编码:{{ addBoxInfo.code }}
+            </div>
+            <ScanCodeInput
+              v-if="addStatus && addSuccessStatus == false"
+              v-model="addBoxSearch"
+              :clearable="true"
+              :showSuffix="true"
+              placeholder="请扫描或输入料箱编号"
+              @keyup.enter="addenterBox"
+            />
+            <el-button
+              class="sureBtn"
+              :type="addStatus ? 'info' : 'primary'"
+              @click="changeAddStatus"
+              >{{ addStatus ? "取消" : "入库新载具" }}
+            </el-button>
+          </div>
           <div
             v-for="(material, index) in outingMaterials"
             :key="index"
@@ -66,7 +85,7 @@
           </div>
         </el-scrollbar>
         <el-button class="sureBtn" type="info" @click="backToStorage"
-          >
+          >
         </el-button>
       </el-col>
       <el-col :span="8">
@@ -108,6 +127,7 @@ import {
   getDestinationList,
   getMaterialInfoByLabel,
 } from "@/api/process/materialFlow";
+import { getVehicleInfo } from "@/api/prepare";
 import {
   backToStorageAPI,
   getStorageBoxesList,
@@ -118,10 +138,37 @@ import {
 const boxSearch = ref("");
 //盒内原有物料data
 const boxesList = ref<any[]>([]);
+const addStatus = ref(false);
+const addSuccessStatus = ref(false);
+const addBoxInfo = ref();
 //选中的item
 const currentBox = ref<any>({});
 const currentBoxIndex = ref(-1);
 const outStatus = ref(false);
+const changeAddStatus = () => {
+  if (addStatus.value == true) {
+    addSuccessStatus.value = false;
+    addBoxInfo.value = null;
+    addBoxSearch.value = "";
+    outingBox.value = {};
+    outingRawBoxList = [];
+    outingMaterials.value = [];
+    materialList.value = [];
+  }
+  addStatus.value = !addStatus.value;
+};
+const addBoxSearch = ref("");
+//扫盒子
+const addenterBox = () => {
+  addBoxSearch.value = addBoxSearch.value.trim();
+  getVehicleInfo(addBoxSearch.value ? addBoxSearch.value : {}).then((res) => {
+    addBoxInfo.value = res.data;
+    addSuccessStatus.value = true;
+    outingBox.value.vehicleNo = addBoxInfo.value.code;
+    outingBox.value.vehicleId = addBoxInfo.value.id;
+    ElMessage.success("扫码成功!");
+  });
+};
 //出库
 const enterBox = () => {
   boxSearch.value = boxSearch.value.trim();
@@ -181,6 +228,7 @@ const materialList = ref<any>([]);
 // 扫码料码
 const handleScanCodeInput = () => {
   getMaterialInfoByLabel(scanCodeInput.value).then((res) => {
+    //seq是序列号唯一的
     if (res.data.codeType == "SEQ") {
       res.data.seqNo = scanCodeInput.value;
     } else {
@@ -400,4 +448,12 @@ onMounted(() => {
   width: 100%;
   margin-top: 10px;
 }
+.addbox {
+  margin-bottom: 10px;
+  border-radius: 16px;
+  background-color: white;
+  text-align: center;
+  padding: 20px 0;
+  font-size: $f24;
+}
 </style>