| ¶Ô±ÈÐÂÎļþ |
| | |
| | | var vm = new Vue({ |
| | | el: '#app', |
| | | data: function () { |
| | | return { |
| | | isLoading: false, |
| | | userInfo: { |
| | | "loginGuid": '', |
| | | "loginAccount": '', |
| | | }, |
| | | num:"", |
| | | sectionCode:"", |
| | | selectKey: "", |
| | | barcode:"", |
| | | ItemBlDetail:[], |
| | | modeInfo: [], |
| | | active: 0, |
| | | show: false, |
| | | actions: [], |
| | | barInfo: [], |
| | | depotsInfo: "",//ä»åºä¿¡æ¯ |
| | | orgInfo: "",//ç»ç»ä¿¡æ¯ |
| | | orgID: "",//ç»ç»id |
| | | itemInfo: [],//æ»ç©æä¿¡æ¯ |
| | | itemNo:"",//éä¸ç©æç¼ç |
| | | printItemInfo: [],//éä¸ç©æä¿¡æ¯ |
| | | |
| | | } |
| | | }, |
| | | mounted() { |
| | | var that = this; |
| | | this.userInfo = { |
| | | loginGuid: this.GetLoginInfor().loginGuid, |
| | | loginAccount: this.GetLoginInfor().loginAccount, |
| | | }; |
| | | }, |
| | | methods: { |
| | | getInfo() { |
| | | this.show = true; |
| | | |
| | | var that = this; |
| | | |
| | | if (!that.sectionCode) { |
| | | this.$toast.fail("åºä½ç¼ç ä¸è½ä¸ºç©º"); |
| | | that.isLoading = false; |
| | | return; |
| | | } |
| | | |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'Inventory/GetItemsList', { |
| | | selectKey: that.selectKey, |
| | | orgId: that.orgID, |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | |
| | | if (json.data.tbBillList.length <= 0) { |
| | | that.$toast.fail("没æå¯ç¨çæ°æ®"); |
| | | } else { |
| | | that.itemInfo = json.data.tbBillList; |
| | | that.actions = json.data.tbBillList.map(item => { |
| | | return { |
| | | name: item.wlInfo // æ¼æ¥å段 |
| | | |
| | | }; |
| | | }); |
| | | } |
| | | } |
| | | 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; |
| | | |
| | | if (item.name.includes('---')) { |
| | | this.itemNo = item.name.split('---')[0]; |
| | | } else { |
| | | // å¤ç没æåé符çæ
åµï¼æ¯å¦è®¾ç½®ä¸ºç©ºæè
åå符串 |
| | | this.itemNo = item.name; // æè
'' |
| | | } |
| | | this.GetMesItemByItemNo(); |
| | | //this.$toast(item.name); |
| | | |
| | | }, |
| | | GetMesItemByItemNo() { |
| | | var that = this; |
| | | // è·åå¹é
ç»ææ°ç» |
| | | const filtered = that.itemInfo.filter(item => |
| | | item.item_no === that.itemNo |
| | | ); |
| | | |
| | | if (filtered.length === 0) { |
| | | that.$toast.fail('æ²¡ææ¾å°å¹é
çç©æä¿¡æ¯'); |
| | | that.printItemInfo = {}; // æ¸
ç©ºæ°æ® |
| | | } else { |
| | | // å第ä¸ä¸ªå¹é
项èµå¼ç»å¯¹è±¡ |
| | | that.printItemInfo = filtered[0]; |
| | | //console.log('å±ç¤ºæ°æ®ï¼', that.printItemInfo); |
| | | that.$refs.num.focus(); |
| | | } |
| | | }, |
| | | getSectionCode() { |
| | | var that = this; |
| | | |
| | | if (!that.sectionCode) { |
| | | this.$toast.fail("åºä½ç¼ç ä¸è½ä¸ºç©º"); |
| | | that.isLoading = false; |
| | | return; |
| | | } |
| | | // æ£æ¥å¯¹è±¡æ¯å¦å
å«æææ°æ® |
| | | if (!that.printItemInfo || !that.printItemInfo.item_no) { |
| | | that.$toast.fail("请å
éæ©ææç©æä¿¡æ¯"); |
| | | that.isLoading = false; |
| | | return; |
| | | } |
| | | |
| | | that.AxiosHttp("post", 'Inventory/GetDepoptsInfo', { |
| | | sectionCode: that.sectionCode |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | |
| | | } |
| | | else { |
| | | |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("ç½ç»é误ï¼è¯·éè¯ï¼"); |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | } |
| | | }) |