南骏 池
3 天以前 77a2d94762f81da09be82aeab75cdabbf95d2926
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
 
var vm = new Vue({
    el: '#app',
    data: function () {
        return {
            isLoading: false,
            userInfo: {
                "loginGuid": '',
                "loginAccount": '',
            },
            KbBar: "",//卡板条码
            LsBar: "",//后盖流水条码
            XBar: "",//箱条码
            UserName: Cookies.get('loginName'),//用户名称
            KbBarInfo: [],
            KbBarMxInfo: [],
            show: false,//列表展示
            actions: [{
                name: "一楼",
                Postition: 1  // 新增
            }, {
                    name: "四楼",
                    Postition: 4  // 新增
                }],//列表的值
            show2: false,//列表展示
            actions2: [{
                name: "合格"
            },{
                    name: "不合格"
                }],//列表的值
            lcName: "",//楼层名称
            lcNum: "",//楼层编号
            jyz: "",//检验值
 
        }
    },
    mounted() {
        var that = this;
        this.userInfo = {
            loginGuid: this.GetLoginInfor().loginGuid,
            loginAccount: this.GetLoginInfor().loginAccount,
        };
    },
    methods: {
        getKbBarInfo() {
            var that = this;
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/getKbBarInfo', {
                Xt: that.GX,
                Kbbarcode: that.KbBar
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
 
                    }
                    else {
                        that.$playSound('error');
                        that.$toast.fail(json.message);
                        that.$refs.KbBar.focus();
                        that.KbBar = "";
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$playSound('error');
                    that.$toast.fail("网络错误,请重试!");
                    that.$refs.KbBar.focus();
                    that.KbBar = "";
                });
        },
 
        
 
        handleClear() {
            this.KbBar = "";
            this.XBar = "";
            this.LsBar = "";
            this.DAA001 = [];
            this.XbarInfo = [];
 
        },
 
 
        handleSubmit() {
 
            if (this.isLoading) {
                return;
            }
 
            var that = this;
            if (!that.KbBar) {
                that.$playSound('error');
                that.$toast.fail("请先扫描卡板条码");
                return;
            }
    
            // 计算可装数和已装数
            const oldqty = +(that.KbBarInfo.quantity || 0);
            const ySum = +(that.KbBarInfo.ySum || 0);
            
            if (oldqty !== ySum) {
                that.$playSound('error');
                that.$toast.fail(`装板未完成,待装数:${oldqty - ySum}`);
                return;
            }
    
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/submitInspection', {
                KbBar: that.KbBar,
                userAccount: that.userInfo.loginAccount
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.$playSound('success');
                        that.$notify({ type: 'success', message: json.message });
                        // 清空数据
                        //that.KbBar = "";
                        //that.XbarInfo = [];
                        //that.KbBarInfo = [];
                        //that.$refs.KbBar.focus();
                    } else {
                        that.$playSound('error');
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$playSound('error');
                    that.$toast.fail("提交失败,请重试!");
                    that.$refs.KbBar.focus();
                });
        },
 
        onSelect(action) {
            this.lcNum = action.Postition;  // 绑定line_no到xtNum字段
            //console.log("选择的线体编号:", this.xtNum);
            this.lcName = action.name;  // 绑定name到xtName字段
            this.show = false;
        },
 
        onSelect2(action) {
            this.jyz = action.name;  // 绑定name到xtName字段
            this.show2 = false;
        },
 
        //获取可呼叫AGV的线体
        selectLc() {
            this.show = true;
            //var that = this;
            //that.actions = [];
            //that.isLoading = true;
            //that.AxiosHttp("post", 'Womdaa/GetAgvXt', {
            //    selectKey: that.selectKey,
            //}, false)
            //    .then(function (res) {
            //        var json = res;
            //        if (json.status == 0) {
 
            //            if (json.data.tbBillList.length <= 0) {
            //                that.$toast.fail("没有可用的数据");
            //                that.$playSound('error');
            //            } else {
            //                that.itemInfo = json.data.tbBillList;
            //                that.actions = json.data.tbBillList.map(item => {
            //                    return {
            //                        name: item.name,
            //                        lineNo: item.line_no  // 新增
            //                    };
            //                });
            //            }
            //        }
            //        else {
            //            that.$toast.fail(json.message);
            //            that.$playSound('error');
            //        }
            //        that.isLoading = false;
            //    })
            //    .catch(function (error) {
            //        that.isLoading = false;
            //        that.$toast.fail("网络错误,请重试!");
            //        that.$playSound('error');
            //        console.log(error);
            //    });
        },
 
        selectJyz() {
            this.show2 = true;
        },
 
        //AGV送检
        handleAgvSj() {
 
            //this.$toast.fail("功能开发测试中!");
            //return;
 
            if (this.isLoading) {
                return;
            }
            var that = this;
 
            if (!that.KbBar) {
                that.$playSound('error');
                that.$toast.fail("请先扫描卡板条码");
                return;
            }
    
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/handleAGVInspection', {
                KbBar: that.KbBar,
                userAccount: that.userInfo.loginAccount
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.$playSound('success');
                        that.$notify({ type: 'success', message: json.message });
                    } else {
                        that.$playSound('error');
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$playSound('error');
                    that.$toast.fail("AGV送检失败,请重试!");
                    that.$refs.KbBar.focus();
                });
        },
 
        //AGV检验
        handleAgvJy() {
            //this.$toast.fail("功能开发测试中!");
            //return;
 
            if (this.isLoading) {
                return;
            }
 
            var that = this;
            if (!that.jyz) {
                that.$playSound('error');
                that.$toast.fail("请先选择检验值");
                return;
            }
 
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/handleAgvJy', {
                jyz: that.jyz,
                KbBar: that.KbBar,
                userAccount: that.userInfo.loginAccount
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.$playSound('success');
                        that.$notify({ type: 'success', message: json.message });
                    } else {
                        that.$playSound('error');
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$playSound('error');
                    that.$toast.fail("AGV检验失败,请重试!");
                    that.$refs.KbBar.focus();
                });
        },
 
 
        handleAgvRk() {
 
            //this.$toast.fail("功能开发测试中!");
            //return;
 
            if (this.isLoading) {
                return;
            }
            var that = this;
 
            if (!that.KbBar) {
                that.$playSound('error');
                that.$toast.fail("请先扫描卡板条码");
                return;
            }
 
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/handleAgvRk', {
                KbBar: that.KbBar,
                userAccount: that.userInfo.loginAccount,
                Postition: that.lcNum
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.$playSound('success');
                        that.$notify({ type: 'success', message: json.message });
                    } else {
                        that.$playSound('error');
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$playSound('error');
                    that.$toast.fail("AGV入立库失败,请重试!");
                    that.$refs.KbBar.focus();
                });
        },
 
 
    }
})