| | |
| | | messageCenter: {}, |
| | | messageId: 0, |
| | | |
| | | show: false, |
| | | |
| | | scanInfo: { barcodeNum: "", splitNum: "", barcode: "" }, |
| | | ip: "", |
| | | port: "", |
| | | oldBarInfo: [], |
| | | cfBarInfo: [], |
| | | |
| | | selectKey: "",//查询关键字 |
| | | actions: [],//列表的值 |
| | | show: false,//列表展示 |
| | | // 当前选中行的索引 |
| | | currentIndex: -1, |
| | | // 存储选中行数据对象 |
| | | selItem: {}, |
| | | ItemBarKw: [],//当天行相关条码库位信息 |
| | | DaaInfo: {}, |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | //that.show = false; |
| | | }, |
| | | methods: { |
| | | getItemOutNo() { |
| | | var that = this; |
| | | /** |
| | | * 处理行点击事件(单选逻辑) |
| | | * @param {Object} item 当前行数据 |
| | | * @param {Number} index 当前行索引 |
| | | */ |
| | | handleRowClick(item, index) { |
| | | if (this.isLoading) { |
| | | return; |
| | | } |
| | | |
| | | // 重置所有行的选中状态 |
| | | this.currentIndex = -1; |
| | | |
| | | // 设置当前选中行 |
| | | this.currentIndex = index; |
| | | this.selItem = { |
| | | itemid: item.itemId,//驼峰命名法!!! |
| | | index: index |
| | | }; |
| | | |
| | | console.log('当前选中项:', this.selItem); // 调试用 |
| | | |
| | | this.GetBarKwByItem(); |
| | | }, |
| | | //获取库位信息 |
| | | GetBarKwByItem() { |
| | | //Womdaa |
| | | //WwGd |
| | | var that = this; |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'MesCgthSq/GetMesCgthSq', { |
| | | that.AxiosHttp("post", 'Womdaa/GetBarKwByItem', { |
| | | itemId: that.selItem.itemid, |
| | | userName: that.userInfo.loginAccount |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | that.ItemBarKw = json.data.tbBillList; |
| | | } |
| | | else { |
| | | that.$toast.fail(json.message); |
| | | that.$playSound('error'); |
| | | that.ItemBarKw = []; |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("网络错误,请重试!"); |
| | | that.$playSound('error'); |
| | | console.log(error); |
| | | that.ItemBarKw = []; |
| | | }); |
| | | }, |
| | | getItemOutNo() { |
| | | 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; |
| | | that.itemOutNoStr = that.itemOutNoList.map(s => { |
| | | return { name: s.billNo } |
| | | }); |
| | | that.show = true; |
| | | if (!Array.isArray(that.itemOutNoList) || that.itemOutNoList.length === 0) { |
| | | that.$toast.fail("没有可用的数据"); |
| | | that.show = false; |
| | | } |
| | | else { |
| | | that.itemOutNoStr = that.itemOutNoList.map(s => ({ name: s })); |
| | | that.show = true; |
| | | } |
| | | } |
| | | else { |
| | | that.$playSound('error'); |
| | |
| | | |
| | | }, |
| | | onSelect(item) { |
| | | // 默认情况下点击选项时不会自动收起 |
| | | // 可以通过 close-on-click-action 属性开启自动收起 |
| | | this.show = false; |
| | | |
| | | //let staf = this.stafList.filter(it => it.staffName === item.name); |
| | | |
| | | this.scanFormData.itemOutNo = item.name; |
| | | |
| | | let itemOut = this.itemOutNoList.filter(it => it.billNo == item.name); |
| | | |
| | | this.invItemOutId = itemOut[0].id; |
| | | |
| | | this.invItemOutId = item.name; |
| | | this.ItemBarKw = []; // 选择申请单号后清空库位列表 |
| | | this.getItem(); |
| | | |
| | | }, |
| | | 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, |
| | | barcode: that.scanFormData.barcode, |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | that.ItemDetail = json.data.tbBillList; |
| | | that.ItemDetail = { |
| | | items: json.data.tbBillList.items, |
| | | ysitems: json.data.tbBillList.ysitems, |
| | | allList: json.data.tbBillList.allList |
| | | }; |
| | | that.$refs.barcode.focus(); |
| | | } |
| | | else { |
| | |
| | | that.getItem(); |
| | | that.$refs.barcode.focus(); |
| | | that.scanFormData.barcode = null; |
| | | that.$playSound('success'); |
| | | that.$notify({ type: 'success', message: json.message }); |
| | | } |
| | | else if (json.status == 2) { |
| | | that.$refs.splitNum.focus(); |
| | | that.scanInfo.splitNum = json.data.tbBillList.splitNum; |
| | | that.scanFormData.quantity = json.data.tbBillList.barcodeNum; |
| | | } |
| | | else { |
| | | that.$playSound('error'); |
| | |
| | | that.$refs.barcode.focus(); |
| | | that.scanFormData.barcode = null; |
| | | } |
| | | success |
| | | that.$notify({ type: 'success', message: json.message }); |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | |
| | | that.$toast.fail("拆分数量不能为空!"); |
| | | return; |
| | | } |
| | | if (that.scanInfo.barcode.length * 1 <= 0) { |
| | | if (that.scanFormData.barcode.length * 1 <= 0) { |
| | | that.$playSound('error'); |
| | | that.$toast.fail("物料条码不能为空!"); |
| | | return; |
| | |
| | | //} |
| | | |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'Womdaa/ScanCodeCF', { |
| | | daa001: that.modeInfo.daa001, |
| | | that.AxiosHttp("post", 'MesCgthSq/ScanCodeCF', { |
| | | billNo: that.scanFormData.itemOutNo, |
| | | userName: that.userInfo.loginAccount, |
| | | barcode: that.scanInfo.barcode, |
| | | barcode: that.scanFormData.barcode, |
| | | Num: that.scanInfo.splitNum, |
| | | }, false) |
| | | .then(function (res) { |
| | |
| | | if (json.status == 0) { |
| | | // that.modeInfo = json.data.tbBillList; |
| | | that.scanInfo.splitNum = null; |
| | | that.scanInfo.barcodeNum = null; |
| | | that.scanInfo.barcode = null; |
| | | that.scanFormData.quantity = null; |
| | | that.scanFormData.barcode = null; |
| | | that.$notify({ type: 'success', message: json.message }); |
| | | that.$playSound('success'); |
| | | |
| | | that.sendMessage(json.data.tbBillList); |
| | | that.getItem(); |
| | | //that.sendMessage(json.data.tbBillList); |
| | | that.sendPrintMessage(json.data.tbBillList); |
| | | |
| | | that.$refs.barcode.focus(); |
| | | that.getModel(); |
| | | |
| | | } |
| | | else { |
| | | that.$playSound('error'); |
| | | that.$toast.fail(json.message); |
| | | that.$playSound('error'); |
| | | } |
| | | that.isLoading = false; |
| | | }) |