| | |
| | | </uni-forms-item> |
| | | <uni-forms-item :label="order_qty"> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="å¾
æ«ç©æç¼ç :"> |
| | | <uni-easyinput type="text" placeholder="è¯·æ«æç©æç¼ç " ref='materialInput' |
| | | :focus="step === 1" v-model="materialCode" |
| | | @confirm="materialCodeInput" |
| | | @blur="materialCodeInput" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="åºä½ç¼å·:"> |
| | | <uni-easyinput type="text" placeholder="è¯·æ«æåºä½ç¼å·" ref='midInput' :focus="!focus" |
| | | <uni-easyinput type="text" placeholder="è¯·æ«æåºä½ç¼å·" ref='midInput' :focus="step === 2" |
| | | v-model="barcode" @confirm="barcodeInput" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="å®çæ°é:"> |
| | | <uni-easyinput type="text" placeholder="请è¾å
¥å®çæ°é" ref='midInput' :focus="focus" |
| | | <uni-easyinput type="text" placeholder="请è¾å
¥å®çæ°é" ref='midInput' :focus="step === 3" |
| | | v-model="materSn" @confirm="snInput" /> |
| | | </uni-forms-item> |
| | | |
| | |
| | | <view style="display: flex;justify-content: space-around;margin-top: 2%;"> |
| | | <!-- <button @click="reset" type="default" size="default" |
| | | style="width: 160rpx;border: 1rpx solid #007aff;color: #007aff;">éç½®</button> --> |
| | | <button @click="submit" type="primary" size="default" style="width: 200rpx;">çç¹å®æ</button> |
| | | <button @click="submit" type="primary" size="default" style="width: 250rpx;">çç¹å®æ</button> |
| | | </view> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | |
| | | Testcheck: false, |
| | | pkmaterSn: "", |
| | | pkmatInfos: [], |
| | | addressdisabled: false |
| | | addressdisabled: false, |
| | | materialCode: "", // æ°å¢ï¼æ«æçç©æç¼ç |
| | | materialCodeValid: false, // æ°å¢ï¼ç©æç¼ç éªè¯ç¶æ |
| | | step: 1, // æ°å¢ï¼1-ç©æç¼ç ï¼2-åºä½ç¼å·ï¼3-å
¥åºæ°é |
| | | } |
| | | }, |
| | | onShow() {}, |
| | |
| | | this.order_qty="è´¦é¢æ°éï¼"+res.stockQuantity; |
| | | this.order_Inqty="ç©æåç§°ï¼"+res.materielName; |
| | | this.goods_no="ç©æç¼å·ï¼"+res.materielCode; |
| | | this.materielCode = res.materielCode; // 设置ç¨äºéªè¯çç©æç¼ç |
| | | |
| | | // this.getData(); |
| | | }, |
| | | methods: { |
| | | // ç©æç¼ç éªè¯ |
| | | materialCodeInput() { |
| | | console.log("materialCodeInput 被触å"); |
| | | console.log("è¾å
¥å¼:", this.materialCode); |
| | | this.$nextTick(() => { |
| | | if (this.materialCode.trim() !== "") { |
| | | const scannedCode = this.materialCode.trim(); |
| | | const expectedCode = this.materielCode; |
| | | |
| | | console.log("æ«æç¼ç :", scannedCode); |
| | | console.log("ææç¼ç ï¼materielCodeï¼:", expectedCode); |
| | | |
| | | if (scannedCode === expectedCode) { |
| | | this.materialCodeValid = true; |
| | | console.log("â
ç©æç¼ç éªè¯æå"); |
| | | |
| | | // éªè¯æåå䏿¸
空å¼ï¼ç´æ¥åæ¢å°ä¸ä¸æ¥ |
| | | this.step = 2; |
| | | this.$refs.uToast.show({ |
| | | title: "ç©æç¼ç éªè¯æå", |
| | | type: "success" |
| | | }); |
| | | // ä½¿ç¨ $nextTick ç¡®ä¿ç¦ç¹åæ¢å¨ DOM æ´æ°åæ§è¡ |
| | | this.$nextTick(() => { |
| | | // 让åºä½ç¼å·è¾å
¥æ¡è·å¾ç¦ç¹ |
| | | this.$refs.midInput.focus(); |
| | | }); |
| | | } else { |
| | | this.materialCodeValid = false; |
| | | console.log("â ç©æç¼ç éªè¯å¤±è´¥"); |
| | | |
| | | this.$refs.uToast.show({ |
| | | title: `ç©æç¼ç ä¸å¹é
`, |
| | | type: "error" |
| | | }); |
| | | |
| | | // éªè¯å¤±è´¥æ¶æ¸
空å¼å¹¶ä¿æç¦ç¹å¨ç©æç¼ç è¾å
¥æ¡ |
| | | setTimeout(() => { |
| | | this.materialCode = ""; |
| | | this.step = 1; |
| | | // ç¡®ä¿ç¦ç¹åå°ç©æç¼ç è¾å
¥æ¡ |
| | | this.$nextTick(() => { |
| | | this.$refs.materialInput.focus(); |
| | | }); |
| | | }, 500); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | // voiceSpeech(src) { |
| | | // innerAudioContext.src = src; // '../../static/success.mp3'; |
| | | // innerAudioContext.play(); |
| | |
| | | } |
| | | }, |
| | | barcodeInput() { |
| | | this.$nextTick(function(x) { |
| | | this.$nextTick(() => { |
| | | 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" |
| | | // }) |
| | | // } |
| | | this.step = 3; // 忢å°å
¥åºæ°é |
| | | this.$refs.uToast.show({ |
| | | title: "åºä½ç¼å·æ«ææå", |
| | | type: "success" |
| | | }); |
| | | // æ·»å å»¶æ¶ç¡®ä¿æ«ç 宿 |
| | | setTimeout(() => { |
| | | this.$nextTick(() => { |
| | | this.$refs.midInput.focus(); |
| | | }); |
| | | }, 100); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | snInput() { |
| | | this.$nextTick(() => { |
| | | if (this.materSn != "") { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | submit() { |
| | | if (this.barcode == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«æè´§ä½ç¼å·", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | if (this.materSn.length == 0) { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥å®çæ°é", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | // submit() { |
| | | // if (this.barcode == "") { |
| | | // this.$refs.uToast.show({ |
| | | // title: "è¯·æ«æè´§ä½ç¼å·", |
| | | // type: 'error' |
| | | // }) |
| | | // return; |
| | | // } |
| | | // if (this.materSn.length == 0) { |
| | | // this.$refs.uToast.show({ |
| | | // title: "请è¾å
¥å®çæ°é", |
| | | // type: 'error' |
| | | // }) |
| | | // return; |
| | | // } |
| | | // this.$u.post('/api/DeliveryOrder/CheckFinish', { |
| | | // MainData: { |
| | | // "locationCode": this.barcode, |
| | | // "taskId":this.taskId, |
| | | // // "warehouseCode": this.warehouseId, |
| | | // // "orderNo": this.orderNo, |
| | | // "qty": this.materSn, |
| | | // // "batchNo": this.batchNo, |
| | | // }, |
| | | // // DelKeys: this.sns |
| | | // }).then(res => { |
| | | // this.Testcheck = false; |
| | | // if (res.status) { |
| | | // this.$refs.uToast.show({ |
| | | // title: "çç¹æå", |
| | | // type: "success" |
| | | // }) |
| | | // // this.Inqty=res.message; |
| | | // // this.order_Inqty="å·²åºåºæ°éï¼"+this.Inqty; |
| | | // this.barcode=""; |
| | | // // uni.setStorageSync('checkTask',true); |
| | | |
| | | |
| | | // //å
³é®ä¿®æ¹ï¼ä½¿ç¨ getCurrentPages è·ååä¸ä¸ªé¡µé¢å¹¶ç´æ¥è°ç¨å
¶æ¹æ³ Y |
| | | // const pages = getCurrentPages(); |
| | | // const prevPage = pages[pages.length - 2]; // è·åä¸ä¸ä¸ªé¡µé¢å®ä¾ |
| | | // console.log('åä¸ä¸ªé¡µé¢:', prevPage); |
| | | |
| | | // if (prevPage && prevPage.refreshData) { |
| | | // // ç´æ¥è°ç¨ä¸ä¸ä¸ªé¡µé¢çå·æ°æ¹æ³ |
| | | // prevPage.refreshData(); |
| | | // console.log('å·²è°ç¨åä¸ä¸ªé¡µé¢ççç¹å·æ°æ¹æ³'); |
| | | // } |
| | | |
| | | // setTimeout(() => { |
| | | // uni.navigateBack({ |
| | | // delta: 1 |
| | | // }); |
| | | // }, 300); |
| | | // // this.materSn=""; |
| | | // } else { |
| | | // this.$refs.uToast.show({ |
| | | // title: res.message, |
| | | // type: "error" |
| | | // }) |
| | | // } |
| | | // }) |
| | | // } |
| | | submit() { |
| | | if (!this.materialCodeValid) { |
| | | this.$refs.uToast.show({ |
| | | title: "请å
æ«æå¹¶éªè¯ç©æç¼ç ", |
| | | type: 'error' |
| | | }); |
| | | return; |
| | | } |
| | | if (this.barcode == "") { |
| | | this.$refs.uToast.show({ |
| | | title: "è¯·æ«æè´§ä½ç¼å·", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | if (this.materSn.length == 0) { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥å®çæ°é", |
| | | type: 'error' |
| | | }) |
| | | return; |
| | | } |
| | | |
| | | // æ°å¢äºæ¬¡ç¡®è®¤é»è¾ |
| | | uni.showModal({ |
| | | title: '确认çç¹', |
| | | content: 'æ¨ç¡®å®è¦æäº¤çç¹ä¿¡æ¯åï¼', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | // æ¾ç¤ºå è½½ä¸ |
| | | uni.showLoading({ |
| | | title: 'æäº¤ä¸...', |
| | | mask: true |
| | | }); |
| | | |
| | | this.$u.post('/api/DeliveryOrder/CheckFinish', { |
| | | MainData: { |
| | | "locationCode": this.barcode, |
| | | "taskId":this.taskId, |
| | | // "warehouseCode": this.warehouseId, |
| | | // "orderNo": this.orderNo, |
| | | "qty": this.materSn, |
| | | // "batchNo": this.batchNo, |
| | | }, |
| | | // DelKeys: this.sns |
| | | MainData: { |
| | | "locationCode": this.barcode, |
| | | "taskId": this.taskId, |
| | | "qty": this.materSn, |
| | | }, |
| | | }).then(res => { |
| | | this.Testcheck = false; |
| | | if (res.status) { |
| | | this.$refs.uToast.show({ |
| | | title: "çç¹æå", |
| | | type: "success" |
| | | }) |
| | | // this.Inqty=res.message; |
| | | // this.order_Inqty="å·²åºåºæ°éï¼"+this.Inqty; |
| | | this.barcode=""; |
| | | // uni.setStorageSync('checkTask',true); |
| | | setTimeout(() => { |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | | }, 300); |
| | | // this.materSn=""; |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }) |
| | | uni.hideLoading(); |
| | | |
| | | this.Testcheck = false; |
| | | if (res.status) { |
| | | this.$refs.uToast.show({ |
| | | title: "çç¹æå", |
| | | type: "success" |
| | | }) |
| | | |
| | | // æå¨æ¸
空ææè¾å
¥æ°æ® |
| | | this.materialCode = ""; |
| | | this.materialCodeValid = false; |
| | | this.barcode = ""; |
| | | this.materSn = ""; |
| | | this.step = 1; // éç½®æ¥éª¤å°ç¬¬ä¸æ¥ |
| | | |
| | | // 设置çç¹ä¸ç¨çå·æ°æ è®° |
| | | uni.setStorageSync('needRefreshCheck', true); |
| | | |
| | | // å»¶è¿è¿åï¼è®©B页é¢å·æ°æ°æ® |
| | | setTimeout(() => { |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | | }, 500); |
| | | |
| | | // ä½¿ç¨ $nextTick ç¡®ä¿ç¦ç¹è®¾ç½®å¨ DOM æ´æ°åæ§è¡ |
| | | this.$nextTick(() => { |
| | | // ç¡®ä¿ç©æç¼ç è¾å
¥æ¡è·å¾ç¦ç¹ |
| | | this.$refs.materialInput.focus(); |
| | | }); |
| | | |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }).catch(err => { |
| | | uni.hideLoading(); |
| | | this.$refs.uToast.show({ |
| | | title: "请æ±å¤±è´¥ï¼è¯·éè¯", |
| | | type: "error" |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | </script> |