From 288d334f5afcb45da57d769c6699cf3b91d7a194 Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期二, 25 六月 2024 16:21:53 +0800
Subject: [PATCH] feat:集装箱显示加判断

---
 pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue |  174 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 160 insertions(+), 14 deletions(-)

diff --git a/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue b/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue
index cf8a82c..69233de 100644
--- a/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue
+++ b/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue
@@ -15,13 +15,13 @@
 					<view class=""
 						v-if="orderType == '杞叆' || orderType == '杞嚭'">鐓ゅ満:{{ coalDetailsData.filedName || '' }}</view>
 					<view class=""
-						v-else>鐓ゅ満:{{ coalDetailsData.filedName || '鏆傛棤' }}</view>
+						v-else>浠撳簱:{{ coalDetailsData.filedName || '鏆傛棤' }}</view>
 				</view>
 			</view>
 			<view class="block-information">
 				<view class="block-main">
 					<view class="basic">
-						<view class="coalName">{{ coalDetailsData.coalName }}</view>
+						<view class="coalName">{{ coalDetailsData.productNames || coalDetailsData.productName }}</view>
 						<view class="status-button"
 							style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/statusbutton.png') no-repeat;
 										background-size: cover;">
@@ -34,7 +34,9 @@
 								size="40"></u-icon></view>
 						<view class="send-date">{{ coalDetailsData.sendDate }}</view>
 					</view>
-					<view class="coal-code">鎻愮叅鍗曠紪鍙�:&nbsp;&nbsp;{{ coalDetailsData.code || '' }}</view>
+					<view class="coal-code">绫诲瀷:&nbsp;&nbsp;{{ coalDetailsData.orderType || '' }}</view>
+					<view class="coal-code">鏀跺彂鍗曠紪鍙�:&nbsp;&nbsp;{{ coalDetailsData.code || '' }}</view>
+					<view class="coal-code">杞︾墝鍙�:&nbsp;&nbsp;{{ coalDetailsData.carNo || '' }}</view>
 					<view class="order-code"
 						v-if="!isSpecial">
 						璁㈠崟缂栧彿:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ coalDetailsData.orderCode || '' }}</view>
@@ -44,26 +46,74 @@
 						v-show="timeLineStatus===9">
 						鏌ョ湅瑁呰浇鎯呭喌
 					</view>
-					<view class="weigh-item">
+					<view class="weigh-item" v-if="isShowClean">
 						<view class="item">
 							<view class="concrete"
 								style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/skin.png') no-repeat;background-size: cover;">
 								鐨�</view>
-							<view class="num">{{ coalDetailsData.skin||"" }}</view>
+							<view class="num" v-if="weightObj.skin">{{  Number(weightObj.skin).toFixed(2) ||"" }}</view>
 						</view>
 						<view class="item">
 							<view class="concrete"
 								style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/hair.png') no-repeat;background-size: cover;">
 								姣�</view>
-							<view class="num">{{ coalDetailsData.hair||""  }}</view>
+							<view class="num" v-if="weightObj.hair">{{  Number(weightObj.hair).toFixed(2) ||""  }}</view>
 						</view>
 						<view class="item">
 							<view class="concrete"
 								style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/clean.png') no-repeat;background-size: cover;">
 								鍑�</view>
-							<view class="num">{{ coalDetailsData.clean||""  }}</view>
+							<view class="num" v-if="weightObj.clean">{{ Number(weightObj.clean).toFixed(2)  ||""  }}</view>
 						</view>
 					</view>
+				</view>
+			</view>
+		</view>
+		<!-- 瀛愯彍鍗� ---琛ㄦ牸 -->
+		<view class="sub-table">
+			<view class="first-line"><combined-title title="浜у搧淇℃伅"></combined-title></view>
+			<view class="table">
+				<uni-table  border 
+		       id="table-box"
+			emptyText="鏆傛棤鏇村鏁版嵁">
+					<uni-tr>
+					    <uni-th align="center" >浜у搧</uni-th>
+						<uni-th align="center">鐨噸</uni-th>
+						<uni-th align="center">姣涢噸</uni-th>
+						<uni-th align="center">鍑�閲�</uni-th>
+					    <uni-th align="center">鎵e惃</uni-th>			
+					</uni-tr>
+					<uni-tr v-for="(subItem, index) in tmTaskCoalList" :key="index">
+						<uni-td align="center">
+							<view class="name">{{ subItem.productName }}</view></uni-td>
+					<uni-td align='right'>
+						<view  v-if="subItem.skin">{{ Number( subItem.skin).toFixed(2)  || ''}}</view>
+					</uni-td>
+					<uni-td align='right'>
+						<view class="name" v-if="subItem.hair">{{ Number(subItem.hair) .toFixed(2) || '' }}</view>
+					</uni-td>
+					<uni-td align='right'>
+						<view class="name" v-if="subItem.clean">{{ Number( subItem.clean).toFixed(2) || '' }}</view>
+					</uni-td>
+					
+				聽   <uni-td align="right">
+					<view>{{ subItem.discount }}</view
+					></uni-td>
+					 
+				</uni-tr>
+				</uni-table>
+			</view>
+			<!-- 璇疯緭鍏ラ泦瑁呯鍙� -->
+			<view class="codeBox" v-if="coalDetailsData.isContainerNum">
+				<text>闆嗚绠卞彿:</text>
+				<view class="inp">
+					<u--input
+						placeholder="璇疯緭鍏ラ泦瑁呯鍙�"
+						v-model="coalDetailsData.containerNumber"
+					></u--input>
+				</view>
+				<view>
+					<u-button type="primary" text="纭畾" @click="enterClick"></u-button>
 				</view>
 			</view>
 		</view>
@@ -71,8 +121,17 @@
 			v-if="originInfoVisible&&!isSpecial">
 			<view class="origin-info_wrapper">
 				<view class="origin-info_content">
-					<view class="first-line"><combined-title title="鍘熷彂淇℃伅"></combined-title></view>
-					<u-form :model="originInfoForm"
+					<!-- 鎶樺彔 -->
+					<zh-collapse  accordion>
+					<zh-collapse-item 
+					class="collItem">
+					<!-- title -->
+					<view slot="title">
+						<view class="first-line"><combined-title title="鍘熷彂淇℃伅"></combined-title></view>
+
+					</view>
+					   <view class="" slot='cont'>
+<u-form :model="originInfoForm"
 						:rules="rules"
 						label-position="top"
 						label-width="160"
@@ -151,6 +210,11 @@
 							:disabled="isModifyoriginInfo"
 							:loading="submitOriginInfoLoading"></u-button>
 					</view>
+					   </view>
+					</zh-collapse-item>
+					</zh-collapse>
+					
+					
 				</view>
 			</view>
 		</view>
@@ -226,7 +290,7 @@
 					:loading="outLoading"
 					loadingText="鎵撳嵃涓�,璇风◢鍊�"></u-button>
 			</view> -->
-			<view class="weigh-button"><u-button text="灞曠ず鎻愮叅鍗�"
+			<view class="weigh-button"><u-button text="灞曠ず鏀跺彂鍗�"
 					@click="showCaolPickUpBill"
 					type="primary"
 					shape="circle"></u-button></view>
@@ -356,6 +420,7 @@
 				swiperList:[],
 				orderPlanId: null,
 				radioValue:'鐓ゅ満',
+				tmTaskCoalList:[],
 				currentNum:0,
 				guideLineshow:false,
 				yyId: null,
@@ -365,7 +430,9 @@
 					affiliationId:'',
 					type:2,
 				},
-				coalDetailsData: {}, // 鎻愮叅鍗曡鎯�
+				coalDetailsData: {
+					tmTaskCoalList:[]
+				}, // 鎻愮叅鍗曡鎯�
 				currentPageCoalStatus: 0, // 褰撳墠椤甸潰鎻愮叅鍗曠姸鎬�
 				// 鑾峰彇鎵�鍦ㄧ鎴垮弬鏁�
 				getWeightHouseObj: {
@@ -452,6 +519,7 @@
 				timeout: '0',
 				wsgShow: false,
 				timeLineStatus: null,
+
 				timeLineEqCode: '',
 				originInfoNotice: '濉啓鍘熷彂淇℃伅鍚庡彲涓婄璁¢噺',
 				submitOriginInfoLoading: false,
@@ -515,6 +583,35 @@
 			},
 			isNeedOrigin() {
 				return uni.getStorageSync('isNeedOrigin')
+			},
+			//鏄惁灞曠ず鐨瘺鍑�
+			isShowClean(){
+				let  flag = true;
+				console.log(this.coalDetailsData.tmTaskCoalList)
+				const tempArr = this.coalDetailsData.tmTaskCoalList.filter(item=> item.isWeight === 1);
+				if(!tempArr.length ){
+					return false; //濡傛灉閮芥病鏈夎繑鍥炲亣
+				} else {
+					flag = 	 tempArr.every(obj => obj['skin'] !== null && obj['clean'] !== null && obj['hair'] !== null );
+					console.log(flag,'f;ag')
+				   return flag;
+				}
+				
+			},
+			//鐨瘺鍑�
+			weightObj(){
+				const index = 0;//涓嬫爣浣� 锛岃鍙栫鍑犵粍鐨勭毊姣涘噣锛�,榛樿鏈�鍚庝竴缁�;
+				const tempArr = this.coalDetailsData.tmTaskCoalList.filter(item=> item.isWeight === 1);
+				 const result =tempArr.find(item=>!item.skin || !item.hair || !item.clean);
+				 console.log(result,'result')
+				 if(result){
+					return result
+				 }else{
+					return  tempArr[index];
+				 }
+
+				
+
 			}
 		},
 		methods: {
@@ -602,6 +699,7 @@
 						this.originInfoForm.coalContactSkin = this.coalDetailsData.skinTwo;
 						this.originInfoForm.coalContactHair = this.coalDetailsData.hairTwo;
 						this.originInfoForm.contactPicture = this.coalDetailsData.contactPicture
+						this.tmTaskCoalList = this.coalDetailsData.tmTaskCoalList;
 						if (this.coalDetailsData.contactPicture) {
 							this.fileList1 = this.coalDetailsData.contactPicture.split(',').map(v => {
 								return {
@@ -1066,13 +1164,44 @@
 					this.$refs.swiperAlbum.onPreviewTap();
 					this.$refs.swiperAlbum.openPage();
 				})
-
+			},
+			enterClick(){
+				console.log('click')
+				this.$reqPut('addContainer',{id:this.coalDetailsData.id,containerNumber:this.coalDetailsData.containerNumber},'json').then(res=>{
+					console.log(res,'res')
+					this.$u.toast('鎿嶄綔鎴愬姛')
+				})
 			}
 		}
 	};
 </script>
 
 <style lang="scss"	scoped>
+.codeBox{
+	height: 100rpx;
+		display: flex;
+		width: 100%;
+		justify-content: space-around;
+		align-items: center;
+	.inp{
+			border: solid 1px #ccc;
+		input{
+		
+			text-indent: 15px;
+		}
+	
+	}
+
+
+}
+.table{
+	width: 100%;
+  /deep/ .uni-table{
+	min-width: 0!important;
+	margin-left: 20rpx;
+  }
+	
+}
 	.guidebox{
 		height:600rpx;
 		padding: 20rpx
@@ -1281,10 +1410,28 @@
 				}
 			}
 		}
+		.sub-table{
+			width: 690rpx;
+			min-height: 300rpx;
+			margin: vww(20) vww(15) vww(13);
+			background: #ffffff;
+			box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12);
+			border-radius: 20rpx;
+			@include flex;
+			    flex-direction: column;
+			justify-content: center;
+			overflow: hidden;
+			position: relative;
+			top: vww(130);
+			align-items: flex-start;
+			/deep/ .uni-table{
+				min-width: 0!important;
+			}
+
+		}
 
 		.origin-info {
 			width: 690rpx;
-			height: 600rpx;
 			margin: vww(20) vww(15) vww(13);
 			background: #ffffff;
 			box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12);
@@ -1297,7 +1444,6 @@
 
 			&_wrapper {
 				width: 650rpx;
-				height: 600rpx;
 				@include flex;
 				flex-direction: column;
 				margin-bottom: vww(20);

--
Gitblit v1.9.1