| | |
| | | v-model="Initiallife" /> |
| | | </uni-forms-item> |
| | | |
| | | <!-- <uni-forms-item> |
| | | <checkbox checked="check">æ¯å¦æ»¡ç</checkbox> |
| | | </uni-forms-item> --> |
| | | <uni-forms-item> |
| | | <view style="display: flex;justify-content: space-around;margin-top: 2%;"> |
| | | <button @click="reset" type="default" size="default" |
| | |
| | | </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> |
| | | <!-- ç´æ¥ç¼è¾Qå¼å¯¹åºçquantityåæ®µ --> |
| | | <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.quantity" |
| | | @input="handleQuantityChange(item)" |
| | | /> |
| | | </view> |
| | | <view class="uni-note">çäº§æ¥æï¼{{item.productionDate}}</view> |
| | | <view class="uni-note">æææï¼{{item.effectiveDate}}</view> |
| | | <view class="uni-note">交货åå·ï¼{{item.deliveryNote}}</view> |
| | |
| | | <view style="font-size: 18px;">åæ®å·ï¼{{orderNo}}</view> |
| | | <view style="font-size: 18px;">ç©æç¼ç ï¼{{item.materielCode}}</view> |
| | | <view>ç©æåç§°ï¼{{item.materielName}}</view> |
| | | <!-- <view>ç©æè§æ ¼ï¼{{item.materielSpec}}</view> --> |
| | | <!-- <view style="font-size: 18px;">ç©æåç§°ï¼{{item.matName}}</view> --> |
| | | <view style="font-size: 18px;">æ°éï¼{{item.orderQuantity}}</view> |
| | | <view style="font-size: 18px;">ç»çæ°éï¼{{item.receiptQuantity}}</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> |
| | | <!-- ç´æ¥ç¼è¾Qå¼å¯¹åºçquantityåæ®µ --> |
| | | <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.quantity" |
| | | @input="handlePkQuantityChange(item)" |
| | | /> |
| | | </view> |
| | | <view class="uni-note">çäº§æ¥æï¼{{item.productionDate}}</view> |
| | | <view class="uni-note">æææï¼{{item.effectiveDate}}</view> |
| | | <view class="uni-note">交货åå·ï¼{{item.deliveryNote}}</view> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | items: ['ç»ç', 'å
¥åº', 'åæ®ä¿¡æ¯'], //, 'è§£ç' |
| | | items: ['ç»ç', 'å
¥åº', 'åæ®ä¿¡æ¯'], |
| | | current: 0, |
| | | matTotal: [], |
| | | matInfos: [], |
| | |
| | | this.getData(); |
| | | }, |
| | | methods: { |
| | | // voiceSpeech(src) { |
| | | // innerAudioContext.src = src; // '../../static/success.mp3'; |
| | | // innerAudioContext.play(); |
| | | // }, |
| | | // ç»ç页æ°éç¼è¾æ ¡éªï¼ç´æ¥ä¿®æ¹åçquantityåæ®µï¼ |
| | | handleQuantityChange(item) { |
| | | item.quantity = item.quantity ? Math.max(1, parseInt(item.quantity)) : 1; |
| | | }, |
| | | |
| | | // å
¥å¹³åºé¡µæ°éç¼è¾æ ¡éªï¼ç´æ¥ä¿®æ¹åçquantityåæ®µï¼ |
| | | handlePkQuantityChange(item) { |
| | | item.quantity = item.quantity ? Math.max(1, parseInt(item.quantity)) : 1; |
| | | }, |
| | | |
| | | 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" |
| | | // }) |
| | | // } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ç»ç页å
ç®±ç è§£æï¼ç´æ¥æä½åçquantityåæ®µï¼ |
| | | snInput() { |
| | | this.$nextTick(() => { |
| | | if (this.materSn != "") { |
| | | if (!this.materSn) return; |
| | | |
| | | // å»¶è¿100msç¡®ä¿æ«ç 宿 |
| | | setTimeout(() => { |
| | | this.focus = false; |
| | | var matSn = this.materSn; |
| | | let matSn = this.materSn.trim(); |
| | | |
| | | // ä»åº11çç¹æ®å¤ç |
| | | if (this.warehouseId == 11) { |
| | | matSn = matSn.replace(/,SC.*/, ''); |
| | | } |
| | | //æ¥è¯¢matSnæ¯å¦åå¨å符 |
| | | if(matSn.indexOf("PO")>0){ |
| | | |
| | | // æ ¡éªå
ç®±ç 宿´æ§ |
| | | const requiredFields = ['M:', 'BS:', 'DM:', 'DE:', 'Q:', 'PO:', 'DN:']; |
| | | const hasAllFields = requiredFields.every(field => matSn.includes(field)); |
| | | if (!hasAllFields) { |
| | | this.$refs.uToast.show({ |
| | | title: "å
ç®±ç ä¸å®æ´ï¼è¯·éæ°æ«æ", |
| | | type: "error" |
| | | }); |
| | | this.materSn = ""; |
| | | return; |
| | | } |
| | | |
| | | // æ ¡éªPOåæ®µå卿§ |
| | | if (matSn.indexOf("PO") <= 0) { |
| | | this.$refs.uToast.show({ |
| | | title: "å
ç®±ç æ ¼å¼éè¯¯ï¼æ POæ è¯ï¼", |
| | | type: "error" |
| | | }); |
| | | this.materSn = ""; |
| | | return; |
| | | } |
| | | |
| | | // è§£æå
ç®±ç ï¼ç´æ¥ä½¿ç¨è¿åçquantityä½ä¸ºQå¼ï¼ |
| | | this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => { |
| | | this.Testcheck = false; |
| | | if (res.status) { |
| | | this.sns.push(res.data.serialNumber); |
| | | |
| | | this.matInfos.push(res.data); |
| | | |
| | | if (res.message) { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | // setTimeout(() => { |
| | | // this.voiceSpeech('../../static/fail.mp3'); |
| | | // }, 100); |
| | | return; |
| | | type: "warning" |
| | | }); |
| | | } |
| | | // setTimeout(() => { |
| | | // this.voiceSpeech('../../static/success.mp3'); |
| | | // }, 100); |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | // setTimeout(() => { |
| | | // this.voiceSpeech('../../static/fail.mp3'); |
| | | // }, 100); |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | setTimeout(() => { |
| | | }); |
| | | |
| | | this.materSn = ""; |
| | | }, 100); |
| | | } |
| | | }, 1000); |
| | | }) |
| | | }, |
| | | |
| | | // å
¥å¹³åºé¡µå
ç®±ç è§£æï¼ç´æ¥æä½åçquantityåæ®µï¼ |
| | | pksnInput() { |
| | | this.$nextTick(() => { |
| | | if (this.pkmaterSn != "") { |
| | | if (!this.pkmaterSn) return; |
| | | |
| | | var matSn = this.pkmaterSn; |
| | | // å»¶è¿100msç¡®ä¿æ«ç 宿 |
| | | setTimeout(() => { |
| | | let matSn = this.pkmaterSn.trim(); |
| | | |
| | | if(matSn.indexOf("PO")>0){ |
| | | // æ ¡éªå
ç®±ç 宿´æ§ |
| | | const requiredFields = ['M:', 'BS:', 'DM:', 'DE:', 'Q:', 'PO:', 'DN:']; |
| | | const hasAllFields = requiredFields.every(field => matSn.includes(field)); |
| | | if (!hasAllFields) { |
| | | this.$refs.uToast.show({ |
| | | title: "å
ç®±ç ä¸å®æ´ï¼è¯·éæ°æ«æ", |
| | | type: "error" |
| | | }); |
| | | this.pkmaterSn = ""; |
| | | return; |
| | | } |
| | | |
| | | // æ ¡éªPOåæ®µå卿§ |
| | | if (matSn.indexOf("PO") <= 0) { |
| | | this.$refs.uToast.show({ |
| | | title: "å
ç®±ç æ ¼å¼éè¯¯ï¼æ POæ è¯ï¼", |
| | | type: "error" |
| | | }); |
| | | this.pkmaterSn = ""; |
| | | return; |
| | | } |
| | | |
| | | // è§£æå
ç®±ç ï¼ç´æ¥ä½¿ç¨è¿åçquantityä½ä¸ºQå¼ï¼ |
| | | 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.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | // setTimeout(() => { |
| | | // this.voiceSpeech('../../static/fail.mp3'); |
| | | // }, 100); |
| | | return; |
| | | } |
| | | // setTimeout(() => { |
| | | // this.voiceSpeech('../../static/success.mp3'); |
| | | // }, 100); |
| | | return; |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | // setTimeout(() => { |
| | | // this.voiceSpeech('../../static/fail.mp3'); |
| | | // }, 100); |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | setTimeout(() => { |
| | | }); |
| | | |
| | | this.pkmaterSn = ""; |
| | | }, 100); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | inbound() { |
| | | if (this.inboundBarcode == "") { |
| | | this.$refs.uToast.show({ |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | inputChangebarcode() { |
| | | this.addressFocus = false; |
| | | this.$nextTick(function(x) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | deleteList(res) { |
| | | this.matInfos.splice(res, 1); |
| | | this.sns.splice(res, 1); |
| | | }, |
| | | |
| | | pkdeleteList(res) { |
| | | this.pkmatInfos.splice(res, 1); |
| | | this.pksns.splice(res, 1); |
| | | }, |
| | | |
| | | reset() { |
| | | this.barcode = ""; |
| | | this.matInfos = []; |
| | | this.sns = []; |
| | | this.materSn = ""; |
| | | if (this.warehouseId = !6) { |
| | | if (this.warehouseId != 6) { |
| | | this.Initiallife = 0; |
| | | } |
| | | }, |
| | | |
| | | resetInPk() { |
| | | this.pkmaterSn = ""; |
| | | this.pkfocus = false; |
| | | this.pkmatInfos = []; |
| | | this.pksns = []; |
| | | }, |
| | | |
| | | pksubmit() { |
| | | if (this.pkmatInfos.length == 0) { |
| | | this.$refs.uToast.show({ |
| | |
| | | }) |
| | | return; |
| | | } |
| | | this.$u.post('/api/InboundOrder/InPinKu?warehouseId=' + this.warehouseId + "&orderNo=" + this.orderNo, this |
| | | .pksns).then(res => { |
| | | |
| | | // ç´æ¥ä½¿ç¨ä¿®æ¹åçquantityï¼å¯¹åºQå¼ï¼æäº¤ |
| | | const submitData = this.pkmatInfos.map(item => ({ |
| | | serialNumber: item.serialNumber, |
| | | quantity: item.quantity |
| | | })); |
| | | |
| | | this.$u.post('/api/InboundOrder/InPinKu?warehouseId=' + this.warehouseId + "&orderNo=" + this.orderNo, submitData) |
| | | .then(res => { |
| | | if (res.status) { |
| | | this.$refs.uToast.show({ |
| | | title: "å
¥åºæå", |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | submit() { |
| | | if (this.barcode == "") { |
| | | this.$refs.uToast.show({ |
| | |
| | | return; |
| | | } |
| | | } |
| | | if (this.warehouseId == 2) { //油墨ä»åºåºID |
| | | this.sn = this.sns[0]; |
| | | |
| | | // ç´æ¥ä½¿ç¨ä¿®æ¹åçquantityï¼å¯¹åºQå¼ï¼æäº¤ |
| | | let submitSns = this.matInfos.map(item => ({ |
| | | serialNumber: item.serialNumber, |
| | | quantity: item.quantity |
| | | })); |
| | | |
| | | // 油墨ä»åºç¹æ®å¤ç |
| | | if (this.warehouseId == 2) { |
| | | const firstItem = submitSns[0]; |
| | | for (var i = 0; i < this.Initiallife - 1; i++) { |
| | | this.sns.push(this.sn); |
| | | submitSns.push({...firstItem}); |
| | | } |
| | | } |
| | | |
| | | this.$u.post('/api/InboundOrder/MaterielGroup', { |
| | | MainData: { |
| | | "palletCode": this.barcode, |
| | | "orderNo": this.orderNo, |
| | | "initiallife": this.Initiallife, |
| | | // "isFull": this.check |
| | | "warehouseId": this.warehouseId |
| | | }, |
| | | DelKeys: this.sns |
| | | DelKeys: submitSns |
| | | }).then(res => { |
| | | this.Testcheck = false; |
| | | if (res.status) { |
| | |
| | | this.matInfos = []; |
| | | this.sns = []; |
| | | this.matTotal = []; |
| | | if (this.warehouseId != 6) { //æµè¯æ¶ä»åºåºID |
| | | if (this.warehouseId != 6) { |
| | | this.Initiallife = ""; |
| | | } |
| | | } else { |
| | |
| | | width: 90%; |
| | | } |
| | | </style> |
| | | |