From cbfc1953c7e7333dbcb1e43fff15433ed24fc543 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期日, 08 十月 2023 17:28:32 +0800
Subject: [PATCH] 修正打印入门证接口错误 增加装卸员页面详情信息

---
 pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue |  124 +++++++++++++++++++++++++----------------
 1 files changed, 76 insertions(+), 48 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 7e18b5a..f7db267 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
@@ -2,6 +2,9 @@
 	<view class="bill-of-lading-details">
 		<view class="top-banner"
 			style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/loadingbanner.png') no-repeat;background-size: cover;">
+			<u-notice-bar :text="originInfoNotice"
+				v-if="originInfoVisible"
+				fontSize='36'></u-notice-bar>
 			<view class="top-information">
 				<view class="cutomer-name"
 					v-if="orderType == '杞叆' || orderType == '杞嚭'">鐓ゅ満:{{ coalDetailsData.toFiledName || '' }}</view>
@@ -22,7 +25,7 @@
 						<view class="status-button"
 							style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/statusbutton.png') no-repeat;
 										background-size: cover;">
-							{{ coalStatus[coalDetailsData.status] || '' }}
+							{{coalStatus[correctStatus]||''}}
 						</view>
 					</view>
 					<view class="time">
@@ -63,6 +66,7 @@
 				<view class="origin-info_content">
 					<view class="first-line"><combined-title title="鍘熷彂淇℃伅"></combined-title></view>
 					<u-form :model="originInfoForm"
+						:rules="rules"
 						label-position="top"
 						label-width="160"
 						:label-style="{'marginLeft':'9px'}"
@@ -168,7 +172,7 @@
 						plain
 						@click="rcsqClick"
 						shape="circle"
-						:disabled="coalDetailsData.status === 3"></u-button>
+						:disabled="correctStatus>= 3"></u-button>
 				</view>
 				<view class="bottom-button">
 					<u-button text="鏀剧┖"
@@ -260,6 +264,10 @@
 		components: {
 			combinedTitle
 		},
+		onPullDownRefresh() {
+			this.getTakeCoal(); //鑾峰彇鎻愮叅鍗曡鎯�
+			uni.stopPullDownRefresh();
+		},
 		onLoad(value) {
 			this.orderPlanId = value.orderPlanId;
 			this.yyId = value.yyId;
@@ -275,6 +283,7 @@
 				this.getTakeCoal(); //鑾峰彇鎻愮叅鍗曡鎯�
 			}
 			this.init(); //鑾峰彇鏃ュ織
+			this.getgetService(); //鑾峰彇瀹㈡湇
 		},
 		onShow() {
 			this.coalDayPage(); //鑾峰彇鏃ュ織 瀹氭椂浠诲姟
@@ -327,7 +336,7 @@
 					serviecePhone: ''
 				},
 				coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅浠�', '鍑虹叅浠�', '鏀剧┖', '浣滃簾', '鍏ュ満鐢宠',
-					'杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�'
+					'杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�', '杩斿洖鍔犲噺鍚�', '瓒呮椂', '鎵撳嵃涓�', '鎵撳嵃涓�'
 				], // 鐘舵��
 				weighHouseCode: '',
 				// 鏀剧┖寮圭獥鎺у埗鍙橀噺
@@ -382,29 +391,11 @@
 				originInfoVisible: false,
 				fileList1: [], //鍥剧墖鍒楄〃
 				deletable: true,
-				rules: {
-					contactPicture: {
-						type: 'string',
-						required: true,
-						message: '璇蜂笂浼犲師鍙戠鍗曞浘鐗�',
-						trigger: ['blur', 'change']
-					},
-					coalContactHair: {
-						type: 'string',
-						required: true,
-						message: '璇疯緭鍏ユ瘺閲�',
-						trigger: ['blur', 'change']
-					},
-					coalContactSkin: {
-						type: 'string',
-						required: true,
-						message: '璇疯緭鍏ョ毊閲�',
-						trigger: ['blur', 'change']
-					}
-				},
+				rules: {},
 				timeout: '0',
-				wsgShow: false
-
+				wsgShow: false,
+				timeLineStatus: null,
+				originInfoNotice: '濉啓鍘熷彂淇℃伅鍚庡彲涓婄璁¢噺'
 			};
 		},
 		watch: {
@@ -438,7 +429,7 @@
 				return this.coalDetailsData.hair !== 0 || this.coalDetailsData.skin !== 0;
 			},
 			isapproach() {
-				return this.currentPageCoalStatus !== 3;
+				return this.correctStatus !== 3
 			},
 			coalContactClean() {
 				let xx = BigNumber(this.originInfoForm.coalContactHair ? this.originInfoForm.coalContactHair : 0)
@@ -454,6 +445,10 @@
 				let minutes = ("0" + currentDate.getMinutes()).slice(-2);
 				let formattedDate = year + "-" + month + "-" + date + " " + hours + ":" + minutes;
 				return formattedDate
+			},
+			correctStatus() {
+				return this.currentPageCoalStatus === this.timeLineStatus ? this.currentPageCoalStatus : this
+					.timeLineStatus
 			}
 		},
 		methods: {
@@ -461,7 +456,7 @@
 			init() {
 				this.$reqGet('coalDayPage', { id: this.orderPlanId, timeout: this.timeout }).then(res => {
 					if (res.code == 0) {
-						// this.dayRZ = res.data;
+						this.timeLineStatus = res.data[0].taskStatus
 						this.dayRZ = res.data.map(v => {
 							let slicedate = v.taskStatusDes.slice(0, 10);
 							if (slicedate == this.currentDate) {
@@ -490,7 +485,7 @@
 						uni.setStorageSync('customeropenId', this.serviceInfoObj.openId);
 						uni.setStorageSync('customerName', this.serviceInfoObj.openName);
 					}
-				});
+				})
 			},
 			// 鑾峰彇鎻愮叅鍗曡鎯�
 			getTakeCoal() {
@@ -534,9 +529,10 @@
 						// 鍘熷彂淇℃伅鍥炴樉浠ュ強鎺у埗鏄惁鍙慨鏀�
 						this.haveInputOrigin = !this.coalDetailsData.skinTwo && this.coalDetailsData.orderType ===
 							'澶栬喘'
-						this.deletable = this.isModifyoriginInfo = this.coalDetailsData.status > 3
+						this.deletable = this.coalDetailsData.status > 3
 						this.originInfoForm.coalContactSkin = this.coalDetailsData.skinTwo;
 						this.originInfoForm.coalContactHair = this.coalDetailsData.hairTwo;
+						this.originInfoForm.contactPicture = this.coalDetailsData.contactPicture
 						if (this.coalDetailsData.contactPicture) {
 							this.fileList1 = this.coalDetailsData.contactPicture.split(',').map(v => {
 								return {
@@ -567,8 +563,6 @@
 						}
 					}
 				}).then(() => {
-					this.getgetService(); //鑾峰彇瀹㈡湇
-				}).then(() => {
 					// 鍒ゆ柇褰撳墠鏃堕棿鏄惁瓒呭嚭棰勭害鏃堕棿
 					setTimeout(() => {
 						let endTime = this.coalDetailsData.yuYueSection.slice(0, 10) + ' ' + this
@@ -586,6 +580,7 @@
 				this.interval = setInterval(() => {
 					this.$reqGet('coalDayPage', { id: this.orderPlanId, timeout: this.timeout }).then(res => {
 						if (res.code == 0) {
+							this.timeLineStatus = res.data[0].taskStatus
 							this.dayRZ = res.data.map(v => {
 								let slicedate = v.taskStatusDes.slice(0, 10);
 								if (slicedate == this.currentDate) {
@@ -694,6 +689,13 @@
 						this.weighData.gateCameraId = res.data.lastEquipmentId;
 						this.weighData.equipmentCode = res.data.lastEquipmentCode;
 						this.weighData.sceneInOut = res.data.sceneInOut;
+						let form = {
+							sceneId: this.weighData.sceneId,
+							gateCameraId: this.weighData.gateCameraId,
+							equipmentCode: this.weighData.equipmentCode,
+							sceneInOut: this.weighData.sceneInOut,
+						}
+						uni.setStorageSync('WeighHouseForm', JSON.stringify(form))
 						this.weighHouseCode = res.data.code;
 						uni.navigateTo({
 							url: `/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice?takeCoalId=${this.orderPlanId}&sceneId=${
@@ -750,24 +752,41 @@
 					title: '姝e湪鎵撳嵃涓�,璇风◢鍚�'
 				})
 				this.enterLoading = true
-				this.$reqGet('printer', { type: 2, tmId: this.coalDetailsData.id }).then(res => {
-					uni.hideLoading()
-					this.enterLoading = false
-					console.log(res);
-					if (res.code === 0) {
-						this.$u.toast('鎵撳嵃鎴愬姛')
-					} else {
-						this.$u.toast(res.msg ? res.msg : '鎵撳嵃澶辫触')
-					}
-				})
+				let form = {
+					deptId: this.getWeightHouseObj.deptId,
+					tmId: this.getWeightHouseObj.tmId,
+					carNo: uni.getStorageSync('carNo'),
+					type: 2,
+					weighingNumber: 1
+				}
+				this.$reqPost('printer', Object.assign(form, JSON.parse(uni.getStorageSync('WeighHouseForm'))),
+					'json').then(
+					res => {
+						uni.hideLoading()
+						this.enterLoading = false
+						console.log(res);
+						if (res.code === 0) {
+							this.$u.toast('鎵撳嵃鎴愬姛')
+						} else {
+							this.$u.toast(res.msg ? res.msg : '鎵撳嵃澶辫触')
+						}
+					})
 			},
 			// 鎵撳嵃鍑洪棬璇�
 			printExitPermit() {
 				uni.showLoading({
 					title: '姝e湪鎵撳嵃涓�,璇风◢鍚�'
 				})
+				let form = {
+					deptId: this.getWeightHouseObj.deptId,
+					tmId: this.getWeightHouseObj.tmId,
+					carNo: uni.getStorageSync('carNo'),
+					type: 3,
+					weighingNumber: 2
+				}
 				this.outLoading = true
-				this.$reqGet('printer', { type: 3, tmId: this.coalDetailsData.id }).then(res => {
+				this.$reqPost('printer', Object.assign(form, JSON.parse(uni.getStorageSync('WeighHouseForm'))),
+					'json').then(res => {
 					uni.hideLoading()
 					this.outLoading = false
 					if (res.code === 0) {
@@ -794,7 +813,8 @@
 				this.isfocus2 = false;
 			},
 			inputChange() {
-				if (Number(this.originInfoForm.coalContactHair) > 0 && Number(this.originInfoForm.coalContactSkin > 0)) {
+				if (Number(this.originInfoForm.coalContactHair) > 0 && Number(this.originInfoForm.coalContactSkin >
+						0)) {
 					this.isInputOrigin = true;
 				}
 			},
@@ -836,7 +856,8 @@
 						name: 'file',
 						success: res => {
 							if (num == 1) {
-								this.originInfoForm.contactPicture = JSON.parse(res.data).data.url;
+								this.originInfoForm.contactPicture = JSON.parse(res.data)
+									.data.url;
 								resolve(`${BaseUrl}${JSON.parse(res.data).data.url}`);
 							}
 						}
@@ -856,18 +877,25 @@
 					taskCoalCode: this.coalDetailsData.code,
 					carNo: this.coalDetailsData.carNo,
 				}
-				this.$refs.originInfoRef.validate().then(res => {
+				if (this.originInfoForm.coalContactSkin && this.originInfoForm.coalContactHair && this
+					.originInfoForm
+					.contactPicture) {
 					this.$reqPost('appSaveContact', form, 'json').then(res => {
 						if (res.code === 0) {
 							this.$u.toast('鎻愪氦鎴愬姛')
-							this.getTakeCoal()
 						} else {
+							this.isModifyoriginInfo = true
 							this.$u.toast(res.msg ? res.msg : '鎻愪氦澶辫触')
+
 						}
+					}).then(() => {
+						setTimeout(() => {
+							this.getTakeCoal()
+						}, 1000)
 					})
-				}).catch(errors => {
+				} else {
 					uni.$u.toast('璇峰~鍐欏畬鏁村師鍙戜俊鎭�')
-				})
+				}
 			}
 		}
 	};

--
Gitblit v1.9.1