南骏 池
2025-05-08 0d193338eedb3afecbb8e6b8f9ebf3592343651e
1.产品绑定送检优化
已修改2个文件
71 ■■■■ 文件已修改
H5/Cpdbsj.aspx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Js/Cpbdsj.js 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Cpdbsj.aspx
@@ -219,5 +219,5 @@
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server">
    <script src="Js/Cpbdsj.js?<%=121111112 %>"></script>
    <script src="Js/Cpbdsj.js?<%=121111114 %>"></script>
</asp:Content>
H5/Js/Cpbdsj.js
@@ -45,6 +45,7 @@
                        that.XBar = "";
                    }
                    else {
                        that.$playSound('error');
                        that.$toast.fail(json.message);
                        that.$refs.KbBar.focus();
                        that.KbBar = "";
@@ -53,6 +54,7 @@
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$playSound('error');
                    that.$toast.fail("网络错误,请重试!");
                    that.$refs.KbBar.focus();
                    that.KbBar = "";
@@ -61,6 +63,7 @@
        getXBarInfo() {
            var that = this;
            if (that.KbBar.length <= 0) {
                that.$playSound('error');
                that.$toast.fail("卡板条码不能为空!");
                that.$refs.KbBar.focus();
                that.XBar = "";
@@ -68,6 +71,7 @@
            }
            if (that.DAA001.length <= 0) {
                that.$playSound('error');
                that.$toast.fail("指令工单不能为空!");
                that.$refs.KbBar.focus();
                that.XBar = "";
@@ -76,7 +80,18 @@
            // 检查是否超过装箱数
            if (that.XbarInfo.length >= that.Xvalue) {
                that.$playSound('error');
                that.$toast.fail(`已达到装箱数限制(${that.Xvalue})`);
                that.XBar = "";
                return;
            }
            //待装数
            var Dvalue = (that.KbBarInfo.oldqty || 0) - +(that.KbBarInfo.ySum || 0)
            // 检查是否超过装箱数
            if (that.Xvalue > Dvalue) {
                that.$playSound('error');
                that.$toast.fail(`装箱数(${that.Xvalue}) 不能大于 卡板待装数(${Dvalue})`);
                that.XBar = "";
                return;
            }
@@ -84,6 +99,7 @@
            // 检查条码是否已存在
            const isExist = that.XbarInfo.some(item => item.iteM_BARCODE === that.XBar);
            if (isExist) {
                that.$playSound('error');
                that.$toast.fail("该箱条码已存在,请勿重复扫描");
                that.XBar = "";
                return;
@@ -91,8 +107,9 @@
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/getXBarInfo', {
                Kbbarcode: that.KbBar,
                KbBar: that.KbBar,
                DAA001: that.DAA001,
                userName: that.userInfo.loginAccount,
                Xbarcode: that.XBar
            }, false)
                .then(function (res) {
@@ -103,24 +120,33 @@
                        that.XBar = "";
                    }
                    else {
                        that.$playSound('error');
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$playSound('error');
                    that.$toast.fail("网络错误,请重试!");
                });
        },
        productBinding() {
            if (this.isLoading) {
                return;
            }
            var that = this;
            if (that.ZsBar.length <= 0) {
                that.$playSound('error');
                that.$toast.fail("追溯码不能为空!");
                return;
            }
            if (that.LsBar.length <= 0) {
                that.$playSound('error');
                that.$toast.fail("后盖码不能为空!");
                return;
            }
@@ -135,12 +161,14 @@
                    var json = res;
                    if (json.status == 0) {
                        // that.scanInfo = json.data.tbBillList;
                        that.$playSound('success');
                        that.$notify({ type: 'success', message: json.message });
                        that.$refs.ZsBar.focus();
                        that.ZsBar = null;
                        that.ZsBar = null;
                    }
                    else {
                        that.$playSound('error');
                        that.$toast.fail(json.message);
                        that.$refs.ZsBar.focus();
                        that.ZsBar = null;
@@ -151,31 +179,18 @@
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$playSound('error');
                    that.$toast.fail("网络错误,请重试!");
                    that.$refs.ZsBar.focus();
                    that.ZsBar = null;
                    that.ZsBar = null;
                });
        },
        //打印机注释
        //selectPrinter(printer) {
        //    this.selectedPrinter = printer.printerId; // 更新选中的打印机编号
        //},
        //confirmSelection() {
        //    if (this.selectedPrinter) {
        //        alert(`您选择了打印机:${this.selectedPrinter}`);
        //        // 在这里处理选择结果,例如调用接口或更新状态
        //        this.isPrinterPopupVisible = false; // 关闭弹窗
        //    } else {
        //        alert('请选择一个打印机!');
        //    }
        //},
        //onPrinterSelected(value) {
        //    console.log('当前选中的打印机编号:', value);
        //},
        checkProductBarcode() {
            var that = this;
            if (!that.LsBar) {
                that.$playSound('error');
                that.$toast.fail("请输入产品条码");
                return;
            }
@@ -190,6 +205,7 @@
                    that.$toast("已核对");
                } else {
                    that.$set(matchedItem, 'is_hedui', "1");
                    that.$playSound('success');
                    that.$notify({ type: 'success', message: "核对成功" });
                    that.LsBar = "";
                    // 检查是否所有行都已核对
@@ -199,6 +215,7 @@
                    }
                }
            } else {
                that.$playSound('error');
                that.$toast.fail("未找到匹配的箱条码");
            }
            
@@ -207,6 +224,11 @@
        // 新增方法:提交所有已核对的数据
        submitAllChecked() {
            if (this.isLoading) {
                return;
            }
            var that = this;
            that.isLoading = true;
            
@@ -218,9 +240,11 @@
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.$playSound('success');
                        that.$notify({ type: 'success', message: json.message });
                        that.getKbBarInfo();
                    } else {
                        that.$playSound('error');
                        that.$toast.fail(json.message);
                        that.XbarInfo = [];
                        that.XBar = "";
@@ -231,12 +255,19 @@
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$playSound('error');
                    that.$toast.fail("绑定失败,请重试!");
                });
        },
        handleSubmit() {
            if (this.isLoading) {
                return;
            }
            var that = this;
            if (!that.KbBar) {
                that.$playSound('error');
                that.$toast.fail("请先扫描卡板条码");
                return;
            }
@@ -246,6 +277,7 @@
            const ySum = +(that.KbBarInfo.ySum || 0);
            
            if (oldqty !== ySum) {
                that.$playSound('error');
                that.$toast.fail(`装板未完成,待装数:${oldqty - ySum}`);
                return;
            }
@@ -258,6 +290,7 @@
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.$playSound('success');
                        that.$notify({ type: 'success', message: json.message });
                        // 清空数据
                        that.KbBar = "";
@@ -265,12 +298,14 @@
                        that.KbBarInfo = [];
                        that.$refs.KbBar.focus();
                    } else {
                        that.$playSound('error');
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$playSound('error');
                    that.$toast.fail("提交失败,请重试!");
                    that.$refs.KbBar.focus();
                });