| ¶Ô±ÈÐÂÎļþ |
| | |
| | | var vm = new Vue({ |
| | | el: '#app', |
| | | data: function () { |
| | | return { |
| | | isLoading: false, |
| | | userInfo: { |
| | | "loginGuid": '', |
| | | "loginAccount": '', |
| | | }, |
| | | itemNo: "", |
| | | num: "", |
| | | fum: "", |
| | | billNo: "", |
| | | barcode:"", |
| | | |
| | | ItemBlDetail: [], // å¾
æ« |
| | | ItemYsDetail: [], // å·²æ« |
| | | ItemDetail: [], |
| | | ItemBarKw: [], |
| | | currentIndex: -1, |
| | | |
| | | modeInfo: [], |
| | | active: 0, |
| | | show: false, |
| | | actions: [], |
| | | ItemDetail: [], |
| | | scanInfo: { barcodeNum: "", splitNum: "", barcode: "" }, |
| | | sectionCode:"", |
| | | } |
| | | }, |
| | | mounted() { |
| | | var that = this; |
| | | this.userInfo = { |
| | | loginGuid: this.GetLoginInfor().loginGuid, |
| | | loginAccount: this.GetLoginInfor().loginAccount, |
| | | }; |
| | | }, |
| | | 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(); |
| | | //this.active = 1; //èªå¨åæ¢å°åºä½å表tab |
| | | }, |
| | | GetBarKwByItem() { |
| | | |
| | | var that = this; |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'Womdaa/GetBarKwByItemCK', { |
| | | itemId: that.selItem.itemid, |
| | | userName: that.userInfo.loginAccount, |
| | | type: 'DBCK',//è°æ¨åºåº |
| | | billNo: that.billNo |
| | | }, 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 = []; |
| | | }); |
| | | }, |
| | | getInfo() { |
| | | this.show = true; |
| | | |
| | | var that = this; |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'TransferOut/GetTransferOutNoList', { |
| | | //name: that.userInfo.loginAccount, |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | |
| | | if (json.data.tbBillList.length == 0) { |
| | | that.$toast.fail("æ²¡ææ¾å°å¯ä»¥éæ©çåºåºåå·"); |
| | | } |
| | | |
| | | that.actions = json.data.tbBillList.map(item => { |
| | | return { name: item } |
| | | }); |
| | | } |
| | | else { |
| | | that.$toast.fail(json.message); |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("ç½ç»é误ï¼è¯·éè¯ï¼"); |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | onClick(index, title) { |
| | | this.$toast(`${index} ${title}`); |
| | | //this.$notify({ type: 'success', message: 'ææç©ææ«ç æåææç©ææ«ç æåææç©ææ«ç æåææç©ææ«ç æå' }); |
| | | |
| | | }, |
| | | onSelect(item) { |
| | | // é»è®¤æ
åµä¸ç¹å»é项æ¶ä¸ä¼èªå¨æ¶èµ· |
| | | // å¯ä»¥éè¿ close-on-click-action 屿§å¼å¯èªå¨æ¶èµ· |
| | | this.show = false; |
| | | |
| | | this.billNo = item.name; |
| | | // æ¸
空åºä½å表 |
| | | this.ItemBarKw = []; |
| | | this.GetMesItemBlDetailByBillNo(); |
| | | //this.$toast(item.name); |
| | | |
| | | }, |
| | | GetMesItemBlDetailByBillNo() { |
| | | var that = this; |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'TransferOut/GetTransferOutDetailListByBillNo', { |
| | | billNo: that.billNo |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | //that.ItemDetail = json.data.tbBillList; |
| | | var tbBillList = json.data.tbBillList || {}; |
| | | that.ItemBlDetail = tbBillList.blDetails || []; // å¾
æ« |
| | | that.ItemYsDetail = tbBillList.ysDetails || []; // å·²æ« |
| | | that.$refs.barcode.focus(); |
| | | that.barcode = ""; |
| | | var firstItemInKw = tbBillList.allList[0].inKw; |
| | | if (firstItemInKw !== null && firstItemInKw !== '') { |
| | | that.sectionCode = firstItemInKw; |
| | | } |
| | | // éç½®åºä½æ¥è¯¢ä¸ææè¡çéä¸ç¶æ |
| | | that.currentIndex = -1; |
| | | that.ItemBarKw = []; |
| | | } |
| | | else { |
| | | that.$toast.fail(json.message); |
| | | that.$refs.billNo.focus(); |
| | | that.billNo = ""; |
| | | that.ItemDetail = null; |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("ç½ç»é误ï¼è¯·éè¯ï¼"); |
| | | that.$refs.billNo.focus(); |
| | | that.billNo = ""; |
| | | that.ItemBlDetail = null; |
| | | //console.log(error); |
| | | }); |
| | | }, |
| | | getScan() { |
| | | |
| | | //this.barcode = value; |
| | | |
| | | var that = this; |
| | | that.isLoading = true; |
| | | |
| | | if (!that.userInfo.loginAccount) { |
| | | this.$toast.fail("è¯·éæ°æ£æ¥ç»å½ç¶æ"); |
| | | that.isLoading = false; |
| | | return; |
| | | } |
| | | |
| | | if (!that.barcode) { |
| | | this.$toast.fail("æ¡ç ä¸è½ä¸ºç©º"); |
| | | that.isLoading = false; |
| | | return; |
| | | } |
| | | |
| | | if (!that.billNo) { |
| | | this.$toast.fail("ç³è¯·åå·ä¸è½ä¸ºç©º"); |
| | | that.isLoading = false; |
| | | return; |
| | | } |
| | | |
| | | that.AxiosHttp("post", 'TransferOut/ScanYjdb', { |
| | | userName: that.userInfo.loginAccount, |
| | | barcode: that.barcode, |
| | | billNo: that.billNo, |
| | | sectionCode: that.sectionCode, |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | |
| | | //that.itemNo = json.data.tbBillList.itemNo; |
| | | ////that.num = json.data.form.num; |
| | | ////that.fum = json.data.form.fum; |
| | | //that.ItemBlDetail = json.data.items |
| | | that.$notify({ type: 'success', message: 'æ«ç æå' }); |
| | | that.$toast.success("æ«ææå"); |
| | | that.$refs.barcode.focus(); |
| | | that.barcode = ""; |
| | | //that.GetMesItemBlDetailByBillNo(); |
| | | that.GetMesItemBlDetailByBillNo(); |
| | | } |
| | | else if (json.status == 2) { |
| | | that.itemNo = json.data.tbBillList.itemNo; |
| | | that.$refs.splitNum.focus(); |
| | | that.scanInfo.splitNum = json.data.tbBillList.splitNum; |
| | | that.scanInfo.barcodeNum = json.data.tbBillList.barcodeNum; |
| | | } |
| | | else { |
| | | that.$toast.fail(json.message); |
| | | that.$refs.barcode.focus(); |
| | | that.barcode = ""; |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("ç½ç»é误ï¼è¯·éè¯ï¼"); |
| | | //console.log(error); |
| | | that.$refs.barcode.focus(); |
| | | that.barcode = ""; |
| | | }); |
| | | }, |
| | | getChaiFen() { |
| | | //this.isPrinterPopupVisible = true; // æ¾ç¤ºå¼¹çª |
| | | |
| | | if (this.isLoading) { |
| | | return; |
| | | } |
| | | |
| | | var that = this; |
| | | if (that.billNo.length <= 0) { |
| | | that.$toast.fail("ç³è¯·åå·ä¸è½ä¸ºç©ºï¼"); |
| | | return; |
| | | } |
| | | if (that.scanInfo.splitNum * 1 <= 0) { |
| | | that.$toast.fail("æåæ°éä¸è½ä¸ºç©ºï¼"); |
| | | return; |
| | | } |
| | | if (that.barcode.length * 1 <= 0) { |
| | | that.$toast.fail("ç©ææ¡ç ä¸è½ä¸ºç©ºï¼"); |
| | | return; |
| | | } |
| | | //that.ip = ""; |
| | | //that.prot = ""; |
| | | //that.getPrintInfo(); |
| | | |
| | | //if (that.ip.length <= 0 || that.prot.length <= 0) { |
| | | // alert(that.ip); |
| | | // alert(that.prot); |
| | | // return; |
| | | //} |
| | | |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'TransferOut/ScanYjdbCF', { |
| | | daa001: that.billNo, |
| | | userName: that.userInfo.loginAccount, |
| | | barcode: that.barcode, |
| | | Num: that.scanInfo.splitNum, |
| | | sectionCode: that.sectionCode, |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | // that.modeInfo = json.data.tbBillList; |
| | | that.scanInfo.splitNum = null; |
| | | that.scanInfo.barcodeNum = null; |
| | | that.scanInfo.barcode = null; |
| | | that.$notify({ type: 'success', message: json.message }); |
| | | that.$playSound('success'); |
| | | |
| | | that.sendPrintMessage(json.data.tbBillList); |
| | | |
| | | that.$refs.barcode.focus(); |
| | | that.barcode = ""; |
| | | //that.GetMesItemBlDetailByBillNo(); |
| | | that.GetMesItemBlDetailByBillNo(); |
| | | } |
| | | else { |
| | | that.$toast.fail(json.message); |
| | | that.$playSound('error'); |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("ç½ç»é误ï¼è¯·éè¯ï¼"); |
| | | that.$playSound('error'); |
| | | }); |
| | | }, |
| | | getKwInfo() { |
| | | var that = this; |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'MesDepotSections/GetSectionName', { |
| | | sectionCode: that.sectionCode |
| | | }, false) |
| | | .then(function (res) { |
| | | var json = res; |
| | | if (json.status == 0) { |
| | | that.depotData = json.data.tbBillList; |
| | | that.$refs.barcode.focus(); |
| | | } |
| | | else { |
| | | that.$toast.fail(json.message); |
| | | that.$playSound('error'); |
| | | that.depotData = []; |
| | | that.sectionCode = ""; |
| | | } |
| | | that.isLoading = false; |
| | | }) |
| | | .catch(function (error) { |
| | | that.isLoading = false; |
| | | that.$toast.fail("ç½ç»é误ï¼è¯·éè¯ï¼"); |
| | | that.$playSound('error'); |
| | | that.depotData = []; |
| | | that.sectionCode = ""; |
| | | that.$refs.sectionCode.focus(); |
| | | }); |
| | | }, |
| | | } |
| | | }) |