| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
 | | <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" |  |                         @input="barcodeInput" /> |  |                 </uni-forms-item> |  |                 <uni-forms-item label="起点位置:"> |  |                     <uni-easyinput type="text" placeholder="请扫描起点位置" ref='midInput' :focus="focusStart" v-model="address" |  |                         @input="addressInput" /> |  |                 </uni-forms-item> |  |                 <uni-forms-item> |  |                     <button @click="InEmpty" type="primary" size="default" style="margin-top: 2%;">空框回库</button> |  |                 </uni-forms-item> |  |             </uni-forms> |  |         </view> |  |         <u-toast ref="uToast" /> |  |     </view> |  | </template> |  |   |  | <script> |  |     const innerAudioContext = uni.createInnerAudioContext(); |  |     export default { |  |         data() { |  |             return { |  |                 focus: false, |  |                 focusStart:false, |  |                 barcode: "", |  |                 address: "", |  |                 WarehouseId: "" |  |             } |  |         }, |  |         onShow() {}, |  |         onLoad(res) { |  |              |  |         }, |  |         methods: { |  |             // voiceSpeech(src) { |  |             //     innerAudioContext.src = src; // '../../static/success.mp3'; |  |             //     innerAudioContext.play(); |  |             // }, |  |             barcodeInput() { |  |                 this.$nextTick(function(x) { |  |                     if (this.barcode.length > 0) { |  |                         this.focus = true; |  |                         this.focusStart=true; |  |                     } |  |                 }) |  |             }, |  |             addressInput() { |  |                 this.$nextTick(function(x) { |  |                     if (this.address.length > 0) { |  |                         this.focusStart = false; |  |                     } |  |                 }) |  |             }, |  |             InEmpty() { |  |                 if (this.barcode == "") { |  |                     this.$refs.uToast.show({ |  |                         title: "请扫描托盘码", |  |                         type: 'error' |  |                     }) |  |                     return; |  |                 } |  |                 if (this.address == "") { |  |                     this.$refs.uToast.show({ |  |                         title: "请扫描起点", |  |                         type: 'error' |  |                     }) |  |                     return; |  |                 } |  |                 this.$u.post('/api/Task/EmptyBackTask?barcode=' + this.barcode + '&startPoint=' + this.address).then( |  |                     res => { |  |                         if (res.status) { |  |                             this.$refs.uToast.show({ |  |                                 title: "成功", |  |                                 type: "success" |  |                             }) |  |                             this.barcode = ""; |  |                             this.address = ""; |  |                         } else { |  |                             this.$refs.uToast.show({ |  |                                 title: res.message, |  |                                 type: "error" |  |                             }) |  |                         } |  |                     }) |  |             } |  |         } |  |     } |  | </script> |  |   |  | <style lang="scss"> |  |     @import '@/common/uni-ui.scss'; |  |   |  |     .content { |  |         display: flex; |  |         height: 150px; |  |     } |  |   |  |     .content-text { |  |         font-size: 14px; |  |         color: #666; |  |     } |  |   |  |     .itemstyle { |  |         margin-top: 30px; |  |         margin-left: 5%; |  |     } |  |   |  |     .headerstyle { |  |         width: 90%; |  |     } |  | </style> | 
 |