| | |
| | | <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> |
| | | |
| | |
| | | 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 == "") { |
| | |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | 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" |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |