yangan
2024-06-29 6a232ec3d1d75af66b5afb475895d585a494cbaf
pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue
@@ -7,21 +7,21 @@
            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>
                  v-else>仓库:{{ coalDetailsData.filedName || '暂无' }}</view>
            </view>
         </view>
         <view class="block-information">
            <view class="block-main">
               <view class="basic">
                  <view class="coalName">{{ coalDetailsData.coalName }}</view>
                  <view class="coalName">{{ coalDetailsData.productNames || coalDetailsData.productName }}</view>
                  <view class="status-button"
                     style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/statusbutton.png') no-repeat;
                              background-size: cover;">
@@ -34,7 +34,9 @@
                        size="40"></u-icon></view>
                  <view class="send-date">{{ coalDetailsData.sendDate }}</view>
               </view>
               <view class="coal-code">提煤单编号:&nbsp;&nbsp;{{ coalDetailsData.code || '' }}</view>
               <view class="coal-code">类型:&nbsp;&nbsp;{{ coalDetailsData.orderType || '' }}</view>
               <view class="coal-code">收发单编号:&nbsp;&nbsp;{{ coalDetailsData.code || '' }}</view>
               <view class="coal-code">车牌号:&nbsp;&nbsp;{{ coalDetailsData.carNo || '' }}</view>
               <view class="order-code"
                  v-if="!isSpecial">
                  订单编号:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ coalDetailsData.orderCode || '' }}</view>
@@ -44,26 +46,77 @@
                  v-show="timeLineStatus===9">
                  查看装载情况
               </view>
               <view class="weigh-item">
               <view class="weigh-item" v-if="isShowClean">
                  <view class="item">
                     <view class="concrete"
                        style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/skin.png') no-repeat;background-size: cover;">
                        皮</view>
                     <view class="num">{{ coalDetailsData.skin||"" }}</view>
                     <view class="num" v-if="weightObj.skin">{{  Number(weightObj.skin).toFixed(2) ||"" }}</view>
                  </view>
                  <view class="item">
                     <view class="concrete"
                        style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/hair.png') no-repeat;background-size: cover;">
                        毛</view>
                     <view class="num">{{ coalDetailsData.hair||""  }}</view>
                     <view class="num" v-if="weightObj.hair">{{  Number(weightObj.hair).toFixed(2) ||""  }}</view>
                  </view>
                  <view class="item">
                     <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">{{ coalDetailsData.clean||""  }}</view>
                     <view class="num" v-if="weightObj.clean">{{ Number(weightObj.clean).toFixed(2)  ||""  }}</view>
                  </view>
               </view>
            </view>
         </view>
      </view>
      <!-- 子菜单 ---表格 -->
      <view class="sub-table">
         <view class="first-line"><combined-title title="产品信息"></combined-title></view>
         <view class="table">
            <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-th align="center">件数</uni-th>
               </uni-tr>
               <uni-tr v-for="(subItem, index) in 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>{{ subItem.discount }}</view
               ></uni-td>
                  <uni-td align="right">
               <view>{{ subItem.productQuantity }}</view
               ></uni-td>
            </uni-tr>
            </uni-table>
         </view>
         <!-- 请输入集装箱号 -->
         <view class="codeBox" v-if="coalDetailsData.isContainerNum">
            <text>集装箱号:</text>
            <view class="inp">
               <u--input
                  placeholder="请输入集装箱号"
                  v-model="coalDetailsData.containerNumber"
               ></u--input>
            </view>
            <view>
               <u-button type="primary" text="确定" @click="enterClick"></u-button>
            </view>
         </view>
      </view>
@@ -71,14 +124,23 @@
         v-if="originInfoVisible&&!isSpecial">
         <view class="origin-info_wrapper">
            <view class="origin-info_content">
               <view class="first-line"><combined-title title="原发信息"></combined-title></view>
               <u-form :model="originInfoForm"
               <!-- 折叠 -->
               <zh-collapse  accordion>
               <zh-collapse-item
               class="collItem">
               <!-- title -->
               <view slot="title">
                  <view class="first-line"><combined-title title="原发信息"></combined-title></view>
               </view>
                  <view class="" slot='cont'>
                  <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>
@@ -126,7 +188,47 @@
                        </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>原发磅单
@@ -151,6 +253,11 @@
                     :disabled="isModifyoriginInfo"
                     :loading="submitOriginInfoLoading"></u-button>
               </view>
                  </view>
               </zh-collapse-item>
               </zh-collapse>
            </view>
         </view>
      </view>
@@ -226,7 +333,7 @@
               :loading="outLoading"
               loadingText="打印中,请稍候"></u-button>
         </view> -->
         <view class="weigh-button"><u-button text="展示提煤单"
         <view class="weigh-button"><u-button text="展示收发单"
               @click="showCaolPickUpBill"
               type="primary"
               shape="circle"></u-button></view>
@@ -267,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"
@@ -355,7 +462,8 @@
         return {
            swiperList:[],
            orderPlanId: null,
            radioValue:'煤场',
            radioValue:'场地',
            tmTaskCoalList:[],
            currentNum:0,
            guideLineshow:false,
            yyId: null,
@@ -365,7 +473,10 @@
               affiliationId:'',
               type:2,
            },
            coalDetailsData: {}, // 提煤单详情
            wareList:[],
            coalDetailsData: {
               tmTaskCoalList:[]
            }, // 提煤单详情
            currentPageCoalStatus: 0, // 当前页面提煤单状态
            // 获取所在磅房参数
            getWeightHouseObj: {
@@ -452,6 +563,7 @@
            timeout: '0',
            wsgShow: false,
            timeLineStatus: null,
            timeLineEqCode: '',
            originInfoNotice: '填写原发信息后可上磅计量',
            submitOriginInfoLoading: false,
@@ -495,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();
@@ -515,6 +643,35 @@
         },
         isNeedOrigin() {
            return uni.getStorageSync('isNeedOrigin')
         },
         //是否展示皮毛净
         isShowClean(){
            let  flag = true;
            console.log(this.coalDetailsData.tmTaskCoalList)
            const tempArr = this.coalDetailsData.tmTaskCoalList.filter(item=> item.isWeight === 1);
            if(!tempArr.length ){
               return false; //如果都没有返回假
            } else {
               flag =     tempArr.every(obj => obj['skin'] !== null && obj['clean'] !== null && obj['hair'] !== null );
               console.log(flag,'f;ag')
               return flag;
            }
         },
         //皮毛净
         weightObj(){
            const index = 0;//下标位 ,读取第几组的皮毛净;,默认最后一组;
            const tempArr = this.coalDetailsData.tmTaskCoalList.filter(item=> item.isWeight === 1);
             const result =tempArr.find(item=>!item.skin || !item.hair || !item.clean);
             console.log(result,'result')
             if(result){
               return result
             }else{
               return  tempArr[index];
             }
         }
      },
      methods: {
@@ -567,6 +724,7 @@
                  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;
@@ -596,12 +754,19 @@
                  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;
                  this.originInfoForm.contactPicture = this.coalDetailsData.contactPicture
                  this.tmTaskCoalList = this.coalDetailsData.tmTaskCoalList;
                  if (this.coalDetailsData.contactPicture) {
                     this.fileList1 = this.coalDetailsData.contactPicture.split(',').map(v => {
                        return {
@@ -991,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
@@ -1013,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({
@@ -1040,7 +1242,7 @@
            this.guideLineshow = true;
            this.swiperList = [];
            this.activeText = '';
            this.activeObj.affiliationId = this.coalDetailsData.filedId; //默认查煤场
            this.activeObj.affiliationId = this.coalDetailsData.filedId;
            this.getguideFun();
         },
@@ -1048,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();
@@ -1066,13 +1268,44 @@
               this.$refs.swiperAlbum.onPreviewTap();
               this.$refs.swiperAlbum.openPage();
            })
         },
         enterClick(){
            console.log('click')
            this.$reqPut('addContainer',{id:this.coalDetailsData.id,containerNumber:this.coalDetailsData.containerNumber},'json').then(res=>{
               console.log(res,'res')
               this.$u.toast('操作成功')
            })
         }
      }
   };
</script>
<style lang="scss"   scoped>
.codeBox{
   height: 100rpx;
      display: flex;
      width: 100%;
      justify-content: space-around;
      align-items: center;
   .inp{
         border: solid 1px #ccc;
      input{
         text-indent: 15px;
      }
   }
}
.table{
   width: 100%;
  /deep/ .uni-table{
   min-width: 0!important;
   margin-left: 20rpx;
  }
}
   .guidebox{
      height:600rpx;
      padding: 20rpx
@@ -1281,10 +1514,28 @@
            }
         }
      }
      .sub-table{
         width: 690rpx;
         min-height: 300rpx;
         margin: vww(20) 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;
         @include flex;
             flex-direction: column;
         justify-content: center;
         overflow: hidden;
         position: relative;
         top: vww(130);
         align-items: flex-start;
         /deep/ .uni-table{
            min-width: 0!important;
         }
      }
      .origin-info {
         width: 690rpx;
         height: 600rpx;
         margin: vww(20) 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);
@@ -1297,7 +1548,6 @@
         &_wrapper {
            width: 650rpx;
            height: 600rpx;
            @include flex;
            flex-direction: column;
            margin-bottom: vww(20);