| | |
| | | "loginGuid": '', |
| | | "loginAccount": '', |
| | | }, |
| | | sms: "", |
| | | num:"", |
| | | billNo:"", |
| | | splitNum: "", |
| | | num: "", |
| | | type: "", |
| | | billNo: "", |
| | | selectType: "", |
| | | daa001: "", |
| | | barcode:"", |
| | | barcode: "", |
| | | ItemBlDetail:[], |
| | | modeInfo: [], |
| | | queryInfo: { dateTime: "", lineNo: "", lineName: "" }, |
| | | active: 0, |
| | | show: false, |
| | | show1:false, |
| | | actions: [], |
| | | actions1: [], |
| | | ItemDetail: [], |
| | | minDate: new Date(new Date().getFullYear() - 1, 0, 1), // 过去一年 |
| | | maxDate: new Date(new Date().getFullYear() + 1, 11, 31), // 未来一年 |
| | | showScDatePicker: false, |
| | | tempDate: new Date(), |
| | | showDatePicker: false, |
| | | ItemBarKw: [], |
| | | currentIndex: -1, |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | loginGuid: this.GetLoginInfor().loginGuid, |
| | | loginAccount: this.GetLoginInfor().loginAccount, |
| | | }; |
| | | this.type = this.Request("type"); |
| | | selectType = this.type == "bl" ? selectType = "生产补料" : selectType = "生产超领"; |
| | | }, |
| | | methods: { |
| | | 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() { |
| | | |
| | | var that = this; |
| | | that.isLoading = true; |
| | | 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 = []; |
| | | }); |
| | | }, |
| | | formatDate(date) { |
| | | const d = new Date(date); |
| | | console.log(d); |
| | | return `${d.getFullYear()}-${(d.getMonth() + 1).toString().padStart(2, '0')}-${d.getDate().toString().padStart(2, '0')}`; |
| | | }, |
| | | onDateConfirm(date) { |
| | | this.queryInfo.dateTime = this.formatDate(date); |
| | | this.showDatePicker = false; |
| | | }, |
| | | getInfo() { |
| | | this.show = true; |
| | | |
| | | var that = this; |
| | | that.isLoading = true; |
| | | |
| | | that.AxiosHttp("post", 'MesItemBl/GetSCBLBillNo', { |
| | | type: "生产补料", |
| | | type: selectType, |
| | | dateTime: that.queryInfo.dateTime, |
| | | lineNo: that.queryInfo.lineNo |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | onClick(index, title) { |
| | | this.$toast(`${index} ${title}`); |
| | | this.$notify({ type: 'success', message: '某某物料扫码成功某某物料扫码成功某某物料扫码成功某某物料扫码成功' }); |
| | | |
| | | }, |
| | | onSelect(item) { |
| | | // 默认情况下点击选项时不会自动收起 |
| | | // 可以通过 close-on-click-action 属性开启自动收起 |
| | |
| | | //this.$toast(item.name); |
| | | |
| | | }, |
| | | onSelect1(actions1) { |
| | | this.queryInfo.lineNo = actions1.lineNo; |
| | | this.show1 = false; |
| | | this.queryInfo.lineName = actions1.name; |
| | | }, |
| | | GetMesItemBlDetailByBillNo() { |
| | | var that = this; |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'MesItemBl/GetMesItemBlDetailByBillNo', { |
| | | billNo: that.billNo, |
| | | type: "生产补料" |
| | | type: selectType |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | that.ItemBlDetail = json.data.tbBillList.item2; |
| | | that.daa001 = json.data.tbBillList.item1; |
| | | that.ItemDetail = json.data.tbBillList; |
| | | that.daa001 = json.data.tbBillList.daa001; |
| | | console.log(json.data.tbBillList.daa001); |
| | | console.log(json.data.tbBillList.items); |
| | | that.$refs.barcode.focus(); |
| | | that.currentIndex = -1; |
| | | that.ItemBarKw = []; |
| | | } |
| | | else { |
| | | that.$toast.fail(json.message); |
| | | that.$refs.billNo.focus(); |
| | | that.billNo = ""; |
| | | that.daa001 = ""; |
| | | that.ItemBlDetail = []; |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("网络错误,请重试!"); |
| | | console.log(error); |
| | | //console.log(error); |
| | | tthat.$refs.billNo.focus(); |
| | | that.billNo = ""; |
| | | that.daa001 = ""; |
| | | that.ItemBlDetail = []; |
| | | }); |
| | | }, |
| | | getBarcode(value) { |
| | | |
| | | this.barcode = value; |
| | | getLineInfo() { |
| | | var that = this; |
| | | that.show1 = true; |
| | | that.actions = []; |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'MesItemBl/GetLineInfo', { |
| | | selectLine: that.selectLine |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | console.log(json); |
| | | if (json.status == 0 && json.data.tbLineInfo.length > 0) { |
| | | that.actions1 = json.data.tbLineInfo.map(item => ({ |
| | | name: item.lineName, |
| | | lineNo: item.lineNo |
| | | })); |
| | | } else { |
| | | that.$toast.fail("没有可用的数据"); |
| | | that.$playSound('error'); |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function () { |
| | | that.isLoading = false; |
| | | that.$toast.fail("网络错误,请重试!"); |
| | | that.$playSound('error'); |
| | | }); |
| | | }, |
| | | getBarcode() { |
| | | // 添加防抖判断 |
| | | if (this.isLoading) { |
| | | return; |
| | | } |
| | | |
| | | //this.barcode = value; |
| | | |
| | | var that = this; |
| | | that.isLoading = true; |
| | |
| | | userName: that.userInfo.loginAccount, |
| | | barcode: that.barcode, |
| | | blNo: that.billNo, |
| | | billNo: that.daa001 |
| | | billNo: that.daa001, |
| | | type: selectType |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | |
| | | //that.ItemBlDetail = json.data.tbBillList.item2 |
| | | that.$notify({ type: 'success', message: '扫描成功' }); |
| | | that.GetMesItemBlDetailByBillNo(); |
| | | that.$refs.barcode.focus(); |
| | | that.barcode = ""; |
| | | that.num = ""; |
| | | that.splitNum = ""; |
| | | |
| | | |
| | | } else if (json.status == 2) { |
| | | that.$refs.splitNum.focus(); |
| | | that.scanInfo.splitNum = json.data.tbBillList.splitNum; |
| | | that.scanInfo.barcodeNum = json.data.tbBillList.barcodeNum; |
| | | that.splitNum = json.data.cfNum; |
| | | that.num = json.data.num; |
| | | } |
| | | else { |
| | | that.$toast.fail(json.message); |
| | | that.$refs.barcode.focus(); |
| | | that.barcode = ""; |
| | | that.num = ""; |
| | | that.splitNum = ""; |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("网络错误,请重试!"); |
| | | console.log(error); |
| | | //console.log(error); |
| | | that.$refs.barcode.focus(); |
| | | that.barcode = ""; |
| | | that.num = ""; |
| | | that.splitNum = ""; |
| | | }); |
| | | }, |
| | | tmcf() { |
| | |
| | | return; |
| | | } |
| | | |
| | | if (!that.sms) { |
| | | if (!that.splitNum) { |
| | | this.$toast.fail("发货数量不能为空"); |
| | | that.isLoading = false; |
| | | return; |
| | |
| | | barcode: that.barcode, |
| | | blNo: that.billNo, |
| | | billNo: that.daa001, |
| | | num: that.sms |
| | | num: that.splitNum, |
| | | type: selectType |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | that.ItemBlDetail = json.data.pendingList; |
| | | that.$notify({ type: 'success', message: '扫描成功' }); |
| | | that.barcode = ""; |
| | | that.num = ""; |
| | | that.splitNum = ""; |
| | | that.$notify({ type: 'success', message: json.message }); |
| | | that.$playSound('success'); |
| | | that.GetMesItemBlDetailByBillNo(); |
| | | //that.sendMessage(json.data.tbBillList); |
| | | that.sendPrintMessage(json.data.tbBillList); |
| | | |
| | | that.$refs.barcode.focus(); |
| | | } |
| | | else { |
| | | that.$toast.fail(json.message); |
| | | that.$refs.barcode.focus(); |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("网络错误,请重试!"); |
| | | console.log(error); |
| | | //console.log(error); |
| | | that.$refs.barcode.focus(); |
| | | that.barcode = ""; |
| | | that.num = ""; |
| | | that.splitNum = ""; |
| | | }); |
| | | } |
| | | } |