From 21889b32ae2f342cf1cb78c37734370d0466e978 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 14 九月 2023 17:48:52 +0800
Subject: [PATCH] 组织bug

---
 minipro_standard/pages_adjust/pages/OrderDetail/OrderDetail.vue |  127 ++++++++++++++++++++++++-----------------
 1 files changed, 74 insertions(+), 53 deletions(-)

diff --git a/minipro_standard/pages_adjust/pages/OrderDetail/OrderDetail.vue b/minipro_standard/pages_adjust/pages/OrderDetail/OrderDetail.vue
index 5b49724..31082f7 100644
--- a/minipro_standard/pages_adjust/pages/OrderDetail/OrderDetail.vue
+++ b/minipro_standard/pages_adjust/pages/OrderDetail/OrderDetail.vue
@@ -1,10 +1,6 @@
 <template>
 	<view>
 		<workOrderInfo :orederMessage="info" />
-		<!-- <view class="bg_cate">
-			<view @click="clickIten(index)" :class="typeView == index ? 'bg_cate_item active' : 'bg_cate_item'"
-				v-for="(item, index) in cate" :key="index">{{ item.name }}</view>
-		</view> -->
 		<div class="bg_list">
 			<div class="bg_list_item">
 				<div class="bg_list_item_top">
@@ -113,6 +109,49 @@
 					</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 bg_m"></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">
+								{{ performance.salaryType == 0 ? '璁′欢' : '璁℃椂' }}
+							</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">{{ (performance.salaryPrice / 10 / 10).toFixed(2) }}鍏�/{{ performance.salaryType ==
+			                0 ? '浠�' : '鏃�' }}</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">{{ (performance.salary / 10 / 10).toFixed(2) }}鍏�</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>
+						</div>
+					</div>
+				</div>
+			</div>
 		</div>
 		
 	</view>
@@ -152,13 +191,6 @@
 		data() {
 			return {
 				workorderId: '',
-				cate: [{
-						name: '鐢熶骇'
-					},
-					{
-						name: '鐐规'
-					}
-				],
 				form: {
 					time: '',
 					efective: [],
@@ -186,17 +218,24 @@
 					qualified: '', // 鍚堟牸
 					undesirableId: '',
 					undesirable: 5 // 涓嶈壇
+				},
+				pages: {
+					capacity: 10,
+					page: 1,
+					total: 0
 				},
 				djData: [],
 				cateList: [],
-				finished: true,
+				finished: true,
+				performance: {}
 			};
 		},
 		onLoad(obj) {
 			this.workorderId = obj.id
 			this.queryByIds()
 			this.getOrocessRecords()
-			this.getData()
+			this.getData()
+			this.pageDJs()
 			this.getOrocessRecordCC()
 			uni.$on('spotAdd', () => {
 				if (this.typeView == 1) {
@@ -206,43 +245,23 @@
 			})
 		},
 		computed: {
-			expectedSalary() {
-				if (this.arrType.length === 0) return 0;
-				// 鎸変欢璁$畻
-				if (this.arrType[this.form.index].type == 0) {
-					if (!this.produceFrom.qualified) return 0
-					if (this.arrType[this.form.index].unqualified == 1) { // 鏄惁璁″叆涓嶈壇鍝�
-						let total = Number(this.produceFrom.qualified) + Number(this.produceFrom.undesirable)
-						return (total * (this.arrType[this.form.index].salary / 100)).toFixed(2) || 0
-					} else {
-						return (Number(this.produceFrom.qualified) * (this.arrType[this.form.index].salary / 100)).toFixed(
-							2) || 0
-					}
-				} else {
-					if (!this.form.duration) return 0;
-					let h = (this.form.duration / 60 / 60).toFixed(2)
-					return (Number(h) * (this.arrType[this.form.index].salary / 10 / 10)).toFixed(2) || 0
-				}
-			},
 			complianceRate() {
-				if (this.arrType.length === 0) return 0;
-				if (!this.produceFrom.qualified && !this.produceFrom.undesirable) return 0;
-				if (!this.form.duration) return 0;
-				if (!this.arrType[this.form.index].num) return 0;
-				// 鎸変欢璁$畻
-				// if (infoBox.value.type == 0) {
-				if (this.arrType[this.form.index].unqualified == 1) { // 鏄惁璁″叆涓嶈壇鍝�
-					let a = ((Number(this.produceFrom.qualified) + Number(this.produceFrom.undesirable)) / (this.form
+				if (!this.performance) return 0;
+				if (!this.performance.duration) return 0;
+				
+				if (!this.performance.qualifiedNum && !this.performance.unqualifiedNum) return 0;
+				if (this.performance.salaryUnqualified == 1) { // 鏄惁璁″叆涓嶈壇鍝�
+					let a = ((Number(this.performance.qualifiedNum) + Number(this.performance.unqualifiedNum)) / (this.performance
 						.duration / 3600)).toFixed(2)
-					let b = (this.arrType[this.form.index].num / (this.arrType[form.index].times / 3600)).toFixed(2)
+					let b = (this.performance.salaryNum / (this.performance.salaryTimes / 3600)).toFixed(2)
 					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 = (this.produceFrom.qualified / (this.form.duration / 3600)).toFixed(2)
-					let b = (this.arrType[this.form.index].num / (this.arrType[this.form.index].times / 3600)).toFixed(2)
+				} else {
+					let a = (this.performance.qualifiedNum / (this.performance.duration / 3600)).toFixed(2)
+					// let b = (this.arrType[this.form.index].num / (this.arrType[this.form.index].times / 3600)).toFixed(2)
+					let b = (this.performance.salaryNum / (this.performance.salaryTimes / 3600)).toFixed(2)
 					return ((Number(a) / Number(b)) * 100).toFixed(2)
-					// return Number(from.qualified) * infoBox.value.salary;
 				}
 			}
 		},
@@ -268,7 +287,7 @@
 					this.pageDJs()
 				}
 			},
-			getLists() {
+			getLists() {
 				if (!this.finished) {
 					return
 				}
@@ -343,7 +362,7 @@
 					url: `/pages_inspect/pages/InspectionRecords/InspectionRecords?id=${this.workorderId}`
 				})
 			},
-			pageDJs() {
+			pageDJs() {
 				pageDJ({
 						capacity: this.pages.capacity,
 						page: this.pages.page,
@@ -427,7 +446,7 @@
 			},
 			queryByIds() {
 				queryById(this.workorderId)
-					.then(res => {
+					.then(res => {
 						this.info = res.data
 						queryList({
 							deleted: 0,
@@ -464,10 +483,13 @@
 			getOrocessRecordCC() {
 				getWorkorderRecordListStandard({
 					workorderId: this.workorderId
-				}).then(res => {
+				}).then(res => {
+					console.log(res.data[0]);
+					debugger
 					if (res.data.length > 0) {
 						this.produceFrom.qualified = res.data[0].qualifiedNum
 						this.produceFrom.undesirable = res.data[0].unqualifiedNum
+						this.performance = res.data[0]
 					}
 				})
 			},
@@ -512,13 +534,13 @@
 		width: 100%;
 		display: flex;
 		flex-direction: column;
-		margin-top: 30rpx;
+		// margin-top: 30rpx;
 
 		.bg_list_item {
 			display: flex;
 			flex-direction: column;
 			// margin-bottom: 40rpx;
-			border-bottom: 40rpx #f7f7f7 solid;
+			// border-bottom: 40rpx #f7f7f7 solid;
 
 			.kong {
 				text-align: center;
@@ -535,9 +557,8 @@
 				display: flex;
 				align-items: center;
 				justify-content: space-between;
-				padding-left: 30rpx;
-				padding-right: 30rpx;
-				margin-bottom: 30rpx;
+				padding: 30rpx;
+				background-color: #f7f7f7;
 
 				.bg_list_item_top_left {
 					display: flex;

--
Gitblit v1.9.3