qingyiay
2024-02-20 aaaee1bb428a2943b6f31d858226d46f19f81ec5
pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue
@@ -38,6 +38,12 @@
               <view class="order-code"
                  v-if="!isSpecial">
                  订单编号:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ coalDetailsData.orderCode || '' }}</view>
               <view class="stream-view"
                  style="color: #475bfd;"
                  @click="streamView"
                  v-show="timeLineStatus===9">
                  查看装载情况
               </view>
               <view class="weigh-item">
                  <view class="item">
                     <view class="concrete"
@@ -163,12 +169,12 @@
      <view class="utilsBox">
         <view class="utils_chil utils_chilTop">
            <view class="top-button">
               <u-button text="签到"
               <u-button text="更换预约时间"
                  type="primary"
                  plain
                  @click="arriveClick"
                  @click="rcsqClick"
                  shape="circle"
                  :disabled="coalDetailsData.status >= 2"></u-button>
                  :disabled="currentPageCoalStatus>= 3"></u-button>
               <!-- <u-button text="入场申请"
                  type="primary"
                  plain
@@ -194,8 +200,16 @@
         </view>
      </view>
      <view class="weigh-ability">
         <view class="weigh-button">
            <u-button text="上磅计量"
               @click="cengZhongClick"
               type="primary"
               shape="circle"
               :disabled="haveInputOrigin&&!isSpecial"
               :loading="weighHouseLoading"></u-button>
         </view>
         <view class="weigh-button"
            v-show='ablePrintInduction'>
            v-show='ablePrintInduction&&!(coalDetailsData.skin&&coalDetailsData.hair)'>
            <u-button text="打印入门证"
               @click="printBefore('in')"
               type="primary"
@@ -216,11 +230,6 @@
               @click="showCaolPickUpBill"
               type="primary"
               shape="circle"></u-button></view>
         <view class="weigh-button"><u-button text="上磅计量"
               @click="cengZhongClick"
               type="primary"
               shape="circle"
               :disabled="haveInputOrigin&&!isSpecial"></u-button></view>
      </view>
      <view class="evacuationModal">
         <u-modal :show="evacuationModalShow"
@@ -230,14 +239,14 @@
            @confirm="evacuationConfirm"
            @cancel="evacuationCancel"></u-modal>
      </view>
      <view class="completeOutSale">
      <!-- <view class="completeOutSale">
         <u-modal :show="completeOutSaleShow"
            title="确认"
            content="是否完成外销提煤单"
            :showCancelButton="true"
            @confirm="completeOutSaleConfirm"
            @cancel="completeOutSaleCancel"></u-modal>
      </view>
      </view> -->
      <view class="serviece-customer">
         <u-action-sheet :actions="list"
            @select="selectClick"
@@ -278,10 +287,10 @@
         this.orderPlanId = value.orderPlanId;
         this.yyId = value.yyId;
         this.originInfoVisible = value.orderType === '外购'
         if (value.overTmWaixiao) {
            this.overTmWaixiao = value.overTmWaixiao
            this.getWeightHouseObj.overTmWaixiao = value.overTmWaixiao
         }
         // if (value.overTmWaixiao) {
         //    this.overTmWaixiao = value.overTmWaixiao
         //    this.getWeightHouseObj.overTmWaixiao = value.overTmWaixiao
         // }
         this.fileList1 = []
         this.changeglobalIsFirstWeighing(1)
         if (this.globalIsFirstWeighing === 1) {
@@ -404,10 +413,13 @@
            timeout: '0',
            wsgShow: false,
            timeLineStatus: null,
            timeLineEqCode: '',
            originInfoNotice: '填写原发信息后可上磅计量',
            submitOriginInfoLoading: false,
            ischeckedDefault: false,
            isSpecial: null //1 是特殊 0不是特殊
            ischeckedDefault: 0,
            isSpecial: null, //1 是特殊 0不是特殊
            printerType: '', //判断打印的是出门证还是入门证
            weighHouseLoading: false
         };
      },
      watch: {
@@ -472,6 +484,7 @@
            this.$reqGet('coalDayPage', { id: this.orderPlanId, timeout: this.timeout }).then(res => {
               if (res.code == 0) {
                  this.timeLineStatus = res.data[0].taskStatus
                  this.timeLineEqCode = res.data[0].eqCode
                  this.dayRZ = res.data.map(v => {
                     let slicedate = v.taskStatusDes.slice(0, 10);
                     if (slicedate == this.currentDate) {
@@ -515,11 +528,11 @@
                  this.orderType = this.coalDetailsData.orderType;
                  // 
                  this.isSpecial = res.data.isSpecial
                  // 判断是否完成外销订单
                  this.completeOutSale.orderType = this.coalDetailsData.orderType;
                  this.completeOutSale.deptId = this.coalDetailsData.deptId;
                  this.completeOutSale.filedId = this.coalDetailsData.filedId;
                  this.completeOutSale.clean = this.coalDetailsData.clean;
                  // // 判断是否完成外销订单
                  // this.completeOutSale.orderType = this.coalDetailsData.orderType;
                  // this.completeOutSale.deptId = this.coalDetailsData.deptId;
                  // this.completeOutSale.filedId = this.coalDetailsData.filedId;
                  // this.completeOutSale.clean = this.coalDetailsData.clean;
                  // 获取所在磅房参数赋值
                  this.getWeightHouseObj.deptId = this.coalDetailsData.deptId;
                  this.getWeightHouseObj.filedId = this.coalDetailsData.filedId;
@@ -564,28 +577,17 @@
                  this.$u.toast('加载失败');
               }
            }).then(() => {
               if (this.completeOutSale.orderType == "内购" || this.completeOutSale.orderType == "转入") {
                  if (this.completeOutSale.clean !== 0 && this.currentPageCoalStatus !== 6 && this
                     .currentPageCoalStatus !== 11 && this.currentPageCoalStatus !== 12) {
                     this.$reqGet('getTmTaskCoalOrderType', {
                        deptId: this.completeOutSale.deptId,
                        filedId: this.completeOutSale.filedId,
                        orderType: '外销'
                     }).then(res => {
                        if (res.data && res.data?.length !== 0) {
                           this.completeOutSaleShow = true
                           console.log(res, '完成外销订单');
                        }
                     })
                  }
               }
            }).then(() => {
               // 判断当前时间是否超出预约时间
               setTimeout(() => {
                  let endTime = this.coalDetailsData.yuYueSection.slice(0, 10) + ' ' + this
                     .coalDetailsData
                     .yuYueSection.slice(-5);
                  if (dayjs(this.currentTime).isAfter(endTime) && this.coalDetailsData.status <= 1) {
                  // 最大约束时间 maxRestrainTime
                  const maxRestrainTime = dayjs().subtract(this.coalDetailsData.flexibleTime,
                        'minute')
                     .format('YYYY-MM-DD HH:mm:ss');
                  console.log(maxRestrainTime, this.correctStatus);
                  if (dayjs(maxRestrainTime).isAfter(endTime) && this.correctStatus <= 1) {
                     // this.$u.toast('已超出预约时间,可点击入场申请重新入场')
                     this.timeout = '1'
                  }
@@ -598,6 +600,7 @@
               this.$reqGet('coalDayPage', { id: this.orderPlanId, timeout: this.timeout }).then(res => {
                  if (res.code == 0) {
                     this.timeLineStatus = res.data[0].taskStatus
                     this.timeLineEqCode = res.data[0].eqCode
                     this.dayRZ = res.data.map(v => {
                        let slicedate = v.taskStatusDes.slice(0, 10);
                        if (slicedate == this.currentDate) {
@@ -620,23 +623,23 @@
            });
         },
         // 签到
         arriveClick() {
            uni.navigateTo({
               url: `/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock?orderPlanId=${this.orderPlanId}&coalStatus=${
               this.correctStatus
            }&tmId=${this.getWeightHouseObj.tmId}&timeout=${this.timeout}&yyId=${this.yyId}&filedId=${this.getYuYueDataParams.filedId}&deptId=${
               this.getYuYueDataParams.deptId
            }&sendDate=${this.getYuYueDataParams.sendDate}&yuYueSection=${this.coalDetailsData.yuYueSection}`
            });
         },
         // 入场申请
         // rcsqClick() {
         // arriveClick() {
         //    uni.navigateTo({
         //       url: `/pages/driver-page/appointment/appointment?type=入场申请&takeCoalId=${this.orderPlanId}&yyId=${this.yyId}&filedId=${this.getYuYueDataParams.filedId}&deptId=${
         //       url: `/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock?orderPlanId=${this.orderPlanId}&coalStatus=${
         //       this.correctStatus
         //    }&tmId=${this.getWeightHouseObj.tmId}&timeout=${this.timeout}&yyId=${this.yyId}&filedId=${this.getYuYueDataParams.filedId}&deptId=${
         //       this.getYuYueDataParams.deptId
         //    }&sendDate=${this.getYuYueDataParams.sendDate}`
         //    }&sendDate=${this.getYuYueDataParams.sendDate}&yuYueSection=${this.coalDetailsData.yuYueSection}`
         //    });
         // },
         // 更换预约时间段
         rcsqClick() {
            uni.navigateTo({
               url: `/pages/driver-page/appointment/appointment?type=入场申请&takeCoalId=${this.orderPlanId}&yyId=${this.yyId}&filedId=${this.getYuYueDataParams.filedId}&deptId=${
               this.getYuYueDataParams.deptId
            }&sendDate=${this.getYuYueDataParams.sendDate}&coalStatus=${this.currentPageCoalStatus}&yuYueSection=${this.coalDetailsData.yuYueSection}&tmId=${this.getWeightHouseObj.tmId}`
            });
         },
         callCustomerService() {
            this.servieceShow = true
         },
@@ -701,8 +704,10 @@
         // 称重
         cengZhongClick() {
            this.changeglobalIsFirstWeighing(2)
            this.weighHouseLoading = true
            this.$reqGet('getWeighHouse', this.getWeightHouseObj).then(res => {
               console.log(res, '获取磅房');
               this.weighHouseLoading = false
               if (res.code == 0) {
                  this.weighData.sceneId = res.data.id;
                  this.weighData.gateCameraId = res.data.lastEquipmentId;
@@ -726,7 +731,9 @@
               } else {
                  this.$u.toast(res.msg ? res.msg : '未在磅房,请前往磅房后再试!!');
               }
            });
            }).catch(() => {
               this.weighHouseLoading = false
            })
         },
         // 放空
         evacuation() {
@@ -771,23 +778,25 @@
         },
         //点击打印入门证之前判断是否勾选了默认打印样式,否则弹出选择 是的话传本地储存选择的样式
         printBefore(type) {
            if (this.ischeckedDefault || uni.getStorageSync('ischeckedDefault')) {
               if (type === 'in') {
                  this.printEntryCertificate()
                  return
               } else if (type === 'out') {
                  this.printExitPermit()
                  return
               }
            } else {
            this.printerType = type
            if (!this.ischeckedDefault && !uni.getStorageSync('ischeckedDefault')) {
               this.$nextTick(() => {
                  this.$refs.printerStyleRef.init()
               })
            } else if (this.ischeckedDefault || uni.getStorageSync('ischeckedDefault')) {
               this.selectedPrintHandle(true)
            }
         },
         //处理选择的打印样式
         selectedPrintHandle(params1) {
            this.ischeckedDefault = params1
            if (this.printerType === 'in') {
               this.printEntryCertificate()
               return
            } else if (this.printerType === 'out') {
               this.printExitPermit()
               return
            }
         },
         // 打印入门证
         printEntryCertificate() {
@@ -834,19 +843,28 @@
               weighingNumber: 2,
               printing: uni.getStorageSync('selectedPrintStyle')
            }
            let form1 = uni.getStorageSync('WeighHouseForm') ? uni.getStorageSync('WeighHouseForm') : '{}'
            // let form1 = uni.getStorageSync('WeighHouseForm') ? uni.getStorageSync('WeighHouseForm') : '{}'
            this.outLoading = true
            this.$reqPost('printer', Object.assign(form, JSON.parse(form1)), 'json').then(res => {
               uni.hideLoading()
               this.outLoading = false
               if (res.code === 0) {
                  this.$u.toast('打印成功')
               } else {
                  this.$u.toast(res.msg ? res.msg : '打印失败')
            this.$reqGet('getWeighHouse1', this.getWeightHouseObj).then(r => {
               let form1 = {
                  sceneId: r.data.id,
                  gateCameraId: r.data.lastEquipmentId,
                  equipmentCode: r.data.lastEquipmentCode,
                  sceneInOut: r.data.sceneInOut
               }
            }).catch(e => {
               uni.hideLoading()
               this.outLoading = false
               this.$reqPost('printer', Object.assign(form, form1), 'json').then(res => {
                  uni.hideLoading()
                  this.outLoading = false
                  if (res.code === 0) {
                     this.$u.toast('打印成功')
                  } else {
                     this.$u.toast(res.msg ? res.msg : '打印失败')
                  }
               }).catch(e => {
                  uni.hideLoading()
                  this.outLoading = false
               })
            })
         },
         wsgContentConfirm() {
@@ -952,6 +970,11 @@
            } else {
               uni.$u.toast('请填写完整原发信息')
            }
         },
         streamView() {
            uni.navigateTo({
               url: `/pages/public-page/driverStream/driverStream?eqCode=${this.timeLineEqCode}`
            })
         }
      }
   };
@@ -1112,6 +1135,12 @@
               color: #7d7d7d;
            }
            .stream-view {
               height: vww(18);
               margin: vww(8);
               margin-left: 0;
            }
            .weigh-item {
               width: 100%;
               height: vww(36);