yangan
2024-06-26 9166395640600a5ec596bfbeefa00906597f095d
pages/loadUnload-page/selectTarget/selectTarget.vue
@@ -62,9 +62,7 @@
         :key="i">
                     <view class="first">
                        <view class="">{{ item.carNo || '' }}</view>
                        <view class=""><u-icon name="arrow-right"
                              color="#999999"
                              size="40"></u-icon></view>
                        <view class=""></view>
                     </view>
                     <view class="second">
                        <view class="coal-name">{{ item.productName || '' }}</view>
@@ -79,7 +77,7 @@
                           <view class="third-line_text">仓库:</view>
                           <view >{{ item.bunkerName }}</view>
                        </view>
                        <view class="third-line">
                        <view class="third-line"  v-if="item.productName === 'EDC'">
                           <view class="third-line_text">质检状态:</view>
                           <view> <u-tag :text="checkStatusList[item.checkStatus]" plain > </u-tag></view>
                        </view>
@@ -106,8 +104,7 @@
               <uni-tr>
                  <uni-th width='140'
                  align="center">操作</uni-th>
                   <uni-th align="center">产品</uni-th>
                  <uni-th align="center">车牌号</uni-th>
                   <uni-th align="center" width='120'>产品</uni-th>
                  <uni-th align="center">类型</uni-th>
                  <uni-th align="center">皮重</uni-th>
                  <uni-th align="center">毛重</uni-th>
@@ -120,14 +117,12 @@
               <uni-tr v-for="(subItem, index) in item.tmTaskCoalList" :key="index">
                   <uni-td  align="center">
               <view class="btnBox"> 
                  <!-- v-if="subItem.flag"  -->
                  <text  @click="viewDetail(subItem)">查看</text>
                  <text @click="enterOk(subItem)">确认装卸</text>
                  <!--   -->
                  <u-button   text='查看'  @click="viewDetail(subItem)"></u-button>
                  <u-button type='primary' text='确认装卸'  v-if="subItem.flag" @click="enterOk(subItem)"></u-button>
                  </view></uni-td>
                  <uni-td align="center">
                     <view class="name">{{ subItem.productName }}</view></uni-td>
                     <uni-td align="center">
                     <view style="width:150rpx">{{ subItem.carNo }}</view></uni-td>
                     <view>{{ subItem.productName }}</view></uni-td>
               <uni-td>
                  <view class="name">{{ subItem.orderType }}</view>
               </uni-td>
@@ -178,11 +173,16 @@
                     <text>请输入</text>:
                       <u--input
                          border="bottom"
                         :disabled="activeObj.productName === 'PVC' && activeObj.packingType === 5"
                        :placeholder="isNumOk ?  '数量' :'折吨'"
                        v-model="checkNum"
                     >
                     </u--input>
                     <text> {{isNumOk ? '件' : '吨' }}</text>
                     </view>
                     <!-- pvc 并且是大包 -->
                     <view class="pvcBig" v-if="activeObj.productName === 'PVC' && activeObj.packingType === 5">
                     </view>
                     <view v-if="isNumOk && activeObj.productQuantity">当前数量:{{activeObj.productQuantity}}件</view>
                     <view v-if="activeObj.containerNumber"><span>集装箱号:</span>{{activeObj.containerNumber}}</view>
@@ -234,7 +234,7 @@
               bunkerId:""
            },
            checkStatusList:[
               '待取样','已取样','合格','不合格'
               '待取样','已取样','质检中','待复核','复核中','待审定','审定中','已完成'
            ],
            index: '',
            enterZx:false,
@@ -318,6 +318,7 @@
                    title:'加载中'
                })
               this.$reqGet('getTaskCoalListByBunkerId', { bunkerId:this.dataForm.bunkerId }).then(res => {
               uni.hideLoading();
               if (res.code === 0) {
                  this.detailData = res.data.map(item=>{
                     item.tmTaskCoalList.map(el=>{
@@ -327,8 +328,13 @@
                   return item;
                  });
                  console.log(this.detailData,'detailData')
               uni.hideLoading();
               }else if(res.code === 1){
                  this.detailData = [];
                  this.$u.toast(res.msg ? res.msg : '操作失败!!')
               }
            }).catch(err=>{
               this.detailData = [];
               this.$u.toast(res.msg ? res.msg : '操作失败!!')
            })
         },
@@ -356,14 +362,21 @@
         },
         open(){},
         enterOk(item){
            console.log('123',item)
            this.activeObj = item;
            if(item.productQuantity){
            if( (item.orderType === '外购' ||item.orderType === '外购退' ) &&  item.productQuantity){
               this.isNumOk = true;
                  this.isClean = false;
            }else if(item.isWeight === 1){
               this.isClean = false;
            }else if( item.orderType ==='外购' &&  item.isWeight === 1){
               this.isClean = true;
               this.isNumOk = false;
            }else{
               this.isNumOk = false;
               this.isClean = false;
            }
            //pvc大包自动计算折吨
            if(item.productName === 'PVC' && item.packingType === 5){
               this.checkNum =  (Number(item.productQuantity) * 60)
            }
         this.enterZx = true;
            
@@ -378,18 +391,34 @@
         },
         confirmModal(){
            this.enterZx = false;
                uni.showLoading({
                    title:'加载中'
                })
            this.$reqPost('confirmLoadAndUnload',{ 
               id: this.activeObj.id,
               productQuantity:this.isNumOk ? this.checkNum :this.activeObj.skin,
               discount:this.isClean ? this.checkNum : null,
               isPretendDischar:this.activeObj.isPretendDischar
             },'json').then(res=>{
               uni.hideLoading();
               console.log(res,'rez')
               this.checkNum = '';
               if(res.code === 1){
                  console.log('触发')
                  this.$u.toast(res.msg || '失败');
                  uni.hideLoading();
               }else{
                 this.$u.toast('操作成功');
                    this.getDetailData();
               }
               setTimeout(() => {
                  this.getDetailData();
               }, 500);
            
            }).catch((err) => {
                this.$u.toast(err.msg || '失败');
            }).finally(() => {
            uni.hideLoading();
            })
         },
         //判断是否是 三种特殊类型对应弹窗
@@ -435,6 +464,17 @@
<style lang="scss"
   scoped>
::-webkit-scrollbar{
        display: none;
   }
   .table{
   width: 100%;
  /deep/ .uni-table{
   min-width: 0!important;
   margin-left: 20rpx;
  }
}
      // 自主配送
         .self-deliver {
         position: relative;
@@ -486,7 +526,7 @@
         font-size: 12px;
        }
   /deep/ .uni-table{
         min-width: 100rpx!important;
         min-width: 0rpx!important;
         // position: sticky !important;;
      }
   /deep/    .uni-table-body-wrapper {
@@ -621,7 +661,7 @@
         .third {
            width: 96%;
            height:  120rpx;
            height:  auto;
            font-size: 30rpx;
            font-weight: 300;
            color: #515151;