深海科学与工程研究所安全巡检系统
祖安之光
2025-09-15 9fe04f4d9567a4de97f5f25d36557ab70b833782
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<template>
  <div class="app-container">
    <div style="display: flex;justify-content: space-between">
      <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" >
        <el-form-item label="检查日期:" >
          <el-date-picker
              v-model="queryParams.searchDate"
              type="month"
              value-format="YYYY-MM"
              placeholder="请选择"
          />
        </el-form-item>
        <el-form-item >
          <el-button type="primary" @click="getList">查询</el-button>
          <el-button type="primary" plain @click="reset">重置</el-button>
<!--          <el-button type="primary">导出</el-button>-->
        </el-form-item>
      </el-form>
    </div>
    <!-- 表格数据 -->
    <el-table v-loading="loading" :data="deptList" :border="true" row-key="deptId" default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
      <el-table-column prop="deptName" label="部门名称" align="center"></el-table-column>
      <el-table-column prop="checkCount" label="检查状态" align="center">
        <template #default="scope">
          <el-tag v-if="scope.row.checkCount > 0" type="success">已检查</el-tag>
          <el-tag v-else type="danger">未检查</el-tag>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
 
<script setup>
import {getCurrentInstance, onMounted, onUnmounted, reactive, ref, toRefs} from "vue";
import {ElMessage, ElMessageBox} from "element-plus";
import Cookies from "js-cookie";
import useUserStore from "@/store/modules/user";
import {listDept} from "@/api/system/dept";
import {
  delDailySafetyInspect,
  getDailySafetyInspectList,
  getDeptCheckData,
  saveDailySafetyInspect
} from "@/api/saftyCheck";
const { proxy } = getCurrentInstance();
const loading = ref(false);
const dialogRef = ref();
const state = reactive({
  queryParams: {
    searchDate: ''
  },
  deptList: [],
});
 
const { queryParams,deptList } = toRefs(state);
onMounted(async ()=>{
  await getList()
})
 
onUnmounted(()=>{
 
})
 
function getList() {
  getDeptCheckData(state.queryParams).then(response => {
    state.deptList = proxy.handleTree(response.data, "deptId")
  });
}
 
/** 重置新增的表单以及其他数据  */
const reset= async()=> {
  state.queryParams = {
    pageNum: 1,
    pageSize: 10,
    researchGroup: null,
    searchCheckUserId: null,
    checkType: null,
    haveMainHazard: null,
    checkBeginDate: '',
    checkEndDate: ''
  }
  state.checkDate = []
  await getList()
}
 
 
 
 
const handleClose = () => {
  dialogRef.value.closeDialog()
}
 
</script>