| | |
| | | # 页面标题 |
| | | VITE_APP_TITLE = 安全巡检系统 |
| | | VITE_APP_TITLE = 安全检查系统 |
| | | |
| | | # 开发环境配置 |
| | | VITE_APP_ENV = 'development' |
| | | |
| | | # 安全巡检系统/开发环境 |
| | | # 安全检查系统/开发环境 |
| | | VITE_APP_BASE_API = 'http://192.168.2.58:8085/api' |
| | |
| | | # 页面标题 |
| | | VITE_APP_TITLE = 安全巡检系统 |
| | | VITE_APP_TITLE = 安全检查系统 |
| | | |
| | | # 生产环境配置 |
| | | VITE_APP_ENV = 'production' |
| | | |
| | | # 安全巡检系统/生产环境 |
| | | VITE_APP_BASE_API = '/prod-api' |
| | | # 安全检查系统/生产环境 |
| | | VITE_APP_BASE_API = 'http://106.15.95.149:8011/api' |
| | | |
| | | # 是否在打包时开启压缩,支持 gzip 和 brotli |
| | | VITE_BUILD_COMPRESS = gzip |
| | |
| | | # 页面标题 |
| | | VITE_APP_TITLE = 安全巡检系统 |
| | | VITE_APP_TITLE = 安全检查系统 |
| | | |
| | | # 生产环境配置 |
| | | VITE_APP_ENV = 'staging' |
| | | |
| | | # 安全巡检系统/生产环境 |
| | | # 安全检查系统/生产环境 |
| | | VITE_APP_BASE_API = '/stage-api' |
| | | |
| | | # 是否在打包时开启压缩,支持 gzip 和 brotli |
| | |
| | | <meta name="renderer" content="webkit"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> |
| | | <link rel="icon" href="/favicon.ico"> |
| | | <title>安全巡检系统</title> |
| | | <title>安全检查系统</title> |
| | | <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]--> |
| | | <style> |
| | | html, |
| | |
| | | { |
| | | "name": "ruoyi", |
| | | "version": "3.8.6", |
| | | "description": "安全巡检系统", |
| | | "description": "安全检查系统", |
| | | "author": "若依", |
| | | "license": "MIT", |
| | | "scripts": { |
| | |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | export function getDeptCheckData(params) { |
| | | return request({ |
| | | url: '/system/dept/getDeptCheckData', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | export function getCheckCount(params) { |
| | | return request({ |
| | | url: '/system/dailySafetyInspection/getCheckCount', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | |
| | | color: #fff; |
| | | font-weight: 600; |
| | | line-height: 50px; |
| | | font-size: 14px; |
| | | font-size: 18px; |
| | | letter-spacing: 2px; |
| | | font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif; |
| | | vertical-align: middle; |
| | | } |
| | |
| | | /> |
| | | </el-select> |
| | | |
| | | <!-- 级联选择组件 --> |
| | | <el-cascader |
| | | v-else-if="item.type === 'cascader'" |
| | | v-model="state.formData[item.prop]" |
| | | :options="getCascaderOptions(item)" |
| | | :props="item.props || {}" |
| | | :placeholder="item.placeholder || '请选择'" |
| | | :disabled="state.title === '查看' || item.disabled" |
| | | :clearable="item.clearable !== false" |
| | | :filterable="item.filterable" |
| | | :show-all-levels="item.showAllLevels !== false" |
| | | :style="item.style || 'width: 100%'" |
| | | @change="item.changeEvent ? handleEvent(item.changeEvent, state.formData[item.prop]) : null" |
| | | /> |
| | | |
| | | |
| | | <!-- 日期选择器组件 --> |
| | | <el-date-picker |
| | | v-else-if="item.type === 'date'" |
| | |
| | | return [] |
| | | } |
| | | |
| | | const getCascaderOptions = (item) => { |
| | | if (!item.options) return [] |
| | | |
| | | // 如果是函数,执行函数获取选项 |
| | | if (typeof item.options === 'function') { |
| | | return item.options() |
| | | } |
| | | |
| | | // 如果是数组,直接返回 |
| | | if (Array.isArray(item.options)) { |
| | | return item.options |
| | | } |
| | | |
| | | // 如果是响应式引用 |
| | | if (item.options && typeof item.options === 'object' && 'value' in item.options) { |
| | | return item.options.value |
| | | } |
| | | |
| | | return [] |
| | | } |
| | | |
| | | // 文件上传前的校验 |
| | | const beforeUpload = (rawFile, item) => { |
| | | const maxSize = item.maxSize || 5 |
| | |
| | | if (userItem) { |
| | | userItem.options = () => userList.map(user => ({ |
| | | value: user.userId, |
| | | label: user.userName |
| | | label: user.nickName |
| | | })) |
| | | state.formData.reformUserId = null |
| | | await nextTick() |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="整改部门/研究组:" > |
| | | <el-select v-model="queryParams.reformDeptId" placeholder="请选择" clearable> |
| | | <el-option |
| | | v-for="item in deptList" |
| | | :key="item.deptId" |
| | | :label="item.deptName" |
| | | :value="item.deptId"> |
| | | </el-option> |
| | | </el-select> |
| | | <!-- <el-select v-model="queryParams.reformDeptId" placeholder="请选择" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in deptList"--> |
| | | <!-- :key="item.deptId"--> |
| | | <!-- :label="item.deptName"--> |
| | | <!-- :value="item.deptId">--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | <el-cascader v-model="queryParams.reformDeptId" placeholder="请选择" :options="deptList" :show-all-levels="false" :props="{value: 'deptId',label: 'deptName',children: 'children',emitPath: false,checkStrictly: true}"/> |
| | | </el-form-item> |
| | | <el-form-item label="整改人:" > |
| | | <el-select v-model="queryParams.reformUserId" placeholder="请选择" clearable> |
| | | <el-option |
| | | v-for="item in userList" |
| | | :key="item.userId" |
| | | :label="item.userName" |
| | | :label="item.nickName" |
| | | :value="item.userId"> |
| | | </el-option> |
| | | </el-select> |
| | |
| | | <el-table-column prop="hazardRoom" align="center" label="房间号"/> |
| | | <el-table-column prop="reformDeptName" align="center" label="整改部门/研究组"/> |
| | | <el-table-column prop="reformUserName" align="center" label="整改人"/> |
| | | <el-table-column prop="updateBy" align="center" label="隐患等记人"/> |
| | | <el-table-column prop="updateTime" align="center" label="隐患等记时间"/> |
| | | <el-table-column prop="createBy" align="center" label="隐患登记人"/> |
| | | <el-table-column prop="createTime" align="center" label="隐患登记时间"/> |
| | | <el-table-column prop="hazardLevel" align="center" label="整改状态"> |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.state == 1" type="primary">已整改</el-tag> |
| | |
| | | import useUserStore from "@/store/modules/user"; |
| | | import {generateWordDocument} from "@/utils/exportWord"; |
| | | import {listDept} from "@/api/system/dept"; |
| | | import {listUser} from "@/api/system/user"; |
| | | import {listUser, listUserByRoleKey} from "@/api/system/user"; |
| | | import {delDailySafetyInspect, getDailySafetyInspectList, saveDailySafetyInspect} from "@/api/saftyCheck"; |
| | | import {delHazard, getHazardList, saveHazard, updateHazard} from "@/api/hazardMng"; |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | { |
| | | label: '整改部门/研究组', |
| | | prop: 'reformDeptId', |
| | | type: 'select', |
| | | disabled: true, |
| | | rules: [{ required: true, message: '请选择部门', trigger: 'blur' }], |
| | | options: () => { |
| | | return state.deptList.map(dept => ({ |
| | | value: dept.deptId, |
| | | label: dept.deptName |
| | | })) |
| | | type: 'cascader', |
| | | showAllLevels: false, |
| | | props: { |
| | | value: 'deptId', |
| | | label: 'deptName', |
| | | children: 'children', |
| | | emitPath: false, |
| | | checkStrictly: true |
| | | }, |
| | | changeEvent: 'getUserList' |
| | | rules: [{ required: true, message: '请选择部门', trigger: 'blur' }], |
| | | options: () => state.deptList, |
| | | changeEvent: 'getUserListByRole' |
| | | }, |
| | | { |
| | | label: '整改人', |
| | |
| | | options: () => { |
| | | return state.userList.map(user => ({ |
| | | value: user.userId, |
| | | label: user.userName |
| | | label: user.nickName |
| | | })) |
| | | } |
| | | }, |
| | |
| | | ] |
| | | }, |
| | | dataLoader: { |
| | | async getUserList(reformDeptId) { |
| | | const res = await listUser({deptId: reformDeptId}) |
| | | return res.code === 200 ? res.rows : [] |
| | | async getUserListByRole(reformDeptId) { |
| | | const res = await listUserByRoleKey({deptId: reformDeptId,roleKey: 'safety_officer'}) |
| | | return res.code === 200 ? res.data : [] |
| | | } |
| | | }, |
| | | api: {}, |
| | |
| | | |
| | | function getDeptList() { |
| | | listDept({}).then(response => { |
| | | state.deptList = response.data |
| | | state.deptList = proxy.handleTree(response.data, "deptId") |
| | | }); |
| | | } |
| | | |
| | | function getUserList() { |
| | | listUser().then(res => { |
| | | state.userList = res.rows; |
| | | state.total = res.total; |
| | | listUser({pageNum: 1,pageSize: 999}).then(res => { |
| | | state.userList = res.rows |
| | | }) |
| | | }; |
| | | |
| | |
| | | const handleSubmit = async (data, type) => { |
| | | const {id,reasonAnalysis,rectificationMeasures,reformPeriod,reformPics} = JSON.parse(JSON.stringify(data)) |
| | | const params = {id,reasonAnalysis,rectificationMeasures,reformPeriod,reformPics} |
| | | console.log(params,'para') |
| | | const res = await updateHazard(params) |
| | | if(res.code == 200){ |
| | | ElMessage.success(res.msg) |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="整改部门/研究组:" > |
| | | <el-select v-model="queryParams.reformDeptId" placeholder="请选择" clearable> |
| | | <el-option |
| | | v-for="item in deptList" |
| | | :key="item.deptId" |
| | | :label="item.deptName" |
| | | :value="item.deptId"> |
| | | </el-option> |
| | | </el-select> |
| | | <!-- <el-select v-model="queryParams.reformDeptId" placeholder="请选择" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in deptList"--> |
| | | <!-- :key="item.deptId"--> |
| | | <!-- :label="item.deptName"--> |
| | | <!-- :value="item.deptId">--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | <el-cascader v-model="queryParams.reformDeptId" placeholder="请选择" :options="deptList" :show-all-levels="false" :props="{value: 'deptId',label: 'deptName',children: 'children',emitPath: false,checkStrictly: true}"/> |
| | | </el-form-item> |
| | | <el-form-item label="整改人:" > |
| | | <el-select v-model="queryParams.reformUserId" placeholder="请选择" clearable> |
| | | <el-option |
| | | v-for="item in userList" |
| | | :key="item.userId" |
| | | :label="item.userName" |
| | | :label="item.nickName" |
| | | :value="item.userId"> |
| | | </el-option> |
| | | </el-select> |
| | |
| | | <el-table-column prop="hazardRoom" align="center" label="房间号"/> |
| | | <el-table-column prop="reformDeptName" align="center" label="整改部门/研究组"/> |
| | | <el-table-column prop="reformUserName" align="center" label="整改人"/> |
| | | <el-table-column prop="updateBy" align="center" label="隐患等记人"/> |
| | | <el-table-column prop="updateTime" align="center" label="隐患等记时间"/> |
| | | <el-table-column prop="createBy" align="center" label="隐患登记人"/> |
| | | <el-table-column prop="createTime" align="center" label="隐患登记时间"/> |
| | | <el-table-column prop="hazardLevel" align="center" label="整改状态"> |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.state == 1" type="primary">已整改</el-tag> |
| | |
| | | import useUserStore from "@/store/modules/user"; |
| | | import {generateWordDocument} from "@/utils/exportWord"; |
| | | import {listDept} from "@/api/system/dept"; |
| | | import {listUser} from "@/api/system/user"; |
| | | import {listUser, listUserByRoleKey} from "@/api/system/user"; |
| | | import {delDailySafetyInspect, getDailySafetyInspectList, saveDailySafetyInspect} from "@/api/saftyCheck"; |
| | | import {delHazard, getHazardList, saveHazard, updateHazard} from "@/api/hazardMng"; |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | { |
| | | label: '整改部门/研究组', |
| | | prop: 'reformDeptId', |
| | | type: 'select', |
| | | disabled: true, |
| | | rules: [{ required: true, message: '请选择部门', trigger: 'blur' }], |
| | | options: () => { |
| | | return state.deptList.map(dept => ({ |
| | | value: dept.deptId, |
| | | label: dept.deptName |
| | | })) |
| | | type: 'cascader', |
| | | showAllLevels: false, |
| | | props: { |
| | | value: 'deptId', |
| | | label: 'deptName', |
| | | children: 'children', |
| | | emitPath: false, |
| | | checkStrictly: true |
| | | }, |
| | | changeEvent: 'getUserList' |
| | | rules: [{ required: true, message: '请选择部门', trigger: 'blur' }], |
| | | options: () => state.deptList, |
| | | changeEvent: 'getUserListByRole' |
| | | }, |
| | | { |
| | | label: '整改人', |
| | |
| | | options: () => { |
| | | return state.userList.map(user => ({ |
| | | value: user.userId, |
| | | label: user.userName |
| | | label: user.nickName |
| | | })) |
| | | } |
| | | }, |
| | |
| | | ] |
| | | }, |
| | | dataLoader: { |
| | | async getUserList(reformDeptId) { |
| | | const res = await listUser({deptId: reformDeptId}) |
| | | return res.code === 200 ? res.rows : [] |
| | | async getUserListByRole(reformDeptId) { |
| | | const res = await listUserByRoleKey({deptId: reformDeptId,roleKey: 'safety_officer'}) |
| | | return res.code === 200 ? res.data : [] |
| | | } |
| | | }, |
| | | api: {}, |
| | |
| | | |
| | | function getDeptList() { |
| | | listDept({}).then(response => { |
| | | state.deptList = response.data |
| | | state.deptList = proxy.handleTree(response.data, "deptId") |
| | | }); |
| | | } |
| | | |
| | | function getUserList() { |
| | | listUser().then(res => { |
| | | listUser({pageNum: 1,pageSize: 999}).then(res => { |
| | | state.userList = res.rows; |
| | | state.total = res.total; |
| | | }) |
| | | }; |
| | | |
| | |
| | | const handleSubmit = async (data, type) => { |
| | | const {id,reasonAnalysis,rectificationMeasures,reformPeriod,reformPics} = JSON.parse(JSON.stringify(data)) |
| | | const params = {id,reasonAnalysis,rectificationMeasures,reformPeriod,reformPics} |
| | | console.log(params,'para') |
| | | const res = await updateHazard(params) |
| | | if(res.code == 200){ |
| | | ElMessage.success(res.msg) |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="整改部门/研究组:" > |
| | | <el-select v-model="queryParams.reformDeptId" placeholder="请选择" clearable> |
| | | <el-option |
| | | v-for="item in deptList" |
| | | :key="item.deptId" |
| | | :label="item.deptName" |
| | | :value="item.deptId"> |
| | | </el-option> |
| | | </el-select> |
| | | <!-- <el-select v-model="queryParams.reformDeptId" placeholder="请选择" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in deptList"--> |
| | | <!-- :key="item.deptId"--> |
| | | <!-- :label="item.deptName"--> |
| | | <!-- :value="item.deptId">--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | <el-cascader v-model="queryParams.reformDeptId" placeholder="请选择" :options="deptList" :show-all-levels="false" :props="{value: 'deptId',label: 'deptName',children: 'children',emitPath: false,checkStrictly: true}"/> |
| | | </el-form-item> |
| | | <el-form-item label="整改人:" > |
| | | <el-select v-model="queryParams.reformUserId" placeholder="请选择" clearable> |
| | | <el-option |
| | | v-for="item in userList" |
| | | :key="item.userId" |
| | | :label="item.userName" |
| | | :label="item.nickName" |
| | | :value="item.userId"> |
| | | </el-option> |
| | | </el-select> |
| | |
| | | <el-table-column prop="hazardRoom" align="center" label="房间号"/> |
| | | <el-table-column prop="reformDeptName" align="center" label="整改部门/研究组"/> |
| | | <el-table-column prop="reformUserName" align="center" label="整改人"/> |
| | | <el-table-column prop="updateBy" align="center" label="隐患等记人"/> |
| | | <el-table-column prop="updateTime" align="center" label="隐患等记时间"/> |
| | | <el-table-column prop="createBy" align="center" label="隐患登记人"/> |
| | | <el-table-column prop="createTime" align="center" label="隐患登记时间"/> |
| | | <el-table-column label="操作" align="center"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openDialog('view',scope.row)">查看</el-button> |
| | |
| | | { |
| | | label: '整改部门/研究组', |
| | | prop: 'reformDeptId', |
| | | type: 'select', |
| | | rules: [{ required: true, message: '请选择部门', trigger: 'blur' }], |
| | | options: () => { |
| | | return state.deptList.map(dept => ({ |
| | | value: dept.deptId, |
| | | label: dept.deptName |
| | | })) |
| | | type: 'cascader', |
| | | showAllLevels: false, |
| | | props: { |
| | | value: 'deptId', |
| | | label: 'deptName', |
| | | children: 'children', |
| | | emitPath: false, |
| | | checkStrictly: true |
| | | }, |
| | | rules: [{ required: true, message: '请选择部门', trigger: 'blur' }], |
| | | options: () => state.deptList, |
| | | changeEvent: 'getUserListByRole' |
| | | }, |
| | | { |
| | |
| | | options: () => { |
| | | return state.userList.map(user => ({ |
| | | value: user.userId, |
| | | label: user.userName |
| | | label: user.nickName |
| | | })) |
| | | } |
| | | }, |
| | |
| | | |
| | | function getDeptList() { |
| | | listDept({}).then(response => { |
| | | state.deptList = response.data |
| | | state.deptList = proxy.handleTree(response.data, "deptId") |
| | | }); |
| | | } |
| | | |
| | | function getUserList() { |
| | | listUser().then(res => { |
| | | listUser({pageNum: 1,pageSize: 999}).then(res => { |
| | | state.userList = res.rows; |
| | | state.total = res.total; |
| | | }) |
| | | }; |
| | | |
| | |
| | | |
| | | const handleSubmit = async (data, type) => { |
| | | const params = JSON.parse(JSON.stringify(data)) |
| | | console.log(params,'para') |
| | | params.reformDeptName = state.deptList.find(i=>i.deptId == params.reformDeptId)?.deptName |
| | | params.reformUserName = state.userList.find(i=>i.userId == params.reformUserId)?.userName |
| | | // params.reformDeptName = state.deptList.find(i=>i.deptId == params.reformDeptId)?.deptName |
| | | params.reformUserName = state.userList.find(i=>i.userId == params.reformUserId)?.nickName |
| | | // 调用API保存数据 |
| | | if (type === '新增') { |
| | | delete params.id |
| | |
| | | <div style="margin: 150px 100px;color: #3173ea" class="login-img"> |
| | | <div > |
| | | <div style="font-size:50px">欢迎进入</div> |
| | | <div style="font-size: 35px;margin-top: 20px">安全巡检系统</div> |
| | | <div style="font-size: 35px;margin-top: 20px">安全检查系统</div> |
| | | </div> |
| | | |
| | | </div> |
| | |
| | | <template> |
| | | <el-row class="login-panel"> |
| | | <el-col :sm="24" :md="13" class="login-left"> |
| | | <el-col :sm="24" :md="14" class="login-left"> |
| | | <div class="login-title"> |
| | | <span>中国科学院深海科学与工程研究所</span> |
| | | <br/> |
| | | 安全巡检系统 |
| | | 安全检查系统 |
| | | </div> |
| | | </el-col> |
| | | <el-col :sm="24" :md="11" class="login-box"> |
| | | <el-col :sm="24" :md="10" class="login-box"> |
| | | <div class="glass-bg"></div> |
| | | <div class="login-card"> |
| | | <el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form"> |
| | |
| | | import { encrypt, decrypt } from "@/utils/jsencrypt"; |
| | | import useUserStore from '@/store/modules/user' |
| | | import { Base64 } from 'js-base64' |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import { getCheckCount } from "@/api/saftyCheck"; |
| | | const userStore = useUserStore() |
| | | const route = useRoute(); |
| | | const router = useRouter(); |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const loginForm = ref({ |
| | | username: "admin", |
| | | password: "Gkhy@c413", |
| | | username: "", |
| | | password: "", |
| | | rememberMe: false, |
| | | code: "", |
| | | uuid: "" |
| | |
| | | } |
| | | return acc; |
| | | }, {}); |
| | | router.push({ path: redirect.value || "/", query: otherQueryParams }); |
| | | if(new Date().getDate() < 25){ |
| | | router.push({ path: redirect.value || "/", query: otherQueryParams }) |
| | | return |
| | | } |
| | | getCheckCount().then(res=>{ |
| | | if(res.code == 200 && res.data == 0){ |
| | | ElMessageBox.confirm( |
| | | '本部门当月未进行安全检查,请先完成安全检查!', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '安全检查', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => {router.push({path: '/saftyCheckMng/dailyCheck'})}) |
| | | .catch(() => {router.push({ path: redirect.value || "/", query: otherQueryParams })}) |
| | | }else{ |
| | | router.push({ path: redirect.value || "/", query: otherQueryParams }) |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | loading.value = false; |
| | | // 重新获取验证码 |
| | |
| | | font-family: 'AliMa'; |
| | | color: #fff; |
| | | letter-spacing: 10px; |
| | | font-size: clamp(3rem, 1.286rem + 2.68vw, 4.5rem); |
| | | font-size: clamp(2rem, 0.286rem + 2.68vw, 3.5rem); |
| | | line-height: 1.2; |
| | | text-shadow: 0 5px 10px rgba(37,99,235,.3); |
| | | margin-bottom: 40px; |
| | |
| | | -ms-opacity: 0; |
| | | animation: show 0.5s 0.7s ease-in-out forwards; |
| | | text-align: center; |
| | | line-height: 1.5; |
| | | |
| | | span{ |
| | | font-size: clamp(1.375rem, 0.375rem + 1.56vw, 2.25rem) |
| | | font-size: clamp(2.675rem, 1.65rem + 1.56vw, 3.55rem) |
| | | } |
| | | } |
| | | } |
| | |
| | | >新增</el-button> |
| | | </el-form-item> |
| | | <el-form-item label="被检查部门/研究组:" > |
| | | <el-select v-model="queryParams.researchGroup" placeholder="请选择" clearable> |
| | | <el-option |
| | | v-for="item in deptList" |
| | | :key="item.deptId" |
| | | :label="item.deptName" |
| | | :value="item.deptId"> |
| | | </el-option> |
| | | </el-select> |
| | | <!-- <el-select v-model="queryParams.researchGroup" placeholder="请选择" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in deptList"--> |
| | | <!-- :key="item.deptId"--> |
| | | <!-- :label="item.deptName"--> |
| | | <!-- :value="item.deptId">--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | <el-cascader v-model="queryParams.researchGroup" placeholder="请选择" :options="deptList" :show-all-levels="false" :props="{value: 'deptId',label: 'deptName',children: 'children',emitPath: false,checkStrictly: true}"/> |
| | | </el-form-item> |
| | | <el-form-item label="参加检查人员:" > |
| | | <el-select v-model="queryParams.searchCheckUserId" placeholder="请选择" clearable> |
| | | <el-option |
| | | v-for="item in userList" |
| | | :key="item.userId" |
| | | :label="item.userName" |
| | | :label="item.nickName" |
| | | :value="item.userId"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="检查类型:" > |
| | | <el-select v-model="queryParams.checkType" placeholder="请选择" clearable> |
| | | <el-option |
| | | v-for="item in checkTypeList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="隐患:" > |
| | | <el-select v-model="queryParams.haveMainHazard" placeholder="请选择" clearable> |
| | | <el-option :key="1" label="有" :value="1"></el-option> |
| | | <el-option :key="0" label="无" :value="0"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="检查日期:" > |
| | | <el-date-picker |
| | | v-model="checkDate" |
| | | type="daterange" |
| | | value-format="YYYY-MM-DD" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item > |
| | | <el-button type="primary" @click="getList">查询</el-button> |
| | |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | researchGroup: null, |
| | | searchCheckUserId: null |
| | | searchCheckUserId: null, |
| | | checkType: null, |
| | | haveMainHazard: null, |
| | | checkBeginDate: '', |
| | | checkEndDate: '' |
| | | }, |
| | | dataList: [], |
| | | deptList: [], |
| | | userList: [], |
| | | checkTypeList: [ |
| | | { |
| | | value: 1, |
| | | label: '综合检查' |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: '部门检查' |
| | | }, |
| | | { |
| | | value: 3, |
| | | label: '实验室自查' |
| | | }, |
| | | { |
| | | value: 4, |
| | | label: '专项检查' |
| | | } |
| | | ], |
| | | total: 0, |
| | | formConfig: { |
| | | formItems: [ |
| | |
| | | options: () => { |
| | | return state.userList.map(user => ({ |
| | | value: user.userId, |
| | | label: user.userName |
| | | label: user.nickName |
| | | })) |
| | | } |
| | | }, |
| | |
| | | { |
| | | label: '被检查部门/研究组', |
| | | prop: 'researchGroup', |
| | | type: 'select', |
| | | type: 'cascader', |
| | | showAllLevels: false, |
| | | props: { |
| | | value: 'deptId', |
| | | label: 'deptName', |
| | | children: 'children', |
| | | emitPath: false, |
| | | checkStrictly: true |
| | | }, |
| | | rules: [{ required: true, message: '请选择部门', trigger: 'blur' }], |
| | | options: () => { |
| | | return state.deptList.map(dept => ({ |
| | | value: dept.deptId, |
| | | label: dept.deptName |
| | | })) |
| | | } |
| | | options: () => state.deptList |
| | | }, |
| | | { |
| | | label: '检查类型', |
| | | prop: 'checkType', |
| | | type: 'select', |
| | | filterable: true, |
| | | rules: [{ required: true, message: '请选择检查类型', trigger: 'change' }], |
| | | options: () => state.checkTypeList |
| | | }, |
| | | { |
| | | label: '检查内容', |
| | |
| | | label: '存在的主要隐患/问题', |
| | | prop: 'mainHazard', |
| | | type: 'textarea', |
| | | placeholder: '没有则填“无”', |
| | | autosize: { minRows: 3 }, |
| | | rules: [{ required: true, message: '请输入存在的主要隐患/问题', trigger: 'blur' }] |
| | | }, |
| | |
| | | label: '整改措施', |
| | | prop: 'rectificationMeasures', |
| | | type: 'textarea', |
| | | placeholder: '没有则填“无”', |
| | | autosize: { minRows: 3 }, |
| | | rules: [{ required: true, message: '请输入整改措施', trigger: 'blur' }] |
| | | }, |
| | |
| | | label: '复查结果', |
| | | prop: 'examinationResults', |
| | | type: 'textarea', |
| | | autosize: { minRows: 3 } |
| | | autosize: { minRows: 3 }, |
| | | rules: [{ required: true, message: '请输入复查结果', trigger: 'blur' }] |
| | | }, |
| | | { |
| | | label: '复查人员', |
| | | prop: 'reCheckUserId', |
| | | type: 'select', |
| | | rules: [{ required: true, message: '请选择复查人员', trigger: 'blur' }], |
| | | options: () => { |
| | | return state.userList.map(user => ({ |
| | | value: user.userId, |
| | | label: user.userName |
| | | label: user.nickName |
| | | })) |
| | | } |
| | | }, |
| | |
| | | prop: 'reCheckDate', |
| | | type: 'date', |
| | | dateType: 'date', |
| | | valueFormat: 'YYYY-MM-DD' |
| | | valueFormat: 'YYYY-MM-DD', |
| | | rules: [{ required: true, message: '请选择复查时间', trigger: 'blur' }] |
| | | }, |
| | | { |
| | | label: '备注', |
| | |
| | | ] |
| | | }, |
| | | dataLoader: {}, |
| | | api: {} |
| | | api: {}, |
| | | checkDate: [] |
| | | }); |
| | | |
| | | const { queryParams, total, dataList,deptList, userList, formConfig, dataLoader, api } = toRefs(state); |
| | | const { queryParams, total, dataList,deptList, userList, formConfig, dataLoader, api, checkTypeList, checkDate } = toRefs(state); |
| | | onMounted(async ()=>{ |
| | | await getList() |
| | | await getDeptList() |
| | |
| | | |
| | | function getDeptList() { |
| | | listDept({}).then(response => { |
| | | state.deptList = response.data |
| | | state.deptList = proxy.handleTree(response.data, "deptId") |
| | | }); |
| | | } |
| | | |
| | | function getUserList() { |
| | | listUser().then(res => { |
| | | listUser({pageNum: 1,pageSize: 999}).then(res => { |
| | | state.userList = res.rows; |
| | | state.total = res.total; |
| | | }) |
| | | }; |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | state.queryParams.checkBeginDate = state.checkDate[0] || '' |
| | | state.queryParams.checkEndDate = state.checkDate[1] || '' |
| | | const res = await getDailySafetyInspectList(state.queryParams) |
| | | if(res.code == 200){ |
| | | state.dataList = res.rows || [] |
| | |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | researchGroup: null, |
| | | searchCheckUserId: null |
| | | searchCheckUserId: null, |
| | | checkType: null, |
| | | haveMainHazard: null, |
| | | checkBeginDate: '', |
| | | checkEndDate: '' |
| | | } |
| | | state.checkDate = [] |
| | | await getList() |
| | | } |
| | | const handleDelete = (val) => { |
| | |
| | | params.dailySafetyInspectionUsers = params.dailySafetyInspectionUsers.map(item=>{ |
| | | return { |
| | | checkUserId: item, |
| | | checkUser: state.userList.find(i=>i.userId == item)?.userName, |
| | | checkUser: state.userList.find(i=>i.userId == item)?.nickName, |
| | | dailySafetyInspectionId: params.id |
| | | } |
| | | }) |
| | | params.reCheckUser = state.userList.find(i=>i.userId == params.reCheckUserId)?.userName |
| | | params.reCheckUser = state.userList.find(i=>i.userId == params.reCheckUserId)?.nickName |
| | | // 调用API保存数据 |
| | | if (type === '新增') { |
| | | delete params.id |
| 对比新文件 |
| | |
| | | <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> |