Newer
Older
Nanping_sponge_GCGL / src / views / project / itemSecurity / AndEvaluationComponents / todoDon.vue
@liyingjing liyingjing on 25 Oct 2023 6 KB 海绵工程管理
<template>
  <div class="water-analysis-page">
    <el-table
      :data="tableDataList"
      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 environmentalIdentificationAndEvaluationCloum"
      >
        <template #default="{ row }" v-if="i.props == 'projectName'">
          <span  class="projectName" > {{ row.projectName }}</span>
        </template>
        <template #default="{ row }" v-if="i.props == 'reformRecordCode'">
          <span  @click="onCheck(row, 4, '详情')" class="projectName" > {{ row.reformRecordCode }}</span>
        </template>
        <template #default="{ row }" v-if="i.props == 'hiddenTroubleLevel'">
          <dict-tag
            :options="hidden_trouble_level"
            :value="row.hiddenTroubleLevel"
          />
        </template>
        <template #default="{ row }" v-if="i.props == 'checkTime'">
          {{row.checkTime.substring(0, 10)  }}
        </template>
        <template #default="{ row }" v-if="i.props == 'status'">
          <span style="color:red" v-if="row.fromStatus">驳回</span>
          <dict-tag v-else :options="dangerous_status" :value="row.status" />
        </template>
      </el-table-column>
      <el-table-column fixed="right" label="操作" width="230" align="center">
        <template #default="{ row }">
          <el-button
            link
            type="primary"
            icon="View"
            @click="onCheck(row, 4, '详情')"
            >详情</el-button
          >
          <el-button
            v-if="row.status == 'examine' && todoList.queryScope == 'todo'"
            icon="Edit"
            link
            type="success"
            @click="onCheck(row, 6, '处理')"
            >处理</el-button
          >
          <!-- <el-button
            icon="Edit"
            v-if="row.status == 'start' && todoList.queryScope == 'main'"
            link
            type="warning"
            @click="onCheck(row, 5, '编辑')"
            >编辑</el-button
          > -->
          <el-button
            icon="EditPen"
            v-if="
              (row.status == 'submit' || row.status == 'start') &&
              todoList.queryScope != 'done'&& userName == row.createBy
            "
            link
            type="success"
            @click="onCheck(row, 3, '提交')"
            >提交</el-button
          >
          <!-- <div v-else-if="todoList.queryScope=='done'"> -->
          <el-button
            icon="Delete"
            v-if="
              (row.status == 'start' ) &&
              todoList.queryScope == 'main'&& userName == row.createBy
            "
            link
            type="danger"
            @click="onCheck(row, 8)"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <slot name="pagination"></slot>
    <el-dialog
      v-model="visible"
      :title="'隐患整改及复查' + tittle"
      :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-if="typeList.type != 4 && typeList.type != 6"
            @click="open2"
            type="primary"
            >{{ tittle }}</el-button
          >
          <el-button
            v-show="typeList.type == 6"
            type="primary"
            @click="open2(1)"
            >通过</el-button
          >
          <el-button v-show="typeList.type == 6" type="danger" @click="open2(2)"
            >驳回</el-button
          >
          <el-button @click="closed">关闭</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import { defineExpose } from "vue";
import {
  getInfo,
  projectInfoDelete,
  projectInfoGet,
  getInfoMamin,
} from "@/api/environmentalIdentificationAndEvaluation";
import tableDalgo from "./tableDalgo.vue";
import { downloadBlob, formatDate, formatMonths } from "@/utils/projectTable";
import emgBox from "@/utils/ElMessageBox";
import { environmentalIdentificationAndEvaluationCloum } from "@/utils/cloums";
const { proxy } = getCurrentInstance();
const {
  project_operation_pattern,
  unit_property,
  credit_line,
  dangerous_status,
  hidden_trouble_level,
} = proxy.useDict(
  "project_operation_pattern",
  "unit_property",
  "credit_line",
  "dangerous_status",
  "hidden_trouble_level"
);
const userName =sessionStorage.getItem('userName')
const tableDataList = ref([]);
const tableLoading = ref(false);
const typeList = ref({});
const tableDalgoRef = ref();
const tittle = ref("");
const { todoList, getInfoList, tableData, loading } = defineProps([
  "todoList",
  "getInfoList",
  "tableData",
]);
console.log("todoListtodoList", todoList);
const visible =ref(false)
tableLoading.value = todoList.loading;
const onCheck = (row, v, t) => {
  tittle.value = t;
  if (v == 8) {
    emgBox(row.id, projectInfoDeleteM, "您确定删除吗?");
  } else {
    projectInfoGet(row.id).then(({ code, data }) => {
      if (code == 200) {
        typeList.value = { ...data, type: v };
        visible.value = true;
      }
    });
  }
};
//删除
const projectInfoDeleteM = async (id) => {
  let { code } = await projectInfoDelete(id);
  getInfoList(tableData);
};
function onModalClose() {
  getInfoList(tableData);
  // tableLoading.value = loading;
  visible.value = false;
}
function closed() {
  tableDalgoRef.value.closed();
}
function open2(v) {
  tableDalgoRef.value.submit(v);
}
onMounted(() => {
  setTimeout(() => {
    tableLoading.value = false;
  }, 1000);
  tableDataList.value = todoList;
});
</script>
<style lang="scss" scoped>
.water-analysis-page {
  padding: 20px;
  height: 90vh;

  .top {
    // margin-bottom: 15px;
  }

  .el-input__inner {
  }

  ::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) {
  // padding: 0px !important;
  background-color: #eef1fb;
  height: 750px;
  overflow: auto;
}
</style>