From bca2dd2d59de29814f9c260edc497834818267e7 Mon Sep 17 00:00:00 2001
From: 819527061@qq.com <123456>
Date: 星期二, 30 七月 2024 11:43:58 +0800
Subject: [PATCH] 复磅细节问题

---
 pages/driver-page/driver-index/bill-of-lading-details/nocarNoWeighingDevice/nocarNoWeighingDevice.vue |  150 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 101 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 091b28b..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
@@ -121,32 +121,32 @@
                   @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);  -->
+<!--      <view class="chengzhong-btn" v-if="weighData.tmId && roleType == 4">
+        &lt;!&ndash;   鏀跺彂鍗曚俊鎭椂 status: 棰嗗彇(0),棰勭害(1),绛惧埌(2),鍏ュ満(3),绉扮毊(4),绉版瘺(5),绂诲満(6), 鍏ョ鎴�(7),鍑虹鎴�(8),鍏ョ叅浠�(9),鍑虹叅浠�(10)
+        ,鏀剧┖(11),浣滃簾(12),鍏ュ満鐢宠(13),杩涘叆鍦洪櫌(14),鐢宠璁¢噺(15);  &ndash;&gt;
         <u-button type="primary"
                   text="澶嶇"
                   :loading="repeatWeighLoading"
                   loadingText="纭"
-                  @click="confirmRepeatWeigh"></u-button>
-      </view>
+                  :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>
+        ></u-button>
       </view>
       <view class="chengzhong-btn" v-if='weighData.tmId && canUnload && isJixuxiehuo && roleType == 4'>
-        <div>{{!isJixuxiehuo}}</div>
         <u-button type="primary"
                   text="缁х画鍗歌揣"
                   @click="UnloadingAgainHandle"
-                  :loading="UnloadingAgainLoading"
+
                   loadingText="纭"
-                  :disabled="isweigh||realTimeWeigh == 0"
-                  ></u-button>
+                  :disabled="isweigh||realTimeWeigh == 0 || statusWeigh == 3"
+        ></u-button>
       </view>
       <!-- 鏀剧┖ -->
       <view class="chengzhong-btn" v-if="weighData.tmId && roleType == 4">
@@ -157,6 +157,16 @@
                   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="evacuationModal">
@@ -189,6 +199,7 @@
   },
   data() {
     return {
+      statusWeigh: '',  //鐘舵��
       isWeighing:'',
       timer:null,
       weighData: {
@@ -250,6 +261,9 @@
       applyHouseId:'',  //纾呮埧鍙�
       noCarNo:0,  //鏄惁鏈夎溅鐗屽彿(鏈夎溅鐗�0锛屾棤杞︾墝1)
       status:null,  //鐘舵��
+      orderCode:'',
+      showModal: false,
+      modalContent: '纭瑕佸纾呭悧锛�'
     };
   },
   watch: {
@@ -434,13 +448,49 @@
       }
     },
     isJixuxiehuo() {   //鏄惁鏄剧ず缁х画鍗歌揣鎸夐挳
-      console.log(this.weighList?.tmTaskCoalItems.length - 1 > 0,'this.weighList?.tmTaskCoalItems===')
-      if(this.weighList?.tmTaskCoalItems) {
-        return this.weighList?.tmTaskCoalItems.length - 1 > 0
+      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: {
@@ -451,34 +501,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 +517,39 @@
           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 {
-          this.weighList = {}
+          Object.keys(this.weighList).forEach(key => {
+            this.weighList[key] = '';
+          });
           this.$u.toast(res.msg ? res.msg : '鍗犳棤纾呭崟淇℃伅');
         }
       });
+    },
+    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,7 +577,8 @@
     // 纭绉伴噸鎺ュ彛
     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) {
@@ -553,14 +601,20 @@
         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;
-            this.init()
             setTimeout(() => {
               uni.navigateBack({
                 delta: 1
@@ -589,7 +643,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 +674,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 +1018,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