南骏 池
8 天以前 46de11510807648d990b3ad77354ca556da5893a
H5/Js/Scll.js
@@ -24,6 +24,11 @@
            //    { printerId: 'Printer2', ipAddress: '192.168.1.2' },
            //    { printerId: 'Printer3', ipAddress: '192.168.1.3' }
            //], // 打印机列表
            // 当前选中行的索引
            currentIndex: -1,
            // 存储选中行数据对象
            selItem: {} ,
            ItemBarKw: [],//当天行相关条码库位信息
        }
    },
    mounted() {
@@ -34,6 +39,62 @@
        };
    },
    methods: {
        /**
         * 处理行点击事件(单选逻辑)
         * @param {Object} item 当前行数据
         * @param {Number} index 当前行索引
         */
        handleRowClick(item, index) {
            if (this.isLoading) {
                return;
            }
            // 重置所有行的选中状态
            this.currentIndex = -1;
            // 设置当前选中行
            this.currentIndex = index;
            this.selItem = {
                itemid: item.fMaterialId,
                index: index
            };
            console.log('当前选中项:', this.selItem); // 调试用
            this.GetBarKwByItem();
        },
        GetBarKwByItem() {
            var that = this;
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/GetBarKwByItem', {
                itemId: that.selItem.itemid,
                userName: that.userInfo.loginAccount
            }, 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 = [];
                });
        },
        getModel() {
            var that = this;
            that.isLoading = true;
@@ -47,9 +108,13 @@
                        that.ItemDetail = json.data.tbBillList;
                        that.modeInfo.planNo = json.data.tbBillList.planNo;
                        that.$refs.barcode.focus();
                        // 重置所有行的选中状态
                        that.currentIndex = -1;
                        that.ItemBarKw = [];
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$playSound('error');
                        that.$refs.daa001.focus();
                        that.modeInfo.daa001 = "";
                        that.modeInfo.planNo = "";
@@ -60,6 +125,7 @@
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    that.$playSound('error');
                    console.log(error);
                    that.$refs.daa001.focus();
                    that.modeInfo.daa001 = "";