hcong
2024-11-12 8f3255956f85af1df98170fb05e6551cea12e9b0
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
<template>
  <el-steps :active="stepIndex" finish-status="success" style="" align-center>
    <el-step title="评估范围" />
    <el-step title="数据源检查" />
    <el-step title="条目豁免" />
    <el-step title="自动评估" />
  </el-steps>
  <CompCheckArea v-show="stepIndex == 0" v-model="stepIndex" @change="onAreaChange"></CompCheckArea>
  <CompCheckSource
    v-show="stepIndex == 1"
    v-model="stepIndex"
    ref="refSource"
    @change="onDataSourceChange"
  ></CompCheckSource>
  <CompCheckExemption
    v-show="stepIndex == 2"
    v-model="stepIndex"
    @change="onExemptionChange"
  ></CompCheckExemption>
  <CompCheckConfirm
    v-show="stepIndex == 3"
    v-model="stepIndex"
    :area-info="area"
    :data-source="dataSource"
    :exemption-items="exemptionItems"
    @start="onNewTask"
  ></CompCheckConfirm>
</template>
 
<script>
import dayjs from 'dayjs';
import CompCheckArea from './components/CompCheckArea.vue';
import CompCheckSource from './components/CompCheckSource.vue';
import CompCheckExemption from './components/CompCheckExemption.vue';
import CompCheckConfirm from './components/CompCheckConfirm.vue';
 
/**
 * 自动评估条件合规性检查
 */
export default {
  name: 'CompPreCheck',
  components: { CompCheckArea, CompCheckSource, CompCheckExemption, CompCheckConfirm },
  props: {},
  emits: ['startTask'],
  data() {
    return {
      // 操作步骤下标
      stepIndex: 0,
      area: {
        _locations: {},
        _scenetype: {}
      },
      dataSource: {},
      // 豁免条目
      exemptionItems: {}
    };
  },
  methods: {
    /**
     * 监听评估范围变更
     */
    onAreaChange(val) {
      const v = val.value;
      this.area = v;
      const a = {
        provincecode: v._locations.pCode,
        provincename: v._locations.pName,
        citycode: v._locations.cCode,
        cityname: v._locations.cName,
        districtcode: v._locations.dCode,
        districtname: v._locations.dName,
        towncode: v._locations.tCode,
        townname: v._locations.tName,
        starttime: this.$fm.formatYMDH(v.time),
        scensetypeid: v._scenetype.value,
        online: true,
        sourceType: v.sourceType
      };
      this.$.refSource.startCheck(a);
    },
    onDataSourceChange(val) {
      this.dataSource = val;
    },
    onExemptionChange(val) {
      this.exemptionItems = val;
    },
    /**
     * 自动评估前置合规性检查
     * 检查所选范围内各项评估数据源是否完整
     */
    onNewTask() {
      this.$emit('startTask');
    }
  }
};
</script>