From eec82b55813387e20087989536cd32810b59cd48 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期五, 13 十月 2023 09:42:49 +0800
Subject: [PATCH] 大部分按钮增加loading 放空操作逻辑修改
---
pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue | 161 +++++++++++++++++++++++++++++++++++------------------
1 files changed, 106 insertions(+), 55 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..b8dd578 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] || '' }}
+ {{coalDetailsData.statusView||''}}
</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'}"
@@ -137,7 +141,8 @@
<u-button text="鎻愪氦"
type="primary"
@click.stop="submitOriginInfo"
- :disabled="isModifyoriginInfo"></u-button>
+ :disabled="isModifyoriginInfo"
+ :loading="submitOriginInfoLoading"></u-button>
</view>
</view>
</view>
@@ -168,16 +173,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
@@ -260,6 +265,10 @@
components: {
combinedTitle
},
+ onPullDownRefresh() {
+ this.getTakeCoal(); //鑾峰彇鎻愮叅鍗曡鎯�
+ uni.stopPullDownRefresh();
+ },
onLoad(value) {
this.orderPlanId = value.orderPlanId;
this.yyId = value.yyId;
@@ -275,6 +284,7 @@
this.getTakeCoal(); //鑾峰彇鎻愮叅鍗曡鎯�
}
this.init(); //鑾峰彇鏃ュ織
+ this.getgetService(); //鑾峰彇瀹㈡湇
},
onShow() {
this.coalDayPage(); //鑾峰彇鏃ュ織 瀹氭椂浠诲姟
@@ -327,7 +337,7 @@
serviecePhone: ''
},
coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅浠�', '鍑虹叅浠�', '鏀剧┖', '浣滃簾', '鍏ュ満鐢宠',
- '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�'
+ '杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�', '杩斿洖鍔犲噺鍚�', '瓒呮椂', '鎵撳嵃涓�', '鎵撳嵃涓�', '濉啓', '鏀剧┖纭涓�', '瓒呮渶澶ф瘺閲嶇‘璁や腑'
], // 鐘舵��
weighHouseCode: '',
// 鏀剧┖寮圭獥鎺у埗鍙橀噺
@@ -382,29 +392,12 @@
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: '濉啓鍘熷彂淇℃伅鍚庡彲涓婄璁¢噺',
+ submitOriginInfoLoading: false
};
},
watch: {
@@ -438,12 +431,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();
@@ -454,6 +447,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 +458,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 +487,7 @@
uni.setStorageSync('customeropenId', this.serviceInfoObj.openId);
uni.setStorageSync('customerName', this.serviceInfoObj.openName);
}
- });
+ })
},
// 鑾峰彇鎻愮叅鍗曡鎯�
getTakeCoal() {
@@ -534,9 +531,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 +565,6 @@
}
}
}).then(() => {
- this.getgetService(); //鑾峰彇瀹㈡湇
- }).then(() => {
// 鍒ゆ柇褰撳墠鏃堕棿鏄惁瓒呭嚭棰勭害鏃堕棿
setTimeout(() => {
let endTime = this.coalDetailsData.yuYueSection.slice(0, 10) + ' ' + this
@@ -586,6 +582,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 +691,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=${
@@ -715,7 +719,8 @@
evacuationConfirm() {
this.weighData = {
...this.weighData,
- weigh: this.globalweigh
+ weigh: this.globalweigh,
+ isBackground: 1
};
let mix = Object.assign(this.weighData, this.getWeightHouseObj);
this.$reqPost('getOneEvacuation', mix, 'json').then(res => {
@@ -750,24 +755,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) {
@@ -794,7 +817,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 +860,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 +881,28 @@
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.submitOriginInfoLoading = true
this.$reqPost('appSaveContact', form, 'json').then(res => {
if (res.code === 0) {
this.$u.toast('鎻愪氦鎴愬姛')
- this.getTakeCoal()
+ this.submitOriginInfoLoading = false
} else {
+ this.submitOriginInfoLoading = false
+ this.isModifyoriginInfo = true
this.$u.toast(res.msg ? res.msg : '鎻愪氦澶辫触')
+
}
+ }).then(() => {
+ setTimeout(() => {
+ this.getTakeCoal()
+ }, 1000)
})
- }).catch(errors => {
+ } else {
uni.$u.toast('璇峰~鍐欏畬鏁村師鍙戜俊鎭�')
- })
+ }
}
}
};
@@ -1178,8 +1213,7 @@
width: 100%;
margin: 0 auto;
- .top-button,
- .bottom-button {
+ .top-button {
width: 100%;
height: vww(47);
@include flex;
@@ -1193,6 +1227,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