南骏 池
2025-06-02 1aa48962bf1ae1ea53d7bca7eccdf3bc074fdda4
H5/Js/PurchaseInventory.js
@@ -31,6 +31,9 @@
            contentScrollW: 0, // 导航区宽度
            scrollLeft: 0, // 横向滚动条位置
            fullHeight: "",
            sectionCode:"",
            depotData: [],
            ItemDetail: [],
        }
    },
    mounted() {
@@ -45,56 +48,79 @@
            var that = this;
            that.isLoading = true;
            that.AxiosHttp("post", 'MesDepotSections/GetSectionName', {
                sectionCode: that.formData.sectionCode
                sectionCode: that.sectionCode
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.formData.sectionName = json.data.tbBillList;
                        that.depotData = json.data.tbBillList;
                        that.$refs.barcode.focus();
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.formData.sectionName = "";
                        that.$playSound('error');
                        that.depotData = [];
                        that.sectionCode = "";
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                    that.$refs.daa001.focus();
                    that.$playSound('error');
                    that.depotData = [];
                    that.sectionCode = "";
                    that.$refs.sectionCode.focus();
                });
        },
        getScan() {
            var that = this;
            if (that.formData.barcode.length * 1 <= 0) {
                that.$toast.fail("物料条码不能为空!");
                that.$playSound('error');
                return;
            }
            if (that.sectionCode.length * 1 <= 0) {
                that.$toast.fail("库位编码不能为空!");
                that.$playSound('error');
                return;
            }
            that.isLoading = true;
            that.AxiosHttp("post", 'MesInvItemInCDetails/SaveBarCodes', {
                sectionCode: that.formData.sectionCode,
                sectionCode: that.sectionCode,
                userName: that.userInfo.loginAccount,
                barcode: that.formData.barcode,
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.formData.itemNo = json.data.tbBillList.itemNo;
                        that.formData.sumQuantity = json.data.tbBillList.sumQuantity;
                        that.itemInsFormData = json.data.tbBillList.itemIns;
                        that.itemTableData = json.data.tbBillList.itemInDetails;
                        that.tableData = json.data.tbBillList.invItemInCDetails;
                        that.barMessage = json.data.tbBillList.message;
                        //that.formData.itemNo = json.data.tbBillList.itemNo;
                        //that.formData.sumQuantity = json.data.tbBillList.sumQuantity;
                        that.ItemDetail = json.data.tbBillList.itemInDetails;
                        //that.itemInsFormData = json.data.tbBillList.itemIns;
                        //that.itemTableData = json.data.tbBillList.itemInDetails;g
                        that.tableData = json.data.tbBillList.itemBarCDetails;
                        //that.barMessage = json.data.tbBillList.message;
                        that.$refs.barcode.focus();
                        that.formData.barcode = null;
                        that.$notify({ type: 'success', message: json.message });
                        that.$playSound('success');
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$playSound('error');
                        that.$refs.barcode.focus();
                        that.formData.barcode = null;
                    }
                    that.$notify({ type: 'success', message: json.message });
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    that.$playSound('error');
                    console.log(error);
                    that.$refs.barcode.focus();
                });
@@ -103,14 +129,17 @@
            var that = this;
            if (that.modeInfo.daa001.length <= 0) {
                that.$toast.fail("领料单号不能为空!");
                that.$playSound('error');
                return;
            }
            if (that.scanInfo.splitNum * 1 <= 0) {
                that.$toast.fail("拆分数量不能为空!");
                that.$playSound('error');
                return;
            }
            if (that.scanInfo.barcode.length * 1 <= 0) {
                that.$toast.fail("物料条码不能为空!");
                that.$playSound('error');
                return;
            }
            that.isLoading = true;
@@ -126,17 +155,20 @@
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$playSound('error');
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    that.$playSound('error');
                    console.log(error);
                });
        },
        cleraCode() {
            this.formData.sectionCode = null;
            this.sectionCode = "";
            this.$refs.sectionCode.focus();
        },
        ToErp() {
            this.Message = "";