| | |
| | | export function inspectIndexApi() { |
| | | return { |
| | | // |
| | | getCountExcepOrder: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/SafeCheckSmartScreen/select/countExcepOrderByLineChart`, |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | }, |
| | | |
| | | // |
| | | getListExcepOrderByPage: (data: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL + `/SafeCheck/abnormalWorkOrder/select/listExcepOrderByPage`, |
| | |
| | | <dv-border-box10 class="item-bg" :color="['rgba(8, 109, 209, 0.2)']"></dv-border-box10> |
| | | <div class="chart-tit"> |
| | | <span class="tit">年度巡检异常趋势</span> |
| | | <div class="filter-part"> |
| | | <el-select v-model="depId1" size="small" :teleported="false"> |
| | | <el-option |
| | | v-for="item in depList1" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | <el-select v-model="depId2" size="small" :teleported="false"> |
| | | <el-option |
| | | v-for="item in depList2" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | <div class="chart" :id="xjLine"></div> |
| | | </div> |
| | |
| | | <dv-border-box10 class="item-bg"></dv-border-box10> |
| | | <div class="chart-tit"> |
| | | <span class="tit">异常区域设备统计</span> |
| | | <div class="filter-part"> |
| | | <div class="filter-part2"> |
| | | <el-switch |
| | | v-model="chartStatus" |
| | | inline-prompt |
| | |
| | | workTypeList: Array<type>; |
| | | departmentList: []; |
| | | timeType: Array<type>; |
| | | depList1: Array<type>; |
| | | classGroupList: Array<classGroup>; |
| | | quotaList: []; |
| | | inspectPointAllList: []; |
| | |
| | | dialogVisible:boolean; |
| | | workNum: string; |
| | | beImgs: []; |
| | | afImgs: [] |
| | | afImgs: []; |
| | | depId1:number|null |
| | | depId2:number|null |
| | | } |
| | | interface type { |
| | | id: number; |
| | |
| | | { id: 4, name: '月' }, |
| | | { id: 5, name: '年' } |
| | | ], |
| | | depList1: [ |
| | | { |
| | | name: '电石事业部', |
| | | id: 49 |
| | | }, |
| | | { |
| | | name: '电力事业部', |
| | | id: 50 |
| | | }, |
| | | { |
| | | name: '有机化工事业部', |
| | | id: 48 |
| | | }, |
| | | { |
| | | name: '甲醇事业部', |
| | | id: 32 |
| | | } |
| | | ], |
| | | depId1: null, |
| | | depId2: null, |
| | | classGroupList: [], |
| | | quotaList: [], |
| | | inspectPointAllList: [], |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | .el-select{ |
| | | width: 50% !important; |
| | | margin-left: 10px; |
| | | } |
| | | .el-switch{ |
| | | width: 100% !important; |
| | | :deep(.el-switch__core){ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | } |
| | | .filter-part2{ |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | width: 20%; |
| | | .el-switch{ |
| | | width: 100% !important; |
| | |
| | | <div class="chart-item"> |
| | | <div class="chart-tit"> |
| | | <span class="tit">年度巡检异常趋势</span> |
| | | <div class="filter-part"> |
| | | <el-cascader v-model="searchDepId" :options="depList" :props="casProps" :show-all-levels="false" size="small"/> |
| | | </div> |
| | | </div> |
| | | <div class="chart" :id="xjLine"></div> |
| | | </div> |
| | | <div class="chart-item"> |
| | | <div class="chart-tit"> |
| | | <span class="tit">异常区域设备统计</span> |
| | | <div class="filter-part"> |
| | | <div class="filter-part2"> |
| | | <el-switch |
| | | v-model="chartStatus" |
| | | inline-prompt |
| | |
| | | import { departmentApi } from '/@/api/systemManage/department'; |
| | | import screenfull from "screenfull"; |
| | | import { BorderBox10 as DvBorderBox10 } from '@kjgl77/datav-vue3' |
| | | import {specialIndexApi} from "/@/api/specialWorkSystem/specialIndex"; |
| | | // 定义接口来定义对象的类型 |
| | | interface stateType { |
| | | tableData: Array<string>; |
| | |
| | | dialogVisible:boolean; |
| | | workNum: string; |
| | | beImgs: []; |
| | | afImgs: [] |
| | | afImgs: []; |
| | | searchDepId: number|null |
| | | depList: Array<any> |
| | | casProps:object |
| | | } |
| | | interface type { |
| | | id: number; |
| | |
| | | { id: 4, name: '月' }, |
| | | { id: 5, name: '年' } |
| | | ], |
| | | searchDepId: null, |
| | | depList: [ |
| | | { |
| | | name: '电石事业部', |
| | | depId: 49 |
| | | }, |
| | | { |
| | | name: '电力事业部', |
| | | id: 50 |
| | | }, |
| | | { |
| | | name: '有机化工事业部', |
| | | id: 48 |
| | | }, |
| | | { |
| | | name: '甲醇事业部', |
| | | id: 32 |
| | | } |
| | | ], |
| | | casProps: { |
| | | expandTrigger: 'hover', |
| | | emitPath: false, |
| | | value: 'depId', |
| | | label: 'depName', |
| | | checkStrictly: true |
| | | }, |
| | | classGroupList: [], |
| | | quotaList: [], |
| | | inspectPointAllList: [], |
| | |
| | | |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getDepartmentData(); |
| | | getCountExcepOrder(); |
| | | getInspectRecord(); |
| | | getListExcepOrder(); |
| | | getDayData(); |
| | | getDepartmentData(); |
| | | initXjLine() |
| | | initSbtj() |
| | | }); |
| | |
| | | } |
| | | const checkAllList =()=>{ |
| | | unusualListRef.value.showUnusualList() |
| | | } |
| | | const getCountExcepOrder = async ()=>{ |
| | | let res = await inspectIndexApi().getCountExcepOrder({depId: state.searchDepId}); |
| | | if (res.data.code === '200') { |
| | | console.log('折线图趋势数据>>>', res.data.data) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | const acceptance =(row:object)=>{ |
| | | ElMessageBox.confirm( |
| | |
| | | let res = await departmentApi().getDepartmentList(); |
| | | if (res.data.code === '200') { |
| | | state.departmentList = res.data.data; |
| | | const newList = [] |
| | | for(let i of state.departmentList[0].children){ |
| | | if(i.depId == 32 || i.depId == 48 ||i.depId == 49 || i.depId == 50){ |
| | | newList.push(i) |
| | | } |
| | | } |
| | | state.depList = newList |
| | | console.log(state.depList,'3434') |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | .el-select{ |
| | | width: 50% !important; |
| | | margin-left: 10px; |
| | | } |
| | | .el-switch{ |
| | | width: 100% !important; |
| | | :deep(.el-switch__core){ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | } |
| | | .filter-part2{ |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: right; |
| | | width: 20%; |
| | | .el-switch{ |
| | | width: 100% !important; |
| | |
| | | .tit{ |
| | | font-size: 20px; |
| | | font-weight: bolder; |
| | | } |
| | | :deep(.el-switch__core){ |
| | | width: 120px; |
| | | |
| | | } |
| | | .top-info { |
| | | display: flex; |
| | |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column property="execClassgroupId" label="巡检班组"> |
| | | <template #default="scope"> |
| | | <span> |
| | | {{ parseNumber(scope.row.execClassgroupId, '巡检班组') }} |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column property="execClassgroupName" label="巡检班组"/> |
| | | <el-table-column property="frequency" label="检查频次"> |
| | | <template #default="scope"> |
| | | <span> |
| | |
| | | <template> |
| | | <div class="system-add-dept-container"> |
| | | <el-dialog :title="title" v-model="isShowDialog" width="600px"> |
| | | <el-form :model="departmentForm" size="default" label-width="90px"> |
| | | <el-form ref="ruleFormRef" :model="departmentForm" :rules="rules" size="default" label-width="90px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="部门等级"> |
| | | <el-select v-model="departmentForm.depLevel" placeholder="请输入部门等级" class="input-add" clearable> |
| | | <el-form-item label="部门等级" prop="depLevel"> |
| | | <el-select v-model="departmentForm.depLevel" placeholder="请选择部门等级" class="input-add" clearable> |
| | | <el-option |
| | | v-for="item in depLevelList" |
| | | :key="item.id" |
| | |
| | | </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="parentDepId"> |
| | | <el-cascader :options="deptData" class="input-add" :props="{ emitPath: false, checkStrictly: true, value: 'depId', label: 'depName' }" placeholder="请选择部门" clearable v-model="departmentForm.parentDepId"> </el-cascader> |
| | | </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="depName"> |
| | | <el-input v-model="departmentForm.depName" class="input-add" 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="depCode"> |
| | | <el-input v-model="departmentForm.depCode" class="input-add" 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="部门描述"> |
| | |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="onCancel" size="default">取 消</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit" size="default">确 定</el-button> |
| | | <el-button type="primary" v-throttle @click="onSubmit(ruleFormRef)" size="default">确 定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | |
| | | <script lang="ts"> |
| | | import { ElMessage } from 'element-plus'; |
| | | import { reactive, toRefs, onMounted, defineComponent } from 'vue'; |
| | | import { ref, reactive, toRefs, onMounted, defineComponent } from 'vue'; |
| | | import { departmentApi } from '/@/api/systemManage/department'; |
| | | |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | // 定义接口来定义对象的类型 |
| | | interface TableDataRow { |
| | | name: string; |
| | |
| | | isShowDialog: boolean; |
| | | departmentForm: { |
| | | depName: string; |
| | | depCode: string; |
| | | depInfo: string; |
| | | parentDepId: string; |
| | | depLevel:null | number |
| | | }; |
| | | deptData: Array<TableDataRow>; |
| | | depLevelList: Array<Type>; |
| | | depLevelList: Array<Type> |
| | | } |
| | | interface Type{ |
| | | id:number; |
| | |
| | | isShowDialog: false, |
| | | departmentForm: { |
| | | depName: '', |
| | | depCode: '', |
| | | parentDepId: '', |
| | | depInfo: '', |
| | | depLevel:null, |
| | |
| | | {id:3,name:'车间'}, |
| | | ] // 部门数据 |
| | | }); |
| | | |
| | | const checkCode = (rule: any, value: any, callback: any) => { |
| | | if (!value) { |
| | | return callback(new Error('请输入部门编号')) |
| | | } |
| | | setTimeout(() => { |
| | | const regex = /^[a-zA-Z0-9]+$/ |
| | | if (regex.test(value)) { |
| | | callback() |
| | | } else { |
| | | callback(new Error('部门编号只能有英文字母和数字构成')) |
| | | } |
| | | }, 1000) |
| | | } |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const rules = reactive<FormRules>({ |
| | | depName: [{ required: true, message: '请填写部门名称', trigger: 'blur' }], |
| | | parentDepId: [{ required: true, message: '请选择上级部门', trigger: 'blur' }], |
| | | depLevel: [{ required: true, message: '请选择部门等级', trigger: 'blur' }], |
| | | depCode: [{ required: true, validator: checkCode, trigger: 'blur' }] |
| | | }); |
| | | // 打开弹窗 |
| | | const openDialog = (type: string, value: any, departmentList: []) => { |
| | | state.isShowDialog = true; |
| | |
| | | state.title = '新增部门'; |
| | | state.departmentForm = { |
| | | depName: '', |
| | | depCode: '', |
| | | parentDepId: '', |
| | | depLevel:null, |
| | | depInfo: '' |
| | |
| | | closeDialog(); |
| | | }; |
| | | // 新增 |
| | | const onSubmit = async () => { |
| | | if (state.title === '新增部门') { |
| | | let res = await departmentApi().addDepartment(state.departmentForm); |
| | | if (res.data.code === '200') { |
| | | const onSubmit = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | if (state.title === '新增部门') { |
| | | let res = await departmentApi().addDepartment(state.departmentForm); |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '部门新增成功', |
| | | duration: 2000 |
| | | type: 'success', |
| | | message: '部门新增成功', |
| | | duration: 2000 |
| | | }); |
| | | closeDialog(); |
| | | context.emit('getDepartmentList'); |
| | | } else { |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } else { |
| | | let res = await departmentApi().modDepartment(state.departmentForm); |
| | | if (res.data.code === '200') { |
| | | } |
| | | } else { |
| | | let res = await departmentApi().modDepartment(state.departmentForm); |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '部门修改成功', |
| | | duration: 2000 |
| | | type: 'success', |
| | | message: '部门修改成功', |
| | | duration: 2000 |
| | | }); |
| | | closeDialog(); |
| | | context.emit('getDepartmentList'); |
| | | } else { |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | }; |
| | | // 初始化部门数据 |
| | | const initTableData = () => {}; |
| | |
| | | initTableData(); |
| | | }); |
| | | return { |
| | | ruleFormRef, |
| | | rules, |
| | | openDialog, |
| | | closeDialog, |
| | | onCancel, |
| | |
| | | </el-button> |
| | | </div> |
| | | <el-table :data="tableData.data" style="width: 100%" row-key="depId" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> |
| | | <el-table-column prop="depName" label="部门名称" show-overflow-tooltip> </el-table-column> |
| | | <el-table-column prop="depInfo" label="部门描述" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="depName" label="部门名称" show-overflow-tooltip/> |
| | | <el-table-column prop="depLevelDesc" label="部门等级" show-overflow-tooltip/> |
| | | <el-table-column prop="depCode" label="部门编号" show-overflow-tooltip/> |
| | | <el-table-column prop="depInfo" label="部门描述" show-overflow-tooltip/> |
| | | <el-table-column label="操作" show-overflow-tooltip width="140"> |
| | | <template #default="scope"> |
| | | <el-button size="small" text type="primary" @click="onOpenDeptDialog('新增', '')">新增</el-button> |
| | |
| | | }; |
| | | // 删除当前行 |
| | | const onTabelRowDel = (row: TableDataRow) => { |
| | | ElMessageBox.confirm(`此操作将永久删除部门:${row.depId}, 是否继续?`, '提示', { |
| | | ElMessageBox.confirm(`此操作将永久删除部门:${row.depName}, 是否继续?`, '提示', { |
| | | confirmButtonText: '删除', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |