qingyiay
2023-09-15 2ea83048e7f11eb9a453da7371f9b3719a323fad
pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue
@@ -103,6 +103,24 @@
         </view>
      </view>
      <view class="weigh-ability">
         <view class="weigh-button"
            v-show='ablePrintInduction'>
            <u-button text="打印入门证"
               @click="printEntryCertificate"
               type="primary"
               shape="circle"
               :loading="enterLoading"
               loadingText="打印中,请稍候"></u-button>
         </view>
         <view class="weigh-button"
            v-show="ablePrintOut">
            <u-button text="打印出门证"
               @click="printExitPermit"
               type="primary"
               shape="circle"
               :loading="outLoading"
               loadingText="打印中,请稍候"></u-button>
         </view>
         <view class="weigh-button"><u-button text="展示提煤单"
               @click="showCaolPickUpBill"
               type="primary"
@@ -153,7 +171,6 @@
      },
      onShow() {
         this.init();
      },
      data() {
         return {
@@ -221,7 +238,11 @@
            completeOutSaleShow: false,
            overTmWaixiao: null,
            list: [{ name: '手机号', subname: '1213456', id: 1 }, { name: '微信语音', id: 2 }], //呼叫客服选项
            servieceShow: false
            servieceShow: false,
            ablePrintInduction: false, //入门证是否显示
            ablePrintOut: false, //出门证是否显示
            enterLoading: false, //入门按钮loading
            outLoading: false, //出门按钮loading
         };
      },
      onHide() {
@@ -329,6 +350,9 @@
                  this.primarySkin = this.coalDetailsData.skinTwo;
                  this.primaryHair = this.coalDetailsData.hairTwo;
                  this.primaryClean = this.coalDetailsData.cleanTwo;
                  // 入门证 和 出门证 是否显示
                  this.ablePrintInduction = this.coalDetailsData.hair || this.coalDetailsData.skin
                  this.ablePrintOut = this.coalDetailsData.hair && this.coalDetailsData.skin
               } else {
                  this.$u.toast('加载失败');
               }
@@ -515,6 +539,38 @@
         completeOutSaleCancel() {
            this.completeOutSaleShow = false
         },
         // 打印入门证
         printEntryCertificate() {
            uni.showLoading({
               title: '正在打印中,请稍后'
            })
            this.enterLoading = true
            this.$reqGet('printer', { type: 2, tmId: this.coalDetailsData.id }).then(res => {
               uni.hideLoading()
               this.enterLoading = false
               if (res.code === 0) {
                  this.$u.toast('打印成功')
               } else {
                  this.$u.toast(res.msg ? res.msg : '打印失败')
               }
            })
         },
         // 打印出门证
         printExitPermit() {
            uni.showLoading({
               title: '正在打印中,请稍后'
            })
            this.outLoading = true
            this.$reqGet('printer', { type: 3, tmId: this.coalDetailsData.id }).then(res => {
               uni.hideLoading()
               this.outLoading = false
               if (res.code === 0) {
                  this.$u.toast('打印成功')
               } else {
                  this.$u.toast(res.msg ? res.msg : '打印失败')
               }
            })
         },
      }
   };
</script>
@@ -543,7 +599,7 @@
   ::v-deep.bill-of-lading-details {
      width: 100%;
      height: 100vh;
      height: 100%;
      margin: 0 auto;
      display: flex;
      flex-direction: column;
@@ -702,7 +758,7 @@
      }
      .timeLine {
         height: 40%;
         height: 300rpx;
         margin: vww(20);
         position: relative;
         top: vww(120);
@@ -764,15 +820,18 @@
      .weigh-ability {
         width: 631rpx;
         height: vww(100);
         height: vww(200);
         margin: vww(80) auto;
         margin-bottom: vww(10);
         margin-top: vww(100);
         margin-bottom: vww(20);
         @include flex;
         flex-direction: column;
         justify-content: flex-start;
         .weigh-button {
            width: 631rpx;
            height: vww(89);
            height: vww(40);
            margin: vww(10);
            .u-button {
               font-size: 28rpx;