付延余
2022-07-13 acabe06a93200d0d7c51cc072838e934c146011d
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
<template>
    <!-- 新增申请表单 -->
    <view class="new-application-form-data">
        <!-- page-mete的page-style属性相当于HTML的body属性 -->
        <!-- <page-meta :page-style="spanStyle"></page-meta> -->
        <!-- 表单 -->
        <combination-title class="newApplicationTitle" title="新增"></combination-title>
        <!-- 注意,如果需要兼容微信小程序,最好通过setRules方法设置rules规则 -->
        <view class="formDataContaniner">
            <u--form labelPosition="left" :model="newFormData" :rules="rules" ref="formRef">
                <u-form-item labelWidth="20%" label="结算客户" borderBottom ref="customerNameRef" @click="selectCustomer">
                    <u--input v-model="newFormData.customerName" border="none"></u--input>
                </u-form-item>
                <u-form-item labelWidth="20%" label="合同编号" borderBottom ref="contractNumRef" @click="selectContract">
                    <u--input v-model="newFormData.contractNum" border="none"></u--input>
                </u-form-item>
                <u-form-item labelWidth="20%" label="合同名称" borderBottom ref="contractNameRef"><u--input v-model="newFormData.contractName" border="none"></u--input></u-form-item>
                <u-form-item labelWidth="20%" label="付款方式" borderBottom @click="showPayType = true" ref="payTypeRef">
                    <u--input v-model="selectValue" disabled disabledColor="#ffffff" placeholder="请选择付款方式" border="none"></u--input>
                    <u-icon slot="right" name="arrow-right"></u-icon>
                </u-form-item>
                <u-form-item @click="timeShow = true" labelWidth="20%" label="日期" borderBottom ref="timeDataRef">
                    <u--input v-model="timeDataStr" border="none" placeholder="请选择范围日期"></u--input>
                    <u-icon slot="right" name="arrow-right"></u-icon>
                </u-form-item>
                <u-form-item labelWidth="20%" label="编号" borderBottom>
                    <u--input border="none" disabled disabledColor="#ffffff" value="自动生成" placeholder="请输入编号"></u--input>
                </u-form-item>
            </u--form>
        </view>
 
        <!-- 申请日历、范围时间 -->
        <u-calendar :show="timeShow" :mode="mode" @confirm="confirmTime" @close="timeClose" rowHeight="110" :maxDate="maxDate"></u-calendar>
        <!-- 申请付款方式弹出菜单 -->
        <u-action-sheet :show="showPayType" :actions="actions" title="请选择付款方式" @close="showPayType = false" @select="sexSelect"></u-action-sheet>
 
        <!-- 选择客户弹框 -->
        <!--  @touchmove.stop.prevent="moveHandleCustomer":防止图层穿透 -->
        <view class="selectCustomerPopup">
            <u-popup :show="selectCustomerShow" @close="selectCustomerClose" @open="selectCustomerOpen" mode="bottom" round="22">
                <scroll-view scroll-y="true" style="height:100%;">
                    <combination-title class="selectCustomerTitle" title="选择客户"></combination-title>
                    <view class="selectCustomerContainer">
                        <view class="searchContainer">
                            <u--form labelPosition="left" :model="searchCustomerForm" ref="selectformRef">
                                <u-form-item labelWidth="12%" label="单位" borderBottom ref="compRef">
                                    <u--input @focus="selectCustomerCompShow = true" v-model="searchCustomerForm.compName" placeholder="点击选择单位" border="none"></u--input>
                                    <u-icon slot="right" name="close-circle-fill" v-show="searchCustomerForm.compName != ''" @click="searchCustomerForm.compName = ''"></u-icon>
                                </u-form-item>
                                <u-form-item labelWidth="20%" label="客户名称" borderBottom ref="timeDataRef">
                                    <u--input v-model="selectCustomerData.customerName" border="none" placeholder="输入客户名称"></u--input>
                                    <u-icon slot="right" name="close-circle-fill" v-show="selectCustomerData.customerName != ''" @click="selectCustomerData.customerName = ''"></u-icon>
                                </u-form-item>
                                <u-form-item labelWidth="20%" label="客户级别" borderBottom>
                                    <u--input @focus="selectLevelShow = true" border="none" v-model="searchCustomerForm.levelText" placeholder="点击选择级别"></u--input>
                                    <u-icon slot="right" name="close-circle-fill" v-show="searchCustomerForm.levelText != ''" @click="searchCustomerForm.levelText = ''"></u-icon>
                                </u-form-item>
                            </u--form>
                        </view>
                        <view class="searchCustomerBtn">
                            <u-button text="搜索" type="primary" @click="selectCustomer()"></u-button>
                            <u-button text="清空" @click="selectCustomerResetFields"></u-button>
                        </view>
                        <!-- 客户列表 -->
                        <view class="searchResultList">
                            <view class="balanceNo" v-if="accountDetails.balanceTotal < 0">
                                <text>客户账户当前处于欠款状态</text>
                            </view>
                            <u-collapse accordion>
                                <u-collapse-item :title="item.customerFullName" v-for="(item, index) in customerData">
                                    <view class="customerDetails">
                                        <view class="table-head">
                                            <text class="titleText">{{ item.customerNumber }}</text>
                                            <template>
                                                <button
                                                    class="mini-btn"
                                                    type="default"
                                                    size="mini"
                                                    style="background: #007aff;
                                                    color: #ffffff;
                                                    margin: auto 0;
                                                    height: 20px;
                                                    line-height:20px;
                                                    width: 86px;
                                                    font-size: 10px;
                                                    padding: 0;"
                                                    @click="selectCustomerOkClick(item.id)"
                                                >
                                                    选择该用户
                                                </button>
                                            </template>
                                        </view>
                                        <uni-table border stripe emptyText="暂无更多数据" style="min-width:420px;">
                                            <uni-tr>
                                                <uni-th align="center">级别</uni-th>
                                                <uni-td align="center">{{ item.level }}</uni-td>
                                            </uni-tr>
                                            <uni-tr>
                                                <uni-th align="center">所属部门名称</uni-th>
                                                <uni-td align="center">{{ item.compNames }}</uni-td>
                                            </uni-tr>
                                            <uni-tr>
                                                <uni-th align="center">电话号码</uni-th>
                                                <uni-td align="center">{{ item.customerPhoneNumber }}</uni-td>
                                            </uni-tr>
                                        </uni-table>
                                    </view>
                                </u-collapse-item>
                            </u-collapse>
                        </view>
 
                        <!-- 选择用户菜单项 -->
                        <view class="selectCustomerCompSheet">
                            <u-action-sheet
                                :show="selectCustomerCompShow"
                                :actions="selectCustomerActions"
                                title="请选择单位"
                                @close="selectCustomerCompShow = false"
                                @select="selectCustomerSelect"
                            ></u-action-sheet>
                        </view>
 
                        <!-- 级别菜单项 -->
                        <view class="selectLevelSheet">
                            <u-action-sheet :show="selectLevelShow" :actions="levelList" title="请选择级别" @close="selectLevelShow = false" @select="selectLevelSelect"></u-action-sheet>
                        </view>
                    </view>
                </scroll-view>
            </u-popup>
        </view>
 
        <!-- 选择合同 -->
        <!-- @touchmove.stop.prevent="moveHandleContract" -->
        <view class="selectCustomerPopup">
            <u-popup :show="selectContractShow" @close="selectContractClose" @open="selectContractOpen" mode="bottom" round="22">
                <scroll-view scroll-y="true" style="height:100%;">
                    <combination-title class="selectCustomerTitle" title="选择合同"></combination-title>
                    <view class="selectCustomerContainer">
                        <view class="searchContainer">
                            <u--form labelPosition="left" :model="searchContractForm" ref="selectformRef">
                                <u-form-item labelWidth="18%" label="合同编号" borderBottom ref="compRef">
                                    <u--input v-model="searchContractForm.num" placeholder="请输入合同编号" border="none"></u--input>
                                    <u-icon slot="right" name="close-circle-fill" v-show="searchContractForm.num != ''" @click="searchContractForm.num = ''"></u-icon>
                                </u-form-item>
                                <u-form-item labelWidth="18%" label="客户名称" borderBottom ref="compRef">
                                    <u--input v-model="searchContractForm.customerName" placeholder="请输入客户名称" border="none"></u--input>
                                    <u-icon slot="right" name="close-circle-fill" v-show="searchContractForm.customerName != ''" @click="searchContractForm.customerName = ''"></u-icon>
                                </u-form-item>
                                <u-form-item labelWidth="18%" label="合同类型" borderBottom ref="compRef">
                                    <u--input v-model="searchContractForm.type" placeholder="请输入合同类型" border="none" @focus="searchContractFormTypeFocus"></u--input>
                                    <u-icon slot="right" name="close-circle-fill" v-show="searchContractForm.type != ''" @click="searchContractForm.type = ''"></u-icon>
                                </u-form-item>
                                <u-form-item labelWidth="18%" label="签订日期" borderBottom ref="compRef">
                                    <u--input @focus="selectContractStartTimeShow = true" v-model="searchContractForm.startDate" placeholder="点击选择签订日期" border="none"></u--input>
                                    <u-icon slot="right" name="close-circle-fill" v-show="searchContractForm.startDate != ''" @click="searchContractForm.startDate = ''"></u-icon>
                                </u-form-item>
                                <u-form-item labelWidth="18%" label="结束日期" borderBottom ref="compRef">
                                    <u--input @focus="selectContractEndTimeShow = true" v-model="searchContractForm.endDate" placeholder="点击选择结束日期" border="none"></u--input>
                                    <u-icon slot="right" name="close-circle-fill" v-show="searchContractForm.endDate != ''" @click="searchContractForm.endDate = ''"></u-icon>
                                </u-form-item>
                            </u--form>
                        </view>
                        <view class="searchCustomerBtn">
                            <u-button text="搜索" type="primary" @click="selectContractOpen()"></u-button>
                            <u-button text="清空" @click="selectContractResetFields"></u-button>
                        </view>
                        <!-- 合同列表 -->
                        <view class="tableContract">
                            <view class="tableBody">
                                <uni-table border emptyText="暂无更多数据">
                                    <uni-tr>
                                        <uni-th width="100" align="center">组织结构</uni-th>
                                        <uni-th width="250" align="center">客户名称</uni-th>
                                        <uni-th width="180" align="center">煤种名称</uni-th>
                                        <uni-th width="220" align="center">合同编号</uni-th>
                                        <uni-th width="90" align="center">合同类型</uni-th>
                                        <uni-th width="130" align="center">签订日期</uni-th>
                                        <uni-th width="130" align="center">终止日期</uni-th>
                                        <uni-th width="100" align="center">合同总量</uni-th>
                                        <uni-th width="100" align="center">合同金额</uni-th>
                                        <uni-th width="70" align="center">状态</uni-th>
                                    </uni-tr>
                                    <uni-tr v-for="(item, index) in contractData" :key="index">
                                        
                                        <uni-td align="center">
                                            <view :style="tdStyle">{{ item.compName }}</view>
                                        </uni-td>
                                        <uni-td align="left">
                                            <view :style="tdStyle">{{ item.customerName }}</view>
                                        </uni-td>
                                        <uni-td align="center">
                                            <view :style="tdStyle">{{ item.coalNames }}</view>
                                        </uni-td>
                                        <uni-td align="left">
                                            <view :style="tdStyle">{{ item.num }}</view>
                                        </uni-td>
                                        <uni-td align="center">
                                            <view :style="tdStyle">{{ item.type }}</view>
                                        </uni-td>
                                        <uni-td align="center">
                                            <view :style="tdStyle">{{ item.startDate }}</view>
                                        </uni-td>
                                        <uni-td align="center">
                                            <view :style="tdStyle">{{ item.endDate }}</view>
                                        </uni-td>
                                        <uni-td align="center">
                                            <view :style="tdStyle">{{ item.countExecutive }}</view>
                                        </uni-td>
                                        <uni-td align="center">
                                            <view :style="tdStyle">{{ item.executive }}</view>
                                        </uni-td>
                                        <uni-td align="center">
                                            <view :style="tdStyle">{{ item.status }}</view>
                                        </uni-td>
                                    </uni-tr>
                                </uni-table>
                            </view>
 
                            <view class="TableUtilBtn">
                                <uni-table border emptyText="暂无更多数据">
                                    <uni-tr><uni-th align="center">操作</uni-th></uni-tr>
                                    <uni-tr v-for="(item, index) in contractData" :key="index">
                                        <uni-td align="center">
                                            <view class="TableUtilBtnContainer"><u-button type="primary" @click="selectContractClick(item)" icon="checkbox-mark" size="mini"></u-button></view>
                                        </uni-td>
                                    </uni-tr>
                                </uni-table>
                            </view>
                        </view>
                        <!-- 合同类型选择器 -->
                        <view class="selectContractTypePicker">
                            <u-picker
                                :closeOnClickOverlay="true"
                                @close="selectContractTypeClose"
                                @cancel="selectContractTypeShow = false"
                                @confirm="selectContractTypeConfirm"
                                :show="selectContractTypeShow"
                                :columns="selectContractTypeData"
                            ></u-picker>
                        </view>
                        <!-- 时间选择器 -->
                        <view class="selectContractStartTime">
                            <u-calendar
                                :show="selectContractStartTimeShow"
                                @close="selectContractStartTimeClose"
                                :mode="selectContractTimeMode"
                                @confirm="selectContractStartTimeConfirm"
                            ></u-calendar>
                        </view>
                        <view class="selectContractEndTime">
                            <u-calendar :show="selectContractEndTimeShow" @close="selectContractEndTimeClose" :mode="selectContractTimeMode" @confirm="selectContractEndTimeConfirm"></u-calendar>
                        </view>
                    </view>
                </scroll-view>
            </u-popup>
        </view>
 
        <!-- 申请表格 -->
        <view class="newApplicationTable">
            <uni-table border stripe emptyText="暂无更多数据">
                <!-- 表格数据行 -->
                <uni-tr v-for="(item, index) in 8" :key="index">
                    <uni-th align="center">字段标题</uni-th>
                    <uni-td>
                        <view class="text">输入/选择内容</view>
                        <view class="icon"><image src="@/static/icon/select.png" mode=""></image></view>
                    </uni-td>
                </uni-tr>
            </uni-table>
        </view>
        <view class="new-application-button">
            <u-button text="取消" :plain="true" type="primary" @click="backPage"></u-button>
            <u-button text="确定" type="primary" @click="newApplicationFormDataClick"></u-button>
        </view>
 
        <!-- 菜单栏 -->
        <popup-menu @menuShow="menushow" ref="menuRef"></popup-menu>
    </view>
</template>
 
<script>
import combinationTitle from '@/components/common/combined-title/combined-title.vue';
import popupMenu from '@/components/common/popup-menu/popup-menu.vue';
 
// 最大显示的日期
const d = new Date();
const year = d.getFullYear();
let month = d.getMonth() + 1;
month = month < 10 ? `0${month}` : month;
const date = d.getDate();
export default {
    data() {
        return {
            tdStyle: 'max-height: 30px;overflow: scroll;',
            spanStyle: 'overflow:auto',
            newFormData: {
                amount: 0,
                coalId: '',
                coalName: '',
                contractId: 169,
                contractName: '国泰洗中煤合同',
                contractNum: '',
                contractOrders: [],
                customerAddressId: '',
                customerId: 236,
                customerName: '邢台国泰发电有限责任公司',
                endDate: '2022-07-12',
                executiveQuant: 0,
                id: 0,
                number: '',
                payType: '0',
                price: 0,
                quant: 0,
                remark: '',
                startDate: '2022-07-05',
                type: '外销'
            },
            accountDetails:0,
            // 时间
            timeDataStr: '',
            menuShow: false,
            // 表单
            selectCustomerShow: false, // 选择用户弹框
            showPayType: false, // 付款方式弹框
            payData: [],
            actions: [],
            selectValue: '',
            rules: {
                'newData.name': {
                    type: 'string',
                    required: true,
                    message: '请填写客户名称',
                    trigger: ['blur', 'change']
                },
                'newData.num': {
                    type: 'string',
                    max: 2,
                    required: true,
                    message: '请选择合同编号',
                    trigger: ['blur', 'change']
                }
            },
            // 时间
            timeShow: false,
            mode: 'range',
            maxDate: `${year}-${month}-${date + 10}`,
            // 选择客户
            selectCustomerData: {
                compIds: '',
                customerName: '',
                level: '',
                current: 1,
                size: 10
            },
            // 搜索字段
            selectCompsData: [],
            selectCustomerLevel: [],
            searchCustomerForm: {
                compName: '',
                levelText: ''
            },
            customerData: [],
            // 选择单位
            selectCustomerCompShow: false,
            selectCustomerActions: [],
            // 级别
            selectLevelShow: false,
            levelList: [{ name: '一星级', value: 'A' }, { name: '二星级', value: 'B' }, { name: '三星级', value: 'C' }, { name: '四星级', value: 'D' }, { name: '五星级', value: 'E' }],
 
            // 选择合同
            selectContractShow: false,
            searchContractForm: {
                current: 1,
                size: 10,
                num: '',
                startDate: '',
                endDate: '',
                result: 2,
                type: '',
                customerName: ''
            },
            contractData: [],
            // 类型
            selectContractTypeShow: false,
            selectContractTypeData: [[]],
            // 时间
            selectContractTimeMode: 'single',
            selectContractStartTimeShow: false,
            selectContractEndTimeShow: false
        };
    },
    onShow() {
        if (this.menuShow == true) {
            this.$refs.menuRef.menuClick();
        }
        this.init();
    },
    // 点击导航栏菜单后
    onNavigationBarButtonTap(e) {
        // console.log(e);
        this.$refs.menuRef.menuClick();
    },
    watch: {
        // 立即处理 进入页面就触发 // immediate: true,
        // 深度监听 属性的变化// deep: true
        // 选择客户查询条件
        'searchCustomerForm.compName'(newV, oldV) {
            if (newV == '') {
                this.selectCustomerData.compIds = '';
            }
        },
        'searchCustomerForm.levelText'(newV, oldV) {
            if (newV == '') {
                this.selectCustomerData.level = '';
            }
        }
    },
    components: {
        popupMenu,
        combinationTitle
    },
    methods: {
        init() {
            this.jcfavouredpolicyitem();
            this.coalfiled();
            this.coalprice();
            this.operato();
            this.pay_type();
            this.others_params();
            this.fetchCompTree();
        },
        // 选择客户
        selectCustomer() {
            this.selectLevelShow = false;
            this.selectCustomerCompShow = false;
            uni.showLoading({
                title: '加载中...'
            });
            this.selectCustomerShow = true;
            this.$reqGet('customer', this.selectCustomerData).then(res => {
                uni.hideLoading();
                if (res.code == 0) {
                    
                    this.customerData = res.data.records;
                }
            });
        },
        selectCustomerOpen() {
            console.log('客户选择弹框打开了');
            // this.spanStyle = 'overflow:hidden'; //当蒙层弹起时,固定界面禁止滚动,当蒙层关闭时,允许滚动
        },
        selectCustomerClose() {
            // this.spanStyle = 'overflow:auto'; // 让html的body可滑动
            this.selectCustomerShow = false;
        },
        // 获取单位树
        fetchCompTree() {
            this.selectCustomerActions = [];
            this.$reqGet('fetchCompTree').then(res => {
                if (res.code == 0) {
                    let a = { name: '', id: '' };
                    a.name = res.data[0].name;
                    a.id = res.data[0].id;
                    this.selectCustomerActions.push(a);
                    res.data[0].children.forEach(item => {
                        let a = { name: '', id: '' };
                        a.name = item.name;
                        a.id = item.id;
                        this.selectCustomerActions.push(a);
                    });
                }
            });
        },
        // 客户选择框单位选择菜单
        selectCustomerSelect(v) {
            uni.hideKeyboard();
            this.selectCustomerData.compIds = v.id;
            this.searchCustomerForm.compName = v.name;
        },
        // 级别
        selectLevelSelect(v) {
            uni.hideKeyboard();
            this.selectCustomerData.level = v.value;
            this.searchCustomerForm.levelText = v.name;
        },
        // 付款类型
        sexSelect(v) {
            uni.hideKeyboard();
            this.selectValue = v.name;
            this.newFormData.payType = v.value;
            // this.newFormData.payType = e.name;
            // this.$refs.form1.validateField('userInfo.sex');
        },
        // 清空选择客户表单
        selectCustomerResetFields() {
            this.$refs.selectformRef.resetFields(); // 不起效果
            this.selectCustomerData.customerName = '';
            this.searchCustomerForm.compName = '';
            this.searchCustomerForm.levelText = '';
            this.selectCustomer();
        },
        selectCustomerOkClick(v) {
            console.log('id', v);
            this.$reqGet('getAccount', { customerId: v }).then(res => {
                console.log('获取账号', res);
                this.accountDetails = res.data
                this.newFormData.customerName = res.data.customerName;
                this.newFormData.customerId = res.data.id;
                this.searchContractForm.customerName = res.data.customerName;
            });
            this.$nextTick(() => {
                this.selectCustomerShow = false;
            });
        },
        // 时间
        confirmTime(v) {
            this.timeShow = false;
            console.log(v);
            v.forEach(e => {
                this.newFormData.startDate = v[0];
                this.newFormData.endDate = v[v.lenght - 1];
                this.timeDataStr = v[0] + ' 至 ' + v[v.length - 1];
            });
        },
 
        // 选择合同
        selectContract() {
            this.selectContractShow = true;
        },
        // 选择合同类型输入框获取焦点触发
        searchContractFormTypeFocus() {
            // 类型弹出框
            this.selectContractTypeShow = true;
            // 弹出框类型请求
            this.$nextTick(() => {
                this.$reqGet('contract_type').then(res => {
                    console.log('contract_type', res);
                    res.data.forEach(item => {
                        this.selectContractTypeData[0].push(item.value);
                    });
                });
            });
        },
        // 选择合同弹框
        selectContractOpen() {
            uni.showLoading({
                title: '加载中...'
            });
            console.log('合同弹框open');
            this.$reqGet('contract_status').then(res => {
                console.log('状态', res);
            });
            this.$reqGet('contract', this.searchContractForm).then(res => {
                uni.hideLoading();
                if (res.code == 0) {
                    console.log('合同', res);
                    this.contractData = res.data.records;
                }
            });
        },
        selectContractClose() {
            this.selectContractShow = false;
        },
        // 合同类型选择器
        selectContractTypeConfirm(v) {
            this.searchContractForm.type = v.value[0];
            this.selectContractTypeShow = false;
            console.log('选择器确定后的值', v, this.searchContractForm.type);
        },
        selectContractTypeClose(v) {
            // 初始化合同类型选择器
            this.selectContractTypeData[0] = [];
 
            this.selectContractTypeShow = false;
            if (v) {
                this.searchContractForm.type = v.value[0];
            }
        },
        // 合同时间选择器
        selectContractStartTimeConfirm(e) {
            this.selectContractStartTimeShow = false;
            this.searchContractForm.startDate = e[0];
        },
        selectContractStartTimeClose() {
            this.selectContractStartTimeShow = false;
        },
        selectContractEndTimeConfirm(e) {
            this.selectContractEndTimeShow = false;
            this.searchContractForm.endDate = e[0];
        },
        selectContractEndTimeClose() {
            this.selectContractEndTimeShow = false;
        },
        // 重置表单所有字段
        selectContractResetFields() {
            this.searchContractForm.num = '';
            this.searchContractForm.startDate = '';
            this.searchContractForm.endDate = '';
            this.searchContractForm.customerName = '';
            this.searchContractForm.type = '';
        },
        selectContractClick(e) {
            console.log(e);
        },
        // 初始数据请求
        operato() {
            this.$reqGet('operator').then(res => {
                // console.log('operator', res);
            });
        },
        pay_type() {
            this.actions = [];
            this.$reqGet('pay_type').then(res => {
                // console.log('paytype', res);
                this.payData = res.data;
                res.data.forEach(e => {
                    let a = { name: '', value: '' };
                    a.name = e.label;
                    a.value = e.value;
                    this.actions.push(a);
                });
            });
            // console.log(this.actions);
        },
        others_params() {
            this.$reqGet('others_params').then(res => {
                // console.log('others_params', res);
            });
        },
        coalprice() {
            this.$reqGet('coalprice', { current: 1, size: 1000 }).then(res => {
                // console.log('coalprice', res);
            });
        },
        jcfavouredpolicyitem() {
            this.$reqGet('jcfavouredpolicyitem', { current: 1, size: 1000, status: 0 }).then(res => {
                // console.log('jcfavouredpolicyitem', res);
            });
        },
        coalfiled() {
            this.$reqGet('coalfiled', { current: 1, size: 10 }).then(res => {
                // console.log('coalfiled', res);
            });
        },
        // 时间
        timeClose() {
            this.timeShow = false;
        },
        menushow(e) {
            this.menuShow = e;
        },
        // 选择客户
        // moveHandleCustomer() {
        //     return true;
        // },
        // moveHandleContract(){
        //     return true;
        // },
        newApplicationFormDataClick() {
            console.log('确认新增申请表单');
        },
        backPage() {
            uni.navigateBack({
                delta: 1
            });
        }
    }
};
</script>
 
<style lang="scss" scoped>
@include tableMainStyle();
::v-deep.new-application-form-data {
    width: 100%;
    padding-bottom: vww(40);
    // 标题
    .newApplicationTitle {
        margin-bottom: 0;
    }
    // 表单
    .formDataContaniner {
        .u-form {
            width: 91%;
            margin: 0 auto 0;
            .u-form-item {
                .u-form-item__body {
                    .u-form-item__body__left {
                        .u-form-item__body__left__content {
                            .u-form-item__body__left__content__label {
                            }
                        }
                    }
                    .u-form-item__body__right {
                        .u-form-item__body__right__content {
                            .u-form-item__body__right__content__slot {
                            }
                        }
                    }
                }
            }
        }
    }
 
    // 选择客户弹框
    .selectCustomerPopup {
        .u-popup {
            .u-transition {
                height: 95%;
                .u-popup__content {
                    overflow: scroll !important;
                    .selectCustomerTitle {
                        margin-bottom: 0;
                    }
                    .selectCustomerContainer {
                        padding: 0 4%;
                        .searchContainer {
                        }
                        .searchCustomerBtn {
                            margin-top: vww(10);
                            display: flex;
                            .u-button {
                                width: 30%;
                            }
                        }
                        // 数据列表
                        .searchResultList {
                            margin-top: vww(16);
                            .u-collapse {
                                .u-collapse-item {
                                    .u-collapse-item__content {
                                        .u-collapse-item__content__text {
                                            padding: 0;
                                        }
                                    }
                                }
                            }
                            .customerDetails {
                                .uni-table-scroll {
                                    min-width: 0 !important;
                                    // overflow-x: hidden;
                                    .uni-table {
                                        .uni-table-tr {
                                            padding: 0;
                                            font-size: vww(13);
                                            .uni-table-th {
                                                width: vww(100);
                                                height: vww(32);
                                                line-height: vww(20);
                                                padding: vww(5) vww(10);
                                                color: #111111;
                                                font-weight: 400;
                                                background: #f5f5f5;
                                            }
 
                                            .uni-table-td {
                                                height: vww(32);
                                                line-height: vww(20);
                                                padding: vww(5) vww(10);
                                                color: #111111;
                                            }
                                        }
                                    }
                                }
 
                                .table-head {
                                    height: vww(32);
                                    border: vww(1) solid #dddddd;
                                    display: flex;
                                    justify-content: space-between;
                                    font-size: vww(13);
                                    line-height: vww(32);
                                    padding: 0 vww(8);
                                    background: #f5f5f5;
 
                                    .titleText {
                                        font-weight: 550;
                                    }
 
                                    .timeText {
                                        color: #999999;
                                    }
                                }
                            }
                        }
 
                        // 合同表格
                        .tableContract {
                            margin-top:vww(30);
                            display: flex;
                            justify-content: center;
                            .uni-table-scroll {
                                min-width: 0 !important;
                                .uni-table {
                                    .uni-table-tr {
                                        padding: 0;
                                        font-size: vww(13);
                                        .uni-table-th {
                                            width: vww(100);
                                            height: vww(32);
                                            line-height: vww(20);
                                            padding: vww(5) vww(10);
                                            color: #111111;
                                            font-weight: 400;
                                            background: #f5f5f5;
                                        }
 
                                        .uni-table-td {
                                            line-height: vww(20);
                                            padding: vww(5) vww(10);
                                            color: #111111;
                                        }
                                    }
                                }
                            }
                            .tableBody {
                                width: 80%;
                            }
                            .TableUtilBtn {
                                width: 20%;
                                overflow: hidden;
                                .uni-table{
                                    min-width:0!important;
                                }
                                .TableUtilBtnContainer{
                                    .u-button{
                                        width:vww(20);
                                    }
                                }
                            }
                        }
 
                        // 合同类型选择器
                        .selectContractTypePicker {
                            .u-popup {
                                .u-transition {
                                    height: auto;
                                }
                            }
                        }
 
                        .selectCustomerCompSheet {
                            .u-popup {
                                .u-transition {
                                    height: auto;
                                }
                            }
                        }
 
                        .selectLevelSheet {
                            .u-popup {
                                .u-transition {
                                    height: auto;
                                }
                            }
                        }
 
                        // 时间选择器
                        .selectContractStartTime {
                            .u-popup {
                                .u-transition {
                                    height: auto;
                                }
                            }
                        }
                        .selectContractEndTime {
                            .u-popup {
                                .u-transition {
                                    height: auto;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
 
    // 表格
    .newApplicationTable {
        margin: vww(40) auto;
        width: 91%;
        .uni-table {
            .uni-table-tr {
                .uni-table-th {
                    padding: 0;
                    width: vww(88);
                    height: vww(40);
                    background-color: #f5f5f5;
                    color: #111111;
                    font-size: vww(13);
                    font-weight: 500;
                }
                .uni-table-td {
                    width: vww(253);
                    height: vww(40);
                    background-color: #ffffff;
                    color: #111111;
                    font-size: vww(13);
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    .text {
                    }
                    .icon {
                        display: flex;
                        align-items: center;
                        image {
                            width: vww(10);
                            height: vww(5.5);
                        }
                    }
                }
            }
        }
        // 边框
        // .table--border{
        //     border:1px solid #DDDDDD;
        // }
    }
 
    // button
    .new-application-button {
        display: flex;
 
        .u-button {
            width: vww(120);
            height: vww(40);
        }
    }
}
</style>