对比新文件 |
| | |
| | | import request from '/@/utils/request'; |
| | | |
| | | export function saftyApi() { |
| | | return { |
| | | // v1 |
| | | getSaftyList: (data: any) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/measure/page/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | addSafty: (data: any) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/measure/save`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | modSafty: (data: any) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/measure/update`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | delSafty: (data: any) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/measure/delete`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | }; |
| | | } |
| | |
| | | meta: { |
| | | title: '安全物资与设备' |
| | | } |
| | | }, |
| | | { |
| | | path: '/zysq', |
| | | name: 'zysq', |
| | | component: () => import('/@/views/newSpecialWorkSystem/workTicket/zysq/index.vue'), |
| | | meta: { |
| | | title: '作业申请' |
| | | } |
| | | }, |
| | | { |
| | | path: '/saftyManage', |
| | | name: 'saftyManage', |
| | | component: () => import('/@/views/system/saftyManage/index.vue'), |
| | | meta: { |
| | | title: '安全措施管理' |
| | | } |
| | | } |
| | | ]; |
| | |
| | | align-items: center; |
| | | justify-content: center; |
| | | background: url('../../assets/loginPage/login-bg.jpg') no-repeat center; |
| | | background-size: 100% 100%; |
| | | /*background-image: radial-gradient(at center, #0075c3, #000b61);*/ |
| | | |
| | | canvas { |
| | |
| | | </div> |
| | | <img class="bgImg" src="../../assets/newMenu/card-7.png" /> |
| | | </div> |
| | | <div class="grid-content cont-bg-1" v-throttle @click="render('7')"> |
| | | <div class="grid-content cont-bg-1" v-throttle @click="toManLocation"> |
| | | <div class="toplayer"> |
| | | <img class="iconImg" src="../../assets/newMenu/icon12.png" /> |
| | | <div> |
| | | <div class="itemTit">人员定位系统</div> |
| | | <div class="enTit">Personnel Positioning System</div> |
| | | </div> |
| | | </div> |
| | | <img class="bgImg" src="../../assets/newMenu/card-12.png" /> |
| | | </div> |
| | | <div class="grid-content cont-bg-2" v-throttle @click="render('7')"> |
| | | <div class="toplayer"> |
| | | <img class="iconImg" src="../../assets/newMenu/icon5.png" /> |
| | | <div> |
| | |
| | | </div> |
| | | </div> |
| | | <img class="bgImg" src="../../assets/newMenu/card-6.png" /> |
| | | </div> |
| | | <div class="grid-content cont-bg-2" v-throttle @click="toSmartFactory"> |
| | | <div class="toplayer"> |
| | | <img class="iconImg" src="../../assets/newMenu/icon13.png" /> |
| | | <div> |
| | | <div class="itemTit">智能工厂系统</div> |
| | | <div class="enTit">Intelligent Factory System</div> |
| | | </div> |
| | | </div> |
| | | <img class="bgImg" src="../../assets/newMenu/card-13.png" /> |
| | | </div> |
| | | <div class="grid-content cont-bg-2" @click="render('1')"> |
| | | <div class="toplayer"> |
| | |
| | | const toDoublePrevent = () => { |
| | | window.open('http://121.239.169.27:6801'); |
| | | }; |
| | | const toSmartFactory = () =>{ |
| | | window.open('http://10.211.134.139:5522/#/login'); |
| | | } |
| | | const toManLocation = () =>{ |
| | | window.open('http://10.211.134.138:8081/GUOTAI'); |
| | | } |
| | | const throttle = (renderMenu: any, delay: number) => { |
| | | let flag = true; |
| | | let count = 0; |
| | |
| | | renderToNew, |
| | | toRiskPlatform, |
| | | toDoublePrevent, |
| | | toSmartFactory, |
| | | toManLocation, |
| | | onScreenfullClick, |
| | | loginIconTwo, |
| | | getThemeConfig, |
| | |
| | | @media screen and (min-width: 1600px) { |
| | | .gridCont { |
| | | width: 100%; |
| | | height: 100%; |
| | | display: grid; |
| | | grid-gap: 20px; |
| | | grid-template-columns: repeat(3, 1fr); |
| | | grid-template-rows: repeat(5, 200px); |
| | | grid-auto-flow: row; |
| | | justify-content: center; |
| | | .toplayer { |
| | |
| | | @media screen and (min-width: 1200px) and (max-width: 1600px) { |
| | | .gridCont { |
| | | width: 100%; |
| | | height: 100%; |
| | | display: grid; |
| | | grid-gap: 15px; |
| | | grid-template-columns: repeat(3, 1fr); |
| | |
| | | @media screen and (max-width: 1200px) { |
| | | .gridCont { |
| | | width: 100%; |
| | | height: 100%; |
| | | display: grid; |
| | | grid-gap: 10px; |
| | | grid-template-columns: repeat(3, 1fr); |
| | |
| | | position: absolute; |
| | | top: 260px; |
| | | left: 220px; |
| | | overflow: hidden; |
| | | overflow-y: scroll; |
| | | .gridCont { |
| | | .grid-content { |
| | | border-radius: 16px; |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业申请单位" prop="workDetail.involvedDepIds"> |
| | | <el-cascader v-model="form.workDetail.involvedDepIds" :options="departList" :show-all-levels="false"/> |
| | | <el-cascader style="width: 100%" v-model="form.workDetail.involvedDepIds" :options="departList" :props="depProps" :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业单位" prop="workDetail.involvedDepIds"> |
| | | <el-cascader v-model="form.workDetail.involvedDepIds" :options="departList" :show-all-levels="false"/> |
| | | <el-cascader style="width: 100%" v-model="form.workDetail.involvedDepIds" :props="depProps" :options="departList" :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="预计整体完成时间" prop="workTimeLine"> |
| | | <el-form-item label="预计(整体)完成时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetime" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="备注" prop="info"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | :autosize="{ minRows: 1 }" |
| | | type="textarea" |
| | | placeholder="请输入作业备注" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-table :data="safeData" style="width: 100%" border> |
| | | <el-table-column type="index" label="序号" width="80px"/> |
| | | <el-table-column prop="name" label="安全措施"/> |
| | | <el-table-column prop="address" label="确认人"> |
| | | <template #default="scope"> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="address" label="操作"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="Edit">修改确认人</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="其他安全措施填报人" prop="info"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-table :data="form.reviewData" style="width: 100%" border> |
| | | <el-table-column prop="item" label="审批签字项目"/> |
| | | <el-table-column prop="isCheck" label="是否必签"> |
| | | <template #default="scope"> |
| | | <el-radio-group v-model="scope.row.isCheck"> |
| | | <el-radio :label="1">所有必签</el-radio> |
| | | <el-radio :label="2">任一</el-radio> |
| | | <el-radio :label="3">非必签</el-radio> |
| | | </el-radio-group> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="names" label="审批人"> |
| | | <template #default="scope"> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="address" label="操作"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="Edit">选择审批人</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="完工验收" prop="info"> |
| | | <el-select v-model="form.operatorUids"> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="现场开始结束确认人" prop="info"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <el-table :data="tableData" style="width: 100%"> |
| | | <el-table-column type="index" label="序号"/> |
| | | <el-table-column prop="name" label="安全措施"/> |
| | | <el-table-column prop="address" label="确认人" /> |
| | | </el-table> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { Search, Edit } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | |
| | | form: Object, |
| | | workLevelList: Array<any>, |
| | | otherWorkList: Array<any>, |
| | | equipmentDialog: boolean |
| | | equipmentDialog: boolean, |
| | | depProps:{}, |
| | | safeData: [] |
| | | } |
| | | export default defineComponent({ |
| | | name: 'fireForm', |
| | |
| | | receiveUids: [], |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | expEndTime: '', |
| | | reviewData: [ |
| | | { |
| | | item: '作业负责人意见', |
| | | isCheck: null, |
| | | names: [] |
| | | }, |
| | | { |
| | | item: '车间主任意见', |
| | | isCheck: null, |
| | | names: [] |
| | | }, |
| | | { |
| | | item: '运营安环科意见', |
| | | isCheck: null, |
| | | names: [] |
| | | }, |
| | | { |
| | | item: '运营单位负责人意见', |
| | | isCheck: null, |
| | | names: [] |
| | | }, |
| | | { |
| | | item: '事业部安环科意见', |
| | | isCheck: null, |
| | | names: [] |
| | | }, |
| | | { |
| | | item: '事业部负责人审批意见', |
| | | isCheck: null, |
| | | names: [] |
| | | }, |
| | | { |
| | | item: '公司主要负责人审批意见', |
| | | isCheck: null, |
| | | names: [] |
| | | }, |
| | | { |
| | | item: '岗位当班班长验票情况', |
| | | isCheck: null, |
| | | names: [] |
| | | } |
| | | ] |
| | | }, |
| | | workLevelList: [ |
| | | { |
| | |
| | | label: "盲板抽堵作业", |
| | | value: 8 |
| | | } |
| | | ] |
| | | ], |
| | | depProps:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | | value: 'depId' |
| | | }, |
| | | safeData: [] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | |
| | | |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | |
| | | state.form.involvedDepIds = userInfos.value.depId |
| | | }); |
| | | |
| | | |
| | |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | width: 100%; |
| | | height: 100vh; |
| | | overflow: hidden; |
| | | position: relative; |
| | | overflow-y: scroll; |
| | | padding: 40px 0 100px; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | position: absolute; |
| | | z-index: 999; |
| | | width: 100%; |
| | | background: #fff; |
| | | padding-top: 15px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | onMounted(() => { |
| | | getAll(); |
| | | getAllDepartment(); |
| | | getAllDevice() |
| | | getAllDevice(); |
| | | }); |
| | | |
| | | return { |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowVideoDialog" width="50%"> |
| | | <el-form :model="saftyForm" size="default" ref="userRef" :rules="saftyFormRules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="编号" prop="orderNum"> |
| | | <el-input v-model.trim="saftyForm.orderNum" placeholder="请输入编号" clearable type="number" :readonly="isDisabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="作业类型" prop="workType"> |
| | | <el-select v-model="saftyForm.workType" :disabled="isDisabled"> |
| | | <el-option |
| | | v-for="item in workTypeList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="安全措施内容" prop="measureContent"> |
| | | <el-input v-model.trim="saftyForm.measureContent" placeholder="带填空内容必须以“(#)”格式输入,如:现场配备灭火器(#)台,灭火毯(#)块。否则无法提交。" type="textarea" :autosize="{ minRows: 3 }" clearable :readonly="isDisabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="是否填空" prop="measureType"> |
| | | <el-radio-group v-model="saftyForm.measureType" :disabled="isDisabled"> |
| | | <el-radio :label="0">否</el-radio> |
| | | <el-radio :label="1">是</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-if="saftyForm.measureType == 1"> |
| | | <el-form-item label="填空数量" prop="blanks"> |
| | | <el-input v-model.trim="saftyForm.blanks" placeholder="请输入填空数量" clearable type="number" :readonly="isDisabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowVideoDialog = !isShowVideoDialog" size="default">取 消</el-button> |
| | | <el-button v-if="!isDisabled" type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import { saftyApi } from '/@/api/systemManage/saftyManage'; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DeptData {} |
| | | interface sexData {} |
| | | interface UserState { |
| | | title: string; |
| | | isDisabled: boolean; |
| | | isShowVideoDialog: boolean; |
| | | saftyForm: { |
| | | orderNum: number | null; |
| | | workType: number | null; |
| | | measureContent: string | null; |
| | | measureType: number | null; |
| | | blanks: number | null; |
| | | }; |
| | | saftyFormRules:{ |
| | | |
| | | }, |
| | | departmentData: Array<DeptData>; |
| | | addProps:{} |
| | | workTypeList: Array<TypeList> |
| | | } |
| | | interface TypeList { |
| | | label: string, |
| | | value: number |
| | | } |
| | | export default defineComponent({ |
| | | name: 'videoDialog', |
| | | setup(props, context) { |
| | | const userRef = ref() |
| | | const state = reactive<UserState>({ |
| | | title: '', |
| | | isDisabled: false, |
| | | isShowVideoDialog: false, |
| | | saftyForm: { |
| | | orderNum: null, |
| | | workType: null, |
| | | measureContent: '', |
| | | measureType: null, |
| | | blanks: null |
| | | }, |
| | | saftyFormRules:{ |
| | | orderNum: [{ required: true, message: '请填写安全措施编号', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '请选择作业类型', trigger: 'blur' }], |
| | | measureContent: [{ required: true, message: '请填写安全措施内容', trigger: 'blur' }], |
| | | measureType: [{ required: true, message: '请选择措施类型', trigger: 'blur' }], |
| | | blanks: [{ required: true, message: '请填写填空数量', trigger: 'blur' }] |
| | | }, |
| | | departmentData: [], // 部门数据 |
| | | addProps:{ |
| | | expandTrigger: 'hover', |
| | | emitPath: false, |
| | | value: 'depId', |
| | | label: 'depName', |
| | | checkStrictly: true |
| | | }, |
| | | workTypeList: [ |
| | | { |
| | | label: "动火作业", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "受限空间作业", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "吊装作业", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "动土作业", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "断路作业", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "高处作业", |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: "临时用电作业", |
| | | value: 7 |
| | | }, |
| | | { |
| | | label: "盲板抽堵作业", |
| | | value: 8 |
| | | } |
| | | ] |
| | | }); |
| | | // 打开弹窗 |
| | | const openDialog = (type: string, value: any, departmentList: [], roleList: [], dutyList:[]) => { |
| | | state.isShowVideoDialog = true; |
| | | state.departmentData = departmentList; |
| | | if (type === '新增') { |
| | | state.title = '新增安全措施' |
| | | state.isDisabled = false |
| | | state.saftyForm = { |
| | | orderNum: null, |
| | | workType: null, |
| | | measureContent: '', |
| | | measureType: null, |
| | | blanks: null |
| | | }; |
| | | } else if(type === '修改'){ |
| | | state.title = '修改安全措施'; |
| | | state.isDisabled = false |
| | | state.saftyForm = JSON.parse(JSON.stringify(value)); |
| | | } else{ |
| | | state.title = '查看安全措施'; |
| | | state.isDisabled = true |
| | | state.saftyForm = JSON.parse(JSON.stringify(value)); |
| | | } |
| | | }; |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | userRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | if(state.saftyForm.measureType == 0){ |
| | | state.saftyForm.blanks = null |
| | | } |
| | | if (state.title === '新增安全措施') { |
| | | let res = await saftyApi().addSafty(state.saftyForm); |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '安全措施新增成功', |
| | | duration: 2000 |
| | | }); |
| | | state.isShowVideoDialog = false; |
| | | context.emit('getSaftyList'); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } else { |
| | | let res = await saftyApi().modSafty(state.saftyForm); |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '安全措施修改成功', |
| | | duration: 2000 |
| | | }); |
| | | state.isShowVideoDialog = false; |
| | | context.emit('getSaftyList'); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | }; |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => {}); |
| | | return { |
| | | userRef, |
| | | openDialog, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-user-container"> |
| | | <el-card shadow="hover"> |
| | | <div class="system-user-search mb15"> |
| | | <el-select v-model="listQuery.searchParams.workType" clearable size="default"> |
| | | <el-option |
| | | v-for="item in workTypeList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <el-button size="default" type="primary" class="ml10" @click="initSaftyTableData"> |
| | | <el-icon> |
| | | <ele-Search /> |
| | | </el-icon> |
| | | 查询 |
| | | </el-button> |
| | | <el-button size="default" type="success" class="ml10" @click="onOpenSaftyDialog('新增', '')"> |
| | | <el-icon> |
| | | <ele-FolderAdd /> |
| | | </el-icon> |
| | | 新增 |
| | | </el-button> |
| | | </div> |
| | | <el-table :data="saftyTableData.data" style="width: 100%"> |
| | | <el-table-column prop="orderNum" label="编号" width="60" align="center"/> |
| | | <el-table-column prop="workTypeDesc" label="作业类型" align="center" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="measureContent" label="安全措施内容" align="center" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="gmtCreateUname" label="创建人" align="center" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="gmtCreate" label="创建时间" align="center" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="gmtModifiedUname" label="最后修改人" align="center" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="gmtModified" label="最后修改时间" align="center" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="100" align="center"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="onOpenSaftyDialog('查看', scope.row)">查看</el-button> |
| | | <el-button size="small" text type="primary" @click="onOpenSaftyDialog('修改', scope.row)">修改</el-button> |
| | | <el-button style="color: red" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <br /> |
| | | <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="page-position" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="listQuery.pageIndex" background v-model:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="saftyTableData.total"> </el-pagination> |
| | | <br /> |
| | | <br /> |
| | | </el-card> |
| | | <safty-dialog ref="safeRef" @getSaftyList="initSaftyTableData"/> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage } from 'element-plus'; |
| | | import saftyDialog from '/@/views/system/saftyManage/component/saftyDialog.vue'; |
| | | import { saftyApi } from '/@/api/systemManage/saftyManage'; |
| | | import { dutyApi } from '/@/api/systemManage/duty'; |
| | | import { departmentApi } from '/@/api/systemManage/department'; |
| | | import { useRoleApi } from '/@/api/systemManage/role'; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface TableDataRow { |
| | | name: string; |
| | | userNickname: string; |
| | | roleSign: string; |
| | | department: string[]; |
| | | phone: string; |
| | | email: string; |
| | | sex: string; |
| | | password: string; |
| | | overdueTime: Date; |
| | | status: boolean; |
| | | describe: string; |
| | | createTime: string; |
| | | } |
| | | interface DepartmentDataRow {} |
| | | interface TableDataState { |
| | | saftyTableData: { |
| | | data: Array<TableDataRow>; |
| | | total: number; |
| | | loading: boolean; |
| | | }; |
| | | listQuery: { |
| | | pageIndex: number; |
| | | pageSize: number; |
| | | searchParams: {} |
| | | }; |
| | | departmentList: []; |
| | | roleList: []; |
| | | dutyList: []; |
| | | props:{}; |
| | | workTypeList: Array<TypeList> |
| | | } |
| | | interface TypeList { |
| | | label: string, |
| | | value: number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'saftyManage', |
| | | components: { saftyDialog }, |
| | | setup() { |
| | | const safeRef = ref(); |
| | | const state = reactive<TableDataState>({ |
| | | saftyTableData: { |
| | | data: [], |
| | | total: 0, |
| | | loading: false, |
| | | }, |
| | | listQuery: { |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | searchParams: { |
| | | workType: null |
| | | } |
| | | }, |
| | | departmentList: [], |
| | | roleList: [], |
| | | dutyList: [], |
| | | props: { |
| | | label: 'depName', |
| | | value: 'depId', |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | | workTypeList: [ |
| | | { |
| | | label: "动火作业", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "受限空间作业", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "吊装作业", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "动土作业", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "断路作业", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "高处作业", |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: "临时用电作业", |
| | | value: 7 |
| | | }, |
| | | { |
| | | label: "盲板抽堵作业", |
| | | value: 8 |
| | | } |
| | | ] |
| | | }); |
| | | // 初始化表格数据 |
| | | const initSaftyTableData = async () => { |
| | | let res = await saftyApi().getSaftyList(state.listQuery); |
| | | if (res.data.code === '200') { |
| | | state.saftyTableData.data = res.data.data; |
| | | state.saftyTableData.total = res.data.total; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // 回显职务信息 |
| | | const parseNumber = (value: number) => { |
| | | return state.dutyList.find((i) => i.positionId === value)?.positionName; |
| | | }; |
| | | const getDepartmentData = async () => { |
| | | let res = await departmentApi().getDepartmentList(); |
| | | if (res.data.code === '200') { |
| | | state.departmentList = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const getRoleData = async () => { |
| | | let res = await useRoleApi().getRoleList(); |
| | | if (res.data.code === '200') { |
| | | state.roleList = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const getDutyData = async () => { |
| | | let res = await dutyApi().getAllList({positionName: '',positionCode: ''}); |
| | | if (res.data.code === '200') { |
| | | state.dutyList = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // 打开新增修改用户弹窗 |
| | | const onOpenSaftyDialog = (type: string, value: any) => { |
| | | safeRef.value.openDialog(type, value, state.departmentList, state.roleList, state.dutyList); |
| | | }; |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: TableDataRow) => { |
| | | ElMessageBox.confirm(`此操作将永久删除该项安全措施,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | let res = await saftyApi().delSafty({id: row.id}); |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | duration: 2000, |
| | | message: '删除成功' |
| | | }); |
| | | await initSaftyTableData(); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | initSaftyTableData(); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | initSaftyTableData(); |
| | | }; |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | let a = { name: 1, c: { name: 1 } }; |
| | | let b = Object.assign({}, a); |
| | | b.c.name = 2; |
| | | initSaftyTableData(); |
| | | getDepartmentData(); |
| | | getRoleData(); |
| | | getDutyData() |
| | | }); |
| | | return { |
| | | safeRef, |
| | | onOpenSaftyDialog, |
| | | onRowDel, |
| | | parseNumber, |
| | | onHandleSizeChange, |
| | | initSaftyTableData, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | :deep(.el-textarea.is-disabled .el-textarea__inner) { |
| | | background-color: var(--el-card-bg-color); |
| | | color: var(--el-input-text-color, var(--el-text-color-regular)); |
| | | } |
| | | :deep(.el-input.is-disabled .el-input__inner) { |
| | | color: var(--el-input-text-color, var(--el-text-color-regular)); |
| | | } |
| | | :deep(.el-input.is-disabled .el-input__wrapper) { |
| | | background-color: var(--el-card-bg-color); |
| | | } |
| | | </style> |