yangan
2024-12-04 2ab92240f1eccf659d7380dc524e76faca6f644c
feat:库管新页面提交
3个文件已添加
770 ■■■■■ 已修改文件
subPages/pvcSplicePage/index.vue 367 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
subPages/pvcSplicePage/kuguan.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
subPages/pvcSplicePage/view.vue 360 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
subPages/pvcSplicePage/index.vue
New file
@@ -0,0 +1,367 @@
<template>
<div class="warp">
    <!-- 司机待拼单列表 -->
     <div class="daiPin">
        <combined-title title="待拼单日计划">
        </combined-title>
        <view class="table">
            <uni-table border
                stripe
                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-tr>
                <uni-tr v-for="(item, index) in daiPageList"
                    :key="item.id">
                    <uni-td align="center">{{ item.productName || '' }}</uni-td>
                    <uni-td align="center">{{ item.customerName || '' }}</uni-td>
                    <uni-td align="center"><u-button text="选择"
                            type="primary"
                            :disabled=" item.isPretendDischar === 1"
                            @click="enterOk(item)"></u-button></uni-td>
                </uni-tr>
            </uni-table>
        </view>
     </div>
       <!-- 司机已拼单列表 -->
      <!-- <div class="border"></div> -->
       <div class="yiPin">
        <combined-title title="已拼单列表"></combined-title>
        <view class="table">
            <uni-table border
                stripe
                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-tr>
                <uni-tr v-for="(item, index) in yiPageList"
                    :key="item.id">
                    <uni-td align="center">{{ item.productName || '' }}</uni-td>
                    <uni-td align="center">{{ item.customerName || '' }}</uni-td>
                    <uni-td  align="center"><u-button text="删除"
                            type="error"
                            v-if="item.mainTmTaskId"
                            :disabled=" item.isPretendDischar === 1"
                            @click="deletePvcOrder(item)"></u-button></uni-td>
                </uni-tr>
            </uni-table>
        </view>
       </div>
       <!-- 确认吨数弹框 -->
       <u-popup :show="showLing"
                @close="closeling"
                closeOnClickOverlay
                @open="openLing"
                mode="center"
                round="10">
                <view class="receiverPopup">
                      <view class="tableCon"   v-if="pageList.length">
            <!-- <uni-table border
                        stripe
                        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-tr>
                        <uni-tr v-for="(item, index) in pageList"
                            :key="item.id">
                            <uni-td align="center">
                                  <u-radio-group
                                    v-model="item.flag"
                                    placement="column"
                                    @change="(v)=>groupChange(v,item.flag)"
                                >
                                    <u-radio
                                    :iconSize='40'
                                    :customStyle="{marginBottom: '8px'}"
                                    @change="radioChange(item.flag)"
                                    >
                                    </u-radio>
                                </u-radio-group>
                                </uni-td>
                            <uni-td align="center">{{ item.productName}}</uni-td>
                            <uni-td align="center">{{ item.productGrade}}</uni-td>
                            <uni-td align="center">  {{item.planMeasure}}</uni-td>
                        </uni-tr>
                    </uni-table> -->
                   <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>
            <view class="receiverPopup__btn"><u-button text="确定"
                        type="primary"
                        @click="popupDetermineClick"
                        :loading="ClickLoading"></u-button></view>
                </view>
            </u-popup>
            <view class="qianDanModel">
                    <u-modal :show="quxiaoShow"
                        :title="'提示'"
                        showCancelButton
                        :content="'确认删除?'"
                        @confirm="quxiaoConfirm"
                        @cancel="quxiaoCancel"></u-modal>
                </view>
</div>
</template>
<script>
import combinedTitle from '@/components/combined-title/combined-title.vue';
export default {
    onLoad(params){
        console.log(params,'params')
        this.mainTmTaskId = JSON.parse(params.item).id;
        console.log(JSON.parse(params.item).id,'213123')
    },
    components: {
            combinedTitle,
        },
    onShow(){
        this.init();
    },
    data() {
        return {
            daiPageList:[],
            yiPageList:[],
            quxiaoShow:false,
            radioValue:'',
            deletItem:{},
            activeObj:{},
            pageList:[],
            lingFlag:true,
            showLing:false,
            mainTmTaskId:'', //主订单id
            ClickLoading:false,
        }
    },
    methods: {
        init(){
            this.$reqGet('pvcSplicingList').then((res) => {
                console.log(res,'res')
                this.daiPageList = res.data.list1;
                this.yiPageList = res.data.list2;
            })
        },
        enterOk(item){
            this.activeObj = item;
            this.getBuild();
        },
        getBuild(item){
                    this.$reqGet('getBuildList',{orderPlanId:this.activeObj.orderPlanId,customerId:this.activeObj.customerId,status:1,fleetId:this.activeObj.fleetId}).then(res=>{
                    console.log(res,'resss')
                    this.showLing = true;
                    this.pageList = res.data.map(item=>{
                        item.flag = false
                        return item;
                    });
                })
            },
        closeling(){
            this.radioValue = '';
            this.showLing = false;
        },
        //点击确定
        popupDetermineClick(){
            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);
            }
            }
        },
        openLing(){
        },
        qiangDan(id, fleetId, customerId, xsUserId,tmId) {
                uni.showLoading({
                    title: '加载中'
                })
                this.$reqPost('pvcSplicingOfDriver', {
                        orderPlanId: id,
                        fleetId: fleetId,
                        customerId: customerId,
                        xsUserId: xsUserId,
                        pvcForwardId:this.lingFlag? this.radioValue : null,
                        tmId:tmId
                    }, 'params')
                    .then(res => {
                        uni.hideLoading()
                        if (res.code == 0) {
                            this.$u.toast('接单成功');
                            this.showLing  =false;
                        } else {
                            this.$u.toast(res.msg ? res.msg : '接单失败');
                                this.showLing  =false;
                        }
                    })
                    .then(() => {
                        setTimeout(() => {
                            this.init();
                            this.radioValue = '';
                            this.showLing =false;
                        }, 1500);
                    }).catch(e => {
                        uni.hideLoading()
                    })
            },
        radioChange(n) {
                console.log(n,'213')
            },
            deletePvcOrder(deletItem){
                this.deletItem = deletItem;
                this.quxiaoShow = true;
            },
            deletePvcOrderFun(){
                this.$reqGet('cancelPindan',{
                    takeCoalId:this.mainTmTaskId,
                    pvcPindanId:this.deletItem.id,
                }).then(res=>{
                    if(res.code === 0){
                        console.log(res,'resss')
                    this.$u.toast('删除成功')
                    this.quxiaoShow = false;
                    this.init();
                    }else{
                        this.$u.toast('操作失败')
                    }
                })
            },
            quxiaoConfirm(){
                this.deletePvcOrderFun();
            },
            quxiaoCancel(){
                this.quxiaoShow = false;
            }
    },
}
</script>
<style lang="scss" scoped>
.warp{
    width: 100%;
    height: calc(100vh - 105rpx);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    .daiPin{
        display: flex;
        flex:  0 1 48%;
        flex-direction: column;
    }
    .yiPin{
        display: flex;
        flex:  0 1 48%;
        flex-direction: column;
    }
}
.table{
    width: 98%;
  /deep/ .uni-table{
    width: 100%!important;
    min-width: 0!important;
    margin-left: 20rpx;
  }
}
.border{
    width: 98%;
    margin:  0 auto;;
    height: 20rpx;
    border-top: dashed 1px #000;
}
.receiverPopup {
        height: vww(280);
        width: 700rpx;
        padding: 20rpx;
        // overflow: auto;
        // position: relative;
        .image{
            width: 100%;
            height: vww(110);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .tables{
            width: 100%;
        }
        .receiverPopup__title {
            margin: vww(10) auto 0;
            width: 80%;
            text-align: center;
        }
        &__btn {
            margin: vww(10) auto;
            width: 50%;
            position: absolute;
            left: 25%;
            top: 87%;
            .u-button {
                height: vww(20);
            }
        }
    }
</style>
subPages/pvcSplicePage/kuguan.vue
New file
@@ -0,0 +1,43 @@
<template>
<div class="warp">
    库管装卸
</div>
</template>
<script>
export default {
    data() {
        return {
            pageData:[],
            id:'',
        }
    },
    onLoad(params){
        console.log(params,'123')
        this.id = params.id;
        this.init(params.id);
    },
    onShow(){
    },
    methods: {
        init(id){
            this.$reqGet('getPdListByMainTmTaskCoalId',{mainTmTaskCoalId:id}).then((res) => {
                console.log(res,'res')
            })
        }
    },
}
</script>
<style lang="scss" scoped>
.warp{
    width: 100%;
    height: calc(100vh - 75px);
}
</style>
subPages/pvcSplicePage/view.vue
New file
@@ -0,0 +1,360 @@
<template>
    <div class="warp">
        <!-- 司机待拼单列表 -->
         <div class="daiPin">
            <combined-title title="待拼单日计划">
            </combined-title>
            <view class="table">
                <uni-table border
                    stripe
                    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-tr>
                    <uni-tr v-for="(item, index) in daiPageList"
                        :key="item.id">
                        <uni-td align="center">{{ item.productName || '' }}</uni-td>
                        <uni-td align="center">{{ item.customerName || '' }}</uni-td>
                        <!-- <uni-td align="center"><u-button text="选择"
                                type="primary"
                                :disabled="item.carNum == item.carNum1&&!isRCSQ"
                                @click="enterOk(item)"></u-button></uni-td> -->
                    </uni-tr>
                </uni-table>
            </view>
         </div>
           <!-- 司机已拼单列表 -->
          <!-- <div class="border"></div> -->
           <div class="yiPin">
            <combined-title title="已拼单列表"></combined-title>
            <view class="table">
                <uni-table border
                    stripe
                    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-tr>
                    <uni-tr v-for="(item, index) in yiPageList"
                        :key="item.id">
                        <uni-td align="center">{{ item.productName || '' }}</uni-td>
                        <uni-td align="center">{{ item.customerName || '' }}</uni-td>
                        <!-- <uni-td  align="center"><u-button text="删除"
                                type="error"
                                v-if="item.mainTmTaskId"
                                @click="deletePvcOrder(item)"></u-button></uni-td> -->
                    </uni-tr>
                </uni-table>
            </view>
           </div>
           <!-- 确认吨数弹框 -->
           <u-popup :show="showLing"
                    @close="closeling"
                    closeOnClickOverlay
                    @open="openLing"
                    mode="center"
                    round="10">
                    <view class="receiverPopup">
                          <view class="tableCon"   v-if="pageList.length">
                <!-- <uni-table border
                            stripe
                            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-tr>
                            <uni-tr v-for="(item, index) in pageList"
                                :key="item.id">
                                <uni-td align="center">
                                      <u-radio-group
                                        v-model="item.flag"
                                        placement="column"
                                        @change="(v)=>groupChange(v,item.flag)"
                                    >
                                        <u-radio
                                        :iconSize='40'
                                        :customStyle="{marginBottom: '8px'}"
                                        @change="radioChange(item.flag)"
                                        >
                                        </u-radio>
                                    </u-radio-group>
                                    </uni-td>
                                <uni-td align="center">{{ item.productName}}</uni-td>
                                <uni-td align="center">{{ item.productGrade}}</uni-td>
                                <uni-td align="center">  {{item.planMeasure}}</uni-td>
                            </uni-tr>
                        </uni-table> -->
                       <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>
                <view class="receiverPopup__btn"><u-button text="确定"
                            type="primary"
                            @click="popupDetermineClick"
                            :loading="ClickLoading"></u-button></view>
                    </view>
                </u-popup>
                <view class="qianDanModel">
                        <u-modal :show="quxiaoShow"
                            :title="'提示'"
                            showCancelButton
                            :content="'确认删除?'"
                            @confirm="quxiaoConfirm"
                            @cancel="quxiaoCancel"></u-modal>
                    </view>
    </div>
    </template>
    <script>
    import combinedTitle from '@/components/combined-title/combined-title.vue';
    export default {
        onLoad(params){
            console.log(params,'params')
            this.mainTmTaskId = JSON.parse(params.item).id;
            console.log(JSON.parse(params.item).id,'213123')
        },
        components: {
                combinedTitle,
            },
        onShow(){
            this.init();
        },
        data() {
            return {
                daiPageList:[],
                yiPageList:[],
                quxiaoShow:false,
                radioValue:'',
                deletItem:{},
                activeObj:{},
                pageList:[],
                lingFlag:true,
                showLing:false,
                mainTmTaskId:'', //主订单id
                ClickLoading:false,
            }
        },
        methods: {
            init(){
                this.$reqGet('pvcSplicingList').then((res) => {
                    console.log(res,'res')
                    this.daiPageList = res.data.list1;
                    this.yiPageList = res.data.list2;
                })
            },
            enterOk(item){
                this.activeObj = item;
                this.getBuild();
            },
            getBuild(item){
                        this.$reqGet('getBuildList',{orderPlanId:this.activeObj.orderPlanId,customerId:this.activeObj.customerId,status:1,fleetId:this.activeObj.fleetId}).then(res=>{
                        console.log(res,'resss')
                        this.showLing = true;
                        this.pageList = res.data.map(item=>{
                            item.flag = false
                            return item;
                        });
                    })
                },
            closeling(){
                this.radioValue = '';
                this.showLing = false;
            },
            //点击确定
            popupDetermineClick(){
                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);
                }
            },
            openLing(){
            },
            qiangDan(id, fleetId, customerId, xsUserId,tmId) {
                    uni.showLoading({
                        title: '加载中'
                    })
                    this.$reqPost('pvcSplicingOfDriver', {
                            orderPlanId: id,
                            fleetId: fleetId,
                            customerId: customerId,
                            xsUserId: xsUserId,
                            pvcForwardId:this.lingFlag? this.radioValue : null,
                            tmId:tmId
                        }, 'params')
                        .then(res => {
                            uni.hideLoading()
                            if (res.code == 0) {
                                this.$u.toast('接单成功');
                                this.showLing  =false;
                            } else {
                                this.$u.toast(res.msg ? res.msg : '接单失败');
                                    this.showLing  =false;
                            }
                        })
                        .then(() => {
                            setTimeout(() => {
                                this.init();
                                this.radioValue = '';
                                this.showLing =false;
                            }, 1500);
                        }).catch(e => {
                            uni.hideLoading()
                        })
                },
            radioChange(n) {
                    console.log(n,'213')
                },
                deletePvcOrder(deletItem){
                    this.deletItem = deletItem;
                    this.quxiaoShow = true;
                },
                deletePvcOrderFun(){
                    this.$reqGet('cancelPindan',{
                        takeCoalId:this.mainTmTaskId,
                        pvcPindanId:this.deletItem.id,
                    }).then(res=>{
                        if(res.code === 0){
                            console.log(res,'resss')
                        this.$u.toast('删除成功')
                        this.init();
                        }else{
                            this.$u.toast('操作失败')
                        }
                    })
                },
                quxiaoConfirm(){
                    this.deletePvcOrderFun();
                },
                quxiaoCancel(){
                    this.quxiaoShow = false;
                }
        },
    }
    </script>
    <style lang="scss" scoped>
    .warp{
        width: 100%;
        height: calc(100vh - 105rpx);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        .daiPin{
            display: flex;
            flex:  0 1 48%;
            flex-direction: column;
        }
        .yiPin{
            display: flex;
            flex:  0 1 48%;
            flex-direction: column;
        }
    }
    .table{
        width: 98%;
      /deep/ .uni-table{
        width: 100%!important;
        min-width: 0!important;
        margin-left: 20rpx;
      }
    }
    .border{
        width: 98%;
        margin:  0 auto;;
        height: 20rpx;
        border-top: dashed 1px #000;
    }
    .receiverPopup {
            height: vww(280);
            width: 700rpx;
            padding: 20rpx;
            // overflow: auto;
            // position: relative;
            .image{
                width: 100%;
                height: vww(110);
                display: flex;
                align-items: center;
                justify-content: center;
            }
            .tables{
                width: 100%;
            }
            .receiverPopup__title {
                margin: vww(10) auto 0;
                width: 80%;
                text-align: center;
            }
            &__btn {
                margin: vww(10) auto;
                width: 50%;
                position: absolute;
                left: 25%;
                top: 87%;
                .u-button {
                    height: vww(20);
                }
            }
        }
    </style>