况洋洋
2025-07-10 588407f3ad4279a7ed792dfaaee2ef91b57aa179
H5/Js/PurchaseInventory.js
@@ -34,6 +34,9 @@
            sectionCode:"",
            depotData: [],
            ItemDetail: [],
            rkType: "正常入库",
            show: false,//下拉框的显示
            actions: [{ name: "正常入库" }, { name: "工废入库" }, { name: "料废入库" }],//下拉框的数值
        }
    },
    mounted() {
@@ -44,6 +47,19 @@
        };
    },
    methods: {
        getInfo() {
            this.show = true;
        },
        // 修正 onSelect 方法
        onSelect(item) {  // item 是选中的对象(如 { name: "正常入库" })
            this.rkType = item.name;  // 提取 name 字段作为选中值
            this.show = false;
            console.log('选中的入库类型:', this.rkType);
        },
        getModel() {
            var that = this;
            that.isLoading = true;
@@ -87,23 +103,22 @@
                that.$playSound('error');
                return;
            }
            console.log('提交前 rkType 的值:', this.rkType);  // 确认是否为单个字符串
            console.log('提交前 rkType 的类型:', typeof this.rkType);  // 应输出 "string"
            that.isLoading = true;
            that.AxiosHttp("post", 'MesInvItemInCDetails/SaveBarCodes', {
                sectionCode: that.sectionCode,
                userName: that.userInfo.loginAccount,
                barcode: that.formData.barcode,
                cgrkType: this.rkType // 直接使用 rkType,默认值或选中值
            }, 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.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 });