fuliqi
2024-04-02 0a0e01138e0d9b6f370ae16ef1099e4c60d15c26
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
<template>
  <div class="app-container">
    <el-page-header @back="goBack" content="详情页面">
    </el-page-header>
    <el-container>
      <el-main style="padding-top: 0px">
        <h2>考核分数明细</h2>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button
              type="success"
              plain
              icon="el-icon-edit"
              size="mini"
              :disabled="single"
              @click="handleScoreUpdate"
            >修改</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="danger"
              plain
              icon="el-icon-delete"
              size="mini"
              :disabled="multiple"
              @click="handleDelete"
            >删除</el-button>
          </el-col>
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getScoreList"></right-toolbar>
        </el-row>
 
        <el-table v-loading="loading" :data="scoreList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="考核名" align="center" prop="examineName" />
          <el-table-column label="考核类型" align="center" prop="examineCategory">
            <template slot-scope="scope">
              <div v-if="scope.row.examineCategory == 1">省厅考核</div>
              <div v-else-if="scope.row.examineCategory == 2">市局考核</div>
              <div v-else-if="scope.row.examineCategory == 3">合同考核</div>
            </template>
          </el-table-column>
          <el-table-column label="考核对象" align="center" prop="unitName">
            <template slot-scope="scope">
              <div v-if="scope.row.unitName ==='成都x运维' ">成都x运维</div>
              <div v-else>自流井区</div>
            </template>
          </el-table-column>
          <el-table-column label="分值" align="center" prop="score" />
          <el-table-column label="考核规则" align="center" prop="ruleCategory">
            <template slot-scope="scope">
              <div v-if="scope.row.ruleCategory == 1">视频在线率</div>
              <div v-else-if="scope.row.ruleCategory == 2">存储故障</div>
              <div v-else-if="scope.row.ruleCategory == 3">视图库对接稳定性</div>
              <div v-else-if="scope.row.ruleCategory == 4">一机一档24小时未修复</div>
              <div v-else-if="scope.row.ruleCategory == 5">时钟不同步24小时未修复</div>
            </template>
          </el-table-column>
          <el-table-column label="创建人" align="center" prop="createBy" />
          <el-table-column label="创建时间" align="center" prop="createTime" />
          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleScoreUpdate(scope.row)"
              >修改</el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="handleScoreDelete(scope.row)"
              >删除</el-button>
            </template>
          </el-table-column>
        </el-table>
 
      </el-main>
    </el-container>
   <el-container>
     <el-main>
       <h2>考核规则</h2>
       <el-row :gutter="10" class="mb8">
         <el-col :span="1.5">
           <el-button
             type="success"
             plain
             icon="el-icon-edit"
             size="mini"
             :disabled="single"
             @click="handleRuleUpdate"
           >修改</el-button>
         </el-col>
         <el-col :span="1.5">
           <el-button
             type="danger"
             plain
             icon="el-icon-delete"
             size="mini"
             :disabled="multiple"
             @click="handleDelete"
           >删除</el-button>
         </el-col>
         <!--      <el-col :span="1.5">-->
         <!--        <el-button-->
         <!--          type="warning"-->
         <!--          plain-->
         <!--          icon="el-icon-download"-->
         <!--          size="mini"-->
         <!--          @click="handleExport"-->
         <!--          v-hasPermi="['system:checkRule:export']"-->
         <!--        >导出</el-button>-->
         <!--      </el-col>-->
         <right-toolbar :showSearch.sync="showSearch" @queryTable="getRuleList"></right-toolbar>
       </el-row>
 
       <el-table v-loading="loading" :data="ruleList" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="规则名称" align="center" prop="ruleName" />
         <el-table-column label="运维类别" align="center" prop="category">
           <template slot-scope="scope">
             <div v-if="scope.row.category === 1">视频监控</div>
             <div v-else-if="scope.row.category === 2">车辆识别</div>
             <div v-else-if="scope.row.category === 3">人脸识别</div>
           </template>
         </el-table-column>
         <el-table-column label="规则描述" align="center" prop="ruleDetail" />
         <el-table-column label="创建时间" align="center" prop="createTime" />
         <el-table-column label="审核状态" align="center" prop="auditState">
           <template slot-scope="scope">
             <dict-tag :options="dict.type.platform_audit_state" :value="scope.row.auditState"/>
           </template>
         </el-table-column>
         <el-table-column label="审核人" align="center" prop="auditUser" />
         <el-table-column label="审核时间" align="center" prop="auditTime" />
         <el-table-column label="审核意见" align="center" prop="auditDescription" />
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template slot-scope="scope">
             <el-button
               size="mini"
               type="text"
               icon="el-icon-edit"
               @click="handleRuleUpdate(scope.row)"
             >修改</el-button>
             <el-button
               size="mini"
               type="text"
               icon="el-icon-delete"
               @click="handleDelete(scope.row)"
             >删除</el-button>
           </template>
         </el-table-column>
       </el-table>
 
       <pagination
         v-show="total>0"
         :total="total"
         :page.sync="queryParams.pageNum"
         :limit.sync="queryParams.pageSize"
         @pagination="getRuleList"
       />
     </el-main>
   </el-container>
 
    <el-container>
      <el-main>
        <h2>考核成绩</h2>
          <el-collapse v-model="activeNames" @change="handleChange" >
            <el-collapse-item  name="1">
              <template slot="title">
                <div style="width: 10%" >自流井区</div><div style="margin-left: 75%">得分:0.97</div>
              </template>
              <div>视图库对接稳定性:95.32%</div>
              <div>点位在线率:96.46%</div>
              <div>联网卡口设备目录一致率:97.26%</div>
              <div>车辆卡口信息采集准确率:92.33%</div>
              <div>车辆卡口设备抓拍数据完整性:94.26%</div>
              <div>车辆卡口设备抓拍数据准确性:94.78%</div>
              <div>车辆卡口设备时钟准确性:93.98%</div>
              <div>车辆卡口设备抓拍数据上传及时性:95.86%</div>
              <div>车辆卡口设备url可用性:94.56%</div>
              <div>车辆卡口设备抓拍数据大图可用性:91.77%</div>
            </el-collapse-item>
            <el-collapse-item  name="2">
              <template slot="title">
                <div style="width: 10%">贡井区</div><div style="margin-left: 75%">得分:0.94</div>
              </template>
              <div>视图库对接稳定性:95.32%</div>
              <div>点位在线率:96.46%</div>
              <div>联网卡口设备目录一致率:97.26%</div>
              <div>车辆卡口信息采集准确率:92.33%</div>
              <div>车辆卡口设备抓拍数据完整性:94.26%</div>
              <div>车辆卡口设备抓拍数据准确性:94.78%</div>
              <div>车辆卡口设备时钟准确性:93.98%</div>
              <div>车辆卡口设备抓拍数据上传及时性:95.86%</div>
              <div>车辆卡口设备url可用性:94.56%</div>
              <div>车辆卡口设备抓拍数据大图可用性:91.77%</div>
            </el-collapse-item>
            <el-collapse-item title="大安区" name="3">
              <template slot="title">
                <div style="width: 10%">大安区</div><div style="margin-left: 75%">得分:0.95</div>
              </template>
              <div>视图库对接稳定性:95.32%</div>
              <div>点位在线率:96.46%</div>
              <div>联网卡口设备目录一致率:97.26%</div>
              <div>车辆卡口信息采集准确率:92.33%</div>
              <div>车辆卡口设备抓拍数据完整性:94.26%</div>
              <div>车辆卡口设备抓拍数据准确性:94.78%</div>
              <div>车辆卡口设备时钟准确性:93.98%</div>
              <div>车辆卡口设备抓拍数据上传及时性:95.86%</div>
              <div>车辆卡口设备url可用性:94.56%</div>
              <div>车辆卡口设备抓拍数据大图可用性:91.77%</div>
            </el-collapse-item>
            <el-collapse-item title="沿滩区" name="4">
              <template slot="title">
                <div style="width: 10%">沿滩区</div><div style="margin-left: 75%">得分:0.94</div>
              </template>
              <div>视图库对接稳定性:95.32%</div>
              <div>点位在线率:96.46%</div>
              <div>联网卡口设备目录一致率:97.26%</div>
              <div>车辆卡口信息采集准确率:92.33%</div>
              <div>车辆卡口设备抓拍数据完整性:94.26%</div>
              <div>车辆卡口设备抓拍数据准确性:94.78%</div>
              <div>车辆卡口设备时钟准确性:93.98%</div>
              <div>车辆卡口设备抓拍数据上传及时性:95.86%</div>
              <div>车辆卡口设备url可用性:94.56%</div>
              <div>车辆卡口设备抓拍数据大图可用性:91.77%</div>
            </el-collapse-item>
            <el-collapse-item title="荣县" name="5">
              <template slot="title">
                <div style="width: 10%">荣县</div><div style="margin-left: 75%">得分:0.93</div>
              </template>
              <div>视图库对接稳定性:95.32%</div>
              <div>点位在线率:96.46%</div>
              <div>联网卡口设备目录一致率:97.26%</div>
              <div>车辆卡口信息采集准确率:92.33%</div>
              <div>车辆卡口设备抓拍数据完整性:94.26%</div>
              <div>车辆卡口设备抓拍数据准确性:94.78%</div>
              <div>车辆卡口设备时钟准确性:93.98%</div>
              <div>车辆卡口设备抓拍数据上传及时性:95.86%</div>
              <div>车辆卡口设备url可用性:94.56%</div>
              <div>车辆卡口设备抓拍数据大图可用性:91.77%</div>
            </el-collapse-item>
            <el-collapse-item title="富顺区" name="6">
              <template slot="title">
                <div style="width: 10%">富顺区</div><div style="margin-left: 75%">得分:0.95</div>
              </template>
              <div>视图库对接稳定性:95.32%</div>
              <div>点位在线率:96.46%</div>
              <div>联网卡口设备目录一致率:97.26%</div>
              <div>车辆卡口信息采集准确率:92.33%</div>
              <div>车辆卡口设备抓拍数据完整性:94.26%</div>
              <div>车辆卡口设备抓拍数据准确性:94.78%</div>
              <div>车辆卡口设备时钟准确性:93.98%</div>
              <div>车辆卡口设备抓拍数据上传及时性:95.86%</div>
              <div>车辆卡口设备url可用性:94.56%</div>
              <div>车辆卡口设备抓拍数据大图可用性:91.77%</div>
            </el-collapse-item>
            <el-collapse-item title="高新区" name="7">
              <template slot="title">
                <div style="width: 10%">高新区</div><div style="margin-left: 75%;">得分:0.96</div>
              </template>
              <div>视图库对接稳定性:95.32%</div>
              <div>点位在线率:96.46%</div>
              <div>联网卡口设备目录一致率:97.26%</div>
              <div>车辆卡口信息采集准确率:92.33%</div>
              <div>车辆卡口设备抓拍数据完整性:94.26%</div>
              <div>车辆卡口设备抓拍数据准确性:94.78%</div>
              <div>车辆卡口设备时钟准确性:93.98%</div>
              <div>车辆卡口设备抓拍数据上传及时性:95.86%</div>
              <div>车辆卡口设备url可用性:94.56%</div>
              <div>车辆卡口设备抓拍数据大图可用性:91.77%</div>
            </el-collapse-item>
          </el-collapse>
    </el-main>
    </el-container>
 
    <!-- 添加或修改考核规则对话框 -->
    <el-dialog :title="title" :visible.sync="ruleOpen" width="600px" append-to-body>
      <el-form ref="form" :model="ruleForm" :rules="rules" label-width="80px">
        <el-form-item label="规则名称" prop="ruleName">
          <el-input v-model="ruleForm.ruleName" placeholder="请输入规则名称" />
        </el-form-item>
        <el-form-item label="规则类型" prop="category">
          <el-select v-model="ruleForm.category" placeholder="规则类型">
            <el-option
              v-for="item in categoryList"
              :key="item.id"
              :label="item.value"
              :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="规则描述" prop="ruleDetail">
          <el-input v-model="ruleForm.ruleDetail" type="textarea" show-word-limit maxlength="150" placeholder="请输入规则描述"/>
        </el-form-item>
        <el-form-item label="参数配置" prop="ruleDetail">
          <div class="row-warp">
            <div class="row">
              <div class="row-left">参数名</div>
              <div class="row-right">条件</div>
            </div>
            <div class="row">
              <div class="row-left">天网视频点位数</div>
              <div class="row-right">
                <div>不少于</div>
                <div>
                  <el-input class="input-w" type="number" v-model="ruleForm.videoPointNum"/>{{" %"}}
                </div>
              </div>
            </div>
            <div class="row">
              <div class="row-left">车辆卡口点位数</div>
              <div class="row-right">
                <div>不少于</div>
                <div><el-input class="input-w" type="number" v-model="ruleForm.vehicleCheckpointNum"/></div>{{" %"}}
              </div>
            </div>
            <div class="row">
              <div class="row-left">人脸卡口点位数</div>
              <div class="row-right">
                <div>不少于</div>
                <div>
                  <el-input class="input-w" type="number" v-model="ruleForm.faceChceckpointNum" /></div>{{" %"}}
              </div>
            </div>
          </div>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
 
    <!-- 规则详情 -->
    <el-dialog title="规则详情" :visible.sync="ruleDetailOpen" width="50%" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="规则名称" prop="ruleName">
          <el-input class="input" disabled v-model="form.ruleName" placeholder="请输入规则名称" />
        </el-form-item>
        <el-form-item label="运维公司" prop="companyName">
          <el-input class="input" disabled :value ="companyName" placeholder="请输入运维公司名称"></el-input>
        </el-form-item>
        <el-form-item label="规则描述" prop="ruleDesc">
          <el-input class="input" disabled v-model="form.ruleDesc" placeholder="请输入规则描述" />
        </el-form-item>
        <el-form-item label="规则设置">
          <div >
            <div class="line">
              <div class="line-left">时钟同步(超过±3秒为不合格)24小时内未修复的:扣除相关镜头数量*</div>
              <div class="line-right"><el-input disabled v-model="jsonRule.overTime" type="text"/></div>分
            </div>
            <div class="line">
              <div class="line-left">OSD标识不满足《GAT 751-2008 视频图像文字标注规范》,24小时内未修复的:标扣除相关镜头数量*</div>
              <div class="line-right"><el-input disabled v-model="jsonRule.failNum" type="text"/></div>分
            </div>
            <div class="line">
              <div class="line-left">用户抽检,一机一档数据项不合格(提供虚假数据或错误数据为不合格),24小时内未修复的:扣除相关镜头数量*</div>
              <div class="line-right"><el-input disabled v-model="jsonRule.failNum" type="text"/></div>分
            </div>
          </div>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">关闭</el-button>
      </div>
    </el-dialog>
 
    <!-- 添加或修改考核计分对话框 -->
    <el-dialog :title="title" :visible.sync="scoreOpen" width="500px" append-to-body>
      <el-form ref="form" :model="scoreForm" :rules="rules" label-width="80px">
        <el-form-item label="分值" prop="score">
          <el-input v-model="scoreForm.score" placeholder="请输入分值" />
        </el-form-item>
        <el-form-item label="考核名" prop="examineId">
          <el-select v-model="scoreForm.examineId" placeholder="请选择">
            <el-option
              v-for="item in examineList"
              :key="item.id"
              :label="item.value"
              :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="考核对象" prop="unitId">
          <el-select v-model="scoreForm.unitId" placeholder="请选择">
            <el-option
              v-for="item in unitList"
              :key="item.id"
              :label="item.value"
              :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="考核规则" prop="ruleCategory">
          <el-select v-model="scoreForm.ruleCategory" placeholder="请选择">
            <el-option
              v-for="item in ruleCategoryList"
              :key="item.id"
              :label="item.value"
              :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
 
<script>
import { listCheckResult, getCheckResult, delCheckResult, addCheckResult, updateCheckResult,manualScore, publishCheckResult } from "@/api/platform/check-result";
import { listCheckRule, getCheckRule, delCheckRule, addCheckRule, updateCheckRule } from "@/api/platform/check-rule";
import { listScore, getScore, delScore, addScore, updateScore } from "@/api/platform/check-score";
import {unitSelect} from "../../../../api/platform/unit";
import {publishSelect} from "../../../../api/platform/check-publish";
 
export default {
  name: "CheckResult",
  dicts: ['platform_audit_state'],
  data() {
    return {
      activeNames: ['1'],
      companyName: "成都x运维公司",
      detailTitle: '',
      detailOpen: false,
      detail:{
      },
      examineList: [],
      unitList: [
        {id:2,value: '成都x运维'},
        {id:3,value: '自流井区'},
      ],
      ruleCategoryList: [
        { id: 1, value: '视频在线率' },
        { id: 2, value: '存储故障' },
        { id: 3, value: '视图库对接稳定性' },
        { id: 4, value: '一机一档24小时未修复' },
        { id: 5, value: '时钟不同步24小时未修复' },
      ],
      tableData: [{
        name: '视频平均在线率',
        content: '97%',
        score: '-5'
      }, {
        name: '一机一档24小时未修复',
        content: '5个',
        score: '-0.5'
      }, {
        name: '存储故障',
        content: '5小时',
        score: '-0.3'
      }, {
        name: '时钟不同步24小时未修复',
        content: '3个',
        score: '-0.5'
      }],
      // 运维类型
      categoryList: [
        { id: 1, value: '视频监控' },
        { id: 2, value: '车辆识别' },
        { id: 3, value: '人脸识别' },
      ],
      manualScoreOpen: false,
      manualScoreForm: {},
      manualScoreTitle: '',
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 考核结果表格数据
      checkResultList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      scoreOpen: false,
      ruleOpen: false,
      ruleDetailOpen: false,
      // 逻辑删除时间范围
      daterangeCheckTime: [],
      // 表单参数
      form: {},
      scoreForm: {},
      ruleForm: {},
      jsonRule: {},
      // 考核规则列表
      ruleList: [],
      // 考核计分表格数据
      scoreList: [],
      //违约规则请求参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        ruleName: null,
        ruleStatus: null,
        createTime: null,
      },
      //考核分数请求参数
      scoreQueryParams: {
        pageNum: 1,
        pageSize: 10,
        examineCategory: 1,
      },
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    //考核成绩详情跳转参数接收
    if(this.$route.query.detail){
      this.detail = this.$route.query.detail
      console.log(this.$route.query.detail,"detail------------")
    }
    // 考核规则列表
    this.getRuleList();
    // 考核积分列表
    this.getScoreList();
    // this.selectUnit();
    this.selectExamine();
  },
  methods: {
    handleChange(val) {
      console.log(val);
    },
    // 运维公司下拉数据
    // selectUnit() {
    //   unitSelect().then(res => {
    //     this.unitList = res.data;
    //   })
    // },
    // 考核下拉数据
    selectExamine() {
      publishSelect().then(res => {
        this.examineList = res.data;
      })
    },
    /** 查询考核计分列表 */
    getScoreList() {
      this.loading = true;
      listScore(this.scoreQueryParams).then(response => {
        this.scoreList = response.rows;
        this.loading = false;
      });
    },
    /** 查询违约规则列表 */
    getRuleList() {
      this.loading = true;
      if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
        this.queryParams["start"] = this.daterangeCreateTime[0];
        this.queryParams["end"] = this.daterangeCreateTime[1];
      }
      listCheckRule(this.queryParams).then(response => {
        this.ruleList = response.data;
        this.total = response.total;
        this.loading = false;
      });
    },
    frequencyFormatter(row) {
      if (row.frequency === "1") {
        return "月度考核"
      }
      if (row.frequency === "2") {
        return "季度考核"
      }
    },
    examineRangeFormatter(row) {
      if (row.examineRange === "1") {
        return "分局考核"
      }
      if (row.examineRange === "2") {
        return "市局考核"
      }
    },
    /** 查询考核结果列表 */
    getCheckResult() {
      this.loading = true;
      getCheckResult(id).then(response => {
        this.detail = response.data;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.scoreOpen = false;
      this.ruleOpen = false;
      this.ruleDetailOpen = false;
      this.ruleDetailOpen = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        checkUnitId: null,
        checkPublishId: null,
        checkScore: null,
        systemScore: null,
        manualScore: null,
        checkTime: null,
        createTime: null,
        updateTime: null,
        deleted: null
      };
      this.resetForm("form");
    },
    cancelManualScore() {
      this.manualScoreForm = {};
      this.manualScoreTitle = "";
      this.manualScoreOpen = false;
    },
    submitManualScore() {
      if (! this.manualScoreForm.manualScore) {
        this.$modal.msgWarning("请填写分数");
        return
      }
      manualScore(this.manualScoreForm).then(res => {
        this.$modal.msgSuccess("操作成功");
        this.cancelManualScore();
        this.getList();
      })
    },
    handleSetManualScore(row) {
      this.manualScoreForm.id = row.id;
      this.manualScoreForm.manualScore = parseInt(row.manualScore);
      this.manualScoreTitle = row.checkUnitName + '人工打分'
      this.manualScoreOpen = true;
    },
 
    handlePublish(row) {
      let text = row.publish == 1 ? '取消发布' : '发布';
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认' + text + '考核结果编号为"' + ids + '"的数据项?').then(function() {
        return publishCheckResult(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess(text + "成功");
      }).catch(() => {});
 
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.daterangeCheckTime = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加考核结果";
    },
    /** 修改积分按钮操作 */
    handleScoreUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getScore(id).then(response => {
        this.scoreForm = response.data;
        this.scoreOpen = true;
        this.title = "修改考核计分";
      });
    },
    /** 修改按钮操作 */
    handleRuleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getCheckRule(id).then(response => {
        this.ruleForm = response.data;
        this.ruleOpen = true;
        this.title = "修改考核规则";
 
      });
    },
    // 详情按钮
    handleRuleDetail(row) {
      this.ruleDetailOpen = true;
      this.form = row;
      this.jsonRule = JSON.parse(this.form.ruleDetail);
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateCheckResult(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addCheckResult(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除考核结果编号为"' + ids + '"的数据项?').then(function() {
        return delCheckResult(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/checkResult/export', {
        ...this.queryParams
      }, `checkResult_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
<style scoped>
 
.line {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
}
 
.line-right {
  width: 50px;
}
.input{
  width: 200px;
}
 
.input-w {
  margin-left: 5px;
  width: 70px;
}
.row-warp {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  border: solid 1px gray;
  /*padding: 3px;*/
}
.row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  border-bottom: solid 1px gray;
  padding: 3px;
}
.row:last-of-type {
  border-bottom: none;
}
.row-left {
  flex: 2;
  border-right: solid 1px gray;
}
.row-right {
  flex: 4;
  display: flex;
  flex-direction: row;
  justify-content: center;
}
</style>