zhangyanpeng
2024-05-29 1f227a1cf627526701c652ba84bae3e430bba8d3
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
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
<!doctype html>
<html>
    <head>
        <meta charset="utf-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache">
        <title>库存明细选择或文件导入弹窗</title>
        
        <script type="text/javascript">
            var pageVue = null;
            function loadJsCss(callback) {
                var jscss_urls = [];
                window.top.initJsCss(document, jscss_urls, callback);
            };
            
            function initVue() {
                new ListVue({
                    el: "#vbody",
                    data: {
                        dataname: "wm_book_detail",
                        title: "库存明细选择弹窗",
                        pageAttr: {
                            heightType: "popuppage"
                        },
                        filterAttr: {
                            columnnumber: 3,
                            labelwidth: "100px",
                            labelposition: "right",//"left",//"right",
                            size: "medium",
                            border: "0px solid #c6c6c600"
                        },
                        filterObjBydefault: {},
                        filterfieldClick: {},
                        tablefieldClick: {},
                        formfieldClick: {},
                        orderby: "spec",
                        selectedrows: [],
                        iscustomer: false,
                        basicfilterfields: [],
                        basicfilterAttr: {
                            istitle: false,
                            title: "表单名称",
                            columnnumber: 5,
                            labelwidth: "0px",
                            labelposition: "left",//"left",// right//top
                            size: "mini",
                            border: "1px solid #c6c6c600"
                        },
                        filterAttr: {
                            istitle: false,
                            title: "表单名称",
                            columnnumber: 4,
                            labelwidth: "60px",
                            labelposition: "left",//"left",// right//top
                            size: "mini",
                            border: "5px solid #c6c6c600",
                            isinputqty: false,// 是否需要添加一个数量输入字段
                            isinputedit: false, // 是否可编辑行数据
                        },
                        
                        filterData: {},
                        shoppingcartRewriteFields: ["input_qty", "h_notrowclick"], // 在购物车中的数据要回写到重新查询数据中的字段
                        
                        tabs: [
                            {code: "select_sku", name: "选择明细"},
                            {code: "upload_sku", name: "导入明细"},
                        ],
                        activeTabName: "",
                        
                        //上传页面
                        add_Step: 0,
                        upload_url: "",
                        upload_headers: {},
                        upload_multiple: false, //是否允许多文件
                        filetypelist: [".xlsx"],
                        filetype: ".xlsx",
                        fileList: [],
                        messagelist: [],
                        errorlines: [],
                        iobatchid: "",
                        disabled_NextStepLength: false,
                        loading_nextStep: false,
                        uploade_state: false,
                        upload_file: null,
                        
                        formData: {
                            ioname: "import_so_implant_detail",
                            uploadType: "",
                            tempTable: "",
                            operate_type: "",
                        },
                        upload_list: [],
                        customer_id: "",
                        
                    },
                    created() {
                        this.iscustomer = window.top.vue.isCustomer
                        
                        this.popupParames = clone(Root.popupParames);
                        this.title = this.popupParames.title || this.popupParames.text
                        if (this.popupParames.filter) {
                            this.filterTxt = this.popupParames.filter
                        }
                        
                        if (this.popupParames.dataname) {
                            this.dataname = this.popupParames.dataname;
                        }
                        
                        if (this.popupParames.delta && this.popupParames.delta.selectmap) {
                            this.filterData = this.popupParames.delta.selectmap;
                        }
                        if (this.popupParames.delta && this.popupParames.delta.isinputqty) { // 是否需要添加一个数量输入字段
                            this.isinputqty = this.popupParames.delta.isinputqty;
                            this.isinputedit = true
                        }
                        if (this.popupParames.delta && this.popupParames.delta.customer_id) {
                            this.customer_id = this.popupParames.delta.customer_id;
                        }
                        
                        
                        if (this.popupParames.sceneCode) {
                            if (this.popupParames.sceneCode == "add") {//新增
                                this.isedit = true;
                            }
                        }
                    },
                    
                    mounted() {
                        //获取数据
                        this.activeTabName = "select_sku";
                        this.initData();
                        this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
                            hideLoading();
                        });
                    },
                    
                    methods:{
                        //关闭弹窗
                        closeDialog() {
                            this.docloseDialog(true);
                        },
                        
                        //关闭前调回调
                        saveAfter() {
                            var me = this;
                            var selectedrows = this.$refs.table1.getShoppingcart();
                            
                            if(this.popupParames.callback) {
                                let obj = {
                                    type: this.activeTabName,
                                    list: clone(selectedrows)
                                    // row: clone(this.selectedrow)
                                }
                                this.popupParames.callback(obj, function() {
                                    me.docloseDialog();
                                });
                            }
                            else {
                                me.docloseDialog();
                            }
                        },
                        
                        initData() {
                            var me = this;
                            this.onQuery(function(result, callback) {//查询后的回调,用于获取字段的
                                if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) {
                                    var metas = clone(result.meta[me.dataname].fields);
                                    var filterFields_ = [];
                                    var tableFields_ = [];
                                    var tableFields_last_ = [];
                                    
                                    var basicfilterfields_ = [];
                                    
                                    metas.map(f=>{
                                        f.isshow = "T";
                                        f.inputtype = "span"
                                        if (f.field == "warehouse_code" || f.field == "warehouse_name" 
                                            || f.field == "type_code" || f.field == "type_name"
                                            || f.field == "orig_warehouse_code" || f.field == "orig_warehouse_name" 
                                            || f.field == "orig_type_code" || f.field == "orig_type_name"
                                            || f.field == "md_org__code" || f.field == "md_org__name" || f.field == "md_org_account__actor_code" 
                                            || f.field == "md_org_account__actor_name" || f.field == "create_time" || f.field == "update_time"
                                            || f.field == "bu_id" || f.field == "wm_warehouse__code" || f.field == "price" 
                                            || f.field == "amt" || f.field == "is_sn_active" || f.field == "org_code" || f.field == "org_name"
                                        ) {
                                            if(me.iscustomer){
                                                f.isfilter = false;
                                                f.isshow = "F";
                                            }
                                        }
                                        
                                        if (f.field == "unit" || f.field == "stock_type_name") {
                                            f.isfilter = false;
                                            f.isshow = "F";
                                        }
                                        
                                        if (f.isfilter) {
                                            filterFields_.push(clone(f));
                                        }
                                        else {
                                            var filter_f = clone(f);
                                            filter_f.isshow = "F";
                                            filterFields_.push(filter_f);
                                        }
                                        
                                        if (f.field == "org_name" || f.field == "type_name" 
                                            || f.field == "wm_warehouse__code" || f.field == "bu_id"
                                            || f.field == "product_name"
                                        ) {
                                            tableFields_last_.push(clone(f));
                                        }
                                        else {
                                            
                                            tableFields_.push(clone(f));
                                        }
                                        
                                        if (f.field == "org_name" || f.field == "bu_id"
                                            || f.field == "wm_warehouse__name" || f.field == "spec"
                                            || f.field == "batch_no"
                                        ) {
                                            basicfilterfields_.push(clone(f));
                                        }
                                    })
                                    if (tableFields_last_.length) {
                                        tableFields_last_.map(fl=>{
                                            tableFields_.push(clone(fl));
                                        })
                                    }
                                    
                                    if (me.isinputqty) {
                                        var f_input_qty = {isshow: "T", field: "input_qty", name: "输入数量", inputtype: "input", inputkeys: "number", align: "right", width: "100", isfixed: "right", istablesum: true}
                                        tableFields_.push(clone(f_input_qty));
                                    }
                                    
                                    if (!me.filterFields || (me.filterFields && me.filterFields.length == 0)) {
                                        me.filterFields = clone(filterFields_);
                                        me.tableFields = clone(tableFields_);
                                        me.basicfilterfields = clone(basicfilterfields_);
                                        
                                        //字段数组转字段obj,目的为了筛选时获取字段属性
                                        me.fieldsToFieldsObj();
                                        
                                        //设置字段事件
                                        me.tableFieldClick();
                                    }
                                    
                                }
                                
                                if (callback) {
                                    callback();
                                }
                            });
                        },
                        
                        onQueryAfter() {
                            var me = this;
                            
                            var tableData_ = clone(me.tableData);
                            tableData_.map(row=>{
                                //rowkey
                                var key_ = row.warehouse_id + "_" + row.product_code + "_" + row.batch_no
                                if (row.batch_sn) {//有序列号
                                    key_ = row.warehouse_id + "_" + row.product_code + "_" + row.batch_no + "_" + row.batch_sn
                                }
                                if (me.filterData[key_]) {
                                    // row.cssname = "z_notrowclick";
                                    row.input_qty = me.filterData[key_].qty
                                    row.h_classname = "z_notrowclick";
                                }
                                else if (this.isinputedit) {
                                    row.isWithinEdit = true
                                }
                                
                            })
                            me.tableData = clone(tableData_);
                        },
                        
                        tableFieldClick() {
                            var me = this;
                            //筛选字段事件设置
                            this.filterfieldClick = {
                            };
                            //表格字段事件设置
                            this.tablefieldClick = {
                                input_qty: {//字段事件设置
                                    cell: {// 单元格点击事件
                                        onclick: function(obj) { // 有单元格点击事件的,此单元格点击时不触发行点击事件
                                            
                                        }
                                    },
                                    input: {
                                        onchange: function(obj) {//输入更改事件
                                            if (obj.row.input_qty && obj.row.input_qty > obj.row.qty_available) {
                                                Root.message({
                                                    type: 'warning',
                                                    message: '输入数量不能大于可用数量'
                                                });
                                                obj.row.input_qty = 1
                                            }
                                            if (obj.row.input_qty && obj.row.input_qty != "0") {// 如果有数量则选中该行
                                                obj.row.h_notrowclick = true // 设置行选中锁定
                                                me.$refs.table1.selectedRow(obj.row, true);
                                            }
                                            else {
                                                obj.row.h_notrowclick = false // 取消行选中锁定
                                            }
                                        }
                                    },
                                },
                            };
                        
                            //表单字段事件设置
                            this.formfieldClick = {
                            };
                        },
                        
                        selectionChange(obj){
                            var me = this;
                            me.selectedrows = obj;
                        },
                        saveShoppingcart(list) {
                            var me = this;
                            me.selectedrows = list;
                        },
                        
                        onRowDblClick() {
                            if (this.isedit) {
                                this.saveAfter();
                            }
                        },
                        
                        
                        // 上传页面
                        uploadSaveAfter() {
                            var me = this;
                            if (this.iobatchid) {
                                this.closeDialog();
                                return
                            }
                            if (this.popupParames.callback) {
                                var selectedrows = clone(this.upload_list)
                                if(this.popupParames.callback) {
                                    let obj = {
                                        type: this.activeTabName,
                                        list: clone(selectedrows)
                                        // row: clone(this.selectedrow)
                                    }
                                    this.popupParames.callback(obj, function() {
                                        me.docloseDialog();
                                    });
                                }
                                else {
                                    me.docloseDialog();
                                }
                            } else {
                                alert("该按键事件缺失!")
                            }
                        },
                        
                        beforeAvatarUpload(file) {
                            let FileName = file.name;
                            let index1 = FileName.lastIndexOf(".");
                            let index2 = FileName.length;
                            let suffix = FileName.substring(index1, index2).toLowerCase(); //后缀名
                            let isFileType = false;
                            
                            if (this.filetypelist.length) {
                                this.filetypelist.map(e=>{
                                    if (suffix === e) {
                                        isFileType = true;
                                    }
                                });
                            }
                            else {//没有设置则默认全部文件可传
                                isFileType = true;
                            }
                                        
                            if (!isFileType) {
                                this.$message.error('只能上传' + this.filetype + '文件');
                            } else {}
                            return isFileType;
                        },
                        handleExceed(files, fileList) {
                            this.$message.warning(`当前限制选择 1 个文件`);
                        },
                        /* 导入时文件成功事件 */
                        upload_change_(response, file, fileList) {
                            console.log(response);
                            if (response.messages && response.messages.count && response.messages.count.error) {
                                this.loading_nextStep = false;
                                this.messagelist = ['上传请求失败'];
                                if (response.messages.list) {
                                    var config = {
                                        totab: false,
                                        // width: "1200px",
                                        // height: 800,
                                        icon: "icon-product",
                                        text: "错误信息",
                                        url: "module/tool/page/popup_error_messages.html",
                                        data: {},
                                        delta: response.messages.list,
                                        callback: function(obj, callback) {
                                            if (callback) {
                                                callback();
                                            }
                                        }
                                    };
                                    me.doPopupByPublic(config);
                                }
                            }
                            else {
                                this.uploade_state = true;
                            }
                        },
                        /* 导入时文件失败事件 */
                        upload_error(errorresult, file, fileList) {
                            var me = this;
                            console.log(errorresult);
                            this.loading_nextStep = false;
                            this.messagelist = ['上传请求失败'];
                            if (errorresult.messages && errorresult.messages.count && errorresult.messages.count.error) {
                                if (errorresult.messages.list) {
                                    var config = {
                                        totab: false,
                                        // width: "1200px",
                                        // height: 800,
                                        icon: "icon-product",
                                        text: "错误信息",
                                        url: "module/tool/page/popup_error_messages.html",
                                        data: {},
                                        delta: errorresult.messages.list,
                                        callback: function(obj, callback) {
                                            if (callback) {
                                                callback();
                                            }
                                        }
                                    };
                                    me.doPopupByPublic(config);
                                }
                            }
                            else {
                                clearTimeout(this.timer);
                                this.$message({
                                    message: '上传请求失败',
                                    type: 'warning'
                                });
                            }
                        },
                        /* 导入时文件状态改变事件*/
                        upload_change(file, fileList) {
                            console.log(file);
                            if (fileList.length == 2) {
                                const newFileList = fileList.slice(-1);
                                this.fileList = newFileList;
                            }
                            this.upload_file = file;
                            if (fileList.length > 0) {
                                this.disabled_NextStepLength = false;
                            }
                            
                            let FileName = file.name;
                            let index1 = FileName.lastIndexOf(".");
                            let index2 = FileName.length;
                            let suffix = FileName.substring(index1, index2).toLowerCase(); //后缀名
                            let isFileType = false;
                            
                            if (this.filetypelist.length) {
                                this.filetypelist.map(e=>{
                                    if (suffix === e) {
                                        isFileType = true;
                                    }
                                });
                            }
                            else {//没有设置则默认全部文件可传
                                isFileType = true;
                            }
                                            
                            if (!isFileType) {
                                this.upload_file = null
                                this.$message.error('只能上传' + this.filetype + '文件');
                                this.$refs.upload.handleRemove(file)
                            } else {
                                
                            }
                        },
                        
                        downloadErrorsData() {
                            let me = this;
                            let param = {
                                ioname: me.formData.ioname,
                                ioBatchId: me.iobatchid,
                                token: Root.getToken()
                            }
                            window.top.vue.downloadFormByErrorsData(param);
                        },
                        
                        /* 步骤下一步事件 */
                        NextStep() {
                            if (!this.uploade_state) {
                                this.submitUpload();
                                return;
                            } else if (this.add_Step == 1) {
                                this.saveRowTable();
                            }
                        },
                        
                        // 重新上传
                        UpStep() {
                            this.add_Step = 0;
                            this.messagelist = [];
                            this.errorlines = [];
                            this.iobatchid = "";
                            
                        },
                        
                        /* 数据导入事件 */
                        submitUpload() {
                            if (!this.upload_file) {
                                return
                            }
                            this.loading_nextStep = true;
                            
                            let me = this;
                            let formData = new FormData();
                            var ocrtype = "toDB";
                            formData.append("oneFile", this.upload_file.raw);
                            // formData.append("customer_id", this.customer_id);
                            
                            var formData_ = clone(formData);
                            var formData_db = {
                                ioname:me.formData.ioname,
                                oneFile: formData_,
                                uploadType: me.formData.uploadType,
                                tempTable: me.formData.tempTable,
                                operate_type: me.formData.operate_type,
                                userid: window.top.vue.userinfo.id,
                                customer_id: this.customer_id
                            }
                            
                            if (window.top.vue.userinfo.employee && window.top.vue.userinfo.employee.positions && window.top.vue.userinfo.employee.positions.length && window.top.vue.userinfo.employee.positions[0].id) {
                                formData_db.position_id = window.top.vue.userinfo.employee.positions[0].id;
                            }
                            
                            formData = formData_db;
                            
                            // return
                            me.messagelist = [];
                            me.errorlines = [];
                            me.iobatchid = "";
                            uploadFile(me, formData, result_ => {
                                console.log(result_);
                                if (result_.data.error_lines && result_.data.error_lines.length) {
                                    me.iobatchid = result_.data.iobatchid;
                                    if (result_.data.error_lines) {
                                        me.errorlines = clone(result_.data.error_lines);
                                    }
                                    me.add_Step = 1;
                                    me.loading_nextStep = false;
                                }
                                else if (!result_.data.success) {
                                    me.iobatchid = result_.data.iobatchid;
                                    me.loading_nextStep = false;
                                    var errorresult = result_.data;
                                    if (errorresult.messages && errorresult.messages.count && errorresult.messages.count.error) {
                                        if (errorresult.messages.list) {
                                            var config = {
                                                totab: false,
                                                // width: "1200px",
                                                // height: 800,
                                                icon: "icon-product",
                                                text: "错误信息",
                                                url: "module/tool/page/popup_error_messages.html",
                                                data: {},
                                                delta: errorresult.messages.list,
                                                callback: function(obj, callback) {
                                                    if (callback) {
                                                        callback();
                                                    }
                                                }
                                            };
                                            me.doPopupByPublic(config);
                                            
                                        }
                                    }
                                    else {
                                        Root.message({
                                            type: 'error',
                                            message: '上传失败'
                                        });
                                    }
                                    return
                                }
                                else if (result_.data.success) {
                                    me.messagelist = clone(result_.data.status.messagelist);
                                    me.add_Step = 1;
                                    me.loading_nextStep = false;
                                    
                                    // selectedrows upload_list
                                    if (result_.data && result_.data.import_data) {
                                        me.upload_list = result_.data.import_data
                                    }
                                }
                                
                            }, function() {
                                //上传出现错误时,去掉转圈圈
                                me.loading_nextStep = false;
                            }, ocrtype);
                        },
                        // DownloadTemplate() {
                        //     var pathurl = "template/1.导入模板/植入明细导入模板.xlsx";
                        //     handleDownload(pathurl);
                        // },
                        DownloadTemplate() {
                            let me = this;
                            var filter_ = "qty_available > 0";
                            let param = {
                                ioname:"export_available_stock",
                                filter: filter_,
                                orderby: "org_name, warehouse_name, spec, batch_no",
                                token: Root.getToken()
                            }
                            window.top.vue.textdownloadForm(param);
                        },
                        
                        
                    }
                });
            };
            
            loadJsCss(function () {
                initVue();
            });
        </script>
        <style>
            /* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
            [v-cloak] {
                display: none !important;
            }
            .el-table__body tr.z_notrowclick>td{
                background-color: #aaa !important;
            }
            .el-table__body tr.z_notrowclick>td:hover {
                cursor: not-allowed;
            }
                        
            .h_table .h_h_table .h_table_tool_right .h_table_right_filter {
                width: 85% !important;
            }
            
            .h_b_template {
                position: absolute;
                right: 40px;
                top: 3px;
            }
            .el-steps {
                padding-top: 0px !important;
            }
        </style>
        
    </head>
    
    <body style="margin: 0px;">
        <div v-cloak id="vbody">
            <div id="page_root">
                <div ref="popup_body" style="padding: 0 20px;">
                    <div>
                        <el-tabs v-model="activeTabName">
                            <el-tab-pane v-for="(tab, k) in tabs" :label="tab.name" :name="tab.code" :key="k">
                            </el-tab-pane>
                        </el-tabs>
                        
                        <el-button class="h_b_template" v-show="activeTabName == 'upload_sku'" @click="DownloadTemplate">模板下载</el-button>
                    </div>
                    
                    <div class="h_dialog__body" style="height: 390px;">
                        <h-table v-show="activeTabName == 'select_sku'"
                            v-if="isRefresh && tableFields.length"
                            ref="table1"
                            :table-fields="tableFields" 
                            :table-data="tableData" 
                            :pagesize="pagesize"
                            :pagenum="pagenum"
                            :total="total"
                            :table-height="tableHeight"
                            :table-field-click="tablefieldClick"
                            :is-highlight-row="isedit"
                            :is-show-index="false"
                            :filtersobj="filterObj"
                            :basicfilterfields="basicfilterfields"
                            :basicfilter-attr="basicfilterAttr"
                            :filter-attr="filterAttr"
                            :shoppingcart-rewrite-fields="shoppingcartRewriteFields"
                            
                            v-on:get-data="getData"
                            v-on:row-click="rowClick"
                            v-on:order-fields="orderTableFields"
                            
                            :select-table-data="selectedrows"
                            :is-selection="true"
                            :isshow-shoppingcart="true"
                            v-on:selection-change="selectionChange"
                            v-on:save-shoppingcart="saveShoppingcart"
                        >
                        </h-table>
                        <!-- 
                        :is-within-edit-table-data="isinputedit"
                         v-on:row-dblclick="rowDblclick"
                         -->
                         
                         <div v-show="activeTabName == 'upload_sku'" >
                             <div class="popup_el-dialog__header">
                                 <div class="dialog-title">
                                     <i class="iconfont icon-customermanagement"></i>
                                     <span> 文件上传 </span>
                                 </div>
                             </div>
                             <div class="el-dialog__body" style="height: 360px; margin-top: 10px;">
                                 <div class="class_dataImport" style="padding: 0px 24px;">
                                     <!-- 数据导入步骤 -->
                                     <el-steps :active="add_Step" finish-status="success">
                                         <!-- 步骤一 -->
                                         <el-step title="选择文件"></el-step>
                                         <!-- 步骤二 -->
                                         <el-step title="上传结果"></el-step>
                                     </el-steps>
                                     <div style="height: 300px; border: 1px solid #C0C4CC; padding:0px; box-sizing:boder-box; overflow: auto;">
                                         <!-- 步骤一,选择数据文件 -->
                                         <div v-if="add_Step == 0" style="width: 100%; height: 100%;" align="center">
                                             <div style="padding-top: 90px; box-sizing:boder-box">
                                                 <el-upload class="upload-demo" :before-upload="beforeAvatarUpload"
                                                     :accept="filetype"
                                                     :on-exceed="handleExceed" :action="upload_url" :headers="upload_headers"
                                                     :on-success="upload_change_" :on-error="upload_error"
                                                     :on-change="upload_change" :multiple="upload_multiple" :limit="2"
                                                     :file-list="fileList" :auto-upload="false" ref="upload">
                                                     <el-button size="small" type="primary">选择文件</el-button>
                                                     <div slot="tip" class="el-upload__tip">{{filetype ? '仅上传' + filetype + '文件' : '可上传全部类型文件'}}</div>
                                                 </el-upload>
                                                 <div style="width: 100%; text-align: left;">
                                                     <!-- 上传时的反馈日志 -->
                                                     <li v-for="row in messagelist">{{row}}</li>
                                                 </div>
                                             </div>
                                         </div>
                         
                                         <!-- 导入数据的预览 -->
                                         <div v-if="add_Step == 1" style="width: 100%; height: 100%; margin:0 auto">
                                             <div v-if="errorlines && errorlines.length">
                                                 <!-- 上传时的错误日志 -->
                                                 <div>错误信息:
                                                     <el-button v-if="iobatchid" size="small" type="danger" style="float: right;margin-top: 5px; margin-right: 5px;"
                                                      @click="downloadErrorsData">导出错误数据</el-button>
                                                 </div>
                                                 
                                                 <div v-for="(messages, key) in errorlines" :key="key">
                                                     <i class="errorspan">{{messages.error_message}}, 数量 {{messages.error_count}}</i>
                                                 </div>
                                             </div>
                                             
                                             <div v-if="messagelist && messagelist.length">
                                                 <!-- 上传时的反馈日志 -->
                                                 <div>上传过程:</div>
                                                 <li v-for="row in messagelist">{{row}}</li>
                                             </div>
                                         </div>
                                     </div>
                                 </div>
                             
                             </div>
                         </div>
                    </div>
                    
                    <!-- 底部工具栏 -->
                    <div class="el-dialog__footer">
                        <el-button size="small" type="default" @click="closeDialog">取 消</el-button>
                        <el-button v-show="activeTabName == 'select_sku'" size="small" v-if="isedit" type="primary" @click="saveAfter">确 定</el-button>
                        
                        <el-button v-if="add_Step == 0 && activeTabName == 'upload_sku'" :disabled="disabled_NextStepLength" type="primary"
                            :loading="loading_nextStep" size="small" @click="NextStep">上 传</el-button>
                            
                        <el-button v-else-if="add_Step == 1 && activeTabName == 'upload_sku' && iobatchid" type="primary"
                            size="small" @click="UpStep()">上一步</el-button>
                        <el-button v-else-if="add_Step == 1 && activeTabName == 'upload_sku'" :disabled="disabled_NextStepLength" type="primary"
                            :loading="loading_nextStep" size="small" @click="uploadSaveAfter()">确 定</el-button>
                            
                    </div>
                </div>
            </div>
        </div>
        
        <div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 50vh;">
            <div class="spinner">
              <div class="cube1"></div>
              <div class="cube2"></div>
            </div>
        </div>
        
    </body>
</html>