新框架PDA前端(祈禧6月初版本)
南骏 池
2025-11-25 408b576b8aa155c9f7c8b919be3cd82be52a1da8
H5/Js/Dbck.js
@@ -12,11 +12,19 @@
            fum: "",
            billNo: "",
            barcode:"",
            ItemBlDetail:[],
            ItemBlDetail: [], // 待扫
            ItemYsDetail: [], // 已扫
            ItemDetail: [],
            ItemBarKw: [],
            currentIndex: -1,
            modeInfo: [],
            active: 0,
            show: false,
            actions: [],
            ItemDetail: [],
            scanInfo: { barcodeNum: "", splitNum: "", barcode: "" },
        }
    },
    mounted() {
@@ -27,6 +35,56 @@
        };
    },
    methods: {
            handleRowClick(item, index) {
                if (this.isLoading) {
                    return;
                }
                // 重置所有行的选中状态
                this.currentIndex = -1;
                // 设置当前选中行
                this.currentIndex = index;
                this.selItem = {
                    itemid: item.itemId,
                    index: index
                };
                console.log('当前选中项:', this.selItem); // 调试用
                this.GetBarKwByItem();
                //this.active = 1;            //自动切换到库位列表tab
            },
            GetBarKwByItem() {
                var that = this;
                that.isLoading = true;
                that.AxiosHttp("post", 'Womdaa/GetBarKwByItemCK', {
                    itemId: that.selItem.itemid,
                    userName: that.userInfo.loginAccount,
                    type: 'DBCK',//调拨出库
                    billNo: that.billNo
                }, false)
                    .then(function (res) {
                        var json = res;
                        if (json.status == 0) {
                            that.ItemBarKw = json.data.tbBillList;
                        }
                        else {
                            that.$toast.fail(json.message);
                            that.$playSound('error');
                            that.ItemBarKw = [];
                        }
                        that.isLoading = false;
                    })
                    .catch(function (error) {
                        that.isLoading = false;
                        that.$toast.fail("网络错误,请重试!");
                        that.$playSound('error');
                        console.log(error);
                        that.ItemBarKw = [];
                    });
            },
        getInfo() {
            this.show = true;
@@ -69,6 +127,8 @@
            this.show = false;
            this.billNo = item.name;
            // 清空库位列表
            this.ItemBarKw = [];
            this.GetMesItemBlDetailByBillNo();
            //this.$toast(item.name);
@@ -82,7 +142,10 @@
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.ItemBlDetail = json.data.tbBillList;
                        //that.ItemDetail = json.data.tbBillList;
                        var tbBillList = json.data.tbBillList || {};
                        that.ItemBlDetail = tbBillList.blDetails || []; // 待扫
                        that.ItemYsDetail = tbBillList.ysDetails || []; // 已扫
                        that.$refs.barcode.focus();
                        that.barcode = "";
                    }
@@ -90,7 +153,7 @@
                        that.$toast.fail(json.message);
                        that.$refs.billNo.focus();
                        that.billNo = "";
                        that.ItemBlDetail = null;
                        that.ItemDetail = null;
                    }
                    that.isLoading = false;
                })
@@ -103,7 +166,7 @@
                    //console.log(error);
                });
        },
        getBarcode() {
        getScan() {
            //this.barcode = value;
@@ -137,15 +200,22 @@
                    var json = res;
                    if (json.status == 0) {
                        that.itemNo = json.data.form.itemNo;
                        //that.num = json.data.form.num;
                        //that.fum = json.data.form.fum;
                        that.ItemBlDetail = json.data.items
                        //that.itemNo = json.data.tbBillList.itemNo;
                        ////that.num = json.data.form.num;
                        ////that.fum = json.data.form.fum;
                        //that.ItemBlDetail = json.data.items
                        that.$notify({ type: 'success', message: '扫码成功' });
                        that.$toast.success("扫描成功");
                        that.$refs.barcode.focus();
                        that.barcode = "";
                        //that.GetMesItemBlDetailByBillNo();
                        that.GetMesItemBlDetailByBillNo();
                    }
                    else if (json.status == 2) {
                        that.itemNo = json.data.tbBillList.itemNo;
                        that.$refs.splitNum.focus();
                        that.scanInfo.splitNum = json.data.tbBillList.splitNum;
                        that.scanInfo.barcodeNum = json.data.tbBillList.barcodeNum;
                    }
                    else {
                        that.$toast.fail(json.message);
@@ -162,57 +232,71 @@
                    that.barcode = "";
                });
        },
        tmcf() {
        getChaiFen() {
            //this.isPrinterPopupVisible = true; // 显示弹窗
            if (this.isLoading) {
                return;
            }
            var that = this;
            if (!that.userInfo.loginAccount) {
                this.$toast.fail("请重新检查登录状态");
            if (that.billNo.length <= 0) {
                that.$toast.fail("申请单号不能为空!");
                return;
            }
            if (that.scanInfo.splitNum * 1 <= 0) {
                that.$toast.fail("拆分数量不能为空!");
                return;
            }
            if (that.barcode.length * 1 <= 0) {
                that.$toast.fail("物料条码不能为空!");
                return;
            }
            //that.ip = "";
            //that.prot = "";
            //that.getPrintInfo();
            if (!that.barcode) {
                this.$toast.fail("条码不能为空");
                return;
            }
            if (!that.billNo) {
                this.$toast.fail("申请单号不能为空");
                return;
            }
            if (!that.fum) {
                this.$toast.fail("拆分数不能为空");
                return;
            }
            //if (that.ip.length <= 0 || that.prot.length <= 0) {
            //    alert(that.ip);
            //    alert(that.prot);
            //    return;
            //}
            that.isLoading = true;
            that.AxiosHttp("post", 'TransferOut/SplitBarcode', {
            that.AxiosHttp("post", 'TransferOut/ScanCodeCF', {
                daa001: that.billNo,
                userName: that.userInfo.loginAccount,
                barcode: that.barcode,
                billNo: that.billNo,
                fum: that.fum
                Num: that.scanInfo.splitNum,
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        //  that.modeInfo = json.data.tbBillList;
                        that.scanInfo.splitNum = null;
                        that.scanInfo.barcodeNum = null;
                        that.scanInfo.barcode = null;
                        that.$notify({ type: 'success', message: json.message });
                        that.$playSound('success');
                        that.itemNo = json.data.form.itemNo;
                        that.num = json.data.form.num;
                        that.barcode = json.data.form.barcode;
                        that.fum = json.data.form.fum;
                        that.ItemBlDetail = json.data.items
                        that.$notify({ type: 'success', message: '扫码成功' });
                        that.sendPrintMessage(json.data.tbBillList);
                        that.$refs.barcode.focus();
                        that.barcode = "";
                        //that.GetMesItemBlDetailByBillNo();
                        that.GetMesItemBlDetailByBillNo();
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$playSound('error');
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                    that.$playSound('error');
                });
        }
        },
    }
})