riku
2024-01-10 54b5fa2047324b81b6d2ee7f830693267f946c0a
src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
@@ -62,6 +62,9 @@
<script>
import evaluateApi from '@/api/fysp/evaluateApi';
import taskApi from '@/api/fysp/taskApi';
import userMapApi from '@/api/fysp/userMapApi';
import problemApi from '@/api/fysp/problemApi';
import complaintApi from '@/api/fytz/complaintApi';
/**
 * 生成一项数据源检查记录
@@ -98,21 +101,17 @@
  emits: ['update:modelValue'],
  data() {
    return {
      areaInfo: {
        _locations: '',
        _scenetype: '',
        time: '',
        sourcetype: ''
      },
      areaInfo: {},
      // 数据源检查记录
      checkResults: [
        // 区域范围内的自动评估规则表是否存在
        baseCheckItem(
          '自动评估规则表',
          '',
          () => {
            const param = {
              taskTypeId: 99,
              scensetypeid: this.areaInfo._scenetype.value
              ...this.areaInfo
            };
            return evaluateApi.fetchEvaluationRule(param).then((res) => {
              return res.data.length > 0;
@@ -120,12 +119,39 @@
          },
          true
        ),
        baseCheckItem('现场监管巡查总任务', '', () => {}),
        // 区域范围内的监管任务是否存在
        baseCheckItem('现场监管巡查总任务', '', () => {
          return taskApi.fetchTopTasks(this.areaInfo).then((res) => {
            return res.data.length > 0;
          });
        }),
        // 区域范围内的监测数据是否存在、数据时间跨度是否完整、数据的初步分析是否完成
        baseCheckItem('现场监测数据', '', () => {}),
        baseCheckItem('监管点位与监测点匹配', '', () => {}),
        baseCheckItem('现场监管问题类型', '', () => {}),
        baseCheckItem('信访投诉', '', () => {}),
        baseCheckItem('行政处罚', '', () => {})
        // 区域范围内的每个监管点位与监测仪器的匹配记录是否存在,缺失情况等
        baseCheckItem('监管点位与监测点匹配', '', () => {
          userMapApi.fetchDeviceMap(this.areaInfo).then((res) => {
            return res.data.length > 0;
          });
        }),
        // 区域范围内的监管问题配置表是否存在
        baseCheckItem('现场监管问题类型', '', () => {
          const param = {
            cityCode: this.areaInfo.citycode,
            districtCode: this.areaInfo.districtcode,
            sceneTypeId: this.areaInfo.scensetypeid
          }
          problemApi.fetchProblemType(param).then((res) => {
            return res.length > 0;
          });
        }),
        // 区域范围内的信访投诉记录是否存在,可随时补充
        baseCheckItem('信访投诉', '', () => {
          complaintApi.fetchComplaints();
        }),
        // 区域范围内的行政处罚记录是否存在,可随时补充
        baseCheckItem('行政处罚', '', () => {
          complaintApi.fetchPunishment();
        })
      ]
    };
  },
@@ -162,8 +188,22 @@
      }
    },
    // 开始检查任务
    startCheck(v) {
      this.areaInfo = v;
    startCheck(value) {
      const v = value.value
      this.areaInfo = {
        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: v.time,
        scensetypeid: v._scenetype.value,
        online: true,
        sourceType: v.sourceType,
      };
      this.checkResults.forEach((e) => {
        e.fetch();
      });