| | |
| | | var vm = new Vue({ |
| | | |
| | | var vm = new Vue({ |
| | | el: '#app', |
| | | data: function () { |
| | | return { |
| | |
| | | //} |
| | | ], |
| | | DAA001: [], |
| | | show: false,//列表展示 |
| | | actions: [],//列表的值 |
| | | xtName: "",//线体名称 |
| | | xtNum: "",//线体编号 |
| | | agvChecked: false,//是否勾选AGV |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | } |
| | | |
| | | //待装数 |
| | | 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'); |
| | |
| | | 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'); |
| | | that.XBar = ""; |
| | | that.$toast.fail(json.message); |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.XBar = ""; |
| | | that.$playSound('error'); |
| | | that.$toast.fail("网络错误,请重试!"); |
| | | }); |
| | |
| | | that.LsBar = ""; // 清空输入框 |
| | | }, |
| | | |
| | | GetWeightByXt() { |
| | | |
| | | handleClear() { |
| | | this.KbBar = ""; |
| | | this.XBar = ""; |
| | | this.LsBar = ""; |
| | | this.DAA001 = []; |
| | | this.XbarInfo = []; |
| | | |
| | | }, |
| | | |
| | | // 新增方法:提交所有已核对的数据 |
| | |
| | | } |
| | | |
| | | // 计算可装数和已装数 |
| | | const oldqty = +(that.KbBarInfo.oldqty || 0); |
| | | const oldqty = +(that.KbBarInfo.quantity || 0); |
| | | const ySum = +(that.KbBarInfo.ySum || 0); |
| | | |
| | | if (oldqty !== ySum) { |
| | |
| | | that.$refs.KbBar.focus(); |
| | | }); |
| | | }, |
| | | |
| | | onSelect(action) { |
| | | this.xtNum = action.lineNo; // 绑定line_no到xtNum字段 |
| | | console.log("选择的线体编号:", this.xtNum); |
| | | this.xtName = action.name; // 绑定name到xtName字段 |
| | | this.show = false; |
| | | }, |
| | | //获取可呼叫AGV的线体 |
| | | selectXt() { |
| | | this.show = true; |
| | | var that = this; |
| | | that.actions = []; |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'Womdaa/GetAgvXt', { |
| | | selectKey: that.selectKey, |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | |
| | | if (json.data.tbBillList.length <= 0) { |
| | | that.$toast.fail("没有可用的数据"); |
| | | that.$playSound('error'); |
| | | } else { |
| | | that.itemInfo = json.data.tbBillList; |
| | | that.actions = json.data.tbBillList.map(item => { |
| | | return { |
| | | name: item.name, |
| | | lineNo: item.line_no // 新增 |
| | | }; |
| | | }); |
| | | } |
| | | } |
| | | 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); |
| | | }); |
| | | }, |
| | | |
| | | //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(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | }) |