From a99b32aee78f130d44f5353b30b001f96c84977a Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期四, 17 八月 2023 18:45:29 +0800
Subject: [PATCH] 改bug

---
 h5_standard/src/views/workOrder/reportingForWork.vue |   60 ++++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 34 insertions(+), 26 deletions(-)

diff --git a/h5_standard/src/views/workOrder/reportingForWork.vue b/h5_standard/src/views/workOrder/reportingForWork.vue
index f6d30eb..5fa1d2e 100644
--- a/h5_standard/src/views/workOrder/reportingForWork.vue
+++ b/h5_standard/src/views/workOrder/reportingForWork.vue
@@ -55,7 +55,7 @@
                         <span>鏂板鎶曟枡</span>
                     </div>
                 </div>
-                <template v-if="wuList.length > 0">
+                <template v-if="wuList.length > 0 && !(hasBom == 1 && bomType == 1)">
                     <van-swipe-cell v-for="(item, index) in wuList" :key="index">
                         <div class="bg_list_item_h">
                             <div class="bg_list_item_num">
@@ -82,7 +82,7 @@
                         </template>
                     </van-swipe-cell>
                 </template>
-                <template v-else>
+                <template v-else-if="wuList.length == 0 && !(hasBom == 1 && bomType == 1)">
                     <div class="kong">
                         <span>鏆傛棤鏁版嵁</span>
                     </div>
@@ -104,7 +104,7 @@
                             <span><b>*</b>鑹搧鏁�</span>
                             <div class="bg_list_item_num_item_sr">
                                 <input type="number" v-model="from.qualified" @input="changeNum(1)" placeholder="璇疯緭鍏�" />
-                                <span>鍧�</span>
+                                <span v-if="from.processPlan">{{from.processPlan.unitName}}</span>
                             </div>
                         </div>
                     </div>
@@ -113,7 +113,7 @@
                             <span>涓嶈壇鏁�</span>
                             <div class="bg_list_item_num_item_sr">
                                 <input type="number" v-model="from.undesirable" @input="changeNum(2)" placeholder="璇疯緭鍏�" />
-                                <span>鍧�</span>
+                                <span v-if="from.processPlan">{{from.processPlan.unitName}}</span>
                             </div>
                         </div>
                     </div>
@@ -158,7 +158,7 @@
                         <div class="bg_list_item_num_item">
                             <span>宸ヨ祫鍗曚环</span>
                             <div class="bg_list_item_num_item_sr">
-                                <span class="color1">{{infoBox.salary}}鍏�/{{infoBox.type == 0 ? '浠�' : '鏃�'}}</span>
+                                <span class="color1">{{(infoBox.salary / 10 / 10).toFixed(2)}}鍏�/{{infoBox.type == 0 ? '浠�' : '鏃�'}}</span>
                             </div>
                         </div>
                     </div>
@@ -188,7 +188,7 @@
             <div class="bg_footer_submit" @click="submit">鎻愪氦</div>
         </div>
         <!-- 閫夋嫨涓嶈壇椤� -->
-        <van-popup v-model:show="show" round position="bottom" :style="{ height: '53%' }">
+        <van-popup v-model:show="show" round position="bottom">
             <div class="bl">
                 <div class="bl_head">
                     <img src="@/assets/icon/ic_close@2x.png" style="opacity: 0;" alt="" />
@@ -280,8 +280,7 @@
         text: 'name'
     };
     let userShow = ref(false)
-    let userList = ref([])
-    let wuList: any = ref([])
+    let wuList = ref<Array<any>>([])
 
     // 浜у嚭鏁伴噺楠岃瘉
     const changeNum = (type: number) => {
@@ -348,7 +347,10 @@
         } else {
             if (!wuList.value.length === 0) return Toast('鎶曟枡涓嶈兘涓虹┖')
         }
-        if (!from.qualified) return Toast('鑹搧鏁颁笉鑳戒负绌�')
+        if (!from.qualified && !from.undesirable) {
+            return Toast('鑹搧鏁颁笌涓嶈壇鏁颁笉鑳藉悓鏃朵负绌�')
+        }
+        // if (!from.qualified) return Toast('鑹搧鏁颁笉鑳戒负绌�')
         // 鏈変笉鑹暟
         if (from.undesirable > 0) {
             if (from.defective.length === 0) return Toast('涓嶈壇椤逛笉鑳戒负绌�')
@@ -357,8 +359,8 @@
         autoWorkReport({
             createWorkorderRecordDTO: {
                 duration: from.duration,
-                qualifiedNum: from.qualified,
-                unQualifiedNum: from.undesirable
+                qualifiedNum: from.qualified ? from.qualified : 0,
+                unQualifiedNum: from.undesirable ? from.undesirable : 0
             },
             plansId: from.processPlan.id,
             proGroupId: deviceId.value,
@@ -387,43 +389,46 @@
 
     // 棰勮宸ヨ祫
     const expectedSalary = computed(() => {
-        if (!infoBox.value) return 0
+        if (!infoBox.value) return 0;
         // 鎸変欢璁$畻
         if (infoBox.value.type == 0) {
-            console.log('璁′欢')
             if (!from.qualified) return 0
             if (infoBox.value.unqualified == 1) {   // 鏄惁璁″叆涓嶈壇鍝�
                 let total = Number(from.qualified) + Number(from.undesirable)
-                return total * infoBox.value.salary
+                return (total * (infoBox.value.salary / 10 / 10)).toFixed(2) || 0
             } else {
-                return Number(from.qualified) * infoBox.value.salary
+                return (Number(from.qualified) * (infoBox.value.salary / 10 / 10)).toFixed(2) || 0
             }
         } else {
-            console.log('璁℃椂')
             if (!from.duration) return 0;
             let h = (from.duration / 60 / 60).toFixed(2)
-            return Number(h) * infoBox.value.salary
+            return (Number(h) * (infoBox.value.salary / 10 / 10)).toFixed(2) || 0
         }
     })
 
     // 杈炬爣鐜�
     const complianceRate = computed(() => {
         if (!infoBox.value) return 0;
-        if (!from.qualified) return 0;
+        if (!from.qualified && !from.undesirable) return 0;
         if (!from.duration) return 0;
         // 鎸変欢璁$畻
         // if (infoBox.value.type == 0) {
-            // if (infoBox.value.unqualified == 1) {   // 鏄惁璁″叆涓嶈壇鍝�
+            if (infoBox.value.unqualified == 1) {   // 鏄惁璁″叆涓嶈壇鍝�
                 let a = ((Number(from.qualified) + Number(from.undesirable)) / (from.duration / 60 / 60)).toFixed(2)
                 let b = (infoBox.value.num / (infoBox.value.times / 60 / 60)).toFixed(2)
                 console.log(a)
                 console.log(b)
-                return (Number(a) / Number(b)).toFixed(2)
+                return ((Number(a) / Number(b)) * 100).toFixed(2) || 0
                 // let total = (Number(from.qualified) + Number(from.undesirable)) / ((from.duration * 60 * 60) * infoBox.value.num / )
                 // return total * infoBox.value.salary;
-            // } else {
-            //     return Number(from.qualified) * infoBox.value.salary;
-            // }
+            } else {
+                let a = (from.qualified / (from.duration / 60 / 60)).toFixed(2)
+                let b = (infoBox.value.num / (infoBox.value.times / 60 / 60)).toFixed(2)
+                console.log(a)
+                console.log(b)
+                return ((Number(a) / Number(b)) * 100).toFixed(2) || 0
+                // return Number(from.qualified) * infoBox.value.salary;
+            }
         // } else {
         //     console.log('鎸夋椂闀�')
         // }
@@ -544,7 +549,7 @@
             // 鑾峰彇绫诲瀷
             getIdPlansExt(res.id)
                 .then(res2 => {
-                    if (res.code === 200) {
+                    if (res2.code === 200) {
                         bomType.value = res2.data.bomType
                         hasBom.value = res2.data.hasBom
                     }
@@ -843,7 +848,7 @@
                                     font-size: 28px;
                                     font-weight: 400;
                                     color: #333333;
-                                    padding: 0 30px
+                                    padding: 0 30px;
                                 }
                                 .wulll {
                                     width: 400px;
@@ -906,12 +911,15 @@
             }
         }
         .bl {
+            width: 100%;
+            height: 800px;
             padding: 30px;
             box-sizing: border-box;
             display: flex;
             flex-direction: column;
             .bl_head {
                 width: 100%;
+                height: 50px;
                 display: flex;
                 align-items: center;
                 justify-content: space-between;
@@ -942,7 +950,7 @@
             }
             .bl_list {
                 width: 100%;
-                height: 550px;
+                height: calc(100% - 168px);
                 overflow-y: scroll;
                 margin-top: 30px;
                 .bl_list_item {

--
Gitblit v1.9.3