Newer
Older
KaiFengPC / src / views / spongePerformance / OutputPerformance / SewageTreatment.vue
@鲁yixuan 鲁yixuan on 3 Sep 4 KB updata
<template>
  <!-- 污水处理厂进水BOD -->
  <div class="publicContainer">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
      <el-form-item label="统计年份" prop="year">
        <el-date-picker
          type="year"
          v-model="queryParams.year"
          value-format="YYYY"
          placeholder="请选择统计年份"
          style="width: 100%"
        ></el-date-picker>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
        <el-button icon="Refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <!-- 表格 -->
    <el-table :data="dataList" v-loading="loading" stripe :max-height="580">
      <el-table-column type="index" width="55" label="序号" />
      <el-table-column label="年份" prop="year" />
      <el-table-column label="年度目标(mg/L)" prop="targetBod" />
      <el-table-column label="进水BOD实际平均浓度(mg/L)" prop="realBod" />
      <el-table-column label="达标情况" prop="isQualify">
        <template #default="scope">
          <el-tag v-if="scope.row.isQualify == '2'" type="warning">未填报</el-tag>
          <el-tag v-else :type="scope.row.isQualify == '1' ? 'success' : 'error'">{{
            scope.row.isQualify == '1' ? '达标' : '未达标'
          }}</el-tag>

          <!-- <span :class="scope.row.isQualify == 1 ? 'green' : scope.row.isQualify == 2 ? 'red' : ''">
            {{ scope.row.isQualify == '0' ? '否' : scope.row.isQualify == '1' ? '已填报' : scope.row.isQualify == '2' ? '未填报' : '' }}
          </span> -->
        </template>
      </el-table-column>
      <el-table-column label="操作" width="240">
        <template #default="scope">
          <el-button link icon="View" type="primary" @click="handleDetail(scope.row, 'view')">详情</el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 详情弹窗 -->
    <el-dialog :title="title" v-model="open" width="800px" append-to-body :close-on-click-modal="false">
      <el-table :data="dataListWSC" stripe :max-height="580">
        <!-- <el-table-column label="日期" prop="year" />
        <el-table-column label="进水BOD平均浓度(mg/L)">
          <el-table-column prop="monthPlan1" label="西区污水处理厂" />
          <el-table-column prop="monthPlan2" label="东区污水处理厂" />
          <el-table-column prop="monthPlan3" label="马家河污水处理厂" />
        </el-table-column> -->
        <el-table-column v-for="item in dataListOne" :label="item.value" :prop="item.key"> </el-table-column>
      </el-table>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup name="WaterSupplyWaterPlants">
import { yearDataStatisticsPage, sewageBodQueryYearDataDetail } from '@/api/spongePerformance/UrbanDomesticSewage';
const { proxy } = getCurrentInstance();
const showSearch = ref(true);
const loading = ref(true);
const title = ref('');
const open = ref(false);
const dataList = ref([{ yaer: '2022' }, { yaer: '2023' }, { yaer: '2024' }]);
const dataListWSC = ref([]);
const dataListOne = ref([]);
const AllData = reactive({
  id: '',
  queryParams: {
    year: null,
  },
});
const { queryParams } = toRefs(AllData);
//搜索
function handleQuery() {
  getList();
}
//重置
function resetQuery() {
  proxy.resetForm('queryRef');
  handleQuery();
}

/** 搜索列表 */
const getList = async () => {
  loading.value = true;
  yearDataStatisticsPage(queryParams.value).then(response => {
    dataList.value = response.data;
    loading.value = false;
  });
};

//查看详情操作
function handleDetail(row) {
  open.value = true;
  title.value = row.year + '污水厂进水BOD详情';
  SjDetail(row.year);
}
// 详情数据
function SjDetail(val) {
  sewageBodQueryYearDataDetail({ dataTime: val }).then(response => {
    dataListWSC.value = response.data.datalist;
    dataListOne.value = response.data.headlist;
  });
}
// 取消事件
function cancel() {
  open.value = false;
}
onMounted(() => {
  getList();
});
</script>
<style scoped lang="scss"></style>