From 96db936c641b23897636ff6a15e31f8f87964342 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期三, 11 十月 2023 13:44:05 +0800
Subject: [PATCH] 确定装卸逻辑修改 增加称重时稳定态
---
pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue | 165 +++++++++++++++++++++++++++++++++++++------------------
1 files changed, 111 insertions(+), 54 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 7549489..e1334a8 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="haveInputOrigin"
+ 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'}"
@@ -130,7 +134,7 @@
height="150"
:previewFullImage="true"
:disabled="isModifyoriginInfo"
- :deletable='!deletable'></u-upload>
+ :deletable="!deletable"></u-upload>
</u-form-item>
</u-form>
<view class="submit-button">
@@ -168,16 +172,16 @@
plain
@click="rcsqClick"
shape="circle"
- :disabled="coalDetailsData.status === 3"></u-button>
+ :disabled="correctStatus>= 3"></u-button>
</view>
<view class="bottom-button">
- <u-button text="鏀剧┖"
+ <!-- <u-button text="鏀剧┖"
type="primary"
plain
@click="evacuation"
throttleTime="500"
shape="circle"
- :disabled="isEvacuation || isapproach"></u-button>
+ :disabled="isEvacuation || isapproach"></u-button> -->
<u-button text="鍛煎彨瀹㈡湇"
type="primary"
plain
@@ -241,7 +245,7 @@
</view>
<!-- 纾呮埧蹇欑鎻愮ず寮圭獥 -->
<view class="">
- <u-modal :show="wsgVisiable"
+ <u-modal :show="wsgShow"
title="鎻愮ず"
:content="wsgContent"
@confirm="wsgContentConfirm"></u-modal>
@@ -260,6 +264,10 @@
components: {
combinedTitle
},
+ onPullDownRefresh() {
+ this.getTakeCoal(); //鑾峰彇鎻愮叅鍗曡鎯�
+ uni.stopPullDownRefresh();
+ },
onLoad(value) {
this.orderPlanId = value.orderPlanId;
this.yyId = value.yyId;
@@ -269,14 +277,18 @@
this.getWeightHouseObj.overTmWaixiao = value.overTmWaixiao
}
this.fileList1 = []
+ this.changeglobalIsFirstWeighing(1)
if (this.globalIsFirstWeighing === 1) {
+ console.log('鑾峰彇璇︽儏 onload');
this.getTakeCoal(); //鑾峰彇鎻愮叅鍗曡鎯�
}
this.init(); //鑾峰彇鏃ュ織
+ this.getgetService(); //鑾峰彇瀹㈡湇
},
onShow() {
this.coalDayPage(); //鑾峰彇鏃ュ織 瀹氭椂浠诲姟
if (this.globalIsFirstWeighing === 2) {
+ console.log('鑾峰彇璇︽儏 onShow');
this.getTakeCoal(); //鑾峰彇鎻愮叅鍗曡鎯�
}
},
@@ -324,7 +336,7 @@
serviecePhone: ''
},
coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅浠�', '鍑虹叅浠�', '鏀剧┖', '浣滃簾', '鍏ュ満鐢宠',
- '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�'
+ '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�', '杩斿洖鍔犲噺鍚�', '瓒呮椂', '鎵撳嵃涓�', '鎵撳嵃涓�', '濉啓'
], // 鐘舵��
weighHouseCode: '',
// 鏀剧┖寮圭獥鎺у埗鍙橀噺
@@ -379,29 +391,20 @@
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,
+ timeLineStatus: null,
+ originInfoNotice: '濉啓鍘熷彂淇℃伅鍚庡彲涓婄璁¢噺'
};
+ },
+ watch: {
+ '$store.state.wsgVisiable': {
+ deep: true,
+ handler: function(val) {
+ this.wsgShow = val
+ }
+ }
},
computed: {
...mapState(['globalweigh', 'globalinfraredStatus', 'wsgVisiable', 'wsgContent', 'globalIsFirstWeighing']),
@@ -426,12 +429,12 @@
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)
let yy = BigNumber(this.originInfoForm.coalContactSkin ? this.originInfoForm.coalContactSkin : 0)
- return xx.minus(yy).toNumber().toFixed(2) || ''
+ return xx.minus(yy).toNumber() > 0 ? xx.minus(yy).toNumber().toFixed(2) : 0
},
currentTime() {
let currentDate = new Date();
@@ -442,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: {
@@ -449,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) {
@@ -478,7 +485,7 @@
uni.setStorageSync('customeropenId', this.serviceInfoObj.openId);
uni.setStorageSync('customerName', this.serviceInfoObj.openName);
}
- });
+ })
},
// 鑾峰彇鎻愮叅鍗曡鎯�
getTakeCoal() {
@@ -522,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 {
@@ -555,8 +563,6 @@
}
}
}).then(() => {
- this.getgetService(); //鑾峰彇瀹㈡湇
- }).then(() => {
// 鍒ゆ柇褰撳墠鏃堕棿鏄惁瓒呭嚭棰勭害鏃堕棿
setTimeout(() => {
let endTime = this.coalDetailsData.yuYueSection.slice(0, 10) + ' ' + this
@@ -574,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) {
@@ -682,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=${
@@ -738,24 +752,42 @@
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
+ }
+ let form1 = uni.getStorageSync('WeighHouseForm') ? uni.getStorageSync('WeighHouseForm') : '{}'
+ this.$reqPost('printer', Object.assign(form, JSON.parse(form1)),
+ '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) {
@@ -782,7 +814,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;
}
},
@@ -824,7 +857,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}`);
}
}
@@ -844,18 +878,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('璇峰~鍐欏畬鏁村師鍙戜俊鎭�')
- })
+ }
}
}
};
@@ -1166,8 +1207,7 @@
width: 100%;
margin: 0 auto;
- .top-button,
- .bottom-button {
+ .top-button {
width: 100%;
height: vww(47);
@include flex;
@@ -1181,6 +1221,23 @@
border: 2px solid #3b56eb;
}
}
+
+ .bottom-button {
+ width: 40%;
+ height: vww(47);
+ padding-left: vww(18);
+ @include flex;
+ justify-content: flex-start;
+
+ .u-button {
+ width: 100%;
+ height: 60rpx;
+ font-size: 28rpx;
+ font-weight: 300;
+ color: #497bfb;
+ border: 2px solid #3b56eb;
+ }
+ }
}
}
--
Gitblit v1.9.1