yangan
2024-12-10 3ec0c69457a438fdc5ce4d3fa7eee40ef9c68a18
subPages/pvcSplicePage/kuguan.vue
@@ -1,6 +1,172 @@
<template>
<div class="warp">
    库管装卸
    <view class="history-information"
         >
                     <view class="first">
                        <view class="">{{ pageData.carNo || '' }}</view>
                        <view class=""></view>
                     </view>
                     <view class="second">
                        <view class="coal-name">{{ pageData.productNames?limitString(pageData.productNames,20,'...'):'' || ''}}</view>
                        <view class="order-type">{{ pageData.orderType || '' }}</view>
                     </view>
                     <view class="third">
                        <view class="third-line">
                           <view class="third-line_text">客户名称:</view>
                           <view>{{ pageData.customerName }}</view>
                        </view>
                           <view class="third-line" v-if="/聚氯乙烯树脂/.test(pageData.productName)">
                           <view class="third-line_text">包装类型:</view>
                           <view>{{ proType[pageData.packingType] }}</view>
                        </view>
                        <view class="third-line"  v-if="pageData.productName === '二氯乙烷(EDC)'">
                           <view class="third-line_text">质检状态:</view>
                           <view> <u-tag :text="checkStatusList[pageData.checkStatus]" plain > </u-tag></view>
                        </view>
                     </view>
                     <view class="fourth">
                        <text v-if="pageData.containerNumber">集装箱号:{{ pageData.containerNumber}}</text>
                     </view>
                     <view class="fourth">
                        <view class="fourth-icon">
                           <view
                              style="width: 24rpx;height: 24rpx;line-height: 24rpx;background: url('https://wrzs.czjlchem.com:9090/appimg/image/banner/clock.png') no-repeat;background-size: cover">
                           </view>
                        </view>
                        <view class="senddate">{{ pageData.sendDate }}</view>
                     </view>
                     <view class="fourth">
                        <view class="fourth-icon">
                           <view
                              style="width: 26rpx;height: 26rpx;line-height: 26rpx;background: url('https://wrzs.czjlchem.com:9090/appimg/image/banner/carnNUm.png') no-repeat;background-size: cover;">
                           </view>
                        </view>
                        <view class="senddate">{{ pageData.orderCode }}</view>
                     </view>
                                     <view class="table">
         <uni-table border stripe
         emptyText="暂无更多数据">
               <uni-tr>
                   <uni-th align="center" width='800'>产品</uni-th>
                   <uni-th align="center" width='200'>包装</uni-th>
                  <!-- <uni-th align="center" width='100'>皮重</uni-th>
                  <uni-th align="center" width='100'>毛重</uni-th>
                  <uni-th align="center" width='100'>净重</uni-th>
                  <uni-th align="center" width='100'>数量</uni-th>  -->
                  <!-- <uni-th align="center"  width='120'>确认量</uni-th>  -->
                   <uni-th align="center"  width='120'>计划量</uni-th>
                  <uni-th align="center"  width='100'>计重方式</uni-th>
                  <uni-th align="center"  width='250'>请输入</uni-th>
                   <!-- <uni-th align="center"  width='100'>实际量</uni-th>  -->
               </uni-tr>
               <uni-tr v-for="(subItem, index) in detailData" :key="index">
                  <uni-td align="left">
                     <view style="font-size: 25rpx;">{{ subItem.productName  +  ( subItem.productGrade  ? '-' + subItem.productGrade :'')   }}</view></uni-td>
               <!-- <uni-td>
                  <view>{{ subItem.bunkerName }}</view>
               </uni-td>
               <uni-td>
                  <view class="name" v-if="subItem.skin">{{ Number(subItem.skin).toFixed(2) || ''  }}</view>
               </uni-td>
               <uni-td>
                  <view class="name" v-if="subItem.hair"> {{  Number(subItem.hair).toFixed(2) || ''  }}</view>
               </uni-td>
                  <uni-td>
                  <view class="name" v-if="(subItem.clean || (subItem.clean && subItem.clean === 0))">{{ Number(subItem.clean).toFixed(2) || ''}}</view>
               </uni-td>
               <uni-td>
                  <view class="name">{{ subItem.productQuantity }}</view>
               </uni-td> -->
               <uni-td align="center">
                  <view class="name"  style="font-size: 25rpx;" >{{ proType[subItem.packingType] }}</view>
               </uni-td>
               <!-- <uni-td align="right">
                  <view class="name"  style="font-size: 25rpx;">{{ subItem.productQuantity }}</view>
               </uni-td> -->
               <uni-td align="center">
                  <view class="name"  style="font-size: 25rpx;">{{ subItem.planMeasure }}</view>
               </uni-td>
               <uni-td >
                     <u-tag :text="'计数'" plain v-if="subItem.isWeight==0"></u-tag>
                     <u-tag  :text="'称重'"  plain v-else-if="subItem.isWeight==1"></u-tag>
                     <u-tag :text="'称重计数'"  plain v-else-if="subItem.isWeight==2"></u-tag>
                     <u-tag v-else></u-tag>
               </uni-td>
               <uni-td align="right">
                  <view style="border:  solid 1rpx red;"><u--input
                          type='digit'
                        :placeholder="'请输入'"
                        v-model="subItem.productQuantity"
                     >
                     </u--input></view>
               </uni-td>
               <!-- <uni-td>
                  <view class="name">{{ subItem.realityMeasure }}</view>
               </uni-td> -->
<!--
                <uni-td align="center">
               <view>{{ subItem.bunkerName }}</view></uni-td> -->
                 <!-- <uni-td align="center">
               <view  class="name">{{ subItem.statusView }}</view></uni-td> -->
            </uni-tr>
            </uni-table>
            <view style="display:flex;margin-top:20rpx;width: 30%;">是否空车出厂: <u-radio-group
                        v-model="isEmptyCar"
                         placement="row"
                         iconPlacement="right"
                         style="justify-content: space-evenly"
                     >
                        <u-radio
                        :key="1"
                        :label="'是'"
                        :name="'1'"
                        shape="circle"
                        iconSize="32"
                        label-size="32"
                        size="40"
                        >
                        </u-radio>
                        <u-radio
                        :key="0"
                        :label="'否'"
                        :name="'0'"
                        shape="circle"
                        iconSize="32"
                        label-size="32"
                        size="40"
                        >
                        </u-radio>
                     </u-radio-group></view>
                     <view  class="footerBtn">
                        <u-button type="primary"
                        @click="confirmLoad"
                        :size="300" text="确认装卸"></u-button>
                     </view>
       </view>
               </view>
                  <!-- 场内接单弹窗 -->
            <view class="">
               <u-modal :show="insideConnectShow"
                  title="提示"
                  showCancelButton
                  content="是否确认装卸"
                  @confirm="insideConnectConfirm"
                  @cancel="insideConnectCancel"></u-modal>
            </view>
</div>  
</template>
@@ -8,15 +174,27 @@
export default {
    data() {
        return {
            pageData:[],
            pageData:{},
         insideConnectShow:false,
            id:'',
            detailData:[],
            proType:['散装','液氯瓶装','罐装','PVC25','PVC80','PVC1150','PVc1200'],
            coalStatus: ['领取', '预约', '签到', '入场', '称皮', '称毛', '离场', '入磅房', '出磅房', '入仓库', '出仓库', '放空', '作废', '入场申请',
               '进入场院', '异常审核中', '返回加减吨', '超时', '打印中', '打印中', '填写', '放空确认中', '超最大毛重确认中','补打','入场检查','质检中',
               '离场检查','已打印','装卸','返回加减吨确认中'
            ],
        }
    },
    onLoad(params){
        this.pageData = JSON.parse(params.item)
        console.log(params,'123')
        this.id = params.id;
        this.init(params.id);
      if(this.pageData.orderType === '外购'){
               this.isEmptyCar = '1';
            }else if(this.pageData.orderType === '外销' || this.pageData.orderType === '外购退'){
               this.isEmptyCar = '0';
            }
    },
    onShow(){
@@ -26,17 +204,185 @@
        init(id){
            this.$reqGet('getPdListByMainTmTaskCoalId',{mainTmTaskCoalId:id}).then((res) => {
                console.log(res,'res')
                this.detailData = res.data;
            })
        }
        },
        limitString(str, limit, suffix = '...') {
                     if (str.length <= limit) return str;
                     return str.slice(0, limit) + suffix;
      },
      //点击装卸
      confirmLoad(){
         this.insideConnectShow = true;
      },
      insideConnectConfirm(){
         let mainPQ,subPQjoin =  ''; // 1主 2子
         this.detailData.forEach(item=>{
            if(item.isPindan === 1){
               mainPQ = item.productQuantity;
            }else if(item.isPindan === 2){
               let str = item.id + ':' + item.productQuantity + ',';
               subPQjoin  += str;
            }
         })
         console.log(mainPQ,subPQjoin,'131313')
         this.insideConnectShow = false;
         this.$reqPost('pvcConfirmLoadAndUnload',{
               id: this.pageData.id,
               productQuantity:mainPQ || '',
               isEmptyCar:this.isEmptyCar,
               isPretendDischar:this.pageData.isPretendDischar,
               productId: this.pageData.productId ,
               pdZiDanPq:subPQjoin || '',
             },'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('操作成功');
                 setTimeout(() => {
                  // this.init();
                  uni.switchTab({
                        url: '/pages/tabbar-page/index-tabbar/index-tabbar'
                     })
               }, 500);
               }
            });
      },
      insideConnectCancel(){
         this.insideConnectShow = false;
      }
    },
}
</script>
<style lang="scss" scoped>
   .table{
   width: 100%;
   margin-top: 30rpx;
  /deep/ .uni-table{
   min-width: 0!important;
   margin-left: 20rpx;
   width: auto;
  }
}
.footerBtn{
   width: 300rpx;
   margin-top: 30rpx;
   float: right;
   font-size: 26rpx;
   height: 100rpx;
}
.warp{
    width: 100%;
    height: calc(100vh - 75px);
    .history-information {
               position: relative;
         margin-bottom:30rpx;
         margin-top: 10rpx;
         background: #ffffff;
         border-radius: 20rpx;
         @include flex flex-direction: column;
         padding: 10px;
         align-items: flex-start;
         justify-content: space-evenly;
         box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12);
         .first {
            width: 96%;
            height: 34rpx;
            font-size: 32rpx;
            font-weight: 300;
            color: #303030;
            @include flex;
            margin: vww(10) vww(10) 0;
         }
         .second {
            width: 100%;
            height: 31rpx;
            font-size: 30rpx;
            font-weight: 300;
            color: #515151;
            margin: vww(10) vww(10) 0;
            margin-bottom: 15rpx;
            @include flex;
            justify-content: flex-start;
            .coal-name {
               min-width: vww(20);
               height: vww(20);
               margin-right: vww(21);
            }
            .order-type {
               height: 45rpx;
               color: #035cfb;
               border: 2px solid #035cfb;
               border-radius: 4rpx;
               padding: vww(2) vww(4);
               margin-left: 70%;
               text-align: center;
            }
         }
         .third {
            width: 96%;
            height:  auto;
            font-size: 30rpx;
            font-weight: 300;
            color: #515151;
            margin: vww(10) vww(10) 0;
            @include flex;
            flex-direction: column;
            .third-line {
               @include flex;
               align-items: center;;
               &_text {
                  color: #919090;
               }
               &_num {
                  color: #035cfb;
               }
            }
         }
         .fourth {
            width: 100%;
            height: 31rpx;
            font-size: 30rpx;
            font-weight: 300;
            color: #515151;
            position: relative;
            margin: vww(10) vww(10) 0;
            @include flex;
            .fourth-icon {
               width: vww(13);
               height: vww(13);
               margin-right: vww(14);
            }
            .senddate {
               flex: 1;
            }
         }
      }
}