From ca2200ba53b236e8902b706c444375408c782f07 Mon Sep 17 00:00:00 2001
From: Mr.Zhang <710666463@qq.com>
Date: 星期一, 18 九月 2023 15:58:45 +0800
Subject: [PATCH] 09-18 小程序

---
 minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue |  404 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 206 insertions(+), 198 deletions(-)

diff --git a/minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue b/minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue
index d7020d8..72eafcb 100644
--- a/minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue
+++ b/minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue
@@ -15,202 +15,205 @@
 				<image src="@/static/ic_ar@2x.png" alt="" />
 			</view>
 		</view>
-		<view class="bg_list">
-			<view class="bg_list_item">
-				<view class="bg_list_item_top">
-					<view class="bg_list_item_top_left">
-						<view class="bg_list_item_top_left_x"></view>
-						<text>鐢熶骇淇℃伅</text>
-					</view>
-				</view>
-				<view class="bg_list_item_h">
-					<view class="bg_list_item_num" @click="openDev">
-						<view class="bg_list_item_num_item">
-							<text>鐢熶骇璁惧</text>
-							<view class="bg_list_item_num_item_sr">
-								<text :style="{color: from.deviceName ? '#333' : ''}">{{from.deviceName ? from.deviceName : '璇烽�夋嫨'}}</text>
-								<image src="@/static/ic_ar@2x.png" alt="" />
-							</view>
+		<template v-if="plansId">
+			<view class="bg_list">
+				<view class="bg_list_item">
+					<view class="bg_list_item_top">
+						<view class="bg_list_item_top_left">
+							<view class="bg_list_item_top_left_x"></view>
+							<text>鐢熶骇淇℃伅</text>
 						</view>
 					</view>
-					<view class="bg_list_item_num" @click="userShow = true">
-						<view class="bg_list_item_num_item">
-							<text>鐢熶骇浜哄憳</text>
-							<view class="bg_list_item_num_item_sr">
-								<text :style="{color: from.userName ? '#333' : ''}">{{from.userName ? from.userName : '璇烽�夋嫨'}}</text>
-								<image src="@/static/ic_ar@2x.png" alt="" />
-							</view>
-						</view>
-					</view>
-				</view>
-			</view>
-			<view class="bg_list_item">
-				<view class="bg_list_item_top">
-					<view class="bg_list_item_top_left">
-						<view class="bg_list_item_top_left_x"></view>
-						<text>鐢熶骇鎶曟枡</text>
-					</view>
-					<view class="bg_list_item_top_right" @click="openMaterial" v-if="(hasBom == 1 && bomType != 1) || hasBom == 0">
-						<image src="@/static/gongdan_ic_shoudong@2x.png" alt="" />
-						<text>鏂板鎶曟枡</text>
-					</view>
-				</view>
-				<template v-if="wuList.length > 0 && !(hasBom == 1 && bomType == 1)">
-					<van-swipe-cell v-for="(item, index) in wuList" :key="index">
-						<view class="bg_list_item_h">
-							<view class="bg_list_item_num">
-								<view class="bg_list_item_num_item">
-									<view class="bg_list_item_num_item_wl">
-										<text>{{ item.materialName }}{{ item.procedureName ? ` | ${item.procedureName}` : '' }}</text>
-										<view class="bg_list_item_num_item_wl_lx">
-											<text class="green" v-if="item.qualityType == 0">鍚堟牸&nbsp;/&nbsp;</text>
-											<text class="yellow" v-if="item.qualityType == 1">涓嶈壇&nbsp;/&nbsp;</text>
-											<text class="red" v-if="item.qualityType == 2">鎶ュ簾&nbsp;/&nbsp;</text>
-											<text>{{ item.locationName || '-' }}&nbsp;/&nbsp;</text>
-											<text>{{ item.batch || '-' }}</text>
-										</view>
-									</view>
-									<view class="bg_list_item_num_item_sr">
-										<u--input
-										    placeholder="璇疯緭鍏�"
-										    border="surround"
-											type="number"
-											:customStyle="{width: '100%'}"
-										    v-model="item.num"
-											@input="inputwl(index)"
-										  ></u--input>
-										<!-- <input type="number" v-model="item.num" @input="inputwl(index)" /> -->
-										<text>{{ item.unitName }}</text>
-									</view>
+					<view class="bg_list_item_h">
+						<view class="bg_list_item_num" @click="openDev">
+							<view class="bg_list_item_num_item">
+								<text>鐢熶骇璁惧</text>
+								<view class="bg_list_item_num_item_sr">
+									<text :style="{color: from.deviceName ? '#333' : ''}">{{from.deviceName ? from.deviceName : '璇烽�夋嫨'}}</text>
+									<image src="@/static/ic_ar@2x.png" alt="" />
 								</view>
 							</view>
 						</view>
-						<template #right>
-							<van-button style="height: 100%;" @click="deleItem(index)" square text="鍒犻櫎" type="danger" />
-						</template>
-					</van-swipe-cell>
-				</template>
-				<template v-else-if="wuList.length == 0 && !(hasBom == 1 && bomType == 1)">
-					<view class="kong">
-						<text>鏆傛棤鏁版嵁</text>
-					</view>
-				</template>
-				<view class="kong" v-if="hasBom == 1 && bomType == 1">
-					<text>褰撳墠宸ュ簭鏃犻渶鎶曟枡</text>
-				</view>
-			</view>
-			<view class="bg_list_item bottomval">
-				<view class="bg_list_item_top">
-					<view class="bg_list_item_top_left">
-						<view class="bg_list_item_top_left_x"></view>
-						<text>浜у嚭鏄庣粏</text>
-					</view>
-				</view>
-				<view class="bg_list_item_h">
-					<view class="bg_list_item_num">
-						<view class="bg_list_item_num_item">
-							<text><text>*</text>鑹搧鏁�</text>
-							<view class="bg_list_item_num_item_sr">
-								<u--input
-								    placeholder="璇疯緭鍏�"
-								    border="surround"
-									type="number"
-									:customStyle="{width: '180rpx'}"
-								    v-model="from.qualified"
-									@input="changeNum(1)"
-								  ></u--input>
-								<!-- <input type="number" v-model="from.qualified" @input="changeNum(1)" placeholder="璇疯緭鍏�" /> -->
-								<text v-if="from.processPlan">{{from.processPlan.unitName}}</text>
+						<view class="bg_list_item_num" @click="userShow = true">
+							<view class="bg_list_item_num_item">
+								<text>鐢熶骇浜哄憳</text>
+								<view class="bg_list_item_num_item_sr">
+									<text :style="{color: from.userName ? '#333' : ''}">{{from.userName ? from.userName : '璇烽�夋嫨'}}</text>
+									<image src="@/static/ic_ar@2x.png" alt="" />
+								</view>
 							</view>
 						</view>
 					</view>
-					<view class="bg_list_item_num">
-						<view class="bg_list_item_num_item">
-							<text>涓嶈壇鏁�</text>
-							<view class="bg_list_item_num_item_sr">
-								<u--input
-								    placeholder="璇疯緭鍏�"
-								    border="surround"
-									type="number"
-									:customStyle="{width: '180rpx'}"
-								    v-model="from.undesirable"
-									@input="changeNum(2)"
-								  ></u--input>
-								<!-- <input type="number" v-model="from.undesirable" @input="changeNum(2)" placeholder="璇疯緭鍏�" /> -->
-								<text v-if="from.processPlan">{{from.processPlan.unitName}}</text>
+				</view>
+				<view class="bg_list_item">
+					<view class="bg_list_item_top">
+						<view class="bg_list_item_top_left">
+							<view class="bg_list_item_top_left_x"></view>
+							<text>鐢熶骇鎶曟枡</text>
+						</view>
+						<view class="bg_list_item_top_right" @click="openMaterial" v-if="(hasBom == 1 && bomType != 1) || hasBom == 0">
+							<image src="@/static/gongdan_ic_shoudong@2x.png" alt="" />
+							<text>鏂板鎶曟枡</text>
+						</view>
+					</view>
+					<template v-if="wuList.length > 0 && !(hasBom == 1 && bomType == 1)">
+						<van-swipe-cell v-for="(item, index) in wuList" :key="index">
+							<view class="bg_list_item_h">
+								<view class="bg_list_item_num">
+									<view class="bg_list_item_num_item">
+										<view class="bg_list_item_num_item_wl">
+											<text>{{ item.materialName }}{{ item.procedureName ? ` | ${item.procedureName}` : '' }}</text>
+											<view class="bg_list_item_num_item_wl_lx">
+												<text class="green" v-if="item.qualityType == 0">鍚堟牸&nbsp;/&nbsp;</text>
+												<text class="yellow" v-if="item.qualityType == 1">涓嶈壇&nbsp;/&nbsp;</text>
+												<text class="red" v-if="item.qualityType == 2">鎶ュ簾&nbsp;/&nbsp;</text>
+												<text>{{ item.locationName || '-' }}&nbsp;/&nbsp;</text>
+												<text>{{ item.batch || '-' }}</text>
+											</view>
+										</view>
+										<view class="bg_list_item_num_item_sr">
+											<u--input
+											    placeholder="璇疯緭鍏�"
+											    border="surround"
+												type="number"
+												:customStyle="{width: '100%'}"
+											    v-model="item.num"
+												@input="inputwl(index)"
+											  ></u--input>
+											<!-- <input type="number" v-model="item.num" @input="inputwl(index)" /> -->
+											<text>{{ item.unitName }}</text>
+										</view>
+									</view>
+								</view>
+							</view>
+							<template #right>
+								<van-button style="height: 100%;" @click="deleItem(index)" square text="鍒犻櫎" type="danger" />
+							</template>
+						</van-swipe-cell>
+					</template>
+					<template v-else-if="wuList.length == 0 && !(hasBom == 1 && bomType == 1)">
+						<view class="kong">
+							<text>鏆傛棤鏁版嵁</text>
+						</view>
+					</template>
+					<view class="kong" v-if="hasBom == 1 && bomType == 1">
+						<text>褰撳墠宸ュ簭鏃犻渶鎶曟枡</text>
+					</view>
+				</view>
+				<view class="bg_list_item bottomval">
+					<view class="bg_list_item_top">
+						<view class="bg_list_item_top_left">
+							<view class="bg_list_item_top_left_x"></view>
+							<text>浜у嚭鏄庣粏</text>
+						</view>
+					</view>
+					<view class="bg_list_item_h">
+						<view class="bg_list_item_num">
+							<view class="bg_list_item_num_item">
+								<text><text>*</text>鑹搧鏁�</text>
+								<view class="bg_list_item_num_item_sr">
+									<u--input
+									    placeholder="璇疯緭鍏�"
+									    border="surround"
+										type="number"
+										:customStyle="{width: '180rpx'}"
+									    v-model="from.qualified"
+										@input="changeNum(1)"
+									  ></u--input>
+									<!-- <input type="number" v-model="from.qualified" @input="changeNum(1)" placeholder="璇疯緭鍏�" /> -->
+									<text v-if="from.processPlan">{{from.processPlan.unitName}}</text>
+								</view>
+							</view>
+						</view>
+						<view class="bg_list_item_num">
+							<view class="bg_list_item_num_item">
+								<text>涓嶈壇鏁�</text>
+								<view class="bg_list_item_num_item_sr">
+									<u--input
+									    placeholder="璇疯緭鍏�"
+									    border="surround"
+										type="number"
+										:customStyle="{width: '180rpx'}"
+									    v-model="from.undesirable"
+										@input="changeNum(2)"
+									  ></u--input>
+									<!-- <input type="number" v-model="from.undesirable" @input="changeNum(2)" placeholder="璇疯緭鍏�" /> -->
+									<text v-if="from.processPlan">{{from.processPlan.unitName}}</text>
+								</view>
+							</view>
+						</view>
+						<view class="bg_list_item_num" v-if="from.undesirable > 0">
+							<view class="bg_list_item_num_item" @click="openBL">
+								<!-- <text>*</text> -->
+								<text>涓嶈壇椤�</text>
+								<view class="bg_list_item_num_item_sr">
+									<text class="wulll" :style="{color: from.defectiveName ? '#305ED5' : ''}">{{from.defectiveName ? from.defectiveName : '璁剧疆'}}</text>
+									<image src="@/static/ic_ar@2x.png" alt="" />
+								</view>
 							</view>
 						</view>
 					</view>
-					<view class="bg_list_item_num" v-if="from.undesirable > 0">
-						<view class="bg_list_item_num_item" @click="openBL">
-							<!-- <text>*</text> -->
-							<text>涓嶈壇椤�</text>
-							<view class="bg_list_item_num_item_sr">
-								<text class="wulll" :style="{color: from.defectiveName ? '#305ED5' : ''}">{{from.defectiveName ? from.defectiveName : '璁剧疆'}}</text>
-								<image src="@/static/ic_ar@2x.png" alt="" />
+				</view>
+				<view class="bg_plan" @click="TimeShow = true">
+					<view class="bg_plan_label">
+						<text>鎶ュ伐鏃堕暱</text>
+					</view>
+					<view class="bg_plan_label_val">
+						<text :style="{color: from.durationName ? '#333' : ''}">{{from.durationName ? from.durationName : '璇烽�夋嫨'}}</text>
+						<image src="@/static/ic_ar@2x.png" alt="" />
+					</view>
+				</view>
+				<view class="bg_list_item" v-if="arrType && arrType.length > 0 && from.duration > 0">
+					<view class="bg_list_item_top">
+						<view class="bg_list_item_top_left">
+							<view class="bg_list_item_top_left_x"></view>
+							<text>宸ヨ祫缁╂晥</text>
+						</view>
+					</view>
+					<view class="bg_list_item_h">
+						<view class="bg_list_item_num">
+							<view class="bg_list_item_num_item">
+								<text>璁′欢鏂瑰紡</text>
+								<view class="bg_list_item_num_item_list">
+									<view :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 }}</view>
+								</view>
+							</view>
+						</view>
+						<view class="bg_list_item_num">
+							<view class="bg_list_item_num_item">
+								<text>宸ヨ祫鍗曚环</text>
+								<view class="bg_list_item_num_item_sr">
+									<text class="color1">{{(arrType[from.index].salary / 10 / 10).toFixed(2)}}鍏�/{{arrType[from.index].type == 0 ? '浠�' : '鏃�'}}</text>
+								</view>
+							</view>
+						</view>
+						<view class="bg_list_item_num">
+							<view class="bg_list_item_num_item">
+								<text>棰勮宸ヨ祫</text>
+								<view class="bg_list_item_num_item_sr">
+									<text class="color1">{{expectedSalary}}鍏�</text>
+								</view>
+							</view>
+						</view>
+						<view class="bg_list_item_num">
+							<view class="bg_list_item_num_item">
+								<text>杈炬爣鐜�</text>
+								<view class="bg_list_item_num_item_sr">
+									<text class="color1">{{complianceRate}}%</text>
+								</view>
 							</view>
 						</view>
 					</view>
 				</view>
 			</view>
-			<view class="bg_plan" @click="TimeShow = true">
-				<view class="bg_plan_label">
-					<text>鎶ュ伐鏃堕暱</text>
-				</view>
-				<view class="bg_plan_label_val">
-					<text :style="{color: from.durationName ? '#333' : ''}">{{from.durationName ? from.durationName : '璇烽�夋嫨'}}</text>
-					<image src="@/static/ic_ar@2x.png" alt="" />
-				</view>
+			<!--  鎶ュ伐鎸夐挳  -->
+			<view class="bh_zw"></view>
+			<view class="bg_footer">
+				<view class="bg_footer_submit1" @click="continueSubmit">缁х画鎶ュ伐</view>
+				<view class="bg_footer_submit" @click="submit">鎻愪氦</view>
 			</view>
-			<view class="bg_list_item" v-if="arrType && arrType.length > 0 && from.duration > 0">
-				<view class="bg_list_item_top">
-					<view class="bg_list_item_top_left">
-						<view class="bg_list_item_top_left_x"></view>
-						<text>宸ヨ祫缁╂晥</text>
-					</view>
-				</view>
-				<view class="bg_list_item_h">
-					<view class="bg_list_item_num">
-						<view class="bg_list_item_num_item">
-							<text>璁′欢鏂瑰紡</text>
-							<view class="bg_list_item_num_item_list">
-								<view :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 }}</view>
-							</view>
-						</view>
-					</view>
-					<view class="bg_list_item_num">
-						<view class="bg_list_item_num_item">
-							<text>宸ヨ祫鍗曚环</text>
-							<view class="bg_list_item_num_item_sr">
-								<text class="color1">{{(arrType[from.index].salary / 10 / 10).toFixed(2)}}鍏�/{{arrType[from.index].type == 0 ? '浠�' : '鏃�'}}</text>
-							</view>
-						</view>
-					</view>
-					<view class="bg_list_item_num">
-						<view class="bg_list_item_num_item">
-							<text>棰勮宸ヨ祫</text>
-							<view class="bg_list_item_num_item_sr">
-								<text class="color1">{{expectedSalary}}鍏�</text>
-							</view>
-						</view>
-					</view>
-					<view class="bg_list_item_num">
-						<view class="bg_list_item_num_item">
-							<text>杈炬爣鐜�</text>
-							<view class="bg_list_item_num_item_sr">
-								<text class="color1">{{complianceRate}}%</text>
-							</view>
-						</view>
-					</view>
-				</view>
-			</view>
-		</view>
-		<!--  鎶ュ伐鎸夐挳  -->
-		<view class="bh_zw"></view>
-		<view class="bg_footer">
-			<view class="bg_footer_submit1" @click="continueSubmit">缁х画鎶ュ伐</view>
-			<view class="bg_footer_submit" @click="submit">鎻愪氦</view>
-		</view>
+		</template>
+		
 		<!-- 鐢熶骇浜哄憳 -->
 		<user :show="userShow" @close="userShow = false" @value="onConfirm1" />
 		<!-- 鐢熶骇璁惧 -->
@@ -301,34 +304,39 @@
 			...mapState(['userInfo']),
 			// 棰勮宸ヨ祫
 			expectedSalary() {
+				
 				if (this.arrType.length === 0) return 0;
-				if (this.arrType[this.from.index].type == 0) {
-					if (!this.from.qualified) return 0
-					if (this.arrType[this.from.index].unqualified == 1) {   // 鏄惁璁″叆涓嶈壇鍝�
-						let total = Number(this.from.qualified) + Number(this.from.undesirable)
-						return (total * (this.arrType[from.index].salary / 10 / 10)).toFixed(2)
+				let { index, qualified, undesirable, duration } = this.from
+				let temp = this.arrType[index]
+				if (temp.type == 0) {
+					if (!qualified) return 0
+					if (temp.unqualified == 1) {   // 鏄惁璁″叆涓嶈壇鍝�
+						let total = Number(qualified) + Number(undesirable)
+						return (total * (temp.salary / 10 / 10)).toFixed(2)
 					} else {
-						return (Number(this.from.qualified) * (this.arrType[this.from.index].salary / 10 / 10)).toFixed(2)
+						return (Number(qualified) * (temp.salary / 10 / 10)).toFixed(2)
 					}
 				} else {
-					if (!this.from.duration) return 0;
-					let h = (this.from.duration / 60 / 60).toFixed(2)
-					return (Number(h) * (this.arrType[this.from.index].salary / 10 / 10)).toFixed(2)
+					if (!duration) return 0;
+					let h = (duration / 60 / 60).toFixed(2)
+					return (Number(h) * (temp.salary / 10 / 10)).toFixed(2)
 				}
 			},
 			// 杈炬爣鐜�
 			complianceRate() {
 				if (this.arrType.length === 0) return 0;
-				if (!this.from.qualified && !this.from.undesirable) return 0;
-				if (!this.from.duration) return 0;
-				if (!this.arrType[this.from.index].num) return 0;
-				if (this.arrType[this.from.index].unqualified == 1) {   // 鏄惁璁″叆涓嶈壇鍝�
-					let a = ((Number(this.from.qualified) + Number(this.from.undesirable)) / (this.from.duration / 3600)).toFixed(2)
-					let b = (this.arrType[this.from.index].num / (this.arrType[this.from.index].times / 3600)).toFixed(2)
+				let { index, qualified, undesirable, duration } = this.from
+				let temp = this.arrType[index]
+				if (!qualified && !undesirable) return 0;
+				if (!duration) return 0;
+				if (!temp.num) return 0;
+				if (temp.unqualified == 1) {   // 鏄惁璁″叆涓嶈壇鍝�
+					let a = ((Number(qualified) + Number(undesirable)) / (duration / 3600)).toFixed(2)
+					let b = (temp.num / (temp.times / 3600)).toFixed(2)
 					return ((Number(a) / Number(b)) * 100).toFixed(2)
 				} else {
-					let a = (this.from.qualified / (this.from.duration / 3600)).toFixed(2)
-					let b = (this.arrType[this.from.index].num / (this.arrType[this.from.index].times / 3600)).toFixed(2)
+					let a = (qualified / (duration / 3600)).toFixed(2)
+					let b = (temp.num / (temp.times / 3600)).toFixed(2)
 					return ((Number(a) / Number(b)) * 100).toFixed(2)
 				}
 			}
@@ -360,8 +368,8 @@
 				this.wuList = []
 				this.from.defective = []
 				this.from.defectiveName = ''
-				this.from.userName = ''
-				this.from.userId = ''
+				// this.from.userName = ''
+				// this.from.userId = ''
 				// 鑾峰彇璁惧
 				getDeviceByCondition({ procedureId: data.obj.procedureId })
 					.then(res1 => {

--
Gitblit v1.9.3