yangan
2024-11-11 4e517dc54e1e3e5e5b543383c321161de351272e
subPages/splicingOrders/index.vue
@@ -3,17 +3,24 @@
   <view class="history-information"    v-for="item,i in datetailData"       
         :key="i">
                     <view class="first">
                        <view class="">{{ item.carNo || '' }}</view>
                        <view class="">{{ item.orderCode || '' }}</view>
                        <view class=""></view>
                     </view>
                     <view class="second">
                        <view class="coal-name">{{ item.productNames || item.productName }}</view>
                        <view class="order-type">{{ item.orderType || '' }}</view>
                     </view>
                            <view class="second">
                                <view class="coal-name">品级: {{ item.productGrade }}</view>
                            </view>
                     <view class="third">
                        <view class="third-line">
                           <view class="third-line_text">客户名称:</view>
                           <view>{{ item.customerName }}</view>
                        </view>
                                <view class="third-line">
                           <view class="third-line_text">车队名称:</view>
                           <view>{{ item.fleetName }}</view>
                        </view>
                           <view class="third-line" v-if="/聚氯乙烯树脂/.test(item.productName)">
                           <view class="third-line_text">包装类型:</view>
@@ -40,76 +47,73 @@
                        </view>
                        <view class="senddate">{{ item.orderCode }}</view>
                     </view>
                                     <view class="table">
         <uni-table border stripe
         emptyText="暂无更多数据">
               <uni-tr>
                   <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='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">计划量</uni-th>
                   <uni-th align="center">实际量</uni-th>
               </uni-tr>
               <uni-tr v-for="(subItem, index) in item.tmTaskCoalList" :key="index">
                  <uni-td align="center">
                     <view>{{ subItem.productName }}</view></uni-td>
                     <uni-td align="center">
                     <view>{{ subItem.productGrade }}</view></uni-td>
                     <uni-td>
                  <view>{{ proType[item.packingType] }}</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>
                  <view class="name">{{ subItem.planMeasure }}</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 class="footer">   
                    <view class="rightBtn">   <u-button type='primary' text='确认拼单'></u-button></view>
                    <view class="rightBtn">   <u-button type='primary' text='确认拼单' @click="enterPin(item)"></u-button></view>
            
                </view>
       </view>
         <u-empty mode="data"
                  icon="http://cdn.uviewui.com/uview/empty/data.png"
                  textSize="30"
                  iconSize="1000"
                  text="暂无数据"
                  v-if="datetailData.length === 0"></u-empty>
         <u-popup :show="showLing"
            @close="closeling"
            closeOnClickOverlay
            @open="openLing"
            mode="center"
            round="10">
            <view class="receiverPopup">
                 <view class="tableCon"   v-if="pageList.length">
               <view style="text-align: center;">选择吨数</view>
               <u-radio-group v-model="radioValue"  borderBottom placement="column"
               @change="radioChange"
               >
                  <view
                  style="margin:15rpx" v-for="(item, index) in pageList" :key="index">
                     <u-radio
                     :size='40'
                  :iconSize='50' labelSize='32' shape="circle"
                        :key="index"
                        :label="`${item.productName} - ${item.productGrade?item.productGrade : '暂无等级' } - ${item.planMeasure}吨`"
                        :name="item.id"></u-radio>
                  </view>
               </u-radio-group>
               <view class="receiverPopup__btn"><u-button text="确定"
                  type="primary"
                  @click="popupDetermineClick"
                  :loading="ClickLoading"></u-button></view>
        </view>
            </view>
         </u-popup>
            <u-modal :show="showTwo" :title="'确认拼单'"
            showCancelButton
            @confirm="falseConfirm"
         @cancel="falseCancel"
            ></u-modal>
               </view>
  </view>
</template>
<script>
export default {
    data() {
        return {
            proType:['散装','液氣瓶装','罐装','PVC25','PVC80','PVC1150','PVc1200'],
            proType:['散装','液氯瓶装','罐装','PVC25','PVC80','PVC1150','PVc1200'],
            datetailData:[],
            taskId:'',
            pageList:[],
            showTwo:false,
            activeObj:{},
            showLing:false,
            radioValue:'',
         orderType:'',
            radioChange:"",
            ClickLoading:false,
        }
    },
    methods: {
@@ -117,11 +121,77 @@
            uni.showLoading({
               title: "加载中"
            })
            this.$reqGet('getUnclaimedList',{taskCoalId:this.taskId}).then((res) => {
            this.$reqGet('getUnclaimedList',{taskCoalId:this.taskId,orderType:this.orderType}).then((res) => {
                this.datetailData =  res.data;
                uni.hideLoading();
            })
        }
        },
        enterPinDan(){
             uni.showLoading({
                title: "加载中"
            })
           this.$reqPost('splicingOrders',{
            orderPlanId: this.activeObj.orderPlanId,
         fleetId: this.activeObj.fleetId,
          customerId: this.activeObj.customerId,
         xsUserId: this.activeObj.xsUserId,
         pvcForwardId:this.radioValue,
           taskCoalId: this.taskId
           },'params').then(res=>{
            console.log(res,'resss')
            if(res.code === 0 ){
             this.$u.toast('操作成功');
             this.showLing = false;
                   uni.switchTab({
                        url: '/pages/tabbar-page/index-tabbar/index-tabbar'
                     });
            }else{
                 this.$u.toast('失败')
            }
           }).finally(() => {
               uni.hideLoading();
           })
        },
        popupDetermineClick(){
                this.enterPinDan();
        },
        enterPin(item){
            this.activeObj = item;
            if(/聚氯乙烯树脂/.test(item.productName)){
                 this.showLing = true;
            }else{
                this.enterPinDan();
                this.showTwo = true;
            }
        },
         closeling() {
            this.showLing = false;
            this.receiveNum = null;
         },
               openLing() {
               this.getBuild();
            },
                   getBuild(item){
            console.log(this.productName,'opr')
               this.$reqGet('getBuildList',{orderPlanId:this.activeObj.orderPlanId,customerId:this.activeObj.customerId,status:1,fleetId:this.activeObj.fleetId}).then(res=>{
               console.log(res,'resss')
                    this.pageList = res.data.map(item=>{
                  item.flag = false
                  return item;
               });
            })
         },
            falseConfirm (){
                this.enterPinDan();
            },
            falseCancel(){}
        
    },
    computed:{
@@ -130,6 +200,7 @@
    onLoad(params)
    {
        this.taskId = params.taskCoalId;
      this.orderType = params.orderType;
    },
    onShow(){
        this.init();
@@ -140,6 +211,8 @@
<style lang="scss"
   scoped>
       .table{
   width: 100%;
    margin-top: 10rpx;
@@ -148,19 +221,23 @@
   margin-left: 20rpx;
   width: auto;
  }
  .footer{
    height: 100rpx;
    .rightBtn{
        width: 200rpx;
        float: right;;
    }
  }
        }
    .warp-box{
        width: 96%;
        margin:  10rpx auto;
        height: calc(100vh - 10vh);
          .footer{
            width: 100%;
    height: 100rpx;
    .rightBtn{
        width: 200rpx;
        float: right;;
        margin-top: 20rpx;
        margin-right: 20rpx;
    }
  }
    }      .history-information {
         margin-bottom:30rpx;
         margin-top: 10rpx;
@@ -254,4 +331,8 @@
         }
      }
       
</style>
<style  >
</style>