cdk
昨天 8e4aa88d5b4b85d19cdaf49f14fca22540b7e3dd
H5/Js/Xsck.js
@@ -19,6 +19,11 @@
            active: 0,
            show: false,
            actions: [],
            ItemTblDetail: [],
            ItemDetail: [],
            ItemBarKw: [],
            currentIndex: -1,
            zdy: "",
        }
    },
    mounted() {
@@ -29,8 +34,55 @@
        };
    },
    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();
        },
        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 = [];
                });
        },
        //获取发货通知单号
        getInfo() {
            this.show = true;
            var that = this;
            that.isLoading = true
@@ -47,11 +99,11 @@
                            that.actions = json.data.tbBillList.map(item => {
                                return { name: item }
                            });
                        }
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.show = false;
                    }
                    that.isLoading = false;
                })
@@ -67,6 +119,7 @@
        //    this.$notify({ type: 'success', message: '某某物料扫码成功某某物料扫码成功某某物料扫码成功某某物料扫码成功' });
        //},
        //点击事件
        onSelect(item) {
            // 默认情况下点击选项时不会自动收起
            // 可以通过 close-on-click-action 属性开启自动收起
@@ -77,6 +130,7 @@
            //this.$toast(item.name);
        },
        //根据发货通知单号获取明细
        GetMesItemDetailByBillNo() {
            var that = this;
            that.isLoading = true;
@@ -88,6 +142,7 @@
                    var json = res;
                    if (json.status == 0) {
                        that.ItemBlDetail = json.data.tbBillList;
                        that.zdy = json.data.tbBillList.allList[0].createNmae;
                        //that.daa001 = json.data.tbBillList.item1;
                        that.$refs.barcode.focus();
                    }
@@ -104,12 +159,13 @@
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    //console.log(error);
                    tthat.$refs.billNo.focus();
                    that.$refs.billNo.focus();
                    that.billNo = "";
                    that.daa001 = "";
                    that.ItemBlDetail = [];
                });
        },
        //扫码
        getBarcode() {
            //this.barcode = value;
@@ -130,7 +186,7 @@
            }
            if (!that.billNo) {
                this.$toast.fail("发货通知单号不能为空");
                this.$toast.fail("申请单号不能为空");
                that.isLoading = false;
                return;
            }
@@ -145,7 +201,8 @@
            that.AxiosHttp("post", 'MesXsck/XSCKScanBarcode', {
                userName: that.userInfo.loginAccount,
                barcode: that.barcode,
                daa001: that.billNo,
                daa001: that.daa001,
                billNo: that.billNo,
                //type: selectType
            }, false)
                .then(function (res) {
@@ -155,7 +212,6 @@
                        that.barcode = null;
                        that.sms = null;
                        that.num = null;
                        //that.ItemBlDetail = json.data.tbBillList.item2
                        that.$notify({ type: 'success', message: '扫描成功' });
                        that.GetMesItemDetailByBillNo();
                        that.$refs.barcode.focus();
@@ -166,8 +222,12 @@
                    } else if (json.status == 2) {
                        that.$refs.splitNum.focus();
                        that.splitNum = json.data.cfNum;
                        that.num = json.data.num;
                        that.splitNum = json.data.tbBillList.splitNum; // 拆分数量
                        that.num = json.data.tbBillList.barcodeNum;    // 条码数量
                        that.daa001 = json.data.tbBillList.daa001;     // 工单号
                        if (json.data.tbBillList.billNo) {
                            that.billNo = json.data.tbBillList.billNo;
                        }     // 发货通知单号,只在有值时赋值
                    }
                    else {
                        that.$toast.fail(json.message);
@@ -188,6 +248,7 @@
                    that.splitNum = "";
                });
        },
        //条码拆分
        tmcf() {
            //this.show = true;
@@ -207,16 +268,16 @@
            }
            if (!that.billNo) {
                this.$toast.fail("补料单号不能为空");
                this.$toast.fail("发货单号不能为空");
                that.isLoading = false;
                return;
            }
            if (!that.daa001) {
                this.$toast.fail("工单号不能为空");
                that.isLoading = false;
                return;
            }
            //if (!that.daa001) {
            //    this.$toast.fail("工单号不能为空");
            //    that.isLoading = false;
            //    return;
            //}
            if (!that.splitNum) {
                this.$toast.fail("发货数量不能为空");
@@ -227,7 +288,8 @@
            that.AxiosHttp("post", 'MesXsck/SplitBarcode', {
                userName: that.userInfo.loginAccount,
                barcode: that.barcode,
                daa001: that.billNo,
                daa001: that.daa001,
                billNo: that.billNo,
                num: that.splitNum,
                //type: selectType
            }, false)