Newer
Older
Nanping_sponge_GCGL / src / views / project / itemSecurity / environmentalMonitoringComponents / todoDon.vue
@liyingjing liyingjing on 25 Oct 2023 5 KB 海绵工程管理
<template>
  <div class="water-analysis-page">
    <el-table
      :data="tableData"
      v-loading="tableLoading"
      stripe
      max-height="500"
     
    >
      <el-table-column type="index" width="55" label="序号" align="center" />
      <el-table-column
        :label="i.label"
        align="center"
        :prop="i.props"
        show-overflow-tooltip
        v-for="i in environmentalMonitoringCloum"
      >
        <template #default="{ row }" v-if="i.props == 'projectName'">
          <span  @click="onCheck(row, 2, '详情')" class="projectName" > {{ row.projectName }}</span>
        </template>
        <template #default="{ row }" v-if="i.props == 'identificationDate'">
          {{row.identificationDate.substring(0, 10)  }}
        </template>
      </el-table-column>
      <el-table-column fixed="right" label="操作" width="180" align="center">
        <template #default="{ row }">
          <!-- <div v-if="FormList.workFlag=='1'">
                        <el-button link type="primary" @click="onCheck(row, 3)">提交</el-button>
                    <el-button link type="success" @click="onCheck(row, 1)">撤回</el-button>
                    <el-button link type="success" @click="onCheck(row, 2)">处理</el-button>
                    </div> -->
          <el-button link icon="View" type="primary" @click="onCheck(row, 2,'详情')"
            >详情</el-button
          >
          <el-button link type="danger" icon="Delete" @click="onCheck(row, 3)"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="FormList.totals > 0"
      :total="FormList.totals"
      v-model:page="FormList.pageNum"
      v-model:limit="FormList.pageSize"
      @pagination="getInfoList(FormList)"
    />
  </div>
  <!-- <projectTable v-else @returnClick="returnClick" :category='category'></projectTable> -->
  <!-- 查看详情弹框 -->
  <el-dialog
    v-model="visible"
    :title="'环境辨识与评价新'+title"
    :modal-append-to-body="false"
    :close-on-click-modal="false"
    width="68%"
  >
    <tableDalgo
      ref="tableDalgoRef"
      v-if="visible"
      @onModalClose="onModalClose"
      :typeList="typeList"
    ></tableDalgo>
    <template #footer>
      <div class="dialog-footer">
        <el-button v-show="typeList.type != 2" type="primary" @click="submit"
          >保存
        </el-button>
        <el-button @click="visible = false">关闭</el-button>
      </div>
    </template>
  </el-dialog>
</template>
<script setup>
import { defineExpose } from "vue";
import {
  getInfo,
  projectInfoDelete,
  projectInfoGet,
} from "@/api/environmentalMonitoring";
import { FileSystemList } from "@/api/project/tenderReview";

import tableDalgo from "./tableDalgo.vue";
import { downloadBlob, formatDate, formatMonths } from "@/utils/projectTable";
import emgBox from "@/utils/ElMessageBox";
import { environmentalMonitoringCloum } from "@/utils/cloums";
const { proxy } = getCurrentInstance();
const { project_operation_pattern, unit_property, credit_line } = proxy.useDict(
  "project_operation_pattern",
  "unit_property",
  "credit_line"
);
let visible = ref(false);
const FormList = ref({
  pageNum: 1,
  pageSize: 10,
  workFlag: 1,
});
let tableData = ref([]);
let tableLoading = ref(false);
let title=ref('')
const tableDalgoRef = ref();
//获取列表数据
const getInfoList = async (prams) => {
  if (prams.timer) {
    prams.identificationStartDate = prams.timer[0];
    prams.identificationEndDate = prams.timer[1];
  } else {
    prams.identificationStartDate = "";
    prams.identificationEndDate = "";
  }
  FormList.value = prams;
  tableLoading.value = true;
  let { data, total } = await getInfo(prams);
  tableData.value = data;
  FormList.value.totals = total;
  setTimeout(() => {
    tableLoading.value = false;
  }, 500);
};
//搜索
defineExpose({ getInfoList });
// 查看上报数据
let typeList = ref({});
const onCheck = (row, v,t) => {
  title.value=t
  if (v == 2 || v == 4) {
    projectInfoGet(row.id).then(({ code, data }) => {
      if (code == 200) {
        typeList.value = { ...data, type: v };
        FileSystemList({
          refId: row.id,
          refType: "proEnvironmentComment",
        }).then(({ data }) => {
          typeList.value.fileList1 = data;
          visible.value = true;
        });
      }
    });
  } else {
    emgBox(row.id, projectInfoDeleteM, "您确定删除吗?");
  }
};
//删除
const projectInfoDeleteM = async (id) => {
  let { code } = await projectInfoDelete(id);
  getInfoList(FormList.value);
};
function onModalClose() {
  visible.value = false;
  console.log(232323);
  //   getInfoList(FormList.value);
}
function submit() {
  tableDalgoRef.value.submit();
}
onMounted(() => {
  // getInfoList(FormList.value)
});
</script>
<style lang="scss" scoped>
.water-analysis-page {
  // border: 1px solid #ddd;
  height: 90vh;
  .top {
   // margin-bottom: 15px;
  }
  .el-input__inner {
    // color: #fff;//
  }
  ::v-deep .el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active {
    font-size: 18px;
    color: rgb(255, 255, 255);
    background-color: rgb(22, 132, 252);
    border-left: 1px solid rgb(22, 132, 252);
  }
}
:deep(.el-dialog__body) {
  background-color: #eef1fb;
  height: 700px;
  overflow: auto;
}
</style>