zmc
2023-12-18 6c74bf912e251347714099a84585f825b32a1c08
src/views/fysp/evaluation/components/CompPreCheck.vue
@@ -1,115 +1,76 @@
<template>
  <FYSearchBar @search="preCheck">
    <template #options>
      <!-- 区县 -->
      <FYOptionLocation
        :allOption="false"
        :level="3"
        :checkStrictly="false"
        v-model:value="formSearch._locations"
      ></FYOptionLocation>
      <!-- 场景类型 -->
      <FYOptionScene
        :allOption="false"
        :type="2"
        v-model:value="formSearch.scenetype"
      ></FYOptionScene>
      <!-- 时间 -->
      <FYOptionTime type="month" v-model:value="formSearch.time"></FYOptionTime>
  <el-steps :active="stepIndex" finish-status="success" style="" align-center>
    <el-step title="评估范围" />
    <el-step title="数据源检查" />
    <el-step title="豁免条目" />
    <el-step title="自动评估" />
  </el-steps>
  <el-card v-if="stepIndex == 0" shadow="never">
    <template #header>
      <div><el-text tag="b" size="large">选择评估范围</el-text></div>
      <el-text size="small" type="info">包括区县、场景类型以及月份</el-text>
    </template>
  </FYSearchBar>
  <el-row>
    <span>快捷选择</span>
    <el-button v-for="(v, i) in quickSetting" :key="i" type="primary" @click="quickSet(v)">{{
      v.name
    }}</el-button>
  </el-row>
    <FYForm :form-info="evaConditon" :rules="evaConditionRules" :showButtons="false">
      <template #form-item="{ formObj }">
        <!-- 区县 -->
        <FYOptionLocation
          :allOption="false"
          :level="3"
          :checkStrictly="false"
          v-model:value="formObj.locations"
        ></FYOptionLocation>
        <!-- 场景类型 -->
        <FYOptionScene
          :allOption="false"
          :type="2"
          v-model:value="formObj.scenetype"
        ></FYOptionScene>
        <!-- 时间 -->
        <FYOptionTime
          :initValue="true"
          type="month"
          v-model:value="formObj.time"
        ></FYOptionTime>
      </template>
    </FYForm>
    <template #footer>
      <el-row justify="space-around">
        <el-button type="primary" size="default">下一步</el-button>
      </el-row>
    </template>
  </el-card>
  <el-card v-if="stepIndex == 1" shadow="never"> Never2 </el-card>
  <el-card v-if="stepIndex == 2" shadow="never"> Never3 </el-card>
  <el-card v-if="stepIndex == 3" shadow="never"> Never4 </el-card>
</template>
<script>
import dayjs from 'dayjs';
/**
 * 自动评估条件合规性检查
 */
export default {
  name: 'CompPreCheck',
  props: {
    quickSetting: {
      type: Array,
      default: () => {
        return [
          {
            name: '静安工地',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310106',
              dName: '静安区'
            },
            scenetype: { label: '工地', value: '1' }
          },
          {
            name: '徐汇餐饮',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310104',
              dName: '徐汇区'
            },
            scenetype: { label: '餐饮', value: '5' }
          },
          {
            name: '金山工地',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310116',
              dName: '金山区'
            },
            scenetype: { label: '工地', value: '1' }
          },
          {
            name: '金山码头',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310116',
              dName: '金山区'
            },
            scenetype: { label: '码头', value: '2' }
          },
          {
            name: '金山搅拌站',
            locations: {
              pCode: '31',
              pName: '上海市',
              cCode: '3100',
              cName: '上海市',
              dCode: '310116',
              dName: '金山区'
            },
            scenetype: { label: '搅拌站', value: '3' }
          }
        ]
      }
    }
  },
  props: {},
  emits: ['preCheck'],
  data() {
    return {
      formSearch: {
        _locations: {},
        scenetype: {},
        time: undefined
      // 操作步骤下标
      stepIndex: 0,
      // 评估任务范围
      evaConditon: {},
      evaConditionRules: {
        acountname: [
          {
            required: true,
            message: '账户名不能为空',
            trigger: 'blur'
          }
        ]
      }
    }
    };
  },
  methods: {
    /**
@@ -117,18 +78,8 @@
     * 检查所选范围内各项评估数据源是否完整
     */
    preCheck() {
      this.$emit('preCheck', this.formSearch)
    },
    /**
     * 快速设置条件
     */
    quickSet(set) {
      this.formSearch._locations = set.locations
      this.formSearch.scenetype = set.scenetype
      this.preCheck()
      // this.$emit('preCheck', param)
    }
  }
}
};
</script>