yangan
2024-07-12 dbc79ab43fced444933174bd4148ee9f5dd777c3
pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue
@@ -7,13 +7,13 @@
            fontSize='36'></u-notice-bar>
         <view class="top-information">
            <view class="cutomer-name"
               v-if="orderType == '转入' || orderType == '转出'">煤场:{{ coalDetailsData.toFiledName || '' }}</view>
               v-if="orderType == '转入' || orderType == '转出'">场地:{{ coalDetailsData.toFiledName || '' }}</view>
            <view class="cutomer-name"
               v-else>客户:{{ coalDetailsData.customerName || '' }}</view>
            <view class="fild-name">
               <view class="">矿场:{{ coalDetailsData.deptName || '暂无' }}</view>
               <view class=""
                  v-if="orderType == '转入' || orderType == '转出'">煤场:{{ coalDetailsData.filedName || '' }}</view>
                  v-if="orderType == '转入' || orderType == '转出'">场地:{{ coalDetailsData.filedName || '' }}</view>
               <view class=""
                  v-else>仓库:{{ coalDetailsData.filedName || '暂无' }}</view>
            </view>
@@ -63,7 +63,7 @@
                     <view class="concrete"
                        style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/clean.png') no-repeat;background-size: cover;">
                        净</view>
                     <view class="num" v-if="weightObj.clean">{{ Number(weightObj.clean).toFixed(2)  ||""  }}</view>
                     <view class="num" v-if="(weightObj.clean || (weightObj.clean &&  weightObj.clean === 0) )">{{ Number(weightObj.clean).toFixed(2)  ||""  }}</view>
                  </view>
               </view>
            </view>
@@ -81,7 +81,8 @@
                  <uni-th align="center">皮重</uni-th>
                  <uni-th align="center">毛重</uni-th>
                  <uni-th align="center">净重</uni-th>
                   <uni-th align="center">扣吨</uni-th>
                   <uni-th align="center">扣吨</uni-th>
                  <uni-th align="center">件数</uni-th>
               </uni-tr>
               <uni-tr v-for="(subItem, index) in tmTaskCoalList" :key="index">
                  <uni-td align="center">
@@ -93,18 +94,20 @@
                  <view class="name" v-if="subItem.hair">{{ Number(subItem.hair) .toFixed(2) || '' }}</view>
               </uni-td>
               <uni-td align='right'>
                  <view class="name" v-if="subItem.clean">{{ Number( subItem.clean).toFixed(2) || '' }}</view>
                  <view class="name" v-if="(subItem.clean || (subItem.clean &&  subItem.clean === 0))">{{ Number( subItem.clean).toFixed(2) || '' }}</view>
               </uni-td>
               
                <uni-td align="right">
               <view>{{ subItem.discount }}</view
               ></uni-td>
                  <uni-td align="right">
               <view>{{ subItem.productQuantity }}</view
               ></uni-td>
            </uni-tr>
            </uni-table>
         </view>
         <!-- 请输入集装箱号 -->
         <view class="codeBox">
         <view class="codeBox" v-if="coalDetailsData.isContainerNum">
            <text>集装箱号:</text>
            <view class="inp">
               <u--input
@@ -128,16 +131,16 @@
               <!-- title -->
               <view slot="title">
                  <view class="first-line"><combined-title title="原发信息"></combined-title></view>
               </view>
                  <view class="" slot='cont'>
<u-form :model="originInfoForm"
                  <u-form :model="originInfoForm"
                  :rules="rules"
                  label-position="top"
                  label-width="160"
                  :label-style="{'marginLeft':'9px'}"
                  ref="originInfoRef">
                  <u-form-item prop="coalContactSkin">
                  <view v-if="coalDetailsData.isWeight">
                     <u-form-item prop="coalContactSkin">
                     <view class="second-line">
                        <view class="label-text"
                           :class="{ focusClass: isfocus1 }"><text style="color: #f56c6c;">*</text>皮重</view>
@@ -185,17 +188,57 @@
                        </view>
                        <view class="unit">吨</view>
                     </view>
                  </u-form-item>
                  </u-form-item>
                  </view>
                  <!-- 输入数量 -->
                  <view v-else class="table-div">
                  <uni-table
                   border
                  id="table-box"
                  emptyText="暂无更多数据">
                        <uni-tr>
                           <uni-th align="center" >产品</uni-th>
                           <!-- <uni-th align="center">皮重</uni-th>
                           <uni-th align="center">毛重</uni-th>
                           <uni-th align="center">净重</uni-th> -->
                           <uni-th align="center">数量</uni-th>
                        </uni-tr>
                        <uni-tr v-for="(subItem, index) in coalDetailsData.tmTaskCoalList" :key="index">
                           <uni-td align="center">
                              <view class="name">{{ subItem.productName }}</view></uni-td>
                        <!-- <uni-td align='right'>
                           <view  v-if="subItem.skin">{{ Number( subItem.skin).toFixed(2)  || ''}}</view>
                        </uni-td>
                        <uni-td align='right'>
                           <view class="name" v-if="subItem.hair">{{ Number(subItem.hair) .toFixed(2) || '' }}</view>
                        </uni-td>
                        <uni-td align='right'>
                           <view class="name" v-if="subItem.clean">{{ Number( subItem.clean).toFixed(2) || '' }}</view>
                        </uni-td> -->
                         <uni-td align="right">
                        <view>
                        <u--input
                        placeholder="请输入产品数量"
                        type='number'
                        v-model="subItem.productQuantity"
                        ></u--input>
                        </view></uni-td>
                     </uni-tr>
                     </uni-table>
                  </view>
                  <u-form-item prop='contactPicture'>
                     <view class="label-text">
                        <text style="color: #f56c6c;">*</text>原发磅单
                        <text style="color: #f56c6c;">*</text>原发单据
                     </view>
                     <u-upload :fileList="fileList1"
                        @afterRead="afterRead"
                        @delete="deletePic"
                        name="1"
                        multiple
                        :maxCount="2"
                        :maxCount="deletable ? fileList1.length : 2"
                        width="250"
                        height="150"
                        :previewFullImage="true"
@@ -311,7 +354,7 @@
      <!-- <view class="completeOutSale">
         <u-modal :show="completeOutSaleShow"
            title="确认"
            content="是否完成外销提煤单"
            content="是否完成外销收发单"
            :showCancelButton="true"
            @confirm="completeOutSaleConfirm"
            @cancel="completeOutSaleCancel"></u-modal>
@@ -331,14 +374,14 @@
            placement="row" 
            @change="radioChange"
            >
            <u-radio label="煤场" :name="'煤场'" :labelSize="30" :size="30"></u-radio>
            <u-radio label="单位"  :name="'单位'":labelSize="30" :size="30"></u-radio>
            <u-radio label="场地" :name="'场地'" :labelSize="30" :size="30"></u-radio>
            <u-radio v-for="(item,index) in wareList" :label="'仓库'+(index+1)"  :name="index":labelSize="30" :size="30" ></u-radio>
         </u-radio-group>
            <div class="guidebox">
            <u-swiper
            v-if="guideLineshow"
            :height="200"
            :height="400"
            @click="swiperClick"
            :list="swiperList"
            keyName="image"
@@ -374,7 +417,7 @@
         printerStyle
      },
      onPullDownRefresh() {
         this.getTakeCoal(); //获取提煤单详情
         this.getTakeCoal(); //获取收发单详情
         uni.stopPullDownRefresh();
      },
      onLoad(value) {
@@ -389,7 +432,7 @@
         this.changeglobalIsFirstWeighing(1)
         if (this.globalIsFirstWeighing === 1) {
            console.log('获取详情 onload');
            this.getTakeCoal(); //获取提煤单详情
            this.getTakeCoal(); //获取收发单详情
         }
         this.init(); //获取日志
         this.getgetService(); //获取客服
@@ -398,7 +441,7 @@
         this.coalDayPage(); //获取日志 定时任务
         if (this.globalIsFirstWeighing === 2) {
            console.log('获取详情 onShow');
            this.getTakeCoal(); //获取提煤单详情
            this.getTakeCoal(); //获取收发单详情
         }
      },
      onHide() {
@@ -419,7 +462,7 @@
         return {
            swiperList:[],
            orderPlanId: null,
            radioValue:'煤场',
            radioValue:'场地',
            tmTaskCoalList:[],
            currentNum:0,
            guideLineshow:false,
@@ -430,10 +473,11 @@
               affiliationId:'',
               type:2,
            },
            wareList:[],
            coalDetailsData: {
               tmTaskCoalList:[]
            }, // 提煤单详情
            currentPageCoalStatus: 0, // 当前页面提煤单状态
            }, // 收发单详情
            currentPageCoalStatus: 0, // 当前页面收发单状态
            // 获取所在磅房参数
            getWeightHouseObj: {
               deptId: '',
@@ -492,8 +536,8 @@
            },
            completeOutSaleShow: false,
            overTmWaixiao: null,
            list: [{ name: '手机号', subname: '1213456', id: 1 }, { name: '微信语音', id: 2 }], //呼叫客服选项
            servieceShow: false,
            list: [{ name: '手机号', subname: '', id: 1 }], //呼叫客服选项  { name: '微信语音', id: 2 }
              servieceShow: false,
            ablePrintInduction: false, //入门证是否显示
            ablePrintOut: false, //出门证是否显示
            enterLoading: false, //入门按钮loading
@@ -563,9 +607,25 @@
            return this.correctStatus !== 3
         },
         coalContactClean() {
            if(this.coalDetailsData.isWeight){
            let xx = BigNumber(this.originInfoForm.coalContactHair ? this.originInfoForm.coalContactHair : 0)
            let yy = BigNumber(this.originInfoForm.coalContactSkin ? this.originInfoForm.coalContactSkin : 0)
            return xx.minus(yy).toNumber() > 0 ? xx.minus(yy).toNumber().toFixed(2) : 0
            }else{
               //数量
               if(!this.coalDetailsData.tmTaskCoalList.length){
                  return false
               }else{
                  const reslut = this.coalDetailsData.tmTaskCoalList.find(item=>!item.productQuantity);
                  console.log(reslut);
                  if(reslut){
                     return false
                  }else{
                     return true
                  }
               }
            }
         },
         currentTime() {
            let currentDate = new Date();
@@ -651,7 +711,7 @@
               }
            })
         },
         // 获取提煤单详情
         // 获取收发单详情
         getTakeCoal() {
            uni.showLoading({
               title: '加载中'
@@ -659,11 +719,12 @@
            this.$reqGet('getTakeCoal', { takeCoalId: this.orderPlanId }).then(res => {
               if (res.code == 0) {
                  uni.hideLoading();
                  console.log(res, '提煤单详情');
                  console.log(res, '收发单详情');
                  this.coalDetailsData = res.data;
                  this.orderType = this.coalDetailsData.orderType;
                  // 
                  this.isSpecial = res.data.isSpecial
                  this.wareList=res.data.bunkerIds.split(",")
                  // // 判断是否完成外销订单
                  // this.completeOutSale.orderType = this.coalDetailsData.orderType;
                  // this.completeOutSale.deptId = this.coalDetailsData.deptId;
@@ -682,7 +743,7 @@
                  // 获取客服openId参数赋值
                  this.getServiceOpenid.deptId = this.coalDetailsData.deptId;
                  this.getServiceOpenid.filedId = this.coalDetailsData.filedId;
                  // 获取提煤单状态
                  // 获取收发单状态
                  this.currentPageCoalStatus = this.coalDetailsData.status;
                  // 获取原发信息
                  this.primarySkin = this.coalDetailsData.skinTwo;
@@ -693,8 +754,14 @@
                  this.ablePrintOut = this.coalDetailsData.hair && this.coalDetailsData.skin || this
                     .coalDetailsData.status === 6
                  // 原发信息回显以及控制是否可修改
                  this.haveInputOrigin = !this.coalDetailsData.skinTwo && this.coalDetailsData.orderType ===
                     '外购'
                  const originFlag = this.coalDetailsData.tmTaskCoalList.find(item=>!item.productQuantity);
                  if(this.coalDetailsData.isWeight === 1){
                     this.haveInputOrigin = (!this.coalDetailsData.skinTwo && this.coalDetailsData.orderType ===
                     '外购')
                  }else{
                     this.haveInputOrigin = !!originFlag
                  }
                  console.log(originFlag,this.coalDetailsData.tmTaskCoalList,'origin')
                  this.deletable = this.coalDetailsData.status > 3
                  this.originInfoForm.coalContactSkin = this.coalDetailsData.skinTwo;
                  this.originInfoForm.coalContactHair = this.coalDetailsData.hairTwo;
@@ -757,7 +824,7 @@
               });
            }, 5000);
         },
         // 展示提煤单详情
         // 展示收发单详情
         showCaolPickUpBill() {
            uni.navigateTo({
               url: `/pages/driver-page/driver-index/bill-of-lading-details/coal-pick-up-bill/coal-pick-up-bill?orderPlanId=${this.orderPlanId}`
@@ -1089,7 +1156,8 @@
               taskCoalCode: this.coalDetailsData.code,
               carNo: this.coalDetailsData.carNo,
            }
            if (this.originInfoForm.coalContactSkin && this.originInfoForm.coalContactHair && this
            if(this.coalDetailsData.isWeight === 1){
               if (this.originInfoForm.coalContactSkin && this.originInfoForm.coalContactHair && this
               .originInfoForm
               .contactPicture) {
               this.submitOriginInfoLoading = true
@@ -1111,6 +1179,42 @@
            } else {
               uni.$u.toast('请填写完整原发信息')
            }
            }else{
                  //数量
               form.numDtoList = this.coalDetailsData.tmTaskCoalList.map(item=>{
                  let obj  = {
                     tmId:item.id,
                     num:Number(item.productQuantity)
                  }
                  return obj;
               });
               //删除皮毛净
               delete form.clean;
               delete form.hair;
               delete form.skin;
               if (this.coalContactClean && this
               .originInfoForm
               .contactPicture) {
               this.submitOriginInfoLoading = true;
               console.log(form,'form')
               this.$reqPost('appSaveContact', form, 'json').then(res => {
                  if (res.code === 0) {
                     this.$u.toast('提交成功')
                     this.submitOriginInfoLoading = false
                  } else {
                     this.submitOriginInfoLoading = false
                     this.$u.toast(res.msg ? res.msg : '提交失败')
                  }
               }).then(()=>{
                     setTimeout(() => {
                     this.getTakeCoal()
                  }, 1000);
               })
            } else {
               uni.$u.toast('请填写完整原发信息')
            }
            }
         },
         streamView() {
            uni.navigateTo({
@@ -1138,7 +1242,7 @@
            this.guideLineshow = true;
            this.swiperList = [];
            this.activeText = '';
            this.activeObj.affiliationId = this.coalDetailsData.filedId; //默认查煤场
            this.activeObj.affiliationId = this.coalDetailsData.filedId;
            this.getguideFun();
         },
@@ -1146,12 +1250,12 @@
            this.guideLineshow = false;
         },
         radioChange(item){
            console.log(item);
            if(item == '煤场'){
            console.log(111,item,this.coalDetailsData,this.wareList);
            if(item == '场地'){
               this.activeObj.affiliationId = this.coalDetailsData.filedId;
               this.activeObj.type = 2
            }else{
               this.activeObj.affiliationId = this.coalDetailsData.deptId;
               this.activeObj.affiliationId = this.wareList.length>0?this.wareList[item]:this.coalDetailsData.deptId;
               this.activeObj.type = 1
            }
            this.getguideFun();
@@ -1413,7 +1517,7 @@
      .sub-table{
         width: 690rpx;
         min-height: 300rpx;
         margin: vww(20) vww(15) vww(13);
         margin: vww(40) vww(15) vww(13);
         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;
@@ -1426,9 +1530,12 @@
         align-items: flex-start;
         /deep/ .uni-table{
            min-width: 0!important;
         }
      }
         .uni-table::-webkit-scrollbar {
            display: none;
            }
         }
      .origin-info {
         width: 690rpx;