From 21fb37c7162d5b47a14d6438870377c85fcc0b52 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期六, 07 十月 2023 10:23:21 +0800
Subject: [PATCH] 修改装卸员页面 调整websocket逻辑
---
pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue | 93 ++++++++++++---
pages.json | 2
pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue | 2
pages/loadUnload-page/selectTarget/selectTarget.vue | 4
pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue | 2
pages/tabbar-page/index-tabbar/index-tabbar.vue | 9 +
pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue | 2
pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue | 116 +++++++++++--------
pages/loadUnload-page/loadUnload-detail/loadUnload-detail.vue | 6
pages/customer-page/customer-index/fayunPlanDetails/fayunPlanMore/fayunPlanMore.vue | 2
pages/driver-page/driver-index/driver-index.vue | 8 +
store/index.js | 60 ++++++---
12 files changed, 202 insertions(+), 104 deletions(-)
diff --git a/pages.json b/pages.json
index 3aa1294..2430afe 100644
--- a/pages.json
+++ b/pages.json
@@ -94,7 +94,7 @@
"path": "pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details",
"style": {
"navigationBarTitleText": "鎻愮叅鍗曡鎯�",
- "enablePullDownRefresh": false
+ "enablePullDownRefresh": true
}
},
// {
diff --git a/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue b/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue
index 076a5f9..512cdf3 100644
--- a/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue
+++ b/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue
@@ -123,7 +123,7 @@
orderCode: null,
orderPlanDetail: {},
coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅浠�', '鍑虹叅浠�', '鏀剧┖', '浣滃簾', '鍏ュ満鐢宠',
- '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�'
+ '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�', '杩斿洖鍔犲噺鍚�', '瓒呮椂', '鎵撳嵃涓�', '鎵撳嵃涓�'
],
yyDailyList: [],
// 棰嗗彇鏁伴噺
diff --git a/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanMore/fayunPlanMore.vue b/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanMore/fayunPlanMore.vue
index 05c1ce7..1cdec36 100644
--- a/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanMore/fayunPlanMore.vue
+++ b/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanMore/fayunPlanMore.vue
@@ -102,7 +102,7 @@
yyDailyList: {},
orderPlanDetail: {},
coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅浠�', '鍑虹叅浠�', '鏀剧┖', '浣滃簾', '鍏ュ満鐢宠',
- '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�'
+ '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�', '杩斿洖鍔犲噺鍚�', '瓒呮椂', '鎵撳嵃涓�', '鎵撳嵃涓�'
],
index: ''
};
diff --git a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
index e3f4dfa..f848fd1 100644
--- a/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
+++ b/pages/customer-page/customer-my/faYunstatistics/faYunstatistics.vue
@@ -331,7 +331,7 @@
faYunDetailobj: {},
modalShow: false,
coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅浠�', '鍑虹叅浠�', '鏀剧┖', '浣滃簾', '鍏ュ満鐢宠',
- '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�'
+ '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�', '杩斿洖鍔犲噺鍚�', '瓒呮椂', '鎵撳嵃涓�', '鎵撳嵃涓�'
]
};
},
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..3661fb7 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,33 @@
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 : '鎵撳嵃澶辫触')
- }
- })
+ this.$reqGet('printer', { type: 2, tmId: this.coalDetailsData.id, weighingNumber: 1 }).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 +805,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 +848,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 +869,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('璇峰~鍐欏畬鏁村師鍙戜俊鎭�')
- })
+ }
}
}
};
diff --git a/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue b/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue
index b3b9105..0381b1f 100644
--- a/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue
+++ b/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue
@@ -204,16 +204,20 @@
:disabled="addAndSubtractCoalDisabled"
@click="addAndSubtractCoal"
class="jiajian"
- v-if="outBuy"></u-button>
+ v-if="outBuy||!isSkinWeigh"></u-button>
</view>
- <view class="four">
+ <view v-show="isConfirmWeighLoading"
+ style="color: #ff6363;width: auto;margin: 0 auto;">
+ 瓒呭嚭姣涢噸,纾呮埧浜哄憳纭涓�,璇峰嬁绂诲紑姝ら〉闈�
+ </view>
+ <!-- <view class="four">
<u-button type="primary"
text="鍒锋柊"
@click.stop="RefreshHandle"
icon="reload"
throttle-time="800"
:loading="refreshLoading"></u-button>
- </view>
+ </view> -->
<!-- 鏀剧┖寮圭獥 -->
<view class="evacuationModal">
<u-modal :show="evacuationModalShow"
@@ -229,7 +233,6 @@
title="寮傚父鍘熷洜"
:showCancelButton="true"
@confirm="abnormalConfirm"
- @cancel="abnormalCancel"
confirmText="鎻愪氦">
<view class="slot-content">
<u--form labelPosition="top"
@@ -249,11 +252,17 @@
</view>
</u-modal>
</view>
+ <!-- 纭鍚庣О閲嶆彁绀哄脊绐� -->
+ <view class="">
+ <u-modal :show="confirmWeighVisiable"
+ title="鎻愮ず"
+ :content="confirmWeighContent"
+ @confirm="confirmWeighConfirm"></u-modal>
+ </view>
</view>
</template>
<script>
- let socket = null;
import { webSocketUrl } from '@/api/request.js';
import { mapState, mapMutations } from 'vuex';
import combinedTitle from '@/components/combined-title/combined-title.vue';
@@ -277,6 +286,23 @@
this.changeWeigh('')
this.realTimeWeigh = 0
},
+ onShow() {
+ this.timer = setTimeout(() => {
+ if (!this.globalweigh) {
+ console.log('绉伴噸鏃惰嚜鍔ㄩ噸杩�');
+ this.socketTask.close();
+ this.changesocketTask(null);
+ this.changereconnectNum({ connectNum: 1, isWeigh: true })
+ this.$store.dispatch('websocketInit');
+ }
+ }, 3000)
+ },
+ onHide() {
+ clearTimeout(this.timer)
+ },
+ onUnload() {
+ clearTimeout(this.timer)
+ },
components: {
combinedTitle
},
@@ -296,7 +322,8 @@
coalContactClean: 0,
coalContactHair: 0,
coalContactSkin: 0,
- isMerge: 0 //1鏄� 0涓嶆槸 榛樿0 鏄惁鍚堝崱
+ isMerge: '0', //1鏄� 0涓嶆槸 榛樿0 鏄惁鍚堝崱
+ isBackground: '0'
},
takeCoalId: null,
weighHouseCode: '',
@@ -360,7 +387,8 @@
mergeStateShow: false, //鍚堝崱寮圭獥
checkboxValue1: [],
isExceedOrigin: false, //鏄惁瓒呭嚭鍘熷彂姣涢噸
- refreshLoading: false
+ refreshLoading: false,
+ timer: null
};
},
watch: {
@@ -373,7 +401,8 @@
.orderType ==
'杞嚭') {
if (this.weighList.skin == 0) {
- this.isSkinWeigh = true
+ this.isSkinWeigh = true //绉扮毊娌℃湁杩斿洖瑁呭嵏
+ this.outBuy = false //绉扮毊娌℃湁杩斿洖瑁呭嵏
this.temporaryWeighObj.skin = newV;
let xx = new BigNumber(this.avgSkin)
let yy = new BigNumber(newV)
@@ -381,6 +410,7 @@
this.avgSkin !== 0
} else {
this.isSkinWeigh = false;
+ this.outBuy = true;
this.temporaryWeighObj.hair = newV;
this.temporaryWeighObj.clean = (this.temporaryWeighObj.hair - this.weighList.skin).toFixed(
2);
@@ -394,17 +424,20 @@
.orderType == '杞叆') {
if (this.weighList.hair == 0) {
this.isSkinWeigh = false;
+ this.outBuy = true;
this.temporaryWeighObj.hair = newV;
- if (this.weighList.orderType == '澶栬喘') {
- let xx = new BigNumber(newV)
- let yy = new BigNumber(this.weighList.hairTwo)
- if (xx.minus(yy) > 0.3) {
- this.$u.toast('瓒呭嚭鍘熷彂淇℃伅姣涢噸,璇风瓑寰呯鐞嗕汉鍛樺鐞�')
- this.isExceedOrigin = true
- }
- }
+ // if (this.weighList.orderType == '澶栬喘') {
+ // let xx = new BigNumber(newV)
+ // let yy = new BigNumber(this.weighList.hairTwo)
+ // if (xx.minus(yy) > 0.3) {
+ // this.$u.toast('瓒呭嚭鍘熷彂淇℃伅姣涢噸,璇风瓑寰呯鐞嗕汉鍛樺鐞�')
+ // this.isExceedOrigin = true
+ // this.saveWeigh()
+ // }
+ // }
} else {
- this.isSkinWeigh = true;
+ this.isSkinWeigh = true; //绉扮毊娌℃湁杩斿洖瑁呭嵏
+ this.outBuy = false //绉扮毊娌℃湁杩斿洖瑁呭嵏
this.temporaryWeighObj.skin = newV;
let xx = new BigNumber(this.avgSkin)
let yy = new BigNumber(newV)
@@ -420,11 +453,16 @@
}
}
}
+ },
+ confirmWeighVisiable(v) {
+ if (v) {
+ uni.hideLoading()
+ }
}
},
computed: {
...mapState(['globalweigh', 'globalinfraredStatus', 'globalisconnect', 'globalisUploadimg', 'globalisLogin',
- 'is_open_socket'
+ 'is_open_socket', 'socketTask', 'confirmWeighVisiable', 'confirmWeighContent'
]),
coalContactClean() {
let xx = BigNumber(this.weighData.coalContactHair)
@@ -455,7 +493,9 @@
},
methods: {
- ...mapMutations(['changeweighHouseCode', 'changeisLogin', 'changeWeigh']),
+ ...mapMutations(['changeweighHouseCode', 'changeisLogin', 'changeWeigh', 'changeconfirmWeighVisiable',
+ 'changesocketTask', 'changereconnectNum'
+ ]),
RefreshHandle() {
if (this.globalisconnect) return this.$u.toast('宸茶繛鎺ワ紝鏃犻渶鍒锋柊')
this.refreshLoading = true
@@ -542,7 +582,6 @@
// 纭绉伴噸鎺ュ彛
saveWeigh() {
this.weighData.coalContactClean = this.coalContactClean;
- console.log(this.weighData);
this.$reqPost('saveWeigh', this.weighData, 'json')
.then(res => {
console.log(res, '绉伴噸鎺ュ彛');
@@ -554,6 +593,10 @@
});
this.isConfirmWeighLoading = false;
}, 1000);
+ } else if (res.code === 3) {
+ uni.showLoading({
+ title: '纾呮埧浜哄憳纭涓�',
+ })
} else {
this.$u.toast(res.msg ? res.msg : '绉伴噸澶辫触锛岃绋嶅悗閲嶈瘯');
this.isConfirmWeighLoading = false
@@ -678,6 +721,16 @@
this.orderSurplusLess = true
}
},
+ confirmWeighConfirm() {
+ this.changeconfirmWeighVisiable(false)
+ this.isConfirmWeighLoading = false
+ setTimeout(() => {
+ this.$u.toast('鍗冲皢杩斿洖涓婁竴椤�'),
+ uni.navigateBack({
+ delta: 1
+ })
+ }, 800)
+ }
}
};
</script>
diff --git a/pages/driver-page/driver-index/driver-index.vue b/pages/driver-page/driver-index/driver-index.vue
index 95d9614..cb73355 100644
--- a/pages/driver-page/driver-index/driver-index.vue
+++ b/pages/driver-page/driver-index/driver-index.vue
@@ -299,7 +299,8 @@
xsUserId: '',
customerId: '',
isFirstLogin: true, //鏄惁鏄涓�娆$櫥褰�
- phone: ""
+ phone: "",
+ isFirstTime: false //鏄惁鏄櫥褰曡繘鍏ラ椤碉紝杩樻槸鍒殑椤甸潰杩斿洖 false鏄櫥褰� true鏄埆鐨勯〉闈�
};
},
onShow() {
@@ -316,7 +317,9 @@
},
init() {
this.qiangDanList();
- this.getLogOn()
+ if (!this.isFirstTime) {
+ this.getLogOn()
+ }
},
// 鍙告満棣栭〉鍒楄〃
qiangDanList() {
@@ -393,6 +396,7 @@
this.$refs.previewImage.open('https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj1.png')
},
getLogOn() {
+ this.isFirstTime = true
this.$reqGet('getUserEntity').then(res => {
this.phone = res.data.phone
}).then(() => {
diff --git a/pages/loadUnload-page/loadUnload-detail/loadUnload-detail.vue b/pages/loadUnload-page/loadUnload-detail/loadUnload-detail.vue
index 7ccbef4..3d278b5 100644
--- a/pages/loadUnload-page/loadUnload-detail/loadUnload-detail.vue
+++ b/pages/loadUnload-page/loadUnload-detail/loadUnload-detail.vue
@@ -77,7 +77,7 @@
loading: false,
id: "",
coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅浠�', '鍑虹叅浠�', '鏀剧┖', '浣滃簾', '鍏ュ満鐢宠',
- '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�',
+ '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�', '杩斿洖鍔犲噺鍚�', '瓒呮椂', '鎵撳嵃涓�', '鎵撳嵃涓�'
], // 鐘舵��
}
},
@@ -121,7 +121,9 @@
this.loading = false;
if (res.code === 0) {
this.$u.toast('瑁呭嵏鎴愬姛')
- this.init()
+ setTimeout(() => {
+ this.init()
+ }, 1000)
} else {
this.$u.toast(res.msg ? res.msg : '瑁呭嵏澶辫触')
}
diff --git a/pages/loadUnload-page/selectTarget/selectTarget.vue b/pages/loadUnload-page/selectTarget/selectTarget.vue
index 63098b4..9b44bae 100644
--- a/pages/loadUnload-page/selectTarget/selectTarget.vue
+++ b/pages/loadUnload-page/selectTarget/selectTarget.vue
@@ -33,7 +33,7 @@
<view class="coal-name"
v-show="coalList.length!==0">
<u-checkbox-group v-model="checkedCoal"
- placement="row"
+ placement="column"
@change="checkboxChange"
size="30">
<u-checkbox :customStyle="{marginBottom: '8px',fontSize:'20px'}"
@@ -145,13 +145,13 @@
checked: false
}
})
- console.log(this.coalList);
},
checkboxChange(e) {
this.selectedCoal = e
},
formHandle() {
if (!this.dataForm.firstClass || !this.dataForm.secondClass) return this.$u.toast('璇烽�夋嫨鐓ゅ満鎴栬�呯叅浠�')
+ if (this.selectedCoal.length === 0) return this.$u.toast('璇烽�夋嫨鐓ょ')
this.$reqPost('updateUser', Object.assign(this.userInfo, {
responsibilityCoal: this.selectedCoal.join(),
filedId: this
diff --git a/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue b/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue
index 8577da2..104a898 100644
--- a/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue
+++ b/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue
@@ -94,7 +94,7 @@
id: '',
faYunDetailobj: {},
coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅浠�', '鍑虹叅浠�', '鏀剧┖', '浣滃簾', '鍏ュ満鐢宠',
- '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�'
+ '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�', '鎵撳嵃涓�', '鎵撳嵃涓�'
]
};
},
diff --git a/pages/tabbar-page/index-tabbar/index-tabbar.vue b/pages/tabbar-page/index-tabbar/index-tabbar.vue
index 7e9dcc4..d6216d9 100644
--- a/pages/tabbar-page/index-tabbar/index-tabbar.vue
+++ b/pages/tabbar-page/index-tabbar/index-tabbar.vue
@@ -191,17 +191,20 @@
}
} else if (v.startsWith('wsg')) {
let wsgObj = JSON.parse(v.slice(5));
- console.log(uni.getStorageSync('carNo'), wsgObj.carNo);
- if (uni.getStorageSync('carNo') === wsgObj.carNo) {
+ if (uni.getStorageSync('carNo') === wsgObj.carNo && !wsgObj.peopleWeigh) {
this.changewsgVisiable(true)
this.changewsgContent(wsgObj.content)
+ }
+ if (uni.getStorageSync('carNo') === wsgObj.carNo && wsgObj.peopleWeigh === 2) {
+ this.changeconfirmWeighVisiable(true)
+ this.changeconfirmWeighContent(wsgObj.content)
}
}
}
},
methods: {
...mapMutations(['pushMessage', 'changeWeigh', 'changeinfraredStatus', 'changeisconnect', 'websocketInit',
- 'changewsgVisiable', 'changewsgContent'
+ 'changewsgVisiable', 'changewsgContent', 'changeconfirmWeighVisiable', 'changeconfirmWeighContent'
]),
messagePage() {
uni.navigateTo({
diff --git a/store/index.js b/store/index.js
index 8485ad9..bdb23b7 100644
--- a/store/index.js
+++ b/store/index.js
@@ -145,7 +145,9 @@
],
wsgVisiable: false, //纾呮埧蹇欑寮圭獥鎺у埗
wsgContent: '',
- globalIsFirstWeighing: 1 //鏄惁鏄涓�娆′笂纾�
+ globalIsFirstWeighing: 1, //鏄惁鏄涓�娆′笂纾�
+ confirmWeighVisiable: false, //纾呮埧绠$悊纭绉伴噸瀹屾垚鎻愮ず寮圭獥
+ confirmWeighContent: ''
},
mutations: {
lengthchange(state, payload) {
@@ -189,6 +191,9 @@
changeuserInfo(state, payload) {
state.globaluserInfo = payload
},
+ changesocketTask(state, payload) {
+ state.socketTask = payload
+ },
// 鏀圭増鍏ㄥ眬websocket鐘舵��
changeisconnect(state, payload) {
state.globalisconnect = payload
@@ -209,10 +214,14 @@
},
// 鏀瑰彉閲嶈繛娆℃暟
changereconnectNum(state, payload) {
- if (state.connectNum < 6) {
- state.connectNum += payload
+ if (payload.isWeigh) {
+ state.connectNum = payload.connectNum
} else {
- state.connectNum = payload
+ if (state.connectNum < 6) {
+ state.connectNum += payload.connectNum
+ } else {
+ state.connectNum = payload.connectNum
+ }
}
},
changeablePrintInduction(state, payload) {
@@ -229,12 +238,18 @@
},
changeglobalIsFirstWeighing(state, payload) {
state.globalIsFirstWeighing = payload
+ },
+ changeconfirmWeighVisiable(state, payload) {
+ state.confirmWeighVisiable = payload
+ },
+ changeconfirmWeighContent(state, payload) {
+ state.confirmWeighContent = payload
}
},
actions: {
websocketInit({ state, dispatch, commit }) {
let wsUrl = `${webSocketUrl}?access_token=${uni.getStorageSync('token')}`
- state.socketTast = uni.connectSocket({
+ state.socketTask = uni.connectSocket({
url: wsUrl,
header: { CLIENT_TOC: 'Y' },
success: res => {
@@ -252,17 +267,17 @@
commit('changeisconnect', false)
}
})
- state.socketTast.onOpen(() => dispatch('websocketOnOpen'))
- state.socketTast.onMessage(result => dispatch('websocketOnMessage', result.data))
- state.socketTast.onClose(e => dispatch('websocketOnClose', e))
- state.socketTast.onError(e => dispatch('websocketOnError', e))
+ state.socketTask.onOpen(() => dispatch('websocketOnOpen'))
+ state.socketTask.onMessage(result => dispatch('websocketOnMessage', result.data))
+ state.socketTask.onClose(e => dispatch('websocketOnClose', e))
+ state.socketTask.onError(e => dispatch('websocketOnError', e))
},
websocketOnOpen({ state, commit }) {
console.log('ws鎵撳紑')
clearInterval(state.reconnectTimeOut)
clearInterval(state.globalIntervalId)
state.globalIntervalId = setInterval(() => {
- state.socketTast.send({
+ state.socketTask.send({
data: JSON.stringify({ type: 'ping' }),
success(e) {
console.log(e, '鍙戦�佸績璺虫垚鍔�')
@@ -271,24 +286,25 @@
}, 30000)
},
websocketOnClose({ state, commit, dispatch }, e) {
- if (!state.socketTast) return
+ if (!state.socketTask) return
console.log('ws鍏抽棴', e)
- state.socketTast.close(e => {
+ state.socketTask.close(e => {
commit('changeisconnect', false)
})
clearInterval(state.globalIntervalId)
clearInterval(state.reconnectTimeOut)
- state.socketTast = null
+ state.socketTask = null
commit('changereconnectState', false)
- if (state.connectNum < 6 && state.globalisLogin) {
+ console.log(state.connectNum, state.connectNum.connectNum, '閾炬帴鏁�');
+ if (state.connectNum < 6 || state.connectNum.connectNum < 6 && state.globalisLogin) {
uni.showToast({
- title: `杩炴帴澶辫触锛屾鍦ㄥ皾璇曠${state.connectNum}娆¤繛鎺,
+ title: '杩炴帴澶辫触锛屾鍦ㄥ皾璇曢噸鏂拌繛鎺�',
icon: 'none'
})
- commit('changereconnectNum', 1)
+ commit('changereconnectNum', { connectNum: 1, isWeigh: false })
dispatch('reconnect')
} else if (state.connectNum >= 6 && state.globalisLogin) {
- commit('changereconnectNum', 1)
+ commit('changereconnectNum', { connectNum: 1, isWeigh: false })
uni.showToast({
title: '缃戠粶寮傚父,璇风◢鍚庨噸璇�',
icon: 'none'
@@ -302,17 +318,17 @@
console.log('ws鎶ラ敊', e)
clearInterval(state.globalIntervalId)
clearInterval(state.reconnectTimeOut)
- state.socketTast = null
+ state.socketTask = null
commit('changereconnectState', false)
- if (state.connectNum < 6 && state.globalisLogin) {
+ if (state.connectNum < 6 || state.connectNum.connectNum < 6 && state.globalisLogin) {
uni.showToast({
- title: `杩炴帴澶辫触锛屾鍦ㄥ皾璇曠${state.connectNum}娆¤繛鎺,
+ title: '杩炴帴澶辫触锛屾鍦ㄥ皾璇曢噸鏂拌繛鎺�',
icon: 'none'
})
- commit('changereconnectNum', 1)
+ commit('changereconnectNum', { connectNum: 1, isWeigh: false })
dispatch('reconnect')
} else if (state.connectNum > 6 && state.globalisLogin) {
- commit('changereconnectNum', 1)
+ commit('changereconnectNum', { connectNum: 1, isWeigh: false })
uni.showToast({
title: '缃戠粶寮傚父,璇风◢鍚庨噸璇�',
icon: 'none'
--
Gitblit v1.9.1