yangan
22 小时以前 a28d0135ee42809b2c5863609da37155d3ecba5b
subPages/pvcSplicePage/index.vue
@@ -15,11 +15,12 @@
               <uni-th align="center">操作</uni-th>
            </uni-tr>
            <uni-tr v-for="(item, index) in daiPageList"
               :key="item.id">
               :key="index">
   
               <uni-td align="center">{{ item.productName || '' }}</uni-td>
               <uni-td align="center">{{ item.productName || '' }}</uni-td>
               <uni-td align="center">{{ item.customerName || '' }}</uni-td>
               <uni-td align="center"><u-button text="选择"
               <uni-td align="center">
                  <u-button text="选择"
                     type="primary"
                     :disabled=" item.isPretendDischar === 1"
                     @click="enterOk(item)"></u-button></uni-td>
@@ -37,14 +38,18 @@
            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" width="300">客户</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="(item, index) in yiPageList"
               :key="item.id">
               :key="index">
               <uni-td align="center">{{ item.productName || '' }}</uni-td>
               <uni-td align="center">{{ item.customerName || '' }}</uni-td>
               <uni-td align="center">{{ item.orderCode || '' }}</uni-td>
               <uni-td align="center">{{ item.planMeasure || '' }}</uni-td>
                    <uni-td  align="center"><u-button text="删除"
                     type="error"
                            v-if="item.mainTmTaskId"
@@ -139,6 +144,7 @@
    onLoad(params){
        console.log(params,'params')
        this.mainTmTaskId = JSON.parse(params.item).id;
      this.init();
        console.log(JSON.parse(params.item).id,'213123')
    },
@@ -147,11 +153,12 @@
         
      },
    onShow(){
        this.init();
        // this.init();
    },
    data() {
        return {
            daiPageList:[],
         radioNum:'',
            yiPageList:[],
            quxiaoShow:false,
            radioValue:'',
@@ -168,19 +175,20 @@
    methods: {
        init(){
            this.$reqGet('pvcSplicingList').then((res) => {
                console.log(res,'res')
                console.log(res.data.list1,this.daiPageList,'res');
                this.daiPageList = res.data.list1;
                this.yiPageList = res.data.list2;
            })
        },
        enterOk(item){
         console.log(item,'12313')
            this.activeObj = item;
            this.getBuild();
            this.getBuild(item);
        },
        getBuild(item){
               this.$reqGet('getBuildList',{orderPlanId:this.activeObj.orderPlanId,customerId:this.activeObj.customerId,status:1,fleetId:this.activeObj.fleetId}).then(res=>{
               this.$reqGet('getBuildList',{orderPlanId:item.orderPlanId,customerId:item.customerId,status:1,fleetId:item.fleetId}).then(res=>{
               console.log(res,'resss')
                    this.showLing = true;
                    this.pageList = res.data.map(item=>{
@@ -200,19 +208,59 @@
            if(!this.radioValue){
                return this.$u.toast('必须选择规格')
            }else{
                if (this.activeObj.tmcCount == '0') {
            this.qiangDan(this.activeObj.orderPlanId,this.activeObj.fleetId, !this.activeObj.customerId ? '0' : this.activeObj.customerId,
                     !this.activeObj.xsUserId ? '0' : this.activeObj.xsUserId,this.mainTmTaskId);
         } else {
            // this.qiangDanOrderPlanId = value.orderPlanId;
             // this.fleetId = value.fleetId;
            // this.customerId = !value.customerId ? '0' : value.customerId;
            // this.xsUserId = !value.xsUserId ? '0' : value.xsUserId;
            // this.qiangDanShow = true;
             this.$u.toast(`当前已接${value.tmcCount}单`);
                 this.qiangDan(this.activeObj.orderPlanId,this.activeObj.fleetId, !this.activeObj.customerId ? '0' : this.activeObj.customerId,
                     !this.activeObj.xsUserId ? '0' : this.activeObj.xsUserId,this.mainTmTaskId);
         }
            let radioNum  = this.pageList.find(item=>item.id === this.radioValue).planMeasure;
            console.log(radioNum,'ressi88')
               let result = this.yiPageList.reduce((cur,next)=>{
               return  Number(cur) + Number(next.productQuantity)
            },radioNum);
            console.log(result,'result')
            if(result >= 40){
               uni.showModal({
                  title: '提示',
                  content: '加上此单累计大于等于40吨了,还要继续拼单吗?',
                  cancelText: "取消", // 取消按钮的文字  d
                  confirmText: "确认", // 确认按钮的文字
                  showCancel: true, // 是否显示取消按钮,默认为 true
                  success: (res) => {
                  if(res.confirm) {
                     console.log('comfirm') //点击确定之后执行的代码
                     if (this.activeObj.tmcCount == '0') {
                     this.qiangDan(this.activeObj.orderPlanId,this.activeObj.fleetId, !this.activeObj.customerId ? '0' : this.activeObj.customerId,
                              !this.activeObj.xsUserId ? '0' : this.activeObj.xsUserId,this.mainTmTaskId);
                  } else {
                     // this.qiangDanOrderPlanId = value.orderPlanId
                     // this.fleetId =
                     // this.customerId = !value.customerId ? '0' : value.customerId;
                     // this.xsUserId = !value.xsUserId ? '0' : value.xsUserId;
                     // this.qiangDanShow = true;
                     this.$u.toast(`当前已接${value.tmcCount}单`);
                     this.qiangDan(this.activeObj.orderPlanId,this.activeObj.fleetId, !this.activeObj.customerId ? '0' : this.activeObj.customerId,
                              !this.activeObj.xsUserId ? '0' : this.activeObj.xsUserId,this.mainTmTaskId);
                  }
                  } else {
                     console.log('cancel') //点击取消之后执行的代码
                     }
                  }
               })
            }else{
               if (this.activeObj.tmcCount == '0') {
                     this.qiangDan(this.activeObj.orderPlanId,this.activeObj.fleetId, !this.activeObj.customerId ? '0' : this.activeObj.customerId,
                              !this.activeObj.xsUserId ? '0' : this.activeObj.xsUserId,this.mainTmTaskId);
                  } else {
                     // this.qiangDanOrderPlanId = value.orderPlanId
                     // this.fleetId =
                     // this.customerId = !value.customerId ? '0' : value.customerId;
                     // this.xsUserId = !value.xsUserId ? '0' : value.xsUserId;
                     // this.qiangDanShow = true;
                     this.$u.toast(`当前已接${value.tmcCount}单`);
                     this.qiangDan(this.activeObj.orderPlanId,this.activeObj.fleetId, !this.activeObj.customerId ? '0' : this.activeObj.customerId,
                              !this.activeObj.xsUserId ? '0' : this.activeObj.xsUserId,this.mainTmTaskId);
                  }
            }
            }