From c3db9f5a903f7213f14d9eaafc804ecdb3bdf2a0 Mon Sep 17 00:00:00 2001
From: 819527061@qq.com <123456>
Date: 星期五, 05 七月 2024 17:38:23 +0800
Subject: [PATCH] 无车牌修改的内容

---
 pages/driver-page/driver-index/bill-of-lading-details/nocarNoWeighingDevice/nocarNoWeighingDevice.vue |  155 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 135 insertions(+), 20 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..518498a 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,20 +102,19 @@
     </view>
     <!--  绉伴噸鍘嗗彶-->
     <weigh-item :list="weighHistory" class="weighingDecive-item"></weigh-item>
-    <view class="chengzhong-btn">
+    <view class="chengzhong-btn" v-if="applyHouseId && noCarNo == 1 && status == 15 && roleType == 4">
     <!--   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>
     </view>
-    <view class="chengzhong-btn marginTop">
+    <!--  iszj锛屾槸鍚﹀凡璐ㄦ瀛楁  璐ㄦ鍛樿韩浠�+鏈塼mId+璐ㄦ涔嬪墠  -->
+    <view class="chengzhong-btn marginTop" v-if="weighData.tmId && roleType == 4">
       <!--   鏀跺彂鍗曚俊鎭椂   -->
       <u-button type="primary"
                 text="澶嶇"
-                :disabled="weighData.tmId && roledType == 4"
                 :loading="repeatWeighLoading"
                 loadingText="纭"
                 @click="confirmRepeatWeigh"></u-button>
@@ -112,8 +130,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: {
@@ -192,6 +211,7 @@
     // 鐩戝惉閲嶉噺鍙樺寲
     globalweigh: {
       handler: function(newV) {
+        console.log(newV,'newV===')
         if(newV) {
           this.weighData.weigh = this.realTimeWeigh = newV;
           if  ((this.weighList.orderType == '澶栭攢')) {
@@ -266,14 +286,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父;
@@ -366,9 +389,41 @@
       uni.showLoading({
         title: '鍔犺浇涓�'
       })
+      console.log(this.weighData.sceneId,'纾呮埧----')
       // 鑾峰彇绉伴噸淇℃伅
-      this.$reqGet('weighList', { id: this.tmId }).then(res => {
-        console.log(res, '鑾峰彇绉伴噸淇℃伅');
+      // 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,'鍙傛暟===')
+      this.$reqGet('getTmTaskCoalNoCar', params).then(res => {
+        console.log(res, '鎻愮叅鍗曚俊鎭�');
         uni.hideLoading()
         if (res.code == 0) {
           this.weighList = res.data;
@@ -383,15 +438,37 @@
           this.outBuy = (this.weighList.orderType.indexOf('閿�') !== -1) && this.showWeigh.skin > 0;
           // 缁х画鍗歌揣鍙湁澶栬喘绫诲瀷绗簩娆′細鏈�
           this.canUnload = this.weighList.orderType === '澶栬喘' && this.showWeigh.hair > 0;
+        }else {
+          this.weighList = {}
+          this.$u.toast(res.msg ? res.msg : '鍗犳棤纾呭崟淇℃伅');
         }
       });
     },
-    // confirmWeigh() {  //鐐瑰嚮纭绉伴噸鎸夐挳
-    //
-    // },
-    // 纭绉伴噸鎺ュ彛
+    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')
           .then(res => {
@@ -412,10 +489,32 @@
             this.isConfirmWeighLoading = false;
             console.log(err);
             this.$u.toast(err.msg ? err.msg : '绉伴噸澶辫触');
-          });
+          }).finally(() => {
+        this.isConfirmWeighLoading = false;
+      });
     },
     confirmRepeatWeigh() {  //澶嶇
-
+      this.repeatWeighLoading = true
+      if(this.weighData.weigh != 0) {
+        this.$reqPost('reWeighYZY', this.weighData, 'json').then(res => {
+          if (res.code == 0) {
+            this.repeatWeighLoading = false;
+            this.$u.toast('澶嶇鎴愬姛');
+            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;
+      }
     }
   }
 };
@@ -518,7 +617,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 +769,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;
@@ -752,4 +852,19 @@
 .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