From 72f2abafea3ce8c91d9b689821a4508bdc0f7d9f Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期五, 12 七月 2024 16:59:41 +0800 Subject: [PATCH] feat:修改细节 --- pages/driver-page/driver-index/bill-of-lading-details/nocarNoWeighingDevice/nocarNoWeighingDevice.vue | 127 ++++++++++++++++++++++++++++------------- 1 files changed, 86 insertions(+), 41 deletions(-) diff --git a/pages/driver-page/driver-index/bill-of-lading-details/nocarNoWeighingDevice/nocarNoWeighingDevice.vue b/pages/driver-page/driver-index/bill-of-lading-details/nocarNoWeighingDevice/nocarNoWeighingDevice.vue index 091b28b..84225ba 100644 --- a/pages/driver-page/driver-index/bill-of-lading-details/nocarNoWeighingDevice/nocarNoWeighingDevice.vue +++ b/pages/driver-page/driver-index/bill-of-lading-details/nocarNoWeighingDevice/nocarNoWeighingDevice.vue @@ -128,6 +128,7 @@ text="澶嶇" :loading="repeatWeighLoading" loadingText="纭" + :disabled="isFuBangSHow" @click="confirmRepeatWeigh"></u-button> </view> <view class="chengzhong-btn" v-if="weighData.tmId && outBuy && roleType == 4"> @@ -136,17 +137,16 @@ :disabled="addAndSubtractCoalDisabled" @click="addAndSubtractCoal" class="jiajian" - ></u-button> + ></u-button> </view> - <view class="chengzhong-btn" v-if='weighData.tmId && canUnload && isJixuxiehuo && roleType == 4'> - <div>{{!isJixuxiehuo}}</div> + <view class="chengzhong-btn" v-if='weighData.tmId && canUnload && !isJixuxiehuo && roleType == 4'> <u-button type="primary" text="缁х画鍗歌揣" @click="UnloadingAgainHandle" :loading="UnloadingAgainLoading" loadingText="纭" :disabled="isweigh||realTimeWeigh == 0" - ></u-button> + ></u-button> </view> <!-- 鏀剧┖ --> <view class="chengzhong-btn" v-if="weighData.tmId && roleType == 4"> @@ -157,6 +157,7 @@ throttleTime="500" :disabled="!isEvacuation"></u-button> </view> + </view> <!-- 鏀剧┖寮圭獥 --> <view class="evacuationModal"> @@ -189,6 +190,7 @@ }, data() { return { + statusWeigh: '', //鐘舵�� isWeighing:'', timer:null, weighData: { @@ -250,6 +252,7 @@ applyHouseId:'', //纾呮埧鍙� noCarNo:0, //鏄惁鏈夎溅鐗屽彿(鏈夎溅鐗�0锛屾棤杞︾墝1) status:null, //鐘舵�� + orderCode:'' }; }, watch: { @@ -338,7 +341,7 @@ ...mapState(['globalinfraredStatus', 'globalWarning', 'globalisconnect', 'globalisUploadimg', 'globalisLogin', 'socketTask','is_open_socket', ]), - ...mapGetters(['globalweigh']), + ...mapGetters(['globalweigh','yuanFaList']), token() { return uni.getStorageSync('token'); }, @@ -434,13 +437,50 @@ } }, isJixuxiehuo() { //鏄惁鏄剧ず缁х画鍗歌揣鎸夐挳 - console.log(this.weighList?.tmTaskCoalItems.length - 1 > 0,'this.weighList?.tmTaskCoalItems===') - if(this.weighList?.tmTaskCoalItems) { - return this.weighList?.tmTaskCoalItems.length - 1 > 0 + console.log(this.yuanFaList,'this.yuanFaList=====璐ㄦ鍛�---鏄惁鏄剧ず缁х画鍗歌揣11111') + if(this.weighList?.tmTaskCoalItems && this.weighList?.tmTaskCoalItems.length > 0 && this.yuanFaList && this.yuanFaList.length > 0) { + console.log(this.yuanFaList,'this.yuanFaList=====璐ㄦ鍛�---鏄惁鏄剧ず缁х画鍗歌揣2222222') + return this.weighList?.tmTaskCoalItems.length == this.yuanFaList.length }else { return false } + }, + isFuBangSHow() { //澶嶇鏄惁鍙互鐐瑰嚮 + console.log(this.globalweigh,'this.globalweigh====') + if(this.noCarNo == 1) { //鏃犺溅鐗岀殑鏃跺�欏纾呴兘鑳界偣鍑� + //鏉′欢锛� 涓嶆槸绉伴噸瀹屾垚+涓嶆槸鏈О閲�+鏈夎溅鐗�+鍙告満 銆愭湭绉伴噸0锛岀О閲嶄腑1锛岄獙璐ㄤ腑2锛岀О閲嶅畬鎴�3,楠岃川瀹屾垚4銆� noCarNo 鏄惁鏈夎溅鐗屽彿(鏈夎溅鐗�0锛屾棤杞︾墝1) + if(this.statusWeigh == 0 || this.statusWeigh == 3 || this.globalweigh == 0) { + return true + }else { + return false + } + }else { //鏈夎溅鐗岀殑璇� + console.log(this.isJixuxiehuo,'this.isJixuxiehuo------') + if(this.weighHistory && this.weighHistory.length > 0) { + if(!this.isJixuxiehuo) { //鍙湁涓�鏉� tmTaskCoalItems + let data = this.weighHistory[0] + if(!data.hair && !data.skin) { //鐨噸鍜屾瘺閲嶉兘娌℃湁鐨勮瘽 澶嶇 涓嶈兘鐐瑰嚮 + return true + }else if(data.hair && data.skin) { //鐨噸鍜屾瘺閲嶉兘鏈夌殑璇� 澶嶇 涔熶笉鑳界偣鍑� 锛堢О閲嶇粨鏉燂級 + return true + }else { + return false + } + + }else { + let hairAndSkin = this.weighHistory.every(item => item.hair && item.skin) //鐨噸姣涢噸閮芥湁 + if(hairAndSkin) { + return true + }else { + return false + } + } + }else { + return true + } + } } + }, methods: { @@ -451,34 +491,6 @@ }) console.log(this.weighData.sceneId,'纾呮埧----') // 鑾峰彇绉伴噸淇℃伅 - // uni.request({ //鏍规嵁纾呮埧鏌ヨ鎻愮叅鍗曚俊鎭� - // url: `${BaseUrl}/wrzs/jccoalweighhouse/getTmTaskCoalNoCar/${this.weighData.sceneId}`, - // method: 'GET', - // header: { - // Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'), - // clientToc: 'Y', - // 'CLIENT_TOC': 'Y', - // }, - // success: (res) => { - // console.log(res,'res.datra----------') - // if(res.data.code == 0) { - // this.weighList = res.data; - // this.weighData.deptId = res.data.deptId; - // this.weighData.tmId = res.data.id; - // this.weighData.carNo = res.data.carNo; - // this.weighData.tmCode = res.data.code; - // this.weighData.filedId = res.data.filedId; - // this.noCarNo = res.data.noCarNo - // this.applyHouseId = res.data.applyHouseId - // this.status = res.data.status - // this.outBuy = (this.weighList.orderType.indexOf('閿�') !== -1) && this.showWeigh.skin > 0; - // // 缁х画鍗歌揣鍙湁澶栬喘绫诲瀷绗簩娆′細鏈� - // this.canUnload = this.weighList.orderType === '澶栬喘' && this.showWeigh.hair > 0; - // }else { - // this.$u.toast(res.data.msg); - // } - // } - // }) let params = {} this.tmId ? params = { tmId: this.tmId, houseId: this.weighData.sceneId } : params = { houseId: this.weighData.sceneId } console.log(params,'鍙傛暟===') @@ -495,14 +507,48 @@ this.noCarNo = res.data.noCarNo this.applyHouseId = res.data.applyHouseId this.status = res.data.status + this.statusWeigh = res.data.statusWeigh + this.orderCode = res.data.orderCode this.outBuy = (this.weighList.orderType.indexOf('閿�') !== -1) && this.showWeigh.skin > 0; // 缁х画鍗歌揣鍙湁澶栬喘绫诲瀷绗簩娆′細鏈� this.canUnload = this.weighList.orderType === '澶栬喘' && this.showWeigh.hair > 0; + this.getShebeiData() //鑾峰彇璁惧淇℃伅 + this.getYuanfaList() }else { - this.weighList = {} + Object.keys(this.weighList).forEach(key => { + this.weighList[key] = ''; + }); this.$u.toast(res.msg ? res.msg : '鍗犳棤纾呭崟淇℃伅'); } }); + }, + getYuanfaList() { //鍘熷彂淇℃伅list + this.$reqGet('getMaterialDetailByOrderCode', { orderCode: this.orderCode }).then(res => { + if(res.code == 0) { + this.$store.commit('GET_YUANFALIST',res.data) + } + + }) + }, + getShebeiData() { //鑾峰彇璁惧淇℃伅 + let params = { + deptId: this.weighData.deptId, + filedId: this.weighData.filedId, + tmId: this.weighData.tmId, + tmCode: this.weighData.tmCode, + carNo: this.weighData.carNo + } + console.log(params,'params=====') + this.$reqGet('getWeighHouse',params).then(res => { + console.log(res, '鑾峰彇璁惧淇℃伅res'); + if(res.code == 0) { + this.weighData.gateCameraId = res.data.lastEquipmentId; + this.weighData.equipmentCode = res.data.lastEquipmentCode; + this.weighData.sceneInOut = res.data.sceneInOut; + }else { + this.$u.toast(res.msg); + } + }) }, refreshClick() { this.init() @@ -530,6 +576,7 @@ // 纭绉伴噸鎺ュ彛 saveWeigh() { //鐐瑰嚮纭绉伴噸鎸夐挳 // this.weighData.coalContactClean = this.coalContactClean; + console.log(this.weighData,'澶嶇鍙傛暟----') this.$reqPost('saveWeighYZY', this.weighData, 'json') .then(res => { console.log(res, '绉伴噸鎺ュ彛'); @@ -589,7 +636,6 @@ deptId: this.weighData.deptId, sceneId: this.weighData.sceneId, carNo: this.weighData.carNo, - tmId: this.weighData.tmId, filedId: this.weighData.filedId, tmId: this.weighData.tmId, gateCameraId: this.weighData.gateCameraId, @@ -621,7 +667,6 @@ carNo: this.weighData.carNo, tmId: this.weighData.tmId, filedId: this.weighData.filedId, - tmId: this.weighData.tmId, gateCameraId: this.weighData.gateCameraId, equipmentCode: this.weighData.equipmentCode, tmCode: this.weighData.tmCode, @@ -966,10 +1011,10 @@ flex-wrap: wrap; padding: 0 40rpx; box-sizing: border-box; - justify-content: center; + justify-content: start; .u-button{ width: 200rpx; - margin: 0 10rpx; + margin: 10rpx 10rpx; } } -- Gitblit v1.9.1