南骏 池
2025-08-19 a40798a6290b41c4aacab2e142a23b944743bda9
H5/Js/Cpbdsj.js
@@ -1,4 +1,5 @@
var vm = new Vue({

var vm = new Vue({
    el: '#app',
    data: function () {
        return {
@@ -31,6 +32,7 @@
            actions: [],//列表的值
            xtName: "",//线体名称
            xtNum: "",//线体编号
            agvChecked: false,//是否勾选AGV
        }
    },
    mounted() {
@@ -101,7 +103,7 @@
            }
            //待装数
            var Dvalue = (that.KbBarInfo.oldqty || 0) - +(that.KbBarInfo.ySum || 0)
            var Dvalue = (that.KbBarInfo.quantity || 0) - +(that.KbBarInfo.ySum || 0)
            // 检查是否超过装箱数
            if (that.Xvalue > Dvalue) {
                that.$playSound('error');
@@ -130,8 +132,15 @@
                    var json = res;
                    if (json.status == 0) {
                        that.XbarInfo.push(json.data.tbBillList.xBarInfo[0]);
                        that.$playSound('success');
                        that.$refs.XBar.focus();
                        that.XBar = "";
                        // 检查是否超过装箱数
                        if (that.XbarInfo.length >= that.Xvalue) {
                            that.$refs.LsBar.focus();
                        }
                    }
                    else {
                        that.$playSound('error');
@@ -257,7 +266,12 @@
        },
        handleClear() {
            this.KbBar = "";
            this.XBar = "";
            this.LsBar = "";
            this.DAA001 = [];
            this.XbarInfo = [];
        },
        // 新增方法:提交所有已核对的数据
@@ -311,7 +325,7 @@
            }
    
            // 计算可装数和已装数
            const oldqty = +(that.KbBarInfo.oldqty || 0);
            const oldqty = +(that.KbBarInfo.quantity || 0);
            const ySum = +(that.KbBarInfo.ySum || 0);
            
            if (oldqty !== ySum) {
@@ -349,12 +363,11 @@
                });
        },
        onSelect(item) {
        onSelect(action) {
            this.xtNum = action.lineNo;  // 绑定line_no到xtNum字段
            console.log("选择的线体编号:", this.xtNum);
            this.xtName = action.name;  // 绑定name到xtName字段
            this.show = false;
            console.log(item);
            // 正则匹配第一个方括号内容
            this.modeInfo.Xt = item;
        },
        //获取可呼叫AGV的线体
        selectXt() {
@@ -376,9 +389,8 @@
                            that.itemInfo = json.data.tbBillList;
                            that.actions = json.data.tbBillList.map(item => {
                                return {
                                    name: item.daaInfo,  // 拼接字段
                                    subname:"[线体名称][]"
                                    name: item.name,
                                    lineNo: item.line_no  // 新增
                                };
                            });
                        }
@@ -397,6 +409,105 @@
                });
        },
        //AGV送检
        handleAGVInspection() {
            //this.$toast.fail("功能开发测试中!");
            //return;
            if (this.isLoading) {
                return;
            }
            var that = this;
            if (that.agvChecked === false)
            {
                that.$playSound('error');
                that.$toast.fail("AGV送检请先勾选 AGV");
                return;
            }
            if (!that.KbBar) {
                that.$playSound('error');
                that.$toast.fail("请先扫描卡板条码");
                return;
            }
            // 计算可装数和已装数
            const oldqty = +(that.KbBarInfo.quantity || 0);
            const ySum = +(that.KbBarInfo.ySum || 0);
            if (oldqty !== ySum) {
                that.$playSound('error');
                that.$toast.fail(`装板未完成,待装数:${oldqty - ySum}`);
                return;
            }
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/handleAGVInspection', {
                KbBar: that.KbBar,
                userAccount: that.userInfo.loginAccount
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.$playSound('success');
                        that.$notify({ type: 'success', message: json.message });
                    } else {
                        that.$playSound('error');
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$playSound('error');
                    that.$toast.fail("AGV送检失败,请重试!");
                    that.$refs.KbBar.focus();
                });
        },
        //AGV呼叫
        handleAGVCall() {
            //this.$toast.fail("功能开发测试中!");
            //return;
            if (this.isLoading) {
                return;
            }
            var that = this;
            if (!that.xtNum) {
                that.$playSound('error');
                that.$toast.fail("请先选择线体");
                return;
            }
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/handleAGVCall', {
                XtNum: that.xtNum,
                userAccount: that.userInfo.loginAccount
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.$playSound('success');
                        that.$notify({ type: 'success', message: json.message });
                    } else {
                        that.$playSound('error');
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$playSound('error');
                    that.$toast.fail("AGV呼叫失败,请重试!");
                    that.$refs.KbBar.focus();
                });
        }
    }
})