From 1fb93f73037a8c40ea87c7f09f568df16a6869d1 Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期五, 06 六月 2025 17:26:42 +0800
Subject: [PATCH] 工具台账功能

---
 src/views/tms/modules/outBound/OutboundOrderModal.vue |   65 ++++++++++++++++++++++++++------
 1 files changed, 52 insertions(+), 13 deletions(-)

diff --git a/src/views/tms/modules/outBound/OutboundOrderModal.vue b/src/views/tms/modules/outBound/OutboundOrderModal.vue
index ec09ece..9d1a4e7 100644
--- a/src/views/tms/modules/outBound/OutboundOrderModal.vue
+++ b/src/views/tms/modules/outBound/OutboundOrderModal.vue
@@ -18,7 +18,7 @@
           </a-col>
           <a-col :span="12">
             <a-form-model-item label="鍑哄簱绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outStorehouseType">
-              <j-dict-select-tag :disabled="disableSubmit" @change="handleTypeChange" type="list" v-model="model.outStorehouseType" dictCode="out_storehouse_type" placeholder="璇烽�夋嫨鍑哄簱绫诲瀷" />
+              <j-dict-select-tag :disabled="disableSubmit" @change="handleTypeChange" type="list" v-model="model.outStorehouseType" dictCode="out_storehouse_type" placeholder="璇烽�夋嫨鍑哄簱绫诲瀷" disabled/>
             </a-form-model-item>
           </a-col>
         </a-row>
@@ -54,7 +54,7 @@
           </a-col>
           <a-col :span="12">
             <a-form-model-item v-if="addShow" label="瀹℃牳鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="auditDate">
-              <j-date placeholder="璇烽�夋嫨瀹℃牳鏃堕棿" v-model="model.auditDate" style="width: 100%" disabled/>
+              <j-date placeholder="璇烽�夋嫨瀹℃牳鏃堕棿" :show-time="true" dateFormat="YYYY-MM-DD HH:mm" v-model="model.auditDate" style="width: 100%" disabled/>
             </a-form-model-item>
           </a-col>
         </a-row>
@@ -75,7 +75,8 @@
       </a-form-model>
     </a-spin>
 
-    <a-button v-show="selectBorrowTool" type="primary" :style="{ marginBottom: '8px' }" @click="selectOutBoundTool">閫夋嫨鍑哄簱宸ュ叿</a-button>
+    <a-button v-show="selectBorrowTool" type="primary" :style="{ marginBottom: '8px' }" @click="selectBorrowOutBoundTool">閫夋嫨鍑哄簱宸ュ叿</a-button>
+    <a-button v-show="selectSharpenTool" type="primary" :style="{ marginBottom: '8px' }" @click="selectSharpenOutBoundTool">閫夋嫨鍒冪(宸ュ叿</a-button>
     <a-table
       ref="table"
       size="middle"
@@ -111,7 +112,8 @@
       <a-button @click="handleOk" :disabled="isDisabled" type="primary">纭畾</a-button>
     </template>
 
-    <j-select-outbound-tool-modal ref="selectOutBoundToolModal"></j-select-outbound-tool-modal>
+    <j-select-borrow-outbound-tool-modal ref="selectBorrowOutBoundToolModal"></j-select-borrow-outbound-tool-modal>
+    <j-select-sharpen-outbound-tool-modal ref="selectSharpenOutBoundToolModal"></j-select-sharpen-outbound-tool-modal>
   </j-modal>
 
 </template>
@@ -121,7 +123,8 @@
   import { httpAction } from '@/api/manage'
   import { validateDuplicateValue } from '@/utils/util'
   import OutboundDetailList from '../../OutboundDetailList.vue'
-  import JSelectOutboundToolModal from './JSelectOutboundToolModal.vue'
+  import JSelectBorrowOutboundToolModal from './JSelectBorrowOutboundToolModal.vue'
+  import JSelectSharpenOutboundToolModal from './JSelectSharpenOutboundToolModal.vue'
   import { getAction } from '../../../../api/manage'
   import title from 'ant-design-vue/lib/skeleton/Title'
 
@@ -129,7 +132,8 @@
     name: "OutboundOrderModal",
     components: {
       OutboundDetailList,
-      JSelectOutboundToolModal
+      JSelectBorrowOutboundToolModal,
+      JSelectSharpenOutboundToolModal
     },
     data () {
       return {
@@ -140,6 +144,7 @@
         isDisabled: false,
         addShow: true,
         selectBorrowTool: false,
+        selectSharpenTool: false,
         model:{
         },
         labelCol: {
@@ -218,10 +223,16 @@
         confirmLoading: false,
         validatorRules: {
            outStorehouseType: [
-              { required: true, message: '璇疯緭鍏ュ嚭搴撶被鍨�!'},
+              { required: true, message: '璇烽�夋嫨鍑哄簱绫诲瀷!'},
            ],
            subjectMatter: [
               { required: true, message: '璇疯緭鍏ラ鐢ㄤ簨鐢�!'},
+           ],
+          reviewer: [
+              { required: true, message: '璇烽�夋嫨瀹℃牳浜�!'},
+           ],
+          outboundTime: [
+              { required: true, message: '璇烽�夋嫨鍑哄簱鏃堕棿!'},
            ],
         },
         url: {
@@ -258,15 +269,23 @@
       handleTypeChange(value) {
         if (value === '1') {
           this.selectBorrowTool = true
+          this.selectSharpenTool = false
+          this.dataSource = []
         }
         if (value === '2') {
           this.selectBorrowTool = false
+          this.selectSharpenTool = false
+          this.dataSource = []
         }
         if (value === '3') {
           this.selectBorrowTool = false
+          this.selectSharpenTool = false
+          this.dataSource = []
         }
         if (value === '4') {
           this.selectBorrowTool = false
+          this.selectSharpenTool = true
+          this.dataSource = []
         }
       },
       handleDelete(record, index) {
@@ -290,7 +309,7 @@
           this.dataSource = temp
         }
       },
-      selectOutBoundTool() {
+      selectBorrowOutBoundTool() {
         console.log(this.dataSource)
         let ids = ''
         if (this.title === '鏂板') {
@@ -299,7 +318,18 @@
         if (this.title === '缂栬緫') {
          ids = this.dataSource.map(item => item.toolLedgerDetailId).join(',')
         }
-        this.$refs.selectOutBoundToolModal.showModal(ids)
+        this.$refs.selectBorrowOutBoundToolModal.showOrderModal(ids)
+      },
+      selectSharpenOutBoundTool() {
+        console.log(this.dataSource)
+        let ids = ''
+        if (this.title === '鏂板') {
+          ids = this.dataSource.map(item => item.id).join(',')
+        }
+        if (this.title === '缂栬緫') {
+          ids = this.dataSource.map(item => item.toolSharpeningId).join(',')
+        }
+        this.$refs.selectSharpenOutBoundToolModal.showOrderModal(ids)
       },
       add () {
         this.addShow = false
@@ -316,16 +346,20 @@
               const type = record.outStorehouseType
               switch (type) {
                 case '1':
-                  this.handleTypeChange('1')
+                  this.selectBorrowTool = true
+                  this.selectSharpenTool = false
                   break
                 case '2':
-                  this.handleTypeChange('2')
+                  this.selectBorrowTool = false
+                  this.selectSharpenTool = false
                   break
                 case '3':
-                  this.handleTypeChange('3')
+                  this.selectBorrowTool = false
+                  this.selectSharpenTool = false
                   break
                 case '4':
-                  this.handleTypeChange('4')
+                  this.selectBorrowTool = false
+                  this.selectSharpenTool = true
                   break
               }
             }
@@ -338,6 +372,7 @@
         this.$emit('close');
         this.addShow = true
         this.selectBorrowTool = false
+        this.selectSharpenTool = false
         this.visible = false;
         this.$refs.form.clearValidate();
       },
@@ -349,6 +384,10 @@
         // 瑙﹀彂琛ㄥ崟楠岃瘉
         this.$refs.form.validate(valid => {
           if (valid) {
+            if (this.dataSource == null || this.dataSource.length === 0) {
+              this.$message.warning('璇烽�夋嫨鍑哄簱宸ュ叿!');
+              return
+            }
             this.model.outboundDetailList = this.dataSource
             that.confirmLoading = true;
             let httpurl = '';

--
Gitblit v1.9.3