| ¶Ô±ÈÐÂÎļþ |
| | |
| | | var vm = new Vue({ |
| | | el: '#app', |
| | | data: function () { |
| | | return { |
| | | isLoading: false, |
| | | userInfo: { |
| | | "loginGuid": '', |
| | | "loginAccount": '', |
| | | }, |
| | | scanFormData: { |
| | | itemOutNo: "", |
| | | barcode: "", |
| | | itemNo: "", |
| | | quantity:0 |
| | | }, |
| | | formData: {}, |
| | | ItemDetail: [], |
| | | codeTableData: [], |
| | | itemOutNoList: [], |
| | | itemOutNoStr: [], |
| | | invItemOutId: '', |
| | | |
| | | barMessage: "", |
| | | |
| | | Message: "", |
| | | messageCenter: {}, |
| | | messageId: 0, |
| | | |
| | | show: false, |
| | | } |
| | | }, |
| | | mounted() { |
| | | var that = this; |
| | | this.userInfo = { |
| | | loginGuid: this.GetLoginInfor().loginGuid, |
| | | loginAccount: this.GetLoginInfor().loginAccount, |
| | | }; |
| | | that.beginload(); |
| | | //that.show = false; |
| | | }, |
| | | methods: { |
| | | getItemOutNo() { |
| | | var that = this; |
| | | |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'MesSctk/GetMesSctkSq', { |
| | | }, 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; |
| | | } |
| | | else { |
| | | that.$toast.fail(json.message); |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("ç½ç»é误ï¼è¯·éè¯ï¼"); |
| | | console.log(error); |
| | | }); |
| | | |
| | | }, |
| | | beginload() { |
| | | var that = this; |
| | | |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'MesSctk/GetMesSctkSq', { |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | that.itemOutNoList = json.data.tbBillList; |
| | | } |
| | | else { |
| | | that.$toast.fail(json.message); |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("ç½ç»é误ï¼è¯·éè¯ï¼"); |
| | | console.log(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.getItem(); |
| | | |
| | | //var that = this; |
| | | |
| | | //that.isLoading = true; |
| | | //that.AxiosHttp("post", 'MesInvItemOuts/GetPage', { |
| | | // billNo: this.scanFormData.itemOutNo, |
| | | // pageIndex: 1, |
| | | // limit: 1, |
| | | //}, false) |
| | | // .then(function (res) { |
| | | // var json = res; |
| | | // if (json.status == 0) { |
| | | // that.formData = json.data.tbBillList[0]; |
| | | // that.formData.billTypeName = "åºåºå"; |
| | | |
| | | // that.getScanBarcode(); |
| | | // } |
| | | // else { |
| | | // that.$toast.fail(json.message); |
| | | // } |
| | | // that.isLoading = false; |
| | | // }) |
| | | // .catch(function (error) { |
| | | // that.isLoading = false; |
| | | // that.$toast.fail("ç½ç»é误ï¼è¯·éè¯ï¼"); |
| | | // console.log(error); |
| | | // }); |
| | | |
| | | }, |
| | | 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", 'MesSctk/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.$refs.barcode.focus(); |
| | | } |
| | | else { |
| | | that.$toast.fail(json.message); |
| | | that.ItemDetail = []; |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("ç½ç»é误ï¼è¯·éè¯ï¼"); |
| | | that.ItemDetail = []; |
| | | }); |
| | | }, |
| | | |
| | | SaveBarCodes() { |
| | | |
| | | //if (!this.scanFormData.barcode) { |
| | | |
| | | //} |
| | | var that = this; |
| | | |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'MesSctk/ScanCode', { |
| | | billNo: that.scanFormData.itemOutNo, |
| | | userName: that.userInfo.loginAccount, |
| | | barcode: that.scanFormData.barcode, |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | //if (json.data.tbBillList) { |
| | | // //this.ToErp(); |
| | | //} else { |
| | | |
| | | //} |
| | | that.scanFormData.quantity = json.data.tbBillList.barcodeNum |
| | | that.getItem(); |
| | | that.$refs.barcode.focus(); |
| | | that.scanFormData.barcode = null; |
| | | } |
| | | else { |
| | | that.$toast.fail(json.message); |
| | | that.$refs.barcode.focus(); |
| | | that.scanFormData.barcode = null; |
| | | } |
| | | that.$notify({ type: 'success', message: json.message }); |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("ç½ç»é误ï¼è¯·éè¯ï¼"); |
| | | console.log(error); |
| | | that.$refs.barcode.focus(); |
| | | }); |
| | | } |
| | | } |
| | | }) |