| | |
| | | <view style="padding: 5%;"> |
| | | <uni-forms label-width="120"> |
| | | <uni-forms-item label="æçç¼ç "> |
| | | <uni-easyinput type="text" :focus="!istrue" v-model="PalletCode1" placeholder="请è¾å
¥æçç¼ç " |
| | | ref='midInput' /> |
| | | <uni-easyinput type="text" :focus="barcodeFocus" v-model="PalletCode1" placeholder="请è¾å
¥æçç¼ç " |
| | | ref='midInput' @input="Changebarcode()"/> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="å
¥åºèµ·ç¹"> |
| | | <uni-easyinput type="text" :focus="istrue" v-model="SourceAddress" placeholder="请è¾å
¥å
¥åºèµ·ç¹" |
| | | <uni-easyinput type="text" :focus="addressFocus" v-model="SourceAddress" placeholder="请è¾å
¥å
¥åºèµ·ç¹" |
| | | ref='midInput' /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="å
¥åºç»ç¹"> |
| | | <!-- <uni-forms-item label="å
¥åºç»ç¹"> |
| | | <uni-easyinput type="text" :focus="istrue" v-model="TargetAddress" placeholder="请è¾å
¥å
¥åºç»ç¹" |
| | | ref='midInput' /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="ç» ç¹ åº å"> |
| | | </uni-forms-item> --> |
| | | <uni-forms-item label="ç»ç¹åºå"> |
| | | <uni-data-select :focus="!istrue" v-model="AreaId" :localdata="range" |
| | | placeholder="请è¾éæ©å
¥åºç»ç¹åºå"></uni-data-select> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | <button @click="InboundTask" type="primary" size="default" style="margin-top: 2%;">å
¥åº</button> |
| | | <u-toast ref="InboundTaskluToast" /> |
| | | |
| | | </view> |
| | | </view> |
| | | <view v-show="current === 1"> |
| | |
| | | <uni-easyinput type="text" placeholder="è¯·æ«æå¤ç®±æ ç¾" ref='midInput' :focus="focus" v-model="materSn" |
| | | @input="snInput" /> |
| | | </uni-forms-item> |
| | | <uni-list> |
| | | <!-- <uni-list-item direction="column" v-for="item in InBoundOrder" :key="item.matCode"> |
| | | <template v-slot:body> |
| | | <view class="uni-list-box"> |
| | | <view class="uni-content"> |
| | | <view class="uni-title-sub uni-ellipsis-2">订åå¯ä¸ç¼ç ï¼{{item.orderNo}}</view> |
| | | </view> |
| | | <view v-if="group.length" class="scan-result"> |
| | | <uni-card v-for="(item, index) in group" :key="item.orderNo"> |
| | | <view class="info-grid"> |
| | | <view class="info-row"> |
| | | <text class="label">订åç¼ç ï¼</text> |
| | | <text>{{ item.orderNo }}</text> |
| | | </view> |
| | | </template> |
| | | </uni-list-item> --> |
| | | <uni-list-item direction="column" v-for="(item,index) in InBoundOrder" :key="item.sn"> |
| | | <template v-slot:body> |
| | | <view class="uni-list-box"> |
| | | <uni-icons type="trash" size="22" style="position: absolute;right: 5%;" |
| | | @click="deleteList(item.orderNo)"> |
| | | </uni-icons> |
| | | <view class="uni-content"> |
| | | <view class="uni-title-sub uni-ellipsis-2">订åå·ï¼{{item.orderNo}}</view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | </uni-list-item> |
| | | </uni-list> |
| | | <br> |
| | | <view class="info-row"> |
| | | <text class="label">ä»åºåç§°ï¼</text> |
| | | <text>{{ item.warehouseName }}</text> |
| | | </view><br> |
| | | <view class="info-row"> |
| | | <text class="label">ç©æç¼ç ï¼</text> |
| | | <text>{{ item.materialNo }}</text> |
| | | </view><br> |
| | | <uni-forms-item label="ç»çæ°é"> |
| | | <uni-easyinput v-model="item.quantity" type="number" /> |
| | | </uni-forms-item> |
| | | </view> |
| | | <uni-icons type="trash" class="delete-icon" @click="removeScanItem(item.orderNo)" /> |
| | | </uni-card> |
| | | </view> |
| | | </uni-forms> |
| | | <button @click="OutboundTask" type="primary" size="default" style="margin-top: 2%;">ç»ç</button> |
| | | <u-toast ref="OutboundTaskluToast" /> |
| | | <button @click="GroupPlate" type="primary" size="default" style="margin-top: 2%;">ç»ç</button> |
| | | </view> |
| | | </view> |
| | | <view v-show="current === 2"> |
| | |
| | | placeholder="请è¾å
¥æçç¼ç " ref='midInput' /> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | <button @click="OutboundTask" type="primary" size="default" style="margin-top: 2%;">è§£ç</button> |
| | | <u-toast ref="OutboundTaskluToast" /> |
| | | <button @click="SolvePlate" type="primary" size="default" style="margin-top: 2%;">è§£ç</button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <u-toast ref="luToast" /> |
| | | </view> |
| | | </template> |
| | | |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | barcodeFocus:true, |
| | | focus: false, |
| | | istrue: false, |
| | | addressFocus:false, |
| | | barcodefocus: false, |
| | | range: [], |
| | | AreaId: "", |
| | | group: [], |
| | | AreaId: 0, |
| | | quantity: "", |
| | | SourceAddress: "", |
| | | TargetAddress: "", |
| | | PalletCode1: "", |
| | | PalletCode2: "", |
| | | PalletCode3: "", |
| | | materSn: "", |
| | | InBoundOrder: [], |
| | | items: ['å
¥åº', 'ç»ç', 'è§£ç'], |
| | | current: 0 |
| | | } |
| | |
| | | this.current = e.currentIndex; |
| | | } |
| | | }, |
| | | voiceSpeech(src) { |
| | | innerAudioContext.src = src; // '../../static/success.mp3'; |
| | | innerAudioContext.play(); |
| | | }, |
| | | InboundTask() { |
| | | if (this.PalletCode.length <= 0 && this.Point.length) { |
| | | this.$refs.InboundTaskluToast.show({ |
| | | if (this.PalletCode1.length <= 0 && this.SourceAddress.length) { |
| | | this.$refs.luToast.show({ |
| | | title: "æçç¼ç è·ç»å®è´§ä½ä¸è½ä¸ºç©º", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | var param = { |
| | | "PalletCode": this.PalletCode, |
| | | "PalletCode": this.PalletCode1, |
| | | "Position": this.SourceAddress, |
| | | "TargetAddress": this.TargetAddress |
| | | "TargetAddress": this.TargetAddress, |
| | | "AreaId": this.AreaId, |
| | | } |
| | | console.log(param); |
| | | this.$u.post('/api/Task/RequestTaskAsync', param).then(res => { |
| | | this.$u.post('/api/Task/RequestInboundTaskAsync', param).then(res => { |
| | | if (res.status) { |
| | | this.$refs.InboundTaskluToast.show({ |
| | | this.$refs.luToast.show({ |
| | | title: res.message, |
| | | type: "success" |
| | | }) |
| | | this.PalletCode = ""; |
| | | this.PalletCode1 = ""; |
| | | this.SourceAddress = ""; |
| | | this.TargetAddress = ""; |
| | | this.AreaId = ""; |
| | | this.istrue = false; |
| | | } else { |
| | | this.$refs.InboundTaskluToast.show({ |
| | | this.$refs.luToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | OutboundTask() { |
| | | if (this.EndAddress.length <= 0 && this.Barcode.length) { |
| | | this.$refs.OutboundTaskluToast.show({ |
| | | GroupPlate() { |
| | | if (this.PalletCode2.length <= 0 && this.InBoundOrder.length) { |
| | | this.$refs.luToast.show({ |
| | | title: "请è¾å
¥èµ·ç¹ç«å°", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | var param = { |
| | | "PalletCode": this.Barcode, |
| | | "Position": this.StartAddress, |
| | | "TargetAddress": this.EndAddress |
| | | "PalletCode": this.PalletCode2, |
| | | "groups": this.group |
| | | } |
| | | this.$u.post('/api/Task/RequestOutTaskAsync', param).then(res => { |
| | | this.$u.post('/api/BoxingInfo/AddGroupPlateAsync', param).then(res => { |
| | | if (res.status) { |
| | | this.$refs.OutboundTaskluToast.show({ |
| | | this.$refs.luToast.show({ |
| | | title: res.message, |
| | | type: "success" |
| | | }) |
| | | this.Barcode = ""; |
| | | this.EndAddress = ""; |
| | | this.StartAddress = ""; |
| | | this.PalletCode2 = ""; |
| | | this.group = []; |
| | | this.barcodefocus = false; |
| | | } else { |
| | | this.$refs.OutboundTaskluToast.show({ |
| | | this.$refs.luToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | SolvePlate() { |
| | | if (this.PalletCode3.length <= 0) { |
| | | this.$refs.luToast.show({ |
| | | title: "请è¾å
¥æçæ¡ç ", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | var param = { |
| | | "PalletCode": this.PalletCode3, |
| | | } |
| | | this.$u.post('/api/BoxingInfo/DeleteGroupPlateAsync', param).then(res => { |
| | | if (res.status) { |
| | | this.$refs.luToast.show({ |
| | | title: res.message, |
| | | type: "success" |
| | | }) |
| | | this.PalletCode3 = ""; |
| | | this.barcodefocus = false; |
| | | } else { |
| | | this.$refs.luToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | updateFocus() { |
| | | this.$nextTick(() => { |
| | | this.materSn = ''; |
| | | if (!this.focus) { |
| | | this.focus = true; |
| | | } |
| | | }); |
| | | }, |
| | | snInput() { |
| | | this.$nextTick(() => { |
| | | var matObj = { |
| | | orderNo: this.materSn, |
| | | } |
| | | var temp = this.InBoundOrder.find(x => x.orderNo == matObj.orderNo); |
| | | console.log(temp) |
| | | var temp = this.group.find(x => x.orderNo == matObj.orderNo); |
| | | if (!temp) { |
| | | this.InBoundOrder.push(matObj); |
| | | setTimeout(this.updateFocus, 200); |
| | | setTimeout(() => { |
| | | this.voiceSpeech('../../static/success.mp3'); |
| | | }, 100); |
| | | this.$u.post('/api/InboundOrder/GetInboundOrderInfo?orderNo=' + this.materSn, "").then( |
| | | res => { |
| | | if (res.status) { |
| | | this.group.push(res.data); |
| | | setTimeout(this.updateFocus, 200); |
| | | setTimeout(() => { |
| | | this.voiceSpeech('../../static/success.mp3'); |
| | | }, 100); |
| | | } else { |
| | | this.$refs.luToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | this.$refs.luToast.show({ |
| | | title: "æ«ç éå¤", |
| | | type: "error" |
| | | }) |
| | |
| | | |
| | | }) |
| | | }, |
| | | // deleteList(res) { |
| | | // this.matInfos.map((item, index) => { |
| | | // if (item.orderNo == res) { |
| | | // this.matInfos.splice(index, 1); |
| | | |
| | | // } |
| | | // }) |
| | | // this.orderNo.map((item, index) => { |
| | | // if (item == res) { |
| | | // this.orderNo.splice(index, 1); |
| | | // } |
| | | // }) |
| | | // }, |
| | | deleteList(res) { |
| | | // å é¤matInfosä¸orderNoå¹é
项 |
| | | this.matInfos = this.matInfos.filter(item => item.orderNo !== res); |
| | | |
| | | // å é¤orderNoä¸å¹é
项 |
| | | this.orderNo = this.orderNo.filter(item => item !== res); |
| | | |
| | | // å¯éï¼æ·»å å é¤åé¦ |
| | | this.$refs.uToast.show({ |
| | | title: `å·²å é¤: ${res}`, |
| | | type: "success" |
| | | }); |
| | | } |
| | | Changebarcode() { |
| | | this.barcodeFocus = false; |
| | | this.$nextTick(function(x) { |
| | | if (this.PalletCode1 != '') { |
| | | this.addressFocus = true; |
| | | } |
| | | }) |
| | | }, |
| | | inputChangebarcode() { |
| | | this.$nextTick(() => { |
| | | this.$u.post('/api/BoxingInfo/GetPalletCodeInfo?palletCode=' + this.PalletCode2, "").then( |
| | | res => { |
| | | if (res.status) { |
| | | this.group = res.data; |
| | | console.log(this.group); |
| | | setTimeout(this.updateFocus, 200); |
| | | setTimeout(() => { |
| | | this.voiceSpeech('../../static/success.mp3'); |
| | | }, 100); |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | removeScanItem(orderNo) { |
| | | this.group = this.group.filter(item => item.orderNo !== orderNo); |
| | | } |
| | | } |
| | | } |
| | | </script> |