| | |
| | | <uni-easyinput type="text" :placeholder="Testplaceholder" ref='midInput' |
| | | v-model="Initiallife" /> |
| | | </uni-forms-item> |
| | | <!-- <uni-forms-item> |
| | | <checkbox checked="check">æ¯å¦æ»¡ç</checkbox> |
| | | </uni-forms-item> --> |
| | | <uni-forms-item> |
| | | <button @click="submit" type="primary" size="default" style="margin-top: 2%;">ç»ç</button> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | <uni-list> |
| | | <!-- <uni-list-item direction="column" v-for="item in matTotal" :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.matCode}}</view> |
| | | <view class="uni-title-sub uni-ellipsis-2">æ°éï¼{{item.matQuantity}}</view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | </uni-list-item> --> |
| | | <uni-list-item direction="column" v-for="(item,index) in matInfos" :key="index"> |
| | | <template v-slot:body> |
| | | <view class="uni-list-box"> |
| | |
| | | <view class="uni-title-sub uni-ellipsis-2">éè´åå·ï¼{{item.purchaseOrderNo}}</view> |
| | | <view class="uni-note">ç©æç¼ç ï¼{{item.materielCode}}</view> |
| | | <view class="uni-note">æ¹æ¬¡å·ï¼{{item.lotNo}}</view> |
| | | <view class="uni-note">æ°éï¼{{item.quantity}}</view> |
| | | <!-- æ°éç¼è¾æ¡ --> |
| | | <view class="uni-note" style="display: flex; align-items: center; gap: 10rpx;"> |
| | | æ°éï¼ |
| | | <uni-easyinput |
| | | type="number" |
| | | min="1" |
| | | style="width: 150rpx; display: inline-block;" |
| | | v-model="item.editableQuantity" |
| | | @input="handleQuantityChange(item)" |
| | | /> |
| | | </view> |
| | | <view class="uni-note">çäº§æ¥æï¼{{item.productionDate}}</view> |
| | | <view class="uni-note">æææï¼{{item.effectiveDate}}</view> |
| | | </view> |
| | |
| | | <view class="uni-title-sub uni-ellipsis-2">éè´åå·ï¼{{item.purchaseOrderNo}}</view> |
| | | <view class="uni-note">ç©æç¼ç ï¼{{item.materielCode}}</view> |
| | | <view class="uni-note">æ¹æ¬¡å·ï¼{{item.lotNo}}</view> |
| | | <view class="uni-note">æ°éï¼{{item.quantity}}</view> |
| | | <!-- æ°éç¼è¾æ¡ --> |
| | | <view class="uni-note" style="display: flex; align-items: center; gap: 10rpx;"> |
| | | æ°éï¼ |
| | | <uni-easyinput |
| | | type="number" |
| | | min="1" |
| | | style="width: 150rpx; display: inline-block;" |
| | | v-model="item.editableQuantity" |
| | | @input="handlePkQuantityChange(item)" |
| | | /> |
| | | </view> |
| | | <view class="uni-note">çäº§æ¥æï¼{{item.productionDate}}</view> |
| | | <view class="uni-note">æææï¼{{item.effectiveDate}}</view> |
| | | </view> |
| | |
| | | this.getData(); |
| | | }, |
| | | methods: { |
| | | // voiceSpeech(src) { |
| | | // innerAudioContext.src = src; // '../../static/success.mp3'; |
| | | // innerAudioContext.play(); |
| | | // }, |
| | | // ç»ç页æ°éåæ´æ ¡éª |
| | | handleQuantityChange(item) { |
| | | // ç¡®ä¿æ°éä¸ºæ£æ´æ° |
| | | item.editableQuantity = item.editableQuantity ? Math.max(1, parseInt(item.editableQuantity)) : 1; |
| | | }, |
| | | |
| | | // å
¥å¹³åºé¡µæ°éåæ´æ ¡éª |
| | | handlePkQuantityChange(item) { |
| | | item.editableQuantity = item.editableQuantity ? Math.max(1, parseInt(item.editableQuantity)) : 1; |
| | | }, |
| | | |
| | | //wmså
¥å¹³åº |
| | | pksubmit() { |
| | | if (this.pkmatInfos.length == 0) { |
| | |
| | | }) |
| | | return; |
| | | } |
| | | this.$u.post('/api/InboundOrder/WMSInPinKu?warehouseId=' + this.warehouseId, this |
| | | .pksns).then(res => { |
| | | debugger |
| | | |
| | | // åå¤æäº¤æ°æ®ï¼å
å«ç¼è¾åçæ°é |
| | | const submitData = this.pkmatInfos.map(item => ({ |
| | | serialNumber: item.serialNumber, |
| | | quantity: item.editableQuantity |
| | | })); |
| | | |
| | | this.$u.post('/api/InboundOrder/WMSInPinKu?warehouseId=' + this.warehouseId, submitData).then(res => { |
| | | if (res.status) { |
| | | this.$refs.uToast.show({ |
| | | title: "å
¥åºæå", |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | pksnInput() { |
| | | this.$nextTick(() => { |
| | | if (this.pkmaterSn != "") { |
| | | this.focus = false; |
| | | var matSn = this.pkmaterSn; |
| | | if (!this.pkmaterSn) return; |
| | | |
| | | // å»¶è¿100msç¡®ä¿æ«ç 宿 |
| | | setTimeout(() => { |
| | | this.pkmaterSn = ""; |
| | | }, 10); |
| | | this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => { |
| | | if (res.status) { |
| | | this.pksns.push(res.data.serialNumber); |
| | | this.pkmatInfos.push(res.data); |
| | | if (!res.status) { |
| | | this.focus = false; |
| | | |
| | | // æ ¡éªå
ç®±ç 宿´æ§ |
| | | const requiredFields = ['M:', 'BS:', 'DM:', 'DE:', 'Q:', 'PO:', 'DN:']; |
| | | const hasAllFields = requiredFields.every(field => this.pkmaterSn.includes(field)); |
| | | if (!hasAllFields) { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | title: "å
ç®±ç ä¸å®æ´ï¼è¯·éæ°æ«æ", |
| | | type: "error" |
| | | }) |
| | | // setTimeout(() => { |
| | | // this.voiceSpeech('../../static/fail.mp3'); |
| | | // }, 100); |
| | | }); |
| | | this.pkmaterSn = ""; |
| | | return; |
| | | } |
| | | // setTimeout(() => { |
| | | // this.voiceSpeech('../../static/success.mp3'); |
| | | // }, 100); |
| | | return; |
| | | |
| | | const matSn = this.pkmaterSn; |
| | | this.pkmaterSn = ""; |
| | | |
| | | this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => { |
| | | if (res.status) { |
| | | // æ°å¢å¯ç¼è¾æ°éåæ®µ |
| | | const tempData = res.data; |
| | | tempData.editableQuantity = tempData.quantity; |
| | | |
| | | this.pksns.push(tempData.serialNumber); |
| | | this.pkmatInfos.push(tempData); |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | // setTimeout(() => { |
| | | // this.voiceSpeech('../../static/fail.mp3'); |
| | | // }, 100); |
| | | } |
| | | }) |
| | | } |
| | | }, 100); |
| | | }) |
| | | }, |
| | | |
| | | //è§£ç |
| | | releasebox() { |
| | | if (this.value.length == 0) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | releaseboxInput() { |
| | | this.$nextTick(() => { |
| | | if (this.value.length == 0) { |
| | |
| | | }, |
| | | |
| | | updateFocus() { |
| | | debugger |
| | | this.$nextTick(() => { |
| | | this.materSn = ''; |
| | | if (!this.focus) { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | barcodeFocus() { |
| | | debugger |
| | | this.barcode = ''; |
| | | if (this.focus) { |
| | | this.focus = false; |
| | | } |
| | | }, |
| | | |
| | | getData() { |
| | | var postData = { |
| | | MainData: { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | onClickItem(e) { |
| | | this.focus = false; |
| | | this.addressFocus = false; |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | barcodeInput() { |
| | | this.$nextTick(function(x) { |
| | | if (this.barcode.length > 0) { |
| | | // if (this.barcode.substring(0, 1) == 'A' || this.barcode.substring(0, 2) == 'TP') { |
| | | this.focus = true; |
| | | // } else { |
| | | // this.$refs.uToast.show({ |
| | | // title: "æ«ç é误,è¯·æ«ææçç ", |
| | | // type: "error" |
| | | // }) |
| | | // } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | snInput() { |
| | | this.$nextTick(() => { |
| | | if (!this.materSn) return; |
| | | |
| | | // å»¶è¿100msç¡®ä¿æ«ç 宿 |
| | | setTimeout(() => { |
| | | this.focus = false; |
| | | |
| | | // ä»åº11çç¹æ®å¤ç |
| | | if(this.warehouseId==11){ |
| | | this.materSn=this.materSn.replace(/,SC.*/, ''); |
| | | } |
| | | |
| | | // æ ¡éªå
ç®±ç 宿´æ§ |
| | | const requiredFields = ['M:', 'BS:', 'DM:', 'DE:', 'Q:', 'PO:', 'DN:']; |
| | | const hasAllFields = requiredFields.every(field => this.materSn.includes(field)); |
| | | if (!hasAllFields) { |
| | | this.$refs.uToast.show({ |
| | | title: "å
ç®±ç ä¸å®æ´ï¼è¯·éæ°æ«æ", |
| | | type: "error" |
| | | }); |
| | | this.materSn = ""; |
| | | return; |
| | | } |
| | | |
| | | // ä»åºç¹å®é»è¾ |
| | | if (this.warehouseId == 6 || this.warehouseId == 2 || this.warehouseId == 3) { |
| | | if (this.sns.length > 0) { |
| | | this.sns = []; |
| | | } |
| | | } |
| | | if (this.materSn != "") { |
| | | this.focus = false; |
| | | if(this.warehouseId==11){ |
| | | this.materSn=this.materSn.replace(/,SC.*/, ''); |
| | | } |
| | | if (this.materSn.split(',').length != 6) { |
| | | |
| | | const matSn = this.materSn; |
| | | this.materSn = ""; |
| | | return; |
| | | } |
| | | var matSn = this.materSn; |
| | | //setTimeout(() => { |
| | | this.materSn = ""; |
| | | //}, 10); |
| | | |
| | | this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => { |
| | | this.Testcheck = false; |
| | | if (res.status) { |
| | | this.sns.push(res.data.serialNumber); |
| | | if (this.warehouseId == 6 || this.warehouseId == 2 || this.warehouseId == |
| | | 3) { |
| | | // æ°å¢å¯ç¼è¾æ°éåæ®µ |
| | | const tempData = res.data; |
| | | tempData.editableQuantity = tempData.quantity; |
| | | |
| | | this.sns.push(tempData.serialNumber); |
| | | if (this.warehouseId == 6 || this.warehouseId == 2 || this.warehouseId == 3) { |
| | | if (this.matInfos.length > 0) { |
| | | this.matInfos = []; |
| | | } |
| | | } |
| | | this.matInfos.push(res.data); |
| | | if (!res.status) { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | // setTimeout(() => { |
| | | // this.voiceSpeech('../../static/fail.mp3'); |
| | | // }, 100); |
| | | return; |
| | | } |
| | | // setTimeout(() => { |
| | | // this.voiceSpeech('../../static/success.mp3'); |
| | | // }, 100); |
| | | this.matInfos.push(tempData); |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | // setTimeout(() => { |
| | | // this.voiceSpeech('../../static/fail.mp3'); |
| | | // }, 100); |
| | | } |
| | | }) |
| | | } |
| | | }, 100); |
| | | }) |
| | | }, |
| | | |
| | | inbound() { |
| | | if (this.inboundBarcode == "") { |
| | | this.$refs.uToast.show({ |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | inputChangebarcode() { |
| | | this.addressFocus = false; |
| | | this.$nextTick(function(x) { |
| | |
| | | } |
| | | }; |
| | | this.$u.post('/api/StockInfo/StockQueryData', postData).then(res => { |
| | | // this.stockInfo = []; |
| | | this.stockInfoDetail = []; |
| | | if (res.status) { |
| | | // this.stockInfo = res.data, |
| | | this.stockInfoDetail = res.data.details |
| | | //è·åæ»æ°é |
| | | this.Summmary = 0; |
| | | this.stockInfoDetail.forEach(item => { |
| | | this.Summmary += item.stockQuantity; |
| | | }); |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | // title: "æªæ¾å°æçä¿¡æ¯", |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | deleteList(res) { |
| | | this.matInfos.splice(res, 1); |
| | | this.sns.splice(res, 1); |
| | | }, |
| | | |
| | | pkdeleteList(res) { |
| | | this.pkmatInfos.splice(res, 1); |
| | | this.pksns.splice(res, 1); |
| | | }, |
| | | |
| | | submit() { |
| | | if (this.barcode == "") { |
| | | this.$refs.uToast.show({ |
| | |
| | | return; |
| | | } |
| | | } |
| | | if (this.warehouseId == 2) { //油墨ä»åºåºID |
| | | this.sn = this.sns[0]; |
| | | for (var i = 0; i < this.Initiallife - 1; i++) { |
| | | this.sns.push(this.sn); |
| | | } |
| | | } |
| | | let url = 'palletCode=' + this.barcode + '&initiallife=' + this.Initiallife + '&warehouseId=' + this |
| | | .warehouseId; |
| | | |
| | | this.$u.post('/api/InboundOrder/ManualMaterielGroup?' + url, this.sns).then(res => { |
| | | // åå¤æäº¤æ°æ®ï¼å
å«ç¼è¾åçæ°é |
| | | const submitSns = this.matInfos.map(item => ({ |
| | | serialNumber: item.serialNumber, |
| | | quantity: item.editableQuantity |
| | | })); |
| | | |
| | | if (this.warehouseId == 2) { //油墨ä»åºåºID |
| | | // ç¹æ®å¤çä¿æä¸åï¼ä½ä½¿ç¨ç¼è¾åçæ°é |
| | | const firstItem = this.matInfos[0]; |
| | | for (var i = 0; i < firstItem.editableQuantity - 1; i++) { |
| | | submitSns.push({ |
| | | serialNumber: firstItem.serialNumber, |
| | | quantity: 1 |
| | | }); |
| | | } |
| | | } |
| | | |
| | | let url = 'palletCode=' + this.barcode + '&initiallife=' + this.Initiallife + '&warehouseId=' + this.warehouseId; |
| | | |
| | | this.$u.post('/api/InboundOrder/ManualMaterielGroup?' + url, submitSns).then(res => { |
| | | this.Testcheck = false; |
| | | if (res.status) { |
| | | this.$refs.uToast.show({ |