From 3d1a4b4bf3d37e29a3d3345e00f9f84c0d7959a6 Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期一, 21 八月 2023 09:16:05 +0800
Subject: [PATCH] 改bug

---
 h5_standard/src/views/workOrder/workOrderReporting.vue |  462 ++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 294 insertions(+), 168 deletions(-)

diff --git a/h5_standard/src/views/workOrder/workOrderReporting.vue b/h5_standard/src/views/workOrder/workOrderReporting.vue
index 55a1d2f..531d7fd 100644
--- a/h5_standard/src/views/workOrder/workOrderReporting.vue
+++ b/h5_standard/src/views/workOrder/workOrderReporting.vue
@@ -14,167 +14,172 @@
                 <span>鎵爜浜у嚭</span>
             </div>
         </div> -->
+        <div class="bg_cate">
+            <div @click="clickIten(index)" :class="typeView == index ? 'bg_cate_item active' : 'bg_cate_item'" v-for="(item, index) in cate" :key="index">{{ item.name }}</div>
+        </div>
         <!--  鎶曟枡鏄庣粏/鍚堟牸浜у嚭鏄庣粏/涓嶈壇浜у嚭鏄庣粏  -->
-        <div class="bg_list">
-            <div class="bg_list_item">
-                <div class="bg_list_item_top">
-                    <div class="bg_list_item_top_left">
-                        <div class="bg_list_item_top_left_x"></div>
-                        <span>鎶曟枡鏄庣粏</span>
-                        <!-- <span class="blue left">{{tlTotal()}}</span> -->
+        <div class="bg_list" v-if="typeView === 0">
+                <div class="bg_list_item">
+                    <div class="bg_list_item_top">
+                        <div class="bg_list_item_top_left">
+                            <div class="bg_list_item_top_left_x"></div>
+                            <span>鎶曟枡鏄庣粏</span>
+                            <!-- <span class="blue left">{{tlTotal()}}</span> -->
+                        </div>
+                        <div class="bg_list_item_top_right" @click="jumpTL" v-if="proxy.$auth('h5:workorderinput:create') && (info.bomType !== 1 || info.bomType == 0 || !info.bomType)">
+                            <img src="@/assets/icon/gongdan_ic_shoudong@2x.png" alt="" />
+                            <span>鎵嬪姩褰曞叆</span>
+                        </div>
                     </div>
-                    <div class="bg_list_item_top_right" @click="jumpTL" v-if="proxy.$auth('h5:workorderinput:create') && (info.bomType !== 1 || info.bomType == 0 || !info.bomType)">
-                        <img src="@/assets/icon/gongdan_ic_shoudong@2x.png" alt="" />
-                        <span>鎵嬪姩褰曞叆</span>
-                    </div>
-                </div>
-                <template v-if="feedingData && feedingData.length > 0">
-                    <van-swipe-cell v-for="(item, index) in feedingData" :key="index">
-                        <div class="bg_list_item_h">
-                            <div class="bg_list_item_num">
-                                <div class="bg_list_item_num_item">
-                                    <!-- <span>{{item.code}}</span> -->
-                                    <div class="bg_list_item_num_item_wl">
-                                        <span> {{ item.materialName }}{{ item.procedureName ? `&nbsp;|&nbsp;${item.procedureName}` : '' }}</span>
-                                        <div class="bg_list_item_num_item_wl_lx">
-                                            <span class="green" v-if="item.qualityType == 0">鍚堟牸&nbsp;/&nbsp;</span>
-                                            <span class="yellow" v-if="item.qualityType == 1">涓嶈壇&nbsp;/&nbsp;</span>
-                                            <span class="red" v-if="item.qualityType == 2">鎶ュ簾&nbsp;/&nbsp;</span>
-                                            <span>{{ item.locationName }}</span>
-                                            <span>{{ item.batch ? `&nbsp;/&nbsp;${item.batch}` : '' }}</span>
+                    <template v-if="feedingData && feedingData.length > 0">
+                        <van-swipe-cell v-for="(item, index) in feedingData" :key="index">
+                            <div class="bg_list_item_h">
+                                <div class="bg_list_item_num">
+                                    <div class="bg_list_item_num_item">
+                                        <!-- <span>{{item.code}}</span> -->
+                                        <div class="bg_list_item_num_item_wl">
+                                            <span> {{ item.materialName }}{{ item.procedureName ? `&nbsp;|&nbsp;${item.procedureName}` : '' }}</span>
+                                            <div class="bg_list_item_num_item_wl_lx">
+                                                <span class="green" v-if="item.qualityType == 0">鍚堟牸&nbsp;/&nbsp;</span>
+                                                <span class="yellow" v-if="item.qualityType == 1">涓嶈壇&nbsp;/&nbsp;</span>
+                                                <span class="red" v-if="item.qualityType == 2">鎶ュ簾&nbsp;/&nbsp;</span>
+                                                <span>{{ item.locationName }}</span>
+                                                <span>{{ item.batch ? `&nbsp;/&nbsp;${item.batch}` : '' }}</span>
+                                            </div>
+                                        </div>
+                                        <div class="bg_list_item_num_item_sr">
+                                            <input v-model="item.num" :disabled="!proxy.$auth('h5:workorderinput:update')" @blur="change(item.id, item.num, 'T', item.maxNum, item, item.unitAttribute)" type="number" />
+                                            <span>{{item.unitName}}</span>
                                         </div>
                                     </div>
-                                    <div class="bg_list_item_num_item_sr">
-                                        <input v-model="item.num" :disabled="!proxy.$auth('h5:workorderinput:update')" @blur="change(item.id, item.num, 'T', item.maxNum, item, item.unitAttribute)" type="number" />
-                                        <span>{{item.unitName}}</span>
+                                </div>
+                            </div>
+                            
+                            <template #right v-if="proxy.$auth('h5:workorderinput:delete')">
+                                <van-button style="height: 100%;" square text="鍒犻櫎" @click="deleItem(item.id, 'T')" type="danger" />
+                            </template>
+                        </van-swipe-cell>
+                    </template>
+                    <template v-else>
+                        <div class="kong">
+                            <span>鏆傛棤鏁版嵁</span>
+                        </div>
+                    </template>
+                </div>
+                <div class="bg_list_item">
+                    <div class="bg_list_item_top">
+                        <div class="bg_list_item_top_left">
+                            <div class="bg_list_item_top_left_x"></div>
+                            <span>浜у嚭鏄庣粏</span>
+                        </div>
+                    </div>
+                    <!-- <template v-if="produceData && produceData.length > 0"> -->
+                        <!-- v-for="(item, index) in produceData" :key="index" -->
+                        <van-swipe-cell>
+                            <div class="bg_list_item_h">
+                                <div class="bg_list_item_num">
+                                    <div class="bg_list_item_num_item">
+                                        <span>鑹搧鏁�({{ info.umodel ? info.umodel.name : '' }})</span>
+                                        <div class="bg_list_item_num_item_sr">
+                                            <!-- :disabled="!proxy.$auth('h5:workorderoutput:update')" -->
+                                            <!-- @blur="change(item.id, item.num, 'C', item.maxNum, item)" -->
+                                            <input type="number" v-model="produceFrom.qualified" @blur="changeCC('0', produceFrom.qualified, produceFrom.qualifiedId)" placeholder="璇疯緭鍏�" />
+                                            <span v-if="info.umodel">{{info.umodel.name}}</span>
+                                        </div>
                                     </div>
                                 </div>
                             </div>
-                        </div>
-                        
-                        <template #right v-if="proxy.$auth('h5:workorderinput:delete')">
-                            <van-button style="height: 100%;" square text="鍒犻櫎" @click="deleItem(item.id, 'T')" type="danger" />
-                        </template>
-                    </van-swipe-cell>
-                </template>
-                <template v-else>
-                    <div class="kong">
-                        <span>鏆傛棤鏁版嵁</span>
-                    </div>
-                </template>
-            </div>
-            <div class="bg_list_item">
-                <div class="bg_list_item_top">
-                    <div class="bg_list_item_top_left">
-                        <div class="bg_list_item_top_left_x"></div>
-                        <span>浜у嚭鏄庣粏</span>
-                    </div>
-                </div>
-                <!-- <template v-if="produceData && produceData.length > 0"> -->
-                    <!-- v-for="(item, index) in produceData" :key="index" -->
-                    <van-swipe-cell>
-                        <div class="bg_list_item_h">
-                            <div class="bg_list_item_num">
-                                <div class="bg_list_item_num_item">
-                                    <span>鑹搧鏁�({{ info.umodel ? info.umodel.name : '' }})</span>
-                                    <div class="bg_list_item_num_item_sr">
-                                        <!-- :disabled="!proxy.$auth('h5:workorderoutput:update')" -->
-                                        <!-- @blur="change(item.id, item.num, 'C', item.maxNum, item)" -->
-                                        <input type="number" v-model="produceFrom.qualified" @blur="changeCC('0', produceFrom.qualified, produceFrom.qualifiedId)" placeholder="璇疯緭鍏�" />
-                                        <span v-if="info.umodel">{{info.umodel.name}}</span>
+                        </van-swipe-cell>
+                        <van-swipe-cell>
+                            <div class="bg_list_item_h">
+                                <div class="bg_list_item_num">
+                                    <!-- @blur="change(item.id, item.num, 'C', item.maxNum, item)" -->
+                                    <div class="bg_list_item_num_item">
+                                        <span>涓嶈壇鏁�({{ info.umodel ? info.umodel.name : '' }})</span>
+                                        <div class="bg_list_item_num_item_sr">
+                                            <!-- :disabled="!proxy.$auth('h5:workorderoutput:update')" -->
+                                            <!-- @blur="change(item.id, item.num, 'C', item.maxNum, item)" -->
+                                            <input type="number" v-model="produceFrom.undesirable" @blur="changeCC('1', produceFrom.undesirable, produceFrom.undesirableId)" placeholder="璇疯緭鍏�" />
+                                            <span v-if="info.umodel">{{info.umodel.name}}</span>
+                                        </div>
                                     </div>
                                 </div>
                             </div>
-                        </div>
-                    </van-swipe-cell>
-                    <van-swipe-cell>
-                        <div class="bg_list_item_h">
-                            <div class="bg_list_item_num">
-                                <!-- @blur="change(item.id, item.num, 'C', item.maxNum, item)" -->
-                                <div class="bg_list_item_num_item">
-                                    <span>涓嶈壇鏁�({{ info.umodel ? info.umodel.name : '' }})</span>
-                                    <div class="bg_list_item_num_item_sr">
-                                        <!-- :disabled="!proxy.$auth('h5:workorderoutput:update')" -->
-                                        <!-- @blur="change(item.id, item.num, 'C', item.maxNum, item)" -->
-                                        <input type="number" v-model="produceFrom.undesirable" @blur="changeCC('1', produceFrom.undesirable, produceFrom.undesirableId)" placeholder="璇疯緭鍏�" />
-                                        <span v-if="info.umodel">{{info.umodel.name}}</span>
+                        </van-swipe-cell>
+                        <van-swipe-cell v-if="produceFrom.undesirable > 0">
+                            <div class="bg_list_item_h">
+                                <div class="bg_list_item_num">
+                                    <div class="bg_list_item_num_item" @click="show = true">
+                                        <span>涓嶈壇椤�</span>
+                                        <div class="bg_list_item_num_item_sr">
+                                            <span class="wulll" :style="{color: from.defectiveName ? '#305ED5' : ''}">{{from.defectiveName ? from.defectiveName : '璁剧疆'}}</span>
+                                            <img src="@/assets/icon/ic_ar@2x.png" alt="" />
+                                        </div>
                                     </div>
                                 </div>
                             </div>
+                        </van-swipe-cell>
+                    <!-- </template>
+                    <template v-else>
+                        <div class="kong">
+                            <span>鏆傛棤鏁版嵁</span>
                         </div>
-                    </van-swipe-cell>
-                    <van-swipe-cell v-if="produceFrom.undesirable > 0">
-                        <div class="bg_list_item_h">
-                            <div class="bg_list_item_num">
-                                <div class="bg_list_item_num_item" @click="show = true">
-                                    <span>涓嶈壇椤�</span>
-                                    <div class="bg_list_item_num_item_sr">
-                                        <span class="wulll" :style="{color: from.defectiveName ? '#305ED5' : ''}">{{from.defectiveName ? from.defectiveName : '璁剧疆'}}</span>
-                                        <img src="@/assets/icon/ic_ar@2x.png" alt="" />
-                                    </div>
+                    </template> -->
+                </div>
+                <div class="bg_plan" @click="TimeShow = true">
+                    <div class="bg_plan_label">
+                        <span>鎶ュ伐鏃堕暱</span>
+                    </div>
+                    <div class="bg_plan_label_val">
+                        <span :style="{color: from.durationName ? '#333' : ''}">{{from.durationName ? from.durationName : '璇烽�夋嫨'}}</span>
+                        <img src="@/assets/icon/ic_ar@2x.png" alt="" />
+                    </div>
+                </div>
+                <div class="bg_list_item" v-if="arrType && arrType.length > 0">
+                    <div class="bg_list_item_top">
+                        <div class="bg_list_item_top_left">
+                            <div class="bg_list_item_top_left_x"></div>
+                            <span>宸ヨ祫缁╂晥</span>
+                        </div>
+                    </div>
+                    <div class="bg_list_item_h">
+                        <div class="bg_list_item_num">
+                            <div class="bg_list_item_num_item">
+                                <span>璁′欢鏂瑰紡</span>
+                                <div class="bg_list_item_num_item_list">
+                                    <div :class="item.active ? 'bg_list_item_num_item_list_item active' : 'bg_list_item_num_item_list_item'" v-for="(item, index) in arrType" :key="index" @click="clickPerformanceType(index)">{{ item.name }}</div>
+                                    <!-- <div class="bg_list_item_num_item_list_item active" v-if="infoBox.type == 0">璁′欢</div>
+                                    <div class="bg_list_item_num_item_list_item active" v-if="infoBox.type == 1">璁℃椂</div> -->
                                 </div>
                             </div>
                         </div>
-                    </van-swipe-cell>
-                <!-- </template>
-                <template v-else>
-                    <div class="kong">
-                        <span>鏆傛棤鏁版嵁</span>
-                    </div>
-                </template> -->
-            </div>
-            <div class="bg_plan" @click="TimeShow = true">
-                <div class="bg_plan_label">
-                    <span><b>*</b>鎶ュ伐鏃堕暱</span>
-                </div>
-                <div class="bg_plan_label_val">
-                    <span :style="{color: from.durationName ? '#333' : ''}">{{from.durationName ? from.durationName : '璇烽�夋嫨'}}</span>
-                    <img src="@/assets/icon/ic_ar@2x.png" alt="" />
-                </div>
-            </div>
-            <div class="bg_list_item" v-if="infoBox">
-                <div class="bg_list_item_top">
-                    <div class="bg_list_item_top_left">
-                        <div class="bg_list_item_top_left_x"></div>
-                        <span>宸ヨ祫缁╂晥</span>
-                    </div>
-                </div>
-                <div class="bg_list_item_h">
-                    <div class="bg_list_item_num">
-                        <div class="bg_list_item_num_item">
-                            <span>璁′欢鏂瑰紡</span>
-                            <div class="bg_list_item_num_item_list">
-                                <div class="bg_list_item_num_item_list_item active" v-if="infoBox.type == 0">璁′欢</div>
-                                <div class="bg_list_item_num_item_list_item active" v-if="infoBox.type == 1">璁℃椂</div>
+                        <div class="bg_list_item_num">
+                            <div class="bg_list_item_num_item">
+                                <span>宸ヨ祫鍗曚环</span>
+                                <div class="bg_list_item_num_item_sr">
+                                    <span class="color1">{{(arrType[from.index].salary / 10 / 10).toFixed(2)}}鍏�/{{arrType[from.index].type == 0 ? '浠�' : '鏃�'}}</span>
+                                    <!-- <span class="color1">{{infoBox.salary / 100}}鍏�/{{infoBox.type == 0 ? '浠�' : '鏃�'}}</span> -->
+                                </div>
                             </div>
                         </div>
-                    </div>
-                    <div class="bg_list_item_num">
-                        <div class="bg_list_item_num_item">
-                            <span>宸ヨ祫鍗曚环</span>
-                            <div class="bg_list_item_num_item_sr">
-                                <span class="color1">{{infoBox.salary / 100}}鍏�/{{infoBox.type == 0 ? '浠�' : '鏃�'}}</span>
+                        <div class="bg_list_item_num">
+                            <div class="bg_list_item_num_item">
+                                <span>棰勮宸ヨ祫</span>
+                                <div class="bg_list_item_num_item_sr">
+                                    <span class="color1">{{expectedSalary}}鍏�</span>
+                                </div>
                             </div>
                         </div>
-                    </div>
-                    <div class="bg_list_item_num">
-                        <div class="bg_list_item_num_item">
-                            <span>棰勮宸ヨ祫</span>
-                            <div class="bg_list_item_num_item_sr">
-                                <span class="color1">{{expectedSalary}}鍏�</span>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="bg_list_item_num">
-                        <div class="bg_list_item_num_item">
-                            <span>杈炬爣鐜�</span>
-                            <div class="bg_list_item_num_item_sr">
-                                <span class="color1">{{complianceRate}}%</span>
+                        <div class="bg_list_item_num">
+                            <div class="bg_list_item_num_item">
+                                <span>杈炬爣鐜�</span>
+                                <div class="bg_list_item_num_item_sr">
+                                    <span class="color1">{{complianceRate}}%</span>
+                                </div>
                             </div>
                         </div>
                     </div>
                 </div>
-            </div>
             <!-- <div class="bg_list_item">
                 <div class="bg_list_item_top">
                     <div class="bg_list_item_top_left">
@@ -272,8 +277,8 @@
                 </template>
             </div> -->
         </div>
-        <div class="details_dj">
-            <div class="details_dj_title">
+        <div class="details_dj" v-if="typeView === 1">
+            <!-- <div class="details_dj_title">
                 <div class="details_dj_title_left">
                     <div class="details_x"></div>
                     <span>鐢熶骇鐐规</span>
@@ -282,7 +287,7 @@
                     <img src="@/assets/icon/gongdan_ic_shoudong@2x.png" alt="" />
                     <span>鎵嬪姩褰曞叆</span>
                 </div>
-            </div>
+            </div> -->
             <div class="details_dj_list">
                 <van-list
                     v-model:loading="loading"
@@ -305,7 +310,11 @@
         <template v-if="info.status === 2 || info.procedureNeedcheck === 1">
             <div class="bh_zw"></div>
             <div class="bg_footer">
-                <div class="bg_footer_submit" @click="submit">纭鎶ュ伐</div>
+                <div class="bg_footer_submit" v-if="typeView == 0" @click="submit">纭鎶ュ伐</div>
+                <div class="bg_footer_submit1" @click="jumpdj" v-if="proxy.$auth('h5:workorder:processRecord') && typeView == 1">
+                    <img src="@/assets/icon/gongdan_ic_shoudong@2x.png" alt="" />
+                    <span>鏂板鐐规</span>
+                </div>
             </div>
         </template>
         <!--  鎵爜缁勪欢  -->
@@ -315,7 +324,7 @@
             @closePopup="closePopup"
             @onDecode="onDecode" />
         <!--  鎶ュ伐缁熻鏁版嵁  -->
-        <van-popup v-model:show="statistics" round :closeable="true" position="bottom" :style="{ height: '53%' }">
+        <van-popup v-model:show="statistics" round :closeable="true" position="bottom">
             <div class="tg">
                 <div class="tg_header">璇风‘璁ゆ姤宸ヤ俊鎭�</div>
                 <div class="tg_table">
@@ -382,11 +391,11 @@
 </template>
 
 <script setup lang="ts">
-    import { getCurrentInstance, nextTick, onMounted, ref, reactive, computed } from 'vue'
+    import { getCurrentInstance, nextTick, onMounted, ref, reactive, computed, onActivated } from 'vue'
     import { useRouter, useRoute } from "vue-router"
     import { Dialog, Toast } from 'vant'
     import { REGULAR } from '@/utils/utils'
-    import { categoryExtList, queryOne } from '@/apis/PlanningAPI'
+    import { categoryExtList, queryOne, queryList } from '@/apis/PlanningAPI'
     import {
         getBarcodeContent,
         queryById,
@@ -404,6 +413,7 @@
     } from '@/apis/WorkOrderAPI'
     import { QRCodeType } from '@/enum'
     const { proxy }: any = getCurrentInstance()
+    const { $Bus }  = getCurrentInstance().appContext.config.globalProperties
     import VWorkOrderInfo from '@/components/common/WorkOrderInfo.vue'
 
     const router = useRouter()
@@ -414,49 +424,65 @@
     let from: any = reactive({
         time: '',
         defective: [],
-        defectiveName: ''
+        defectiveName: '',
+        durationName: '0灏忔椂0鍒嗛挓',
+        duration: 0,
+        index: 0
     })
+
+    let cate = ref([{ name: '鐢熶骇' }, { name: '鐐规' }])
+    let typeView = ref(0)
+
+    const clickIten = (i: number) => {
+        typeView.value = i
+        if (i === 1) {
+            finished.value = false
+            page.capacity = 1
+            pageDJs()
+        }
+    }
 
     // 棰勮宸ヨ祫
     const expectedSalary = computed(() => {
-        if (!infoBox.value) return 0;
+        if (arrType.value.length === 0) return 0;
         // 鎸変欢璁$畻
-        if (infoBox.value.type == 0) {
+        if (arrType.value[from.index].type == 0) {
             if (!produceFrom.qualified) return 0
-            if (infoBox.value.unqualified == 1) {   // 鏄惁璁″叆涓嶈壇鍝�
+            if (arrType.value[from.index].unqualified == 1) {   // 鏄惁璁″叆涓嶈壇鍝�
                 let total = Number(produceFrom.qualified) + Number(produceFrom.undesirable)
-                return (total * (infoBox.value.salary / 100)).toFixed(2) || 0
+                return (total * (arrType.value[from.index].salary / 100)).toFixed(2) || 0
             } else {
-                return (Number(produceFrom.qualified) * (infoBox.value.salary / 100)).toFixed(2) || 0
+                return (Number(produceFrom.qualified) * (arrType.value[from.index].salary / 100)).toFixed(2) || 0
             }
         } else {
             if (!from.duration) return 0;
             let h = (from.duration / 60 / 60).toFixed(2)
-            return (Number(h) * (infoBox.value.salary / 10 / 10)).toFixed(2) || 0
+            return (Number(h) * (arrType.value[from.index].salary / 10 / 10)).toFixed(2) || 0
         }
     })
 
     // 杈炬爣鐜�
     const complianceRate = computed(() => {
-        if (!infoBox.value) return 0;
+        if (arrType.value.length === 0) return 0;
         if (!produceFrom.qualified && !produceFrom.undesirable) return 0;
         if (!from.duration) return 0;
+        if (!arrType.value[from.index].num) return 0;
         // 鎸変欢璁$畻
         // if (infoBox.value.type == 0) {
-            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)
+            if (arrType.value[from.index].unqualified == 1) {   // 鏄惁璁″叆涓嶈壇鍝�
+                let a = ((Number(produceFrom.qualified) + Number(produceFrom.undesirable)) / (from.duration / 3600)).toFixed(2)
+                let b = (arrType.value[from.index].num / (arrType.value[from.index].times / 3600)).toFixed(2)
                 console.log(a)
                 console.log(b)
-                return (Number(a) / Number(b)).toFixed(2) || 0
+                return ((Number(a) / Number(b)) * 100).toFixed(2)
                 // let total = (Number(from.qualified) + Number(from.undesirable)) / ((from.duration * 60 * 60) * infoBox.value.num / )
                 // return total * infoBox.value.salary;
             } else {
-                let a = (produceFrom.qualified / (from.duration / 60 / 60)).toFixed(2)
-                let b = (infoBox.value.num / (infoBox.value.times / 60 / 60)).toFixed(2)
+                let a = (produceFrom.qualified / (from.duration / 3600)).toFixed(2)
+                let b = (arrType.value[from.index].num / (arrType.value[from.index].times / 3600)).toFixed(2)
                 console.log(a)
                 console.log(b)
-                return (Number(a) / Number(b)).toFixed(2) || 0
+                return ((Number(a) / Number(b)) * 100).toFixed(2)
                 // return Number(from.qualified) * infoBox.value.salary;
             }
         // } else {
@@ -501,6 +527,8 @@
 
     // 鎵爜绫诲瀷
     let type: any = ref('')
+
+    let arrType: any = ref([])
 
     // 缁熻鏁版嵁
     let statisticsData: any = ref([
@@ -652,7 +680,8 @@
                 if (res.code === 200) {
                     djData.value = []
                     finished.value = false
-                    page.page = 0
+                    page.page = 1
+                    djData.value = []
                     pageDJs()
                 }
             })
@@ -717,6 +746,17 @@
             return `${total}${scrap.value[0].company}`
         }
         return ''
+    }
+
+    // 鍒囨崲缁╂晥绫诲瀷
+    const clickPerformanceType = (i: number) => {
+        from.index = i
+        arrType.value.forEach((item: any, index: number) => {
+            if (i === index) {
+                from.type = item.id
+            }
+            item.active = index === i
+        })
     }
 
     // 鍒犻櫎浜у嚭/鎶曟枡
@@ -802,15 +842,28 @@
             if (res.code === 200) {
                 info.value = res.data
                 // 鑾峰彇宸ヨ祫缁╂晥鏁版嵁
-                queryOne({
+                queryList({
                     deleted: 0,
                     departId: res.data.factoryId,
                     materialId: res.data.materialId,
                     procedureId: res.data.procedureId
                 }).then((result: any) => {
                     if (result.code === 200) {
-                        infoBox.value = result.data
+                        if (result.data && result.data.length > 0) {
+                            result.data.forEach((item: any, index: number) => {
+                                item.name = item.type == 0 ? '璁′欢' : '璁℃椂'
+                                item.id = item.type
+                                item.active = index == 0
+                            })
+                            arrType.value = result.data
+                        } else {
+                            arrType.value = []
+                        }
+                        // infoBox.value = result.data
                     }
+                    // if (result.code === 200) {
+                    //     infoBox.value = result.data
+                    // }
                 })
             }
         })
@@ -1194,9 +1247,9 @@
 
     // 纭鎶ュ伐
     const submitBG = () => {
-        if (!from.duration || from.duration <= 0) {
-            return Toast('鎶ュ伐鏃堕暱涓嶈兘涓虹┖')
-        }
+        // if (!from.duration || from.duration <= 0) {
+        //     return Toast('鎶ュ伐鏃堕暱涓嶈兘涓虹┖')
+        // }
         let createUnqualifiedDTOList = from.defective.map((item: any) => {
             return {
                 categoryId: item.id,
@@ -1205,7 +1258,7 @@
         })
         let createWorkorderRecordDTO = {
             workorderId: route.query.id,
-            duration: from.duration,
+            duration: from.duration ? from.duration : 0,
             qualifiedNum: produceFrom.qualified ? produceFrom.qualified : 0,
             unQualifiedNum: produceFrom.undesirable ? produceFrom.undesirable : 0
         }
@@ -1223,11 +1276,38 @@
         })
     }
 
+    onActivated(() => {
+        // $Bus.on('callback1', (res: any)=>{
+        //     console.log(res)
+        //     if (res == 1) {
+        //         djData.value = []
+        //         finished.value = false
+        //         page.page = 1
+        //         djData.value = []
+        //         pageDJs()
+        //     }
+        // })
+        // queryByIds()
+        // getOrocessRecords()
+        // getData()
+    })
+
     onMounted(() => {
-        pageDJs()
+        // $Bus.on('callback1', (res: any)=>{
+        //     if (res == 1) {
+        //         djData.value = []
+        //         finished.value = false
+        //         page.page = 1
+        //         djData.value = []
+        //         pageDJs()
+        //     }
+        // })
+        // pageDJs()
+
         queryByIds()
         getOrocessRecords()
         getData()
+
         // getOrocessRecordCC()
     })
 </script>
@@ -1336,6 +1416,30 @@
                     font-weight: 400;
                     color: #ffffff;
                 }
+            }
+        }
+        .bg_cate {
+            width: 100%;
+            height: 88px;
+            background: #FFFFFF;
+            margin-top: 20px;
+            display: flex;
+            align-items: center;
+            .active {
+                box-sizing: border-box;
+                color: #305ED5 !important;
+                border-bottom: 2PX solid #305ED5;
+            }
+            .bg_cate_item {
+                flex: 1;
+                height: 100%;
+                display: flex;
+                align-items: center;
+                justify-content: center;
+                font-size: 30px;
+                font-family: PingFangSC-Regular, PingFang SC;
+                font-weight: 400;
+                color: #555555;
             }
         }
         .bg_list {
@@ -1657,6 +1761,27 @@
             width: 100%;
             padding: 0 30px 60px 30px;
             box-sizing: border-box;
+            .bg_footer_submit1 {
+                width: 690px;
+                height: 76px;
+                background: #FFFFFF;
+                border-radius: 36px;
+                border: 1px solid #E5E5E5;
+                display: flex;
+                align-items: center;
+                justify-content: center;
+                img {
+                    width: 28px;
+                    height: 28px;
+                    margin-right: 12px;
+                }
+                span {
+                    font-size: 26px;
+                    font-family: PingFangSC-Regular, PingFang SC;
+                    font-weight: 400;
+                    color: #305ED5;
+                }
+            }
             .bg_footer_submit {
                 width: 690px;
                 height: 88px;
@@ -1673,7 +1798,7 @@
         }
         .tg {
             width: 100%;
-            height: 100%;
+            height: 800px;
             padding: 30px;
             box-sizing: border-box;
             .tg_header {
@@ -1706,7 +1831,8 @@
                 }
             }
             .nr {
-                max-height: 400px;
+                width: 100%;
+                max-height: calc(100% - 133px);
                 overflow-x: scroll;
                 .tg_table_nr {
                     width: 100%;

--
Gitblit v1.9.3