| | |
| | | <uni-forms label-width="120"> |
| | | <uni-forms-item label="æçæ¡ç "> |
| | | <uni-easyinput type="text" :focus="!istrue" v-model="barcode" placeholder="è¯·æ«ææçæ¡ç " |
| | | ref='midInput' @confirm="inputChangebarcode()" /> |
| | | ref='midInput' @confirm="inputChangebarcode" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="å®çæ°é"> |
| | | <uni-easyinput type="number" v-model="num" placeholder="请è¾å
¥å®çæ°é" ref='midInput' /> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | // const SixUniTts = uni.requireNativePlugin("SmallSix-SixUniTts") |
| | | export default { |
| | | data() { |
| | | return { |
| | | items: ['çç¹', 'å
¥åº'],//'æ£éç»ç', |
| | | items: ['çç¹'], |
| | | current: 0, |
| | | isPicking: false, |
| | | istrue: false, |
| | | barcode: '', |
| | | materialsns: "", |
| | | boxBarcodes: [], |
| | | sns: [], |
| | | barcodefocus: true, |
| | | totalNum: 0, |
| | | pickNum: 0, |
| | | num: null, |
| | | orderTotalNum: 0, |
| | | orderPickNum: 0, |
| | | orderNo: "", |
| | | matTotal: [], |
| | | istrue2: false, |
| | | barcode2: '', |
| | | Summmary:0, |
| | | innerboxcode: "", |
| | | takeStockObj:null, |
| | | sns2: [], |
| | | barcodefocus: true, |
| | | addressFocus: false, |
| | | inboundBarcode: "", |
| | | address: "", |
| | | addressdisabled: false, |
| | | warehouseId:"", |
| | | Summmary: 0, |
| | | stockInfoDetail:[] |
| | | } |
| | | }, |
| | | onLoad(res) { |
| | | this.barcodefocus = false; |
| | | this.istrue = false; |
| | | this.warehouseId = res.warehouseId; |
| | | this.orderNo=res.orderNo; |
| | | if (this.warehouseId == 3) { //æ¿æä»åºåºID |
| | | if (this.warehouseId == 3) { |
| | | this.address = "1011"; |
| | | this.addressdisabled = true; |
| | | } |
| | |
| | | this.$u.post('/api/Task/RequestInboundTask', postData).then(res => { |
| | | if (res.status) { |
| | | this.inboundBarcode = ""; |
| | | if (this.warehouseId !== 3) //æ¿æä»åºåºID |
| | | { |
| | | if (this.warehouseId !== 3) { |
| | | this.address = ""; |
| | | } |
| | | this.Summmary=0; |
| | |
| | | }, |
| | | inputChangebarcode3() { |
| | | this.addressFocus = false; |
| | | this.$nextTick(function(x) { |
| | | if (this.inboundBarcode != '') { |
| | | setTimeout(() => { |
| | | if (this.inboundBarcode) { |
| | | this.addressFocus = true; |
| | | } |
| | | }) |
| | | this.$nextTick(function(x) { |
| | | if (this.inboundBarcode != '') { |
| | | var postData = { |
| | | MainData: { |
| | | "barcode": this.inboundBarcode, |
| | |
| | | } |
| | | }; |
| | | this.$u.post('/api/StockInfo/StockQueryData', postData).then(res => { |
| | | // this.stockInfo = []; |
| | | this.stockInfoDetail = []; |
| | | this.Summmary=0; |
| | | if (res.status) { |
| | | // this.stockInfo = res.data, |
| | | this.stockInfoDetail = res.data.details |
| | | //è·åæ»æ°é |
| | | this.stockInfoDetail.forEach(item => { |
| | | this.Summmary += item.stockQuantity; |
| | | }); |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | // title: "æªæ¾å°æçä¿¡æ¯", |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, 1000); |
| | | }, |
| | | picking() { |
| | | if (this.barcode == "") { |
| | | if (!this.barcode) { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«ææçæ¡ç ", |
| | | type: "error" |
| | |
| | | }) |
| | | return; |
| | | } |
| | | if(this.takeStockObj==null){ |
| | | if (!this.takeStockObj) { |
| | | this.$refs.uToast.show({ |
| | | title: "çç¹ä¿¡æ¯ä¸ºç©º", |
| | | type: "error" |
| | |
| | | } |
| | | }) |
| | | }, |
| | | inputChange(e) { |
| | | this.$nextTick(() => { |
| | | this.istrue = false; |
| | | var matInfo = this.materialsns.split('|'); |
| | | if (matInfo.length == 7) { |
| | | var matObj = { |
| | | matCode: matInfo[1], |
| | | matProductionDate: matInfo[3], |
| | | matQty: matInfo[5], |
| | | orderNo: matInfo[6], |
| | | sn: this.materialsns, |
| | | isPicking: this.isPicking |
| | | } |
| | | var temp = this.boxBarcodes.find(x => x.orderNo == matObj.orderNo); |
| | | if (!temp) { |
| | | var tmp = this.matTotal.find(x => x.matCode == matObj.matCode); |
| | | if (!tmp) { |
| | | this.matTotal.push({ |
| | | matCode: matObj.matCode, |
| | | matQuantity: parseInt(matObj.matQty) |
| | | }) |
| | | } else { |
| | | tmp.matQuantity += parseInt(matObj.matQty); |
| | | } |
| | | this.sns.push({ |
| | | innerboxcode: this.materialsns, |
| | | isSplit: this.isPicking |
| | | }); |
| | | this.boxBarcodes.push(matObj); |
| | | this.isPicking = false; |
| | | setTimeout(this.updateFocus, 100); |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: "æ«ç éå¤", |
| | | type: "error" |
| | | }) |
| | | setTimeout(this.updateFocus, 100); |
| | | } |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: "æ«ç é误,è¯·æ«ææ£ç¡®å
ç®±ç ", |
| | | type: "error" |
| | | }) |
| | | setTimeout(this.updateFocus, 100); |
| | | } |
| | | }) |
| | | }, |
| | | checkedClick() { |
| | | this.isPicking = !this.isPicking; |
| | | this.istrue = false; |
| | | this.$nextTick(function(x) { |
| | | if (this.barcode != '') { |
| | | this.istrue = true; |
| | | } |
| | | }) |
| | | }, |
| | | updateFocus() { |
| | | this.materialsns = ''; |
| | | if (!this.istrue) { |
| | | this.istrue = true; |
| | | } |
| | | }, |
| | | inputChangebarcode() { |
| | | this.istrue = false; |
| | | this.$nextTick(function(x) { |
| | | if (this.barcode != '') { |
| | | setTimeout(() => { |
| | | if (this.barcode) { |
| | | this.istrue = true; |
| | | var postData = { |
| | | MainData: { |
| | | "orderNo": this.orderNo, |
| | |
| | | }; |
| | | this.$u.post('/api/TakeStockOrder/GetTakeDetailInfo', postData).then(res => { |
| | | if (res.status) { |
| | | this.takeStockObj=null; |
| | | this.takeStockObj= res.data; |
| | | } else { |
| | | this.barcode=""; |
| | |
| | | }) |
| | | } |
| | | }) |
| | | this.istrue = true; |
| | | } |
| | | }) |
| | | }, |
| | | deleteList(res) { |
| | | this.matTotal.map((item, index) => { |
| | | var temp = this.boxBarcodes.find(x => x.sn == res); |
| | | if (temp) { |
| | | if (item.matCode == temp.matCode) { |
| | | if (item.matQuantity - temp.matQty == 0) { |
| | | this.matTotal.splice(index, 1); |
| | | } else { |
| | | item.matQuantity -= temp.matQty; |
| | | }, 1000); |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | this.sns.map((item, index) => { |
| | | if (item.innerboxcode == res) { |
| | | this.sns.splice(index, 1); |
| | | } |
| | | }) |
| | | this.boxBarcodes.map((item, index) => { |
| | | if (item.sn == res) { |
| | | this.boxBarcodes.splice(index, 1); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | submit() { |
| | | if (this.barcode2 == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«ææçæ¡ç ", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | if (this.innerboxcode == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«æå
ç®±æ ç¾", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | this.$u.post('/api/StockOperate/PickingBoxing', { |
| | | MainData: { |
| | | "barcode": this.barcode2, |
| | | "innerboxcode": this.innerboxcode |
| | | }, |
| | | DelKeys: this.sns2 |
| | | }).then(res => { |
| | | if (res.status) { |
| | | uni.$showMsg('ç»çæå!') |
| | | this.barcode2 = ""; |
| | | this.innerboxcode = ""; |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }).catch(err => { |
| | | this.$refs.uToast.show({ |
| | | title: err.message, |
| | | type: "error" |
| | | }) |
| | | }) |
| | | }, |
| | | inputChange2(e) { |
| | | |
| | | }, |
| | | inputChangebarcode2() { |
| | | this.istrue2 = false; |
| | | this.$nextTick(function(x) { |
| | | if (this.barcode2 != '') { |
| | | this.istrue2 = true; |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |