From d7fe8ae3888c8e2b1eea3c1e3769be0d42a21cc9 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 16 十月 2023 09:03:47 +0800
Subject: [PATCH] Merge branch '1.0.3' of http://139.186.142.91:10010/r/productDev/dmMes into 1.0.3

---
 h5_standard/src/views/needToBeDealtWith/addWarehousing.vue |   70 +++++++++++++++++++++++++++-------
 1 files changed, 55 insertions(+), 15 deletions(-)

diff --git a/h5_standard/src/views/needToBeDealtWith/addWarehousing.vue b/h5_standard/src/views/needToBeDealtWith/addWarehousing.vue
index ef5e6ea..1d9ab0b 100644
--- a/h5_standard/src/views/needToBeDealtWith/addWarehousing.vue
+++ b/h5_standard/src/views/needToBeDealtWith/addWarehousing.vue
@@ -43,13 +43,15 @@
                             <van-icon name="arrow" size="20" color="#999999" />
                         </div>
                     </div>
-                    <div class="rework_qd_item" v-if="form.type != 25" @click="openGX(index)">
-                        <span>鐢熶骇宸ュ簭</span>
-                        <div class="rework_qd_item_right">
-                            <span :class="item.procedureName ? 'black' : ''">{{item.procedureName ? item.procedureName : '璇烽�夋嫨'}}</span>
-                            <van-icon name="arrow" size="20" color="#999999" />
+                    <template v-if="form.type !== 25">
+                        <div class="rework_qd_item" v-if="item.hasBom !== 0" @click="openGX(index)">
+                            <span>鐢熶骇宸ュ簭</span>
+                            <div class="rework_qd_item_right">
+                                <span :class="item.procedureName ? 'black' : ''">{{item.procedureName ? item.procedureName : '璇烽�夋嫨'}}</span>
+                                <van-icon name="arrow" size="20" color="#999999" />
+                            </div>
                         </div>
-                    </div>
+                    </template>
                     <div class="rework_qd_item" @click="openQ(index)">
                         <span><b>*</b>璐ㄩ噺灞炴��</span>
                         <div class="rework_qd_item_right">
@@ -139,10 +141,12 @@
         {
             batch: '',
             locationId: '',
+            locationIdLabel: '',
             locationName: '',
             materialId: '',
             materialName: '',
             num: '',
+            hasBom: '',
             procedureId: '',
             procedureName: '',
             qualityType: '',
@@ -165,11 +169,15 @@
     }
     // 鎵撳紑閫夋嫨鐗╂枡
     const openQ = (index: number) => {
+        if (list.value[index].locationIdLabel == 'APPLIANCE_ONTEST' || list.value[index].locationIdLabel == 'APPLIANCE_OFFTEST' || list.value[index].locationIdLabel == 'APPLIANCE_USELESS') {
+            return
+        }
         i.value = index
         qualityShow.value = true
     }
     // 鎵撳紑宸ュ簭
     const openGX = (index: number) => {
+        if (!list.value[index].materialId) return Toast('璇峰厛閫夋嫨鍏ュ簱鐗╂枡')
         i.value = index
         productionShow.value = true
     }
@@ -180,18 +188,20 @@
         locationShow.value = true
     }
     const addItem = () => {
-        // if (!form.warehouseId) return Toast('璇烽�夋嫨鍏ュ簱浠撳簱')
+        if (!form.warehouseId) return Toast('璇烽�夋嫨鍏ュ簱浠撳簱')
         list.value.push({
             batch: '',
-            locationId: '',
-            locationName: '',
+            locationId: list.value[list.value.length - 1].locationId,
+            locationName: list.value[list.value.length - 1].locationName,
+            locationIdLabel: list.value[list.value.length - 1].locationIdLabel,
             materialId: '',
             materialName: '',
             num: '',
+            hasBom: '',
             procedureId: '',
             procedureName: '',
-            qualityType: '',
-            qualityTypeName: '',
+            qualityType: list.value[list.value.length - 1].qualityType,
+            qualityTypeName: list.value[list.value.length - 1].qualityTypeName,
             unitId: '',
             unitName: ''
         })
@@ -230,7 +240,7 @@
             if (!list.value[i].locationId) return Toast(`绗�${i+1}椤瑰叆搴撹揣浣嶄笉鑳戒负绌篳)
             if (!list.value[i].materialId) return Toast(`绗�${i+1}椤瑰叆搴撶墿鏂欎笉鑳戒负绌篳)
             if (!list.value[i].qualityType) return Toast(`绗�${i+1}椤硅川閲忓睘鎬т笉鑳戒负绌篳)
-            if (!list.value[i].num || list.value[i].num == '' || list.value[i].num == 0) {
+            if (list.value[i].num <= 0) {
                 return Toast(`绗�${i + 1}椤瑰叆搴撴暟閲忓繀椤诲ぇ浜�0`)
             }
         }
@@ -262,7 +272,8 @@
     // 鍒犻櫎
     const dele = (index: any) => {
         if (list.value.length === 1) {
-            Toast('鑷冲皯淇濈暀涓�鏉″伐瑁呬俊鎭�')
+        //    Toast('鑷冲皯淇濈暀涓�鏉″伐瑁呬俊鎭�')
+            Toast('鑷冲皯淇濈暀涓�鏉$墿娴佹竻鍗曚俊鎭�')
             return
         }
         list.value.splice(index, 1)
@@ -301,12 +312,27 @@
                             item.locationId = res.data[0].id
                             item.locationName = res.data[0].unionName
                         })
+                        list.value[i.value].locationIdLabel = res.data[0].label
+                        if (res.data[0].label === 'APPLIANCE_ONTEST') {
+                            list.value[i.value].qualityType = '0'
+                            list.value[i.value].qualityTypeName = '鍚堟牸'
+                        } else if (res.data[0].label === 'APPLIANCE_OFFTEST') {
+                            list.value[i.value].qualityType = '1'
+                            list.value[i.value].qualityTypeName = '涓嶈壇'
+                        } else if (res.data[0].label === 'APPLIANCE_USELESS') {
+                            list.value[i.value].qualityType = '2'
+                            list.value[i.value].qualityTypeName = '鎶ュ簾'
+                        }
                     } else {
                         location.value = true
                         list.value.forEach(item => {
-                            item.locationId = ''
-                            item.locationName = ''
+                            item.locationId = res.data[0].id
+                            item.locationName = res.data[0].unionName
                         })
+                        // list.value.forEach(item => {
+                        //     item.locationId = ''
+                        //     item.locationName = ''
+                        // })
                     }
                 }
             })
@@ -317,6 +343,7 @@
         list.value[i.value].materialName = item.mmodelUnionName
         list.value[i.value].materialId = item.id
         list.value[i.value].unitId = item.unitId
+        list.value[i.value].hasBom = item.hasBom
         list.value[i.value].unitName = item.umodelName
         // 鑾峰彇鐗╂枡涓嬪伐搴�
         getListByMaterialId({
@@ -340,6 +367,19 @@
     const getValue3 = (item: any): void => {
         list.value[i.value].locationId = item.id
         list.value[i.value].locationName = item.unionName
+        list.value[i.value].qualityType = ''
+        list.value[i.value].qualityTypeName = ''
+        list.value[i.value].locationIdLabel = item.label
+        if (item.label === 'APPLIANCE_ONTEST') {
+            list.value[i.value].qualityType = '0'
+            list.value[i.value].qualityTypeName = '鍚堟牸'
+        } else if (item.label === 'APPLIANCE_OFFTEST') {
+            list.value[i.value].qualityType = '1'
+            list.value[i.value].qualityTypeName = '涓嶈壇'
+        } else if (item.label === 'APPLIANCE_USELESS') {
+            list.value[i.value].qualityType = '2'
+            list.value[i.value].qualityTypeName = '鎶ュ簾'
+        }
         locationShow.value = false
     }
     // 閫夋嫨宸ュ簭

--
Gitblit v1.9.3