| | |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | getProjectInfoList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/project/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addProjectInfo: (data: Array<any>) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/project`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delProjectInfo: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/project/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | getKeyUserInfoList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/key/personnel/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addKeyUserInfo: (data: Array<any>) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/key/personnel`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delKeyUserInfo: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/key/personnel/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | getUserCertInfoList: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/key/personnel/cert/list`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | addUserCertInfo: (data: Array<any>) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/key/personnel/cert`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | delUserCertInfo: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/report/assemble/contractor/key/personnel/cert/del`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | }; |
| | | } |
| | |
| | | return { |
| | | analyseType: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialWork/analyse/everyType/dep`, |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/statistic/everyType/dep`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | |
| | | renewalHot: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/renewal/hot`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | renewalConfinedspace: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/renewal/confinedspace`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | renewalHoisting: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/renewal/hoisting`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | renewalGroundBreaking: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/renewal/groundBreaking`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | renewalBrokenCircuit: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/renewal/brokenCircuit`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | renewalHight: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/renewal/hight`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | renewalTemporaryPower: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/renewal/temporaryPower`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | renewalBlindPlatePlugging: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/renewal/blindPlatePlugging`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | renewalOpenJob: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/specialwork9step/work/renewal/openJob`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | // 所有记录列表 |
| | | getApplyList: (data: object) => { |
| | | return request({ |
| | |
| | | }); |
| | | }, |
| | | |
| | | // 查询特殊作业人员 |
| | | getOpList: () => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/account/special/operator/list`, |
| | | method: 'get' |
| | | }); |
| | | }, |
| | | |
| | | // 受限空间申请 |
| | | postSpaceApply: (data: object) => { |
| | | return request({ |
| | |
| | | if (!Cookies.get('token')) return false; |
| | | const res = await menuApi.getMenuAdmin(Cookies.get('projectId') === null ? '' : Cookies.get('projectId')); |
| | | if (res.data.code === '200') { |
| | | if(res.data.data && res.data.data[0]){ |
| | | state.systemName = res.data.data[0].project.projectName; |
| | | }else{ |
| | | state.systemName = '' |
| | | } |
| | | } else { |
| | | console.log('有问题'); |
| | | } |
| | |
| | | const backToMenu = () => { |
| | | router.push({ path: 'newMenu' }).then(()=>{ |
| | | routeList.routesList.value = [] |
| | | console.log(routeList); |
| | | }); |
| | | }; |
| | | // const toHome = () => { |
| | |
| | | } else if (token && to.path === '/newMenu') { |
| | | next(); |
| | | NProgress.done(); |
| | | } else { |
| | | } else if (token && (to.path === '/warningScreen' || to.path === '/screenPage')) { |
| | | next(); |
| | | NProgress.done(); |
| | | }else { |
| | | const storesRoutesList = useRoutesList(pinia); |
| | | const { routesList } = storeToRefs(storesRoutesList); |
| | | if (routesList.value.length === 0) { |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" 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="userId"> |
| | | <el-select v-model="form.userId" filterable placeholder="请选择人员" clearable> |
| | | <el-option v-for="(item,index) in userList" :key="index" :label="item.userName" :value="item.uuid"/> |
| | | </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="userType"> |
| | | <el-select v-model="form.userType" filterable placeholder="请选择类型" clearable> |
| | | <el-option v-for="(item,index) in userTypeList" :key="index" :label="item.name" :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="contractorId"> |
| | | <el-select v-model="form.contractorId" filterable placeholder="请选择承包商" clearable> |
| | | <el-option v-for="(item,index) in contractorList" :key="index" :label="item.contractorName" :value="item.uuid"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-if="title == '新增上报'? false : true"> |
| | | <el-form-item label="删除状态" prop="deleted"> |
| | | <el-radio-group v-model="form.deleted"> |
| | | <el-radio label="0">未删除</el-radio> |
| | | <el-radio label="1">已删除</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button 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, FormRules, FormInstance} from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {contractorApi} from "/@/api/dataUpload/contractorManage"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string |
| | | isShowDialog: boolean |
| | | form: { |
| | | uuid: string |
| | | userType: null | number |
| | | userId: string |
| | | contractorId: string |
| | | deleted: string |
| | | } |
| | | rules:{} |
| | | contractorList: [] |
| | | userList: [] |
| | | userTypeList: Array<any> |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | props: ['types'], |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const addFormRef = ref() |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | uuid: '', |
| | | userType: null, |
| | | userId: '', |
| | | contractorId: '', |
| | | deleted: '0' |
| | | }, |
| | | rules:{ |
| | | userType: [{ required: true, message: '请选择人员类型', trigger: 'blur' }], |
| | | userId: [{ required: true, message: '请选择人员', trigger: 'blur' }], |
| | | contractorId: [{ required: true, message: '请选择承包商', trigger: 'blur' }] |
| | | }, |
| | | contractorList: [], |
| | | userList: [], |
| | | userTypeList: props.types |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true; |
| | | getDataList() |
| | | getUserList() |
| | | if (type === 'add') { |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | uuid: '', |
| | | userType: null, |
| | | userId: '', |
| | | contractorId: '', |
| | | deleted: '0' |
| | | } |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | userType: data.userType, |
| | | contractorId: data.contractorId, |
| | | userId: data.userId, |
| | | deleted: '0' |
| | | } |
| | | } |
| | | }; |
| | | |
| | | const getDataList = async ()=>{ |
| | | const res = await contractorApi().getContractorList({searchParams: {}, pageIndex: 1, pageSize: 999}) |
| | | if(res.data.code == 200){ |
| | | state.contractorList = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const getUserList = async ()=>{ |
| | | const res = await contractorApi().getContractorUserList({searchParams: {}, pageIndex: 1, pageSize: 999}) |
| | | if(res.data.code == 200){ |
| | | state.userList = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const res = await contractorApi().addKeyUserInfo([state.form]) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh'); |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | return { |
| | | formRef, |
| | | addFormRef, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="contractorId" label="承包商id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="userName" label="人员名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="userType" label="人员类型" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{userTypeList.find(i=>i.value == scope.row.userType)?.name}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createDate" label="创建时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="updateDate" label="修改时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="openDialog('update',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> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @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="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" :types="userTypeList" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {contractorApi} from "/@/api/dataUpload/contractorManage"; |
| | | import Cookies from "js-cookie"; |
| | | import axios from "axios"; |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | userList: [] |
| | | userTypeList: Array<any> |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'projectInfo', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null, |
| | | userList: [], |
| | | userTypeList: [ |
| | | { |
| | | name: '主要负责人', |
| | | value: 1 |
| | | }, |
| | | { |
| | | name: '安全管理人员', |
| | | value: 2 |
| | | }, |
| | | { |
| | | name: '特殊作业人员', |
| | | value: 3 |
| | | } |
| | | ] |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(async() => { |
| | | await getData() |
| | | await getUserList() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await contractorApi().getKeyUserInfoList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | const getUserList = async ()=>{ |
| | | const res = await contractorApi().getContractorUserList({searchParams: {}, pageIndex: 1, pageSize: 999}) |
| | | if(res.data.code == 200){ |
| | | state.userList = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: Object) => { |
| | | ElMessageBox.confirm(`此操作将永久删除该记录,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await contractorApi().delKeyUserInfo({ids: [row.id]}) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | const viewPdf=(item: Object)=>{ |
| | | console.log(item.filePath,555) |
| | | window.open(item.filePath) |
| | | } |
| | | |
| | | return { |
| | | reportRef, |
| | | openDialog, |
| | | getData, |
| | | viewPdf, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .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; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" 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="projectName"> |
| | | <el-input v-model.trim="form.projectName" 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="contractorId"> |
| | | <el-select v-model="form.contractorId" filterable placeholder="请选择承包商" clearable> |
| | | <el-option v-for="(item,index) in contractorList" :key="index" :label="item.contractorName" :value="item.uuid"/> |
| | | </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="qualificationList"> |
| | | <el-button type="primary" style="margin-bottom: 10px" @click="addFile">新增</el-button> |
| | | <el-table :data="form.qualificationList" style="width: 100%" border> |
| | | <el-table-column prop="qulificationName" label="资质名称"></el-table-column> |
| | | <el-table-column prop="filePath" label="资质文件"></el-table-column> |
| | | <el-table-column fixed="right" label="操作"> |
| | | <template #default="scope"> |
| | | <el-button @click="delFile(scope.$index)" type="text" size="small">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-if="title == '新增上报'? false : true"> |
| | | <el-form-item label="删除状态" prop="deleted"> |
| | | <el-radio-group v-model="form.deleted"> |
| | | <el-radio label="0">未删除</el-radio> |
| | | <el-radio label="1">已删除</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | <el-dialog v-model="addVisible" @open="startAdd" width="30%"> |
| | | <el-form :model="addForm" label-width="170px" ref="addFormRef" :rules="addFormRules"> |
| | | <el-row :gutter="20"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="资质名称" prop="qulificationName"> |
| | | <el-input |
| | | v-model="addForm.qulificationName" |
| | | placeholder="请输入资质名称" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="资质文件" prop="filePath"> |
| | | <el-upload accept=".pdf" multiple :action="uploadUrl" :headers="header" method="post" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :on-success="handleAvatarSuccess" :limit='1' v-model:file-list="fileList" :before-upload="picSize" :on-remove="handleRemove" :before-remove="beforeRemove"> |
| | | <el-button size="small" type="primary">点击上传</el-button> |
| | | <div slot="tip" class="el-upload__tip">支持上传pdf,尺寸小于5M,最多可上传1份</div> |
| | | <!-- <template #tip>--> |
| | | <!-- <div class="el-upload__tip">上传图片尺寸小于4M,最多可上传1张</div>--> |
| | | <!-- </template>--> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="primary" @click="confirmAdd(addFormRef)">新增</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, toRefs, onMounted, defineComponent, ref } from 'vue'; |
| | | import {ElMessageBox, ElMessage, FormRules, FormInstance} from 'element-plus'; |
| | | import axios from "axios"; |
| | | import {contractorApi} from "/@/api/dataUpload/contractorManage"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string |
| | | isShowDialog: boolean |
| | | form: { |
| | | uuid: string |
| | | projectName: string |
| | | contractorId: string |
| | | qualificationList: Array<any> |
| | | deleted: string |
| | | } |
| | | rules:{} |
| | | addVisible: boolean |
| | | fileList: [], |
| | | uploadUrl: string, |
| | | header: {}, |
| | | imgDialog: boolean, |
| | | imageUrl: string |
| | | addForm: {} |
| | | contractorList: [] |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const addFormRef = ref() |
| | | const checkList = (rule: any, value: any, callback: any) => { |
| | | if(state.form.qualificationList.length == 0){ |
| | | callback(new Error("请完善资质信息")) |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | uuid: '', |
| | | projectName: '', |
| | | contractorId: '', |
| | | qualificationList: [], |
| | | deleted: '0' |
| | | }, |
| | | rules:{ |
| | | projectName: [{ required: true, message: '请填写项目名称', trigger: 'blur' }], |
| | | contractorId: [{ required: true, message: '请选择承包商', trigger: 'blur' }], |
| | | qualificationList: [{ required: true,validator: checkList, trigger: 'blur' }] |
| | | }, |
| | | contractorList: [], |
| | | addVisible: false, |
| | | fileList: [], |
| | | uploadUrl: import.meta.env.VITE_API_URL + '/account/file/upload', |
| | | header: { |
| | | uid: Cookies.get('uid'), |
| | | Authorization: Cookies.get('token') |
| | | }, |
| | | imgDialog: false, |
| | | imageUrl: '', |
| | | addForm: { |
| | | qulificationName: '', |
| | | filePath: '' |
| | | } |
| | | }) |
| | | |
| | | const checkFile = (rule: any, value: any, callback: any) => { |
| | | if(state.fileList.length == 0){ |
| | | callback(new Error("请上传附件")) |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | |
| | | const addFormRules = reactive<FormRules>({ |
| | | qulificationName: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | filePath: [{ required: true,validator: checkFile, trigger: 'blur' }] |
| | | }) |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true; |
| | | getDataList() |
| | | if (type === 'add') { |
| | | state.title = '新增上报'; |
| | | state.form = { |
| | | uuid: '', |
| | | projectName: '', |
| | | contractorId: '', |
| | | qualificationList: [], |
| | | deleted: '0' |
| | | } |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | state.form = { |
| | | uuid: data.uuid, |
| | | projectName: data.projectName, |
| | | contractorId: data.contractorId, |
| | | qualificationList: data.qualificationList, |
| | | deleted: '0' |
| | | } |
| | | } |
| | | }; |
| | | |
| | | const getDataList = async ()=>{ |
| | | const res = await contractorApi().getContractorList({searchParams: {}, pageIndex: 1, pageSize: 999}) |
| | | if(res.data.code == 200){ |
| | | state.contractorList = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const res = await contractorApi().addProjectInfo([state.form]) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh'); |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const delFile = (index:number)=>{ |
| | | state.form.qualificationList.splice(index,1) |
| | | } |
| | | |
| | | const addFile = ()=>{ |
| | | state.addVisible = true |
| | | } |
| | | |
| | | const startAdd =()=>{ |
| | | state.addForm={ |
| | | qulificationName: '', |
| | | filePath: '', |
| | | } |
| | | state.fileList = [] |
| | | } |
| | | |
| | | const confirmAdd=async (formEl: FormInstance | undefined)=>{ |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | state.form.qualificationList.push(state.addForm) |
| | | state.addVisible = false |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '有表单内容未完成,请再次检查完善' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 图片上传 |
| | | const showTip =()=>{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '超出文件上传数量' |
| | | }); |
| | | } |
| | | |
| | | const picSize = async(rawFile: any) => { |
| | | if(rawFile.size / 1024 / 1024 > 5){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过5M' |
| | | }); |
| | | return false |
| | | } |
| | | } |
| | | |
| | | const handleAvatarSuccess = (res:any, uploadFile: any) => { |
| | | if(res){ |
| | | uploadFile.name = res |
| | | state.addForm.filePath = res |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件上传失败' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const handlePictureCardPreview = (uploadFile) => { |
| | | state.imageUrl = uploadFile.url |
| | | state.imgDialog = true; |
| | | } |
| | | |
| | | const handleRemove = (file, uploadFiles,type) => { |
| | | state.fileList = uploadFiles |
| | | } |
| | | |
| | | return { |
| | | formRef, |
| | | addFormRef, |
| | | addFormRules, |
| | | delFile, |
| | | startAdd, |
| | | showTip, |
| | | picSize, |
| | | addFile, |
| | | confirmAdd, |
| | | handleAvatarSuccess, |
| | | handlePictureCardPreview, |
| | | handleRemove, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="projectName" label="项目名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="contractorId" label="承包商id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="qualificationList" label="当前项目承包商提供资质" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" v-for="(item,index) in scope.row.qualificationList" @click="viewPdf(item)">{{item.qulificationName }}</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column prop="qulificationName" label="资质名称" show-overflow-tooltip></el-table-column>--> |
| | | <!-- <el-table-column prop="contractorType" label="资质文件" show-overflow-tooltip></el-table-column>--> |
| | | <!-- <el-table-column prop="Deleted" label="删除状态" show-overflow-tooltip>--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- {{scope.row.Deleted == 0?'未删除':scope.row.Deleted == 1?'已删除':'--'}}--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column prop="createDate" label="创建时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="updateDate" label="修改时间" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="openDialog('update',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> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @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="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {contractorApi} from "/@/api/dataUpload/contractorManage"; |
| | | import Cookies from "js-cookie"; |
| | | import axios from "axios"; |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'projectInfo', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await contractorApi().getProjectInfoList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: Object) => { |
| | | ElMessageBox.confirm(`此操作将永久删除:“${row.projectName}”,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await contractorApi().delProjectInfo({ids: [row.id]}) |
| | | if(res.data.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | const viewPdf=(item: Object)=>{ |
| | | console.log(item.filePath,555) |
| | | window.open(item.filePath) |
| | | } |
| | | |
| | | return { |
| | | reportRef, |
| | | openDialog, |
| | | getData, |
| | | viewPdf, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .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; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-add-user-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="50%"> |
| | | <el-form :model="form" size="default" ref="formRef" :rules="rules" 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="certName"> |
| | | <el-input v-model.trim="form.certName" type="text" 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="certNo"> |
| | | <el-input v-model.trim="form.certNo" type="text" 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="issuingInstituion"> |
| | | <el-input v-model.trim="form.issuingInstituion" type="text" 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="issuingTime"> |
| | | <el-date-picker v-model="form.issuingTime" value-format="YYYY-MM-DD" type="date" placeholder="选择发证日期" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="有效期" prop="effectiveTime"> |
| | | <el-date-picker v-model="form.effectiveTime" value-format="YYYY-MM-DD" type="date" placeholder="选择发证日期" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="复审日期" prop="reviewTime"> |
| | | <el-date-picker v-model="form.reviewTime" value-format="YYYY-MM-DD" type="date" placeholder="选择发证日期" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="承包商重点人员" prop="keyPersonnelId"> |
| | | <el-select v-model="form.keyPersonnelId" filterable placeholder="请选择重点人员" clearable> |
| | | <el-option v-for="(item,index) in contractorUserList" :key="index" :label="item.userName" :value="item.uuid"/> |
| | | </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="filePath"> |
| | | <el-upload accept="image/*" :action="uploadUrl" :headers="header" method="post" :on-exceed="showTip" :on-success="handleAvatarSuccess" :limit='1' v-model:file-list="fileList" :before-upload="picSize" :on-remove="handleRemove" :before-remove="beforeRemove"> |
| | | <el-button type="primary">点击上传</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip">仅支持上传图片文件,尺寸小于5M,最多可上传1张</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20" v-if="title == '新增上报'? false : true"> |
| | | <el-form-item label="删除状态" prop="deleted"> |
| | | <el-radio-group v-model="form.deleted"> |
| | | <el-radio label="0">未删除</el-radio> |
| | | <el-radio label="1">已删除</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | | <el-button 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 axios from "axios"; |
| | | import {workApplyApi} from "/@/api/specialWorkSystem/workApply"; |
| | | import {userApi} from '/@/api/systemManage/user' |
| | | import Cookies from "js-cookie"; |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | import {contractorApi} from "/@/api/dataUpload/contractorManage"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DataState { |
| | | title: string; |
| | | isShowDialog: boolean; |
| | | form: { |
| | | uuid: string |
| | | certName: string |
| | | certNo: string |
| | | issuingInstituion: string |
| | | issuingTime: string |
| | | effectiveTime: string |
| | | reviewTime: string |
| | | keyPersonnelId: string |
| | | filePath: string |
| | | deleted: string |
| | | } |
| | | rules:{}, |
| | | fileList: [], |
| | | contractorUserList: [] |
| | | uploadUrl: string, |
| | | header: {} |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'reportDialog', |
| | | setup(props, context) { |
| | | const formRef = ref() |
| | | const checkFile = (rule: any, value: any, callback: any) => { |
| | | if(state.fileList.length == 0){ |
| | | callback(new Error("请上传证书照片")) |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | const state = reactive<DataState>({ |
| | | title: '', |
| | | isShowDialog: false, |
| | | form: { |
| | | uuid: '', |
| | | certName: '', |
| | | certNo: '', |
| | | issuingInstituion: '', |
| | | issuingTime: '', |
| | | effectiveTime: '', |
| | | reviewTime: '', |
| | | keyPersonnelId: '', |
| | | filePath: '', |
| | | deleted: '0' |
| | | }, |
| | | rules:{ |
| | | certName: [{ required: true, message: '请选择证书名称', trigger: 'blur'}], |
| | | certNo: [{ required: true, message: '请填写证书编号', trigger: 'blur'}], |
| | | issuingInstituion: [{ required: true, message: '请填写发证机构', trigger: 'blur'}], |
| | | issuingTime: [{ required: true, message: '请选择发证日期', trigger: 'blur'}], |
| | | effectiveTime: [{ required: true, message: '请选择有效期', trigger: 'blur'}], |
| | | reviewTime: [{ required: true, message: '请选择复审期', trigger: 'blur'}], |
| | | keyPersonnelId: [{ required: true, message: '请选择重点人员', trigger: 'blur'}], |
| | | filePath: [{ required: true,validator: checkFile, trigger: 'blur' }] |
| | | }, |
| | | fileList: [], |
| | | contractorUserList: [], |
| | | uploadUrl: import.meta.env.VITE_API_URL + '/account/file/upload', |
| | | header: { |
| | | uid: Cookies.get('uid'), |
| | | Authorization: Cookies.get('token') |
| | | } |
| | | }) |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | // 打开弹窗 |
| | | const open = (type: string, data: object) => { |
| | | state.isShowDialog = true |
| | | getUserList() |
| | | if (type === 'add') { |
| | | state.title = '新增上报' |
| | | state.form = { |
| | | uuid: '', |
| | | certName: '', |
| | | certNo: '', |
| | | issuingInstituion: '', |
| | | issuingTime: '', |
| | | effectiveTime: '', |
| | | reviewTime: '', |
| | | keyPersonnelId: '', |
| | | filePath: '', |
| | | deleted: '0' |
| | | } |
| | | state.fileList = [] |
| | | }else{ |
| | | state.title = '重新上报'; |
| | | Object.keys(state.form).forEach(key => { |
| | | if (Object.prototype.hasOwnProperty.call(data,key)) { |
| | | state.form[key] = JSON.parse(JSON.stringify(data))[key]; |
| | | } |
| | | }) |
| | | if(data.files !== ''){ |
| | | state.fileList = state.form.filePath.split(',').map((i,index) => { |
| | | return { |
| | | url: i, |
| | | name: '文件' + (index+1) |
| | | } |
| | | }) |
| | | }else{ |
| | | state.fileList = [] |
| | | } |
| | | // state.form = { |
| | | // type: 1, |
| | | // uuid: data.uuid, |
| | | // name: '', |
| | | // remarks: '', |
| | | // evaluateTime: '', |
| | | // files: '', |
| | | // deleted: '0' |
| | | // } |
| | | } |
| | | }; |
| | | |
| | | const getUserList = async ()=>{ |
| | | const res = await contractorApi().getKeyUserInfoList({pageIndex: 1, pageSize: 999}) |
| | | if(res.data.code == 200){ |
| | | state.contractorUserList = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // 图片上传 |
| | | const showTip =()=>{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '超出文件上传数量' |
| | | }); |
| | | } |
| | | |
| | | const picSize = async(rawFile: any) => { |
| | | if(rawFile.size / 1024 / 1024 > 5){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过5M' |
| | | }); |
| | | return false |
| | | } |
| | | } |
| | | |
| | | const handleAvatarSuccess = (res:any, uploadFile: any) => { |
| | | if(res){ |
| | | uploadFile.name = res |
| | | state.form.filePath = res |
| | | console.log(state.fileList,'list') |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件上传失败' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const handleRemove = (file, uploadFiles,type) => { |
| | | state.form.files = '' |
| | | } |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | | formRef.value.validate(async (valid:Boolean) => { |
| | | if(valid){ |
| | | const res = await contractorApi().addUserCertInfo([state.form]) |
| | | if(res.data.code == '200'){ |
| | | ElMessage({ |
| | | type:'success', |
| | | message:'数据上报成功' |
| | | }) |
| | | state.isShowDialog = false |
| | | state.fileList = [] |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:res.data.msg |
| | | }) |
| | | } |
| | | context.emit('refresh'); |
| | | }else{ |
| | | ElMessage({ |
| | | type:'warning', |
| | | message:'请完善基本信息' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | return { |
| | | formRef, |
| | | showTip, |
| | | picSize, |
| | | handleAvatarSuccess, |
| | | handleRemove, |
| | | open, |
| | | onSubmit, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" icon="Plus" size="default" @click="openDialog('add',{})">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="reportData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="certName" label="证书名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="certNo" label="证书编号" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="issuingInstituion" label="发证机构" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="issuingTime" label="发证日期" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="effectiveTime" label="有效期" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="reviewTime" label="复审日期" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="keyPersonnelId" label="重点人员信息id" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="filePath" label="证书" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-button v-if="scope.row.filePath !== ''" size="small" text type="primary" @click="openFile(scope.row.filePath)">查看</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="openDialog('update',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> |
| | | <div class="pageBtn"> |
| | | <el-pagination @size-change="onHandleSizeChange" small="false" @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="total"> </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <add-report ref="reportRef" @refresh="getData"></add-report> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue' |
| | | import { ElMessageBox, ElMessage } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import addReport from "./components/addReport.vue" |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | import axios from "axios"; |
| | | import Cookies from "js-cookie"; |
| | | import {contractorApi} from "/@/api/dataUpload/contractorManage"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface TableDataRow { |
| | | id: number|null |
| | | reportTime: string |
| | | name: string |
| | | remarks: string |
| | | evaluateTime: string |
| | | files: string |
| | | } |
| | | interface TableDataState { |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {} |
| | | pageIndex: number |
| | | pageSize: number |
| | | } |
| | | total: null | number |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'judgeReport', |
| | | components: {addReport }, |
| | | setup() { |
| | | const reportRef= ref(); |
| | | const state = reactive<TableDataState>({ |
| | | reportData: [], |
| | | listQuery: { |
| | | searchParams: {}, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | | }, |
| | | total: null |
| | | }); |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getData() |
| | | }); |
| | | |
| | | const getData = async ()=>{ |
| | | const res = await contractorApi().getUserCertInfoList(state.listQuery) |
| | | if(res.data.code == 200){ |
| | | state.reportData = res.data.data |
| | | state.total = res.data.total |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const openDialog=(type:string,data:object)=>{ |
| | | reportRef.value.open(type,data) |
| | | } |
| | | |
| | | const openFile=(file: string)=>{ |
| | | // axios.get(file,{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ |
| | | // if (res) { |
| | | // const link = document.createElement('a') |
| | | // let blob = new Blob([res.data],{type: 'application/pdf'}) |
| | | // link.style.display = "none"; |
| | | // link.href = URL.createObjectURL(blob); // 创建URL |
| | | // window.open(link.href) |
| | | // } else { |
| | | // ElMessage({ |
| | | // type: 'warning', |
| | | // message: '文件读取失败' |
| | | // }); |
| | | // } |
| | | // }) |
| | | window.open(file) |
| | | } |
| | | |
| | | // 删除用户 |
| | | const onRowDel = (row: TableDataRow) => { |
| | | ElMessageBox.confirm(`此操作将永久删除该记录,是否继续?`, '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | const res = await contractorApi().delUserCertInfo({ids: [row.id]}) |
| | | if(res.data.code == '200'){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }) |
| | | await getData() |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | // 分页改变 |
| | | const onHandleSizeChange = (val: number) => { |
| | | state.listQuery.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.listQuery.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | return { |
| | | reportRef, |
| | | openFile, |
| | | openDialog, |
| | | getData, |
| | | onRowDel, |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | | .demo-tabs { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | &::v-deep(.el-tabs__content) { |
| | | height: calc(100% - 60px); |
| | | } |
| | | |
| | | .el-tab-pane { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .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; |
| | | } |
| | | } |
| | | } |
| | | .el-card { |
| | | border: 0; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | const onSignIn = async () => { |
| | | state.loading.signIn = true; |
| | | // 存储 token 到浏览器缓存 |
| | | let res = await useLoginApi().signIn(state.ruleForm); |
| | | const data = JSON.parse(JSON.stringify(state.ruleForm)) |
| | | data.password = Base64.encode(data.password) |
| | | let res = await useLoginApi().signIn(data); |
| | | if (res.data.code === '200') { |
| | | await userInfo.setUserInfos(res.data.data); |
| | | Cookies.set('token', res.data.data.accessToken); |
| | |
| | | // Session.set('token', res.data.data.accessToken); |
| | | // Session.set('projectId', ''); |
| | | // Session.set('uid', res.data.data.uid); |
| | | console.log(state.ruleForm,'form') |
| | | if (state.saveCode) { |
| | | localStorage.setItem('userCode', state.ruleForm.username) |
| | | localStorage.setItem('userPassword', Base64.encode(state.ruleForm.password),) |
| | |
| | | const resolvedRoute = router.resolve(routePath); |
| | | const fullPath = resolvedRoute.href |
| | | window.open(fullPath, '_blank'); |
| | | // window.open(fullPath, '_blank'); |
| | | |
| | | // window.open('http://39.104.85.193:8585/'); |
| | | }; |
| | | |
| | | const toDoublePrevent = () => { |
| | | window.open('http://117.190.40.54:6801/login'); |
| | | window.open('http://8.137.115.153:6801/login'); |
| | | }; |
| | | const toSmartFactory = () =>{ |
| | | window.open('http://117.190.40.54:5522/#/login'); |
| | |
| | | startTime: state.startTime1, |
| | | endTime:state.endTime |
| | | } |
| | | let res = await workApplyApi().getSbtjPie(data); |
| | | let res = await workApplyApi().getSbtjPie(data) |
| | | if (res.data.code === '200') { |
| | | if(res.data.data && res.data.data.length>0){ |
| | | const pieData = res.data.data.map(({workTypeDesc,count})=>({ name: workTypeDesc,value: count})) |
| | | const pieData = res.data.data.map(({workTypeDesc,count})=>({ name: workTypeDesc,value: count})).filter(i=>i.name !== '未知') |
| | | initZyfb(pieData) |
| | | } |
| | | else{ |
| | |
| | | </div> |
| | | <div class="basic-line" style="display:flex;white-space:nowrap;line-height: 40px"> |
| | | <span>负责人:</span> |
| | | <el-input v-model="searPara.headUserName" placeholder="负责人"/> |
| | | <el-input v-model.trim="searPara.headUserName" placeholder="负责人"/> |
| | | </div> |
| | | <div class="basic-line"> |
| | | <span>事业部:</span> |
| | |
| | | <div class="basic-line" style="display:flex;white-space:nowrap;line-height: 40px"> |
| | | <span>作业票编号:</span> |
| | | <el-input |
| | | v-model="searPara.workPermitNo" |
| | | v-model.trim="searPara.workPermitNo" |
| | | placeholder="请输入作业票编号" |
| | | /> |
| | | </div> |
| | |
| | | <template #default="scope"> |
| | | <!-- <el-button link type="danger" size="small" :icon="Delete" @click="deleteRecordBtn(scope.row)">作废</el-button>--> |
| | | <el-button link type="primary" size="small" :icon="View" @click="viewRecord(scope.row)">查看</el-button> |
| | | <el-button v-if="(scope.row.working?.workAllStatus == 3 || scope.row.working?.workAllStatus == 4 || scope.row.working?.workAllStatus == 5)&&!scope.row.renewalWorkApplyId" link type="primary" size="small" :icon="Edit" @click="continueRecord(scope.row)">一键续票</el-button> |
| | | <!-- <el-button link type="success" size="small" :icon="Finished">修改</el-button>--> |
| | | <!-- <el-button link type="success" size="small" :icon="Download">正式办票</el-button>--> |
| | | <el-button link type="primary" size="small" :icon="Download" @click="downLoadRecord(scope.row)">作业票预览</el-button> |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <fire-dialog ref="fireRef" :lists="lists" @refresh="getListByPage"></fire-dialog> |
| | | <plate-dialog ref="plateRef" :lists="lists" @refresh="getListByPage"></plate-dialog> |
| | | <space-dialog ref="spaceRef" :lists="lists" @refresh="getListByPage"></space-dialog> |
| | | <hoist-dialog ref="hoistRef" :lists="lists" @refresh="getListByPage"></hoist-dialog> |
| | | <ground-dialog ref="groundRef" :lists="lists" @refresh="getListByPage"></ground-dialog> |
| | | <broken-dialog ref="brokenRef" :lists="lists" @refresh="getListByPage"></broken-dialog> |
| | | <height-dialog ref="heightRef" :lists="lists" @refresh="getListByPage"></height-dialog> |
| | | <power-dialog ref="powerRef" :lists="lists" @refresh="getListByPage"></power-dialog> |
| | | <open-dialog ref="openRef" :lists="lists" @refresh="getListByPage"></open-dialog> |
| | | <!-- <el-dialog v-model="downLoadDialog" title="提示" width="30%" center>--> |
| | | <!-- <span>您确定要导出该条记录吗?</span>--> |
| | | <!-- <template #footer>--> |
| | |
| | | dep4List: Array<type>; |
| | | searPara: {} |
| | | timeRange: Array<string>; |
| | | lists: {} |
| | | } |
| | | interface type { |
| | | id: number; |
| | |
| | | export default defineComponent({ |
| | | name: 'applys', |
| | | components: { |
| | | detailLog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/detailLog.vue')) |
| | | detailLog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/detailLog.vue')), |
| | | fireDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/fireDialog.vue')), |
| | | plateDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/plateDialog.vue')), |
| | | spaceDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/spaceDialog.vue')), |
| | | hoistDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/hoistDialog.vue')), |
| | | groundDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/groundDialog.vue')), |
| | | brokenDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/brokenDialog.vue')), |
| | | heightDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/heightDialog.vue')), |
| | | powerDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/powerDialog.vue')), |
| | | openDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/openDialog.vue')) |
| | | }, |
| | | setup() { |
| | | const userInfo = useUserInfo(); |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const router = useRouter(); |
| | | const state = reactive<stateType>({ |
| | | lists: { |
| | | workerList: [], |
| | | departList: [], |
| | | departList2: [], |
| | | deviceList: [], |
| | | otherWorks: [], |
| | | spList: [], |
| | | riskList: [] |
| | | }, |
| | | pageIndex1: 1, |
| | | pageSize1: 10, |
| | | totalSize1: 0, |
| | |
| | | {id:49,name:'电石事业部'}, |
| | | {id:50,name:'电力事业部'}, |
| | | {id:48,name:'有机化工事业部'}, |
| | | {id:32,name:'甲醇事业部'} |
| | | {id:32,name:'甲醇事业部'}, |
| | | {id:10,name:'后勤中心'}, |
| | | {id:41,name:'安全环保部'}, |
| | | {id:46,name:'供销中心'}, |
| | | {id:47,name:'技术中心'} |
| | | ], |
| | | workType: [ |
| | | { id: 1, name: '动火作业' }, |
| | | { id: 2, name: '受限空间作业' }, |
| | | { id: 3, name: '吊装作业' }, |
| | | { id: 4, name: '动土作业' }, |
| | | { id: 5, name: '断路作业' }, |
| | | { id: 6, name: '高处作业' }, |
| | | { id: 7, name: '临时用电作业' }, |
| | | { id: 8, name: '盲板抽堵作业' } |
| | | { id: 1, name: '动火作业' }, |
| | | { id: 2, name: '受限空间作业' }, |
| | | { id: 3, name: '吊装作业' }, |
| | | { id: 4, name: '动土作业' }, |
| | | { id: 5, name: '断路作业' }, |
| | | { id: 6, name: '高处作业' }, |
| | | { id: 7, name: '临时用电作业' }, |
| | | { id: 8, name: '盲板抽堵作业' } |
| | | ], |
| | | statusList: [ |
| | | { |
| | |
| | | ], |
| | | timeRange: [] |
| | | }); |
| | | |
| | | const fireRef = ref() |
| | | const plateRef = ref() |
| | | const spaceRef = ref() |
| | | const hoistRef = ref() |
| | | const groundRef = ref() |
| | | const brokenRef = ref() |
| | | const heightRef = ref() |
| | | const powerRef = ref() |
| | | const openRef = ref() |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getListByPage(); |
| | | getAllDepartment() |
| | | spWorker() |
| | | getOpList() |
| | | getAll() |
| | | getAllDevice() |
| | | getAllRisks() |
| | | getOtherWork() |
| | | }); |
| | | const giveTime = () => { |
| | | if (state.timeRange && state.timeRange !== null) { |
| | | state.searPara.startTime = state.timeRange[0]; |
| | |
| | | state.searPara.endTime = ''; |
| | | } |
| | | }; |
| | | |
| | | const continueRecord = (row)=>{ |
| | | if(row.workType == 1){ |
| | | fireRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 2){ |
| | | spaceRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 3){ |
| | | hoistRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 4){ |
| | | groundRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 5){ |
| | | brokenRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 6){ |
| | | heightRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 7){ |
| | | powerRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 8){ |
| | | plateRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 9){ |
| | | openRef.value.openDialog(row,'continue') |
| | | } |
| | | } |
| | | |
| | | // 刷新 |
| | | const reLoadData = async () => { |
| | |
| | | if (res.data.code === '200') { |
| | | state.departmentList = JSON.parse(JSON.stringify(res.data.data)) |
| | | recursion(state.departmentList); |
| | | state.lists.departList = state.departmentList |
| | | 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', |
| | |
| | | return nameList.join(); |
| | | } |
| | | }; |
| | | |
| | | const spWorker = async ()=>{ |
| | | for(let id of ['18','19']){ |
| | | const res = await workApplyApi().getSpList({roleId: id}) |
| | | 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 getAll = async ()=>{ |
| | | const res = await workApplyApi().getAllUsers() |
| | | if (res.data.code === '200') { |
| | | state.lists.workerList = 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.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 |
| | | }); |
| | | } |
| | | } |
| | | |
| | | const getOtherWork = async () => { |
| | | let res = await workApplyApi().getOtherWork({pageSize: 999, pageIndex: 1, searchParams: {workPermitNo: '', workType: null}}) |
| | | if (res.data.code === '200') { |
| | | state.lists.otherWorks = JSON.parse(JSON.stringify(res.data.data)) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // 关键词查询记录 |
| | | const searchRecord = async () => { |
| | |
| | | // 导出方法 |
| | | const downLoadRecord = (row: any) => { |
| | | // let res = await workApplyApi().postPrinting(data); |
| | | console.log(row,555) |
| | | axios.post(import.meta.env.VITE_API_URL + `/specialwork9step/work/down/load/pdf`,{ id: row.id},{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ |
| | | if (res) { |
| | | const link = document.createElement('a') |
| | |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getListByPage(); |
| | | getAllDepartment() |
| | | }); |
| | | |
| | | return { |
| | | View, |
| | | Edit, |
| | |
| | | Plus, |
| | | Finished, |
| | | Download, |
| | | fireRef, |
| | | plateRef, |
| | | spaceRef, |
| | | hoistRef, |
| | | groundRef, |
| | | brokenRef, |
| | | heightRef, |
| | | powerRef, |
| | | openRef, |
| | | continueRecord, |
| | | giveTime, |
| | | reLoadData, |
| | | toApply, |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <!-- <div class="home-container">--> |
| | | <el-dialog v-model="showDialog" :title="title" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :disabled="isDisabled" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" v-throttle plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | <el-button v-if="title == '修改'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">提交修改</el-button> |
| | | <el-button v-if="title == '续票'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">一键续票</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | <!-- </div>--> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | |
| | | import {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | isDisabled: boolean |
| | | title: string |
| | | equipmentDialog: boolean, |
| | | showDialog: boolean |
| | | props1:{}, |
| | | depProps:{}, |
| | | depProps2:{}, |
| | | cas2Props:{} |
| | | safetyMeasureBasicList: [], |
| | | zyList: [] |
| | | fileList: Array<file>, |
| | |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | zyList: [], |
| | | isDisabled: false, |
| | | title: '修改', |
| | | form: { |
| | | id: null, |
| | | workType: 5, |
| | |
| | | emitPath: false, |
| | | multiple: true |
| | | }, |
| | | cas2Props: { |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | fileList: [], |
| | | imgLimit: 3, |
| | | uploadUrl: '', |
| | |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getWorkerList = ()=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | const openDialog = (row)=>{ |
| | | const openDialog = (row,type)=>{ |
| | | clearFile() |
| | | state.zyList = props.lists.spList.opList |
| | | getBasicData() |
| | |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | console.log(row.operatorList,'list') |
| | | state.form.operatorUids = row.operatorList.map(i=>{ |
| | | if(i.certExpiredAt && i.certExpiredAt !==''){ |
| | | return [i.userId,i.certificate + ',' + i.certExpiredAt] |
| | | }else{ |
| | | return [i.userId] |
| | | } |
| | | }) |
| | | console.log(state.form.operatorUids,'id') |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | |
| | | state.form.workDepIds = row.workDepList.map(i=>i.workDepId) |
| | | }else{ |
| | | state.form.workDepIds.push(row.workDepId) |
| | | } |
| | | if(type == 'edit'){ |
| | | state.isDisabled = false |
| | | state.title = '修改' |
| | | }else{ |
| | | if(!state.form.id){ |
| | | state.form.id = row.workApplyId |
| | | } |
| | | state.isDisabled = true |
| | | state.title = '续票' |
| | | } |
| | | getWorkerList() |
| | | state.showDialog = true |
| | |
| | | return index === 0; |
| | | } |
| | | |
| | | const singleSelect=(value,type)=>{ |
| | | let selected = value |
| | | if(selected.length>1){ |
| | | const temp = [] |
| | | for(let i of selected){ |
| | | const index = temp.findIndex(item => item[0] === i[0]); |
| | | if (index !== -1) { |
| | | temp[index] = i |
| | | }else{ |
| | | temp.push(i) |
| | | } |
| | | } |
| | | if(type == '作业人'){state.form.operatorUids = JSON.parse(JSON.stringify(temp))} |
| | | // if(type == '分析人'){state.form.analystUids = temp} |
| | | if(type == '监护人'){state.form.guardianUids = temp} |
| | | if(type == '确认人'){state.form.safetyMeasureUids = temp} |
| | | if(type == '结束人'){state.form.startOrEndUids = temp} |
| | | } |
| | | } |
| | | |
| | | const transformArr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const transform2Arr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | |
| | | state.form.workDetail.bcPath = state.form.workDetail.bcPath.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUids = transform2Arr(data.acceptUids) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modBrokenApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.bcPath = [] |
| | | state.fileList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.involvedDepIds = state.form.workDetail.involvedDepIds.split(',') |
| | | state.form.workDetail.bcPath = state.form.workDetail.bcPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | if(state.title == '修改'){ |
| | | const res = await workApplyApi().modBrokenApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.bcPath = [] |
| | | state.fileList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.involvedDepIds = state.form.workDetail.involvedDepIds.split(',') |
| | | state.form.workDetail.bcPath = state.form.workDetail.bcPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | }else{ |
| | | const res = await workApplyApi().renewalBrokenCircuit(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '续票成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.bcPath = [] |
| | | state.fileList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.involvedDepIds = state.form.workDetail.involvedDepIds.split(',') |
| | | state.form.workDetail.bcPath = state.form.workDetail.bcPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | singleSelect, |
| | | renderMenu, |
| | | getBasicData, |
| | | getWorkerList, |
| | |
| | | <div class="d-cont" v-else>{{details.workDepName}}</div> |
| | | </div> |
| | | <div class="d-row"> |
| | | <div class="d-tit">作业人</div><div class="d-cont">{{details.operatorList.map(i=>{return i.userName + '(' + i.phone+ ')' }).join('、')}}</div> |
| | | <div class="d-tit">作业人</div> |
| | | <div class="d-cont"> |
| | | {{details.operatorList.map(i=>{return i.userName + '(' + i.phone + (i.certificate ? `,证书编号:${i.certificate}`:'') + ')'}).join('、')}} |
| | | </div> |
| | | </div> |
| | | <div class="d-row" v-if="details.involveOtherWork && details.involveOtherWork !== ''"> |
| | | <div class="d-tit">关联其他作业</div><div class="d-cont">{{details.involveOtherWork}}</div> |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <!-- <div class="home-container">--> |
| | | <el-dialog v-model="showDialog" :title="title" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :disabled="isDisabled" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">提交修改</el-button> |
| | | <el-button v-if="title == '修改'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">提交修改</el-button> |
| | | <el-button v-if="title == '续票'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">一键续票</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | <!-- </div>--> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | |
| | | import {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | isDisabled: boolean |
| | | title: string |
| | | workLevelList: Array<any>, |
| | | fireWorkList: Array<any>, |
| | | equipmentDialog: boolean, |
| | |
| | | zyList: [] |
| | | props1:{} |
| | | depProps:{} |
| | | cas2Props: {} |
| | | safetyMeasureBasicList: [] |
| | | } |
| | | export default defineComponent({ |
| | |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | zyList: [], |
| | | isDisabled: false, |
| | | title: '修改', |
| | | form: { |
| | | id: null, |
| | | workType: 1, |
| | |
| | | value: 'depId', |
| | | emitPath: false |
| | | }, |
| | | cas2Props: { |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | depProps:{ |
| | | expandTrigger: 'hover', |
| | | label: 'depName', |
| | |
| | | console.log('false loading') |
| | | }) |
| | | const getWorkerList = ()=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | const openDialog = (row)=>{ |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const openDialog = (row,type)=>{ |
| | | clearFile() |
| | | state.zyList = props.lists.spList.opList |
| | | getBasicData() |
| | |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key] |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.operatorUids = row.operatorList.map(i=>{ |
| | | if(i.certExpiredAt && i.certExpiredAt !==''){ |
| | | return [i.userId,i.certificate + ',' + i.certExpiredAt] |
| | | }else{ |
| | | return [i.userId] |
| | | } |
| | | }) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | |
| | | state.form.workDetail.other = state.form.workDetail.methodList[i] |
| | | state.form.workDetail.methodList[i] = '其他' |
| | | } |
| | | } |
| | | if(type == 'edit'){ |
| | | state.isDisabled = false |
| | | state.title = '修改' |
| | | }else{ |
| | | if(!state.form.id){ |
| | | state.form.id = row.workApplyId |
| | | } |
| | | state.isDisabled = true |
| | | state.title = '续票' |
| | | } |
| | | getWorkerList() |
| | | state.showDialog = true |
| | |
| | | // state.form.applyDepId = state.form.depIdList[state.form.depIdList.length - 1] |
| | | // state.form.seDepId = state.form.depIdList[0] |
| | | state.form.seDepId = findTopLevelId(props.lists.departList2,state.form.applyDepId) |
| | | } |
| | | |
| | | const singleSelect=(value,type)=>{ |
| | | let selected = value |
| | | if(selected.length>1){ |
| | | const temp = [] |
| | | for(let i of selected){ |
| | | const index = temp.findIndex(item => item[0] === i[0]); |
| | | if (index !== -1) { |
| | | temp[index] = i |
| | | }else{ |
| | | temp.push(i) |
| | | } |
| | | } |
| | | if(type == '作业人'){state.form.operatorUids = JSON.parse(JSON.stringify(temp))} |
| | | // if(type == '分析人'){state.form.analystUids = temp} |
| | | if(type == '监护人'){state.form.guardianUids = temp} |
| | | if(type == '确认人'){state.form.safetyMeasureUids = temp} |
| | | if(type == '结束人'){state.form.startOrEndUids = temp} |
| | | } |
| | | } |
| | | |
| | | // 获取基础数据 |
| | |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | return item |
| | | }) |
| | | data.workDetail.workMethod = data.workDetail.methodList.join(',') |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | // data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUids = transform2Arr(data.acceptUids) |
| | | data.lastApprover = transform2EObj(data.lastApprover) |
| | | const res = await workApplyApi().modFireApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | if(state.title == '修改'){ |
| | | const res = await workApplyApi().modFireApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | }else{ |
| | | const res = await workApplyApi().renewalHot(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '续票成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | submitForm, |
| | | findParent, |
| | | openWorkSelect, |
| | | singleSelect, |
| | | getSelected, |
| | | openDialog, |
| | | workSelectRef, |
| | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | width: 100%; |
| | | height: 100vh; |
| | | overflow: hidden; |
| | | overflow-y: scroll; |
| | | &::-webkit-scrollbar{ |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <!-- <div class="home-container">--> |
| | | <el-dialog v-model="showDialog" :title="title" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :disabled="isDisabled" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" v-throttle plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | <el-button v-if="title == '修改'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">提交修改</el-button> |
| | | <el-button v-if="title == '续票'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">一键续票</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | <el-dialog v-model="dialogVisible"> |
| | | <img w-full :src="dialogImageUrl" alt="Preview Image" /> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </div> |
| | | <!-- </div>--> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | |
| | | import axios from "axios"; |
| | | import {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | form: Object |
| | | isDisabled: boolean |
| | | title: string |
| | | equipmentDialog: boolean, |
| | | showDialog: boolean |
| | | props1:{}, |
| | | depProps:{}, |
| | | cas2Props: {} |
| | | safetyMeasureBasicList: [], |
| | | zyList: [] |
| | | fileList: Array<file>, |
| | |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | zyList: [], |
| | | isDisabled: false, |
| | | title: '修改', |
| | | form: { |
| | | id: null, |
| | | workType: 4, |
| | |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | | cas2Props: { |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | fileList: [], |
| | | imgLimit: 3, |
| | | uploadUrl: '', |
| | |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getWorkerList = ()=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | |
| | | const openDialog = (row)=>{ |
| | | const openDialog = (row,type)=>{ |
| | | clearFile() |
| | | state.zyList = props.lists.spList.opList |
| | | getBasicData() |
| | |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.operatorUids = row.operatorList.map(i=>{ |
| | | if(i.certExpiredAt && i.certExpiredAt !==''){ |
| | | return [i.userId,i.certificate + ',' + i.certExpiredAt] |
| | | }else{ |
| | | return [i.userId] |
| | | } |
| | | }) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | |
| | | state.form.workDepIds = row.workDepList.map(i=>i.workDepId) |
| | | }else{ |
| | | state.form.workDepIds.push(row.workDepId) |
| | | } |
| | | if(type == 'edit'){ |
| | | state.isDisabled = false |
| | | state.title = '修改' |
| | | }else{ |
| | | if(!state.form.id){ |
| | | state.form.id = row.workApplyId |
| | | } |
| | | state.isDisabled = true |
| | | state.title = '续票' |
| | | } |
| | | getWorkerList() |
| | | state.showDialog = true |
| | |
| | | return index === 0; |
| | | } |
| | | |
| | | const singleSelect=(value,type)=>{ |
| | | let selected = value |
| | | if(selected.length>1){ |
| | | const temp = [] |
| | | for(let i of selected){ |
| | | const index = temp.findIndex(item => item[0] === i[0]); |
| | | if (index !== -1) { |
| | | temp[index] = i |
| | | }else{ |
| | | temp.push(i) |
| | | } |
| | | } |
| | | if(type == '作业人'){state.form.operatorUids = JSON.parse(JSON.stringify(temp))} |
| | | // if(type == '分析人'){state.form.analystUids = temp} |
| | | if(type == '监护人'){state.form.guardianUids = temp} |
| | | if(type == '确认人'){state.form.safetyMeasureUids = temp} |
| | | if(type == '结束人'){state.form.startOrEndUids = temp} |
| | | } |
| | | } |
| | | |
| | | const transformArr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | return |
| | | } |
| | | } |
| | | // if(Array.isArray(state.form.involveOtherWork)){ |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.join(',') |
| | | // } |
| | | state.form.workDetail.gbPath = state.form.workDetail.gbPath.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUids = transform2Arr(data.acceptUids) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modGroundApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.gbPath = [] |
| | | state.fileList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.gbPath = state.form.workDetail.gbPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | if(state.title == '修改'){ |
| | | const res = await workApplyApi().modGroundApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.gbPath = [] |
| | | state.fileList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.gbPath = state.form.workDetail.gbPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | }else{ |
| | | const res = await workApplyApi().renewalGroundBreaking(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '续票成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.gbPath = [] |
| | | state.fileList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.gbPath = state.form.workDetail.gbPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | singleSelect, |
| | | renderMenu, |
| | | getBasicData, |
| | | getWorkerList, |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <!-- <div class="home-container">--> |
| | | <el-dialog v-model="showDialog" :title="title" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :disabled="isDisabled" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" v-throttle plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | <el-button v-if="title == '修改'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">提交修改</el-button> |
| | | <el-button v-if="title == '续票'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">一键续票</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | <!-- </div>--> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | |
| | | import {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | isDisabled: boolean |
| | | title: string |
| | | workLevelList: Array<any>, |
| | | equipmentDialog: boolean, |
| | | showDialog: boolean |
| | | props1:{}, |
| | | depProps:{}, |
| | | cas2Props:{} |
| | | safetyMeasureBasicList: [] |
| | | zyList: [] |
| | | tabLoading: boolean |
| | |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | zyList: [], |
| | | isDisabled: false, |
| | | title: '修改', |
| | | form: { |
| | | id: null, |
| | | workType: 6, |
| | |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | | cas2Props: { |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | } |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getWorkerList = ()=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | const openDialog = (row)=>{ |
| | | const openDialog = (row,type)=>{ |
| | | clearFile() |
| | | state.zyList = props.lists.spList.opList |
| | | getBasicData() |
| | |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.operatorUids = row.operatorList.map(i=>{ |
| | | if(i.certExpiredAt && i.certExpiredAt !==''){ |
| | | return [i.userId,i.certificate + ',' + i.certExpiredAt] |
| | | }else{ |
| | | return [i.userId] |
| | | } |
| | | }) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | |
| | | state.form.workDepIds = row.workDepList.map(i=>i.workDepId) |
| | | }else{ |
| | | state.form.workDepIds.push(row.workDepId) |
| | | } |
| | | if(type == 'edit'){ |
| | | state.isDisabled = false |
| | | state.title = '修改' |
| | | }else{ |
| | | if(!state.form.id){ |
| | | state.form.id = row.workApplyId |
| | | } |
| | | state.isDisabled = true |
| | | state.title = '续票' |
| | | } |
| | | getWorkerList() |
| | | state.showDialog = true |
| | |
| | | return index === 0; |
| | | } |
| | | |
| | | const singleSelect=(value,type)=>{ |
| | | let selected = value |
| | | if(selected.length>1){ |
| | | const temp = [] |
| | | for(let i of selected){ |
| | | const index = temp.findIndex(item => item[0] === i[0]); |
| | | if (index !== -1) { |
| | | temp[index] = i |
| | | }else{ |
| | | temp.push(i) |
| | | } |
| | | } |
| | | if(type == '作业人'){state.form.operatorUids = JSON.parse(JSON.stringify(temp))} |
| | | // if(type == '分析人'){state.form.analystUids = temp} |
| | | if(type == '监护人'){state.form.guardianUids = temp} |
| | | if(type == '确认人'){state.form.safetyMeasureUids = temp} |
| | | if(type == '结束人'){state.form.startOrEndUids = temp} |
| | | } |
| | | } |
| | | |
| | | const transformArr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const transform2Arr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | |
| | | // } |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUids = transform2Arr(data.acceptUids) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modHeightApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | if(state.title == '修改'){ |
| | | const res = await workApplyApi().modHeightApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | }else{ |
| | | const res = await workApplyApi().renewalHight(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '续票成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | singleSelect, |
| | | renderMenu, |
| | | getBasicData, |
| | | getWorkerList, |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <!-- <div class="home-container">--> |
| | | <el-dialog v-model="showDialog" :title="title" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :disabled="isDisabled" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" v-throttle plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | <el-button v-if="title == '修改'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">提交修改</el-button> |
| | | <el-button v-if="title == '续票'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">一键续票</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | <!-- </div>--> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | |
| | | import {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | isDisabled: boolean |
| | | title: string |
| | | workLevelList: Array<any> |
| | | equipmentDialog: boolean |
| | | showDialog: boolean |
| | | props1:{} |
| | | depProps:{} |
| | | cas2Props: {} |
| | | zyList: [] |
| | | safetyMeasureBasicList: [] |
| | | tabLoading: boolean |
| | |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | zyList: [], |
| | | isDisabled: false, |
| | | title: '修改', |
| | | form: { |
| | | id: null, |
| | | workType: 3, |
| | |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | | cas2Props: { |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | } |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getWorkerList = ()=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | const openDialog = (row)=>{ |
| | | const openDialog = (row,type)=>{ |
| | | clearFile() |
| | | state.zyList = props.lists.spList.opList |
| | | getBasicData() |
| | |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.operatorUids = row.operatorList.map(i=>{ |
| | | if(i.certExpiredAt && i.certExpiredAt !==''){ |
| | | return [i.userId,i.certificate + ',' + i.certExpiredAt] |
| | | }else{ |
| | | return [i.userId] |
| | | } |
| | | }) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | |
| | | state.form.workDepIds = row.workDepList.map(i=>i.workDepId) |
| | | }else{ |
| | | state.form.workDepIds.push(row.workDepId) |
| | | } |
| | | if(type == 'edit'){ |
| | | state.isDisabled = false |
| | | state.title = '修改' |
| | | }else{ |
| | | if(!state.form.id){ |
| | | state.form.id = row.workApplyId |
| | | } |
| | | state.isDisabled = true |
| | | state.title = '续票' |
| | | } |
| | | getWorkerList() |
| | | state.showDialog = true |
| | |
| | | return index === 0; |
| | | } |
| | | |
| | | const singleSelect=(value,type)=>{ |
| | | let selected = value |
| | | if(selected.length>1){ |
| | | const temp = [] |
| | | for(let i of selected){ |
| | | const index = temp.findIndex(item => item[0] === i[0]); |
| | | if (index !== -1) { |
| | | temp[index] = i |
| | | }else{ |
| | | temp.push(i) |
| | | } |
| | | } |
| | | if(type == '作业人'){state.form.operatorUids = JSON.parse(JSON.stringify(temp))} |
| | | // if(type == '分析人'){state.form.analystUids = temp} |
| | | if(type == '监护人'){state.form.guardianUids = temp} |
| | | if(type == '确认人'){state.form.safetyMeasureUids = temp} |
| | | if(type == '结束人'){state.form.startOrEndUids = temp} |
| | | } |
| | | } |
| | | |
| | | const transformArr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | state.form.workDetail.solicitorUids = state.form.workDetail.solicitorUids.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUids = transform2Arr(data.acceptUids) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modHoistApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.solicitorUids = state.form.workDetail.solicitorUids.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | if(state.title == '修改'){ |
| | | const res = await workApplyApi().modHoistApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.solicitorUids = state.form.workDetail.solicitorUids.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | }else{ |
| | | const res = await workApplyApi().renewalHoisting(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '续票成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.solicitorUids = state.form.workDetail.solicitorUids.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | singleSelect, |
| | | renderMenu, |
| | | getBasicData, |
| | | getWorkerList, |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="风险研判报告记录附件"> |
| | | <el-form-item label="风险研判报告记录附件" prop="judgePicturePath"> |
| | | <el-upload accept="image/*" :auto-upload="true" :on-exceed="showTip" :on-preview="handlePictureCardPreview" :limit='imgLimit' v-model:file-list="fileList" :http-request="upload" :action="uploadUrl" list-type="picture-card" :before-remove="beforeRemove" :before-upload="getUploadUrl"> |
| | | <el-icon><Plus /></el-icon> |
| | | <template #tip> |
| | |
| | | <div class="d-row"> |
| | | <div class="d-tit">jsa风险研判结论</div><div class="d-cont">{{detail.judgeRecord}}</div> |
| | | </div> |
| | | <div class="d-row"> |
| | | <div class="d-row" v-if="detail.judgeJsaCode && detail.judgeJsaCode !== ''"> |
| | | <div class="d-tit">报告编号</div><div class="d-cont">{{detail.judgeJsaCode}}</div> |
| | | </div> |
| | | <div class="d-row"> |
| | |
| | | setup(props: any, context: any) { |
| | | const jsaFormRef = ref(); |
| | | const approveLevelDialogRef = ref(); |
| | | const checkFile = (rule: any, value: any, callback: any) => { |
| | | if(state.fileList.length == 0){ |
| | | callback(new Error("请上传附件")) |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | const state = reactive<dataState>({ |
| | | title: '', |
| | | disabled: true, |
| | |
| | | judgePicturePath: [] |
| | | }, |
| | | jsaFormRules: { |
| | | judgeRecord: [{ required: true, message: '请填写jsa风险研判结论', trigger: 'blur' }] |
| | | judgeRecord: [{ required: true, message: '请填写jsa风险研判结论', trigger: 'blur' }], |
| | | judgePicturePath: [{ required: true,validator: checkFile, trigger: 'blur' }] |
| | | }, |
| | | fileList: [], |
| | | imgLimit: 3, |
| | |
| | | getReport, |
| | | submitApproveRule, |
| | | showReportDialog, |
| | | checkFile, |
| | | handlePreview, |
| | | getUploadUrl, |
| | | upload, |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <!-- <div class="home-container">--> |
| | | <el-dialog v-model="showDialog" :title="title" @close="clearFile" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :disabled="isDisabled" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- <el-row>--> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="最终审批人" prop="lastApprover">--> |
| | | <!-- <el-select v-model="form.lastApprover" filterable clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in lists.workerList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.username"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" v-throttle plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | <el-button v-if="title == '修改'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">提交修改</el-button> |
| | | <el-button v-if="title == '续票'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">一键续票</el-button> |
| | | </div> |
| | | <el-dialog v-model="qpVisible" @open="startAdd"> |
| | | <el-form :model="qpForm" label-width="170px" ref="qpFormRef" :rules="qpFormRules"> |
| | |
| | | <img w-full :src="dialogImageUrl" alt="Preview Image" /> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </div> |
| | | <!-- </div>--> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | |
| | | interface stateType { |
| | | showDialog: boolean |
| | | form: Object, |
| | | isDisabled: boolean |
| | | title: string |
| | | qpForm: Object, |
| | | equipmentDialog: boolean, |
| | | qpVisible: boolean |
| | |
| | | props1:{}, |
| | | depProps:{}, |
| | | casProps:{} |
| | | cas2Props:{} |
| | | safetyMeasureBasicList: [], |
| | | fileList: Array<file>, |
| | | uploadUrl: string, |
| | |
| | | qpVisible: false, |
| | | safetyMeasureBasicList: [], |
| | | zyList: [], |
| | | isDisabled: false, |
| | | title: '修改', |
| | | form: { |
| | | id: null, |
| | | workType: 9, |
| | |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | | cas2Props: { |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | casProps: { |
| | | expandTrigger: 'hover', |
| | |
| | | getBasicData() |
| | | }); |
| | | |
| | | const openDialog = (row)=>{ |
| | | const openDialog = (row,type)=>{ |
| | | state.zyList = props.lists.spList.opList |
| | | getBasicData() |
| | | Object.keys(state.form).forEach(key => { |
| | |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key] |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.operatorUids = row.operatorList.map(i=>{ |
| | | if(i.certExpiredAt && i.certExpiredAt !==''){ |
| | | return [i.userId,i.certificate + ',' + i.certExpiredAt] |
| | | }else{ |
| | | return [i.userId] |
| | | } |
| | | }) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | |
| | | state.form.workDepIds = row.workDepList.map(i=>i.workDepId) |
| | | }else{ |
| | | state.form.workDepIds.push(row.workDepId) |
| | | } |
| | | if(type == 'edit'){ |
| | | state.isDisabled = false |
| | | state.title = '修改' |
| | | }else{ |
| | | if(!state.form.id){ |
| | | state.form.id = row.workApplyId |
| | | } |
| | | state.isDisabled = true |
| | | state.title = '续票' |
| | | } |
| | | getWorkerList() |
| | | state.showDialog = true |
| | |
| | | } |
| | | |
| | | const getWorkerList = ()=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | |
| | | const getSelected = ()=>{ |
| | |
| | | return index === 0; |
| | | } |
| | | |
| | | const singleSelect=(value,type)=>{ |
| | | let selected = value |
| | | if(selected.length>1){ |
| | | const temp = [] |
| | | for(let i of selected){ |
| | | const index = temp.findIndex(item => item[0] === i[0]); |
| | | if (index !== -1) { |
| | | temp[index] = i |
| | | }else{ |
| | | temp.push(i) |
| | | } |
| | | } |
| | | if(type == '作业人'){state.form.operatorUids = JSON.parse(JSON.stringify(temp))} |
| | | // if(type == '分析人'){state.form.analystUids = temp} |
| | | if(type == '监护人'){state.form.guardianUids = temp} |
| | | if(type == '确认人'){state.form.safetyMeasureUids = temp} |
| | | if(type == '结束人'){state.form.startOrEndUids = temp} |
| | | } |
| | | } |
| | | |
| | | const transformArr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | certificate: '', |
| | | certExpiredAt: '', |
| | | certTypeName: '' |
| | | } |
| | | } |
| | | |
| | | const singleSelect=(value,type)=>{ |
| | | let selected = value |
| | | if(selected.length>1){ |
| | | const temp = [] |
| | | for(let i of selected){ |
| | | const index = temp.findIndex(item => item[0] === i[0]); |
| | | if (index !== -1) { |
| | | temp[index] = i |
| | | }else{ |
| | | temp.push(i) |
| | | } |
| | | } |
| | | if(type == '作业人'){state.form.operatorUids = temp} |
| | | if(type == '监护人'){state.form.guardianUids = temp} |
| | | if(type == '确认人'){state.form.safetyMeasureUids = temp} |
| | | if(type == '结束人'){state.form.startOrEndUids = temp} |
| | | } |
| | | } |
| | | |
| | |
| | | state.form.workDetail.sketchMapPath = state.form.workDetail.sketchMapPath.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUids = transform2Arr(data.acceptUids) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modOpenApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }) |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.sketchMapPath = [] |
| | | state.fileList = [] |
| | | state.form.workDetail.qpDetailList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.sketchMapPath = state.form.workDetail.sketchMapPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | if(state.title == '修改'){ |
| | | const res = await workApplyApi().modOpenApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }) |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.sketchMapPath = [] |
| | | state.fileList = [] |
| | | state.form.workDetail.qpDetailList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.sketchMapPath = state.form.workDetail.sketchMapPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | }else{ |
| | | const res = await workApplyApi().renewalOpenJob(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '续票成功!' |
| | | }) |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.sketchMapPath = [] |
| | | state.fileList = [] |
| | | state.form.workDetail.qpDetailList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.sketchMapPath = state.form.workDetail.sketchMapPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } |
| | | } else { |
| | | ElMessage({ |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <!-- <div class="home-container">--> |
| | | <el-dialog v-model="showDialog" :title="title" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :disabled="isDisabled" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" v-throttle plain @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | <el-button v-if="title == '修改'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">提交修改</el-button> |
| | | <el-button v-if="title == '续票'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">一键续票</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | <!-- </div>--> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | |
| | | import {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | isDisabled: boolean |
| | | title: string |
| | | workLevelList: Array<any>, |
| | | equipmentDialog: boolean, |
| | | showDialog: boolean, |
| | | props1:{}, |
| | | depProps:{}, |
| | | cas2Props:{} |
| | | safetyMeasureBasicList: [], |
| | | zyList: [] |
| | | fileList: Array<file>, |
| | |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | zyList: [], |
| | | isDisabled: false, |
| | | title: '修改', |
| | | form: { |
| | | id: null, |
| | | workType: 8, |
| | |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | | cas2Props: { |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | fileList: [], |
| | | imgLimit: 3, |
| | | uploadUrl: '', |
| | |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getWorkerList = ()=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | |
| | | const openDialog = (row)=>{ |
| | | const openDialog = (row,type)=>{ |
| | | clearFile() |
| | | state.zyList = props.lists.spList.opList |
| | | getBasicData() |
| | |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.operatorUids = row.operatorList.map(i=>{ |
| | | if(i.certExpiredAt && i.certExpiredAt !==''){ |
| | | return [i.userId,i.certificate + ',' + i.certExpiredAt] |
| | | }else{ |
| | | return [i.userId] |
| | | } |
| | | }) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | |
| | | })) |
| | | state.form.acceptUids = row.acceptUserList.map(i=>i.userId) |
| | | state.form.startOrEndUids = row.startOrEndList.map(i=>i.userId) |
| | | // state.form.lastApprover = row.lastApprover.userId |
| | | state.fileList = row.workDetail.bpLocationMapPath.split(',').map(item => { |
| | | return { |
| | | url: item, |
| | |
| | | } |
| | | }) |
| | | state.form.workDetail.bpLocationMapPath = row.workDetail.bpLocationMapPath.split(',').map(item => item.match(/specialWork9step\/(.*?)\?/)[1]) |
| | | console.log(state.fileList,state.form.workDetail.bpLocationMapPath,'854') |
| | | if(row.workDepList && row.workDepList.length>0){ |
| | | state.form.workDepIds = row.workDepList.map(i=>i.workDepId) |
| | | }else{ |
| | | state.form.workDepIds.push(row.workDepId) |
| | | } |
| | | if(type == 'edit'){ |
| | | state.isDisabled = false |
| | | state.title = '修改' |
| | | }else{ |
| | | if(!state.form.id){ |
| | | state.form.id = row.workApplyId |
| | | } |
| | | state.isDisabled = true |
| | | state.title = '续票' |
| | | } |
| | | getWorkerList() |
| | | state.showDialog = true |
| | |
| | | return index === 0; |
| | | } |
| | | |
| | | const singleSelect=(value,type)=>{ |
| | | let selected = value |
| | | if(selected.length>1){ |
| | | const temp = [] |
| | | for(let i of selected){ |
| | | const index = temp.findIndex(item => item[0] === i[0]); |
| | | if (index !== -1) { |
| | | temp[index] = i |
| | | }else{ |
| | | temp.push(i) |
| | | } |
| | | } |
| | | if(type == '作业人'){state.form.operatorUids = JSON.parse(JSON.stringify(temp))} |
| | | // if(type == '分析人'){state.form.analystUids = temp} |
| | | if(type == '监护人'){state.form.guardianUids = temp} |
| | | if(type == '确认人'){state.form.safetyMeasureUids = temp} |
| | | if(type == '结束人'){state.form.startOrEndUids = temp} |
| | | } |
| | | } |
| | | |
| | | const transformArr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | state.form.workDetail.bpLocationMapPath = state.form.workDetail.bpLocationMapPath.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUids = transform2Arr(data.acceptUids) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modPlateApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.bpLocationMapPath = [] |
| | | state.fileList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.bpLocationMapPath = state.form.workDetail.bpLocationMapPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | if(state.title == '修改'){ |
| | | const res = await workApplyApi().modPlateApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.bpLocationMapPath = [] |
| | | state.fileList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.bpLocationMapPath = state.form.workDetail.bpLocationMapPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | }else{ |
| | | const res = await workApplyApi().renewalBlindPlatePlugging(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '续票成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | state.form.workDetail.bpLocationMapPath = [] |
| | | state.fileList = [] |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.bpLocationMapPath = state.form.workDetail.bpLocationMapPath.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | singleSelect, |
| | | renderMenu, |
| | | getBasicData, |
| | | getWorkerList, |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <!-- <div class="home-container">--> |
| | | <el-dialog v-model="showDialog" :title="title" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :disabled="isDisabled" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">提交申报</el-button> |
| | | <el-button v-if="title == '修改'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">提交修改</el-button> |
| | | <el-button v-if="title == '续票'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">一键续票</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | <!-- </div>--> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | |
| | | import {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | isDisabled: boolean |
| | | title: string |
| | | equipmentDialog: boolean, |
| | | showDialog: boolean |
| | | props1:{}, |
| | | depProps:{}, |
| | | cas2Props:{} |
| | | safetyMeasureBasicList: [] |
| | | zyList: [] |
| | | tabLoading: boolean |
| | |
| | | showDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | zyList: [], |
| | | isDisabled: false, |
| | | title: '修改', |
| | | form: { |
| | | id: null, |
| | | workType: 7, |
| | |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | | cas2Props: { |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | } |
| | | }) |
| | | const ruleFormRef = ref<FormInstance>() |
| | |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getWorkerList = ()=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | const openDialog = (row)=>{ |
| | | const openDialog = (row,type)=>{ |
| | | clearFile() |
| | | console.log(state.form.operatorUids,'ops1') |
| | | state.zyList = props.lists.spList.opList |
| | | getBasicData() |
| | | Object.keys(state.form).forEach(key => { |
| | |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | console.log(row.operatorList,'list') |
| | | state.form.operatorUids = row.operatorList.map(i=>{ |
| | | if(i.certExpiredAt && i.certExpiredAt !==''){ |
| | | return [i.userId,i.certificate + ',' + i.certExpiredAt] |
| | | }else{ |
| | | return [i.userId] |
| | | } |
| | | }) |
| | | console.log(state.form.operatorUids,'ops2') |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | |
| | | state.form.workDepIds = row.workDepList.map(i=>i.workDepId) |
| | | }else{ |
| | | state.form.workDepIds.push(row.workDepId) |
| | | } |
| | | if(type == 'edit'){ |
| | | state.isDisabled = false |
| | | state.title = '修改' |
| | | }else{ |
| | | if(!state.form.id){ |
| | | state.form.id = row.workApplyId |
| | | } |
| | | state.isDisabled = true |
| | | state.title = '续票' |
| | | } |
| | | getWorkerList() |
| | | state.showDialog = true |
| | |
| | | return index === 0; |
| | | } |
| | | |
| | | const singleSelect=(value,type)=>{ |
| | | let selected = value |
| | | if(selected.length>1){ |
| | | const temp = [] |
| | | for(let i of selected){ |
| | | const index = temp.findIndex(item => item[0] === i[0]); |
| | | if (index !== -1) { |
| | | temp[index] = i |
| | | }else{ |
| | | temp.push(i) |
| | | } |
| | | } |
| | | if(type == '作业人'){state.form.operatorUids = JSON.parse(JSON.stringify(temp))} |
| | | // if(type == '分析人'){state.form.analystUids = temp} |
| | | if(type == '监护人'){state.form.guardianUids = temp} |
| | | if(type == '确认人'){state.form.safetyMeasureUids = temp} |
| | | if(type == '结束人'){state.form.startOrEndUids = temp} |
| | | } |
| | | } |
| | | |
| | | const transformArr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const transform2Arr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | |
| | | state.form.workDetail.electricityUids = state.form.workDetail.electricityUids.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUids = transform2Arr(data.acceptUids) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modPowerApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.electricityUids = state.form.workDetail.electricityUids.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | if(state.title == '修改'){ |
| | | const res = await workApplyApi().modPowerApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.electricityUids = state.form.workDetail.electricityUids.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | }else{ |
| | | const res = await workApplyApi().renewalTemporaryPower(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '续票成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.workDetail.electricityUids = state.form.workDetail.electricityUids.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | singleSelect, |
| | | renderMenu, |
| | | getBasicData, |
| | | getWorkerList, |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-dialog v-model="showDialog" title="修改申报" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :rules="applyRules" ref="ruleFormRef"> |
| | | <!-- <div class="home-container">--> |
| | | <el-dialog v-model="showDialog" :title="title" @close="clearFile()" width="80%" :close-on-click-modal="false"> |
| | | <el-form :model="form" label-width="180px" :disabled="isDisabled" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)" v-throttle>提交申报</el-button> |
| | | <el-button v-if="title == '修改'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">提交修改</el-button> |
| | | <el-button v-if="title == '续票'" type="primary" size="large" plain v-throttle @click="submitForm(ruleFormRef)">一键续票</el-button> |
| | | </div> |
| | | <work-select ref="workSelectRef" @refreshWorks="getSelected()"></work-select> |
| | | </el-dialog> |
| | | </div> |
| | | <!-- </div>--> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | |
| | | import {userApi} from "/@/api/systemManage/user"; |
| | | interface stateType { |
| | | form: Object, |
| | | isDisabled: boolean |
| | | title: string |
| | | equipmentDialog: boolean, |
| | | showDialog: boolean |
| | | props1:{}, |
| | | depProps:{}, |
| | | cas2Props: {} |
| | | safetyMeasureBasicList: [] |
| | | zyList: [] |
| | | tabLoading: boolean |
| | |
| | | equipmentDialog: false, |
| | | safetyMeasureBasicList: [], |
| | | zyList: [], |
| | | isDisabled: false, |
| | | title: '修改', |
| | | form: { |
| | | id: null, |
| | | workType: 2, |
| | |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | } |
| | | }, |
| | | cas2Props: { |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getWorkerList = ()=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | | } |
| | | |
| | | const openDialog = (row)=>{ |
| | | const openDialog = (row,type)=>{ |
| | | clearFile() |
| | | state.zyList = props.lists.spList.opList |
| | | getBasicData() |
| | |
| | | state.form[key] = JSON.parse(JSON.stringify(row))[key]; |
| | | } |
| | | }) |
| | | state.form.operatorUids = row.operatorList.map(i=>i.userId) |
| | | state.form.operatorUids = row.operatorList.map(i=>{ |
| | | if(i.certExpiredAt && i.certExpiredAt !==''){ |
| | | return [i.userId,i.certificate + ',' + i.certExpiredAt] |
| | | }else{ |
| | | return [i.userId] |
| | | } |
| | | }) |
| | | state.form.headUids = row.headList.map(i=>i.userId) |
| | | state.form.analystUids = row.analystList.map(i=>i.userId) |
| | | state.form.guardianUids = row.guardianList.map(i=>i.userId) |
| | |
| | | state.form.workDepIds = row.workDepList.map(i=>i.workDepId) |
| | | }else{ |
| | | state.form.workDepIds.push(row.workDepId) |
| | | } |
| | | if(type == 'edit'){ |
| | | state.isDisabled = false |
| | | state.title = '修改' |
| | | }else{ |
| | | if(!state.form.id){ |
| | | state.form.id = row.workApplyId |
| | | } |
| | | state.isDisabled = true |
| | | state.title = '续票' |
| | | } |
| | | getWorkerList() |
| | | state.showDialog = true |
| | |
| | | return index === 0; |
| | | } |
| | | |
| | | const singleSelect=(value,type)=>{ |
| | | let selected = value |
| | | if(selected.length>1){ |
| | | const temp = [] |
| | | for(let i of selected){ |
| | | const index = temp.findIndex(item => item[0] === i[0]); |
| | | if (index !== -1) { |
| | | temp[index] = i |
| | | }else{ |
| | | temp.push(i) |
| | | } |
| | | } |
| | | if(type == '作业人'){state.form.operatorUids = JSON.parse(JSON.stringify(temp))} |
| | | // if(type == '分析人'){state.form.analystUids = temp} |
| | | if(type == '监护人'){state.form.guardianUids = temp} |
| | | if(type == '确认人'){state.form.safetyMeasureUids = temp} |
| | | if(type == '结束人'){state.form.startOrEndUids = temp} |
| | | } |
| | | } |
| | | |
| | | const transformArr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const transform2Arr = (arr: Array<any>)=>{ |
| | | return arr.map((i)=>{ |
| | | return { |
| | |
| | | // } |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | |
| | | data.startOrEndUids = transform2Arr(data.startOrEndUids) |
| | | data.acceptUids = transform2Arr(data.acceptUids) |
| | | data.lastApprover = transform2Obj(data.lastApprover) |
| | | const res = await workApplyApi().modSpaceApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | if(state.title == '修改'){ |
| | | const res = await workApplyApi().modSpaceApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | }else{ |
| | | const res = await workApplyApi().renewalConfinedspace(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '续票成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | state.form.guardianUids = [] |
| | | state.form.involveOtherWork = [] |
| | | getBasicData() |
| | | clearFile() |
| | | context.emit('refresh') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | // state.form.involveOtherWork = state.form.involveOtherWork.split(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.split(',') |
| | | } |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | singleSelect, |
| | | renderMenu, |
| | | getBasicData, |
| | | getWorkerList, |
| | |
| | | getListByPage(); |
| | | getAllDepartment() |
| | | spWorker() |
| | | getOpList() |
| | | getAll() |
| | | getAllDevice() |
| | | getAllRisks() |
| | |
| | | |
| | | const openEdit = (row)=>{ |
| | | if(row.workType == 1){ |
| | | fireRef.value.openDialog(row) |
| | | fireRef.value.openDialog(row,'edit') |
| | | } |
| | | if(row.workType == 2){ |
| | | spaceRef.value.openDialog(row) |
| | | spaceRef.value.openDialog(row,'edit') |
| | | } |
| | | if(row.workType == 3){ |
| | | hoistRef.value.openDialog(row) |
| | | hoistRef.value.openDialog(row,'edit') |
| | | } |
| | | if(row.workType == 4){ |
| | | groundRef.value.openDialog(row) |
| | | groundRef.value.openDialog(row,'edit') |
| | | } |
| | | if(row.workType == 5){ |
| | | brokenRef.value.openDialog(row) |
| | | brokenRef.value.openDialog(row,'edit') |
| | | } |
| | | if(row.workType == 6){ |
| | | heightRef.value.openDialog(row) |
| | | heightRef.value.openDialog(row,'edit') |
| | | } |
| | | if(row.workType == 7){ |
| | | powerRef.value.openDialog(row) |
| | | powerRef.value.openDialog(row,'edit') |
| | | } |
| | | if(row.workType == 8){ |
| | | plateRef.value.openDialog(row) |
| | | plateRef.value.openDialog(row,'edit') |
| | | } |
| | | if(row.workType == 9){ |
| | | openRef.value.openDialog(row) |
| | | openRef.value.openDialog(row,'edit') |
| | | } |
| | | } |
| | | |
| | | const spWorker = async ()=>{ |
| | | for(let id of ['17','18','19']){ |
| | | 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)) |
| | |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | 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 |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | state.departmentList = JSON.parse(JSON.stringify(res.data.data)) |
| | | recursion(state.departmentList); |
| | | 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) |
| | | 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', |
| | |
| | | } |
| | | }; |
| | | const getOtherWork = async () => { |
| | | let res = await workApplyApi().getOtherWork({workPermitNo: '',workType: null}); |
| | | let res = await workApplyApi().getOtherWork({pageSize: 999, pageIndex: 1, searchParams: {workPermitNo: '', workType: null}}) |
| | | if (res.data.code === '200') { |
| | | state.lists.otherWorks = JSON.parse(JSON.stringify(res.data.data)) |
| | | } else { |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | } |
| | | }, |
| | | cas2Props: { |
| | | expandTrigger: 'hover', |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: false, |
| | | lazy: true, |
| | | async lazyLoad(node, resolve){ |
| | | const { value, level } = node |
| | | let nodes = [] |
| | | if(level == 0){ |
| | | nodes = props.lists.spList.opList |
| | | }else{ |
| | | let res = await userApi().getCtf({uid: value}) |
| | | if(res.data.code == 200){ |
| | | nodes = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | nodes=nodes.map(item => ({ |
| | | uid: item.certNo +','+ item.certExpiredAt+','+item.certTypeName, |
| | | realName: node.label + '(' +item.certTypeName +' ' + item.certExpiredAt + ')', |
| | | leaf: level >= 1 |
| | | })) |
| | | resolve(nodes) |
| | | } |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | cas3Props: { |
| | | expandTrigger: 'hover', |
| | |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getWorkerList = (val)=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | const getWorkerList = ()=>{ |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | state.form.workDetail.bcPath = state.form.workDetail.bcPath.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted, onUpdated } from 'vue'; |
| | | import {toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted, onUpdated, nextTick} from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | |
| | | } |
| | | }, |
| | | cas2Props: { |
| | | expandTrigger: 'hover', |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: false, |
| | | lazy: true, |
| | | async lazyLoad(node, resolve){ |
| | | const { value, level } = node |
| | | let nodes = [] |
| | | if(level == 0){ |
| | | nodes = props.lists.spList.opList |
| | | }else{ |
| | | let res = await userApi().getCtf({uid: value}) |
| | | if(res.data.code == 200){ |
| | | nodes = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | nodes=nodes.map(item => ({ |
| | | uid: item.certNo +','+ item.certExpiredAt+','+item.certTypeName, |
| | | realName: node.label + '(' +item.certTypeName +' ' + item.certExpiredAt + ')', |
| | | leaf: level >= 1 |
| | | })) |
| | | resolve(nodes) |
| | | } |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | cas3Props: { |
| | | expandTrigger: 'hover', |
| | |
| | | } |
| | | } |
| | | nodes=nodes.map(item => ({ |
| | | uid: item.certNo +','+ item.certExpiredAt+','+item.certTypeName, |
| | | realName: node.label + '(' +item.certTypeName +' ' + item.certExpiredAt + ')', |
| | | uid: item.certNo +','+ item.certExpiredAt, |
| | | realName: '(' +item.certTypeName +' ' + item.certExpiredAt + ')', |
| | | leaf: level >= 1 |
| | | })) |
| | | resolve(nodes) |
| | |
| | | getBasicData() |
| | | }) |
| | | |
| | | |
| | | onUpdated(()=>{ |
| | | console.log('false loading') |
| | | }) |
| | | |
| | | const getWorkerList = (val)=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | const getWorkerList = ()=>{ |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | |
| | | const openWorkSelect = ()=>{ |
| | |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | temp.push(i) |
| | | } |
| | | } |
| | | if(type == '作业人'){state.form.operatorUids = temp} |
| | | if(type == '作业人'){state.form.operatorUids = JSON.parse(JSON.stringify(temp))} |
| | | // if(type == '分析人'){state.form.analystUids = temp} |
| | | if(type == '监护人'){state.form.guardianUids = temp} |
| | | if(type == '确认人'){state.form.safetyMeasureUids = temp} |
| | | if(type == '结束人'){state.form.startOrEndUids = temp} |
| | | console.log(value,state.form.operatorUids,55) |
| | | } |
| | | } |
| | | |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | console.log(state.form.operatorUids,666) |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | |
| | | return item |
| | | }) |
| | | data.workDetail.workMethod = data.workDetail.methodList.join(',') |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | // data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" multiple filterable clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <div class="el-upload__tip">上传jpg/png图片尺寸小于2M,最多可上传3张</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容签字人" prop="workDetail.signUid"> |
| | | <el-select v-model="form.workDetail.signUid" filterable clearable> |
| | | <el-option |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="签字人" prop="workDetail.signUid"> |
| | | <el-select v-model="form.workDetail.signUid" filterable clearable> |
| | | <el-option |
| | | v-for="item in lists.workerList" |
| | | :key="item.uid" |
| | | :label="item.username" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-row>--> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="作业内容签字人" prop="workDetail.signUid">--> |
| | | <!-- <el-select v-model="form.workDetail.signUid" filterable clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in lists.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="lastApprover">--> |
| | | <!-- <el-select v-model="form.lastApprover" filterable clearable>--> |
| | |
| | | <!-- <el-cascader style="width: 100%" v-model="form.lastApprover" :options="lists.workerList" :props="cas4Props" filterable :show-all-levels="false"/>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | </el-row> |
| | | <!-- </el-row>--> |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | |
| | | } |
| | | }, |
| | | cas2Props: { |
| | | expandTrigger: 'hover', |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: false, |
| | | lazy: true, |
| | | async lazyLoad(node, resolve){ |
| | | const { value, level } = node |
| | | let nodes = [] |
| | | if(level == 0){ |
| | | nodes = props.lists.spList.opList |
| | | }else{ |
| | | let res = await userApi().getCtf({uid: value}) |
| | | if(res.data.code == 200){ |
| | | nodes = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | nodes=nodes.map(item => ({ |
| | | uid: item.certNo +','+ item.certExpiredAt+','+item.certTypeName, |
| | | realName: node.label + '(' +item.certTypeName +' ' + item.certExpiredAt + ')', |
| | | leaf: level >= 1 |
| | | })) |
| | | resolve(nodes) |
| | | } |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | cas3Props: { |
| | | expandTrigger: 'hover', |
| | |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | |
| | | const getWorkerList = (val)=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | const getWorkerList = ()=>{ |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | |
| | | const getSelected = ()=>{ |
| | |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | state.form.workDetail.gbPath = state.form.workDetail.gbPath.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | } |
| | | }, |
| | | cas2Props: { |
| | | expandTrigger: 'hover', |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: false, |
| | | lazy: true, |
| | | async lazyLoad(node, resolve){ |
| | | const { value, level } = node |
| | | let nodes = [] |
| | | if(level == 0){ |
| | | nodes = props.lists.spList.opList |
| | | }else{ |
| | | let res = await userApi().getCtf({uid: value}) |
| | | if(res.data.code == 200){ |
| | | nodes = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | nodes=nodes.map(item => ({ |
| | | uid: item.certNo +','+ item.certExpiredAt+','+item.certTypeName, |
| | | realName: node.label + '(' +item.certTypeName +' ' + item.certExpiredAt + ')', |
| | | leaf: level >= 1 |
| | | })) |
| | | resolve(nodes) |
| | | } |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | cas3Props: { |
| | | expandTrigger: 'hover', |
| | |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | |
| | | const getWorkerList = (val)=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | const getWorkerList = ()=>{ |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | |
| | | const getSelected = ()=>{ |
| | |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | // } |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | } |
| | | }, |
| | | cas2Props: { |
| | | expandTrigger: 'hover', |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: false, |
| | | lazy: true, |
| | | async lazyLoad(node, resolve){ |
| | | const { value, level } = node |
| | | let nodes = [] |
| | | if(level == 0){ |
| | | nodes = props.lists.spList.opList |
| | | }else{ |
| | | let res = await userApi().getCtf({uid: value}) |
| | | if(res.data.code == 200){ |
| | | nodes = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | nodes=nodes.map(item => ({ |
| | | uid: item.certNo +','+ item.certExpiredAt+','+item.certTypeName, |
| | | realName: node.label + '(' +item.certTypeName +' ' + item.certExpiredAt + ')', |
| | | leaf: level >= 1 |
| | | })) |
| | | resolve(nodes) |
| | | } |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | cas3Props: { |
| | | expandTrigger: 'hover', |
| | |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | |
| | | const getWorkerList = (val)=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | const getWorkerList = ()=>{ |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | |
| | | const getSelected = ()=>{ |
| | |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | state.form.workDetail.solicitorUids = state.form.workDetail.solicitorUids.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | props1:{}, |
| | | depProps:{}, |
| | | casProps:{} |
| | | cas2Props:{} |
| | | safetyMeasureBasicList: [], |
| | | fileList: Array<file>, |
| | | uploadUrl: string, |
| | |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | emitPath: false |
| | | }, |
| | | cas2Props: { |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | casProps: { |
| | | expandTrigger: 'hover', |
| | |
| | | state.form.workDetail.qpDetailList.splice(index,1) |
| | | } |
| | | |
| | | const getWorkerList = (val)=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | const getWorkerList = ()=>{ |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | |
| | | const getSelected = ()=>{ |
| | |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | state.form.workDetail.sketchMapPath = state.form.workDetail.sketchMapPath.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | } |
| | | }, |
| | | cas2Props: { |
| | | expandTrigger: 'hover', |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: false, |
| | | lazy: true, |
| | | async lazyLoad(node, resolve){ |
| | | const { value, level } = node |
| | | let nodes = [] |
| | | if(level == 0){ |
| | | nodes = props.lists.spList.opList |
| | | }else{ |
| | | let res = await userApi().getCtf({uid: value}) |
| | | if(res.data.code == 200){ |
| | | nodes = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | nodes=nodes.map(item => ({ |
| | | uid: item.certNo +','+ item.certExpiredAt+','+item.certTypeName, |
| | | realName: node.label + '(' +item.certTypeName +' ' + item.certExpiredAt + ')', |
| | | leaf: level >= 1 |
| | | })) |
| | | resolve(nodes) |
| | | } |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | cas3Props: { |
| | | expandTrigger: 'hover', |
| | |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getWorkerList = (val)=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | const getWorkerList = ()=>{ |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | state.form.workDetail.bpLocationMapPath = state.form.workDetail.bpLocationMapPath.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | | data.safetyMeasureUids = transform2Arr(data.safetyMeasureUids) |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | } |
| | | }, |
| | | cas2Props: { |
| | | expandTrigger: 'hover', |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: false, |
| | | lazy: true, |
| | | async lazyLoad(node, resolve){ |
| | | const { value, level } = node |
| | | let nodes = [] |
| | | if(level == 0){ |
| | | nodes = props.lists.spList.opList |
| | | }else{ |
| | | let res = await userApi().getCtf({uid: value}) |
| | | if(res.data.code == 200){ |
| | | nodes = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | nodes=nodes.map(item => ({ |
| | | uid: item.certNo +','+ item.certExpiredAt+','+item.certTypeName, |
| | | realName: node.label + '(' +item.certTypeName +' ' + item.certExpiredAt + ')', |
| | | leaf: level >= 1 |
| | | })) |
| | | resolve(nodes) |
| | | } |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | cas3Props: { |
| | | expandTrigger: 'hover', |
| | |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getWorkerList = (val)=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | const getWorkerList = ()=>{ |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | state.form.workDetail.electricityUids = state.form.workDetail.electricityUids.join(',') |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" filterable multiple clearable> |
| | | <el-option |
| | | v-for="item in zyList" |
| | | :key="item.uid" |
| | | :label="item.realName" |
| | | :value="item.uid" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-cascader style="width: 100%" v-model="form.operatorUids" :options="lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/>--> |
| | | <!-- <el-select v-model="form.operatorUids" filterable multiple clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in zyList"--> |
| | | <!-- :key="item.uid"--> |
| | | <!-- :label="item.realName"--> |
| | | <!-- :value="item.uid"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <el-cascader style="width: 100%" v-model="form.operatorUids" :options="zyList?zyList:lists.spList.opList" :props="cas2Props" @change="singleSelect($event,'作业人')" filterable :show-all-levels="false"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | } |
| | | }, |
| | | cas2Props: { |
| | | expandTrigger: 'hover', |
| | | value: 'uid', |
| | | label: 'realName', |
| | | multiple: true, |
| | | checkStrictly: false, |
| | | lazy: true, |
| | | async lazyLoad(node, resolve){ |
| | | const { value, level } = node |
| | | let nodes = [] |
| | | if(level == 0){ |
| | | nodes = props.lists.spList.opList |
| | | }else{ |
| | | let res = await userApi().getCtf({uid: value}) |
| | | if(res.data.code == 200){ |
| | | nodes = res.data.data |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }) |
| | | } |
| | | } |
| | | nodes=nodes.map(item => ({ |
| | | uid: item.certNo +','+ item.certExpiredAt+','+item.certTypeName, |
| | | realName: node.label + '(' +item.certTypeName +' ' + item.certExpiredAt + ')', |
| | | leaf: level >= 1 |
| | | })) |
| | | resolve(nodes) |
| | | } |
| | | checkStrictly: true, |
| | | children: 'certList' |
| | | }, |
| | | cas3Props: { |
| | | expandTrigger: 'hover', |
| | |
| | | const openWorkSelect = ()=>{ |
| | | workSelectRef.value.openDialog(state.form.involveOtherWork) |
| | | } |
| | | const getWorkerList = (val)=>{ |
| | | const filteredList = props.lists.spList.opList.filter(i => state.form.workDepIds.includes(i.depId)); |
| | | const getWorkerList = ()=>{ |
| | | let idList:Array<any> = [] |
| | | for(let i of state.form.workDepIds){ |
| | | idList = idList.concat(getListFromDep(getIdListsFormDepId(props.lists.departList,i))) |
| | | } |
| | | const depLists = [...new Set(idList)] |
| | | const filteredList = props.lists.spList.opList.filter(i => depLists.includes(i.depId)); |
| | | if(filteredList && filteredList.length>0){ |
| | | state.zyList = filteredList |
| | | }else{ |
| | | state.zyList = props.lists.spList.opList |
| | | } |
| | | } |
| | | |
| | | const getListFromDep = (dep) =>{ |
| | | let depIds = [] |
| | | depIds.push(dep.depId) |
| | | if (Array.isArray(dep.children)) { |
| | | for (let child of dep.children) { |
| | | depIds = depIds.concat(getListFromDep(child)); |
| | | } |
| | | } |
| | | return depIds; |
| | | } |
| | | |
| | | const getIdListsFormDepId=(DepList:Array<any>,id:number)=>{ |
| | | for(const i of DepList){ |
| | | if(i.depId === id){ |
| | | return i |
| | | } |
| | | if(Array.isArray(i.children)){ |
| | | const node:any = getIdListsFormDepId(i.children,id) |
| | | if(node){ |
| | | return node |
| | | } |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const getSelected = ()=>{ |
| | | state.form.involveOtherWork = workSelectRef.value.selected |
| | |
| | | return arr.map((i)=>{ |
| | | return { |
| | | uid: i[0], |
| | | certificate: i[1].split(',')[0], |
| | | certExpiredAt: i[1].split(',')[1], |
| | | certTypeName: i[1].split(',')[2] |
| | | certificate: i[1]?i[1].split(',')[0]:'', |
| | | certExpiredAt: i[1]?i[1].split(',')[1]:'', |
| | | certTypeName: '' |
| | | } |
| | | }) |
| | | } |
| | |
| | | // } |
| | | state.form.riskIdentification = state.form.riskIdentification.join(',') |
| | | const {depIdList,...data} = state.form |
| | | data.operatorUids = transform2Arr(data.operatorUids) |
| | | data.operatorUids = transformArr(data.operatorUids) |
| | | data.headUids = transform2Arr(data.headUids) |
| | | // data.analystUids = transformArr(data.analystUids) |
| | | data.guardianUids = transform2Arr(data.guardianUids) |
| | |
| | | <el-row style="margin-bottom: 20px"> |
| | | <div class="basic-line" style="display:flex;white-space:nowrap;line-height: 40px"> |
| | | <span>作业编号:</span> |
| | | <el-input v-model="searPara.workPermitNo" placeholder="作业编号"/> |
| | | <el-input v-model="searPara.searchParams.workPermitNo" placeholder="作业编号"/> |
| | | </div> |
| | | <div class="basic-line"> |
| | | <span>作业类型:</span> |
| | | <el-select v-model="searPara.workType"> |
| | | <el-select v-model="searPara.searchParams.workType"> |
| | | <el-option |
| | | v-for="item in workType" |
| | | :key="item.value" |
| | |
| | | </div> |
| | | </el-row> |
| | | <el-table ref="TableRef" :data="otherWorks" style="width: 100%" border @selection-change="handleSelectionChange" :row-key="(row) => { return row.workApplyId }"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column type="selection" width="55" :reserve-selection="true"/> |
| | | <!-- <el-table-column type="index" label="序号" width="60" />--> |
| | | <el-table-column prop="workTypeDesc" label="作业类型" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="workLevelDesc" label="作业等级" show-overflow-tooltip></el-table-column> |
| | |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | </el-table> |
| | | <el-pagination style="margin-top: 20px;display: flex;justify-content: right" v-model:currentPage="searPara.pageIndex" v-model:page-size="searPara.pageSize" :page-sizes="[10]" small="false" background layout="total, sizes, prev, pager, next, jumper" :total="totalSize" @size-change="handleSizeChange" @current-change="handleCurrentChange" /> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="isShowDialog = !isShowDialog" size="default">取 消</el-button> |
| | |
| | | title: string |
| | | isShowDialog: boolean |
| | | searPara: object |
| | | totalSize: number |
| | | otherWorks: [] |
| | | workType: Array<any> |
| | | selected: Array<any> |
| | |
| | | title: '', |
| | | isShowDialog: false, |
| | | searPara: { |
| | | workPermitNo: '', |
| | | workType: null |
| | | pageSize: 10, |
| | | pageIndex: 1, |
| | | searchParams: { |
| | | workPermitNo: '', |
| | | workType: null |
| | | } |
| | | }, |
| | | totalSize: 0, |
| | | otherWorks: [], |
| | | selected: [], |
| | | workType: [ |
| | |
| | | }; |
| | | |
| | | const refreshTableSelection = (works) => { |
| | | state.selected = works |
| | | if (TableRef.value) { |
| | | for (let i = 0; i < state.otherWorks.length; i++) { |
| | | if (works.includes(state.otherWorks[i].workApplyId)){ |
| | |
| | | let res = await workApplyApi().getOtherWork(state.searPara); |
| | | if (res.data.code === '200') { |
| | | state.otherWorks = JSON.parse(JSON.stringify(res.data.data)) |
| | | state.totalSize = res.data.total |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | |
| | | const clearSearch = ()=>{ |
| | | state.searPara = { |
| | | workPermitNo: '', |
| | | workType: null |
| | | pageSize: 10, |
| | | pageIndex: 1, |
| | | searchParams: { |
| | | workPermitNo: '', |
| | | workType: null |
| | | } |
| | | } |
| | | getData() |
| | | } |
| | |
| | | } |
| | | |
| | | const onSubmit = ()=>{ |
| | | console.log(state.selected,'sel') |
| | | context.emit('refreshWorks') |
| | | state.selected = [] |
| | | clearSearch() |
| | | state.isShowDialog = false |
| | | } |
| | | |
| | | // 分页改变 |
| | | const handleSizeChange = (val: number) => { |
| | | state.searPara.pageSize = val; |
| | | getData() |
| | | }; |
| | | // 分页改变 |
| | | const handleCurrentChange = (val: number) => { |
| | | state.searPara.pageIndex = val; |
| | | getData() |
| | | }; |
| | | |
| | | // 页面加载时 |
| | | onMounted(() => {}); |
| | | return { |
| | | userRef, |
| | | TableRef, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | handleSelectionChange, |
| | | openDialog, |
| | | getData, |
| | |
| | | getAllDevice() |
| | | getOtherWork() |
| | | spWorker() |
| | | getOpList() |
| | | getAllRisks() |
| | | }); |
| | | |
| | |
| | | }; |
| | | |
| | | const spWorker = async ()=>{ |
| | | for(let id of ['17','18','19']){ |
| | | 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 == '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)) |
| | |
| | | } |
| | | } |
| | | |
| | | 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(); |
| | |
| | | |
| | | // 获取相关作业列表 |
| | | const getOtherWork = async () => { |
| | | let res = await workApplyApi().getOtherWork({workPermitNo: '',workType: null}); |
| | | 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)) |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column property="info" label="描述" show-overflow-tooltip width="200" align="center"/> |
| | | <el-table-column property="operatorUname" label="分析人" align="center"/> |
| | | <el-table-column property="operationTime" label="分析时间" width="180" align="center"/> |
| | | <el-table-column property="operatorUname" label="检查人" align="center"/> |
| | | <el-table-column property="operationTime" label="登记时间" width="180" align="center"/> |
| | | <!-- <el-table-column property="mcResultName" label="物资检查" width="180" align="center">--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <span :class="scope.row.mcResultName == '不合格' ? 'red': ''">{{ scope.row.mcResultName== null?'-':scope.row.mcResultName}}</span>--> |
| | |
| | | <!-- </div>--> |
| | | <div class="info"> |
| | | <div class="left-info"> |
| | | <template v-for="item in videoData.approvalDeviceList"> |
| | | <template v-for="item in videoData.workApprovalDeviceList"> |
| | | <iframe class="video-cont" :src="'http://36.108.169.10:8088/808gps/open/player/video.html?lang=zh&devIdno=' + item.deviceNo + '&&account=gtxh&password=000000'"></iframe> |
| | | </template> |
| | | <div class="chart-area"> |
| | |
| | | <el-table-column property="operationTime" label="检查填报时间" align="center"/> |
| | | <el-table-column property="checkContent" label="检查内容" align="center"/> |
| | | <el-table-column property="info" label="描述" align="center"/> |
| | | <el-table-column property="checkContent" label="是否合格" align="center"> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <span>{{scope.row.isGood == 0?'合格':'不合格'}}</span>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <el-table-column property="checkResultDesc" label="是否合格" align="center"/> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | |
| | | const recordRef = ref() |
| | | const openDialog = (row)=>{ |
| | | state.videoData = row |
| | | console.log(state.videoData.approvalDeviceList,'data') |
| | | state.title = row.workTypeDesc + '编号' + row.workPermitNo + '实时监测详情' |
| | | state.videoDetailDialog = true |
| | | } |
| | |
| | | <!-- </el-steps>--> |
| | | <div class="item" v-for="(item,index) in data" :key="index"> |
| | | <div class="marker"> |
| | | <div class="dot"></div> |
| | | <div class="dot" :class="item.operationTitle == '作业验收'?'greenDot':''"></div> |
| | | <div class="line"></div> |
| | | </div> |
| | | <div class="content"> |
| | | <div class="tit">{{item.operationTitle}}<span>{{index == data.length - 1 ? '[进行中]': '[已完成]'}}</span></div> |
| | | <div class="tit">{{item.operationTitle}}<span :class="item.operationTitle == '作业验收'?'green':''">{{item.operationTitle == '作业验收'?'[已完成]':(index == data.length - 1 ? '[进行中]': '[已完成]')}}</span></div> |
| | | <div>{{item.operationUtype}}:{{item.operationUname}}</div> |
| | | <div>操作时间:{{item.operationTime}}</div> |
| | | <div>操作内容:{{item.content}}</div> |
| | | <div>操作意见:{{item.approvalOpinions}}</div> |
| | | <div v-if="item.fileUrl" style="display: flex;align-items: flex-start">附件内容: |
| | | <el-image v-for="(i,index) in item.fileUrl.split(',')" :key="index" style="width: 150px; height: 150px;margin-right: 50px;margin-bottom: 20px" :src="i" fit="cover" /> |
| | | <el-image v-for="(i,index) in item.fileUrl.split(',')" :key="index" :preview-src-list="item.fileUrl.split(',')" :initial-index="0" style="width: 150px; height: 150px;margin-right: 50px;margin-bottom: 20px" :src="i" fit="cover" /> |
| | | </div> |
| | | <div v-if="item.signUrl" style="display: flex;align-items: flex-start">签字图片: |
| | | <el-image v-for="(i,index) in item.signUrl.split(',')" :key="index" style="width: 150px; height: 150px;margin-right: 50px;margin-bottom: 20px" :src="i" fit="cover" /> |
| | | <el-image v-for="(i,index) in item.signUrl.split(',')" :key="index" :preview-src-list="item.signUrl.split(',')" :initial-index="0" style="width: 150px; height: 150px;margin-right: 50px;margin-bottom: 20px" :src="i" fit="cover" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | .line{ |
| | | display: none; |
| | | } |
| | | .greenDot{ |
| | | background: #13ce66; |
| | | } |
| | | .tit{ |
| | | span{ |
| | | color: #409eff; |
| | | } |
| | | .green{ |
| | | color: #13ce66; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | </el-button> |
| | | </div> |
| | | <div class="topChart"> |
| | | <!-- <div class="chart-item">--> |
| | | <!-- <dv-border-box10 v-if="isFull==true" class="item-bg"></dv-border-box10>--> |
| | | <!-- <div class="chart-tit">--> |
| | | <!-- <span class="tit">各事业部关联作业分析</span>--> |
| | | <!-- <div class="filter-part">--> |
| | | <!-- <el-cascader :teleported="false" v-model="chartSearch2.depId" @change="changeDep2()" :options="departmentList" :props="casProps" :show-all-levels="false" size="small"/>--> |
| | | <!-- <el-select v-model="chartSearch2.type" size="small" :teleported="false" @change="changeType2()">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in workType1"--> |
| | | <!-- :key="item.id"--> |
| | | <!-- :label="item.name"--> |
| | | <!-- :value="item.id"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="chart" :id="slfx"></div>--> |
| | | <!-- </div>--> |
| | | <div class="chart-item"> |
| | | <dv-border-box10 v-if="isFull==true" class="item-bg"></dv-border-box10> |
| | | <div class="chart-tit"> |
| | |
| | | </el-radio-group> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="topChart">--> |
| | | <!-- <div class="chart-item">--> |
| | | <!-- <dv-border-box10 v-if="isFull==true" class="item-bg"></dv-border-box10>--> |
| | | <!-- <div class="chart-tit">--> |
| | | <!-- <span class="tit">关联作业趋势图</span>--> |
| | | <!-- <div class="filter-part filter-part2">--> |
| | | <!-- <el-cascader :teleported="false" v-model="chartSearch3.depId" @change="changeDep3()" :options="departmentList" :props="casProps" :show-all-levels="false" size="small"/>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="chart" :id="zyqs"></div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="chart-item">--> |
| | | <!-- <dv-border-box10 v-if="isFull==true" class="item-bg"></dv-border-box10>--> |
| | | <!-- <div class="chart-tit">--> |
| | | <!-- <span class="tit">作业警报记录</span>--> |
| | | <!-- <div class="filter-part">--> |
| | | <!-- <el-select :teleported="false" v-model="chartSearch4.days" size="small" @change="(value)=>changeTime4(value)">--> |
| | | <!-- <el-option label="近7天" :value="7"/>--> |
| | | <!-- <el-option label="近30天" :value="30"/>--> |
| | | <!-- <el-option label="近90天" :value="90"/>--> |
| | | <!-- <el-option label="近1年" :value="365"/>--> |
| | | <!-- </el-select>--> |
| | | <!-- <el-select :teleported="false" v-model="chartSearch4.workType" size="small" @change="changeType4()">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in workType1"--> |
| | | <!-- :key="item.id"--> |
| | | <!-- :label="item.name"--> |
| | | <!-- :value="item.id"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="chart">--> |
| | | <!-- <el-table ref="multipleTableRef" :data="warningData" style="width: 100%" stripe border :header-cell-style="{ background: '#fafafa' }">--> |
| | | <!-- <el-table-column property="operatorUname" label="姓名" align="center"/>--> |
| | | <!-- <el-table-column property="deptName" label="所属部门" align="center"/>--> |
| | | <!-- <el-table-column property="warningCount" label="异常报警次数" align="center"/>--> |
| | | <!-- </el-table>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div> |
| | | |
| | | <div class="homeCard"> |
| | | <dv-border-box10 v-if="isFull==true" class="item-bg"></dv-border-box10> |
| | | <el-row> |
| | |
| | | <span style="white-space: nowrap">作业票编号:</span> |
| | | <div class="grid-content topInfo"> |
| | | <el-input |
| | | v-model="searchParams.workPermitNo" |
| | | v-model.trim="searchParams.workPermitNo" |
| | | placeholder="请输入作业票编号" |
| | | size="small" |
| | | /> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="4" style="display:flex;align-items: center"> |
| | | <span style="white-space: nowrap">申请单位:</span> |
| | | <span style="white-space: nowrap">申请事业部:</span> |
| | | <div class="grid-content topInfo"> |
| | | <el-cascader :teleported="false" v-model="searchParams.applyDepId" @change="changeDep4()" :options="departmentList" :props="casProps" :show-all-levels="false" size="small"/> |
| | | <el-cascader :teleported="false" v-model="searchParams.seDepId" @change="changeDep4()" :options="depList" :props="casProps" :show-all-levels="false" size="small"/> |
| | | </div> |
| | | </el-col> |
| | | <el-button type="primary" style="margin-left: 20px" @click="searchRecord" size="small">查询</el-button> |
| | |
| | | </el-table-column> |
| | | <el-table-column property="workTypeDesc" label="作业类型" align="center"/> |
| | | <el-table-column property="workLevelDesc" label="作业等级" align="center"/> |
| | | <el-table-column property="abortReason" label="中止原因" align="center"> |
| | | <template #default="scope"> |
| | | <span>{{scope.row.abortReason?scope.row.abortReason:'--'}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column property="abortReason" label="中止原因" align="center">--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <span>{{scope.row.abortReason?scope.row.abortReason:'--'}}</span>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column property="workAllStatusDesc" label="作业状态" align="center"/> |
| | | <el-table-column fixed="right" label="操作" align="center" width="250"> |
| | | <template #default="scope"> |
| | |
| | | v-if="scope.row.workAllStatus == -1|| scope.row.workAllStatus == 1 || scope.row.workAllStatus == 3 || scope.row.workAllStatus == 7" |
| | | type="primary" size="small" :icon="VideoPlay" @click="openVideo(scope.row)">查看监控视频</el-button> |
| | | <el-button link type="primary" size="small" :icon="View" @click="viewRecord(scope.row.workApplyId)">查看记录</el-button> |
| | | <el-button v-if="(scope.row.workAllStatus == 3 || scope.row.workAllStatus == 4 || scope.row.workAllStatus == 5)&&!scope.row.renewalWorkApplyId" link type="primary" size="small" :icon="Edit" @click="continueRecord(scope.row)">一键续票</el-button> |
| | | <el-button link type="primary" size="small" :icon="View" @click="viewTicket(scope.row)">查看作业票</el-button> |
| | | <el-button link type="primary" size="small" :icon="Download" @click="downLoadTicket(scope.row)">导出作业票</el-button> |
| | | <!-- <el-button link type="primary" size="small" :icon="FolderChecked" @click="handleReview(scope.row)">验收</el-button>--> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-dialog v-model="dialogDetails" title="作业申请详情" center> |
| | | <!-- <fire v-if="dialogType == 1" :details = details></fire>--> |
| | | <!-- <space v-else-if="dialogType == 2" :details = details></space>--> |
| | |
| | | <!-- </el-dialog>--> |
| | | <video-detail ref="videoRef"></video-detail> |
| | | <Work-record ref="recordRef"></Work-record> |
| | | <fire-dialog ref="fireRef" :lists="lists" @refresh="getMydepList"></fire-dialog> |
| | | <plate-dialog ref="plateRef" :lists="lists" @refresh="getMydepList"></plate-dialog> |
| | | <space-dialog ref="spaceRef" :lists="lists" @refresh="getMydepList"></space-dialog> |
| | | <hoist-dialog ref="hoistRef" :lists="lists" @refresh="getMydepList"></hoist-dialog> |
| | | <ground-dialog ref="groundRef" :lists="lists" @refresh="getMydepList"></ground-dialog> |
| | | <broken-dialog ref="brokenRef" :lists="lists" @refresh="getMydepList"></broken-dialog> |
| | | <height-dialog ref="heightRef" :lists="lists" @refresh="getMydepList"></height-dialog> |
| | | <power-dialog ref="powerRef" :lists="lists" @refresh="getMydepList"></power-dialog> |
| | | <open-dialog ref="openRef" :lists="lists" @refresh="getMydepList"></open-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import {toRefs, reactive, defineComponent, ref, onMounted, defineAsyncComponent} from 'vue'; |
| | | import {toRefs, reactive, defineComponent, ref, onMounted, defineAsyncComponent, nextTick} from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import { useUserInfo } from '/@/stores/userInfo'; |
| | |
| | | import WorkRecord from "/@/views/specialWorkSystem/specialIndex/components/workRecord.vue"; |
| | | import { BorderBox10 as DvBorderBox10 } from '@kjgl77/datav-vue3' |
| | | import {productionDeviceApi} from "/@/api/doublePreventSystem/productionDevice"; |
| | | import {ElMessageBox} from "element-plus/es"; |
| | | import {judgeReportApi} from "/@/api/dataUpload/saftyBaseInfo/judgeReport"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface stateType { |
| | |
| | | workType1: Array<type>; |
| | | dialogType: number | null; |
| | | departmentList: Array<any>; |
| | | depList: Array<any>; |
| | | departmentRecursionList: Array<DepartmentState>; |
| | | reviewForm: object; |
| | | reviewRules: object; |
| | |
| | | endTime:string |
| | | pieData: Array<status> |
| | | squareData: Array<status> |
| | | lists: {} |
| | | } |
| | | interface type { |
| | | id: number | null; |
| | |
| | | components: { |
| | | VideoDetail, |
| | | WorkRecord, |
| | | // fire: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/fireLog.vue')), |
| | | // space: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/spaceLog.vue')), |
| | | // hoist: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/hoistLog.vue')), |
| | | // ground: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/groundLog.vue')), |
| | | // broken: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/brokenLog.vue')), |
| | | // height: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/heightLog.vue')), |
| | | // power: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/powerLog.vue')), |
| | | // plate: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/plateLog.vue')) |
| | | fireDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/fireDialog.vue')), |
| | | plateDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/plateDialog.vue')), |
| | | spaceDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/spaceDialog.vue')), |
| | | hoistDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/hoistDialog.vue')), |
| | | groundDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/groundDialog.vue')), |
| | | brokenDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/brokenDialog.vue')), |
| | | heightDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/heightDialog.vue')), |
| | | powerDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/powerDialog.vue')), |
| | | openDialog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/openDialog.vue')) |
| | | }, |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | |
| | | startTime: '', |
| | | endTime: '', |
| | | workAllStatus: null, |
| | | applyDepId: null |
| | | seDepId: null |
| | | }, |
| | | dialogReview: false, |
| | | departmentList: [], |
| | | depList: [], |
| | | departmentRecursionList: [], |
| | | searchStatus: null, |
| | | endTime: '', |
| | |
| | | value: -1 |
| | | }, |
| | | { |
| | | name: '开始', |
| | | name: '作业中(监护中)', |
| | | value: 1 |
| | | }, |
| | | { |
| | | name: '结束', |
| | | value: 2 |
| | | name: '待验收', |
| | | value: 3 |
| | | }, |
| | | { |
| | | name: '验收不合格', |
| | | value: 4 |
| | | }, |
| | | { |
| | | name: '已验收', |
| | | value: 5 |
| | | }, |
| | | { |
| | | name: '作业前气体分析不合格', |
| | | value: 6 |
| | | }, |
| | | { |
| | | name: '审批未通过', |
| | | value: 7 |
| | | }, |
| | | { |
| | | name: '作业中止', |
| | | value: 8 |
| | | }, |
| | | { |
| | | name: '取消', |
| | | value: 15 |
| | | }, |
| | | { |
| | | name: '废止', |
| | | value: 16 |
| | | } |
| | | ], |
| | | pieData: [], |
| | |
| | | }, |
| | | reviewRules:{ |
| | | advice: [{ required: true, message: '请填写验收意见', trigger: 'blur' }] |
| | | } |
| | | }, |
| | | lists: { |
| | | workerList: [], |
| | | departList: [], |
| | | departList2: [], |
| | | deviceList: [], |
| | | otherWorks: [], |
| | | spList: [], |
| | | riskList: [] |
| | | }, |
| | | }); |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | |
| | | getMydepList() |
| | | getAllDepartment(); |
| | | getTypePie() |
| | | getWorkDep() |
| | | getDepMonth() |
| | | getWarningList() |
| | | spWorker() |
| | | getOpList() |
| | | getAll() |
| | | getAllDevice() |
| | | getAllRisks() |
| | | getOtherWork() |
| | | }); |
| | | const fireRef = ref() |
| | | const plateRef = ref() |
| | | const spaceRef = ref() |
| | | const hoistRef = ref() |
| | | const groundRef = ref() |
| | | const brokenRef = ref() |
| | | const heightRef = ref() |
| | | const powerRef = ref() |
| | | const openRef = ref() |
| | | const initTime =()=>{ |
| | | state.chartSearch1.startTime = getPeriod(30) |
| | | state.chartSearch2.startTime = getPeriod(30) |
| | |
| | | getTypePie() |
| | | } |
| | | |
| | | const changeDep2=()=>{ |
| | | getWorkDep() |
| | | } |
| | | const changeType2=()=>{ |
| | | getWorkDep() |
| | | } |
| | | const changeType4=()=>{ |
| | | getWarningList() |
| | | } |
| | | const changeDep3=()=>{ |
| | | getDepMonth() |
| | | } |
| | |
| | | getMydepList() |
| | | getAllDepartment(); |
| | | getTypePie() |
| | | getWorkDep() |
| | | getDepMonth() |
| | | } |
| | | |
| | | const continueRecord = (row)=>{ |
| | | if(row.workType == 1){ |
| | | fireRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 2){ |
| | | spaceRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 3){ |
| | | hoistRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 4){ |
| | | groundRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 5){ |
| | | brokenRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 6){ |
| | | heightRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 7){ |
| | | powerRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 8){ |
| | | plateRef.value.openDialog(row,'continue') |
| | | } |
| | | if(row.workType == 9){ |
| | | openRef.value.openDialog(row,'continue') |
| | | } |
| | | } |
| | | |
| | | const getTypePie = async ()=>{ |
| | | const data = { |
| | | startTime: state.chartSearch1.startTime, |
| | | endTime:state.endTime, |
| | | depId:state.chartSearch1.depId |
| | | depId:state.chartSearch1.depId, |
| | | type: null |
| | | } |
| | | let res = await specialIndexApi().analyseType(data); |
| | | if (res.data.code === '200') { |
| | |
| | | }); |
| | | } |
| | | } |
| | | const getWorkDep = async ()=>{ |
| | | const data = { |
| | | // startTime: state.chartSearch2.startTime, |
| | | // endTime: state.endTime, |
| | | depId:state.chartSearch2.depId, |
| | | type: state.chartSearch2.type |
| | | } |
| | | let res = await specialIndexApi().analyseAllWork(data); |
| | | if (res.data.code === '200') { |
| | | state.squareData = JSON.parse(JSON.stringify(res.data.data)) |
| | | let names = state.squareData.map(i=>i.name) |
| | | let vals = state.squareData.map(i=>i.value) |
| | | initSlfx(names,vals) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | |
| | | const getDepMonth = async ()=>{ |
| | | let res = await specialIndexApi().analyseDepMonth(state.chartSearch3.depId); |
| | | if (res.data.code === '200') { |
| | |
| | | } |
| | | const getWarningList = async()=>{ |
| | | const data = { |
| | | |
| | | startTime: state.chartSearch4.startTime, |
| | | endTime: state.endTime, |
| | | workType:state.chartSearch4.workType |
| | |
| | | } |
| | | } |
| | | type EChartsOption = echarts.EChartsOption |
| | | |
| | | const initZyfb =()=>{ |
| | | let dom = document.getElementById(zyfb.value); |
| | | let myChart = echarts.init(dom); |
| | |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | }, |
| | | }, |
| | | data: state.pieData |
| | | data: state.pieData.map(i=>{ |
| | | return { |
| | | name: i.workTypeDesc, |
| | | value: i.count |
| | | } |
| | | }).filter(i=>i.name !== '未知') |
| | | } |
| | | ] |
| | | } |
| | |
| | | myChart.resize(); |
| | | }); |
| | | } |
| | | const initSlfx =(names:Array<string>,vals:Array<any>)=>{ |
| | | let dom = document.getElementById(slfx.value); |
| | | let myChart = echarts.init(dom); |
| | | let option: EChartsOption; |
| | | option = { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'shadow' |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | xAxis: [ |
| | | { |
| | | type: 'category', |
| | | data: names, |
| | | axisTick: { |
| | | alignWithLabel: true |
| | | }, |
| | | axisLabel: { |
| | | color: state.themeColor |
| | | } |
| | | } |
| | | ], |
| | | yAxis: [ |
| | | { |
| | | type: 'value' |
| | | } |
| | | ], |
| | | series: [ |
| | | { |
| | | name: 'Direct', |
| | | type: 'bar', |
| | | barWidth: '60%', |
| | | data: vals, |
| | | } |
| | | ] |
| | | } |
| | | |
| | | option && myChart.setOption(option); |
| | | window.addEventListener("resize",function (){ |
| | | myChart.resize(); |
| | | }); |
| | | } |
| | | const initZyqs =(names:Array<string>,vals:Array<any>)=>{ |
| | | let dom = document.getElementById(zyqs.value); |
| | | let myChart = echarts.init(dom); |
| | |
| | | let res = await teamManageApi().getAllDepartment(); |
| | | if (res.data.code === '200') { |
| | | state.departmentList = JSON.parse(JSON.stringify(res.data.data)) |
| | | // recursion(state.departmentList); |
| | | state.depList = 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) |
| | | recursion(state.departmentList); |
| | | state.lists.departList = state.departmentList |
| | | state.lists.departList2 = state.depList |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | } |
| | | }; |
| | | |
| | | // 分页获取列表 |
| | | // const getListByPage = async () => { |
| | | // const dateRange = JSON.parse(JSON.stringify(state.searchDate)) |
| | | // if(dateRange[1]){dateRange[1] = dateRange[1].replace('00:00:00','23:59:59')} |
| | | // const data = { pageSize: state.pageSize1, pageIndex: state.pageIndex1, searchParams: { workType: state.searchWord, applyDepId: state.searchDep,applyStartTime: dateRange[0],applyEndTime: dateRange[1]} }; |
| | | // let res = await workApplyApi().getApplyList(data); |
| | | // if (res.data.code === '200') { |
| | | // state.workData = JSON.parse(JSON.stringify(res.data.data)); |
| | | // state.workData = state.workData.map((item) => { |
| | | // if (item.operators == null || item.operators == []) { |
| | | // item.operators = []; |
| | | // } else { |
| | | // item.operators = Array.from(item.operators, ({ operatorUname }) => operatorUname); |
| | | // } |
| | | // return item; |
| | | // }); |
| | | // state.totalSize1 = res.data.total; |
| | | // } else { |
| | | // ElMessage({ |
| | | // type: 'warning', |
| | | // message: res.data.msg |
| | | // }); |
| | | // } |
| | | // }; |
| | | const recursion = (value: any) => { |
| | | for (let i of value) { |
| | | if (i.children.length !== 0) { |
| | | state.departmentRecursionList.push(i); |
| | | recursion(i.children); |
| | | } else { |
| | | state.departmentRecursionList.push(i); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 关键词查询记录 |
| | | const searchRecord = async () => { |
| | |
| | | startTime: '', |
| | | endTime: '', |
| | | workAllStatus: null, |
| | | applyDepId: null |
| | | seDepId: null |
| | | } |
| | | state.searchDate = [] |
| | | state.pageIndex = 1 |
| | |
| | | getMydepList() |
| | | }; |
| | | |
| | | // 查看记录 |
| | | // const viewDetail = (row: any) => { |
| | | // state.dialogType = row.workType |
| | | // state.details = JSON.parse(JSON.stringify(row)); |
| | | // if(state.details.workDetail.otherSpecialWork == '' || !state.details.workDetail.otherSpecialWork){ |
| | | // state.details.workDetail.otherSpecialWork=[] |
| | | // } |
| | | // else { |
| | | // const a = state.details.workDetail.otherSpecialWork |
| | | // state.details.workDetail.otherSpecialWork = a.split(',').map((item) => { |
| | | // return state.workTypeList.find((i: { id: number }) => i.id === Number(item))?.name; |
| | | // }); |
| | | // } |
| | | // if(state.details.workDetail.involvedDepIds == '' || !state.details.workDetail.involvedDepIds){ |
| | | // state.details.workDetail.involvedDepIds=[] |
| | | // } |
| | | // else { |
| | | // const a = state.details.workDetail.involvedDepIds |
| | | // state.details.workDetail.involvedDepIds = a.split(',').map((item) => { |
| | | // return state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(item))?.depName; |
| | | // }); |
| | | // } |
| | | // if(state.details.workDetail.csDepId){ |
| | | // state.details.workDetail.csDepId = state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(state.details.workDetail.csDepId))?.depName; |
| | | // } |
| | | // if(state.details.workDetail.operationDepId){ |
| | | // state.details.workDetail.operationDepId = state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(state.details.workDetail.operationDepId))?.depName; |
| | | // } |
| | | // if(state.details.workDetail.gbPath){ |
| | | // state.details.workDetail.gbPath = state.details.workDetail.gbPath.split(',') |
| | | // } |
| | | // if(state.details.workDetail.bcPath){ |
| | | // state.details.workDetail.bcPath = state.details.workDetail.bcPath.split(',') |
| | | // } |
| | | // if(state.details.workDetail.bpLocationMapPath){ |
| | | // state.details.workDetail.bpLocationMapPath = state.details.workDetail.bpLocationMapPath.split(',') |
| | | // } |
| | | // state.dialogDetails = true; |
| | | // }; |
| | | |
| | | // const handleReview = (row: object)=>{ |
| | | // state.dialogReview = true |
| | | // } |
| | | const openVideo = (row:object)=>{ |
| | | videoRef.value.openDialog(row) |
| | | } |
| | |
| | | } |
| | | axios.post(import.meta.env.VITE_API_URL + `/specialwork9step/work/down/load/pdf`,{id: row.workApplyId},{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ |
| | | if (res) { |
| | | console.log(res.data,888) |
| | | const link = document.createElement('a') |
| | | let blob = new Blob([res.data],{type: 'application/pdf'}) |
| | | link.style.display = "none"; |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const spWorker = async ()=>{ |
| | | for(let id of ['18','19']){ |
| | | const res = await workApplyApi().getSpList({roleId: id}) |
| | | 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 getAll = async ()=>{ |
| | | const res = await workApplyApi().getAllUsers() |
| | | if (res.data.code === '200') { |
| | | state.lists.workerList = 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.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 |
| | | }); |
| | | } |
| | | } |
| | | |
| | | const getOtherWork = async () => { |
| | | let res = await workApplyApi().getOtherWork({pageSize: 999, pageIndex: 1, searchParams: {workPermitNo: '', workType: null}}) |
| | | if (res.data.code === '200') { |
| | | state.lists.otherWorks = JSON.parse(JSON.stringify(res.data.data)) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // const submitReview = async (formEl: FormInstance | undefined) => { |
| | | // if (!formEl) return |
| | |
| | | zyfb, |
| | | slfx, |
| | | zyqs, |
| | | fireRef, |
| | | plateRef, |
| | | spaceRef, |
| | | hoistRef, |
| | | groundRef, |
| | | brokenRef, |
| | | heightRef, |
| | | powerRef, |
| | | openRef, |
| | | getMydepList, |
| | | continueRecord, |
| | | changeTime1, |
| | | changeTime4, |
| | | changeDep1, |
| | | changeDep2, |
| | | changeType2, |
| | | changeType4, |
| | | changeDep3, |
| | | changeDep4, |
| | | toFullscreen, |
| | |
| | | <style scoped lang="scss"> |
| | | $homeNavLengh: 8; |
| | | .home-container { |
| | | height: calc(100vh - 144px); |
| | | height: calc(100vh - 144px) !important; |
| | | position: relative; |
| | | box-sizing: border-box; |
| | | overflow: hidden; |
| | |
| | | |
| | | .main-card { |
| | | width: 100%; |
| | | height: 100%; |
| | | .cardTop { |
| | | display: flex; |
| | | align-items: center; |