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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
| <template>
| <view>
| <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
| </uni-segmented-control>
| <view class="content">
| <view v-if="current === 0" class="headerstyle">
| <view class="itemstyle">
| <uni-forms label-width="180">
| <uni-forms-item label="物料条码:">
| <uni-easyinput type="text" placeholder="请扫描物料条码" ref='midInput' :focus="!focus"
| v-model="bindCode" @confirm="barcodeInput" />
| </uni-forms-item>
| <uni-forms-item label="托盘条码:">
| <uni-easyinput type="text" placeholder="请扫描托盘条码" ref='midInput' :focus="focus"
| v-model="palletCode"/>
| </uni-forms-item>
| <uni-forms-item label="地址条码:">
| <uni-easyinput type="text" placeholder="请扫描地址条码" ref='midInput' :focus="addressFocus"
| v-model="startPoint"/>
| </uni-forms-item>
| <uni-forms-item label="单据类型:">
| <uni-data-select placeholder="请选择" v-model="orderType"
| :localdata="orderTypeRange"></uni-data-select>
| </uni-forms-item>
| <uni-forms-item>
| <button @click="Bindrfid" type="primary" size="default" style="margin-top: 2%;">绑定入库</button>
| </uni-forms-item>
| </uni-forms>
| </view>
| </view>
| </view>
| <u-toast ref="uToast" />
| </view>
| </template>
|
| <script>
| const innerAudioContext = uni.createInnerAudioContext();
| export default {
| data() {
| return {
| items: ['二期新厂入库'], //, '单据信息', '解盘'
| materSn: "",
| wide: "",
| weight: "",
| lengthStock: "",
| thickness: "",
| barcode: "",
| focus: false,
| inboundBarcode: "",
| address: "",
| addressdisabled: true,
| addressFocus: false,
| current: 0,
| inboundCode: "",
| orderNo: "",
| warehouseId: "",
| Test: false,
| emptyCode: "",
| matCount: 0,
| matCode: "", //物料编码
| addressEmpty: "",
| OneCount: 0,
| targetId: "",
| materialCode: "",
| bindCode: "",
| palletCode: "",
| startPoint: "",
| rfidCode: "",
| rfid:"",
| outCount: 0,
| orderType: 0,
| orderTypeRange: []
| }
| },
| onShow() {},
| onLoad(res) {
| this.focus = false;
| this.addressFocus = false;
| this.Test = false;
| this.warehouseId = res.warehouseId;
| this.getDictionary();
| },
| methods: {
| onClickItem(e) {
| this.barcodeFo = true;
| this.focus = false;
| this.addressFocus = false;
| if (this.current !== e.currentIndex) {
| this.current = e.currentIndex;
| }
| },
| barcodeInput() {
| this.$nextTick(function(x) {
| if (this.bindCode.length > 0) {
| this.focus = true;
| }
| })
| },
| getDictionary() {
| var param = ["inOrderTypeEnum"];
| this.$u.post('api/Sys_Dictionary/GetVueDictionary', param).then(res => {
| //将res.data中的value改成text,key改成value
| res[0].data.forEach(item => {
| var obj = {
| value: item.key,
| text: item.value
| }
| if (item.key <40) {
| this.orderTypeRange.push(obj);
| }
| })
| }).catch(err => {
| this.$refs.uToast.show({
| title: err.message,
| type: "error"
| })
| })
| },
| Bindrfid(){
| if (this.bindCode == "") {
| this.$refs.uToast.show({
| title: "请输入条码",
| type: "error"
| })
| return;
| }
| if (this.palletCode == "") {
| this.$refs.uToast.show({
| title: "请输入托盘条码",
| type: "error"
| })
| return;
| }
| if (this.startPoint == "") {
| this.$refs.uToast.show({
| title: "请输入地址条码",
| type: "error"
| })
| return;
| }
| if(this.orderType==0){
| thsis.$refs.uToast.show({
| title: "请选择单据类型",
| type: "error"
| })
| return;
| }
| var url = "?bindCode=" + this.bindCode + "&barCode="+this.palletCode+"&startPoint="
| + this.startPoint+ "&orderType="+this.orderType;
| this.$u.post('api/Task/InboundOrderInTask' + url, {}).then(res => {
| if (res.status) {
| this.bindCode = "";
| this.startPoint="";
| this.palletCode="";
| this.orderType = 0;
| this.focus=false;
| setTimeout(() => {
| this.$refs.uToast.show({
| title: "成功",
| type: "success"
| })
| }, 200);
| } else {
| this.$refs.uToast.show({
| title: res.message,
| type: "error"
| })
| }
| }).catch(err => {
| this.$refs.uToast.show({
| title: err.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>
|
|