Admin
6 天以前 bd6818fc9d40f343547bafca0743658f3c0379dc
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
<template>
    <view>
        <view>
            <u-table font-size="25">
                <u-tr>
                    <u-td>
                        <xfl-select :list="UserArray" :initValue="this.$UserTool.UserInfo.userName" :clearable="false"
                            :disabled="true">
                        </xfl-select>
                    </u-td>
                    <u-td width="25%">现在时间:</u-td>
                    <u-td width="25%">{{date}}</u-td>
                </u-tr>
            </u-table>
        </view>
 
        <view style="padding: 0rpx 0rpx">
            <u-table>
                <u-tr>
                    <u-td width="30%">轮对条码</u-td>
                    <u-td>
                        <u-input v-model="barcode" :focus="qrcodeFocus" :border="true" placeholder="请扫描轮对条码"
                            @input="barcodeChange" />
                    </u-td>
                </u-tr>
                <u-tr>
                    <u-td width="30%">车型</u-td>
                    <u-td>
                        <u-input v-model="materiel" :border="false" :disabled="true" placeholder="" />
                    </u-td>
                </u-tr>
                <u-tr>
                    <u-td width="30%">左防尘板平均值</u-td>
                    <u-td>
                        <u-input v-model="zfcbAVG" :border="false" :disabled="true" placeholder="" />
                    </u-td>
                    <u-td width="30%">右防尘板平均值</u-td>
                    <u-td>
                        <u-input v-model="yfcbAVG" :border="false" :disabled="true" placeholder="" />
                    </u-td>
                </u-tr>
                <u-tr>
                    <u-td width="30%" height="50px;">左轴颈平均值</u-td>
                    <u-td>
                        <u-input v-model="zzjAVG" :border="false" :disabled="true" placeholder="" />
                    </u-td>
                    <u-td width="30%">右轴颈平均值</u-td>
                    <u-td>
                        <u-input v-model="yzjAVG" :border="false" :disabled="true" placeholder="" />
                    </u-td>
                </u-tr>
 
                <u-tr>
                    <u-td width="30%">左挡油环平均值</u-td>
                    <u-td>
                        <u-input v-model="zydAVG" :border="false" :disabled="true" placeholder="" />
                    </u-td>
                    <u-td width="30%">右挡油环平均值</u-td>
                    <u-td>
                        <u-input v-model="yydAVG" :border="false" :disabled="true" placeholder="" />
                    </u-td>
                </u-tr>
                <u-tr>
                    <u-td width="30%">轴承类别:</u-td>
                    <u-td>
                        <xfl-select :list="StateArray" :initValue="'请选择'" :clearable="false" @change="StateChange"
                            ref="StateSelect">
                        </xfl-select>
                    </u-td>
                </u-tr>
                <u-tr>
                    <u-td width="30%">厂家:</u-td>
                    <u-td>
                        <xfl-select :list="ManufacturerArray" :initValue="'请选择'" :clearable="false"
                            @change="ManufacturerChange" ref="ManufacturerSelect">
                        </xfl-select>
                    </u-td>
                </u-tr>
                <u-tr>
                    <u-td width="30%">工位:</u-td>
                    <u-td>
                        <xfl-select :list="StationArray" :initValue="'请选择'" :clearable="false" @change="StationChange">
                        </xfl-select>
                    </u-td>
                </u-tr>
                <u-tr>
                    <u-td width="30%">轴承方向:</u-td>
                    <u-td>
                        <xfl-select :list="ZCdirectionArray" :initValue="'请选择'" :clearable="false"
                            @change="ZCdirectionChange">
                        </xfl-select>
                    </u-td>
                </u-tr>
            </u-table>
        </view>
        <view style="padding: 0rpx 0rpx;">
            <u-table>
                <u-tr>
                    <u-td>
                        <u-button style="width:100px" type="primary" @click="SaveInfomation">确认呼叫</u-button>
                    </u-td>
                </u-tr>
            </u-table>
        </view>
    </view>
</template>
 
<script>
    var _this;
    var _user;
    export default {
        data() {
            return {
                date: '',
                CurrentUser: '', //当前用户
                barcode: '',
                zzjAVG: '',
                yzjAVG: '',
                zfcbAVG: '',
                yfcbAVG: '',
                zydAVG: '',
                yydAVG: '',
                StateArray: [],
                ManufacturerArray: [],
                StationArray: [{
                        label: '1号压装位',
                        value: '1号压装位'
                    },
                    {
                        label: '2号压装位',
                        value: '2号压装位'
                    },
                    {
                        label: '3号压装位',
                        value: '3号压装位'
                    },
                    {
                        label: '4号压装位',
                        value: '4号压装位'
                    }
                ],
                ZCdirectionArray: [{
                        label: 'all',
                        value: '两侧'
                    }, {
                        label: 'left',
                        value: '左侧'
                    },
                    {
                        label: 'right',
                        value: '右侧'
                    }
                ],
                zcState: '',
                Manufacturer: '',
                targetStation: '',
                materiel: '',
                //轴承方向
                ZCdirection: '',
                //轴承号
                ldCode: '',
                ortherData: '',
                qrcodeFocus: false
            }
        },
        methods: {
            UserChange(value) {
 
            },
            setTimer() {
                if (this.timer == null) {
                    this.timer = setInterval(() => {
                        this.date = this.$DateTool.getDate();
                    }, 1000)
                }
 
            },
            ManufacturerChange(value) {
                this.Manufacturer = value.orignItem.label;
            },
            StateChange(value) {
                this.zcState = value.orignItem.label;
            },
            StationChange(value) {
                this.targetStation = value.orignItem.label;
            },
            ZCdirectionChange(value) {
                this.ZCdirection = value.orignItem.label;
            },
            barcodeChange() {
                _this.initAVG();
                if (_this.barcode == '' || _this.barcode == null) {
                    return;
                }
                let data = {
                    MainData: {
                        barcode: _this.barcode
                    },
                };
                // let data = {
                //     barcode: _this.barcode
                // };
                _this.$AjaxRequest.Params('post', 'ToMes/Mes_GetBearingNeckSizeInfo',
                    data, _user.token);
                _this.$AjaxRequest.Request().then(function(result) {
                    //console.log(result);
                    if (result.data.status) {
                        let obj = JSON.parse(JSON.stringify(result.data.data));
                        _this.yfcbAVG = obj.yfcbAVG;
                        _this.zfcbAVG = obj.zfcbAVG;
                        _this.zydAVG = obj.zydAVG;
                        _this.yydAVG = obj.yydAVG;
                        _this.zzjAVG = obj.zzjAVG;
                        _this.yzjAVG = obj.yzjAVG;
                        _this.materiel = obj.materiel;
                        _this.ldCode = obj.ldCode;
                        _this.ortherData = obj.ortherData;
                        if (null != obj.manufacturerArray)
                            obj.manufacturerArray.forEach(function(item, index, arr) {
                                _this.ManufacturerArray.push({
                                    label: item,
                                    value: item
                                })
                            });
                        if (null != obj.neworold)
                            obj.neworold.forEach(function(item, index, arr) {
                                let name = '检修';
                                if (item.indexOf('0') > -1) {
                                    name = '新品';
                                }
 
                                if (null == _this.StateArray.find(r => r.value == name)) {
                                    _this.StateArray.push({
                                        label: item,
                                        value: name
                                    })
                                }
                            });
                        //console.log(obj);
                    } else {
                        uni.showToast({
                            icon: 'none',
                            title: "请求错误:" + result.data.message,
                            duration: 2000
                        });
                        _this.initAVG();
                    }
                }).catch(function(err) {
                    uni.showToast({
                        icon: 'none',
                        title: "请求后台异常,错误信息." + err.errMsg,
                        duration: 2000
                    });
                    _this.initAVG();
                });
            },
            initAVG() {
                _this.yfcbAVG = '';
                _this.zfcbAVG = '';
                _this.zydAVG = '';
                _this.yydAVG = '';
                _this.zzjAVG = '';
                _this.yzjAVG = '';
                _this.materiel = '';
                _this.Manufacturer = '';
                _this.zcState = '';
                _this.StateArray = [];
                _this.ldCode = '';
                _this.ortherData = '';
                _this.ManufacturerArray = [];
                _this.$refs.StateSelect.setInput("请选择");
                _this.$refs.StateSelect.clearItemActive();
                _this.$refs.ManufacturerSelect.setInput("请选择");
                _this.$refs.ManufacturerSelect.clearItemActive();
            },
            SaveInfomation() {
                if (_this.barcode == '' || _this.Manufacturer == '' ||
                    _this.zcState == '' || _this.targetStation == '') {
                    uni.showToast({
                        title: "请选择厂家、工位或者选配标准信息.",
                        duration: 2000
                    });
                    return;
                }
                if (_this.yfcbAVG == '' && _this.zfcbAVG == '' &&
                    _this.zydAVG == '' && _this.yydAVG == '' && _this.zzjAVG == '' &&
                    _this.yzjAVG == '') {
                    uni.showToast({
                        title: "请重新获取轮对选配信息.",
                        duration: 2000
                    });
                    return;
                }
 
                uni.showModal({
                    title: '提示',
                    content: '请核对轮对条码是否正确?',
                    success: function(res) {
                        if (res.confirm) {
                            let data = {
                                MainData: {
                                    barcode: _this.barcode,
                                    zcState: _this.zcState,
                                    Manufacturer: _this.Manufacturer,
                                    yfcbAVG: _this.yfcbAVG,
                                    zfcbAVG: _this.zfcbAVG,
                                    zydAVG: _this.zydAVG,
                                    yydAVG: _this.yydAVG,
                                    zzjAVG: _this.zzjAVG,
                                    yzjAVG: _this.yzjAVG,
                                    materiel: _this.materiel,
                                    targetStation: _this.targetStation,
                                    ZCdirection: _this.ZCdirection,
                                    ldCode: _this.ldCode,
                                    ortherData: _this.ortherData
                                },
                            };
                            _this.$AjaxRequest.Params('post', 'ToAPP/OptionalOutboundAction',
                                data, _user.token);
                            _this.$AjaxRequest.Request().then(function(result) {
                                if (result.data.status) {
                                    uni.showToast({
                                        title: "创建选配出库成功!",
                                        duration: 2000
                                    });
                                    _this.initAVG();
                                    _this.qrcodeFocus = true;
                                } else {
                                    uni.showToast({
                                        icon: 'none',
                                        title: "请求错误:" + result.data.message,
                                        duration: 2000
                                    });
                                }
                            }).catch(function(err) {
                                uni.showToast({
                                    icon: 'none',
                                    title: "请求后台异常,错误信息." + err.errMsg,
                                    duration: 2000
                                });
                            });
                        } else if (res.cancel) {}
                    }
                });
            },
        },
        created: function() {
            // 每次进入界面时,先清除之前的所有定时器,然后启动新的定时器
            clearInterval(this.timer)
            this.timer = null;
            this.setTimer();
            _user = this.$UserTool.UserInfo;
            this.CurrentUser = _user.userName;
            this.UserArray = [this.$UserTool.AllUserInfo];
        },
        destroyed: function() {
            // 每次离开当前界面时,清除定时器
            clearInterval(this.timer);
            this.timer = null;
        },
        mounted() {
            _this = this;
            _this.qrcodeFocus = true;
            //_this.queryOrder();
        },
 
 
    }
</script>
 
<style scoped lang="scss">
    .tdHeight {
        height: 80rpx;
    }
 
    .loopView {
        height: 160px;
        background-color: #f0f0f0;
        margin-top: 10px;
    }
 
    .loopItem {
        margin-top: 5px;
        margin-left: 15px;
 
    }
 
    .deleteBtn {
        margin-top: 25px;
        margin-left: 10px;
        width: 120px;
        background-color: orangered;
    }
</style>