tom
2023-12-06 9e968679ed2e6937aeb7b50a6c450d5d19251f42
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
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
<!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 src="../../../js/vue/vue.js"></script>
        <script src="../../../js/vue/element-ui/lib/index.js"></script>
        <script src="../../../js/vue/axios/dist/axios.min.js"></script>
        <script src="../../../js/myelement.js?v=20220615"></script>
        <script src="../../../js/vue/page.js?v=20220615"></script>
 
        <link href="../../../js/vue/element-ui/lib/theme-chalk/index.css" rel="stylesheet">
        <link href="../../../css/myelement.css?v=20220425" rel="stylesheet">
        <link href="../../../css/iconfont.css" rel="stylesheet">
        <link href="../../../css/page.css?v=20220425" rel="stylesheet">
        <link href="//at.alicdn.com/t/font_2374495_mkoo966o0uo.css" rel="stylesheet">
    </head>
    <body>
        <div id="vbody">
            <div id="page_root">
                <div ref="popup_body" style="height: 100vh; overflow: auto; position: relative;">
                    <!-- <div class="el-dialog_header" style="height: 40px;">
                        <div class="dialog-title">
                            <span ref="ref_title"></span>
                        </div>
                    </div> -->
                    <div class="sorder_body" style="position: absolute; top: 0px; bottom: 51px; overflow: auto; width: 100vw;">
                        <div class="dialog-title" style="padding: 10px;">
                            <span ref="ref_title"></span>
                        </div>
                        <div ref="elbody" class="el-dialog_body" >
                            
                            <el-collapse v-model="activeNames">
                              <el-collapse-item title="单据信息" name="1">
                                <div >
                                    <h-form
                                     :form-attr="formAttr" 
                                     :table-fields="formFields" 
                                     :form-data="order_form" 
                                     :is-end-colspan="false"
                                     >
                                    </h-form>
                                </div>
                                <div>
                                    {{lastmessage}}
                                </div>
                              </el-collapse-item>
                            </el-collapse>
                            
                            
                            <div v-if="order_detail.length">
                                <el-collapse v-model="activeNames_detail">
                                    <el-collapse-item title="明细信息" name="2">
                                    <div v-for="row in order_detail" style="border-bottom: 1px solid #EBEEF5 ;">
                                        <h-form
                                         :form-attr="formAttr" 
                                         :table-fields="tableFields" 
                                         :form-data="row" 
                                         :is-end-colspan="false"
                                         >
                                        </h-form>
                                    </div>
                                </el-collapse-item>
                                </el-collapse>
                            </div>
                            
                            
                        </div>
                    </div>
                    
                    <div class="el-dialog_footer" v-if="noticeobj.type && order_type[noticeobj.type] && order_type[noticeobj.type].fileid">
                        <div >
                            <el-button type="default" @click="download">附件下载</el-button>
                        </div>
                        <!-- <el-button type="default" @click="closeDialog">关 闭</el-button> -->
                    </div>
                </div>
            </div>
            <div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 50vh;z-index:9999">
                <div class="spinner">
                    <div class="cube1"></div>
                    <div class="cube2"></div>
                </div>
            </div>
            
        </div>
 
        <script type="text/javascript">
            new ListVue({
                el: "#vbody",
                data: {
                    empcode: "",
                    title: "",
                    formAttr: {
                        title: "单据信息",
                        istitle: false,
                        columnnumber: 1,
                        labelposition: "left",
                        size: "medium",
                        border: "0px solid #c6c6c600",
                    },
                    activeNames: "1",
                    activeNames_detail: "2",
                    dataname: "",
                    detail_dataname: "",
                    order_id: "",
                    noticeobj: {},
                    form_filter_field: "",
                    detail_filter_field: "",
                    
                    
                    formFields: [],
                    tableFields: [],
                    
                    order_form: {},
                    order_detail: [],
                    old_formdata: {},
                    
                    dataRequest: [],
                    lastmessage: "",
                    
                    order_type: {
                        takeDelivery: {
                            labelwidth: "130px",
                            formDataname: "salesOrder",
                            form_filter_field: "id",
                            
                            detailDataname: "getSalesOrderDetail",
                            detail_filter_field: "a.parent_id",
                            dataRequest: [],
                            formFields: [
                                {isshow: "T", field: "code", name: "订单号", type: "span"},
                                {isshow: "T", field: "biz_date", name: "订单日期", type: "span"},
                                {isshow: "T", field: "customer_name", name: "客户", type: "span"},
                                {isshow: "T", field: "delivery_part_name", name: "发货主体", type: "span"},
                            ],
                            listFields: [
                                {isshow: "T", field: "product_name", name: "产品", type: "span"},
                                {isshow: "T", field: "product_spec", name: "产品规格", type: "span"},
                                {isshow: "T", field: "cnt", name: "销售数量", type: "span"},
                                {isshow: "T", field: "product_price", name: "单价", type: "span"},
                                {isshow: "T", field: "product_unit", name: "单位", type: "span"},
                                {isshow: "T", field: "amt", name: "销售金额", type: "span"},
                            ],
                        },
                        accountCustomerDelivery: {
                            labelwidth: "130px",
                            
                            formDataname: "customerDeliveryApprove",
                            form_filter_field: "cdm.id",
                            
                            detailDataname: "customerDeliveryApprove",
                            detail_filter_field: "cdm.id",
                            dataRequest: [],
                            formFields: [
                                {isshow: "T", field: "md_description", name: "商业名称", type: "span"},
                                {isshow: "T", field: "md_code", name: "商业编码", type: "span"},
                                {isshow: "T", field: "uscc", name: "统一社会信用代码", type: "span"},
                                {isshow: "T", field: "province_name", name: "备案省份", type: "span"},
                                {isshow: "T", field: "business_operate_name", name: "操作人", type: "span"},
                                {isshow: "T", field: "create_operate_name", name: "创建人", type: "span"},                                    
                                
                            ],
                            listFields: [
                                {isshow: "T", field: "delivery_part_name", name: "发货主体", type: "span"},    
                                {isshow: "T", field: "customer_part_name", name: "客户主体", type: "span"},
                                {isshow: "T", field: "customer_identity", name: "客户身份", type: "span", formatterjson: "{\"1\": \"经销\", \"2\": \"分销\", \"3\": \"直销\"}"},
                                {isshow: "T", field: "business_type", name: "商业属性", type: "span", formatterjson: "{\"1\": \"直管\", \"2\": \"非直管\"}"},
                                {isshow: "T", field: "business_operate_name", name: "商业操作人", type: "span"},
                                {isshow: "T", field: "create_operate_name", name: "商业创建人", type: "span"},
                                
                            ],
                        },
                        accountCustomer: {
                            labelwidth: "130px",
                            
                            formDataname: "agCustomerLeft",
                            form_filter_field: "customer.id",
                            
                            detailDataname: "",
                            detail_filter_field: "",
                            dataRequest: [],
                            
                            formFields: [
                                {isshow: "T", field: "md_description", name: "商业名称", type: "span"},
                                {isshow: "T", field: "md_code", name: "商业编码", type: "span"},
                                {isshow: "T", field: "uscc", name: "统一社会信用代码", type: "span"},
                                {isshow: "T", field: "name", name: "备案省份", type: "span"},
                                {isshow: "T", field: "operator_name", name: "操作人", type: "span"},
                                {isshow: "T", field: "create_operate_name", name: "创建人", type: "span"},        
                            ],
                            listFields: [
                                
                            ],
                        },
                        deliveryFreeze: {
                            labelwidth: "130px",
                            
                            formDataname: "customerDeliveryApprove",
                            form_filter_field: "cdm.id",
                            
                            detailDataname: "customerDeliveryApprove",
                            detail_filter_field: "cdm.id",
                            dataRequest: [],
                            
                            formFields: [
                                {isshow: "T", field: "md_description", name: "商业名称", type: "span"},
                                {isshow: "T", field: "md_code", name: "商业编码", type: "span"},
                                {isshow: "T", field: "uscc", name: "统一社会信用代码", type: "span"},
                                {isshow: "T", field: "province_name", name: "备案省份", type: "span"},
                                {isshow: "T", field: "business_operate_name", name: "操作人", type: "span"},
                                {isshow: "T", field: "create_operate_name", name: "创建人", type: "span"},                                
                            ],
                            listFields: [
                                {isshow: "T", field: "delivery_part_name", name: "发货主体", type: "span"},    
                                {isshow: "T", field: "customer_part_name", name: "客户主体", type: "span"},
                                {isshow: "T", field: "customer_identity", name: "客户身份", type: "span", formatterjson: "{\"1\": \"经销\", \"2\": \"分销\", \"3\": \"直销\"}"},
                                {isshow: "T", field: "business_type", name: "商业属性", type: "span", formatterjson: "{\"1\": \"直管\", \"2\": \"非直管\"}"},
                                {isshow: "T", field: "business_operate_name", name: "商业操作人", type: "span"},
                                {isshow: "T", field: "create_operate_name", name: "商业创建人", type: "span"},
                                
                            ],
                        },
                        accountCustomerCertification: {
                            labelwidth: "130px",
                            
                            formDataname: "getCertificationApproveList",
                            form_filter_field: "customer_delivery_certification_mapping.id",
                            
                            detailDataname: "",
                            detail_filter_field: "",
                            dataRequest: [],
                            
                            formFields: [
                                {isshow: "T", field: "md_description", name: "商业名称", type: "span"},
                                {isshow: "T", field: "md_code", name: "商业编码", type: "span"},
                                {isshow: "T", field: "delivery_part_name", name: "工厂名称", type: "span"},
                                {isshow: "T", field: "customer_part_name", name: "客户主体", type: "span"},
                                {isshow: "T", field: "customer_identity", name: "客户身份", type: "span", formatterjson: "{\"1\": \"经销\", \"2\": \"分销\", \"3\": \"直销\"}"},
                                {isshow: "T", field: "business_type", name: "商业属性", type: "span", formatterjson: "{\"1\": \"直管\", \"2\": \"非直管\"}"},
                                {isshow: "T", field: "business_operate_name", name: "商业操作人", type: "span"},
                                {isshow: "T", field: "create_operate_name", name: "创建人", type: "span"},
                                {isshow: "T", field: "remark", name: "备注", type: "span"},
                            ],
                            listFields: [
                                
                            ],
                        },
                        consignee: {
                            labelwidth: "130px",
                            
                            formDataname: "",
                            form_filter_field: "",
                            
                            detailDataname: "",
                            detail_filter_field: "",
                            dataRequest: [],
                            
                            formFields: [
                                
                            ],
                            listFields: [
                                
                            ],
                        },
                        procure: {
                            labelwidth: "130px",
                            
                            formDataname: "",
                            form_filter_field: "",
                            
                            detailDataname: "",
                            detail_filter_field: "",
                            dataRequest: [],
                            
                            formFields: [
                                
                            ],
                            listFields: [
                                
                            ],
                        },
                        licence: {
                            labelwidth: "130px",
                            
                            formDataname: "getCustomerAndLicence",
                            form_filter_field: "customer_licence_mapping.id",
                            
                            detailDataname: "",
                            detail_filter_field: "",
                            dataRequest: [],
                            
                            formFields: [
                                {isshow: "T", field: "md_code", name: "商业编码", type: "span"},
                                {isshow: "T", field: "md_description", name: "商业名称", type: "span"},
                                {isshow: "T", field: "type_name", name: "证照类型", type: "span"},
                                {isshow: "T", field: "license_term", name: "到期时间", type: "span"},
                            ],
                            listFields: [
                                
                            ],
                        },
                        agreement: {
                            labelwidth: "130px",
                            
                            formDataname: "agreement_line",
                            form_filter_field: "id",
                            
                            detailDataname: "agreementRecord",
                            detail_filter_field: "agreement_record.parent_id",
                            dataRequest: [],
                            
                            formFields: [
                                {isshow: "T", field: "code", name: "备案编号", type: "span"},
                                {isshow: "T", field: "create_time", name: "申请日期", type: "span"},
                                {isshow: "T", field: "create_operate_name", name: "申请人", type: "span"},
                                {isshow: "T", field: "emp_depart_name", name: "所属部门", type: "span"},                
                            ],
                            listFields: [
                                {isshow: "T", field: "start_date", name: "有效期开始", type: "span"},
                                {isshow: "T", field: "end_date", name: "有效期结束", type: "span"},
                                {isshow: "T", field: "customer_name", name: "客户", type: "span"},
                                {isshow: "T", field: "product_name", name: "产品", type: "span"},
                                {isshow: "T", field: "product_spec", name: "产品规格", type: "span"},
                                {isshow: "T", field: "product_pack", name: "产品单位", type: "span"},
                                {isshow: "T", field: "manager_part_code", name: "管理主体", type: "span"},
                                {isshow: "T", field: "delivery_part_name", name: "发货主体", type: "span"},
                                {isshow: "T", field: "business_type", name: "商业属性", type: "span" ,formatterjson: "{\"1\": \"直管\", \"2\": \"非直管\"}"},
                                {isshow: "T", field: "province_name", name: "省份", type: "span"},    
                                {isshow: "T", field: "business_depart_name", name: "业务部门", type: "span"},
                                {isshow: "T", field: "settle_type", name: "结算类型", type: "span",formatterjson: "{\"9\": \"Y\", \"10\": \"D\",\"11\": \"G\"}"},
                                {isshow: "T", field: "control_type", name: "控制类型", type: "span" ,formatterjson: "{\"1\": \"预付款\", \"2\": \"账期\"}"},
                                {isshow: "T", field: "days_payment", name: "付款天数", type: "span"},
                                {isshow: "T", field: "days_trans", name: "在途天数", type: "span"},    
                                {isshow: "T", field: "peroid_payment", name: "账期", type: "span"},
                                {isshow: "T", field: "tag_price_type", name: "中标类型", type: "span"},
                                {isshow: "T", field: "tag_price", name: "中标价", type: "span"},
                                {isshow: "T", field: "invoice_limit_price", name: "开票限价", type: "span"},
                                {isshow: "T", field: "supply_price", name: "供货价", type: "span"},    
                                {isshow: "T", field: "distribution_price", name: "分销价", type: "span"},
                                {isshow: "T", field: "retail_price", name: "零售价", type: "span"},
                                {isshow: "T", field: "delivery_rate", name: "配送费率", type: "span"},
                                {isshow: "T", field: "delivery_amt", name: "配送费", type: "span"},
                                {isshow: "T", field: "business_rate", name: "商业扣率", type: "span"},    
                                {isshow: "T", field: "cash_type_name", name: "兑付时间", type: "span"},
                                {isshow: "T", field: "rebate_type", name: "商返类型", type: "span"},
                                {isshow: "T", field: "current_tick_amt", name: "当期票折金额", type: "span"},
                                {isshow: "T", field: "current_tick_rate", name: "当期票折系数", type: "span"},
                                {isshow: "T", field: "drained_amt", name: "回笼履约金额", type: "span"},    
                                {isshow: "T", field: "drained_rate", name: "回笼履约系数", type: "span"},
                                {isshow: "T", field: "drained_arrest_amt", name: "回笼履约扣留金额", type: "span"},
                                {isshow: "T", field: "drained_arrest_rate", name: "回笼履约扣留系数", type: "span"},
                                {isshow: "T", field: "discount_common_amt", name: "基础折让金额", type: "span"},
                                {isshow: "T", field: "discount_common_rate", name: "基础折让系数", type: "span"},    
                                {isshow: "T", field: "discount_business_amt", name: "商业规范操作折让金额", type: "span"},
                                {isshow: "T", field: "discount_business_rate", name: "商业规范操作折让系数", type: "span"},
                                {isshow: "T", field: "discount_trans_amt", name: "调拨折让金额", type: "span"},
                                {isshow: "T", field: "discount_trans_rate", name: "调拨折让系数", type: "span"},    
                                {isshow: "T", field: "discount_flow_amt", name: "流水折让金额", type: "span"},
                                {isshow: "T", field: "discount_flow_rate", name: "流水折让系数", type: "span"},
                                {isshow: "T", field: "annual_cnt", name: "年度任务数量", type: "span"},
                                {isshow: "T", field: "discount_annual_amt", name: "年度折让金额", type: "span"},    
                                {isshow: "T", field: "discount_annual_rate", name: "年度折让系数", type: "span"},
                                {isshow: "T", field: "inventory_amt", name: "库存管理金额", type: "span"},
                                {isshow: "T", field: "inventory_rate", name: "库存管理系数", type: "span"},    
                                {isshow: "T", field: "discount_total_amt", name: "折让小计", type: "span"},
                                {isshow: "T", field: "discount_total_rate", name: "折让小计比率", type: "span"},
                                {isshow: "T", field: "remark", name: "备注", type: "span"},
                            ],
                        },
                        agreementTrans: {
                            labelwidth: "130px",
                            
                            formDataname: "agreementRecord",
                            form_filter_field: "line.id",
                            
                            detailDataname: "agreementRecord",
                            detail_filter_field: "agreement_record.parent_id",
                            dataRequest: [],
                            
                            formFields: [
                                {isshow: "T", field: "code", name: "备案编号", type: "span"},
                                {isshow: "T", field: "end_line.code", name: "变更后编号", type: "span"},
                                {isshow: "T", field: "create_time", name: "申请日期", type: "span"},
                                {isshow: "T", field: "create_operate_name", name: "申请人", type: "span"},
                                {isshow: "T", field: "emp_depart_name", name: "所属部门", type: "span"},
                            ],
                            listFields: [
                                {isshow: "T", field: "start_date", name: "有效期开始", type: "span"},
                                {isshow: "T", field: "end_date", name: "有效期结束", type: "span"},
                                {isshow: "T", field: "customer_name", name: "客户", type: "span"},
                                {isshow: "T", field: "product_name", name: "产品", type: "span"},
                                {isshow: "T", field: "product_spec", name: "产品规格", type: "span"},
                                {isshow: "T", field: "product_pack", name: "产品单位", type: "span"},
                                {isshow: "T", field: "manager_part_code", name: "管理主体", type: "span"},
                                {isshow: "T", field: "delivery_part_name", name: "发货主体", type: "span"},
                                {isshow: "T", field: "business_type", name: "商业属性", type: "span",formatterjson: "{\"1\": \"直管\", \"2\": \"非直管\"}"},
                                {isshow: "T", field: "province_name", name: "省份", type: "span"},    
                                {isshow: "T", field: "business_depart_name", name: "业务部门", type: "span"},
                                {isshow: "T", field: "settle_type", name: "结算类型", type: "span",formatterjson: "{\"9\": \"Y\", \"10\": \"D\",\"11\": \"G\"}"},
                                {isshow: "T", field: "control_type", name: "控制类型", type: "span" ,formatterjson: "{\"1\": \"预付款\", \"2\": \"账期\"}"},
                                {isshow: "T", field: "days_payment", name: "付款天数", type: "span"},
                                {isshow: "T", field: "days_trans", name: "在途天数", type: "span"},    
                                {isshow: "T", field: "peroid_payment", name: "账期", type: "span"},
                                {isshow: "T", field: "tag_price_type", name: "中标类型", type: "span"},
                                {isshow: "T", field: "tag_price", name: "中标价", type: "span"},
                                {isshow: "T", field: "invoice_limit_price", name: "开票限价", type: "span"},
                                {isshow: "T", field: "supply_price", name: "供货价", type: "span"},    
                                {isshow: "T", field: "distribution_price", name: "分销价", type: "span"},
                                {isshow: "T", field: "retail_price", name: "零售价", type: "span"},
                                {isshow: "T", field: "delivery_rate", name: "配送费率", type: "span"},
                                {isshow: "T", field: "delivery_amt", name: "配送费", type: "span"},
                                {isshow: "T", field: "business_rate", name: "商业扣率", type: "span"},    
                                {isshow: "T", field: "cash_type_name", name: "兑付时间", type: "span"},
                                {isshow: "T", field: "rebate_type", name: "商返类型", type: "span"},
                                {isshow: "T", field: "current_tick_amt", name: "当期票折金额", type: "span"},
                                {isshow: "T", field: "current_tick_rate", name: "当期票折系数", type: "span"},
                                {isshow: "T", field: "drained_amt", name: "回笼履约金额", type: "span"},    
                                {isshow: "T", field: "drained_rate", name: "回笼履约系数", type: "span"},
                                {isshow: "T", field: "drained_arrest_amt", name: "回笼履约扣留金额", type: "span"},
                                {isshow: "T", field: "drained_arrest_rate", name: "回笼履约扣留系数", type: "span"},
                                {isshow: "T", field: "discount_common_amt", name: "基础折让金额", type: "span"},
                                {isshow: "T", field: "discount_common_rate", name: "基础折让系数", type: "span"},    
                                {isshow: "T", field: "discount_business_amt", name: "商业规范操作折让金额", type: "span"},
                                {isshow: "T", field: "discount_business_rate", name: "商业规范操作折让系数", type: "span"},
                                {isshow: "T", field: "discount_trans_amt", name: "调拨折让金额", type: "span"},
                                {isshow: "T", field: "discount_trans_rate", name: "调拨折让系数", type: "span"},    
                                {isshow: "T", field: "discount_flow_amt", name: "流水折让金额", type: "span"},
                                {isshow: "T", field: "discount_flow_rate", name: "流水折让系数", type: "span"},
                                {isshow: "T", field: "annual_cnt", name: "年度任务数量", type: "span"},
                                {isshow: "T", field: "discount_annual_amt", name: "年度折让金额", type: "span"},    
                                {isshow: "T", field: "discount_annual_rate", name: "年度折让系数", type: "span"},
                                {isshow: "T", field: "inventory_amt", name: "库存管理金额", type: "span"},
                                {isshow: "T", field: "inventory_rate", name: "库存管理系数", type: "span"},    
                                {isshow: "T", field: "discount_total_amt", name: "折让小计", type: "span"},
                                {isshow: "T", field: "discount_total_rate", name: "折让小计比率", type: "span"},
                                {isshow: "T", field: "remark", name: "备注", type: "span"},
                            ],
                        },
                        
                        sales:{
                            labelwidth: "130px",
                            formDataname: "salesOrder",
                            form_filter_field: "id",
                            
                            detailDataname: "getSalesOrderDetail",
                            detail_filter_field: "a.parent_id",
                            dataRequest: [],
                            formFields: [
                                {isshow: "T", field: "code", name: "订单号", type: "span"},
                                {isshow: "T", field: "biz_date", name: "订单日期", type: "span"},
                                {isshow: "T", field: "customer_name", name: "客户", type: "span"},
                                {isshow: "T", field: "delivery_part_name", name: "发货主体", type: "span"},
                            ],
                            listFields: [
                                {isshow: "T", field: "product_name", name: "产品", type: "span"},
                                {isshow: "T", field: "product_spec", name: "产品规格", type: "span"},
                                {isshow: "T", field: "cnt", name: "销售数量", type: "span"},
                                {isshow: "T", field: "product_price", name: "单价", type: "span"},
                                {isshow: "T", field: "product_unit", name: "单位", type: "span"},
                                {isshow: "T", field: "amt", name: "销售金额", type: "span"},
                            ],
                        },
                        overdue_sales:{
                            labelwidth: "130px",
                            formDataname: "v_remit_customerLeft",
                            form_filter_field: "sales_order.id",
                            
                            detailDataname: "over_day",
                            detail_filter_field: "sales_order_id",
                            dataRequest: [],
                            formFields: [
                                {isshow: "T", field: "code", name: "订单号", type: "span"},
                                {isshow: "T", field: "biz_date", name: "订单日期", type: "span"},
                                {isshow: "T", field: "customer_name", name: "客户", type: "span"},
                                {isshow: "T", field: "delivery_part_name", name: "发货主体", type: "span"},
                                {isshow: "T", field: "raw_code", name: "发货单号", type: "span"},
                                {isshow: "T", field: "dur_day", name: "超账期天数", type: "span"},
                            ],
                            listFields: [
                                {isshow: "T", field: "product_name", name: "产品", type: "span"},
                                {isshow: "T", field: "product_spec", name: "产品规格", type: "span"},
                                {isshow: "T", field: "cnt", name: "发货数量", type: "span"},
                                {isshow: "T", field: "product_price", name: "单价", type: "span"},
                                {isshow: "T", field: "product_unit", name: "单位", type: "span"},
                                {isshow: "T", field: "amt", name: "金额", type: "span"},
                            ],
                        },
                        delivery_sales: {
                            labelwidth: "130px",
                            
                            formDataname: "deliveryOrderDetail",
                            form_filter_field: "do_id",
                            
                            detailDataname: "deliveryOrderDetail",
                            detail_filter_field: "parent_id",
                            dataRequest: [],
                            
                            formFields: [
                                {isshow: "T", field: "deo_code", name: "发货编号", type: "span"},
                                {isshow: "T", field: "code", name: "订单编号", type: "span"},
                                {isshow: "T", field: "customer_name", name: "客户名称", type: "span"},
                                {isshow: "T", field: "delivery_part_name", name: "发货主体", type: "span"},
                                {isshow: "T", field: "deo_raw_code", name: "工厂发货单号", type: "span"}
                            ],
                            listFields: [
                                {isshow: "T", field: "product_name", name: "产品名称", type: "span"},    
                                {isshow: "T", field: "product_spec", name: "产品规格", type: "span"},
                                {isshow: "T", field: "product_unit", name: "单位", type: "span"},
                                {isshow: "T", field: "cnt", name: "发货数量", type: "span"},
                            ],
                        },
                        delivery_revocation: {
                            labelwidth: "130px",
                            
                            formDataname: "getDeliveryOrderDetailByRevocation",
                            form_filter_field: "do.id",
                            
                            detailDataname: "getDeliveryOrderDetailByRevocation",
                            detail_filter_field: "dod.parent_id",
                            dataRequest: [],
                            
                            formFields: [
                                {isshow: "T", field: "deo_code", name: "发货编号", type: "span"},
                                {isshow: "T", field: "code", name: "退货单号", type: "span"},
                                {isshow: "T", field: "customer_name", name: "客户名称", type: "span"},
                                {isshow: "T", field: "delivery_part_name", name: "发货主体", type: "span"},
                                {isshow: "T", field: "raw_code", name: "工厂发货单号", type: "span"}
                            ],
                            listFields: [
                                {isshow: "T", field: "product_name", name: "产品名称", type: "span"},
                                {isshow: "T", field: "product_spec", name: "产品规格", type: "span"},
                                {isshow: "T", field: "product_unit", name: "单位", type: "span"},
                                {isshow: "T", field: "cnt", name: "发货数量", type: "span"},
                            ],
                        },
                        revocation: {
                            labelwidth: "130px",
                            
                            formDataname: "getReturnAndDetail",
                            form_filter_field: "revocation_order.id",
                            
                            detailDataname: "getReturnAndDetail",
                            detail_filter_field: "revocation_order_detail.parent_id",
                            dataRequest: [],
                            
                            formFields: [
                                {isshow: "T", field: "code", name: "退货单号", type: "span"},
                                {isshow: "T", field: "biz_date", name: "退货日期", type: "span"},
                                {isshow: "T", field: "customer_name", name: "客户名称", type: "span"},
                                {isshow: "T", field: "delivery_part_name", name: "发货主体", type: "span"},
                                {isshow: "T", field: "typereason", name: "退货类型    ", type: "span"},
                                {isshow: "T", field: "sub_typereason", name: "退货原因", type: "span"},
                            ],
                            listFields: [
                                {isshow: "T", field: "product_name", name: "产品", type: "span"},
                                {isshow: "T", field: "product_spec", name: "产品规格", type: "span"},
                                {isshow: "T", field: "qty_needreturn", name: "退货数量", type: "span"},
                                {isshow: "T", field: "revocation_price", name: "单价", type: "span"},
                                {isshow: "T", field: "product_unit", name: "单位", type: "span"},
                                {isshow: "T", field: "amt", name: "退货金额", type: "span"},
                                {isshow: "T", field: "settle_type_value", name: "结算方式", type: "span"},
                                {isshow: "T", field: "tax_rate", name: "税率", type: "span"},
                            ],
                        },
                        puresale_plan: {
                            labelwidth: "130px",
                            
                            formDataname: "puresaleDetailInfo",
                            form_filter_field: "plan_puresale.id",
                            fileid: "file_id",
                            
                            detailDataname: "puresaleDetailInfo",
                            detail_filter_field: "plan_puresale_detail.parent_id",
                            dataRequest: [],
                            
                            formFields: [
                                {isshow: "T", field: "code", name: "编码", type: "span"},
                                {isshow: "T", field: "year", name: "年份", type: "span"},
                                {isshow: "T", field: "month", name: "月份", type: "span"},
                                {isshow: "T", field: "province_name", name: "省份", type: "span"},
                                
                            ],
                            listFields: [
                                {isshow: "T", field: "marketing_company_name", name: "业务线", type: "span"},
                                {isshow: "T", field: "sales_company_name", name: "业务单元", type: "span"},
                                {isshow: "T", field: "sub_company_name", name: "分公司", type: "span"},
                                {isshow: "T", field: "customer_name", name: "商业", type: "span"},
                                {isshow: "T", field: "shop_name", name: "网点", type: "span"},
                                {isshow: "T", field: "product_name", name: "产品", type: "span"},
                                {isshow: "T", field: "cnt", name: "数量", type: "span"},
                            ],
                        },
                        verification: {
                            labelwidth: "130px",
                            
                            formDataname: "invoice_info",
                            form_filter_field: "invoice_order.id",
                            fileid: "file_id",
                            
                            detailDataname: "invoice_info",
                            detail_filter_field: "invoice_order.id",
                            dataRequest: [],
                            
                            formFields: [
                                {isshow: "T", field: "code", name: "开票编码", type: "span"},
                                {isshow: "T", field: "biz_date", name: "开票日期", type: "span"},
                                {isshow: "T", field: "customer_name", name: "客户名称", type: "span"},
                                {isshow: "T", field: "delivery_part_name", name: "发货主体", type: "span"},
                                
                            ],
                            listFields: [
                                {isshow: "T", field: "raw_code", name: "工厂发货单号", type: "span"},
                                {isshow: "T", field: "product_name", name: "产品名称", type: "span"},
                                {isshow: "T", field: "product_spec", name: "产品规格", type: "span"},
                                {isshow: "T", field: "product_price", name: "产品规格", type: "span"},
                                {isshow: "T", field: "unit", name: "单位", type: "span"},
                                
                                {isshow: "T", field: "dod_cnt", name: "发货数量", type: "span"},
                                {isshow: "T", field: "cnt", name: "开票数量", type: "span"},
                                
                                {isshow: "T", field: "rebate_amt", name: "折扣金额", type: "span"},
                                {isshow: "T", field: "tax_amt", name: "价税合计", type: "span"},
                                {isshow: "T", field: "batch_no", name: "批号", type: "span"},
                            ],
                        },
                        
                        supplyFeedback: {
                            labelwidth: "130px",
                            
                            formDataname: "supply_info",
                            form_filter_field: "pp.id",
                            
                            detailDataname: "",
                            detail_filter_field: "",
                            dataRequest: [],
                            
                            formFields: [
                                {isshow: "T", field: "code", name: "生产计划编码", type: "span"},
                                {isshow: "T", field: "md_description", name: "产品名称", type: "span"},
                                {isshow: "T", field: "specification", name: "产品规格", type: "span"},
                                {isshow: "T", field: "unit", name: "单位", type: "span"},
                                {isshow: "T", field: "batch_no", name: "批号", type: "span"},
                                {isshow: "T", field: "biz_date", name: "供货时间", type: "span"},
                                {isshow: "T", field: "cnt", name: "供货数量", type: "span"},
                                {isshow: "T", field: "unfinish_cnt", name: "未完成数量", type: "span"},
                                
                            ],
                        },
                                                
                        product_plan: {
                            labelwidth: "130px",
                            
                            formDataname: "producePlanDetail",
                            form_filter_field: "plan_produce.id",
                            fileid: "file_id",
                            
                            detailDataname: "producePlanDetail",
                            detail_filter_field: "plan_produce_detail.parent_id",
                            dataRequest: [],
                            
                            formFields: [
                                {isshow: "T", field: "code", name: "编码", type: "span"},
                                {isshow: "T", field: "year", name: "年份", type: "span"},
                                {isshow: "T", field: "quarter", name: "季度", type: "span"},
                                {isshow: "T", field: "type", name: "类型", type: "span",formatterjson: "{\"1\": \"正常\", \"2\": \"增补\"}"},
                            ],
                            listFields: [
                                {isshow: "T", field: "company_name", name: "药厂", type: "span"},
                                {isshow: "T", field: "product_code", name: "产品编码", type: "span"},
                                {isshow: "T", field: "product_name", name: "产品名称", type: "span"},
                                {isshow: "T", field: "product_spec", name: "产品规格", type: "span"},
                                {isshow: "T", field: "due_total", name: "生产周期", type: "span"},
                                {isshow: "T", field: "min_cnt", name: "最小批量", type: "span"},
                                {isshow: "T", field: "sum_produce_cnt", name: "上年度计划量", type: "span"},
                                {isshow: "T", field: "standard_cnt", name: "件数", type: "span"},
                                {isshow: "T", field: "cnt", name: "需求数量", type: "span"},
                            ],
                        },
                        
                    }
                },
 
                created() {
                    let me = this;
                    this.getpnl_message();
                },
 
                mounted() {
                    let me = this;
                    this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
                        document.getElementById('page_root').style.display = "block";
                        document.getElementById('page_loading').style.display = "none";
                        
                        // //重新设置弹窗宽高
                        // this.$nextTick(function() {
                        //     let w_ = this.$refs.popup_body.offsetWidth + "px";
                        //     let h_ = this.$refs.popup_body.offsetHeight + "px";
                        //     Root.setPopupWH(w_, h_);
                        // })
                    });
                    // if (this.dataRequest.length) {
                    //     var result = {};
                    //     this.loadRequestData(this.dataRequest, result, function(data) {
                    //         me.dataRequestObj = data;
                    //         if (me.formFields.length) {
                    //             var formFields_part_ = clone(me.formFields);
                    //             formFields_part_.map(e => {
                    //                 if (e.field == "manager_part_code") {
                    //                     e.options = me.dataRequestObj.manager_part_code;
                    //                 } else if (e.field == "sales_type") {
                    //                     e.options = me.dataRequestObj.sales_type;
                    //                 } else if (e.field == "settle_type") {
                    //                     e.options = me.dataRequestObj.settle_type;
                    //                 } else if (e.field == "business_type") {
                    //                     e.options = me.dataRequestObj.business_type;
 
                    //                 } else if (e.field == "sales_business_type") {
                    //                     e.options = me.dataRequestObj.sales_business_type;
                    //                 } else if (e.field == "tax_rate") {
                    //                     e.options = me.dataRequestObj.tax_rate;
                    //                 } else if (e.field == "control_type") {
                    //                     e.options = me.dataRequestObj.control_type;
 
                    //                 }else if(e.field == "trans_type") {
                    //                     e.options = me.dataRequestObj.trans_type;
                    //                 }
 
                    //             });
 
                    //             me.formFields = formFields_part_;
                    //         }
                    //         //me.initData();
                    //     });
                    // }
 
                    // this.initData();
                },
 
                methods: {
                    onServerInitData(data) {
                    
                    },
                    closeDialog() {
                        let me = this;
                        window.top.vue.closeWin();
                    },
                    getpnl_message(){
                        var url = window.location.href;//"http://127.0.0.1:8848/h5/AppLoginMain.html?empCode=001007&flowId=47f6e38eae0444d0a7169278df86c4f0"
                        var params = getGetParams(url);
                        var me = this;
                        if(params && params.id) {
                            let id = params.id;
                            console.log(params);
                            // this.empcode = empCode;
                            me.getNotice(id);
                        }
                        else {
                            this.onCloseWinPage("erroe", "请求错误");
                        }
                    },
                    
                    getNotice(id) {
                        var me = this;
                        let param = {
                            dataname: "notification", //"actKeyMapping",
                            filter: "id ='" + id +"'",
                        }
                        Server.call("root/data/getEntity", param, function(result) {
                            console.log("noticeobj", result);
                            if (result && result.data && result.data.entity) {
                                var data_ = result.data.entity
                                
                                me.noticeobj = clone(data_);
                                var isfont = me.noticeobj.content.indexOf("<font color=#f56c6c >开票</font>") != -1 ? true : false;
                                if (me.noticeobj.type == "delivery_sales" && isfont) {
                                    me.$refs.ref_title.innerHTML = me.noticeobj.content.replace("<font color=#f56c6c >开票</font>", "<span style='color: #f56c6c' >开票</span>");
                                }
                                
                                else {
                                    me.$refs.ref_title.innerHTML = me.noticeobj.content
                                }
                                
                                me.order_id = clone(me.noticeobj.business_id);
                                
                                me.initFields();
                            }
                        });
                    },
                    
                    initFields() {
                        let me = this;
                        if (this.order_type[me.noticeobj.type]) {
                            this.formFields = clone(this.order_type[me.noticeobj.type].formFields);
                            this.tableFields = clone(this.order_type[me.noticeobj.type].listFields);
                            this.dataname = clone(this.order_type[me.noticeobj.type].formDataname);
                            this.form_filter_field = clone(this.order_type[me.noticeobj.type].form_filter_field);
                            this.dataRequest = clone(this.order_type[me.noticeobj.type].dataRequest);
                            
                            this.$set(this.formAttr, "labelwidth", clone(this.order_type[me.noticeobj.type].labelwidth))
                            this.initRequestData(function() {
                                me.initData();
                                if (me.order_type[me.noticeobj.type].detailDataname) {
                                     me.detail_dataname = clone(me.order_type[me.noticeobj.type].detailDataname);
                                    me.detail_filter_field = clone(me.order_type[me.noticeobj.type].detail_filter_field);
                                    me.initDetailData();
                                }
                            })
                            
                        }
                        else {
                            window.top.vue.closeWin();
                        }
                    },
                    
                    initRequestData(callback) {
                        if (this.dataRequest.length) {
                            var result = {};
                            this.loadRequestData(this.dataRequest, result, function(data) {
                                me.dataRequestObj = data;
                        //         if (me.formFields.length) {
                        //             var formFields_part_ = clone(me.formFields);
                        //             formFields_part_.map(e => {
                        //                 if (e.field == "manager_part_code") {
                        //                     e.options = me.dataRequestObj.manager_part_code;
                        //                 } else if (e.field == "sales_type") {
                        //                     e.options = me.dataRequestObj.sales_type;
                        //                 } else if (e.field == "settle_type") {
                        //                     e.options = me.dataRequestObj.settle_type;
                        //                 } else if (e.field == "business_type") {
                        //                     e.options = me.dataRequestObj.business_type;
                        
                        //                 } else if (e.field == "sales_business_type") {
                        //                     e.options = me.dataRequestObj.sales_business_type;
                        //                 } else if (e.field == "tax_rate") {
                        //                     e.options = me.dataRequestObj.tax_rate;
                        //                 } else if (e.field == "control_type") {
                        //                     e.options = me.dataRequestObj.control_type;
                        
                        //                 }else if(e.field == "trans_type") {
                        //                     e.options = me.dataRequestObj.trans_type;
                        //                 }
                        
                        //             });
                        
                        //             me.formFields = formFields_part_;
                        //         }
                                callback();
                            });
                        }
                        else {
                            callback();
                        }
                    },
 
                    initData() {
                        let me = this;
                        let param = {
                            dataname: me.dataname,
                            filter: me.form_filter_field + "='" + me.order_id + "'",
                        }
                        Server.call("root/data/getEntity", param, function(result) {
                            var isreturn = me.noticeobj.content.indexOf("退回") != -1 ? true : false;
                            
                            if (result && result.data.entity) {
                                console.log(result.data.entity)
                                var order_obj_ = clone(result.data.entity);
                                me.old_formdata = order_obj_;
                                var order_form_ = {};
                                
                                if (me.formFields.length == 0) {
                                    var formFields_ = [];
                                    for(var field in order_obj_) {
                                        var f_ = {
                                            isshow: "T", 
                                            field: field, 
                                            name: field,
                                            type: "span"
                                        }
                                        formFields_.push(f_);
                                    }
                                    me.formFields = formFields_;
                                }
                                if(me.noticeobj.type == "accountCustomerDelivery"){
                                    if(result.data.entity.old_id != null){
                                        me.formFields = clone(me.order_type[me.noticeobj.type].formFields);
                                        me.formFields.map(f=>{
                                            order_form_[f.field] = order_obj_[f.field];
                                        })
                                    }else {
                                        me.formFields.map(f=>{
                                            order_form_[f.field] = order_obj_[f.field];
                                        })
                                        if (!isreturn) {
                                            me.lastmessage = "经销商业请及时进行工厂资质备案,以免影响发货。";
                                        }
                                    }
                                }else {
                                    me.formFields.map(f=>{
                                        order_form_[f.field] = order_obj_[f.field];
                                    })
                                }
                                
                                if(me.noticeobj.type == "accountCustomer" && !isreturn){
                                    me.lastmessage = "若进行了商业名称修改,关联的发货主体及商业政策将同步冻结,请及时进行资质修改解除冻结,以免影响发货。";
                                }
                                
                                me.order_form = order_form_;
                            }
                        });
                    },
                    
                    initDetailData() {
                        var me = this;
                        var filter_table = me.detail_filter_field + "= '" + me.order_id + "'";
                        let param_table = {
                            isClientMode: false,
                            dataname: this.detail_dataname,
                            filter: filter_table,
                        }
                        Server.call("root/data/getEntitySet", param_table, function(result) {
                            console.log(result);
                            if (result && result.data.entityset) {
                                var order_detail_ = clone(result.data.entityset);
                                if (me.noticeobj.type == "revocation") {
                                    order_detail_.map(item=>{
                                        var price_ = item.revocation_price ? item.revocation_price : item.product_price * 1;
                                        var amt_ = price_ * item.qty_needreturn;
                                        item.amt = amt_;
                                    })
                                }
                                me.order_detail = clone(order_detail_);
                                // tableFields: [],
                                // for (var i = 0; i < result.data.entityset.length; i++) {}
                            }
                        });
                    },
                    
                    download() {
                        var me = this;
                        var fileid = this.old_formdata[me.order_type[me.noticeobj.type].fileid];
                        if (fileid) {
                            handleDownload(fileid);
                        }
                        else {
                            me.$message({
                                type:"warning",
                                message:"没有附件"
                            })
                        }
                    },
                    
                }
            });
        </script>
        <style>
        .header {
            height: 21px;
        }
        .el-dialog__header {
            border-bottom: 0;
        }
        .el-dialog__body {
            text-align: center;
            /* height: 200px; */
        }
        .cssTransType .el-message-box__content{
            color: red;
        }
        
        .sorder_body {
            font-size: 12px;
        }
        .el-dialog_body {
            padding: 0px;
            overflow-y: auto;
        }
        
        .el-collapse-item__header {
            padding: 0 10px;
            background-color: #c9f7e8;
        }
        .el-collapse-item__wrap {
            padding: 20px;
        }
        
        td > div {
            border-bottom: 0px !important
        }
        </style>
    </body>
</html>