From 9f0eeddb0d3977dd39f3e317fedc50faf389c375 Mon Sep 17 00:00:00 2001 From: Your Name <123456> Date: 星期三, 31 八月 2022 17:09:40 +0800 Subject: [PATCH] 特殊作业 --- src/api/approveRule.js | 62 + src/views/specialWorkManage/workFlow/approveBasic/components/approveBasicDialog.vue | 187 ++++ src/assets/style/index.css | 15 src/views/specialWorkManage/workFlow/approveRule/index.vue | 409 ++++++++ src/views/specialWorkManage/workTicket/myApproval/index.vue | 13 src/api/safetyAction.js | 62 + src/views/specialWorkManage/foundationSet/index.vue | 13 src/views/roleManage/menu/index.vue | 2 src/views/specialWorkManage/workTicket/index.vue | 13 src/views/specialWorkManage/workFlow/approveRule/components/approveItemDialog.vue | 143 +++ src/views/specialWorkManage/workFlow/approveRule/components/approveLevelDialog.vue | 246 +++++ src/views/specialWorkManage/workTicket/workApply/index.vue | 13 src/views/specialWorkManage/foundationSet/safetyAction/components/safetyActionDialog.vue | 166 +++ src/api/approveBasic.js | 63 + src/main.js | 2 src/views/specialWorkManage/workFlow/index.vue | 13 src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/accept/index.vue | 31 src/views/specialWorkManage/foundationSet/safetyAction/index.vue | 367 +++++++ src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/rectify/index.vue | 18 src/views/specialWorkManage/workFlow/approveRule/components/approveRuleDialog.vue | 484 ++++++++++ src/views/specialWorkManage/workFlow/approveBasic/index.vue | 365 +++++++ src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/report/index.vue | 18 src/views/specialWorkManage/workTicket/myJobApply/index.vue | 13 23 files changed, 2,710 insertions(+), 8 deletions(-) diff --git a/src/api/approveBasic.js b/src/api/approveBasic.js new file mode 100644 index 0000000..c7c9a97 --- /dev/null +++ b/src/api/approveBasic.js @@ -0,0 +1,63 @@ +import request from '@/utils/request' +import { getToken } from '@/utils/auth' + + +export function approveBasicApi() { + return { + // v1 + getApproveBasicList: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/work/ruleItemStand/page/list`, + method: 'post', + data: data + }); + }, + // v1 + addApproveBasic: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/work/ruleItemStand/save`, + method: 'post', + data: data + }); + }, + // v1 + modApproveBasic: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/work/ruleItemStand/update`, + method: 'post', + data: data + }); + }, + // v1 + deleteApproveBasic: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/work/ruleItemStand/delete`, + method: 'post', + data: data + }); + }, + // v1 + getAllApproveBasicList: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/work/ruleItemStand/list`, + method: 'post', + data + }); + } + }; +} diff --git a/src/api/approveRule.js b/src/api/approveRule.js new file mode 100644 index 0000000..f17de77 --- /dev/null +++ b/src/api/approveRule.js @@ -0,0 +1,62 @@ +import request from '@/utils/request' +import { getToken } from '@/utils/auth' + +export function approveRuleApi() { + return { + // v1 + getApproveRuleList: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/rule/listByPage`, + method: 'post', + data: data + }); + }, + // v1 + addApproveRule: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/rule/save`, + method: 'post', + data: data + }); + }, + // v1 + modApproveRule: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/rule/update`, + method: 'post', + data: data + }); + }, + // v1 + deleteApproveRule: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/rule/del`, + method: 'post', + data: data + }); + }, + // v1 + getAllApproveRuleList: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/prevent/device/select/listDevices`, + method: 'post', + data + }); + } + }; +} diff --git a/src/api/safetyAction.js b/src/api/safetyAction.js new file mode 100644 index 0000000..7d7b1d8 --- /dev/null +++ b/src/api/safetyAction.js @@ -0,0 +1,62 @@ +import request from '@/utils/request' +import { getToken } from '@/utils/auth' + +export function safetyActionApi() { + return { + // v1 + getSafetyActionList: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/rule/measure/page/list`, + method: 'post', + data: data + }); + }, + // v1 + addSafetyAction: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/rule/measure/save`, + method: 'post', + data: data + }); + }, + // v1 + modSafetyAction: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/rule/measure/mod`, + method: 'post', + data: data + }); + }, + // v1 + deleteSafetyAction: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/rule/measure/delete`, + method: 'post', + data: data + }); + }, + // v1 + getAllSafetyActionList: (data) => { + return request({ + headers:{ + 'Authorization':getToken() + }, + url: process.env.BASE_API + `/rule/measure/list`, + method: 'post', + data: data + }); + } + }; +} diff --git a/src/assets/style/index.css b/src/assets/style/index.css new file mode 100644 index 0000000..3dfdd07 --- /dev/null +++ b/src/assets/style/index.css @@ -0,0 +1,15 @@ +.input-box{ + width: 200px !important; + padding-right: 10px; + padding-bottom: 10px; +} +.input-add{ + width: 90% !important; +} +.basic-line{ + display: inline-block; + padding-left: 10px; +} +.page-position{ + float: right; +} diff --git a/src/main.js b/src/main.js index 2dd6f5f..46c3c3d 100644 --- a/src/main.js +++ b/src/main.js @@ -1,7 +1,7 @@ import Vue from 'vue' import Cookies from 'js-cookie' - +import './assets/style/index.css' import 'normalize.css/normalize.css' // A modern alternative to CSS resets import 'default-passive-events' diff --git a/src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/accept/index.vue b/src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/accept/index.vue index 055ac2d..93aba82 100644 --- a/src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/accept/index.vue +++ b/src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/accept/index.vue @@ -12,7 +12,16 @@ ></el-option> </el-select> </div> - + <div class="basic_search"> + <span>验收部门:</span> + <el-select v-model="filter.depId" clearable filterable class="analyseUnit_box"> + <el-option + v-for="item in departmentList" + :key="item.id" + :label="item.department" + :value="item.id" + ></el-option> + </el-select> </div> <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="queryHandle">搜索</el-button> </div> @@ -92,6 +101,8 @@ import {deleteHiddenDangerReport, hiddenDangerAcceptList} from "../../../../../api/hiddenDanger"; import {safetyInspectionItemName} from "../../../../../api/safetySelfInspection"; import AcceptDialog from "./components/acceptDialog"; +import {getAllProductionDeviceList} from "../../../../../api/riskSource"; +import {getDepartmentList} from "../../../../../api/departmentManage"; export default { name: "rectify", @@ -123,12 +134,14 @@ pageIndex:1, pageSize:10, checkAcceptPersonid: null, + depId: null, } } }, created() { this.hiddenDangerList(); this.getUser() + this.getDepartmentData() }, methods: { queryHandle: function () { @@ -175,6 +188,22 @@ } }, + + async getDepartmentData(){ + let res = await getDepartmentList({pageSize:1000,pageIndex:1}) + if(res.data.code === '200'){ + this.departmentList = res.data.result.result + }else{ + this.$message({ + message:res.data.message, + type:'warning' + }) + if(res.data.code === '50001'){ + this.riskSourceData = [] + } + } + }, + hiddenDangerList(){ this.listLoading = true hiddenDangerAcceptList(this.filter) diff --git a/src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/rectify/index.vue b/src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/rectify/index.vue index b2cb38f..78cc327 100644 --- a/src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/rectify/index.vue +++ b/src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/rectify/index.vue @@ -95,6 +95,7 @@ import reportView from "../components/reportView"; import rectifyDialog from "./components/rectifyDialog"; import {deleteHiddenDangerReport} from "../../../../../api/hiddenDanger"; + import {getDepartmentList} from "../../../../../api/departmentManage"; export default { name: "rectify", @@ -130,7 +131,7 @@ }, created() { this.hiddenDangerList(); - + this.getDepartmentData() }, methods: { queryHandle: function () { @@ -162,7 +163,20 @@ window.open(fileurl, '_blank'); }, - + async getDepartmentData(){ + let res = await getDepartmentList({pageSize:1000,pageIndex:1}) + if(res.data.code === '200'){ + this.departmentList = res.data.result.result + }else{ + this.$message({ + message:res.data.message, + type:'warning' + }) + if(res.data.code === '50001'){ + this.riskSourceData = [] + } + } + }, hiddenDangerList(){ this.listLoading = true diff --git a/src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/report/index.vue b/src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/report/index.vue index efc8517..d8959cf 100644 --- a/src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/report/index.vue +++ b/src/views/doublePreventAction/hiddenDanger/hiddenDangerReform/report/index.vue @@ -25,13 +25,23 @@ <el-option v-for="item in dangerTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> </el-select> </div> + <div class="basic_search"> + <span>上报部门:</span> + <el-select v-model="filter.depId" clearable filterable class="analyseUnit_box"> + <el-option + v-for="item in departmentList" + :key="item.id" + :label="item.department" + :value="item.id" + ></el-option> + </el-select> </div> + <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-search" + @click="queryHandle"/> <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-plus" @click="showCreateHandle('新增', '')">新增 </el-button> - <el-button class="filter-item" style="margin-left: 10px;" type="primary" icon="el-icon-search" - @click="queryHandle"/> </div> <div class="table_content"> <el-table @@ -173,7 +183,8 @@ rectifier:'', rectifierid:'', note: '', - level:'' + level:'', + }, isSupervision: '', filter:{ @@ -182,6 +193,7 @@ dangerLevel: null, dangerSource: null, dangerStatus: null, + depId:null, dangerType: null }, diff --git a/src/views/roleManage/menu/index.vue b/src/views/roleManage/menu/index.vue index 772138c..13f01bc 100644 --- a/src/views/roleManage/menu/index.vue +++ b/src/views/roleManage/menu/index.vue @@ -379,7 +379,7 @@ handleNodeClick(data) { console.log('12313') // console.log(this.$route.meta, 'this.$router.meta') - this.form = merge({}, data) + this.form = data const cascaderValue = [] let exitFlag = false for (const node of this.cascaderTree) { diff --git a/src/views/specialWorkManage/foundationSet/index.vue b/src/views/specialWorkManage/foundationSet/index.vue new file mode 100644 index 0000000..ea834ff --- /dev/null +++ b/src/views/specialWorkManage/foundationSet/index.vue @@ -0,0 +1,13 @@ +<template> + <router-view></router-view> +</template> + +<script> + export default { + name: "index" + } +</script> + +<style scoped> + +</style> diff --git a/src/views/specialWorkManage/foundationSet/safetyAction/components/safetyActionDialog.vue b/src/views/specialWorkManage/foundationSet/safetyAction/components/safetyActionDialog.vue new file mode 100644 index 0000000..d6c2420 --- /dev/null +++ b/src/views/specialWorkManage/foundationSet/safetyAction/components/safetyActionDialog.vue @@ -0,0 +1,166 @@ +<template> + <div class="system-add-menu-container"> + <el-dialog :title="title" :visible.sync="isShowSafetyActionDialog" width="600px" :close-on-click-modal="false"> + <el-form :model="safetyActionForm" :rules="safetyActionFormRules" ref="safetyActionFormRef" size="default" 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="workType"> + <el-select class="input-add" :disabled="!disabled" v-model="safetyActionForm.workType" placeholder="请选择作业类型" filterable clearable> + <el-option v-for="item in workTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </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="type"> + <el-select class="input-add" :disabled="!disabled" v-model="safetyActionForm.type" placeholder="请选择措施类型" clearable filterable> + <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col v-if="safetyActionForm.type === 1" :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> + <el-form-item label="正确值" prop="correctVal"> + <el-select class="input-add" :disabled="!disabled" v-model="safetyActionForm.correctVal" placeholder="请选择正确值" clearable filterable> + <el-option v-for="item in typeTwoList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </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="context"> + <el-input class="input-add" :disabled="!disabled" :rows="3" v-model.trim="safetyActionForm.context" type="textarea" placeholder="请输入描述"></el-input> + </el-form-item> + </el-col> + </el-row> + </el-form> + <template #footer> + <div class="dialog-footer" v-show="disabled" align="right"> + <el-button @click="isShowSafetyActionDialog = !isShowSafetyActionDialog" size="default">取 消</el-button> + <el-button type="primary" @click="submitSafetyAction" size="default">确 定</el-button> + </div> + </template> + </el-dialog> + </div> +</template> + +<script> +import {safetyActionApi} from "../../../../../api/safetyAction"; + +export default { + name: 'SafetyActionDialog', + data(){ + return{ + title: '', + disabled: false, + personTime: false, + departmentList: [], + isShowSafetyActionDialog: false, + workTypeList: [ + { id: 1, name: '动火作业' }, + { id: 2, name: '受限空间作业' }, + { id: 3, name: '吊装作业' }, + { id: 4, name: '动土作业' }, + { id: 5, name: '断路作业' }, + { id: 6, name: '高处作业' }, + { id: 7, name: '临时用电作业' }, + { id: 8, name: '盲板抽堵作业' } + ], + typeList: [ + { id: 1, name: '选择' }, + { id: 2, name: '填空' } + ], + typeTwoList: [ + { id: 1, name: '是' }, + { id: 2, name: '否' } + ], + safetyActionForm: { + workType: null, + type: null, + correctVal: null, + context: null + }, + safetyActionFormRules: { + workType: [{ required: true, message: '请选择作业类型', trigger: 'change' }], + type: [{ required: true, message: '请选择措施类型', trigger: 'change' }], + correctVal: [{ required: true, message: '请选择正确值', trigger: 'change' }], + context: [{ required: true, message: '请填写措施内容', trigger: 'blur' }] + } + } + }, + methods:{ + showSafetyActionDialog(type, value, department) { + this.isShowSafetyActionDialog = true; + this.departmentList = department; + this.$nextTick(() =>{ + this.$refs["safetyActionFormRef"].clearValidate() + }) + if (type === '新增') { + this.disabled = true; + this.personTime = false; + this.title = '新增安全措施'; + this.safetyActionForm = { + workType: null, + type: null, + correctVal: null, + context: null + }; + } else if (type === '查看') { + this.disabled = false; + this.personTime = true; + this.title = '查看安全措施'; + this.safetyActionForm = JSON.parse(JSON.stringify(value)); + } else { + this.disabled = true; + this.personTime = false; + this.title = '修改安全措施'; + this.safetyActionForm = JSON.parse(JSON.stringify(value)); + } + }, + + submitSafetyAction() { + this.$refs["safetyActionFormRef"].validate(async (valid) => { + if (valid) { + if (this.title === '新增安全措施') { + let res = await safetyActionApi().addSafetyAction(this.safetyActionForm); + if (res.data.code === '200') { + this.$message({ + type: 'success', + message: '安全措施新增成功', + duration: 2000 + }); + this.isShowSafetyActionDialog = false; + context.emit('refreshSafetyAction'); + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + } else { + let res = await safetyActionApi().modSafetyAction(this.safetyActionForm); + if (res.data.code === '200') { + this.$message({ + type: 'success', + message: '安全措施改成功', + duration: 2000 + }); + this.isShowSafetyActionDialog = false; + context.emit('refreshSafetyAction'); + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + } + } else { + this.$message({ + type: 'warning', + message: '请完善基本信息' + }); + } + }); + }, + }, +}; +</script> + +<style scoped></style> diff --git a/src/views/specialWorkManage/foundationSet/safetyAction/index.vue b/src/views/specialWorkManage/foundationSet/safetyAction/index.vue new file mode 100644 index 0000000..6c8a03b --- /dev/null +++ b/src/views/specialWorkManage/foundationSet/safetyAction/index.vue @@ -0,0 +1,367 @@ +<template> + <div class="home-container"> + <div style="height: 100%"> + <el-row class="homeCard"> + <div class="basic-line"> + <span>作业类型:</span> + <el-select v-model="params.searchParams.workType" clearable filterable class="input-box" placeholder="作业类型"> + <el-option v-for="item in workTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>措施类型:</span> + <el-select v-model="params.searchParams.type" clearable filterable class="input-box" placeholder="措施类型"> + <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>措施内容:</span> + <el-input v-model.trim="params.searchParams.context" class="input-box" placeholder="措施内容"> </el-input> + </div> + <div style="padding-bottom: 10px"> + <el-button type="primary" @click="initSafetyAction">查询</el-button> + <el-button plain @click="reset">重置</el-button> + </div> + </el-row> + <div class="homeCard"> + <div class="main-card"> + <el-row class="cardTop"> + <el-col :span="24" class="mainCardBtn"> + <el-button type="primary" size="default" @click="openSafetyActionDialog('新增', {})">新建</el-button> + <el-button type="danger" size="default" @click="deleteMoreSafetyAction" plain>批量删除</el-button> + </el-col> + </el-row> + <el-table ref="multipleTableRef" :data="safetyActionData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" /> + <el-table-column property="workType" label="作业类型"> + <template slot-scope="scope"> + <div v-for="item in workTypeList"> + <div v-if="scope.row.workType === item.id"> + <span>{{item.name}}</span> + </div> + </div> + </template> + </el-table-column> + <el-table-column property="type" label="措施类型"> + <template slot-scope="scope"> + <div v-for="item in typeList"> + <div v-if="scope.row.type === item.id"> + <span>{{item.name}}</span> + </div> + </div> + </template> + </el-table-column> + <el-table-column property="context" label="措施内容"></el-table-column> + <el-table-column prop="correctVal" label="正确值" show-overflow-tooltip> + <template slot-scope="scope"> + <div v-for="item in typeTwoList"> + <div v-if="scope.row.correctVal === item.id"> + <span>{{item.name}}</span> + </div> + </div> + </template> + </el-table-column> + <el-table-column prop="createUname" label="创建人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> + <el-table-column prop="modifiedUname" label="最后修改人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtModified" label="最后修改时间" show-overflow-tooltip></el-table-column> + <el-table-column fixed="right" label="操作" align="center" width="300"> + <template slot-scope="scope"> + <el-button type="text" @click="openSafetyActionDialog('查看', scope.row)">查看</el-button> + <el-button type="text" @click="openSafetyActionDialog('修改', scope.row)">修改</el-button> + <el-button style="color:red" type="text" @click="deleteSafetyAction(scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + <br /> + <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="params.pageIndex" background v-model:page-size="params.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total" class="page-position"> </el-pagination> + </div> + </div> + </div> + <safety-action-dialog ref="safetyActionDialogRef" @refreshSafetyAction="initSafetyAction"></safety-action-dialog> + </div> +</template> + +<script> +import safetyActionDialog from "./components/safetyActionDialog"; +import {safetyActionApi} from "../../../../api/safetyAction"; +export default { + name: 'index', + components: { safetyActionDialog }, + data(){ + return{ + safetyActionData: [], + total: 0, + loading: false, + params: { + pageIndex: 1, + pageSize: 10, + searchParams: { + workType: null, + type: null, + context: null + } + }, + workTypeList: [ + { id: 1, name: '动火作业' }, + { id: 2, name: '受限空间作业' }, + { id: 3, name: '吊装作业' }, + { id: 4, name: '动土作业' }, + { id: 5, name: '断路作业' }, + { id: 6, name: '高处作业' }, + { id: 7, name: '临时用电作业' }, + { id: 8, name: '盲板抽堵作业' } + ], + typeList: [ + { id: 1, name: '选择' }, + { id: 2, name: '填空' } + ], + typeTwoList: [ + { id: 1, name: '是' }, + { id: 2, name: '否' } + ], + deleteList: { + ids: [] + } + } + }, + created() { + this.initSafetyAction() + }, + methods:{ + async initSafetyAction() { + let res = await safetyActionApi().getSafetyActionList(this.params); + if (res.data.code === '200') { + this.safetyActionData = res.data.data; + this.total = res.data.total; + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }, + + openSafetyActionDialog(type, value) { + this.$refs.safetyActionDialogRef.showSafetyActionDialog(type, value); + }, + + deleteMoreSafetyAction() { + this.$confirm(`此操作将永久删除该措施,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await safetyActionApi().deleteSafetyAction(this.deleteList); + if (res.data.code === '200') { + this.$message({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await this.initSafetyAction(); + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }, + deleteSafetyAction(row) { + this.$confirm(`此操作将永久删除该措施,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await safetyActionApi().deleteSafetyAction({ ids: [row.id] }); + if (res.data.code === '200') { + this.deleteList.ids = []; + this.$message({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await this.initSafetyAction(); + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }, + handleSelectionChange(val) { + this.deleteList.ids = val.map((item) => { + return item.id; + }); + }, + + parseNumber(value, type) { + if (type === '作业类型') { + return this.workTypeList.find((item) => item.id === value).name; + } else { + return this.typeList.find((item) => item.id == value).name; + } + }, + + onHandleSizeChange(val) { + this.params.pageSize = val; + this.initSafetyAction() + }, + + onHandleCurrentChange(val) { + this.params.pageIndex = val; + this.initSafetyAction() + }, + + reset() { + this.params = { + pageIndex: 1, + pageSize: 10, + searchParams: { + workType: null, + type: null, + context: null + } + }; + }, + }, +}; +</script> + +<style scoped lang="scss"> +$homeNavLengh: 8; +.home-container { + height: calc(100vh - 100px); + box-sizing: border-box; + overflow: hidden; + .homeCard { + width: 100%; + padding: 20px; + box-sizing: border-box; + background: #fff; + border-radius: 4px; + + .main-card { + width: 100%; + height: 100%; + .cardTop { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 20px; + .mainCardBtn { + margin: 0; + } + } + .pageBtn { + height: 60px; + display: flex; + align-items: center; + justify-content: right; + + .demo-pagination-block + .demo-pagination-block { + margin-top: 10px; + } + .demo-pagination-block .demonstration { + margin-bottom: 16px; + } + } + } + &:last-of-type { + height: calc(100% - 100px); + } + } + .el-row { + display: flex; + align-items: center; + margin-bottom: 20px; + &:last-child { + margin-bottom: 0; + } + .grid-content { + align-items: center; + min-height: 36px; + } + + .topInfo { + display: flex; + align-items: center; + font-size: 16px; + font-weight: bold; + + & > div { + white-space: nowrap; + margin-right: 20px; + } + } + } +} +.stepItem { + width: 100%; + display: flex; + align-items: flex-start; + margin-bottom: 30px; + margin-left: 30px; + padding-bottom: 30px; + border-left: 2px solid #ccc; + &:first-of-type { + margin-top: 30px; + } + &:last-of-type { + margin-bottom: 0; + border-left: none; + } + .stepNum { + width: 30px; + height: 30px; + border-radius: 15px; + box-sizing: border-box; + color: #333; + border: 1px solid #999; + line-height: 28px; + text-align: center; + margin-right: 10px; + margin-left: -16px; + margin-top: -30px; + } + .stepCard { + width: 100%; + margin-top: -30px; + + .box-card { + width: 100%; + >>>.el-card__header { + padding: 10px 15px; + } + .card-header { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + & > div:first-of-type { + margin-right: 80px; + font-size: 18px; + font-weight: bold; + } + } + } + } + &:hover .card-header { + color: #0098f5; + } + &:hover .stepNum { + border: 2px solid #0098f5; + color: #0098f5; + } +} +.page-position{ + float: right; + padding-top: 10px; +} +</style> diff --git a/src/views/specialWorkManage/workFlow/approveBasic/components/approveBasicDialog.vue b/src/views/specialWorkManage/workFlow/approveBasic/components/approveBasicDialog.vue new file mode 100644 index 0000000..cfffb74 --- /dev/null +++ b/src/views/specialWorkManage/workFlow/approveBasic/components/approveBasicDialog.vue @@ -0,0 +1,187 @@ +<template> + <div class="system-add-menu-container"> + <el-dialog :title="title" :visible.sync="isShowApproveBasicDialog" width="600px" :close-on-click-modal="false"> + <el-form :model="approveBasicForm" :rules="approveBasicFormRules" ref="approveBasicFormRef" size="default" 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="title"> + <el-input class="input-add" :disabled="!disabled" v-model.trim="approveBasicForm.title" placeholder="请输入标题名称" clearable></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="ruleStandType"> + <el-select class="input-add" :disabled="!disabled" v-model="approveBasicForm.ruleStandType" placeholder="请选择标准类型" clearable filterable> + <el-option v-for="item in ruleStandTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </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="maxVal"> + <el-input :disabled="!disabled" v-model="approveBasicForm.maxVal" type="number" class="input-add" placeholder="请根据需求选择"> + <template slot="prepend"> + <el-select :disabled="!disabled" v-model="approveBasicForm.maxValMatchPattern" placeholder="请根据需求选择" style="width: 115px"> + <el-option v-for="item in typeTwoList" :key="item.id" :value="item.id" :label="item.name"> </el-option> + </el-select> + </template> + </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="minVal"> + <el-input :disabled="!disabled" v-model="approveBasicForm.minVal" type="number" class="input-add" placeholder="请根据需求选择"> + <template slot="prepend"> + <el-select :disabled="!disabled" v-model="approveBasicForm.minValMatchPattern" placeholder="请根据需求选择" style="width: 115px"> + <el-option v-for="item in typeList" :key="item.id" :value="item.id" :label="item.name"> </el-option> + </el-select> + </template> + </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="info"> + <el-input class="input-add" :rows="3" :disabled="!disabled" v-model.trim="approveBasicForm.info" type="textarea" placeholder="请输入描述"></el-input> + </el-form-item> + </el-col> + </el-row> + </el-form> + <template #footer> + <div class="dialog-footer" v-show="disabled" align="right"> + <el-button @click="isShowApproveBasicDialog = !isShowApproveBasicDialog" size="default">取 消</el-button> + <el-button type="primary" @click="submitApproveBasic" size="default">确 定</el-button> + </div> + </template> + </el-dialog> + </div> +</template> + +<script> +import {approveBasicApi} from "../../../../../api/approveBasic"; +export default { + name: 'approveBasicDialog', + data(){ + return{ + title: '', + disabled: false, + personTime: false, + departmentList: [], + isShowApproveBasicDialog: false, + ruleStandTypeList: [ + { id: 1, name: '可燃气浓度' }, + { id: 2, name: '氧气浓度' }, + { id: 3, name: '一氧化碳浓度' }, + { id: 4, name: '硫化氢浓度' }, + { id: 5, name: '温度' }, + { id: 6, name: '压力' }, + { id: 7, name: '震动' } + ], + typeList: [ + { id: 1, name: '大于' }, + { id: 2, name: '等于' }, + { id: 4, name: '大于等于' } + ], + typeTwoList: [ + { id: 3, name: '小于' }, + { id: 2, name: '等于' }, + { id: 5, name: '小于等于' } + ], + approveBasicForm: { + ruleStandType: null, + minVal: null, + minValMatchPattern: null, + maxVal: null, + maxValMatchPattern: null, + title: null, + info: null + }, + approveBasicFormRules: { + ruleStandType: [{ required: true, message: '请选择标准类型', trigger: 'change' }], + minVal: [{ required: true, message: '请填写标最低值', trigger: 'blur' }], + maxVal: [{ required: true, message: '请填写标最高值', trigger: 'blur' }], + title: [{ required: true, message: '请选择风险等级', trigger: 'blur' }], + info: [{ required: true, message: '请填写描述信息', trigger: 'blur' }] + } + } + }, + methods:{ + showApproveBasicDialog(type, value) { + this.isShowApproveBasicDialog = true; + this.$nextTick(() =>{ + this.$refs["approveBasicFormRef"].clearValidate() + }) + if (type === '新增') { + this.disabled = true; + this.personTime = false; + this.title = '新增审批标准'; + this.approveBasicForm = { + ruleStandType: null, + minVal: null, + minValMatchPattern: null, + maxVal: null, + maxValMatchPattern: null, + title: null, + info: null + }; + } else if (type === '查看') { + this.disabled = false; + this.personTime = true; + this.title = '查看审批标准'; + this.approveBasicForm = JSON.parse(JSON.stringify(value)); + } else { + this.disabled = true; + this.personTime = false; + this.title = '修改审批标准'; + this.approveBasicForm = JSON.parse(JSON.stringify(value)); + } + }, + + submitApproveBasic() { + this.$refs["approveBasicFormRef"].validate(async (valid) => { + if (valid) { + if (this.title === '新增审批标准') { + let res = await approveBasicApi().addApproveBasic(this.approveBasicForm); + if (res.data.code === '200') { + this.$message({ + type: 'success', + message: '审批标准新增成功', + duration: 2000 + }); + this.isShowApproveBasicDialog = false; + this.$emit('refreshApproveBasic'); + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + } else { + let res = await approveBasicApi().modApproveBasic(this.approveBasicForm); + if (res.data.code === '200') { + this.$message({ + type: 'success', + message: '审批标准修改成功', + duration: 2000 + }); + this.isShowApproveBasicDialog = false; + this.$emit('refreshApproveBasic'); + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + } + } else { + this.$message({ + type: 'warning', + message: '请完善基本信息' + }); + } + }); + }, + }, + +}; +</script> + +<style scoped> +</style> diff --git a/src/views/specialWorkManage/workFlow/approveBasic/index.vue b/src/views/specialWorkManage/workFlow/approveBasic/index.vue new file mode 100644 index 0000000..7ba45f1 --- /dev/null +++ b/src/views/specialWorkManage/workFlow/approveBasic/index.vue @@ -0,0 +1,365 @@ +<template> + <div class="home-container"> + <div style="height: 100%"> + <el-row class="homeCard"> + <div class="basic-line"> + <span>标准类型:</span> + <el-select v-model="tableData.params.searchParams.ruleStandType" clearable filterable class="input-box" placeholder="标准类型"> + <el-option v-for="item in ruleStandTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>标题:</span> + <el-input v-model.trim="tableData.params.searchParams.title" clearable filterable class="input-box" placeholder="标题"> </el-input> + </div> + <div style="padding-bottom: 10px"> + <el-button type="primary" @click="getInspectionTask">查询</el-button> + <el-button plain @click="reset">重置</el-button> + </div> + </el-row> + <div class="homeCard"> + <div class="main-card"> + <el-row class="cardTop"> + <el-col :span="24" class="mainCardBtn"> + <el-button type="primary" size="default" @click="openApproveBasicDialog('新增', {})">新建</el-button> + <el-button type="danger" size="default" @click="deleteMoreApproveBasic" plain>批量删除</el-button> + </el-col> + </el-row> + <el-table ref="multipleTableRef" :data="tableData.approveBasicData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" /> + <el-table-column property="title" label="标题" /> + <el-table-column property="ruleStandType" label="标准类型"> + <template slot-scope="scope"> + <span> + {{ parseNumber(scope.row.ruleStandType, '标准类型') }} + </span> + </template> + </el-table-column> + <el-table-column property="minVal" label="最低值"> + <template slot-scope="scope"> + <span> + {{ parseNumber(scope.row.minValMatchPattern, '最低值') }} + </span> + <span> + {{ scope.row.minVal }} + </span> + </template> + </el-table-column> + <el-table-column property="maxVal" label="最高值"> + <template slot-scope="scope"> + <span> + {{ parseNumber(scope.row.maxValMatchPattern, '最高值') }} + </span> + <span> + {{ scope.row.maxVal }} + </span> + </template> + </el-table-column> + <el-table-column property="info" label="描述" /> + <el-table-column prop="createUname" label="创建人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> + <el-table-column prop="modifiedUname" label="最后修改人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtModified" label="最后修改时间" show-overflow-tooltip></el-table-column> + <el-table-column fixed="right" label="操作" align="center" width="300"> + <template slot-scope="scope"> + <el-button link type="primary" size="small" @click="openApproveBasicDialog('查看', scope.row)">查看</el-button> + <el-button link type="primary" size="small" @click="openApproveBasicDialog('修改', scope.row)">修改</el-button> + <el-button link type="danger" size="small" @click="deleteApproveBasic(scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="tableData.params.pageIndex" background v-model:page-size="tableData.params.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="tableData.total" class="page-position"> </el-pagination> + </div> + </div> + </div> + <approve-basic-dialog ref="approveBasicDialogRef" @refreshApproveBasic="getInspectionTask"></approve-basic-dialog> + </div> +</template> + +<script> +import approveBasicDialog from "./components/approveBasicDialog"; +import {approveBasicApi} from "../../../../api/approveBasic"; +export default { + name: 'index', + components: { approveBasicDialog }, + data(){ + return{ + tableData: { + approveBasicData: [], + total: 0, + loading: false, + params: { + pageIndex: 1, + pageSize: 10, + searchParams: { + ruleStandType: null, + title: null + } + } + }, + ruleStandTypeList: [ + { id: 1, name: '可燃气浓度' }, + { id: 2, name: '氧气浓度' }, + { id: 3, name: '一氧化碳浓度' }, + { id: 4, name: '硫化氢浓度' }, + { id: 5, name: '温度' }, + { id: 6, name: '压力' }, + { id: 7, name: '震动' } + ], + typeList: [ + { id: 1, name: '大于' }, + { id: 2, name: '等于' }, + { id: 4, name: '大于等于' } + ], + typeTwoList: [ + { id: 3, name: '小于' }, + { id: 2, name: '等于' }, + { id: 5, name: '小于等于' } + ], + deleteList: { + ids: [] + } + } + }, + created() { + this.getInspectionTask() + }, + methods:{ + async getInspectionTask() { + let res = await approveBasicApi().getApproveBasicList(this.tableData.params); + if (res.data.code === '200') { + this.tableData.approveBasicData = res.data.data; + this.tableData.total = res.data.total; + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }, + + parseNumber(value,type) { + if (type === '标准类型') { + return this.ruleStandTypeList.find((item) => item.id === value).name; + } else if (type === '最高值') { + return this.typeTwoList.find((item) => item.id == value).name; + } else { + return this.typeList.find((item) => item.id == value).name; + } + }, + + handleSelectionChange(val) { + this.deleteList.ids = val.map((item) => { + return item.ruleStandId; + }); + }, + + openApproveBasicDialog(type, value) { + this.$refs.approveBasicDialogRef.showApproveBasicDialog(type, value); + }, + + deleteApproveBasic(row) { + this.$confirm(`此操作将永久删除该任务:“${row.title}”,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await approveBasicApi().deleteApproveBasic({ ids: [row.ruleStandId] }); + if (res.data.code === '200') { + this.deleteList.ids = []; + this.$message({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await getInspectionTask(); + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }, + + deleteMoreApproveBasic() { + this.$confirm(`此操作将永久删除这些标准项,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await approveBasicApi().deleteApproveBasic(this.deleteList); + if (res.data.code === '200') { + this.$message({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await this.getInspectionTask(); + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }, + onHandleSizeChange(val) { + this.tableData.params.pageSize = val; + this.getInspectionTask(); + }, + // 分页改变 + onHandleCurrentChange(val) { + this.tableData.params.pageIndex = val; + this.getInspectionTask(); + }, + + reset() { + this.tableData.params = { + pageIndex: 1, + pageSize: 10, + searchParams: { + ruleStandType: null, + title: null + } + }; + }, + }, +}; +</script> + +<style scoped lang="scss"> +$homeNavLengh: 8; +.home-container { + height: calc(100vh - 100px); + box-sizing: border-box; + overflow: hidden; + .homeCard { + width: 100%; + padding: 20px; + box-sizing: border-box; + background: #fff; + border-radius: 4px; + + .main-card { + width: 100%; + height: 100%; + .cardTop { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 20px; + .mainCardBtn { + margin: 0; + } + } + .pageBtn { + height: 60px; + display: flex; + align-items: center; + justify-content: right; + + .demo-pagination-block + .demo-pagination-block { + margin-top: 10px; + } + .demo-pagination-block .demonstration { + margin-bottom: 16px; + } + } + } + &:last-of-type { + height: calc(100% - 100px); + } + } + .el-row { + display: flex; + align-items: center; + margin-bottom: 20px; + &:last-child { + margin-bottom: 0; + } + .grid-content { + align-items: center; + min-height: 36px; + } + + .topInfo { + display: flex; + align-items: center; + font-size: 16px; + font-weight: bold; + + & > div { + white-space: nowrap; + margin-right: 20px; + } + } + } +} +.stepItem { + width: 100%; + display: flex; + align-items: flex-start; + margin-bottom: 30px; + margin-left: 30px; + padding-bottom: 30px; + border-left: 2px solid #ccc; + &:first-of-type { + margin-top: 30px; + } + &:last-of-type { + margin-bottom: 0; + border-left: none; + } + .stepNum { + width: 30px; + height: 30px; + border-radius: 15px; + box-sizing: border-box; + color: #333; + border: 1px solid #999; + line-height: 28px; + text-align: center; + margin-right: 10px; + margin-left: -16px; + margin-top: -30px; + } + .stepCard { + width: 100%; + margin-top: -30px; + + .box-card { + width: 100%; + >>>.el-card__header { + padding: 10px 15px; + } + .card-header { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + & > div:first-of-type { + margin-right: 80px; + font-size: 18px; + font-weight: bold; + } + } + } + } + &:hover .card-header { + color: #0098f5; + } + &:hover .stepNum { + border: 2px solid #0098f5; + color: #0098f5; + } +} +.page-position{ + float: right; + padding-top: 10px; +} +</style> diff --git a/src/views/specialWorkManage/workFlow/approveRule/components/approveItemDialog.vue b/src/views/specialWorkManage/workFlow/approveRule/components/approveItemDialog.vue new file mode 100644 index 0000000..035315b --- /dev/null +++ b/src/views/specialWorkManage/workFlow/approveRule/components/approveItemDialog.vue @@ -0,0 +1,143 @@ +<template> + <el-dialog :visible.sync="approveItemDialog" :title="title" :close-on-click-modal="false"> + <el-form :model="approveItemForm" label-width="150px" ref="approveItemFormRef" :rules="approveItemFormRule"> + <el-col :span="24" > + <el-form-item label="审批项名称" prop="itemName"> + <el-input v-model="approveItemForm.itemName" class="input-add" placeholder="请填写审批项名称"> </el-input> + </el-form-item> + </el-col> + <el-col :span="24" > + <el-form-item label="审批项类型" prop="type"> + <el-select v-model="approveItemForm.type" @change="clearValue" placeholder="请选择审批项类型" class="input-add" clearable filterable> + <el-option v-for="item in typeList" :key="item.id" :value="item.id" :label="item.name"></el-option> + </el-select> + </el-form-item> + </el-col> + <!-- <el-col :span="24" style="margin-bottom: 24px">--> + <!-- <el-form-item label="措施或标准" prop="smType">--> + <!-- <el-select v-model="approveItemForm.smType" @change="clearValue" placeholder="请选择措施或标准" class="input-add" clearable filterable>--> + <!-- <el-option v-for="item in smTypeList" :key="item.id" :value="item.id" :label="item.name"></el-option>--> + <!-- </el-select>--> + <!-- </el-form-item>--> + <!-- </el-col>--> + <el-col v-if="(approveItemForm.type === 2 || approveItemForm.type === 3) && personType !== 3" :span="24"> + <el-form-item label="措施名称" prop="measureId"> + <el-select v-model="approveItemForm.measureId" placeholder="请选择措施" class="input-add" clearable filterable> + <el-option v-for="item in actionList" :key="item.id" :value="item.id" :label="item.context"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col v-if="approveItemForm.type === 1" :span="24" > + <el-form-item label="标准名称" prop="standId"> + <el-select v-model="approveItemForm.standId" class="input-add" placeholder="选择标准" clearable filterable> + <el-option v-for="item in standardList" :key="item.ruleStandId" :value="item.ruleStandId" :label="item.title"></el-option> + </el-select> + </el-form-item> + </el-col> + + <div align="right"> + <el-button type="warning" @click="approveItemDialog = false" size="default" plain>取消</el-button> + <el-button type="primary" @click="submitApproveItem()" size="default">确认</el-button> + </div> + </el-form> + </el-dialog> +</template> + +<script> + +export default { + name: 'approveItemDialog', + data(){ + return{ + title: '', + activeName: 'ApproveAction', + approveItemDialog: false, + approveItemForm: { + itemName: null, + type: null, + measureId: null, + smType: 1, + standId: null + }, + approveItemFormRule: { + itemName: [{ required: true, message: '请填写审批项名称', trigger: 'blur' }], + type: [{ required: true, message: '请选择审批项类型', trigger: 'change' }], + measureId: [{ required: true, message: '请选择措施', trigger: 'change' }], + smType: [{ required: true, message: '请选择措施或标准', trigger: 'change' }], + standId: [{ required: true, message: '请选择标准', trigger: 'change' }] + }, + actionList: [], + typeList: [], + smTypeList: [ + { id: 1, name: '标准' }, + { id: 2, name: '措施' } + ], + standardList: [], + order: null, + personType: null, + } + }, + methods:{ + showApproveItemDialog(type, value, index, approveLevelForm, standardList, actionList) { + this.approveItemDialog = true; + this.standardList = standardList; + this.actionList = actionList; + this.order = index; + if (approveLevelForm.type === 3) { + this.personType = 3 + this.typeList = [ + { id: 1, name: '数值' }, + { id: 3, name: '填空' } + ]; + } else { + this.typeList = [ + { id: 2, name: '选项' }, + { id: 3, name: '填空' } + ]; + } + this.$nextTick(() => { + this.$refs["approveItemFormRef"].clearValidate(); + }); + if (type === '新增') { + this.title = '新增审批项'; + this.approveItemForm = { + itemName: null, + type: null, + measureId: null, + standId: null, + smType: 1 + }; + } else { + this.title = '修改审批项'; + this.approveItemForm = JSON.parse(JSON.stringify(value)); + } + }, + + submitApproveItem() { + this.$refs["approveItemFormRef"].validate((valid) => { + if (valid) { + this.approveItemForm.smType = 1; + this.$emit('addApprovalItem', this.approveItemForm, this.title, this.order); + this.approveItemDialog = false; + } else { + this.$message({ + type: 'warning', + message: '请完善审批项基本信息' + }); + } + }); + }, + + clearValue () { + if (this.approveItemForm.type === 1) { + this.approveItemForm.measureId = null; + } else { + this.approveItemForm.standId = null; + } + }, + }, + +}; +</script> + +<style scoped></style> diff --git a/src/views/specialWorkManage/workFlow/approveRule/components/approveLevelDialog.vue b/src/views/specialWorkManage/workFlow/approveRule/components/approveLevelDialog.vue new file mode 100644 index 0000000..3661acc --- /dev/null +++ b/src/views/specialWorkManage/workFlow/approveRule/components/approveLevelDialog.vue @@ -0,0 +1,246 @@ +<template> + <div class="system-add-menu-container"> + <el-dialog :title="title" :visible.sync="approveLevelDialog" :close-on-click-modal="false"> + <el-form :model="approveLevelForm" label-width="150px" ref="approveLevelFormRef" :rules="approveLevelFormRule"> + <el-col :span="24"> + <el-form-item label="层级名称" prop="stepName"> + <el-input v-model="approveLevelForm.stepName" class="input-add" placeholder="请填写层级名称"> </el-input> + </el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="审批层级" prop="type"> + <el-select v-model="approveLevelForm.type" placeholder="请选择审批层级" class="input-add"> + <el-option v-for="item in typeList" :key="item.id" :value="item.id" :label="item.name"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="审批人" prop="unitList"> + <el-select v-model="approveLevelForm.unitList" multiple placeholder="请选择审批人" class="input-add"> + <el-option v-for="item in userList" :key="item.id" :value="item.id" :label="item.realname"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="审批有效时间" prop="continueTime"> + <el-input type="number" v-model="approveLevelForm.continueTime" placeholder="请输入审批有效时间" class="input-add"> + <template slot="prepend"> + <el-select v-model="approveLevelForm.continueTimeUnit" placeholder="选择单位" style="width: 115px"> + <el-option v-for="item in timeList" :key="item.id" :value="item.id" :label="item.name"></el-option> + </el-select> + </template> + </el-input> + </el-form-item> + </el-col> + <div class="checkUnit-point"> + + <div class="filter-container"> + <el-button size="default" type="primary" @click="openApproveActionDialog('新增', '', 0)"> + <el-icon> + <ele-FolderAdd /> + </el-icon> + 新增审批项 + </el-button> + </div> + + <el-table border fit highlight-current-row :data="approveLevelForm.itemList" style="width: 100%"> + <el-table-column property="itemName" label="审批项名称" show-overflow-tooltip> </el-table-column> + <el-table-column property="type" label="审批项类型" show-overflow-tooltip> + <template slot-scope="scope"> + <div v-for="item in typeList"> + <div v-if="scope.row.type === item.id"> + <span>{{item.name}}</span> + </div> + </div> + </template> + </el-table-column> + <el-table-column property="measureId" label="措施名称" show-overflow-tooltip> + <template slot-scope="scope"> + <div v-for="item in actionList"> + <div v-if="scope.row.measureId === item.id"> + <span>{{item.context}}</span> + </div> + </div> + </template> + </el-table-column> + <el-table-column property="standId" label="标准名称" show-overflow-tooltip> + <template slot-scope="scope"> + <div v-for="item in standardList"> + <div v-if="scope.row.standId === item.ruleStandId"> + <span>{{item.text}}</span> + </div> + </div> + </template> + </el-table-column> + <el-table-column label="操作" width="150" align="center"> + <template slot-scope="scope"> + <el-button type="text" size="small" @click="openApproveActionDialog('修改', scope.row, scope.$index)">修改</el-button> + <el-button type="text" size="small" style="color: red" @click="deleteApproveItem(scope.$index)">删除</el-button> + </template> + </el-table-column> + </el-table> + </div> + + <div align="right" style="padding-top: 10px"> + <el-button type="warning" @click="approveLevelDialog = false" size="default" plain>取消</el-button> + <el-button type="primary" @click="submitApproveLevel()" size="default">确认</el-button> + </div> + </el-form> + </el-dialog> + <approve-item-dialog ref="approveItemDialogRef" @addApprovalItem="achieveApprovalItem"></approve-item-dialog> + </div> +</template> + +<script> + +import approveItemDialog from './approveItemDialog.vue'; +import {safetyActionApi} from "../../../../../api/safetyAction"; +import {approveBasicApi} from "../../../../../api/approveBasic"; + +export default { + name: 'approveLevelDialog', + components: { approveItemDialog }, + data(){ + return{ + title: '', + tableKey:'', + activeName: 'ApproveAction', + approveLevelDialog: false, + approveLevelForm: { + id: null, + stepName: null, + stepSerial: null, + type: null, + continueTime: null, + continueTimeUnit: null, + unitList: [], + itemList: [] + }, + approveLevelFormRule: { + stepName: [{ required: true, message: '请填写层次名称', trigger: 'blur' }], + type: [{ required: true, message: '请选择审批层级', trigger: 'change' }], + unitList: [{ required: true, message: '请选择审批人', trigger: 'change' }], + continueTime: [{ required: true, message: '请填写有效时间', trigger: 'blur' }] + }, + departmentList: [], + userList: [], + timeList: [ + { id: 1, name: '日' }, + { id: 2, name: '时' }, + { id: 3, name: '分' } + ], + typeList: [ + { id: 1, name: '单人' }, + { id: 2, name: '多人' }, + { id: 3, name: '分析人' } + ], + workLevelList: [], + actionList: [], + standardList: [] + } + }, + created() { + this.getActionData() + this.getStandardData() + }, + methods:{ + showApproveLevelDialog(type, value, userList) { + this.approveLevelDialog = true; + this.userList = userList; + this.$nextTick(() => { + this.$refs["approveLevelFormRef"].clearValidate() + }) + if (type === '新增') { + this.title = '新增审批层级'; + this.approveLevelForm = { + id: null, + stepName: null, + stepSerial: null, + type: null, + continueTime: null, + continueTimeUnit: null, + unitList: [], + itemList: [] + }; + } else { + this.title = '修改审批层级'; + this.approveLevelForm = JSON.parse(JSON.stringify(value)); + this.approveLevelForm.unitList = this.approveLevelForm.unitList.map((item) => { + return item.bindUid; + }); + } + }, + + openApproveActionDialog(type, value, index) { + this.$refs["approveLevelFormRef"].validate((valid) => { + if (valid) { + this.$refs.approveItemDialogRef.showApproveItemDialog(type, value, index, this.approveLevelForm, this.standardList, this.actionList); + } else { + this.$message({ + type: 'warning', + message: '请先完善审批层级信息,才能选择审批项' + }); + } + }); + }, + + submitApproveLevel() { + this.$refs["approveLevelFormRef"].validate((valid) => { + if (valid) { + this.approveLevelForm.unitList = this.approveLevelForm.unitList.map((item) => { + return { bindUid: item }; + }); + this.$emit('addApprovalLevel', this.approveLevelForm, this.title); + this.approveLevelDialog = false; + } else { + this.$message({ + type: 'warning', + message: '请完善审批层级基本信息' + }); + } + }); + }, + + achieveApprovalItem(value, title, index) { + debugger + if (title === '新增审批项') { + this.approveLevelForm.itemList.push(value); + } else { + // this.approveLevelForm.itemList[index] = JSON.parse(JSON.stringify(value)); + this.$set(this.approveLevelForm.itemList,index,value) + } + }, + + deleteApproveItem(index) { + this.approveLevelForm.itemList.splice(index, 1); + }, + + async getActionData() { + let res = await safetyActionApi().getAllSafetyActionList({ workType: null, type: null, context: null }); + if (res.data.code === '200') { + this.actionList = res.data.data; + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }, + + async getStandardData() { + let res = await approveBasicApi().getAllApproveBasicList({ ruleStandType: null, title: null }); + if (res.data.code === '200') { + this.standardList = res.data.data; + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }, + + }, +}; +</script> + +<style scoped></style> diff --git a/src/views/specialWorkManage/workFlow/approveRule/components/approveRuleDialog.vue b/src/views/specialWorkManage/workFlow/approveRule/components/approveRuleDialog.vue new file mode 100644 index 0000000..ed4956e --- /dev/null +++ b/src/views/specialWorkManage/workFlow/approveRule/components/approveRuleDialog.vue @@ -0,0 +1,484 @@ +<template> + <div class="system-add-menu-container"> + <el-dialog :visible.sync="ifShowApproveRuleDialog" :title="title" :close-on-click-modal="false"> + <el-form :model="approveRuleForm" label-width="120px" ref="approveRuleFormRef" :rules="approveRuleFormRules"> + <el-col :span="24"> + <el-form-item label="任务名称" prop="ruleName"> + <el-input v-model="approveRuleForm.ruleName" :disabled="!disabled" class="input-add" placeholder="请填写任务名称"> </el-input> + </el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="部门名称" prop="depId"> + <el-select v-model="approveRuleForm.depId" @change="clearValue" :disabled="!disabled" placeholder="请选择作业类型" class="input-add"> + <el-option v-for="item in departmentList" :key="item.id" :value="item.id" :label="item.department"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="作业类型" prop="workType"> + <el-select v-model="approveRuleForm.workType" @change="clearValue" :disabled="!disabled" placeholder="请选择作业类型" class="input-add"> + <el-option v-for="item in workTypeList" :key="item.id" :value="item.id" :label="item.name"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="24" v-if="approveRuleForm.workType === 3 || approveRuleForm.workType === 6 || approveRuleForm.workType === 8 || approveRuleForm.workType === 1"> + <el-form-item label="作业等级" prop="workLevel"> + <el-select v-model="approveRuleForm.workLevel" :disabled="!disabled" placeholder="请选择作业等级" class="input-add"> + <el-option v-for="item in workLevelList" :key="item.id" :value="item.id" :label="item.name"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="24"> + <el-form-item label="创建审批链"> + <div style="width: 100%;padding-bottom: 10px" v-show="disabled"> + <el-button type="primary" size="default" @click="openApproveLevelDialog('新增', '')">新增审批层级</el-button> + </div> + <div style="width: 100%; margin-left: -30px"> + <div v-for="(item, index) in approveRuleForm.stepList" class="stepItem"> + <div class="stepNum">{{ index + 1 }}</div> + <div class="stepCard"> + <el-card class="box-card"> + <div class="text item"> + 层级名称:<span>{{ item.stepName }}</span> + </div> + <!-- <div class="text item">--> + <!-- 所属设备区域:<span>{{ item.regionId }}</span>--> + <!-- </div>--> + <div class="text item" v-for="i in typeList"> + <div v-if="i.id === item.type"> + 审批层级:<span>{{ i.name }}</span> + </div> + </div> + <!-- <div class="text item">--> + <!-- 关联RFID:<span>{{ item.rfidId }}</span>--> + <!-- </div>--> + <div class="text item"> + 审批人:<span>{{ + JSON.parse(JSON.stringify( + item.unitList + .map((item) => { + // for(let i in userList){ + // debugger + // if(userList[i].id === item.bindUid){ + // return userList[i].realname + // } + // } + return userList.find((i) => i.id === item.bindUid).realname; + }) + .join('、') + )) + }}</span> + </div> + <!-- <div class="text item">--> + <!-- 巡检指标:<span>{{ item.quotaId }}</span>--> + <!-- </div>--> + <div class="text item" v-for="i in timeList"> + <div v-if="i.id === item.continueTimeUnit"> + 审批有效时长:<span>{{ item.continueTime }}</span> + <span>{{ i.name }}</span> + </div> + </div> + <!-- <div class="text item">--> + <!-- 数据填报类型:<span>{{ item.thisReportType }}</span>--> + <!-- </div>--> + <div class="text item"> + 审批项:<span>{{ + item.itemList + .map((item) => { + return item.itemName; + }) + .join('、') + }}</span> + </div> + </el-card> + </div> + <div v-show="disabled"> + <el-button type="primary" style="margin-left: 10px;margin-bottom: 10px" size="default" @click="openApproveLevelDialog('修改', item)">修改</el-button> + <el-button type="danger" size="default" @click="deleteApproveLevel(index, item)">删除</el-button> + </div> + </div> + </div> + </el-form-item> + </el-col> + </el-form> + <template #footer> + <div v-show="disabled" class="dialog-footer" align="right"> + <el-button type="warning" @click="ifShowApproveRuleDialog = false" size="default" plain>取消</el-button> + <el-button type="primary" @click="submitApproveRule()" size="default">确认</el-button> + </div> + </template> + </el-dialog> + <approve-level-dialog ref="approveLevelDialogRef" @addApprovalLevel="achieveApprovalLevel"></approve-level-dialog> + </div> +</template> + +<script> +import approveLevelDialog from './approveLevelDialog.vue'; + +export default { + name: 'approveRuleDialog', + components: {approveLevelDialog}, + data() { + return { + title: '', + pointTitle: '', + disabled: true, + ifShowApproveRuleDialog: false, + inspectPointForm: { + id: null, + stepName: null, + stepSerial: null, + type: null, + continueTime: null, + continueTimeUnit: null, + unitList: [], + itemList: [] + }, + approveRuleForm: { + id: null, + ruleName: null, + depId: null, + workType: null, + workLevel: null, + stepList: [] + }, + approveRuleFormRules: { + ruleName: [{required: true, message: '请填写规则名称', trigger: 'blur'}], + depId: [{required: true, message: '请选择部门', trigger: 'change'}], + workLevel: [{required: true, message: '请选择作业等级', trigger: 'change'}], + workType: [{required: true, message: '请选择作业类型', trigger: 'cahnge'}] + }, + departmentList: [], + userList: [], + typeList: [ + {id: 1, name: '单人'}, + {id: 2, name: '多人'}, + {id: 3, name: '分析人'} + ], + timeList: [ + {id: 1, name: '日'}, + {id: 2, name: '时'}, + {id: 3, name: '分'} + ], + workTypeList: [ + {id: 1, name: '动火作业'}, + {id: 2, name: '受限空间作业'}, + {id: 3, name: '吊装作业'}, + {id: 4, name: '动土作业'}, + {id: 5, name: '断路作业'}, + {id: 6, name: '高处作业'}, + {id: 7, name: '临时用电作业'}, + {id: 8, name: '盲板抽堵作业'} + ], + workLevelList: [] + } + }, + created() { + + }, + methods: { + openApproveLevelDialog(type, value) { + this.$refs.approveLevelDialogRef.showApproveLevelDialog(type, value, this.userList); + }, + + achieveApprovalLevel(value, title) { + if (title === '新增审批层级') { + if (this.approveRuleForm.stepList.length === 0) { + value.stepSerial = 1; + this.approveRuleForm.stepList.push(value); + } else { + value.stepSerial = (this.approveRuleForm.stepList[this.approveRuleForm.stepList.length - 1].stepSerial) +1; + this.approveRuleForm.stepList.push(value); + } + } else { + let result = this.approveRuleForm.stepList.findIndex((item) => item.stepSerial === value.stepSerial); + // this.approveRuleForm.stepList[result] = JSON.parse(JSON.stringify(value)); + this.$set(this.approveRuleForm.stepList,result,value) + } + }, + + showApproveRuleDialog(type, value, departmentList, userList, workTypeList) { + this.ifShowApproveRuleDialog = true; + this.userList = userList; + this.workTypeList = workTypeList; + this.departmentList = departmentList; + this.$nextTick(()=>{ + this.$refs["approveRuleFormRef"].clearValidate() + }) + if (type === '新增') { + this.disabled = true; + this.title = '新增审批规则'; + this.approveRuleForm = { + id: null, + ruleName: null, + depId: null, + workType: null, + workLevel: null, + stepList: [] + }; + } else if (type === '修改') { + this.disabled = true; + this.title = '修改审批规则'; + this.approveRuleForm = JSON.parse(JSON.stringify(value)); + this.setValue(value.workType); + } else { + this.disabled = false; + this.title = '查看审批规则'; + this.setValue(value.workType); + this.approveRuleForm = JSON.parse(JSON.stringify(value)); + } + }, + + deleteApproveLevel(index, item) { + this.approveRuleForm.stepList.splice(index, 1); + }, + + clearValue() { + if (this.approveRuleForm.workType === 1) { + this.approveRuleForm.workLevel = null; + this.workLevelList = [ + {id: 3, name: '特级动火作业'}, + {id: 1, name: '一级动火作业'}, + {id: 2, name: '二级动火作业'} + ]; + } else if (this.approveRuleForm.workType === 3) { + this.approveRuleForm.workLevel = null; + this.workLevelList = [ + {id: 8, name: '一级吊装作业'}, + {id: 9, name: '二级吊装作业'}, + {id: 10, name: '三级吊装作业'} + ]; + } else if (this.approveRuleForm.workType === 6) { + this.approveRuleForm.workLevel = null; + this.workLevelList = [ + {id: 7, name: '特级高处作业'}, + {id: 4, name: '一级高处作业'}, + {id: 5, name: '二级高处作业'}, + {id: 6, name: '三级高处作业'}, + ]; + } else if (this.approveRuleForm.workType === 8) { + this.approveRuleForm.workLevel = null; + this.workLevelList = [ + {id: 11, name: '抽盲板作业'}, + {id: 12, name: '堵盲板作业'} + ]; + } else { + this.approveRuleForm.workLevel = null; + this.workLevelList = []; + } + }, + + setValue(workType) { + if (workType === 1) { + this.workLevelList = [ + {id: 3, name: '特级动火作业'}, + {id: 1, name: '一级动火作业'}, + {id: 2, name: '二级动火作业'}, + ]; + } else if (workType === 3) { + this.workLevelList = [ + {id: 8, name: '一级吊装作业'}, + {id: 9, name: '二级吊装作业'}, + {id: 10, name: '三级吊装作业'} + ]; + } else if (workType === 6) { + this.workLevelList = [ + {id: 7, name: '四级高处作业'}, + {id: 4, name: '一级高处作业'}, + {id: 5, name: '二级高处作业'}, + {id: 6, name: '三级高处作业'} + ]; + } else if (workType === 8) { + this.workLevelList = [ + {id: 11, name: '抽盲板作业'}, + {id: 12, name: '堵盲板作业'} + ]; + } else { + this.workLevelList = []; + } + }, + + parseNumber(type, value) { + if (type === '时间单位') { + return this.timeList.find((item) => item.id === value).name; + } + }, + + submitApproveRule() { + this.$refs["approveRuleFormRef"].validate(async (valid) => { + if (valid) { + if (this.title === '新增审批规则') { + let res = await approveRuleApi().addApproveRule(this.approveRuleForm); + if (res.data.code === '200') { + this.$message({ + type: 'success', + message: '审批规则新增成功', + duration: 2000 + }); + this.ifShowApproveRuleDialog = false; + this.$emit('refreshApproveRule'); + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + } else { + let res = await approveRuleApi().modApproveRule(this.approveRuleForm); + if (res.data.code === '200') { + this.$message({ + type: 'success', + message: '审批规则修改成功', + duration: 2000 + }); + this.ifShowApproveRuleDialog = false; + this.$emit('refreshApproveRule'); + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + } + } else { + this.$message({ + type: 'warning', + message: '请完善基本信息' + }); + } + }); + } + }, +}; +</script> + +<style scoped lang="scss"> +$homeNavLengh: 8; +.home-container { + height: calc(100vh - 144px); + box-sizing: border-box; + overflow: hidden; + .homeCard { + width: 100%; + padding: 20px; + box-sizing: border-box; + background: #fff; + border-radius: 4px; + + .main-card { + width: 100%; + height: 100%; + .cardTop { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 20px; + .mainCardBtn { + margin: 0; + } + } + .pageBtn { + height: 60px; + display: flex; + align-items: center; + justify-content: right; + + .demo-pagination-block + .demo-pagination-block { + margin-top: 10px; + } + .demo-pagination-block .demonstration { + margin-bottom: 16px; + } + } + } + &:last-of-type { + height: calc(100% - 100px); + } + } + .el-row { + display: flex; + align-items: center; + margin-bottom: 20px; + &:last-child { + margin-bottom: 0; + } + .grid-content { + align-items: center; + min-height: 36px; + } + + .topInfo { + display: flex; + align-items: center; + font-size: 16px; + font-weight: bold; + + & > div { + white-space: nowrap; + margin-right: 20px; + } + } + } +} +.stepItem { + width: 100%; + display: flex; + align-items: flex-start; + margin-bottom: 30px; + margin-left: 30px; + padding-bottom: 30px; + border-left: 2px solid #ccc; + &:first-of-type { + margin-top: 30px; + } + &:last-of-type { + margin-bottom: 0; + border-left: none; + } + .stepNum { + width: 30px; + height: 30px; + border-radius: 15px; + box-sizing: border-box; + color: #333; + border: 1px solid #999; + line-height: 28px; + text-align: center; + margin-right: 10px; + margin-left: -16px; + margin-top: -30px; + } + .stepCard { + width: 100%; + margin-top: -30px; + + .box-card { + width: 100%; + >>>.el-card__header { + padding: 10px 15px; + } + .card-header { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + & > div:first-of-type { + margin-right: 80px; + font-size: 18px; + font-weight: bold; + } + } + } + } + &:hover .card-header { + color: #0098f5; + } + &:hover .stepNum { + border: 2px solid #0098f5; + color: #0098f5; + } +} +/deep/.el-date-editor { + width: 100%; +} +</style> diff --git a/src/views/specialWorkManage/workFlow/approveRule/index.vue b/src/views/specialWorkManage/workFlow/approveRule/index.vue new file mode 100644 index 0000000..ec77eb0 --- /dev/null +++ b/src/views/specialWorkManage/workFlow/approveRule/index.vue @@ -0,0 +1,409 @@ +<template> + <div class="home-container"> + <div style="height: 100%"> + <el-row class="homeCard"> + <div class="basic-line"> + <span>规则名称:</span> + <el-input v-model="tableData.params.searchParams.ruleName" class="input-box" placeholder="规则名称"> </el-input> + </div> + <div class="basic-line"> + <span>部门:</span> + <el-select v-model="tableData.params.searchParams.depId" clearable filterable class="input-box" placeholder="作业类型"> + <el-option v-for="item in departmentList" :key="item.id" :label="item.department" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>作业类型:</span> + <el-select v-model="tableData.params.searchParams.workType" clearable filterable class="input-box" placeholder="作业类型"> + <el-option v-for="item in workTypeList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div class="basic-line"> + <span>作业等级:</span> + <el-select v-model="tableData.params.searchParams.workLevel" clearable filterable class="input-box" placeholder="作业等级"> + <el-option v-for="item in workLevelList" :key="item.id" :label="item.name" :value="item.id"></el-option> + </el-select> + </div> + <div style="padding-bottom: 10px"> + <el-button type="primary" @click="getApproveRule">查询</el-button> + <el-button plain @click="reset">重置</el-button> + </div> + </el-row> + <div class="homeCard"> + <div class="main-card"> + <el-row class="cardTop"> + <el-col :span="24" class="mainCardBtn"> + <el-button type="primary" size="default" @click="openApproveRuleDialog('新增', {})">新建</el-button> + <el-button type="danger" size="default" @click="deleteMoreApproveRule" plain>批量删除</el-button> + </el-col> + </el-row> + <el-table ref="multipleTableRef" :data="tableData.approveRuleData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" /> + <el-table-column property="ruleName" label="任务名称" /> + <el-table-column property="workType" label="作业类型"> + <template slot-scope="scope"> + <span> + {{ parseNumber(scope.row.workType, '作业类型') }} + </span> + </template> + </el-table-column> + <el-table-column property="workLevel" label="作业等级"> + <template slot-scope="scope"> + <span> + {{ parseNumber(scope.row.workLevel, '作业等级') }} + </span> + </template> + </el-table-column> + <el-table-column prop="createUname" label="创建人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column> + <el-table-column prop="modifiedUname" label="最后修改人" show-overflow-tooltip></el-table-column> + <el-table-column prop="gmtModified" label="最后修改时间" show-overflow-tooltip></el-table-column> + <el-table-column fixed="right" label="操作" align="center" width="300"> + <template slot-scope="scope"> + <el-button link type="text" @click="openApproveRuleDialog('查看', scope.row)">查看</el-button> + <el-button link type="text" @click="openApproveRuleDialog('修改', scope.row)">修改</el-button> + <el-button link type="text" style="color: red" @click="deleteApproveRule(scope.row)">删除</el-button> + </template> + </el-table-column> + </el-table> + <div class="pageBtn"> + <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="tableData.params.pageIndex" background v-model:page-size="tableData.params.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="tableData.total" class="page-position"> </el-pagination> + </div> + </div> + </div> + </div> + <approve-rule-dialog ref="approveRuleDialogRef" @refreshApproveRule="getApproveRule"></approve-rule-dialog> + </div> +</template> + +<script> +import approveRuleDialog from './components/approveRuleDialog' +import { approveRuleApi } from '../../../../api/approveRule' +import {getDepartmentList} from "../../../../api/departmentManage"; +import {safetyInspectionItemName} from "../../../../api/safetySelfInspection"; +export default { + name: 'index', + components: { approveRuleDialog }, + data(){ + return{ + tableData: { + approveRuleData: [], + total: 0, + loading: false, + params: { + pageIndex: 1, + pageSize: 10, + searchParams: { + ruleName: null, + depId: null, + workType: null, + workLevel: null + } + } + }, + workTypeList: [ + { id: 1, name: '动火作业' }, + { id: 2, name: '受限空间作业' }, + { id: 3, name: '吊装作业' }, + { id: 4, name: '动土作业' }, + { id: 5, name: '断路作业' }, + { id: 6, name: '高处作业' }, + { id: 7, name: '临时用电作业' }, + { id: 8, name: '盲板抽堵作业' } + ], + workLevelList: [ + { id: 3, name: '特级动火作业' }, + { id: 1, name: '一级动火作业' }, + { id: 2, name: '二级动火作业' }, + { id: 7, name: '特级高处作业' }, + { id: 4, name: '一级高处作业' }, + { id: 5, name: '二级高处作业' }, + { id: 6, name: '三级高处作业' }, + { id: 8, name: '一级吊装作业' }, + { id: 9, name: '二级吊装作业' }, + { id: 10, name: '三级吊装作业' }, + { id: 11, name: '抽盲板作业' }, + { id: 12, name: '堵盲板作业' } + ], + departmentList: [], + userList: [], + deleteList: { ids: [] }, + timeType: [ + { id: 1, name: '分' }, + { id: 2, name: '小时' }, + { id: 3, name: '日' }, + { id: 4, name: '月' }, + { id: 5, name: '年' } + ] + } + }, + created(){ + this.getApproveRule(); + this.getDepartmentData(); + this.getUserData(); + }, + methods:{ + async getApproveRule() { + let res = await approveRuleApi().getApproveRuleList(this.tableData.params); + if (res.data.code === '200') { + this.tableData.approveRuleData = res.data.data; + this.tableData.total = res.data.total; + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }, + + openApproveRuleDialog(type, value) { + this.$refs.approveRuleDialogRef.showApproveRuleDialog(type, value, this.departmentList, this.userList, this.workTypeList); + }, + + async getDepartmentData() { + let res = await getDepartmentList({pageSize:1000,pageIndex:1}) + if(res.data.code === '200'){ + this.departmentList = res.data.result.result + }else{ + this.$message({ + message:res.data.message, + type:'warning' + }) + } + }, + + async getUserData() { + let res = await safetyInspectionItemName() + if(res.data.code === '200'){ + this.userList = res.data.result + }else{ + this.$message({ + message:res.data.message, + type:'warning' + }) + } + }, + + deleteApproveRule(row) { + this.$confirm(`此操作将永久删除该审批规则,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await approveRuleApi().deleteApproveRule({ ids: [row.id] }); + this.deleteList.ids = []; + if (res.data.code === '200') { + this.$message({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await this.getApproveRule(); + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }, + + deleteMoreApproveRule() { + this.$confirm.confirm(`此操作将永久删除这些审批规则,是否继续?`, '提示', { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning' + }) + .then(async () => { + let res = await approveRuleApi().deleteApproveRule(this.deleteList); + if (res.data.code === '200') { + this.$message({ + type: 'success', + duration: 2000, + message: '删除成功' + }); + await this.getApproveRule(); + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => {}); + }, + + parseNumber(value, type) { + if (type === '作业类型') { + return this.workTypeList.find((item) => item.id === value).name; + } else if (type === '作业等级') { + return this.workLevelList.find((item) => item.id == value).name; + } else { + } + }, + + handleSelectionChange(val) { + this.deleteList.ids = val.map((item) => { + return item.ruleId; + }); + }, + + onHandleSizeChange(val) { + this.tableData.params.pageSize = val; + this.getApproveRule(); + }, + + onHandleCurrentChange(val) { + this.tableData.params.pageIndex = val; + this.getApproveRule(); + }, + + reset() { + this.tableData.params = { + pageIndex: 1, + pageSize: 10, + searchParams: { + ruleName: null, + depId: null, + workType: null, + workLevel: null + } + }; + } + }, +}; +</script> + +<style scoped lang="scss"> +$homeNavLengh: 8; +.home-container { + height: calc(100vh - 100px); + box-sizing: border-box; + overflow: hidden; + .homeCard { + width: 100%; + padding: 20px; + box-sizing: border-box; + background: #fff; + border-radius: 4px; + + .main-card { + width: 100%; + height: 100%; + .cardTop { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 20px; + .mainCardBtn { + margin: 0; + } + } + .pageBtn { + height: 60px; + display: flex; + align-items: center; + justify-content: right; + + .demo-pagination-block + .demo-pagination-block { + margin-top: 10px; + } + .demo-pagination-block .demonstration { + margin-bottom: 16px; + } + } + } + &:last-of-type { + height: calc(100% - 100px); + } + } + .el-row { + display: flex; + align-items: center; + margin-bottom: 20px; + &:last-child { + margin-bottom: 0; + } + .grid-content { + align-items: center; + min-height: 36px; + } + + .topInfo { + display: flex; + align-items: center; + font-size: 16px; + font-weight: bold; + + & > div { + white-space: nowrap; + margin-right: 20px; + } + } + } +} +.stepItem { + width: 100%; + display: flex; + align-items: flex-start; + margin-bottom: 30px; + margin-left: 30px; + padding-bottom: 30px; + border-left: 2px solid #ccc; + &:first-of-type { + margin-top: 30px; + } + &:last-of-type { + margin-bottom: 0; + border-left: none; + } + .stepNum { + width: 30px; + height: 30px; + border-radius: 15px; + box-sizing: border-box; + color: #333; + border: 1px solid #999; + line-height: 28px; + text-align: center; + margin-right: 10px; + margin-left: -16px; + margin-top: -30px; + } + .stepCard { + width: 100%; + margin-top: -30px; + + .box-card { + width: 100%; + >>>.el-card__header { + padding: 10px 15px; + } + .card-header { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + & > div:first-of-type { + margin-right: 80px; + font-size: 18px; + font-weight: bold; + } + } + } + } + &:hover .card-header { + color: #0098f5; + } + &:hover .stepNum { + border: 2px solid #0098f5; + color: #0098f5; + } +} +.page-position{ + float: right; + padding-top: 10px; +} +</style> diff --git a/src/views/specialWorkManage/workFlow/index.vue b/src/views/specialWorkManage/workFlow/index.vue new file mode 100644 index 0000000..ea834ff --- /dev/null +++ b/src/views/specialWorkManage/workFlow/index.vue @@ -0,0 +1,13 @@ +<template> + <router-view></router-view> +</template> + +<script> + export default { + name: "index" + } +</script> + +<style scoped> + +</style> diff --git a/src/views/specialWorkManage/workTicket/index.vue b/src/views/specialWorkManage/workTicket/index.vue new file mode 100644 index 0000000..ea834ff --- /dev/null +++ b/src/views/specialWorkManage/workTicket/index.vue @@ -0,0 +1,13 @@ +<template> + <router-view></router-view> +</template> + +<script> + export default { + name: "index" + } +</script> + +<style scoped> + +</style> diff --git a/src/views/specialWorkManage/workTicket/myApproval/index.vue b/src/views/specialWorkManage/workTicket/myApproval/index.vue new file mode 100644 index 0000000..34cd1a0 --- /dev/null +++ b/src/views/specialWorkManage/workTicket/myApproval/index.vue @@ -0,0 +1,13 @@ +<template> + +</template> + +<script> +export default { + name: "index" +} +</script> + +<style scoped> + +</style> diff --git a/src/views/specialWorkManage/workTicket/myJobApply/index.vue b/src/views/specialWorkManage/workTicket/myJobApply/index.vue new file mode 100644 index 0000000..34cd1a0 --- /dev/null +++ b/src/views/specialWorkManage/workTicket/myJobApply/index.vue @@ -0,0 +1,13 @@ +<template> + +</template> + +<script> +export default { + name: "index" +} +</script> + +<style scoped> + +</style> diff --git a/src/views/specialWorkManage/workTicket/workApply/index.vue b/src/views/specialWorkManage/workTicket/workApply/index.vue new file mode 100644 index 0000000..e826003 --- /dev/null +++ b/src/views/specialWorkManage/workTicket/workApply/index.vue @@ -0,0 +1,13 @@ +<template> +<div>1</div> +</template> + +<script> +export default { + name: "index" +} +</script> + +<style scoped> + +</style> -- Gitblit v1.9.2