From 7ca9651f81d7b84f054194d3d46fdbd1d9c8b922 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期三, 09 七月 2025 22:55:27 +0800 Subject: [PATCH] 增加质检出入库逻辑 --- 项目代码/芜湖三一PDA/pages/stash/ModifyBarcode.vue | 105 +++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 86 insertions(+), 19 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/\350\212\234\346\271\226\344\270\211\344\270\200PDA/pages/stash/ModifyBarcode.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/\350\212\234\346\271\226\344\270\211\344\270\200PDA/pages/stash/ModifyBarcode.vue" index fa1480b..fe91f9d 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/\350\212\234\346\271\226\344\270\211\344\270\200PDA/pages/stash/ModifyBarcode.vue" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/\350\212\234\346\271\226\344\270\211\344\270\200PDA/pages/stash/ModifyBarcode.vue" @@ -1,19 +1,40 @@ <template> <view> - <view class="itemstyle"> - <uni-forms label-width="180"> - <uni-forms-item label="鍘熸墭鐩樼爜:"> - <uni-easyinput type="text" placeholder="璇疯緭鍏ユ墭鐩樼爜" ref='midInput' :focus="!focus" v-model="barcode" /> - </uni-forms-item> - <uni-forms-item label="鏂版墭鐩樼爜:"> - <uni-easyinput type="text" placeholder="璇锋壂鎻忔墭鐩樼爜" ref='midInput' v-model="newBarcode" /> - </uni-forms-item> - <uni-forms-item> - <button @click="Modify" type="primary" size="default" style="margin-top: 2%;">鎻愪氦淇敼</button> - </uni-forms-item> - </uni-forms> + <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem"> + </uni-segmented-control> + <view v-show="current === 0"> + <view class="itemstyle"> + <uni-forms label-width="180"> + <uni-forms-item label="鍘熸墭鐩樼爜:"> + <uni-easyinput type="text" placeholder="璇疯緭鍏ユ墭鐩樼爜" ref='midInput' :focus="!focus" v-model="barcode" /> + </uni-forms-item> + <uni-forms-item label="鏂版墭鐩樼爜:"> + <uni-easyinput type="text" placeholder="璇锋壂鎻忔墭鐩樼爜" ref='midInput' :focus="focus" v-model="newBarcode" /> + </uni-forms-item> + <uni-forms-item> + <button @click="Modify" type="primary" size="default" style="margin-top: 2%;">鎻愪氦淇敼</button> + </uni-forms-item> + </uni-forms> + <u-toast ref="uToast" /> + </view> </view> - <u-toast ref="uToast" /> + <view v-show="current === 1"> + <view class="itemstyle"> + <uni-forms label-width="180"> + <uni-forms-item label="鎵樼洏鐮�:"> + <uni-easyinput type="text" placeholder="璇疯緭鍏ユ墭鐩樼爜" ref='midInput' :focus="!focus1" v-model="palletCode" /> + </uni-forms-item> + <uni-forms-item label="琚嬫暟:"> + <uni-easyinput type="text" placeholder="璇疯緭鍏ヨ鏁�" ref='midInput' :focus="focus1" v-model="qty" /> + </uni-forms-item> + <uni-forms-item> + <button @click="ModifyQty" type="primary" size="default" style="margin-top: 2%;">鎻愪氦淇敼</button> + </uni-forms-item> + </uni-forms> + <u-toast ref="uToast1" /> + </view> + </view> + </view> </template> @@ -23,24 +44,37 @@ data() { return { focus: false, + focus1: false, + items: ['鏀规墭鐩樺彿','鏀规墭鐩樿鏁�'], + current: 0, barcode: "", newBarcode: "", - address: "", - WarehouseId: "" + palletCode: "", + qty: "" } }, onShow() {}, onLoad(res) { - this.WarehouseId = res.warehouseId; this.focus = false; - if (res.warehouseId == 5) { - this.address = "8005"; - } }, methods: { voiceSpeech(src) { innerAudioContext.src = src; // '../../static/success.mp3'; innerAudioContext.play(); + }, + onClickItem(e) { + if (this.current !== e.currentIndex) { + this.current = e.currentIndex; + if (this.current == 0) { + this.focus = false; + this.barcode=""; + this.newBarcode = "" + }else{ + this.focus1 = false; + this.qty=""; + this.palletCode=""; + } + } }, Modify() { if (this.barcode == "") { @@ -74,6 +108,39 @@ }) } }) + }, + ModifyQty() { + if (this.palletCode == "") { + this.$refs.uToast1.show({ + title: "璇疯緭鍏ユ墭鐩樼爜", + type: 'error' + }) + return; + } + if (this.qty == "") { + this.$refs.uToast1.show({ + title: "璇疯緭鍏ヨ鏁�", + type: 'error' + }) + return; + } + this.$u.post('/api/PDA/ModifyQty?palletCode=' + this.palletCode + '&qty=' + this.qty).then( + res => { + if (res.status) { + this.$refs.uToast1.show({ + title: "淇敼鎴愬姛", + type: "success" + }) + this.palletCode = ""; + this.qty = ""; + this.focus = false; + } else { + this.$refs.uToast1.show({ + title: res.message, + type: "error" + }) + } + }) } } } -- Gitblit v1.9.3