| | |
| | | <uni-easyinput type="text" placeholder="è¯·æ«ææçæ¡ç " ref='midInput' :focus="!focus" |
| | | v-model="barcode" @confirm="barcodeInput" /> |
| | | </uni-forms-item> |
| | | |
| | | <uni-forms-item label="å
ç®±æ ç¾:"> |
| | | <uni-easyinput type="text" placeholder="è¯·æ«æç®±å·ï¼å¦BOX202510160019ï¼" ref='midInput' :focus="focus" |
| | | v-model="materSn" @confirm="snInput" /> |
| | | </uni-forms-item> |
| | | |
| | | <uni-forms-item :label="Testlabel" v-if="Test"> |
| | | <uni-easyinput type="text" :placeholder="Testplaceholder" ref='midInput' |
| | |
| | | <view class="itemstyle"> |
| | | <uni-forms label-width="180"> |
| | | <uni-forms-item label="å
ç®±æ ç¾:"> |
| | | <uni-easyinput type="text" placeholder="è¯·æ«æç®±å·ï¼å¦BOX202510160019ï¼" ref='midInput' |
| | | :focus="!pkfocus" v-model="pkmaterSn" @confirm="pksnInput" /> |
| | | <uni-easyinput type="text" placeholder="è¯·æ«æç®±å·ï¼å¦BOX202510160019ï¼" ref='midInput' :focus="!pkfocus" |
| | | v-model="pkmaterSn" @confirm="pksnInput" /> |
| | | </uni-forms-item> |
| | | |
| | | <uni-forms-item> |
| | |
| | | this.getData(); |
| | | }, |
| | | methods: { |
| | | |
| | | // ç»ç页æ°éç¼è¾æ ¡éª |
| | | handleQuantityChange(item) { |
| | | item.quantity = item.quantity ? Math.max(1, parseInt(item.quantity)) : 1; |
| | | }, |
| | | |
| | | // å
¥å¹³åºé¡µæ°éç¼è¾æ ¡éª |
| | | handlePkQuantityChange(item) { |
| | | item.quantity = item.quantity ? Math.max(1, parseInt(item.quantity)) : 1; |
| | | }, |
| | | |
| | | updateFocus() { |
| | | this.$nextTick(() => { |
| | | this.materSn = ''; |
| | |
| | | if (this.barcode.length > 0) { |
| | | this.focus = true; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ç»çé¡µç®±å·æ«æ |
| | | snInput() { |
| | | this.$nextTick(() => { |
| | | if (!this.materSn) return; |
| | | |
| | | // å»¶è¿100msç¡®ä¿æ«ç 宿 |
| | | setTimeout(() => { |
| | | this.focus = false; |
| | | let boxNumber = this.materSn.trim(); |
| | | |
| | | // æ ¡éªæ¯å¦å·²æ«æè¿ |
| | | const isAlreadyScanned = this.sns.some(sn => sn === boxNumber); |
| | | if (isAlreadyScanned) { |
| | | this.$refs.uToast.show({ |
| | | title: "该箱å·å·²æ«æï¼è¯·å¿é夿«æ", |
| | | type: "warning" |
| | | }); |
| | | this.materSn = ""; |
| | | return; |
| | | } |
| | | |
| | | // ç®åæ ¡éªç®±å·æ ¼å¼ï¼ä»¥BOXå¼å¤´ï¼ |
| | | if (!boxNumber.startsWith('BOX')) { |
| | | this.$refs.uToast.show({ |
| | | title: "ç®±å·æ ¼å¼é误ï¼åºä»¥BOXå¼å¤´", |
| | | type: "error" |
| | | }); |
| | | this.materSn = ""; |
| | | return; |
| | | } |
| | | |
| | | // æ·»å ç®±å·å°å表 |
| | | const boxData = { |
| | | boxNumber: boxNumber, |
| | | quantity: 1, // é»è®¤æ°é为1 |
| | | serialNumber: boxNumber // ç®±å·ä½ä¸ºåºåå· |
| | | }; |
| | | |
| | | this.sns.push(boxNumber); |
| | | this.matInfos.push(boxData); |
| | | |
| | | this.$refs.uToast.show({ |
| | | title: "ç®±å·æ·»å æå", |
| | | type: "success" |
| | | }); |
| | | |
| | | this.materSn = ""; |
| | | }, 100); |
| | | }) |
| | | }, |
| | | |
| | | // å
¥å¹³åºé¡µç®±å·æ«æ |
| | | pksnInput() { |
| | | this.$nextTick(() => { |
| | | if (!this.pkmaterSn) return; |
| | | |
| | | // å»¶è¿100msç¡®ä¿æ«ç 宿 |
| | | setTimeout(() => { |
| | | let boxNumber = this.pkmaterSn.trim(); |
| | | |
| | | // ç®åæ ¡éªç®±å·æ ¼å¼ï¼ä»¥BOXå¼å¤´ï¼ |
| | | if (!boxNumber.startsWith('BOX')) { |
| | | this.$refs.uToast.show({ |
| | | title: "ç®±å·æ ¼å¼é误ï¼åºä»¥BOXå¼å¤´", |
| | | type: "error" |
| | | }); |
| | | this.pkmaterSn = ""; |
| | | return; |
| | | } |
| | | |
| | | // æ·»å ç®±å·å°å表 |
| | | const boxData = { |
| | | boxNumber: boxNumber, |
| | | quantity: 1, // é»è®¤æ°é为1 |
| | | serialNumber: boxNumber // ç®±å·ä½ä¸ºåºåå· |
| | | }; |
| | | |
| | | this.pksns.push(boxNumber); |
| | | this.pkmatInfos.push(boxData); |
| | | |
| | | this.$refs.uToast.show({ |
| | | title: "ç®±å·æ·»å æå", |
| | | type: "success" |
| | | }); |
| | | |
| | | this.pkmaterSn = ""; |
| | | }, 100); |
| | | }) |
| | | }, |
| | | |
| | |
| | | } |
| | | }, |
| | | |
| | | resetInPk() { |
| | | this.pkmaterSn = ""; |
| | | this.pkfocus = false; |
| | | this.pkmatInfos = []; |
| | | this.pksns = []; |
| | | }, |
| | | |
| | | pksubmit() { |
| | | if (this.pkmatInfos.length == 0) { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«æç®±å·", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | |
| | | // 使ç¨ç®±å·æ°æ®æäº¤ |
| | | 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: "å
¥åºæå", |
| | | type: "success" |
| | | }) |
| | | this.pkfocus = false; |
| | | this.pkmatInfos = []; |
| | | this.pksns = []; |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | submit() { |
| | | if (this.barcode == "") { |
| | |
| | | }) |
| | | return; |
| | | } |
| | | if (this.matInfos.length == 0) { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«æç®±å·", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | if (this.Test) { |
| | | if (!this.Testcheck) { |
| | | this.Testcheck = true; |
| | | if (this.warehouseId == 2) { |
| | | this.$refs.uToast.show({ |
| | | title: "请确认æ°é", |
| | | type: 'error' |
| | | }) |
| | | } else if (this.warehouseId == 6) { |
| | | this.$refs.uToast.show({ |
| | | title: "请确认åå§å¯¿å½", |
| | | type: 'error' |
| | | }) |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // 使ç¨ç®±å·æ°æ®æäº¤ |
| | | 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++) { |
| | | submitSns.push({ |
| | | ...firstItem |
| | | }); |
| | | } |
| | | } |
| | | |
| | | this.$u.post('/api/InboundOrder/CPMaterielGroup', { |
| | | MainData: { |
| | | "palletCode": this.barcode, |
| | | "orderNo": this.orderNo, |
| | | "initiallife": this.Initiallife, |
| | | "warehouseId": this.warehouseId |
| | | }, |
| | | DelKeys: submitSns |
| | | }).then(res => { |
| | | this.Testcheck = false; |
| | | if (res.status) { |