| | |
| | | <template> |
| | | <view> |
| | | <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem"> |
| | | </uni-segmented-control> |
| | | <view v-show="current === 0"> |
| | | <view style="padding: 5%;"> |
| | | <uni-forms label-width="120"> |
| | | <uni-forms-item label="ç¼åç¹"> |
| | | <uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="value" |
| | | placeholder="请è¾å
¥ç¼åç¹" ref='midInput' /> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | <button @click="submit" type="primary" size="default" style="margin-top: 2%;">éæ¾</button> |
| | | <u-toast ref="uToast" /> |
| | | </view> |
| | | </view> |
| | | <view v-show="current === 1"> |
| | | <view style="padding: 5%;"> |
| | | <uni-forms label-width="120"> |
| | | <uni-forms-item label="ç¼åç¹"> |
| | | <uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="value" |
| | | placeholder="请è¾å
¥ç¼åç¹" ref='midInput' /> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | <button @click="submit" type="primary" size="default" style="margin-top: 2%;">æå
</button> |
| | | <u-toast ref="uToast" /> |
| | | </view> |
| | | </view> |
| | | <!-- <view v-show="current === 2"> |
| | | é项å¡3çå
容 |
| | | </view> --> |
| | | </view> |
| | | </view> |
| | | <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem"> |
| | | </uni-segmented-control> |
| | | <view v-show="current === 0"> |
| | | <view style="padding: 5%;"> |
| | | <uni-forms label-width="120"> |
| | | <uni-forms-item label="ç¼åç¹"> |
| | | <uni-easyinput type="text" :focus="!istrue" @input="barcodeInput" v-model="Point" |
| | | placeholder="请è¾å
¥ç¼åç¹" ref='midInput' /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="æçæ°é"> |
| | | <uni-easyinput type="text" :focus="istrue" v-model="PalletCode" placeholder="请è¾å
¥æçæ°é" |
| | | ref='midInput' /> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | <button @click="Bind" type="primary" size="default" style="margin-top: 2%;">ç»å®</button> |
| | | <u-toast ref="BindluToast" /> |
| | | </view> |
| | | </view> |
| | | <view v-show="current === 1"> |
| | | <view style="padding: 5%;"> |
| | | <uni-forms label-width="120"> |
| | | <uni-forms-item label="ç¼åç¹"> |
| | | <uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="value" |
| | | placeholder="请è¾å
¥ç¼åç¹" ref='midInput' /> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | <button @click="submit" type="primary" size="default" style="margin-top: 2%;">éæ¾</button> |
| | | <u-toast ref="BindluToast1" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | return { |
| | | istrue: false, |
| | | range: [], |
| | | PalletCode: "", |
| | | Point: "", |
| | | value: "", |
| | | items: ['éæ¾ç¼åä½', 'æå
'], |
| | | items: ['ç»å®ç¼åç¹', 'éæ¾ç¼åç¹'], //, 'æå
' |
| | | current: 0 |
| | | } |
| | | }, |
| | |
| | | this.getEndLocations(); |
| | | }, |
| | | methods: { |
| | | barcodeInput() { |
| | | this.$nextTick(function(x) { |
| | | if (this.Point.length > 0) { |
| | | this.istrue = true; |
| | | } |
| | | }) |
| | | }, |
| | | onClickItem(e) { |
| | | if (this.current != e.currentIndex) { |
| | | this.current = e.currentIndex; |
| | | } |
| | | }, |
| | | submit() { |
| | | if (this.value.length <= 0) { |
| | | this.$refs.uToast.show({ |
| | | title: "请è¾å
¥ç¼åç¹", |
| | | this.istrue = false; |
| | | if (this.current !== e.currentIndex) { |
| | | this.current = e.currentIndex; |
| | | if (this.current == 2) { |
| | | this.getData(); |
| | | } |
| | | } |
| | | }, |
| | | Bind() { |
| | | if (this.PalletCode.length == "" || this.Point.length == "") { |
| | | this.$refs.BindluToast.show({ |
| | | title: "æçæ°éè·ç»å®è´§ä½ä¸è½ä¸ºç©º", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | var param = { |
| | | MainData: { |
| | | matCode: this.value, |
| | | endPoint: this.value |
| | | } |
| | | } |
| | | this.$u.post('/api/AcrossFloorCarry/AcrossFloorCallMat', param).then(res => { |
| | | this.$u.post('/api/PDA/Bind?qty=' + this.PalletCode + '&point=' + this.Point, {}).then(res => { |
| | | if (res.status) { |
| | | this.$refs.uToast.show({ |
| | | title: "éæ¾æå", |
| | | this.$refs.BindluToast.show({ |
| | | title: "ç»å®æå", |
| | | type: "success" |
| | | }) |
| | | this.carNo = ""; |
| | | this.value = ""; |
| | | this.locationNo = ""; |
| | | this.Point = ""; |
| | | this.PalletCode = ""; |
| | | this.istrue = false; |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | this.$refs.BindluToast.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | submit() { |
| | | if (this.value == "") { |
| | | this.$refs.BindluToast1.show({ |
| | | title: "请è¾å
¥ç¼åç¹", |
| | | type: "error" |
| | | }) |
| | | return; |
| | | } |
| | | // var param = { |
| | | // MainData: { |
| | | // matCode: this.value, |
| | | // endPoint: this.value |
| | | // } |
| | | // } |
| | | this.$u.post('/api/PDA/AcrossFloorCallMat?Point=' + this.value, {}).then(res => { |
| | | if (res.status) { |
| | | this.$refs.BindluToast1.show({ |
| | | title: "éæ¾æå", |
| | | type: "success" |
| | | }) |
| | | // this.carNo = ""; |
| | | this.value = ""; |
| | | // this.locationNo = ""; |
| | | this.istrue = false; |
| | | } else { |
| | | this.$refs.BindluToast1.show({ |
| | | title: res.message, |
| | | type: "error" |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |