From 10207852795508714a0f84bd7934cbbf6a80f572 Mon Sep 17 00:00:00 2001 From: 819527061@qq.com <123456> Date: 星期二, 27 八月 2024 08:16:16 +0800 Subject: [PATCH] 外销添加申请复磅按钮 --- pages/driver-page/driver-index/bill-of-lading-details/nocarNoWeighingDevice/nocarNoWeighingDevice.vue | 408 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 359 insertions(+), 49 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 d9e6ba5..0df8e60 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 @@ -1,5 +1,11 @@ <template> <view class="weighingDevice"> + <div class="shuaxinBtn"> + <u-button + @click="refreshClick" + type="primary" + :plain="true">鐐瑰嚮鍒锋柊</u-button> + </div> <view class="one" :style="{ backgroundImage: `url(${onlineurl}/appimg/image/banner/weighbanner.png)`, backgroundSize: 'cover', backgroundRepeat: 'no-repeat' }"> <view class="top"> @@ -51,6 +57,19 @@ <view class="prefix">璁㈠崟绫诲瀷:</view> <view class="suffix">{{ weighList.orderType || '' }}</view> </view> + <view class="main-information"> + <view class="prefix">浜у搧:</view> + <view class="suffix">{{ weighList.coalName || '' }}</view> + </view> + <view class="main-information"> + <view class="prefix">杞︾墝鍙�:</view> + <view class="suffix">{{ weighList.noCarNo == 1 ? '鏃犺溅鐗�' : weighList.carNo }}</view> + </view> +<!-- xsUser1Name--> + <view class="main-information"> + <view class="prefix">鍙告満濮撳悕:</view> + <view class="suffix">{{ weighList.xsUser1Name || '' }}</view> + </view> <!-- <view class="main-information" v-if="isweight"> <view class="prefix">鐨噸:</view> <view class="suffix"> @@ -83,23 +102,80 @@ </view> <!-- 绉伴噸鍘嗗彶--> <weigh-item :list="weighHistory" class="weighingDecive-item"></weigh-item> - <view class="chengzhong-btn"> - <!-- applyHouseId鏈夌鎴垮彿锛宯oCarNo=1(鏃犺溅鐗屽彿)锛宻tatus=15,璐ㄦ鍛� 鎶婄鍚堜笂闈㈡潯浠剁殑鍔犱笂绉伴噸鎸夐挳 --> - <u-button type="primary" - text="纭畾绉伴噸" - :disabled="applyHouseId && noCarNo == 1 && status == 15 && roledType == 4" - :loading="isConfirmWeighLoading" - loadingText="纭" - @click="confirmWeigh"></u-button> + + <!-- iszj锛屾槸鍚﹀凡璐ㄦ瀛楁 璐ㄦ鍛樿韩浠�+鏈塼mId+璐ㄦ涔嬪墠 --> + + + + + + <view class="three"> + <!-- .澶栬喘璁㈠崟锛屼笉鍑虹幇杩斿洖鍔犲噺鍚ㄧ殑鎸夐挳 --> + <view class="chengzhong-btn" v-if="applyHouseId && noCarNo == 1 && status == 15 && roleType == 4"> + <!-- applyHouseId鏈夌鎴垮彿锛宯oCarNo=1(鏃犺溅鐗屽彿)锛宻tatus=15,璐ㄦ鍛� 鎶婄鍚堜笂闈㈡潯浠剁殑鍔犱笂绉伴噸鎸夐挳 --> + <u-button type="primary" + :disabled="realTimeWeigh == 0 || globalinfraredStatus || isweigh ||globalWarning" + text="纭畾绉伴噸" + :loading="isConfirmWeighLoading" + loadingText="纭" + @click="confirmWeigh"> + </u-button> + </view> +<!-- <view class="chengzhong-btn" v-if="weighData.tmId && roleType == 4"> + <!– 鏀跺彂鍗曚俊鎭椂 status: 棰嗗彇(0),棰勭害(1),绛惧埌(2),鍏ュ満(3),绉扮毊(4),绉版瘺(5),绂诲満(6), 鍏ョ鎴�(7),鍑虹鎴�(8),鍏ョ叅浠�(9),鍑虹叅浠�(10) + ,鏀剧┖(11),浣滃簾(12),鍏ュ満鐢宠(13),杩涘叆鍦洪櫌(14),鐢宠璁¢噺(15); –> + <u-button type="primary" + text="澶嶇" + :loading="repeatWeighLoading" + loadingText="纭" + :disabled="isFuBangSHow" + @click="showModal = true"></u-button> + </view>--> + <view class="chengzhong-btn" v-if="weighData.tmId && outBuy && roleType == 4"> + <u-button type="primary" + text="杩斿洖鍔犲噺鍚�" + :disabled="addAndSubtractCoalDisabled" + @click="addAndSubtractCoal" + class="jiajian" + ></u-button> + </view> + <view class="chengzhong-btn" v-if='weighData.tmId && canUnload && isJixuxiehuo && roleType == 4'> + <u-button type="primary" + text="缁х画鍗歌揣" + @click="UnloadingAgainHandle" + + loadingText="纭" + :disabled="isweigh||realTimeWeigh == 0 || statusWeigh == 3" + ></u-button> + </view> + <!-- 鏀剧┖ --> + <view class="chengzhong-btn" v-if="weighData.tmId && roleType == 4"> + <u-button type="primary" + text="鏀剧┖" + plain + @click="evacuation" + throttleTime="500" + :disabled="!isEvacuation"></u-button> + </view> + <!--浜屾纭--> + <u-modal :show="showModal" + :asyncClose="true" + @cancel="showModal = false" + :content="modalContent" + :showCancelButton="true" + :cancelButtonText="'鍙栨秷'" + :showConfirmButton="true" + :confirmButtonText="'纭'" + @confirm="confirmRepeatWeigh" /> </view> - <view class="chengzhong-btn marginTop"> - <!-- 鏀跺彂鍗曚俊鎭椂 --> - <u-button type="primary" - text="澶嶇" - :disabled="weighData.tmId && roledType == 4" - :loading="repeatWeighLoading" - loadingText="纭" - @click="confirmRepeatWeigh"></u-button> + <!-- 鏀剧┖寮圭獥 --> + <view class="evacuationModal"> + <u-modal :show="evacuationModalShow" + :title="evacuationTitle" + :content="evacuationContent" + :showCancelButton="true" + @confirm="evacuationConfirm" + @cancel="evacuationCancel"></u-modal> </view> </view> </template> @@ -112,8 +188,9 @@ export default { onLoad(params) { console.log(params,'params===') - this.tmId = params.tmId; - this.weighData.sceneId = params.houseId; + this.tmId = params?.tmId || ''; //鎻愮叅鍗昳d + this.weighData.sceneId = params?.houseId; //纾呮埧id + this.changeweighHouseCode(params?.weighHouseCode); this.changeWeigh('') }, components: { @@ -122,6 +199,7 @@ }, data() { return { + statusWeigh: '', //鐘舵�� isWeighing:'', timer:null, weighData: { @@ -183,6 +261,9 @@ applyHouseId:'', //纾呮埧鍙� noCarNo:0, //鏄惁鏈夎溅鐗屽彿(鏈夎溅鐗�0锛屾棤杞︾墝1) status:null, //鐘舵�� + orderCode:'', + showModal: false, + modalContent: '纭瑕佸纾呭悧锛�' }; }, watch: { @@ -192,8 +273,10 @@ // 鐩戝惉閲嶉噺鍙樺寲 globalweigh: { handler: function(newV) { - if(newV) { + console.log(newV,'newV===') + if(newV || newV == 0) { this.weighData.weigh = this.realTimeWeigh = newV; + console.log(this.showWeigh.skin,'this.showWeigh------') if ((this.weighList.orderType == '澶栭攢')) { if (!this.showWeigh.skin) { this.temporaryWeighObj.skin = newV; @@ -266,14 +349,17 @@ }, computed: { - ...mapState(['globalweigh', 'globalinfraredStatus', 'globalWarning', 'globalisconnect', 'globalisUploadimg', - 'globalisLogin', 'socketTask','is_open_socket' + ...mapState(['globalinfraredStatus', 'globalWarning', 'globalisconnect', 'globalisUploadimg', + 'globalisLogin', 'socketTask','is_open_socket', ]), + ...mapGetters(['globalweigh']), token() { return uni.getStorageSync('token'); }, roleType() { - return uni.getStorageSync('roleType'); + console.log(uni.getStorageSync('userInfo'),'roleType----绉伴噸椤甸潰') + console.log(uni.getStorageSync('userInfo').type,'type----type') + return uni.getStorageSync('userInfo').type; }, weightStatus(){ //绉伴噸鏄惁寮傚父 1.鏃犺溅 2.杩炴帴涓� 3.姝e父; @@ -310,6 +396,9 @@ return (this.weighList.skin === 0 ? this.temporaryWeighObj.skin : this.weighList.skin) == this.temporaryWeighObj.hair; } if (this.weighList.orderType == '澶栬喘') { + console.log(this.weighList.hair,'this.weighList.hair=====') + console.log(this.temporaryWeighObj.skin,'this.temporaryWeighObj.skin') + console.log((this.weighList.hair === 0 ? this.temporaryWeighObj.skin : this.weighList.hair) == this.temporaryWeighObj.hair,'hhhhhhhhhhhh') return (this.weighList.hair === 0 ? this.temporaryWeighObj.skin : this.weighList.hair) == this.temporaryWeighObj.hair; } }, @@ -358,6 +447,50 @@ return true } }, + isJixuxiehuo() { //鏄惁鏄剧ず缁х画鍗歌揣鎸夐挳 + if(this.weighList?.tmTaskCoalItems && this.weighList?.tmTaskCoalItems.length > 0) { + return this.weighList?.tmTaskCoalItems.length > 0 + }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) { + // if( 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: { @@ -366,9 +499,13 @@ uni.showLoading({ title: '鍔犺浇涓�' }) + console.log(this.weighData.sceneId,'纾呮埧----') // 鑾峰彇绉伴噸淇℃伅 - this.$reqGet('weighList', { id: this.tmId }).then(res => { - console.log(res, '鑾峰彇绉伴噸淇℃伅'); + let params = {} + this.tmId ? params = { tmId: this.tmId, houseId: this.weighData.sceneId } : params = { houseId: this.weighData.sceneId } + console.log(params,'鍙傛暟===') + this.$reqGet('getTmTaskCoalNoCar', params).then(res => { + console.log(res, '鎻愮叅鍗曚俊鎭�'); uni.hideLoading() if (res.code == 0) { this.weighList = res.data; @@ -380,20 +517,68 @@ 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() //鑾峰彇璁惧淇℃伅 + }else { + Object.keys(this.weighList).forEach(key => { + this.weighList[key] = ''; + }); + this.$u.toast(res.msg ? res.msg : '鍗犳棤纾呭崟淇℃伅'); } }); }, - // confirmWeigh() { //鐐瑰嚮纭绉伴噸鎸夐挳 - // - // }, - // 纭绉伴噸鎺ュ彛 + 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() + }, confirmWeigh() { //鐐瑰嚮纭绉伴噸鎸夐挳 - this.isConfirmWeighLoading = true + if (this.isConfirmWeighLoading == false) { + this.isConfirmWeighLoading = true + if(this.weighData.weigh != 0) { + if (this.weighList.orderType == '澶栭攢') { + if (this.weighList.skin ? (this.weighList.skin < this.realTimeWeigh ? true : false) : true) { + this.saveWeigh(); + } else { + this.$u.toast('姣涢噸涓嶈兘灏忎簬鐨噸'); + this.isConfirmWeighLoading = false; + } + } else { + this.saveWeigh(); + } + }else { + this.$u.toast('鏈兘鑾峰彇鍦扮閲嶉噺'); + this.isConfirmWeighLoading = false; + } + } + }, + // 纭绉伴噸鎺ュ彛 + saveWeigh() { //鐐瑰嚮纭绉伴噸鎸夐挳 // this.weighData.coalContactClean = this.coalContactClean; - this.$reqPost('saveWeighYZY', this.weighData, 'json') + console.log(this.weighData,'澶嶇鍙傛暟----') + this.$reqPost('saveWeigh', this.weighData, 'json') .then(res => { console.log(res, '绉伴噸鎺ュ彛'); if (res.code == 0) { @@ -412,11 +597,123 @@ this.isConfirmWeighLoading = false; console.log(err); this.$u.toast(err.msg ? err.msg : '绉伴噸澶辫触'); - }); + }).finally(() => { + this.isConfirmWeighLoading = false; + }); }, - confirmRepeatWeigh() { //澶嶇 - - } + confirmAction() { //澶嶇 + this.showModal = true + }, + confirmRepeatWeigh() { //澶嶇浜屾纭 + this.repeatWeighLoading = true + setTimeout(() => { + // 3绉掑悗鑷姩鍏抽棴 + this.showModal = false; + }, 2000) + console.log(this.weighData.weigh,'this.weighData.weigh======') + if(this.weighData.weigh && this.weighData.weigh != 0) { + this.$reqPost('reWeighYZY', this.weighData, 'json').then(res => { + if (res.code == 0) { + this.repeatWeighLoading = false; + setTimeout(() => { + uni.navigateBack({ + delta: 1 + }); + this.$u.toast('澶嶇鎴愬姛'); + },1000) + // setTimeout(() => { + // uni.navigateBack({ + // delta: 1 + // }); + // }, 1000); + }else { + this.$u.toast('澶嶇澶辫触锛岃绋嶅悗閲嶈瘯' + (res.msg ? res.msg : '')); + } + }).finally(() => { + this.repeatWeighLoading = false; + }) + }else { + this.$u.toast('鏈兘鑾峰彇鍦扮閲嶉噺'); + this.repeatWeighLoading = false; + } + }, + // 鍔犲噺鐓� + addAndSubtractCoal() { + this.$reqPost('addAndSubtractCoal', { + deptId: this.weighData.deptId, + sceneId: this.weighData.sceneId, + carNo: this.weighData.carNo, + filedId: this.weighData.filedId, + tmId: this.weighData.tmId, + gateCameraId: this.weighData.gateCameraId, + equipmentCode: this.weighData.equipmentCode, + tmCode: this.weighData.tmCode, + sceneInOut: this.weighData.sceneInOut, + weigh: this.realTimeWeigh + }, 'json').then(res => { + if (res.code == 0) { + this.$u.toast('鎿嶄綔鎴愬姛锛屽嵆灏嗚繑鍥炰笂涓�椤�'); + setTimeout(() => { + uni.navigateBack({ + delta: 1 + }); + this.isConfirmWeighLoading = false; + }, 1000); + console.log(res, '鍔犲噺鐓�'); + } else { + this.$u.toast('鎿嶄綔澶辫触锛岃绋嶅�欓噸璇�'); + } + }); + }, + // 缁х画鍗歌揣 + UnloadingAgainHandle() { + this.UnloadingAgainLoading = true + this.$reqPost('continueWeigh', { + deptId: this.weighData.deptId, + sceneId: this.weighData.sceneId, + carNo: this.weighData.carNo, + tmId: this.weighData.tmId, + filedId: this.weighData.filedId, + gateCameraId: this.weighData.gateCameraId, + equipmentCode: this.weighData.equipmentCode, + tmCode: this.weighData.tmCode, + sceneInOut: this.weighData.sceneInOut, + weigh: this.realTimeWeigh + }, 'json').then(res => { + this.UnloadingAgainLoading = false + if (res.code == 0) { + this.$u.toast('鎿嶄綔鎴愬姛锛屽嵆灏嗚繑鍥炰笂涓�椤�'); + setTimeout(() => { + uni.navigateBack({ + delta: 1 + }); + }, 1000); + } else { + this.$u.toast('鎿嶄綔澶辫触锛岃绋嶅�欓噸璇�'); + } + }) + }, + // 鏀剧┖ + evacuation() { + this.evacuationModalShow = true; + }, + // 鏀剧┖寮圭獥纭 + evacuationConfirm() { + this.$reqPost('getTwoEvacuation', this.weighData, 'json').then(res => { + console.log(res, '绗簩娆℃斁绌�'); + if (res.code == 0) { + this.$u.toast('鎿嶄綔鎴愬姛'); + this.evacuationModalShow = false; + } else { + this.$u.toast(res.msg ? res.msg : '鎿嶄綔澶辫触'); + this.evacuationModalShow = true; + } + }); + }, + // 鏀剧┖寮圭獥鍙栨秷 + evacuationCancel() { + this.evacuationModalShow = false; + }, } }; </script> @@ -518,7 +815,7 @@ .one { // flex: 3; height: 290rpx; - margin: vww(20); + margin: vww(10) vww(20) vww(20) vww(20); border-radius: vww(15); .top { @@ -670,11 +967,12 @@ .bottom-block { width: calc(100% - 60rpx); box-sizing: border-box; - height: 420rpx; margin: 0 vww(15) vww(15) vww(15); background: #ffffff; box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12); border-radius: 20rpx; + padding: 20rpx 0; + box-sizing: border-box; @include flex; justify-content: center; overflow: hidden; @@ -715,15 +1013,15 @@ .three { margin: 0 auto vww(5); margin-bottom: vww(60); - width: 96%; - display: grid; - grid-template-columns: repeat(auto-fit, minmax(140rpx, 1fr)); - justify-content: center; - gap: vww(10); - color: #939393; - - .u-button { - width: vww(70); + width: 100%; + display: flex; + flex-wrap: wrap; + padding: 0 40rpx; + box-sizing: border-box; + justify-content: start; + .u-button{ + width: 200rpx; + margin: 10rpx 10rpx; } } @@ -745,11 +1043,23 @@ justify-content: space-between; } } -.chengzhong-btn{ - width: 80%; - margin: 0 auto; -} + .marginTop{ margin-top: 20rpx; } +.weighingDevice{ + .shuaxinBtn{ + width: calc(100% - 80rpx); + margin: 20rpx auto 0; + ::v-deep{ + .u-button--plain.u-button--primary{ + border-radius: 60rpx; + } + .u-button--normal{ + padding: 0 25rpx; + font-size: 28rpx; + } + } + } +} </style> -- Gitblit v1.9.1