<template>
|
<div class="home-container">
|
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick" v-loading="loading">
|
<el-tab-pane :lazy="true" label="动火作业" name="fire">
|
<fire-form ref="fire" :lists="lists"></fire-form>
|
</el-tab-pane>
|
<el-tab-pane :lazy="true" label="受限空间作业" name="space">
|
<space-form ref="space" :lists="lists"></space-form>
|
</el-tab-pane>
|
<el-tab-pane :lazy="true" label="吊装作业" name="hoist">
|
<hoist-form ref="hoist" :lists="lists"></hoist-form>
|
</el-tab-pane>
|
<el-tab-pane :lazy="true" label="动土作业" name="ground">
|
<ground-form ref="ground" :lists="lists"></ground-form>
|
</el-tab-pane>
|
<el-tab-pane :lazy="true" label="断路作业" name="broken">
|
<broken-form ref="broken" :lists="lists"></broken-form>
|
</el-tab-pane>
|
<el-tab-pane :lazy="true" label="高处作业" name="height">
|
<height-form ref="height" :lists="lists"></height-form>
|
</el-tab-pane>
|
<el-tab-pane :lazy="true" label="临时用电作业" name="power">
|
<power-form ref="power" :lists="lists"></power-form>
|
</el-tab-pane>
|
<el-tab-pane :lazy="true" label="盲板抽堵作业" name="plate">
|
<plate-form ref="plate" :lists="lists"></plate-form>
|
</el-tab-pane>
|
<el-tab-pane :lazy="true" label="打开作业" name="open">
|
<open-form ref="open" :lists="lists"></open-form>
|
</el-tab-pane>
|
</el-tabs>
|
<!-- <material-dialog ref="material"></material-dialog>-->
|
<!-- <el-radio-group v-model="activeName" size="large" @change="(value)=>handleClick(value)">-->
|
<!-- <el-radio-button :label=0>动火作业</el-radio-button>-->
|
<!-- <el-radio-button :label=1>受限空间作业</el-radio-button>-->
|
<!-- <el-radio-button :label=2>吊装作业</el-radio-button>-->
|
<!-- <el-radio-button :label=3>动土作业</el-radio-button>-->
|
<!-- <el-radio-button :label=4>断路作业</el-radio-button>-->
|
<!-- <el-radio-button :label=5>高处作业</el-radio-button>-->
|
<!-- <el-radio-button :label=6>临时用电作业</el-radio-button>-->
|
<!-- <el-radio-button :label=7>盲板抽堵作业</el-radio-button>-->
|
<!-- </el-radio-group>:-->
|
<!-- <fire-form v-if="activeName == 0" ref="fire" :workerList = allWorkers :deviceList = allDevices :departList=departmentList :departList2=departmentList2 :otherWorks="otherWorks" :spList="spList"></fire-form>-->
|
<!-- <space-form v-if="activeName == 1" ref="space" :workerList = allWorkers :departList = departmentList :departList2=departmentList2 :deviceList = allDevices :otherWorks="otherWorks" :spList="spList"></space-form>-->
|
<!-- <hoist-form v-if="activeName == 2" ref="hoist" :workerList = allWorkers :departList = departmentList :departList2=departmentList2 :deviceList = allDevices :otherWorks="otherWorks" :spList="spList"></hoist-form>-->
|
<!-- <ground-form v-if="activeName == 3" ref="ground" :workerList = allWorkers :departList = departmentList :departList2=departmentList2 :deviceList = allDevices :otherWorks="otherWorks" :spList="spList"></ground-form>-->
|
<!-- <broken-form v-if="activeName == 4" ref="broken" :workerList = allWorkers :departList = departmentList :departList2=departmentList2 :deviceList = allDevices :otherWorks="otherWorks" :spList="spList"></broken-form>-->
|
<!-- <height-form v-if="activeName == 5" ref="height" :workerList = allWorkers :departList = departmentList :departList2=departmentList2 :deviceList = allDevices :otherWorks="otherWorks" :spList="spList"></height-form>-->
|
<!-- <power-form v-if="activeName == 6" ref="power" :workerList = allWorkers :departList = departmentList :departList2=departmentList2 :deviceList = allDevices :otherWorks="otherWorks" :spList="spList"></power-form>-->
|
<!-- <plate-form v-if="activeName == 7" ref="plate" :workerList = allWorkers :departList = departmentList :departList2=departmentList2 :deviceList = allDevices :otherWorks="otherWorks" :spList="spList"></plate-form>-->
|
</div>
|
</template>
|
|
<script lang="ts">
|
import {toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted} from 'vue';
|
import { storeToRefs } from 'pinia';
|
import { initBackEndControlRoutes } from '/@/router/backEnd';
|
import {useUserInfo} from "/@/stores/userInfo";
|
import { Session } from '/@/utils/storage';
|
import { Search } from '@element-plus/icons-vue'
|
import { ElMessage } from 'element-plus'
|
import type { FormInstance, FormRules, TabsPaneContext } from 'element-plus'
|
import { workApplyApi } from '/@/api/specialWorkSystem/workApply';
|
import {teamManageApi} from "/@/api/systemManage/basicDateManage/personShiftManage/teamManage";
|
|
interface stateType {
|
activeName: string
|
allWorkers: Array<any>
|
departmentList: Array<any>
|
departmentList2: Array<any>
|
otherWorks: Array<any>
|
allDevices: Array<any>
|
loading: boolean
|
lists: {}
|
}
|
export default defineComponent({
|
name: 'apply',
|
components: {
|
fireForm: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/zysq/components/fire.vue')),
|
spaceForm: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/zysq/components/space.vue')),
|
hoistForm: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/zysq/components/hoist.vue')),
|
groundForm: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/zysq/components/ground.vue')),
|
brokenForm: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/zysq/components/broken.vue')),
|
heightForm: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/zysq/components/height.vue')),
|
powerForm: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/zysq/components/power.vue')),
|
plateForm: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/zysq/components/plate.vue')),
|
openForm: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/zysq/components/open.vue')),
|
},
|
setup() {
|
const userInfo = useUserInfo()
|
const { userInfos } = storeToRefs(userInfo);
|
const state = reactive<stateType>({
|
loading: false,
|
lists: {
|
workerList: [],
|
departList: [],
|
departList2: [],
|
deviceList: [],
|
otherWorks: [],
|
spList: [],
|
riskList: []
|
},
|
activeName: 'fire',
|
allWorkers: [],
|
departmentList: [],
|
departmentList2:[],
|
otherWorks: [],
|
allDevices: [],
|
});
|
const fire = ref()
|
const space = ref()
|
const hoist = ref()
|
const ground = ref()
|
const broken = ref()
|
const height = ref()
|
const power = ref()
|
const plate = ref()
|
const open = ref()
|
|
const handleClick = (tab: TabsPaneContext, event: Event) => {
|
state.loading = true
|
setTimeout(()=>{
|
state.loading = false
|
},1000)
|
// if(tab.index == 0){fire.value.getBasicData()}
|
// if(tab.index == 1){space.value.getBasicData()}
|
// if(tab.index == 2){hoist.value.getBasicData()}
|
// if(tab.index == 3){ground.value.getBasicData()}
|
// if(tab.index == 4){broken.value.getBasicData()}
|
// if(tab.index == 5){height.value.getBasicData()}
|
// if(tab.index == 6){power.value.getBasicData()}
|
// if(tab.index == 7){plate.value.getBasicData()}
|
}
|
|
// const handleClick = (value: number) => {
|
// if(value == 0){fire.value.getBasicData()}
|
// if(value == 1){space.value.getBasicData()}
|
// if(value == 2){hoist.value.getBasicData()}
|
// if(value == 3){ground.value.getBasicData()}
|
// if(value == 4){broken.value.getBasicData()}
|
// if(value == 5){height.value.getBasicData()}
|
// if(value == 6){power.value.getBasicData()}
|
// if(value == 7){plate.value.getBasicData()}
|
// }
|
|
// 页面载入时执行方法
|
onMounted(() => {
|
getAll()
|
getAllDepartment()
|
getAllDevice()
|
getOtherWork()
|
spWorker()
|
getOpList()
|
getAllRisks()
|
});
|
|
// 获取用户列表
|
const getAll = async ()=>{
|
const res = await workApplyApi().getAllUsers()
|
if (res.data.code === '200') {
|
state.allWorkers = JSON.parse(JSON.stringify(res.data.data))
|
state.lists.workerList = JSON.parse(JSON.stringify(res.data.data))
|
} else {
|
ElMessage({
|
type: 'warning',
|
message: res.data.msg
|
});
|
}
|
};
|
|
const spWorker = async ()=>{
|
for(let id of ['18','19']){
|
const res = await workApplyApi().getSpList({roleId: id})
|
// if(id == '17'){
|
// if (res.data.code === '200') {
|
// state.lists.spList.opList = JSON.parse(JSON.stringify(res.data.data))
|
// } else {
|
// ElMessage({
|
// type: 'warning',
|
// message: res.data.msg
|
// });
|
// }
|
// }
|
if(id == '18'){
|
if (res.data.code === '200') {
|
state.lists.spList.jhList = JSON.parse(JSON.stringify(res.data.data))
|
} else {
|
ElMessage({
|
type: 'warning',
|
message: res.data.msg
|
});
|
}
|
}
|
if(id == '19'){
|
if (res.data.code === '200') {
|
state.lists.spList.sfList = JSON.parse(JSON.stringify(res.data.data))
|
} else {
|
ElMessage({
|
type: 'warning',
|
message: res.data.msg
|
});
|
}
|
}
|
}
|
}
|
|
const getOpList = async()=>{
|
const res = await workApplyApi().getOpList()
|
if(res.data.code == '200'){
|
if(res.data.data && res.data.data.length>0){
|
state.lists.spList.opList = JSON.parse(JSON.stringify(res.data.data)).map(i=>{
|
if(i.certList && i.certList.length>0){
|
i.certList = i.certList.map(item=>{
|
item['realName'] = i.realName + '(' + item.certTypeName +':'+ item.certExpiredAt + ')'
|
item['uid'] = item.certNo + ',' + item.certExpiredAt
|
return item
|
})
|
}
|
return i
|
})
|
}
|
}else{
|
ElMessage({
|
type: 'warning',
|
message: res.data.msg
|
})
|
}
|
}
|
|
// 获取部门列表
|
const getAllDepartment = async () => {
|
let res = await teamManageApi().getAllDepartment();
|
if (res.data.code === '200') {
|
// state.departmentList = JSON.parse(JSON.stringify(res.data.data))
|
// state.departmentList2 = state.departmentList[0].children[0].children.filter(i=>i.depId == 32 || i.depId == 48 || i.depId == 49 || i.depId == 50)
|
state.lists.departList = JSON.parse(JSON.stringify(res.data.data))
|
state.lists.departList2 = JSON.parse(JSON.stringify(res.data.data))[0].children[0].children.filter(i=>i.depId == 32 || i.depId == 48 || i.depId == 49 || i.depId == 50 || i.depId == 10 || i.depId == 41 || i.depId == 46 || i.depId == 47)
|
} else {
|
ElMessage({
|
type: 'warning',
|
message: res.data.msg
|
});
|
}
|
};
|
|
// 获取相关作业列表
|
const getOtherWork = async () => {
|
let res = await workApplyApi().getOtherWork({pageSize: 999, pageIndex: 1, searchParams: {workPermitNo: '', workType: null}})
|
if (res.data.code === '200') {
|
state.otherWorks = JSON.parse(JSON.stringify(res.data.data))
|
state.lists.otherWorks = JSON.parse(JSON.stringify(res.data.data))
|
} else {
|
ElMessage({
|
type: 'warning',
|
message: res.data.msg
|
});
|
}
|
};
|
|
// 获取设备列表
|
const getAllDevice = async ()=>{
|
const res = await workApplyApi().getAllDevices()
|
if (res.data.code === '200') {
|
state.allDevices = JSON.parse(JSON.stringify(res.data.data))
|
state.lists.deviceList = JSON.parse(JSON.stringify(res.data.data))
|
} else {
|
ElMessage({
|
type: 'warning',
|
message: res.data.msg
|
});
|
}
|
};
|
|
// 获取设备列表
|
const getAllRisks = async ()=>{
|
const res = await workApplyApi().getAllRiskIdentity()
|
if (res.data.code === '200') {
|
// state.allDevices = JSON.parse(JSON.stringify(res.data.data))
|
state.lists.riskList = JSON.parse(JSON.stringify(res.data.data))
|
} else {
|
ElMessage({
|
type: 'warning',
|
message: res.data.msg
|
});
|
}
|
};
|
|
return {
|
...toRefs(state),
|
fire,
|
space,
|
broken,
|
ground,
|
height,
|
hoist,
|
plate,
|
power,
|
open,
|
handleClick,
|
getOtherWork
|
};
|
},
|
});
|
</script>
|
|
<style scoped lang="scss">
|
.home-container {
|
height: 100%;
|
overflow: hidden;
|
position: relative;
|
.homeCard{
|
width: 100%;
|
padding: 20px;
|
box-sizing: border-box;
|
background: #fff;
|
border-radius: 4px;
|
margin-bottom: 20px;
|
}
|
.applyBtn{
|
width: 100%;
|
background: #fff;
|
height: 80px;
|
z-index: 5;
|
box-shadow: 0 -3px 8px rgba(150,150,150,.1);
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
.el-row{
|
margin-bottom: 20px;
|
}
|
.el-row:last-child {
|
margin-bottom: 0;
|
}
|
.el-input{
|
width: 100% !important;
|
}
|
.el-date-editor::v-deep{
|
width: 100%;
|
}
|
.el-select{
|
width: 100%;
|
}
|
.el-cascader{
|
width: 100% !important;
|
}
|
}
|
</style>
|