From 2f519ead537a0b38019bbf64a6075cbb6e08f9b4 Mon Sep 17 00:00:00 2001
From: hyingbo <1363390067@qq.com>
Date: 星期三, 09 七月 2025 13:53:01 +0800
Subject: [PATCH] 车间大屏看板设置设备默认图片

---
 src/views/tms/modules/inboundOrder/InboundOrderModel.vue |  136 +++++++++++++++++++++++++--------------------
 1 files changed, 76 insertions(+), 60 deletions(-)

diff --git a/src/views/tms/modules/inboundOrder/InboundOrderModel.vue b/src/views/tms/modules/inboundOrder/InboundOrderModel.vue
index 6aae13c..4e1d578 100644
--- a/src/views/tms/modules/inboundOrder/InboundOrderModel.vue
+++ b/src/views/tms/modules/inboundOrder/InboundOrderModel.vue
@@ -40,8 +40,24 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :span="24 / 2">
+          <!-- <a-col :span="24 / 2">
+            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="搴撲綅鍙�">
+             <a-select
+                :triggerChange="true"
+                :options="locationCodeOptions"
+                v-decorator="[ 'locationCodeId', validatorRules.locationCodeId ]"
+              />
+            </a-form-item>
+          </a-col> -->
+          <!-- <a-col :span="24 / 2">
             <a-form-item label="鐢宠鍘熷洜" :labelCol="labelCol" :wrapperCol="wrapperCol">
+             <a-input placeholder="璇疯緭鍏ョ敵璇峰師鍥�"  :disabled="disableSubmit" v-decorator="['applicationReason', validatorRules.applicationReason]" />
+            </a-form-item>
+          </a-col> -->
+        </a-row>
+         <a-row style="width: 100%">
+          <a-col :span="24">
+             <a-form-item label="鐢宠鍘熷洜" :labelCol="{ span: 3 }" :wrapperCol="{ span: 21 }" >
              <a-input placeholder="璇疯緭鍏ョ敵璇峰師鍥�"  :disabled="disableSubmit" v-decorator="['applicationReason', validatorRules.applicationReason]" />
             </a-form-item>
           </a-col>
@@ -55,7 +71,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 +80,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,11 +143,22 @@
         <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"
           />
+          <a-select
+            v-if="col.dataIndex == 'goodsShelvesId'"
+            :disabled="disableSubmit"
+            :triggerChange="true"
+            :value="text"
+            show-search
+            :filter-option="filterOption"
+            style="width: 100%"
+            :options="locationCodeOptions"
+            @change="(e) => handleChange(e, record.key, col, index)"
+          />    
         </div>
       </template>
       <span slot="action" slot-scope="text, record, index">
@@ -166,6 +193,7 @@
 import { filterObj } from '@/utils/util'
 import JSelectReturnListModal from './JSelectReturnListModal'
 import JSelectSharpenListModal from './JSelectSharpenListModal'
+import store from '@/store'
 
 export default {
   name: 'InboundOrderModel',
@@ -176,6 +204,7 @@
     JSelectReturnListModal,
     JSearchSelectTag,
     JSelectSharpenListModal,
+    store
   },
   data() {
     return {
@@ -259,6 +288,14 @@
             },
           ],
         },
+        reviewer: {
+          rules: [
+            {
+              required: true,
+              message: '璇烽�夋嫨瀹℃牳浜�!',
+            },
+          ],
+        },
       },
       url: {
         add: '/tms/inboundOrder/add',
@@ -301,6 +338,12 @@
           align: 'center',
           dataIndex: 'toolModel'
         },
+         {
+          title: '搴撲綅鍙�',
+          align: 'center',
+          dataIndex: 'goodsShelvesId',
+          scopedSlots: { customRender: 'goodsShelvesId' },
+        },
         {
           title: '鍏ュ簱鏁伴噺',
           align: 'center',
@@ -314,11 +357,21 @@
           scopedSlots: { customRender: 'action' },
         },
       ],
+      locationCodeOptions:[]
     }
   },
-  created() {},
+  created() {
+    ajaxGetDictItems("tms_goods_shelves,location_code,id", null).then((res) => {
+        if (res.success) {
+          this.locationCodeOptions = res.result
+        }
+      })
+  },
   methods: {
     modalFormOk() {
+    },
+    filterOption(input, option) {
+      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
     },
     getQueryParams() {
       this.param.pageNo = this.ipagination.current
@@ -326,6 +379,7 @@
       return filterObj(this.param)
     },
     add() {
+      this.handle = store.getters.userInfo.username
       this.edit({})
     },
     edit(record) {
@@ -346,7 +400,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 +412,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 +478,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 +508,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 +545,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 +566,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 || 1,
+          accuracyClass:data[i].accuracyClass
         })
       }
       //this.ipaginationm.total = this.dataSource.length

--
Gitblit v1.9.3