yangan
2024-12-16 16c42e89312ec86a5c75092cc3bf83d2fe625c8f
feat:pvc拼单大于40二次确认
1个文件已修改
71 ■■■■■ 已修改文件
subPages/pvcSplicePage/index.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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.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>
@@ -42,7 +43,7 @@
                    <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"><u-button text="删除"
@@ -139,6 +140,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 +149,12 @@
            
        },
    onShow(){
        this.init();
        // this.init();
    },
    data() {
        return {
            daiPageList:[],
            radioNum:'',
            yiPageList:[],
            quxiaoShow:false,
            radioValue:'',
@@ -168,19 +171,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,7 +204,14 @@
            if(!this.radioValue){
                return this.$u.toast('必须选择规格')
            }else{
                let result = this.yiPageList.reduce((cur,next)=>cur + (next.productQuantity),Number(this.radioValue));
                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: '提示',
@@ -208,30 +219,44 @@
                        cancelText: "取消", // 取消按钮的文字  d
                        confirmText: "确认", // 确认按钮的文字  
                        showCancel: true, // 是否显示取消按钮,默认为 true
                        confirmColor: '#f55850',
                        cancelColor: '#39B54A',
                        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);
                        }
                }
                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);
            }
            }