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
<!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 FormVue({
                    el: "#vbody",
                    data: {
                        dataname: "so_order",
                        table_dataname: "",
                        title: "寄售订单信息",
 
                        formAttr: {
                            istitle: false,
                            title: "表单名称",
                            columnnumber: 2,
                            labelwidth: "140px",
                            labelposition: "left",//"left",// right//top
                            size: "mini",
                            border: "5px solid #c6c6c600"
                        },
                        formFields: [
                            {isshow: "T", field: "order_type", name: "订单类型", type: "select", disabled:true, Option:[
                                {label:"寄售订单",value:"寄售订单"},
                            ]},
                            {isshow: "T", field: "code", name: "订单编号", type: "span", disabled: true, required: true, notvalunit: true},
                            {isshow: "T", field: "sales_group", name: "销售组织", type: "select", disabled: true, required: true, notvalunit: true},
                            {isshow: "T", field: "product_group", name: "产品组", type: "select", disabled: true, defaultval: "", notvalunit: true},
                            {isshow: "T", field: "customer_consignee_user_name", name: "期望收货方式", type: "select",options: [{code: "普通快递",value: "普通快递"}, {code: "自提",value: "自提"}],},
                            {isshow: "T", field: "customer_consignee_phone", name: "收货地址", type: "select", required: true},
                            {isshow: "T", field: "operate_emp_name", name: "办事处分仓", type: "select"},
                            {isshow: "T", field: "business_depart_name", name: "期望交货日期", type: "date",},
                            {isshow: "T", field: "file_name_certificate_original111",name: "附件", type:"button", buttonarrayname: [{type: "isnotdatashow", buttonname:"附件上传",code:"upload", icon: "el-icon-upload", classname: "form_uploadfile"},{type:"isdata", buttonname: "查看文件", icon: "el-icon-search",code:"showfile", classname: "form_showfile"},{type: "isdatashow", buttonname: "删除附件", icon: "el-icon-delete",code:"delfile", classname: "form_delfile"}],},
                            {isshow: "T", field: "remark", name: "备注", type: "textarea", colspan:2, notvalunit: true},
                        ],
                        newformData: {
                            //id: uuid_short(),
                            code: createCode("CS"),
                            create_time: createDatetime(),
                            state_code: "Input",
                            state_name: "草稿",
                            // order_type: "寄售订单",
                            // product_group: "结构性心脏病品类",
                            // sales_group: "北京华医",
                            creator_name: window.top.vue.userinfo.name,
                            customer_id: window.top.vue.userinfo.org.id,
                            customer_code: window.top.vue.userinfo.org.code,
                            customer_name: window.top.vue.userinfo.org.name,
                            ncc_customer_code: window.top.vue.userinfo.org.ncccode,
                        },
                        formData: {},
 
                        tableFields: [
                            {isshow: "T", field: "material_code", name: "物料编码", width: "100"},
                            {isshow: "T", field: "material_name", name: "物料名称", width: "350", type: "popup", align: "left"},
                            {isshow: "T", field: "spec", name: "规格", width:"150", type: "span",},
                            {isshow: "T", field: "qty", name: "数量", type: "input", istablesum: true},
                            {isshow: "T", field: "unit", name: "单位", type: "span"}, 
                            {isshow: "T", field: "product_price", name: "保证金", formatter: "formatter_money", align: "right"},
                            
                        ],
                        newTableData: {
                            create_time: createDatetime(),
                            // creator_name: window.top.vue.userinfo.name,
                        },
                        tableData: [],
                        
                        isRefresh: true,
 
                        dataRequest: [
                            {
                                name: "md_salesgroup",//销售组织
                                //url: "root/front/getOneDictionary",
                                //paramsobj: { code: "OrgType", },
                                filter: "",
                                isnotoption: false, //true:不是选项
                                code:"code",//是下拉选项时设置
                                label:"name",//是下拉选项时设置
                            },
 
                            {
                                name: "md_prodgroup",//产品组
                                //url: "root/front/getOneDictionary",
                                //paramsobj: { code: "OrgType", },
                                isnotoption: false, //true:不是选项
                                code:"code",//是下拉选项时设置
                                label:"name",//是下拉选项时设置
                            },
 
                            {
                                name: "md_org_shipto",//收货地址
                                //url: "root/front/getOneDictionary",
                                //paramsobj: { code: "OrgType", },
                                filter: "parent_id='" + window.top.vue.userinfo.org.id + "'",
                                isnotoption: false, //true:不是选项
                                code:"address",//是下拉选项时设置
                                label:"address",//是下拉选项时设置
                            },
                        ],
                        
                        //按键权限设置
                        isedit: false,//提交前编辑,保存/提交
                        isrefuseedit: false,//拒绝后编辑,保存/再次提交
                        isapproval: false,//审批,同意/拒绝/转办/退回
                        
                        iscommit: false,//提交标记
 
                        //审批相关变量
                        loading_save: false,
                        loading_pass: false,
                        reasonvisible:false,//审批通过或拒绝填写原因
                        textarea2: '',//填写理由
                        passOrRefuse:false,
                        
                        //弹窗参数
                        popupParames: {},
                        //字段设置
                        tablefieldClick: {},
                        formfieldClick: {},
                        loading_page: false,
                        // tableCheckNopass: [],
                        
                        iscustomer: false,
                        // isoverduelicence: false,
                        t_height:null,
                    },
                    created() {
                        this.popupParames = clone(Root.popupParames);
                        if (window.top.vue.userinfo && window.top.vue.userinfo.org && window.top.vue.userinfo.org.is_account) {
                            this.iscustomer = true;
                            //动态获取默认数据
                            // if (this.popupParames.sceneCode != "browse") {
                            //     var OrgRegisterValidation_ = {
                            //         name: "OrgRegisterValidation",
                            //         url: "root/saleschecker/validCheck",
                            //         paramsobj: {
                            //             id: window.top.vue.userinfo.org.id,
                            //             checkType: "OrgRegisterValidation"
                            //         },
                            //         isnotoption: true, //true:不是选项
                            //     }
                            //     this.dataRequest.push(OrgRegisterValidation_);
                            // }
                        }
 
                        this.title = this.popupParames.title || this.popupParames.text
                        if (this.popupParames.data) {
                            this.formData = clone(this.popupParames.data);
                        }
                        
                        if (this.popupParames.sceneCode) {
                            if (this.popupParames.sceneCode == "add") {//新增
                                //动态获取默认数据
                                // var newEntity_ = {
                                //     name: "newEntity",
                                //     url: "root/data/newEntity",
                                //     paramsobj: {dataname: ""},
                                //     isnotoption: true, //true:不是选项
                                // }
                                // this.dataRequest.push(newEntity_);
                                
                                // if (this.newTableData) {
                                //     this.tableData.push(clone(this.newTableData));
                                // }
                                
                                this.isedit = true;
                            }
                            else if (this.popupParames.sceneCode == "browse") {//只读
                                this.formAttr.disabled = true;
                            }
                            else if (this.popupParames.sceneCode == "edit") {//编辑
                                this.isedit = true;
                            }
                            else if (this.popupParames.sceneCode == "approval") {//审批
                                this.formAttr.disabled = true;
                                this.isapproval = true;
                            }
                            else if (this.popupParames.sceneCode == "refuseedit") {//拒绝后的编辑
                                this.isrefuseedit = true;
                            }
                        }
                    },
                    
                    mounted() {
                        var me = this;
 
                        me.t_height = document.documentElement.clientHeight*1 - 91;
                        //预加载数据
                        if (this.dataRequest && this.dataRequest.length) {
                            var result = {};
                            this.loadRequestData(this.dataRequest, result, function(data) {
                                me.dataRequestObj = data;
                                //预加载数据后给哪些字段设置options或formatterjson
                                // if (me.dataRequestObj.newEntity) {
                                //     var formData = clone(me.dataRequestObj.newEntity.data[""]);
                                //     // formData.product_category_name = [];
                                //     if (me.newformData) {
                                //         let formData_ = clone(formData);
                                        
                                //         for (var k in me.newformData) {
                                //             if (!formData_[k]) {
                                //                 formData_[k] = me.newformData[k];
                                //             }
                                //         }
 
                                //         me.formData = formData_;
                                //     }
                                // }
                                
                                // if (me.dataRequestObj.OrgRegisterValidation) {
                                //     if (me.dataRequestObj.OrgRegisterValidation.validation && me.dataRequestObj.OrgRegisterValidation.validation.count && me.dataRequestObj.OrgRegisterValidation.validation.count.reject) {
                                //         me.isoverduelicence = true;
                                //     }
                                // }
 
                                me.initData();
                            });
                        }
                        else {
                            this.initData();
                        }
                        
                        // 以服务的方式调用的 Loading 需要异步关闭
                        this.$nextTick(() => { 
                            hideLoading();
                            
                            //重新设置弹窗宽高
                            this.$nextTick(function(){
                                //let w_ = this.$refs.popup_body.offsetWidth + "px";
                                let w_ = "900px";
                                let h_ = this.$refs.popup_body.offsetHeight + "px";
                                Root.setPopupWH(w_, h_);
                            })
                        });
                    },
                    
                    methods:{
                        //关闭弹窗
                        closeDialog() {
                            var me = this;
                            if (me.popupParames.totab){
                                Root.tab.removeItem(Root.tab.selected);
                                Root.tab.open(me.popupParames.parentOption, false); 
                            }
                            else {
                                Root.hidePopup();
                            }
                        },
                        //关闭前调回调
                        saveAfter() {
                            var me = this;
                            if(this.popupParames.callback) {
                                let obj = {
                                    //row: this.formData
                                }
                                this.popupParames.callback(obj, function() {
                                    me.closeDialog();
                                });
                            }
                            else {
                                me.closeDialog();
                            }
                        },
                        
                        initData() {
                            let me = this
                            var id_ = null;
                            
                            //字段数组转字段obj,目的为了筛选时获取字段属性
                            me.fieldsToFieldsObj();
                            
                            //设置字段事件
                            me.tableFieldClick();
 
                            if (this.formData.id) {
                                id_ = this.formData.id;
                            }
 
                            this.getRowDataById(id_, function(result) {//查询后的回调,用于获取字段的
                                if (result.meta && result.meta[me.dataname] && result.meta[me.dataname].fields) {
                                    var metas = clone(result.meta[me.dataname].fields);
                                    var table_dataname_ = "";
                                    for (var dataname_ in result.meta) {
                                        if (dataname_ != me.dataname && !table_dataname_) {
                                            table_dataname_ = dataname_;
                                        }
                                    }
                                    var table_metas = [];
                                    if (table_dataname_) {
                                        me.table_dataname = table_dataname_;
                                        table_metas = clone(result.meta[table_dataname_].fields);
 
                                    }
                                    
                                    var formFields_ = [];
                                    var tableFields_ = [];
                                    metas.map(f=>{
                                        f.isshow = "T";
 
                                        if(f.field == "salesgroup_code") {//销售组织
                                            f.options = me.dataRequestObj.md_salesgroup;
                                        }
                                        else if(f.field == "prodgroup_code") {//产品组
                                            f.options = me.dataRequestObj.md_prodgroup;
                                        }
                                        else if(f.field == "shipto_address_fullname") {//收货地址
                                            f.options = me.dataRequestObj.md_org_shipto;
                                        }
 
                                        formFields_.push(clone(f));
                                    })
                                    table_metas.map(f=>{
                                        f.isshow = "T";
                                        tableFields_.push(clone(f));
                                    })
                                    
                                    if (!me.formFields || (me.formFields && me.formFields.length == 0)) {
                                        me.formFields = clone(formFields_);
                                        me.tableFields = clone(tableFields_);
                                    }
                                }
                                
                                if (me.rowData[me.dataname]) {
                                    me.formData = me.rowData[me.dataname];
                                }
                                if (me.rowData[me.table_dataname]) {
                                    me.tableData = me.rowData[me.table_dataname];
                                }
                            })
                        },
                        
                        tableFieldClick() {
                            var me = this;
                            //表单字段事件设置
                            this.formfieldClick = {
                                hope_shipto_type_code:{
                                    select: {
                                        onchange: function(obj) {//单选更改事件
                                            var formData_ = clone(me.formData);
                                            formData_.hope_shipto_type = obj.selectoption.value || "";
                                            me.formData = clone(formData_);
                                        }
                                    },
                                },
                                
                                shipto_address_fullname:{
                                    select: {
                                        onchange: function(obj) {//单选更改事件
                                            // console.log(obj);
                                            // obj.data.type_name = clone(obj.product_type);
                                            me.inputShipto(obj);
                                        }
                                    },
                                },
                            };
                            
                            //表格字段事件设置
                            this.tablefieldClick = {
                                material_name: {
                                    popup: {
                                        onclick: function(obj) {//弹窗点击事件
                                            //打开
                                            me.tablepopup_productlist(obj);
                                        }
                                    },
                                },
                                qty: {
                                    input: {
                                        onkeydown: function(e, b) {
                                            let key = e.key;
                                            var box = /^[0-9]*$/;//数值的正则表达式
                                            if (key == "Backspace") {//删除按键Backspace
                                                return true
                                            }
                                            if (!box.test(key)) {
                                                e.returnValue = false
                                                return false
                                            }
                                            else return true
                                        },
                                    },
                                },
                            };
                        },
 
                        inputShipto(obj){
                            var me = this;
                            var formData_ = clone(me.formData);
                            
                            formData_.shipto_contact = obj.selectoption.contact_name;
                            formData_.shipto_phone = obj.selectoption.contact_phone;
                            formData_.shipto_address_id = obj.selectoption.id;
                            formData_.ncc_shipto_address_id = obj.selectoption.ncc_id;
                            
                            me.formData = clone(formData_);
                        },
                        
                        tablepopup_productlist(obj) {
                            var me = this;
 
                            let index = obj.$index;
                            Root.showPopup({
                                url: "module/order/page/popup-new_consale_order-product.html",
                                width: 800,
                                height: 550,
                                sceneCode: "add",
                                
                                callback: function(obj, callback) {
                                    me.$set(me.tableData[index], "material_code", obj.row.material_code);
                                    me.$set(me.tableData[index], "material_name", obj.row.material_name);
                                    me.$set(me.tableData[index], "unit", obj.row.unit);
                                    me.$set(me.tableData[index], "spec", obj.row.spec);
 
                                    if (callback) {
                                        callback();
                                    }
                                }
                            });
                        },
                        
                        addTableData() {
                            var table_row = clone(this.newTableData);
                            this.rowChange(table_row, "add", this.table_dataname);
                        },
                        
                        delData(scope) {
                            let me = this;
                            let row = scope.row;
                            let index_ = scope.$index;
                            
                            Root.confirm('确定删除数据【' + JSON.stringify(row) + '】吗?', '删除提示', {
                              confirmButtonText: '删除',
                              cancelButtonText: '取消',
                              type: 'warning'
                            }).then(() => {
                                me.rowChange(row, "del", me.table_dataname);
                            }).catch(() => {
                                Root.message({
                                    type: 'info',
                                    message: '已取消删除'
                                });          
                            });
                        },
                        
                        rowChange(row, type, tablename) {
                            var me = this;
                            if (type == "add") {
                                this.tableData.unshift(row);
                            }
                            else if (type == "del") {
                                if (row.id) {
                                    let param = {
                                        dataname: tablename,
                                        id: row.id
                                    }
                                    
                                    Server.call("root/data/deleteEntity", param, function(result) {
                                        console.log(result);
                                        if (result && result.data) {
                                            me.tableData.remove(row);
                                            
                                            Root.message({
                                                type: 'success',
                                                message: '删除成功!'
                                            });
                                        }
                                    });
                                }
                                else {
                                    this.tableData.remove(row);
                                }
                            }
                            else {
                            
                            }
                        },
                        
                        //提交
                        submitRowTable() {
                            this.iscommit = true;
                            this.saveRowTable();
                        },
                        
                        //保存
                        saveRowTable() {
                            var me = this;
                            var operator_ = "save";//保存
                            if(me.iscommit) {
                                operator_ = "commit";//提交
                            }
                            
                            var entity_ = clone(this.formData);
                            var entity = {};
                            for (var r in entity_) {
                                if (entity_[r] || entity_[r] == "" || entity_[r] == false || entity_[r] == 0) {
                                    entity[r] = entity_[r];
                                }
                            }
                            
                            var tableData_ = [];
                            this.tableData.map(r=>{
                                var row_ = {};
                                for (var k in r) {
                                    if (r[k]) {
                                        row_[k] = r[k];
                                    }
                                }
                                tableData_.push(row_);
                            })
                            
                            if (tableData_.length == 0) {
                                Root.message({
                                    type: 'warning',
                                    message: '请先添加明细数据'
                                });
                                return
                            }
                            
                            let param = {
                                dataname: this.dataname,
                                // operator: operator_,
                                data: {},
                            }
                            param.data[this.dataname] = entity;
                            param.data[this.table_dataname] = tableData_;
                            
                            Server.call("root/data/saveEntity", param, function(result) {
                                console.log(result);
                                if (result.success) {
                                    if(me.iscommit){
                                        me.iscommit = false;
                                        Root.message({
                                            type: 'success',
                                            message: '提交成功'
                                        }); 
                                        me.saveAfter();
                                    }
                                    else {
                                        Root.message({
                                            type: 'success',
                                            message: '保存成功'
                                        }); 
                                        me.saveAfter();
                                    }
                                }
                            });
                        },
                        
                        //审批通过相关数据赋值
                        onPassApproval(){
                            this.textarea2 = "";
                            this.reasonvisible = true;
                            this.passOrRefuse = true;
                        },
                        
                        //审批拒绝相关数据赋值
                        onRefuseApproval(){
                            this.textarea2 = "";
                            this.reasonvisible = true;
                            this.passOrRefuse = false;
                        },
                        
                        //保存通过/拒绝原因
                        saveReason(){
                            if(this.passOrRefuse){
                                //审批通过后拆分成生产订单;
                                //this.batchOrder();
                                //this.passApproval('sales',this.textarea2);
                                this.doApproval();
                            }else{
                                if(this.textarea2 != ""){
                                    //this.refuseApproval('sales',this.textarea2)
                                    this.doReject();
                                }
                                else{
                                    Root.message({
                                        type: 'warning',
                                        message: '请填写原因'
                                    });
                                }
                            }
                        },
                        
                        //审批通过
                        doApproval() {
                            var me = this;
                            
                            let param = {
                                "business_type":"sales",
                                "flow_id": this.formData.flow_id,
                                "user_id": Root.userInfo.id,
                                "pass": true,
                                "reason": this.textarea2,
                                "variableMap": {
                                    "province": this.formData.province
                                }
                            }
                            Server.call("root/workFlow/dealAct", param, function(result) {
                                // console.log(result);
                                if (result.success) {
                                    Root.message({
                                        type: 'success',
                                        message: '审批成功'
                                    }); 
                                    //拆单时要不要重新调用接口
                                    me.saveAfter();
                                }
                                else {
                                    Root.message({
                                        type: 'success',
                                        message: '已拒绝'
                                    }); 
                                    me.saveAfter();
                                }
                            });
                        },
                        
                        //审批拒绝
                        doReject() {
                            var me = this;
                            
                            let param = {
                                "business_type":"sales",
                                "flow_id": this.formData.flow_id,
                                "user_id": Root.userInfo.id,
                                "pass": false,
                                "reason": this.textarea2,
                                "variableMap": {
                                    "province": this.formData.province
                                }
                            }
                            Server.call("root/workFlow/dealAct", param, function(result) {
                                // console.log(result);
                                if (result.success) {
                                    Root.message({
                                        type: 'success',
                                        message: '已拒绝'
                                    }); 
                                    me.saveAfter();
                                }
                            });
                        },
                    }
                });
            };
            
            loadJsCss(function () {
                initVue();
            });
        </script>
        <style>
            /*  在vue.js中 v-cloak 这个指令是防止页面加载时出现 vuejs 的变量名而设计的 */
            [v-cloak] {
                display: none !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 class="el-dialog__header">
                        <div class="dialog-title">
                          <i class="iconfont icon-customermanagement"></i>
                          <span> {{title}}</span>
                        </div>
                    </div>
                    
                    <div :style="{height: t_height +'px', 'overflow-y': 'auto'}">
                    <!-- <div style="height: 550px; overflow-y: auto;"> -->
                        <div class="el-dialog__body">
                            <h-form
                                ref="form1"
                                :form-attr="formAttr"
                                :table-fields="formFields"
                                :form-data="formData"
                                :table-field-click="formfieldClick"
                            >
                            </h-form>
                            
                            <div class="h_dialog__body">
                                <div v-if="isedit || isrefuseedit" style=" text-align: right; margin-top: 20px;">
                                    <!-- 工具栏 -->
                                    <div  style=" display: inline-block; width: 90px;">
                                        <el-button-group>
                                            <el-button @click="addTableData">新增明细</el-button>
                                        </el-button-group>
                                    </div>
                                </div>
                                <h-table
                                    v-if="isRefresh && tableFields.length"
                                    ref="table1"
                                    :table-fields="tableFields" 
                                    :table-data="tableData" 
                                    :is-edit-table-data="isedit || isrefuseedit"
                                    :is-within-edit-table-data="isedit || isrefuseedit"
                                    :is-pagination="false"
                                    :table-field-click="tablefieldClick"
                                    :is-show-index="tableData.length ? true : false"
                                    :edit-table-button="editTableButton"
                                    
                                    
                                    v-on:get-data="getData"
                                    v-on:del-data="delData"
                                >
                                </h-table>
                            </div>
                            
                            <el-dialog title="填写原因" :visible.sync="reasonvisible" height="50%">
                                <el-input
                                  type="textarea"
                                  :autosize="{ minRows: 2, maxRows: 10}"
                                  placeholder="请输入原因"
                                  v-model="textarea2">
                                </el-input>
                                
                                <div slot="footer" class="dialog-footer" >
                                  <el-button type="primary" @click="saveReason">确 定</el-button>
                                  <el-button type="default" @click="reasonvisible = false">取 消</el-button>
                                </div>
                            </el-dialog>
                        </div>
                    </div>
                    <div class="el-dialog__footer">
                        <el-button size="small" type="default" @click="closeDialog">取 消</el-button>
                        <el-button size="small" v-if="isedit || isrefuseedit" type="primary" @click="saveRowTable":icon="buttonsconfig.save.icon">{{buttonsconfig.save.name}}</el-button>
                        <el-button size="small" v-if="isedit" type="success" @click="submitRowTable":icon="buttonsconfig.submit.icon">{{buttonsconfig.submit.name}}</el-button>
                        <el-button size="small" v-if="isrefuseedit" type="success" @click="">再次提交</el-button>
                        
                        <el-button size="small" v-if="isapproval" type="success" @click="onPassApproval">通 过</el-button>
                        <el-button size="small" v-if="isapproval" type="danger" @click="onRefuseApproval">拒 绝</el-button>
                        <!-- <el-button size="small" v-if="isapproval" type="primary" @click="">转 办</el-button>
                        <el-button size="small" v-if="isapproval" type="success" @click="">退 回</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>