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
| <template>
| <view>
| <view class="itemstyle">
| <uni-forms label-width="180">
| <uni-forms-item label="物料编码">
| <uni-easyinput type="text" v-model="materialCode" placeholder="请输入物料编码" ref='midInput' />
| </uni-forms-item>
| <uni-forms-item label="物料幅宽:">
| <uni-easyinput type="text" v-model="wide" placeholder="请输入物料幅宽" ref='midInput'/>
| </uni-forms-item>
| <uni-forms-item label="物料数量:">
| <uni-easyinput type="text" v-model="qty" placeholder="请输入物料数量" ref='midInput'/>
| </uni-forms-item>
| <uni-forms-item label="出库点位">
| <uni-data-select placeholder="请选择" v-model="address"
| :localdata="startPointRange"></uni-data-select>
| </uni-forms-item>
| <uni-forms-item>
| <button @click="OutEmpty" 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,
| wide: "",
| materialCode: "",
| WarehouseId: 0,
| qty: "",
| address: "",
| barcode: "",
| startPointRange: []
| }
| },
| onShow() {},
| onLoad(res) {
| this.WarehouseId = res.warehouseId;
| this.focus = false;
| this.getDictionary();
| },
| methods: {
| // voiceSpeech(src) {
| // innerAudioContext.src = src; // '../../static/success.mp3';
| // innerAudioContext.play();
| // },
| barcodeInput() {
| // this.$nextTick(function(x) {
| // if (this.barcode.length > 0) {
| // this.focus = true;
| // }
| // })
| },
| getDictionary() {
| var param = ["printAreaEnum"];
| 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
| }
| this.startPointRange.push(obj);
| })
| }).catch(err => {
| this.$refs.uToast.show({
| title: err.message,
| type: "error"
| })
| })
| },
| OutEmpty() {
| if (this.materialCode == "") {
| this.$refs.uToast.show({
| title: "请输入物料编码",
| type: 'error'
| })
| return;
| }
| if (this.wide == "") {
| this.$refs.uToast.show({
| title: "请输入物料幅宽",
| type: 'error'
| })
| return;
| }
| if (this.qty == "") {
| this.$refs.uToast.show({
| title: "请输入数量",
| type: 'error'
| })
| return;
| }
| if (this.address == "") {
| this.$refs.uToast.show({
| title: "请选择出库点位",
| type: 'error'
| })
| return;
| }
|
|
| //this.qty 验证为整数
| if (!/^\d+$/.test(this.qty)) {
| this.$refs.uToast.show({
| title: "数量必须为整数",
| type: 'error'
| })
| return;
| }
| if (this.qty < 1) {
| this.$refs.uToast.show({
| title: "数量不能小于1",
| type: 'error'
| })
| return;
| }
| //this.materialCode 去除空格
| this.materialCode = this.materialCode.replace(/\s+/g, "");
| var postData = {
| "materialCode": this.materialCode,
| "count": this.qty,
| "address": this.address,
| "wide": this.wide,
| }
| this.$u.post('/api/Task/RequestYLWMSTaskOut',postData).then(
| res => {
| if (res.status) {
| this.$refs.uToast.show({
| title: "成功",
| type: "success"
| })
| this.materialCode = "";
| this.qty = "";
| this.address = "";
| this.wide = "";
| } 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>
|
|