南骏 池
2025-04-15 2edeef58633a0a303c243f1b8fcc85b79780eea1
H5/Js/PurchaseReturn.js
@@ -14,7 +14,7 @@
                quantity:0
            },
            formData: {},
            tableData: [],
            ItemDetail: [],
            codeTableData: [],
            itemOutNoList: [],
            itemOutNoStr: [],
@@ -35,6 +35,8 @@
            loginGuid: this.GetLoginInfor().loginGuid,
            loginAccount: this.GetLoginInfor().loginAccount,
        };
        that.beginload();
        //that.show = false;
    },
    methods: {
        getItemOutNo() {
@@ -51,6 +53,29 @@
                            return { name: s.billNo }
                        });
                        that.show = true;
                    }
                    else {
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                });
        },
        beginload() {
            var that = this;
            that.isLoading = true;
            that.AxiosHttp("post", 'MesCgthSq/GetMesCgthSq', {
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.itemOutNoList = json.data.tbBillList;
                    }
                    else {
                        that.$toast.fail(json.message);
@@ -110,6 +135,11 @@
        getItem() {
            var that = this;
            that.isLoading = true;
            let itemOut = this.itemOutNoList.filter(it => it.billNo == that.scanFormData.itemOutNo);
            this.invItemOutId = itemOut[0].id;
            that.AxiosHttp("post", 'MesCgthSq/GetSumItem', {
                id: that.invItemOutId,
                billNo: that.scanFormData.itemOutNo,
@@ -118,45 +148,22 @@
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.tableData = json.data.tbBillList.sumItem;
                        that.scanFormData.itemNo = json.data.tbBillList.itemNo
                        //that.scanFormData.quantity = json.data.tbBillList.quantity
                        console.log(json);
                        that.ItemDetail = json.data.tbBillList;
                        that.$refs.barcode.focus();
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.ItemDetail = [];
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                    that.ItemDetail = [];
                });
        },
        //getScanBarcode() {
        //    var that = this;
        //    that.isLoading = true;
        //    that.AxiosHttp("post", 'MesInvItemOuts/GetScanBarcode', {
        //        id: that.formData.guid
        //    }, false)
        //        .then(function (res) {
        //            var json = res;
        //            if (json.status == 0) {
        //                that.codeTableData = res.data.tbBillList;
        //            }
        //            else {
        //                that.$toast.fail(json.message);
        //            }
        //            that.isLoading = false;
        //        })
        //        .catch(function (error) {
        //            that.isLoading = false;
        //            that.$toast.fail("网络错误,请重试!");
        //            console.log(error);
        //        });
        //},
        SaveBarCodes() {
            //if (!this.scanFormData.barcode) {
@@ -180,10 +187,13 @@
                        //}
                        that.scanFormData.quantity = json.data.tbBillList.barcodeNum
                        that.getItem();
                        that.$refs.barcode.focus();
                        that.scanFormData.barcode = null;
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$refs.barcode.focus();
                        that.scanFormData.barcode = null;
                    }
                    that.$notify({ type: 'success', message: json.message });
                    that.isLoading = false;