From 34feb4908ec7b7e5b51adf6355603978c67bd3a4 Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期四, 05 六月 2025 09:53:14 +0800
Subject: [PATCH] 申请单入库

---
 src/views/tms/modules/inboundOrder/InboundOrderModel.vue |   89 +++++++++++++++-----------------------------
 1 files changed, 31 insertions(+), 58 deletions(-)

diff --git a/src/views/tms/modules/inboundOrder/InboundOrderModel.vue b/src/views/tms/modules/inboundOrder/InboundOrderModel.vue
index 6aae13c..06333dd 100644
--- a/src/views/tms/modules/inboundOrder/InboundOrderModel.vue
+++ b/src/views/tms/modules/inboundOrder/InboundOrderModel.vue
@@ -55,7 +55,7 @@
                 v-if="!barcodeCurrentType"
                 placeholder="璇烽�夋嫨缁忔墜浜�"
                 v-decorator="['handler', { rules: [{ required: false, message: '璇烽�夋嫨缁忔墜浜�' }] }]"
-                dict="sys_user,realname,id,del_flag=0"
+                dict="sys_user,realname,username,del_flag=0"
                 @change="selectCurrentUserChange"
               />
             </a-form-item>
@@ -64,10 +64,10 @@
           <a-col :span="24 / 2">
             <a-form-item label="瀹℃牳浜�" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <j-search-select-tag
-                :disabled="true"
+                :disabled="disableSubmit"
                 placeholder="璇烽�夋嫨瀹℃牳浜�"
                 v-decorator="['reviewer', validatorRules.reviewer]"
-                dict="sys_user,realname,id,del_flag=0"
+                dict="sys_user,realname,username,del_flag=0"
                 @change="selectCurrentUserChange"
               />
             </a-form-item>
@@ -127,7 +127,7 @@
         <div :key="col.dataIndex">
           <a-input-number
             v-if="col.dataIndex == 'inStorageQuantity'"
-            :disabled="quantityDisable"
+            :disabled="record.accuracyClass == '1'"
             :value="text"
             @change="(e) => handleChange(e, record.key, col, index)"
             :min="1"
@@ -166,6 +166,7 @@
 import { filterObj } from '@/utils/util'
 import JSelectReturnListModal from './JSelectReturnListModal'
 import JSelectSharpenListModal from './JSelectSharpenListModal'
+import store from '@/store'
 
 export default {
   name: 'InboundOrderModel',
@@ -176,6 +177,7 @@
     JSelectReturnListModal,
     JSearchSelectTag,
     JSelectSharpenListModal,
+    store
   },
   data() {
     return {
@@ -259,6 +261,14 @@
             },
           ],
         },
+        reviewer: {
+          rules: [
+            {
+              required: true,
+              message: '璇烽�夋嫨瀹℃牳浜�!',
+            },
+          ],
+        },
       },
       url: {
         add: '/tms/inboundOrder/add',
@@ -326,6 +336,7 @@
       return filterObj(this.param)
     },
     add() {
+      this.handle = store.getters.userInfo.username
       this.edit({})
     },
     edit(record) {
@@ -346,7 +357,6 @@
         this.inboundOrderId = record.id
         this.detailList(this.inboundOrderId)
       }
-      this.initOptions()
       this.$nextTick(() => {
         this.form.setFieldsValue(
           pick(this.model, 'inboundNum', 'inStorehouseType', 'inboundTime', 'applicationReason', 'handler','approvalDate','reviewer','approvalOpinion','remark')
@@ -359,6 +369,14 @@
       const target = temp.filter(item => key === item.key)[index];
       if (target) {
         target[column.dataIndex] = value
+        if(column.dataIndex === 'inStorageQuantity'){
+          if(target['quantity']<value){
+            this.$message.error('鍏ュ簱鏁伴噺涓嶈兘澶т簬鍑哄簱鏁伴噺!')
+            this.isDisabled = true
+          }else{
+            this.isDisabled = false
+          }
+        }
         this.dataSource = temp
       }
     },
@@ -417,7 +435,7 @@
     selectTooling: function () {
       let ids = []
       for (let i = 0; i < this.dataSource.length; i++) {
-        ids.push(this.dataSource[i].toolCodeId)
+        ids.push(this.dataSource[i].id)
       }
       this.$refs.toolingModalForm.showModal(ids)
       this.$refs.toolingModalForm.title = '閫夋嫨宸ュ叿'
@@ -447,14 +465,6 @@
       this.dataSource.splice(index, 1)
     },
     onChange() {},
-    //鎺у埗鎵爜鎴栨墜閫�
-    selectCurrentUserType(e) {
-      if (e == '0') {
-        this.barcodeCurrentType = true
-      } else {
-        this.barcodeCurrentType = false
-      }
-    },
     //鎵嬮�変汉鍛樺��
     selectCurrentUserChange(e) {
       console.log('褰撳墠鎵嬮��', e)
@@ -492,52 +502,12 @@
       }
       
     },
-    //娣诲姞宸ュ叿鎸夐挳
-    addTooling() {
-      const temp = [...this.dataSource];
-      temp.push({ indexId: temp.length + 1 });
-      this.dataSource = temp;
-    },
     detailList(inboundOrderId) {
       this.param.inboundOrderId = inboundOrderId
       getAction(this.url.detailList, this.getQueryParams()).then((res) => {
         if (res.success) {
           this.dataSource = res.result.records
           this.ipagination.total = res.result.total;
-        }
-      })
-    },
-    initOptions() {
-      
-      ajaxGetDictItems("mes_base_warehouse,name,id,del_flag!='1' order by num asc", null).then((res) => {
-        if (res.success) {
-          if (res.result) {
-            for (let i = 0; i < res.result.length; i++) {
-              res.result[i].label = res.result[i].title;
-            }
-          }
-          this.warehouseOptions = res.result;
-        }
-      })
-      ajaxGetDictItems("mes_base_storage_area,name,id,del_flag!='1'", null).then((res) => {
-        if (res.success) {
-          if (res.result) {
-            for (let i = 0; i < res.result.length; i++) {
-              res.result[i].label = res.result[i].title;
-            }
-          }
-          this.locationOptions = res.result;
-        }
-      })
-       ajaxGetDictItems("mes_base_tooling,num,id,del_flag!='1'", null).then((res) => {
-        if (res.success) {
-          if (res.result) {
-            for (let i = 0; i < res.result.length; i++) {
-              res.result[i].label = res.result[i].title;
-              res.result[i].toolingName = res.result[i].name
-            }
-          }
-          this.toolingOptions = res.result;
         }
       })
     },
@@ -553,13 +523,16 @@
       //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟
       for (let i = 0; i < data.length; i++) {
         this.dataSource.push({
-          toolCodeId:data[i].id,
+          id:data[i].id,
+          toolCodeId: data[i].toolCodeId,
           toolCode: data[i].toolCode,
-          chineseName: data[i].chineseName || data[i].toolName,
+          chineseName: data[i].chineseName,
           toolModel: data[i].toolModel,
           applicationType: data[i].applicationTypeName,
-          onlyCode:data[i].toolNum,
-          inStorageQuantity:data[i].storageQuantity || data[i].quantity
+          onlyCode:data[i].onlyCode,
+          quantity:data[i].quantity,
+          inStorageQuantity:data[i].storageQuantity || data[i].quantity,
+          accuracyClass:data[i].accuracyClass
         })
       }
       //this.ipaginationm.total = this.dataSource.length

--
Gitblit v1.9.3