qinhb 1 vecka sedan
förälder
incheckning
013b5f73e7
2 ändrade filer med 32 tillägg och 3 borttagningar
  1. 7 0
      src/api/prosteps/wuliaocaiji.ts
  2. 25 3
      src/views/pro-steps/popUpView/xiangqingPopUp.vue

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

@@ -44,6 +44,13 @@ export function getInfo(data: any) {
     data,
   });
 }
+export function batchUpdate(data: any) {
+  return request({
+    url: `/api/v1/process/itemRecord/itemInfo/batchUpdate`,
+    method: "post",
+    data,
+  });
+}
 
 //复制物料信息
 export function copyMaterials(data: any) {

+ 25 - 3
src/views/pro-steps/popUpView/xiangqingPopUp.vue

@@ -23,15 +23,20 @@
       </div>
       <el-divider />
       <el-scrollbar>
-        <div class="body">
+        <div class="body" >
           <div
             class="info titleText"
             style="margin-top:5px;"
             v-for="(item, index) in showInfoData"
+            @click="setSelectIndex(index)"
             :key="index"
           >
-
-            {{item.batchNo}} * {{item.num}}
+            <template v-if="selectIndex == index">
+              <ScanCodeInput v-model="item.batchNo" width="50%"/>
+            </template>
+            <template v-else>
+              {{item.batchNo}} * {{item.num}}
+            </template>
 <!--            <el-form span="24" :inline="true" >
               <el-form-item label="批号" span="12">
                 <el-input v-model="item.batchNo"></el-input>
@@ -45,11 +50,16 @@
           <Empty v-if="showInfoData.length == 0" />
         </div>
       </el-scrollbar>
+      <div class="dialog-footer" style="margin: 0 auto;" v-if="selectIndex != null">
+        <el-button @click="handleClose">取消</el-button>
+        <el-button type="primary" @click="replaceMaterials"> 确定 </el-button>
+      </div>
     </div>
   </div>
 </template>
 
 <script lang="ts" setup>
+import {batchUpdate} from "@/api/prosteps/wuliaocaiji";
 const emits = defineEmits(["update:modelValue"]);
 const props = defineProps({
   modelValue: {
@@ -63,10 +73,22 @@ const props = defineProps({
     type: Object,
   },
 });
+const selectIndex = ref(null);
+const setSelectIndex = (index) => {
+  selectIndex.value = index;
+};
 const scanCode = ref("");
 const handleClose = () => {
+  selectIndex.value = null
   emits("update:modelValue", false);
 };
+
+const replaceMaterials = () => {
+  batchUpdate(props.showInfoData).then((res)=>{
+    selectIndex.value = null
+    ElMessage.success(res.msg)
+  });
+};
 </script>
 
 <style lang="scss" scoped>