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
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
<!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);
            }
 
            var initlized = false;
            let id = 1000;
 
            function initVue() {
                new ListVue({
                    el: "#vbody",
                    data: {
                        dataname: "iv_book_balance",
                        tabaleFieldsName: "product_",
                        radio: "4",
                        datanamemapping: "prodcategory_mapping",
                        title: "票折参数",
                        tableHeight2: 510,
                        isEditData: false,
                        isEditTreeData: false,
                        isEditTableData: false,
                        lastsaleprice: "",
                        currorderprice: "",
                        currfixedprice: "",
                        currorderfixedprice: "",
                        treeFields: [
 
                        ],
 
                        isgroup_sku: false,
                        isgroup_order: false,
                        selectedTreeData: {},
                        skuAllObj: {},
                        tableskuindexs: [],
                        tableskuData: [],
                        tableskuDataObj: {},
                        newtableskuData: [],
                        formOrderData: {},
 
                        tableFields: [
 
                        ],
                        istree: false,
                        treeDataObj: {},
                        treeData: [],
                        defaultExpandedKeys: [],
                        defaultProps: {
                            children: 'children',
                            label: 'label'
                        },
                        tableData: [],
                        productTypehome: [],
                        filterText: '',
                        selectrow: {},
                    },
                    created() {
 
                    },
                    mounted() {
                        let me = this;
                        // this.initData();
                        // this.getTree();
                        // this.getAllSKU();
                        //this.onQuery();
                        this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
                            hideLoading();
                        });
                        //获取默认的设置
                        // var params = {
                        //     dataname: "tempdemo",
                        //     isClientMode: false,
                        //     filter: " name = 'rebatelimit' ",
                        // }
 
                        // Server.call("root/data/getEntitySet", params, function(result) {
                        //     console.log(result);
                        //     if (result && result.data.entityset) {
                        //         me.currorderfixedprice = result.data.entityset[0].value;
                        //     }
                        // });
                    },
                    methods: {
                        initData() {
                            //1. run only
                            if (initlized) {
                                return;
                            }
                            initlized = true;
                        },
 
                        ArrayToTree(array_, name, parentId, parId, disabled_field, isencode) {
                            if (!parentId) {
                                parentId = "parent_id";
                            }
                            if (!name) {
                                name = "label";
                            }
                            if (!parId) {
                                parId = "";
                            }
 
                            let obj = {};
                            let result = [];
                            let list = JSON.parse(JSON.stringify(array_));
                            list.map(el => {
                                obj[el.id] = el;
                            })
                            let openId = "";
                            for (let i = 0, len = list.length; i < len; i++) {
                                let parentId_ = list[i][parentId];
                                //如果存在判断只读字段,并且该字段有值则设置该节点为只读
                                if (disabled_field) {
                                    if (list[i][disabled_field]) {
                                        list[i].disabled = true;
                                    }
                                }
 
                                //设置显示字段
                                if (isencode) {
                                    list[i].label = decodeURI(encodeURI(list[i][name])); //数据如果带“%”的需要编码再解码,否则会存在格式错误
                                    list[i].name = decodeURI(encodeURI(list[i][name]));
                                } else {
                                    list[i].label = decodeURI(list[i][name]);
                                    list[i].name = decodeURI(list[i][name]);
                                }
                                if (parentId_ == parId || !parentId_ || parentId_ == "null") {
                                    if (!obj[list[i].id].children) {
                                        obj[list[i].id].children = null;
                                    }
                                    result.push(list[i]);
                                    continue;
                                } else if (obj[parentId_]) {
                                    if (!obj[parentId_].children) {
                                        obj[parentId_].children = [];
                                    }
                                    obj[parentId_].children.push(list[i]);
                                }
                            }
                            return result;
                        },
                        /* getData(page) {
                            this.onQuery();
                        }, */
 
                        onServerInitData(data) {
                            var me = this.data;
 
                            me.tableFields = data.tableFields;
 
 
                            if (me.tableFields.length > 0) {
                                for (var i = 0; i < me.tableFields.length; i++) {
                                    let fieldObj_ = me.tableFields[i];
 
                                    me.tableFieldsObj[fieldObj_.field] = fieldObj_;
                                }
                            }
                        },
                        /* onQuery() {
                            let result = this.productTypehome.filter(item => {
                                let bo = true;
                                
                                for(var k in this.formInline) {
                                    let k_val = this.formInline[k];
                                    let bo_ = item[k].toLowerCase().indexOf(k_val.toLowerCase()) > -1;
                                    if (!bo_) {
                                        return false;
                                    }
                                }
                                return bo;
                            });
                        }, */
                        getAllSKU() {
                            var me = this;
                            let filter_ = "1=1";
 
                            var p_id = this.selectedTreeData.id;
 
                            let param_ = {
                                isClientMode: false,
                                dataname: "sku",
                                filter: filter_,
                            }
                            Server.call("root/data/getEntitySet", param_, function(result) {
                                console.log(result);
                                if (result && result.data) {
                                    var data_ = result.data.entityset;
                                    var i = 0;
                                    data_.map(t => {
                                        me.skuAllObj[t.md_code] = i;
                                        i++;
                                    });
                                    var showData = [];
                                    if (p_id == "t1_1") {
                                        var k = 0;
                                        data_.map(t => {
                                            if (k < 3) {
                                                showData.push(t)
                                            }
                                            k++;
                                        });
                                    } else if (p_id == "t1_3") {
                                        var m = 0;
                                        data_.map(t => {
                                            if (m < 6) {
                                                showData.push(t)
                                            }
                                            m++;
                                        });
                                    }
                                    me.tableData = showData; //data_;
                                }
                            });
                        },
                        getTree() {
                            let me = this;
                            let filter_ = " (id = 't2' or parentid = 't2')";
                            this.filterList = [];
 
                            let param_ = {
                                isClientMode: false,
                                dataname: this.dataname,
                                //filterList: this.filterList,
                                filter: filter_,
                                //orderby: this.orderby,
                            }
                            Server.call("root/data/getEntitySet", param_, function(result) {
                                console.log(result);
                                me.total = 0;
                                me.productTypehome = [];
                                if (result && result.data) {
                                    var data_ = result.data.entityset;
                                    me.productTypehome = data_;
                                }
                                me.defaultExpandedKeys = [];
                                me.istree = false;
                                let treeDataList = me.productTypehome;
                                treeDataList.map(e => {
                                    me.treeDataObj[e.id] = e;
                                });
                                let treeData_ = me.ArrayToTree(treeDataList, "categoryname", "parentid", null,
                                    null, true);
                                treeData_.map(e => {
                                    me.defaultExpandedKeys.push(e.id);
                                    if (e.children) {
                                        e.children.map(ec => {
 
                                        });
                                    }
                                });
                                me.treeData = treeData_;
                                me.istree = true;
                            });
                        },
 
                        //点击事件
                        readnode(data, node) {
                            let me = this;
                            this.isgroup_sku = false;
                            this.isgroup_order = false;
 
                            if (!data.parentid) {
                                return
                            } else {
                                this.selectedTreeData = data;
                                if (data.parentid == "t1") { //sku和选择的sku
                                    this.isgroup_sku = true;
                                    //this.getGroupSKUById();
                                    this.getAllSKU();
                                } else if (data.parentid == "t2") { //sku和选择的sku
                                    this.isgroup_order = true;
                                    this.getGroupOrderById();
                                }
                            }
                        },
 
                        getGroupSKUById() {
                            var me = this;
                            var p_id = this.selectedTreeData.id;
                            let filter_ = "1=1  and parentid='" + p_id + "'";
 
                            let param_ = {
                                isClientMode: false,
                                dataname: "feeearmarked",
                                filter: filter_,
                            }
                            Server.call("root/data/getEntitySet", param_, function(result) {
                                console.log(result);
                                me.tableskuindexs = [];
                                me.tableskuData = [];
                                if (result && result.data) {
                                    var data_ = result.data.entityset;
                                    var tableskuindexs_ = []
                                    data_.map(d => {
                                        if (me.skuAllObj[d.skuid]) {
                                            tableskuindexs_.push(me.skuAllObj[d.skuid]);
                                        }
                                        me.tableskuDataObj[d.skuid] = d;
                                    });
                                    me.tableskuindexs = tableskuindexs_;
                                    me.tableskuData = data_;
 
                                    if (me.tableskuindexs.length) {
                                        me.setselecttablesku();
                                    }
                                }
                            });
                        },
 
                        setselecttablesku() {
                            var rows = [];
                            this.tableskuindexs.map(t => {
                                rows.push(this.tableskuData[t]);
                            });
 
                            if (rows.length) {
                                rows.forEach(row => {
                                    this.$refs.skutable.toggleSelectionByRow(row);
                                });
                            } else {
                                this.$refs.skutable.clearSelection();
                            }
                        },
                        onSelectionChange(val) {
                            this.newtableskuData = val;
                        },
 
                        getGroupOrderById() {
                            var me = this;
                            var p_id = this.selectedTreeData.id;
                            let filter_ = "1=1  and parentid='" + p_id + "'";
 
                            let param_ = {
                                isClientMode: false,
                                dataname: "feequotaprice",
                                filter: filter_,
                            }
 
 
                            Server.call("root/data/getEntitySet", param_, function(result) {
                                console.log(result);
                                me.formOrderData = {};
                                if (p_id == "t2_3") {
                                    // me.formOrderData.currorderfixedprice = "10%";
                                    // me.formOrderData.selectindex = "currorderfixedprice";
                                    // me.formOrderData.currorderfixedprice = "";
                                    me.radio = "0";
                                } else if (p_id == "t2_4") {
                                    //me.currorderfixedprice = "20%";
                                    me.radio = "4";
                                }
 
                                if (result && result.data && result.data.entityset.length) {
                                    var data_ = result.data.entityset[0];
                                    me.formOrderData = data_;
                                }
                            });
                        },
                        //列表添加
                        onAddData(config) {
                            var me = this;
 
                            config.combine({
                                url: "../order/sorder/popup_feeTypeEdit.html",
                                sceneCode: "add",
                                data: {},
                                delta: {},
                                callback: function(obj) {
                                    me.saveRowTable_popup(obj);
                                }
                            });
 
                            return true;
                        },
                        //列表删除
                        delData(scope) {
                            let me = this;
                            if (this.onDelData) {
                                this.onDelData.call(this, scope);
                                return
                            }
                            let row = scope.row;
                            let index_ = scope.$index;
                            let name_ = "该数据";
 
                            if (!this.datanamemapping) {
                                Root.message({
                                    type: 'warning',
                                    message: '该事件需指定数据对象'
                                });
                                return
                            }
                            if (!row.id) {
                                Root.message({
                                    type: 'warning',
                                    message: '该事件需存在数据ID'
                                });
                                return
                            }
                            if (row.name) {
                                name_ = "_" + row.name + "_";
                            }
 
                            Root.confirm('确定删除' + name_ + '吗?', '删除提示', {
                                confirmButtonText: '删除',
                                cancelButtonText: '取消',
                                type: 'warning'
                            }).then(() => {
                                let param = {
                                    id: row.id,
                                    isClientMode: false,
                                }
                                Server.call("root/data/deleteEntity/" + this.datanamemapping, param, function(
                                    result) {
                                    console.log(result);
                                    Root.message({
                                        type: 'success',
                                        message: '删除成功!'
                                    });
 
                                });
                            }).catch(() => {
                                Root.message({
                                    type: 'info',
                                    message: '已取消删除'
                                });
                            });
                        },
                        saveData() {
                            var me = this;
                            var array_ = [];
 
                            var entity_ = {};
                            entity_.id = "1";
                            entity_.name = "rebatelimit";
                            entity_.value = this.currorderfixedprice;
 
                            let param = {
                                isClientMode: false,
                                dataname: "tempdemo",
                                entity: entity_,
                            }
 
                            Server.call("root/data/saveEntity", param, function(result) {
                                console.log(result);
                                if (result.success) {
                                    Root.message({
                                        type: 'success',
                                        message: '保存成功'
                                    });
                                } else {
                                    Root.message({
                                        type: 'warning',
                                        message: result.message
                                    });
                                }
 
                            });
 
 
 
                            // if (this.isgroup_sku) {
                            //     this.saveSKUData();
                            // }
                            // else if (this.isgroup_sku) {
                            //     this.saveOrderData();
                            // }
                        },
                        saveSKUData() {
                            this.newtableskuData;
                            this.tableskuData;
                            this.tableskuDataObj;
 
                            var earmarked_ = [];
                            if (this.newtableskuData.length) {
                                this.newtableskuData.map(n => {
                                    if (this.tableskuDataObj[n.md_code]) {
                                        earmarked_.push(n);
                                    } else {
                                        var r = {
                                            parentid: this.selectedTreeData.id,
                                            skuid: n.md_code,
                                            skuname: n.md_description,
                                        }
                                        earmarked_.push(r);
                                    }
                                });
                            }
 
                            earmarked_;
                        },
                        saveOrderData() {
                            this.formOrderData;
 
                        },
                        //列表编辑
                        onEditData(config, scope) {
                            var me = this;
                            var row = scope.row;
 
                            //1. empty row
                            if (!row || !row.id) {
                                Root.message({
                                    type: 'warning',
                                    message: '请选择要编辑的数据'
                                });
                                return false;
                            }
 
                            //2. popup                    
                            config.combine({
                                url: "../order/sorder/popup_feeTypeEdit.html",
                                sceneCode: "edit",
                                data: row,
                                delta: {},
                                callback: function(obj) {
                                    me.saveRowTable_popup(obj);
                                }
                            });
 
                            return true;
                        },
                        //列表保存数据
                        saveRowTable_popup: function(obj) {
                            var me = this;
                            var formData_ = obj.row;
                            var operationtype_ = this.operationtype;
 
                            if (operationtype_ == "edit") { //修改
                                var paramObj = {};
                                for (var k in formData_) {
                                    paramObj[k] = formData_[k];
                                }
                                var param = paramObj;
                                param.isClientMode = false;
 
                                Server.call("root/data/updateEntity/" + this.datanamemapping, param, function(
                                result) {
                                    console.log(result);
                                });
                            } else { //新增
                                var param = formData_;
                                param.isClientMode = false;
                                Server.call("root/data/insertEntity/" + this.datanamemapping, param, function(
                                result) {
                                    console.log(result);
                                });
                            }
                        },
 
                        //添加树
                        onNewTreeRecord() {
                            /* this.treeFields;
                            this.selectrow = {};
                            this.formData = {};
                            this.openMsg1('add'); */
                            //1.
                            this.operationtype = "add";
                            //this.selectedrow = {};
 
                            //2. get config and go
                            var config = new Config(),
                                go = true;
 
                            if (this.onAddTreeData) {
                                go = this.onAddTreeData.call(this, config);
                            }
 
                            //3. popup
                            if (go) {
                                this.doPopup(config);
                            }
                        },
                        onAddTreeData(config) {
                            var me = this;
                            config.combine({
                                url: "../order/sorder/popup_feeType.html",
                                sceneCode: "add",
                                data: {},
                                delta: {
                                    treeFields: [{
                                            isshow: "T",
                                            field: "categoryname",
                                            name: "分组名称"
                                        },
                                        {
                                            isshow: "T",
                                            field: "parentid",
                                            name: "上级",
                                            type: "select",
                                            options: [{
                                                label: "转款分组",
                                                value: "t1"
                                            }, {
                                                label: "抵扣模式",
                                                value: "t2"
                                            }],
                                            required: true
                                        },
                                    ]
                                },
                                callback: function(obj) {
                                    me.saveRowTree_popup(obj);
                                }
                            });
 
                            return true;
                        },
                        //编辑树
                        editnode: function(scope) {
                            //1.
                            this.operationtype = "edit";
                            //this.selectedrow = scope.row;
 
                            //2. get config and go
                            var config = new Config(),
                                go = true;
                            if (this.onEditTreeData) {
                                go = this.onEditTreeData.call(this, config, scope);
                            }
 
                            //3. popup
                            if (go) {
                                this.doPopup(config);
                            }
                        },
                        onEditTreeData(config, scope) {
                            var me = this;
                            var row = scope;
 
                            //1. empty row
                            if (!row || !row.id) {
                                Root.message({
                                    type: 'warning',
                                    message: '请选择要编辑的数据'
                                });
                                return false;
                            }
 
                            //2. popup                    
                            config.combine({
                                url: "../order/sorder/popup_feeType.html",
                                sceneCode: "edit",
                                data: row,
                                delta: {
                                    treeFields: [{
                                            isshow: "T",
                                            field: "categoryname",
                                            name: "分组名称"
                                        },
                                        {
                                            isshow: "T",
                                            field: "parentid",
                                            name: "上级",
                                            type: "select",
                                            options: [{
                                                label: "转款分组",
                                                value: "t1"
                                            }, {
                                                label: "抵扣模式",
                                                value: "t2"
                                            }],
                                            required: true
                                        },
                                    ]
                                },
                                callback: function(obj) {
                                    me.saveRowTree_popup(obj);
                                }
                            });
 
                            return true;
                        },
                        //删除树
                        remove(node, data) {
                            let me = this;
                            Root.confirm('确定删除-' + data.name + '-吗?', '删除提示', {
                                confirmButtonText: '删除',
                                cancelButtonText: '取消',
                                type: 'warning'
                            }).then(() => {
                                let param = {
                                    id: data.id,
                                    isClientMode: false,
                                }
                                Server.call("root/data/deleteEntity/" + this.dataname, param, function(result) {
                                    console.log(result);
                                    Root.message({
                                        type: 'success',
                                        message: '删除成功!'
                                    });
                                    me.getTree();
                                });
                            }).catch(() => {
                                Root.message({
                                    type: 'info',
                                    message: '已取消删除'
                                });
                            });
                        },
                        //保存树
                        saveRowTree_popup: function(obj) {
                            var me = this;
                            var formData_ = obj.row;
                            var operationtype_ = this.operationtype;
 
                            if (operationtype_ == "edit") { //修改
                                var paramObj = {};
                                for (var k in formData_) {
                                    paramObj[k] = formData_[k];
                                }
                                var param = paramObj;
                                param.isClientMode = false;
 
                                Server.call("root/data/updateEntity/" + this.dataname, param, function(result) {
                                    console.log(result);
                                    me.getTree();
                                });
                            } else { //新增
                                var param = formData_;
                                param.isClientMode = false;
                                Server.call("root/data/insertEntity/" + this.dataname, param, function(result) {
                                    console.log(result);
                                    me.getTree();
                                });
                            }
                        },
 
                        setEditTableData() {
                            this.isRefresh = false;
                            this.isEditTableData = !this.isEditTableData;
                        },
                        onRefreshTree() {
                            this.getTree();
                        },
                        filterNode(value, data) {
                            if (!value) return true;
                            return data.label.indexOf(value) !== -1;
                        },
 
                    }
                });
            };
 
            loadJsCss(function() {
                initVue();
            });
        </script>
 
        <style>
            /* 在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
            [v-cloak] {
                display: none !important;
            }
        </style>
 
        <style>
            .el-dialog__body {
                border-top: 1px solid #ccc;
                border-bottom: 1px solid #ccc;
                padding: 20px;
            }
 
            .custom-tree-node {
                flex: 1;
                display: flex;
                align-items: center;
                justify-content: space-between;
                font-size: 14px;
                padding-right: 8px;
            }
        </style>
    </head>
 
    <body style="margin: 0px;">
        <div v-cloak id="vbody">
            <div id="page_root">
                <div style="width: 100%; height: 100%; padding: 10px; box-sizing: border-box;">
                    <div :style="{width: '38%', height: tableHeight2 + 60+'px', float: 'left', border: '1px solid #ccc'}">
                        <div v-if="treeData.length > 0" style="height: 32px; border-bottom: 1px solid #aaa;">
                            <div class="topbar" style="float: left; line-height: 32px;">
                                <span>{{title}}</span>
                            </div>
                            <div style="float: right; margin: 10px;">
                                <el-button-group style="margin-left: 3px; ">
                                    <el-button icon="el-icon-refresh" @click="onRefreshTree">刷新</el-button>
                                    <el-button icon="el-icon-plus"  @click="onNewTreeRecord">添 加</el-button>
                                    <el-button @click="isEditTreeData = !isEditTreeData">{{isEditTreeData ? '取消编辑' : '编 辑'}}</el-button>
                                </el-button-group>
                            </div>
                        </div>
                        <div style=" padding: 20px;">
                            <el-input
                              placeholder="输入搜索字"
                              v-model="filterText">
                            </el-input>
                        </div>
                        <div v-if="treeData.length > 0 && istree" :style="{height: tableHeight2 - 68 +'px', padding: '0px 20px 20px 20px', 'box-sizing': 'border-box'}">
                            <div :style="{height: tableHeight2 - 80  +'px', 'overflow-y': 'auto', 'font-size': '14px'}">
                                <el-tree ref="tree" 
                                :data="treeData" 
                                :props="defaultProps" 
                                node-key="id"
                                :filter-node-method="filterNode" 
                                :default-expanded-keys="defaultExpandedKeys"
                                highlight-current
                                @node-click="readnode">
                                    <span class="custom-tree-node" slot-scope="{ node, data }">
                                        <span>{{ node.label }}</span>
                                        <span v-if="isEditTreeData">
                                            <el-button style="padding: 2px; font-size: 10px;"
                                            @click="() => editnode(data, node)">编辑</el-button>
                                            <el-button type="danger" size="mini" style="padding: 2px; font-size: 10px;" 
                                            @click="() => remove(node, data)">删除</el-button>
                                        </span>
                                    </span>
                                </el-tree>
                            </div>
                        </div>
                    </div>
                    <div v-if="istree" :style="{width: '61%', height: tableHeight2 + 60+'px', float: 'right', border: '1px solid #ccc'}">
                        <div style="height: 32px; border-bottom: 1px solid #aaa;">
                            <div class="topbar" style="float: left; line-height: 30px;">
                                <span>详情</span>
                            </div>
                            <div style="float: right; margin: 10px;">
                                <el-button-group style="margin-left: 3px; ">
                                    <!-- <el-button icon="el-icon-refresh" @click="onRefreshTree">刷 新</el-button> -->
                                    <el-button @click="saveData":icon="buttonsconfig.save.icon">{{buttonsconfig.save.name}}</el-button>
                                    <!-- <el-button icon="el-icon-plus"  @click="addData" >添 加</el-button> -->
                                    <!-- <el-button @click="setEditTableData" >{{isEditTableData ? '取消编辑' : '编 辑'}}</el-button> -->
                                </el-button-group>
                            </div>
                        </div>
                        <h-table v-if="isgroup_sku"
                            ref="skutable"
                            :table-fields="tableFields" 
                            :table-data="tableData" 
                            :is-edit-table-data="isEditTableData"
                            :pagenum="pagenum"
                            :total="total"
                            :table-height="tableHeight2"
                            :is-highlight-row="true"
                            :is-selection="true"
                            :is-pagination="false"
                            
                            v-on:edit-data="editData"
                            v-on:del-data="delData"
                            v-on:selection-change="onSelectionChange">
                        </h-table>
                        
                        <div v-if="isgroup_order" style="cusor:pointer;padding: 20px; line-height: 30px;">
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-radio v-model="radio" label="1">按上月订单占比(%)</el-radio>
                                </el-col>
                                <el-col :span="12">
                                    <el-input v-model="lastsaleprice" :disabled="radio == 1 ? 0 : 1" placeholder="请输入占比"></el-input>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-radio v-model="radio" label="2">按本月占比(%)</el-radio>
                                </el-col>
                                <el-col :span="12">
                                    <el-input v-model="currorderprice" :disabled="radio == 2 ? 0 : 1" placeholder="请输入占比"></el-input>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-radio v-model="radio" label="3">本月固定抵扣额度</el-radio>
                                </el-col>
                                <el-col :span="12">
                                    <el-input v-model="currfixedprice" :disabled="radio == 3 ? 0 : 1" placeholder="请输入额度"></el-input>
                                </el-col>
                            </el-row>
                            <el-row :gutter="20">
                                <el-col :span="12">
                                    <el-radio v-model="radio" label="4">每单固定抵扣额度</el-radio>
                                </el-col>
                                <el-col :span="12">
                                    <el-input v-model="currorderfixedprice" :disabled="radio == 4 ? 0 : 1" placeholder="请输入额度"></el-input>
                                </el-col>
                            </el-row>
                        </div>
                    </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>