chenhaozhe
2025-10-11 8425983cae1b121cede701aa9e512d36605d5b2d
添加组托单缓存模块 组托/拆托模块 接口调整
5个文件已修改
559 ■■■■■ 已修改文件
pages.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/chaituosaoma/form.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/tab2.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/zutuosaoma/form.vue 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/zutuosaoma/table.vue 507 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -815,6 +815,13 @@
            }
        },
        {
            "path" : "pages/zutuosaoma/table",
            "style" :
            {
                "navigationBarTitleText" : "组托扫码缓存"
            }
        },
        {
            "path" : "pages/chaituosaoma/form",
            "style" : 
            {
pages/chaituosaoma/form.vue
@@ -2,7 +2,7 @@
    <view class="form">
        <view class="form-base-info">
            <view class="form-item">
                <view class="title">箱条码</view>
                <view class="title">托条码</view>
                <view class="right">
                    <input type="text" :focus="HBarCodePackFocus" v-model="HBarCode_Pack" @confirm="GetMeesageByBarCode_Pack(HBarCode_Pack)" />
                </view>
@@ -80,7 +80,7 @@
            </view>
        </view>
        <view class="bottom-btn" id="bottom-btn">
            <button :class="EnableSubmit?'btn-a':'btn-c'" :disabled="!EnableSubmit" size="mini" @tap="cmdSubmit">拆箱</button>
            <button :class="EnableSubmit?'btn-a':'btn-c'" :disabled="!EnableSubmit" size="mini" @tap="cmdSubmit">拆托</button>
            <view style="flex: 1;"></view>
            <!-- <button class="btn-d" size="mini" @tap="cmdDelete">删除</button> -->
            <button class="btn-c" size="mini" @tap="cmdExit">退出</button>
@@ -195,10 +195,10 @@
            GetMeesageByBarCode_Pack(HBarCode_Pack) {
                // 获取托条码对应的数据
                CommonUtils.doRequest2({
                    url: '/WEBSController/Get_PackBarCode_UnPackUnionBill_Json',
                    url: '/WEBSController/Get_PackBarCode_DeletePackUnionBill_Json',
                    data: {
                        HBillSubType: this.HBillSubType,
                        HMaker: this.hform.HMaker,
                        HStockOrgID: this.hform.HStockOrgID,
                        HBarCode_Pack: HBarCode_Pack
                    },
                    resFunction: (res) => {
@@ -465,7 +465,7 @@
                }
                this.EnableSubmit = false
                CommonUtils.doRequest2({
                    url: '/WEBSController/set_SaveUnPackUnionBill_Json',
                    url: '/WEBSController/GetDeletePackUnionBill_Json',
                    data: {
                        "HInterID": this.hform.HInterID,
                        "HBillNo": this.hform.HBillNo,
pages/index/tab2.vue
@@ -244,6 +244,12 @@
                    url: `/pages/shengchantuiliao/table`,
                    id: 33,
                    hidden: false,
                },{
                    img: '../../static/icon/icon8.png',
                    text: '组脱单暂存列表',
                    url: `/pages/zutuosaoma/table`,
                    id: 34,
                    hidden: false,
                }
                // {
                //     img: '../../static/icon/icon8.png',
pages/zutuosaoma/form.vue
@@ -228,13 +228,14 @@
            GetMeesageByBarCode_Pack(HBarCode_Pack) {
                // 获取托条码对应的数据
                CommonUtils.doRequest2({
                    url: '/WEBSController/Get_PackBarCode_PackUnionBill_New_Json',
                    url: '/WEBSController/Get_PackBarCode_PackUnionBill_Json',
                    data: {
                        HInterID: this.hform.HInterID,
                        HInterID: this.hform.HInterID || 0,
                        HBillNo: this.hform.HBillNo,
                        HBillType: this.HBillType,
                        HBillSubType: this.HBillSubType,
                        HBarCode_Pack: HBarCode_Pack
                        HBarCode_Pack: HBarCode_Pack,
                        HMaker: getUserInfo()['Czymc'],
                        HStockOrgID: uni.getStorageSync('OrganizationID')
                    },
                    resFunction: (res) => {
                        let {
@@ -271,7 +272,7 @@
                })
            },
            GetMeesageByBarCode(HBarCode) {
                // 获取包条码对应的数据
                // 获取待组托条码对应的数据
                let HBarCode_Pack = this.HBarCode_Pack
                let sOldBarCode = this.HBarCode
                let HDeleteFlag = sOldBarCode.substring(0, 1)
@@ -279,7 +280,7 @@
                if (!HBarCode_Pack) {
                    return uni.showToast({
                        icon: 'none',
                        title: '托条码为空,请先扫描托条码',
                        title: '托条码不能为空,请先扫描托条码!',
                    })
                }
@@ -287,7 +288,7 @@
                    if (!sBarCode) {
                        return uni.showToast({
                            icon: 'none',
                            title: '请扫描要删除的箱条码',
                            title: '请扫描要删除的条码',
                        })
                    } else {
                        this.HBarCodeFocusRefresh()
@@ -322,19 +323,17 @@
                    if (!sBarCode) {
                        return uni.showToast({
                            icon: 'none',
                            title: '箱条码不能为空,请扫描箱条码',
                            title: '条码不能为空,请扫描条码!',
                        })
                    }
                    CommonUtils.doRequest2({
                        url: '/WEBSController/Get_BarCode_PackUnionBill_New_Json',
                        url: '/WEBSController/Get_BarCode_PackUnionBill_Json',
                        data: {
                            "HInterID": this.hform.HInterID,
                            "HBarCode": sBarCode,
                            "HBillType": this.HBillType,
                            "HBillNo": this.hform.HBillNo,
                            "HBillSubType": this.HBillSubType,
                            "HBarCode_Pack": HBarCode_Pack,
                            "HMaterNumber_Pack": this.HMaterNumber_Pack,
                            "HMaker": this.hform.HMaker,
                            "HStockOrgID": this.hform.HStockOrgID
                        },
@@ -583,14 +582,14 @@
            // 1为 装箱 2为 组托
            this.BarCodeType = e.BarCodeType || 1
            this.OperationType = e.OperationType || 1
            this.HBarCode_Pack_Temp = e.CommonUtils || ""
            this.HBarCode_Pack = e.HBarCode_Pack_Temp || ""
            if (this.OperationType == 1) {
                this.getMaxNo()
            } else if (this.OperationType == 2) {
                this.GetMeesageByBarCode_Pack()
                this.GetMeesageByBarCode_Pack(this.HBarCode_Pack)
                this.DisBillEntryList()
                this.tabs = 1
                this.tabs = 0
            }
pages/zutuosaoma/table.vue
@@ -1,28 +1,517 @@
<template>
    <view>
    <view class="content">
        <view class="tabs">
            <view :class="tabs == 0 ? 'on':''" @tap="changeTab(0)">缓存列表</view>
        </view>
        <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
        <view class="form" v-if="tabs == 0">
            <view class="buttons" @tap="add">
                <uni-icons type="plus" style="margin-right: 10rpx;" size="22"></uni-icons>新增
            </view>
        </view>
        <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
        <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==0">
            <uni-card :title="item.制单日期.substr(0,10)" :extra="item.单据号" style="margin: 10px;"
                @tap="showDetail = showDetail==index?-1:index">
                <view class="card-detail">
                    <view class="detail" v-if="item.托条码">
                        <text>托条码:</text>{{item.托条码}}
                    </view>
                    <view class="detail" v-if="item.制单人">
                        <text>制单人:</text>{{item.制单人}}
                    </view>
                    <view class="detail" v-if="item.制单日期">
                        <text>制单日期:</text>{{ item.制单日期.split('T')[0] }}
                    </view>
                    <view class="detail" v-if="item.组织">
                        <text>组织:</text>{{item.组织}}
                    </view>
                </view>
                <view class="more">
                    <view class="part" style="border-right: 1px solid #eee;color: #3a78ff;" @tap.stop="edit(item)">
                        <uni-icons type="compose" style="color: #3a78ff;margin-right: 10rpx;" size="18"></uni-icons>编辑
                    </view>
                    <view class="part" style="color: #da0000;" @tap.stop="del(item)">
                        <uni-icons type="trash" style="color: #da0000;margin-right: 10rpx;" size="18"></uni-icons>删除
                    </view>
                </view>
            </uni-card>
        </view>
        <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==1">
            <uni-card :title="item.日期" :extra="item.单据号" style="margin: 10px;"
                @tap="showDetail = showDetail==index?-1:index">
                <view class="card-detail">
                    <view class="detail" v-if="item.状态">
                        <text>状态:</text>{{item.状态}}
                    </view>
                    <view class="detail" v-if="item.制单人">
                        <text>制单人:</text>{{item.制单人}}
                    </view>
                    <view class="detail" v-if="item.数量">
                        <text>数量:</text>{{item.数量}}
                    </view>
                    <view class="detail" v-if="item.源单单号">
                        <text>源单单号:</text>{{item.源单单号}}
                    </view>
                    <view class="detail" v-if="item.物料代码">
                        <text>物料代码:</text>{{item.物料代码}}
                    </view>
                    <view class="detail" v-if="item.物料名称">
                        <text>物料名称:</text>{{item.物料名称}}
                    </view>
                    <view class="detail" v-if="item.规格型号">
                        <text>规格型号:</text>{{item.规格型号}}
                    </view>
                    <view class="detail" v-if="item.组织">
                        <text>组织:</text>{{item.组织}}
                    </view>
                </view>
                <view class="more">
                    <view class="part" style="color: #3a78ff;width: 100%;" @tap.stop="qrCodeDisplay(item)">
                        <uni-icons type="scan" style="color: #3a78ff;margin-right: 10rpx;" size="18"></uni-icons>显示二维码
                    </view>
                    <view class="part" style="color: #d98d00;width: 100%;" @tap.stop="revoke(item)">
                        <uni-icons type="undo" style="color: #d98d00;margin-right: 10rpx;" size="18"></uni-icons>撤销
                    </view>
                </view>
            </uni-card>
        </view>
        <view class="over" v-if="!listData || listData.length == 0">暂无数据</view>
        <view class="over" v-if="listData.length != 0 && listData.length != showList.length">加载中...</view>
        <view class="over" v-if="listData.length != 0 && listData.length == showList.length">已到底</view>
        <BarCodePopupVue ref="barcodePopup"></BarCodePopupVue>
    </view>
</template>
<script>
    import dayjs from "dayjs";
    import {
        getUserInfo
    } from "@/utils/auth.js";
    import {
        CommonUtils
    } from "@/utils/common.js"
    import BarCodePopupVue from "../../components/BarCodePopup/BarCodePopup.vue";
    export default {
        data() {
            return {
                userInfo: getUserInfo(),
                serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
                tabs: 0,
                urls: '/WEBSController/GetKf_PonderationBillMain_TempList_New_Json',
                MvarReportTitle: '生产领料单缓存列表',
                hform: {
                    HBillNo: '',
                    HSourceBillNo: '',
                    HBillType: 3783,
                    HMaker: uni.getStorageSync('HUserName'),
                    HStockOrgID: uni.getStorageSync('OrganizationID'),
                },
                sWhere: '',
                listData: [],
                showList: [],
                showDetail: -1,
                page: 1,
            }
        },
        components: {
            BarCodePopupVue
        },
        onShow() {
            //用户模块权限判断
            this.CheckModRight()
            this.changeTab(0)
            console.log(this.userInfo, uni.getStorageSync('HUserName'))
        },
        onReachBottom: function() {
            this.page++
            setTimeout(() => {
                this.showList = this.showList.concat(this.getPage(this.page, this.listData))
            }, 100)
        },
        onPullDownRefresh: function() {
            this.clear()
            setTimeout(() => {
                uni.stopPullDownRefresh();
            }, 1000);
        },
        methods: {
            async qrCodeDisplay(item) {
                this.$refs.barcodePopup.setCodeInfo(item.HBillNo)
                await this.$nextTick()
                this.$refs.barcodePopup.open()
            },
            CheckModRight() {
                uni.request({
                    url: this.serverUrl + '/WEBSController/CheckModRight_Json',
                    data: {
                        ModRightName: 'CE_PackUnion',
                        HUserName: uni.getStorageSync('HUserName')
                    },
                    success: (res) => {
                        if (res.data.count == 1) {} else {
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
                            })
                        }
                    },
                    fail: (res) => {
                        console.log(res);
                        uni.showToast({
                            title: '接口请求失败',
                            icon: 'none'
                        })
                    },
                });
            },
            getPage(page, list) {
                let sindex = (parseInt(page) - 1) * 20
                let eindex = parseInt(page) * 20
                let newList = list.slice(sindex, eindex)
                return newList
            },
            changeTab(e) {
                this.tabs = e
                this.page = 1
                this.showList = []
                if (this.tabs == 0) {
                    this.urls = '/WEBSController/GetSc_PackUnionBill_TempList_Json'
                }
                // if(this.tabs == 1){
                //     this.urls = '/WEBSController/GetKf_ICStockBillQueryList_User_Json'
                // }
                this.getList()
            },
            getList() {
                uni.showLoading({
                    title: '加载中...'
                })
                uni.request({
                    url: this.serverUrl + this.urls,
                    data: this.hform,
                    success: (res) => {
                        console.log(1, res);
                        if (res.data.count == 1) {
                            this.listData = res.data.data
                            this.showList = this.getPage(this.page, this.listData)
                            setTimeout(() => {
                                uni.hideLoading()
                            }, 1000)
                        } else {
                            uni.hideLoading()
                            this.listData = []
                            uni.showToast({
                                title: res.data.Message,
                                icon: 'none'
                            })
                        }
                    },
                    fail: (res) => {
                        console.log(res);
                        uni.hideLoading()
                        uni.showToast({
                            title: '接口请求失败',
                            icon: 'none'
                        })
                    },
                });
            },
            search() {
                this.sWhere = ''
                this.listData = []
                this.page = 1
                this.showList = []
                console.log(this.hform)
                // if (this.hform.HBillNo) {
                //     this.sWhere += " and 单据号 like '%" + this.hform.HBillNo + "%'";
                // }
                // if (this.hform.HSourceBillNo) {
                //     this.sWhere += " and 设备类型 like '%" + this.hform.HSourceBillNo + "%'";
                // }
                this.getList()
            },
            clear() {
                this.listData = []
                this.page = 1
                this.showList = []
                this.sWhere = ''
                this.hform = {
                    HBillNo: '',
                    HSourceBillNo: '',
                    HBillType: 3783,
                    HMaker: uni.getStorageSync('HUserName'),
                    HStockOrgID: uni.getStorageSync('OrganizationID'),
                }
                this.getList()
            },
            add() {
                uni.navigateTo({
                    url: './form?OperationType=1'
                })
            },
            //编辑
            edit(item) {
                console.log(item)
                // uni.request({
                //     url: this.serverUrl + '/WEBSController/TempList_Modify_Json',
                //     data:{ "HInterID": item.HInterID, "HBillNo": item.单据号, "HBillType": this.hform.HBillType },
                //     success: (res) => {
                //         console.log(1,res);
                //         if(res.data.count == 1){
                uni.navigateTo({
                    url: './form?OperationType=2&HBarCode_Pack_Temp=' + item["HBarCode_Pack"],
                })
                //                     }else{
                //                         uni.showToast({
                //                             title:res.data.Message,
                //                             icon:'none'
                //                         })
                //                     }
                //                 },
                //                 fail: (res) => {
                //                     console.log(res);
                //                     uni.hideLoading()
                //                     uni.showToast({
                //                         title:'接口请求失败',
                //                         icon:'none'
                //                     })
                //                 },
                //             })
            },
            //删除
            del(item) {
                // console.log(item.hmainid,uni.getStorageSync('HUserName'))
                uni.showModal({
                    title: '提示',
                    content: '确认要删除记录?删除后不能恢复',
                    success: (res) => {
                        if (res.confirm) {
                            console.log('用户点击确定');
                            uni.request({
                                url: this.serverUrl +
                                    '/WEBSController/DeleteTemp_PackUnionBill_Json',
                                data: {
                                    HInterID: item.HInterID,
                                    // HBillNo: item.单据号,
                                    // HBillType: this.hform.HBillType,
                                    // HMaker: uni.getStorageSync('HUserName'),
                                    // MvarReportTitle: this.MvarReportTitle,
                                },
                                success: (res) => {
                                    console.log(1, res);
                                    if (res.data.count == 1) {
                                        this.clear()
                                    }
                                    uni.showToast({
                                        title: res.data.Message,
                                        icon: 'none'
                                    })
                                },
                                fail: (res) => {
                                    console.log(res);
                                    uni.hideLoading()
                                    uni.showToast({
                                        title: '接口请求失败',
                                        icon: 'none'
                                    })
                                },
                            });
                        } else if (res.cancel) {
                            console.log('用户点击取消');
                        }
                    }
                });
            },
            //撤销
            revoke(item) {
                // console.log(item.hmainid,uni.getStorageSync('HUserName'))
                uni.showModal({
                    title: '提示',
                    content: '是否确认撤销',
                    success: (res) => {
                        if (res.confirm) {
                            console.log('用户点击确定');
                            uni.request({
                                url: this.serverUrl +
                                    '/WEBSController/set_DeleteICStockBillAndWMS_Json',
                                data: {
                                    HInterID: item.HInterID,
                                    HBillNo: item.单据号,
                                    HBillType: this.hform.HBillType,
                                    HMaker: uni.getStorageSync('HUserName'),
                                    MvarReportTitle: this.MvarReportTitle,
                                },
                                success: (res) => {
                                    console.log(1, res);
                                    if (res.data.count == 1) {
                                        this.clear()
                                    }
                                    uni.showToast({
                                        title: res.data.Message,
                                        icon: 'none'
                                    })
                                },
                                fail: (res) => {
                                    console.log(res);
                                    uni.hideLoading()
                                    uni.showToast({
                                        title: '接口请求失败',
                                        icon: 'none'
                                    })
                                },
                            });
                        } else if (res.cancel) {
                            console.log('用户点击取消');
                        }
                    }
                });
            },
        }
    }
</script>
<style>
<style lang="scss" scoped>
    .form {
        width: 640rpx;
        margin: 20rpx auto;
        margin-top: 90rpx;
    }
</style>
    .tabs {
        width: 100%;
        position: fixed;
        left: 0;
        z-index: 9;
        display: flex;
        background-color: #e5e5e5;
        view {
            width: 50%;
            font-size: 30rpx;
            color: #333;
            text-align: center;
            padding: 16rpx 0;
        }
        .on {
            color: #3a78ff;
            font-weight: bold;
            border-bottom: 3px solid #3a78ff;
        }
    }
    .buttons {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 20rpx;
        button {
            border-radius: 50rpx;
            width: 180rpx;
            height: 66rpx;
            line-height: 66rpx;
            font-size: 28rpx;
        }
        .btn-a {
            background-color: #acacac;
            color: #fff;
        }
        .btn-b {
            background-color: #41a863;
            color: #fff;
        }
        .btn-c {
            background-color: #3a78ff;
            color: #fff;
        }
    }
    .form-item {
        display: flex;
        align-items: center;
        font-size: 28rpx;
        padding: 6rpx 0;
        .title {
            width: 180rpx;
            text {
                color: red;
                font-weight: bold;
            }
        }
        .right {
            width: 450rpx;
            border-radius: 22rpx;
            border: 1px solid #acacac;
        }
        .righton {
            width: 450rpx;
            border-radius: 22rpx;
            border: 1px solid #e4e4e4;
            background-color: #e4e4e4;
        }
        input {
            width: 100%;
            padding: 8rpx 20rpx;
            font-size: 30rpx;
        }
    }
    .list {
        width: 100%;
        .card-detail {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            line-height: 120%;
            .detail {
                // width: 50%;
                font-size: 26rpx;
                margin-bottom: 12rpx;
                color: #555;
                margin-right: 20rpx;
                text {
                    color: #999;
                    font-size: 26rpx;
                }
            }
        }
        .more {
            color: #888;
            font-size: 26rpx;
            display: flex;
            border-top: 1px solid #eee;
            padding-top: 20rpx;
            .part {
                width: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }
    }
</style>