已修改48个文件
已添加21个文件
已删除1个文件
对比新文件 |
| | |
| | | <changelist name="Uncommitted_changes_before_Update_at_2022_8_19_20_39_[Default_Changelist]" date="1660912799125" recycled="true" deleted="true"> |
| | | <option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_2022_8_19_20_39_[Default_Changelist]/shelved.patch" /> |
| | | <option name="DESCRIPTION" value="Uncommitted changes before Update at 2022/8/19 20:39 [Default Changelist]" /> |
| | | </changelist> |
对比新文件 |
| | |
| | | <changelist name="Uncommitted_changes_before_Update_at_2022_8_19_20_43_[Default_Changelist]" date="1660912991701" recycled="true" deleted="true"> |
| | | <option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_2022_8_19_20_43_[Default_Changelist]/shelved.patch" /> |
| | | <option name="DESCRIPTION" value="Uncommitted changes before Update at 2022/8/19 20:43 [Default Changelist]" /> |
| | | </changelist> |
| | |
| | | "vue-clipboard3": "^2.0.0", |
| | | "vue-grid-layout": "^3.0.0-beta1", |
| | | "vue-i18n": "^9.1.10", |
| | | "vue-router": "^4.0.15" |
| | | "vue-router": "^4.0.15", |
| | | "xlsx": "^0.18.5" |
| | | }, |
| | | "devDependencies": { |
| | | "@types/json-bigint": "^1.0.1", |
| | |
| | | method: 'get' |
| | | }); |
| | | }, |
| | | //安全目标考核 列表 |
| | | gettargetExamineList: (params: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL_OUT + '/targetExamine/page/list', |
| | | method: 'post', |
| | | data: params |
| | | }); |
| | | }, |
| | | // 安全目标考核 查询单条数据 |
| | | gettargetExamineDetail: (params: any) => { |
| | | return request({ |
| | |
| | | getworkApproveList: (params: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL_OUT + '/targetMng/checkAndSubimt/list', |
| | | method: 'post', |
| | | data: params |
| | | }); |
| | | }, |
| | | // 目标检查上报 查看审批流程 |
| | | getworkApproveListCode: (params: object) => { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL_OUT + '/targetDutyWorkApprove/page/list', |
| | | method: 'post', |
| | | data: params |
| | | }); |
| | |
| | | url: import.meta.env.VITE_API_URL_OUT + '/minio/file/view?obj=' + fileName, |
| | | method: 'get' |
| | | }); |
| | | }, |
| | | // 应急统计 |
| | | emergencyStat(params: object) { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL_OUT + `/emergencyCount/emergencyDrillExecute/count`, |
| | | method: 'post', |
| | | data: params |
| | | }); |
| | | }, |
| | | // 目标分类 分页查询数据 |
| | | gettargetClassList(params: object) { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL_OUT + '/targetType/page/list', |
| | | method: 'post', |
| | | data: params |
| | | }); |
| | | }, |
| | | // 目标分类 查询单条数据 |
| | | gettargetClassDetail(params: any) { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL_OUT + `/targetType/selectOne/${params}`, |
| | | method: 'get' |
| | | }); |
| | | }, |
| | | // 目标分类 新增或者修改数据 |
| | | gettargetClassAdd(params: object) { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL_OUT + '/targetType/addOrUpdate', |
| | | method: 'post', |
| | | data: params |
| | | }); |
| | | }, |
| | | // 目标分类 删除 |
| | | gettargetClassDelete(params: any) { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL_OUT + '/targetType/delete', |
| | | method: 'post', |
| | | data: params |
| | | }); |
| | | }, |
| | | // 目标分类 查询所有数据All |
| | | gettargetClassAll(params: any) { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL_OUT + '/targetType/page/listAll', |
| | | method: 'post', |
| | | data: params |
| | | }); |
| | | }, |
| | | // 统计 查询应急物资 |
| | | emergencySuppliesCount(params: any) { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL_OUT + '/emergencyCount/emergencySupplies/count', |
| | | method: 'post', |
| | | data: params |
| | | }); |
| | | }, |
| | | // 统计 事故快报 |
| | | accidentReportCount(params: any) { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL_OUT + '/accidentCount/accidentReport/count', |
| | | method: 'post', |
| | | data: params |
| | | }); |
| | | }, |
| | | // 目标 统计 |
| | | gettargetstatistics(params: any) { |
| | | return request({ |
| | | url: import.meta.env.VITE_API_URL_OUT + `/targetMng/statistics?targetType=${params}`, |
| | | method: 'get' |
| | | // data:params |
| | | }); |
| | | } |
| | | }; |
| | | } |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" @close="resetForm(ruleFormRef)" :fullscreen="full" :title="titles" width="30%" draggable> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form :model="form" ref="ruleFormRef" :rules="rules" :disabled="disabled" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="名称" size="default" prop="typeName"> |
| | | <el-input v-model="form.typeName" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="描述" size="default" prop="memo"> |
| | | <el-input v-model="form.memo" type="textarea" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="resetForm(ruleFormRef)" size="default">关闭</el-button> |
| | | <el-button type="primary" v-if="disabled == false" @click="submitForm(ruleFormRef)" size="default">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, reactive } from 'vue'; |
| | | import { timeDate } from '/@/assets/index.ts'; |
| | | import type { FormInstance, FormRules } from 'element-plus'; |
| | | import { Search, FullScreen } from '@element-plus/icons-vue'; |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext } from 'element-plus'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | export default defineComponent({ |
| | | components: {}, |
| | | setup(props, { emit }) { |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | const dialogVisible = ref<boolean>(false); |
| | | const form = ref({ |
| | | typeName: '', |
| | | memo: '', |
| | | }); |
| | | const targetType = ref(); |
| | | const disabled = ref(false); |
| | | const titles = ref(); |
| | | const titleT=ref() |
| | | const openDailog = (title: string, type: any, id: number) => { |
| | | dialogVisible.value = true; |
| | | titles.value = `${title}目标分解`; |
| | | titleT.value=title |
| | | targetType.value = type; |
| | | disabled.value = title == '查看' ? true : false; |
| | | if (title == '查看' || title == '修改') { |
| | | goalManagementApi() |
| | | .gettargetClassDetail(id) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | form.value = res.data.data; |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | const rules = reactive<FormRules>({ |
| | | typeName: [ |
| | | { |
| | | required: true, |
| | | message: '名称不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | memo: [ |
| | | { |
| | | required: true, |
| | | message: '描述不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | }); |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | if(titleT.value=='新建'){ |
| | | delete form.value.id |
| | | } |
| | | dialogVisible.value = false; |
| | | goalManagementApi() |
| | | .gettargetClassAdd(form.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | emit('onAdd'); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | }; |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | dialogVisible.value = false; |
| | | }; |
| | | //全屏 |
| | | const full = ref(false); |
| | | const toggleFullscreen = () => { |
| | | if (full.value == false) { |
| | | full.value = true; |
| | | } else { |
| | | full.value = false; |
| | | } |
| | | }; |
| | | return { |
| | | timeDate, |
| | | ruleFormRef, |
| | | titleT, |
| | | rules, |
| | | submitForm, |
| | | resetForm, |
| | | form, |
| | | dialogVisible, |
| | | openDailog, |
| | | Search, |
| | | full, |
| | | toggleFullscreen, |
| | | FullScreen, |
| | | targetType, |
| | | disabled, |
| | | titles, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .el-row { |
| | | padding: 0 0 20px 0; |
| | | } |
| | | </style> |
| | |
| | | <el-input v-model="ruleForm.searchParams.indexNum" placeholder="目标指标编号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6" :offset="1"> |
| | | <el-col :span="10" :offset="1"> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="listApi">查询</el-button> |
| | | <el-button @click="resetForm">重置</el-button> |
| | | <el-button size="default" type="primary" @click="listApi">查询</el-button> |
| | | <el-button size="default" @click="resetForm">重置</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="保养周期" size="default" prop="takecareCycle "> |
| | | <el-input v-model="form.takecareCycle" placeholder="请填写保养周期" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-tabs v-model="activeName" class="demo-tabs"> |
| | | <el-tab-pane label="设备保养" name="first"> |
| | |
| | | useDate: '', |
| | | |
| | | recoverySubmitDate: '', |
| | | takecareCycle:"", |
| | | |
| | | lockNum: '', |
| | | |
| | |
| | | destoryReason: [], |
| | | destorySubmitDate: [], |
| | | actualDestoryDate: [], |
| | | takecareCycle :[] |
| | | }); |
| | | // 提交 |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | |
| | | </script> |
| | | <style scoped> |
| | | .el-form-item { |
| | | width: 400px; |
| | | width: 25vw; |
| | | } |
| | | .formType:after { |
| | | content: ''; |
| | |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | import {deepClone} from '/@/utils/other' |
| | | export default defineComponent({ |
| | | components: { categoryDailog, RegionsDialog, DailogSearchUser, maintenanceDailog, detectDailog, repairDailog, standardDailog }, |
| | | components: { categoryDailog,Plus, RegionsDialog, DailogSearchUser, maintenanceDailog, detectDailog, repairDailog, standardDailog }, |
| | | setup(props, { emit }) { |
| | | const dialogVisible = ref(false); |
| | | const form = ref({ |
| | |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="维修状态" size="default" prop="repairStatus"> |
| | | <el-select v-model="form.repairStatus" placeholder="请选择" style="width: 100%"> |
| | | <el-option label="维修中" value="1" /> |
| | | <el-option label="已修好" value="2" /> |
| | | <el-option label="维修中" :value="1" /> |
| | | <el-option label="已修好" :value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-radio :label="false">否</el-radio> |
| | | </el-radio-group> |
| | | <el-button v-if="ruleForm.casualties" type="primary" style="margin-left: 20px" |
| | | :icon="Edit" @click="openDai" round plain /> |
| | | :icon="Edit" @click="openDai(ruleFormRef)" round plain /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | |
| | | import { reactive, ref, defineComponent, defineEmits, onMounted } from 'vue'; |
| | | |
| | | import type { UploadUserFile, FormInstance, FormRules } from 'element-plus'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { ElMessage,ElMessageBox, } from 'element-plus'; |
| | | import { Search, FullScreen, Edit } from '@element-plus/icons-vue'; |
| | | import NumberOfCasualties from '/@/views/accidentManagementSystem/accidentExpress/component/numberOfCasualties.vue'; |
| | | import UserSelections from '/@/components/userSelections/index.vue'; |
| | |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | isShowDialog.value = false; |
| | | if(ruleForm.value.id==null||ruleForm.value.id==''){ |
| | | ruleForm.value.id = null; |
| | | accidentManagementSystemApi() |
| | | .accidentAdd(ruleForm.value) |
| | |
| | | } |
| | | formEl.resetFields(); |
| | | }); |
| | | }else { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: '添加成功', |
| | | type: 'success', |
| | | }); |
| | | emit('myAdd', true); |
| | | } |
| | | |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | |
| | | console.log('tag', ruleForm); |
| | | }; |
| | | const ShowUser = ref(); |
| | | const openDai = () => { |
| | | const openDai = async (formEl: FormInstance | undefined) => { |
| | | if(ruleForm.value.id==null||ruleForm.value.id==''){ |
| | | if(!ruleForm.value.fileList){ |
| | | ruleForm.value.fileList = [] |
| | | } |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | // isShowDialog.value = false; |
| | | ElMessageBox.confirm('确认添加此事故快报?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | accidentManagementSystemApi() |
| | | .accidentAdd(ruleForm.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: '请先添加事故快报', |
| | | type: 'info', |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | ruleForm.value.id = res.data.data.id |
| | | ShowUser.value.openDialog(ruleForm.value.id, disabled.value); |
| | | } else { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: 'error', |
| | | }); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | // ElMessage({ |
| | | // showClose: true, |
| | | // message: '请先添加事故快报', |
| | | // type: 'info', |
| | | // }); |
| | | }else { |
| | | ShowUser.value.openDialog(ruleForm.value.id, disabled.value); |
| | | } |
| | |
| | | <el-button size="default" type="primary" @click="onOpenAdd"> |
| | | <el-icon> <Plus /> </el-icon>新建 |
| | | </el-button> |
| | | <el-button size="default" type="warning" plain :disabled="warning"> |
| | | <el-button size="default" type="warning" plain :disabled="warning" @click="onEdit('修改', deletAll[0])"> |
| | | <el-icon> <Edit /> </el-icon>修改 |
| | | </el-button> |
| | | <el-button size="default" type="danger" @click="onDeleteAll" plain :disabled="danger"> |
| | |
| | | arr.push(valId[i].id); |
| | | } |
| | | deletAll.value = arr; |
| | | console.log(deletAll.value) |
| | | if (val.length == 1) { |
| | | warning.value = false; |
| | | danger.value = false; |
| | |
| | | <Plus /> |
| | | </el-icon>新建 |
| | | </el-button> |
| | | <el-button size="default" type="warning" plain :disabled="warning"> |
| | | <el-button size="default" type="warning" plain :disabled="warning" @click="onEdit('修改', deletAll[0])"> |
| | | <el-icon> |
| | | <Edit /> |
| | | </el-icon>修改 |
| | |
| | | arr.push(valId[i].id); |
| | | } |
| | | deletAll.value = arr; |
| | | // console.log(deletAll.value); |
| | | console.log(deletAll.value); |
| | | if (val.length == 1) { |
| | | warning.value = false; |
| | | danger.value = false; |
| | |
| | | onMyAdd, |
| | | onDeleteAll, |
| | | onEdit, |
| | | editableTabs |
| | | editableTabs, |
| | | deletAll |
| | | }; |
| | | }, |
| | | }); |
对比新文件 |
| | |
| | | <template> |
| | | <div class="system-user-container"> |
| | | <el-card shadow="hover"> |
| | | <div class="system-user-search mb15"> |
| | | <el-form ref="ruleFormRef" size="default" label-width="80px" :inline="true"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="4" :md="4" :lg="4" :xl="4" class="mb20"> |
| | | <el-form-item prop="telephone" label="选择年月"> |
| | | <el-radio-group v-model="params.type" class="w100"> |
| | | <el-radio :label="2">年</el-radio> |
| | | <el-radio :label="1">月</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="4" :md="4" :lg="4" :xl="4" class="mb20"> |
| | | <el-form-item v-if="params.type==2" prop="telephone" label="选择年"> |
| | | <el-date-picker |
| | | v-model="params.year" |
| | | :disabled="disabled" |
| | | type="year" |
| | | class="w100" |
| | | value-format="YYYY" |
| | | placeholder="选择日期时间" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item v-if="params.type==1" prop="telephone" label="选择月"> |
| | | <el-date-picker |
| | | v-model="params.realMonth" |
| | | :disabled="disabled" |
| | | type="month" |
| | | class="w100" |
| | | value-format="YYYY-MM" |
| | | placeholder="选择日期时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="8" :md="8" :lg="8" :xl="8" class="mb20"> |
| | | <el-button size="default" type="primary" class="ml10" @click="emergencySuppliesCount"> 查询</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div class="echarts" ref="echarts1"> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | </el-card> |
| | | |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, onMounted, ref } from 'vue'; |
| | | import * as echarts from 'echarts'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | import { toNamespacedPath } from 'path/posix'; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const params = ref({ |
| | | level:'', |
| | | type:2, |
| | | year:'2022', |
| | | month:'', |
| | | realMonth:'' |
| | | }) |
| | | const list = ref([]) |
| | | //加载数据 |
| | | const emergencySuppliesCount = () => { |
| | | if(params.value.type==2){ |
| | | params.value.month='' |
| | | } |
| | | if(params.value.type==1){ |
| | | params.value.year=params.value.realMonth.split('-')[0] |
| | | params.value.month=params.value.realMonth.split('-')[1] |
| | | } |
| | | goalManagementApi() |
| | | .accidentReportCount(params.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | var newList = [] |
| | | for(var a = 0;a<res.data.data.length;a++){ |
| | | newList.push( |
| | | { |
| | | name:res.data.data[a].name+":"+res.data.data[a].num, |
| | | value:res.data.data[a].num, |
| | | deathNum: res.data.data[a].deathNum, |
| | | economicLoss: res.data.data[a].economicLoss, |
| | | minorInjuryNum: res.data.data[a].minorInjuryNum, |
| | | seriousInjuryNum: res.data.data[a].seriousInjuryNum |
| | | } |
| | | ) |
| | | } |
| | | list.value = newList; |
| | | initPies() |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }; |
| | | const echarts1 = ref() |
| | | const initPies = () => { |
| | | var myChart = echarts.init(echarts1.value); |
| | | myChart.clear() |
| | | var option = { |
| | | tooltip: { |
| | | trigger: 'item', |
| | | textStyle:{ |
| | | fontSize:18 |
| | | }, |
| | | formatter(params){ |
| | | for(var x in params){ |
| | | return params.data.name.split(':')[0] +":"+params.data.value+'<br />'+ |
| | | '死亡人数:'+params.data.deathNum+'<br />'+ |
| | | '轻伤人数:'+params.data.minorInjuryNum+'<br />'+ |
| | | '重伤人数:'+params.data.seriousInjuryNum+'<br />'+ |
| | | '经济损失:'+params.data.economicLoss+'<br />' |
| | | } |
| | | |
| | | } |
| | | }, |
| | | legend: { |
| | | top: '5%', |
| | | left: 'center', |
| | | icon: "circle", |
| | | formatter: function(param){ |
| | | param=param.split(":"); |
| | | return [param[0]+':'+param[1]].join(""); |
| | | }, |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '事故等级分布', |
| | | type: 'pie', |
| | | radius: ['40%', '70%'], |
| | | avoidLabelOverlap: false, |
| | | itemStyle: { |
| | | borderRadius: 10, |
| | | borderColor: '#fff', |
| | | borderWidth: 2 |
| | | }, |
| | | label: { |
| | | show: false, |
| | | position: 'center' |
| | | }, |
| | | emphasis: { |
| | | label: { |
| | | show: false, |
| | | fontSize: '40', |
| | | fontWeight: 'bold' |
| | | } |
| | | }, |
| | | labelLine: { |
| | | show: false |
| | | }, |
| | | data: list.value |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | myChart.setOption(option, true); |
| | | |
| | | }; |
| | | onMounted(() => { |
| | | emergencySuppliesCount() |
| | | }); |
| | | return { |
| | | params, |
| | | list, |
| | | emergencySuppliesCount, |
| | | initPies, |
| | | echarts1 |
| | | } |
| | | } |
| | | |
| | | }) |
| | | </script> |
| | | <style scoped> |
| | | .echarts{ |
| | | width: 500px; |
| | | height: 400px; |
| | | } |
| | | </style> |
| | |
| | | </el-icon> |
| | | 新建 |
| | | </el-button> |
| | | <el-button size="default" type="warning" plain :disabled="warning"> |
| | | <el-button size="default" type="warning" plain :disabled="warning" @click="onEdit('修改', deletAll[0])"> |
| | | <el-icon> |
| | | <Edit /> |
| | | </el-icon> |
| | |
| | | total, |
| | | onMyAdd, |
| | | onSelectItem, |
| | | deletAll |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> |
| | | <el-tab-pane label="应急队伍人员" name="first" > |
| | | <el-button type="primary" size="default" @click="onAddEmergencyPersonnel" :disabled="disabled">新增 |
| | | <el-button type="primary" size="default" @click="onAddEmergencyPersonnel(ruleFormRef)" :disabled="disabled">新增 |
| | | </el-button> |
| | | <el-table |
| | | :data="tableData" |
| | |
| | | }); |
| | | const titles = ref(); |
| | | const disabled = ref(); |
| | | const peopleInsertBtn = ref(false) |
| | | const teamId = ref() |
| | | // 打开弹窗 |
| | | const openDialog = (title: string, id: number, type: boolean) => { |
| | |
| | | titles.value = title; |
| | | disabled.value = type; |
| | | teamId.value = id |
| | | //如果是新增 无法添加人员 |
| | | if(title == '新建应急队伍管理'){ |
| | | peopleInsertBtn.value = true |
| | | }else{ |
| | | peopleInsertBtn.value = false |
| | | } |
| | | if (title == '查看应急队伍管理' || title == '修改应急队伍管理') { |
| | | contingencyApi() |
| | | .seeEmergencyTeam(id) |
| | |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | isShowDialog.value = false; |
| | | if(teamId.value==null||teamId.value==''){ |
| | | contingencyApi() |
| | | .addEmergencyTeam(ruleForm.value) |
| | | .then((res) => { |
| | |
| | | } |
| | | formEl.resetFields(); |
| | | }); |
| | | }else { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: '添加成功', |
| | | type: 'success', |
| | | }); |
| | | emit('myAdd', true); |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | |
| | | const tableData = ref([]); |
| | | //添加队伍负责人弹窗 |
| | | const addRef = ref(); |
| | | const onAddEmergencyPersonnel = () => { |
| | | //未添加队伍 无法修改人员 |
| | | if(peopleInsertBtn.value == true){ |
| | | const onAddEmergencyPersonnel = async (formEl: FormInstance | undefined) => { |
| | | if(!ruleForm.value.fileList){ |
| | | ruleForm.value.fileList = [] |
| | | } |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | // isShowDialog.value = false; |
| | | if(teamId.value == ''||teamId.value==null){ |
| | | ElMessageBox.confirm('确认添加此应急队伍?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | contingencyApi() |
| | | .addEmergencyTeam(ruleForm.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: '请先添加应急队伍', |
| | | type: 'warning', |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | teamId.value = res.data.data.id |
| | | addRef.value.openDialog('新建应急队伍人员','',teamId.value); |
| | | } else { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: 'error', |
| | | }); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | |
| | | }else { |
| | | addRef.value.openDialog('新建应急队伍人员','',teamId.value); |
| | | } |
| | | |
| | | |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | }; |
| | | // 请求列表数据 |
| | | const listApi = async () => { |
| | |
| | | onEdit, |
| | | onRowDel, |
| | | department, |
| | | peopleInsertBtn, |
| | | teamId, |
| | | newTreeList, |
| | | successUploader, |
| | |
| | | <Plus /> |
| | | </el-icon>新建 |
| | | </el-button> |
| | | <!-- <el-button size="default" type="warning" plain :disabled="warning">--> |
| | | <!-- <el-icon>--> |
| | | <!-- <Edit />--> |
| | | <!-- </el-icon>修改--> |
| | | <!-- </el-button>--> |
| | | <el-button size="default" type="warning" plain :disabled="warning" @click="onEdit('修改', deleteAll[0])"> |
| | | <el-icon> |
| | | <Edit /> |
| | | </el-icon>修改 |
| | | </el-button> |
| | | <el-button size="default" type="danger" plain :disabled="danger" @click="onDeleteAll"> |
| | | <el-icon> |
| | | <Delete /> |
| | |
| | | // Upload, |
| | | // Download, |
| | | // Refresh, |
| | | Edit, |
| | | View, |
| | | EditPen, |
| | | } from '@element-plus/icons-vue' |
| | |
| | | components: { |
| | | OpenAdd, |
| | | View, |
| | | Edit, |
| | | EditPen, |
| | | Plus, |
| | | Delete, |
| | |
| | | listQuery.searchParams.teamLevel = ''; |
| | | onSubmit(); |
| | | }; |
| | | // const warning = ref(true); |
| | | const warning = ref(true); |
| | | const danger = ref(true); |
| | | const deleteAll = ref(); |
| | | const handleSelectionChange = (val: any) => { |
| | |
| | | } |
| | | deleteAll.value = arr; |
| | | if (val.length == 1) { |
| | | // warning.value = false; |
| | | warning.value = false; |
| | | danger.value = false; |
| | | } else if (val.length == 0) { |
| | | // warning.value = true; |
| | | warning.value = true; |
| | | danger.value = true; |
| | | } else { |
| | | // warning.value = true; |
| | | warning.value = true; |
| | | danger.value = false; |
| | | } |
| | | }; |
| | |
| | | onHandleSizeChange, |
| | | onHandleCurrentChange, |
| | | deleteAll, |
| | | // warning, |
| | | warning, |
| | | danger, |
| | | }; |
| | | }, |
对比新文件 |
| | |
| | | <template> |
| | | <div> |
| | | <div class="echart"> |
| | | <h2 class="title">距上次应急演练结束{{day}}天</h2> |
| | | <el-form :model="form" label-width="20px"> |
| | | <el-row> |
| | | <el-col :span="4" :offset="15"> |
| | | <el-form-item size="default"> |
| | | <el-tree-select v-model="form.deptId" :data="data" @change="eaclick" placeholder="选择部门" :props="propse" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item size="default"> |
| | | <el-select v-model="form.type" placeholder="年/月" @change="eaclick" style="width:100%"> |
| | | <el-option label="年" :value="1" /> |
| | | <el-option label="月" :value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div ref="main" style="width: 100%; height: 300px"></div> |
| | | <el-select v-model="params.searchParams.classification" style="width: 200px" |
| | | placeholder="请选择物资分类" @change="emergencySuppliesCount"> |
| | | <el-option label="事故气体吸收装置" value="1"></el-option> |
| | | <el-option label="通讯设施" value="2"></el-option> |
| | | <el-option label="交通运输工具" value="3"></el-option> |
| | | <el-option label="照明装置" value="4"></el-option> |
| | | <el-option label="防护器材" value="5"></el-option> |
| | | <el-option label="其它" value="6"></el-option> |
| | | </el-select> |
| | | <div class="pie-body"> |
| | | <div class="pie-item" ref="echarts0"> |
| | | </div> |
| | | <div class="pie-item" ref="echarts1"> |
| | | </div> |
| | | <div class="pie-item" ref="echarts2"> |
| | | </div> |
| | | <div class="pie-item" ref="echarts3"> |
| | | </div> |
| | | <div class="pie-item" ref="echarts4"> |
| | | </div> |
| | | <ArrowLeftBold class="pie-left" :class="disabledLeft" @click="leftClick" /> |
| | | <ArrowRightBold class="pie-right" :class="disabledRight" @click="rightClick" /> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, onMounted, ref } from 'vue'; |
| | | import * as echarts from 'echarts'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { ArrowLeftBold, ArrowRightBold } from '@element-plus/icons-vue'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | import { toNamespacedPath } from 'path/posix'; |
| | | import { deepClone } from '/@/utils/other'; |
| | | export default defineComponent({ |
| | | components: { |
| | | ArrowLeftBold, |
| | | ArrowRightBold, |
| | | }, |
| | | setup() { |
| | | const params = ref({ |
| | | pageIndex:1, |
| | | pageSize:5, |
| | | searchParams:{ |
| | | classification:'' |
| | | } |
| | | }) |
| | | const list = ref([]) |
| | | |
| | | const leftClick = () => { |
| | | params.value.pageIndex-- |
| | | emergencySuppliesCount() |
| | | initPies() |
| | | } |
| | | const rightClick = () => { |
| | | params.value.pageIndex++ |
| | | emergencySuppliesCount() |
| | | initPies() |
| | | } |
| | | const disabledLeft = ref() |
| | | const disabledRight = ref() |
| | | //加载数据 |
| | | const emergencySuppliesCount = () => { |
| | | goalManagementApi() |
| | | .emergencySuppliesCount(params.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | list.value = res.data.data; |
| | | initPies() |
| | | //禁用左右按钮 |
| | | if(res.data.pageIndex==1){ |
| | | disabledLeft.value = 'disabled-pie' |
| | | }else{ |
| | | disabledLeft.value = '' |
| | | } |
| | | if(res.data.pageIndex==res.data.pages){ |
| | | disabledRight.value = 'disabled-pie' |
| | | }else{ |
| | | disabledRight.value = '' |
| | | } |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }; |
| | | const echarts0 = ref() |
| | | const echarts1 = ref() |
| | | const echarts2 = ref() |
| | | const echarts3 = ref() |
| | | const echarts4 = ref() |
| | | const initPies = () => { |
| | | var myChart0 = echarts.init(echarts0.value); |
| | | var myChart1 = echarts.init(echarts1.value); |
| | | var myChart2 = echarts.init(echarts2.value); |
| | | var myChart3 = echarts.init(echarts3.value); |
| | | var myChart4 = echarts.init(echarts4.value); |
| | | myChart0.clear() |
| | | myChart1.clear() |
| | | myChart2.clear() |
| | | myChart3.clear() |
| | | myChart4.clear() |
| | | for(var a = 0;a<list.value.length;a++){ |
| | | var option = { |
| | | tooltip: { |
| | | trigger: 'item', |
| | | show:false |
| | | }, |
| | | color:['#24c548'], |
| | | title: { |
| | | text: list.value[a].name+'\n'+list.value[a].totalNum, |
| | | x: 127, |
| | | y: 63, |
| | | textAlign:'center', |
| | | textStyle: { |
| | | color: '#24c548', |
| | | fontSize: 25, |
| | | fontWeight: "bold", |
| | | fontFamily:'D-DIN', |
| | | textShadowColor:'red' |
| | | }, |
| | | }, |
| | | series: [ |
| | | { |
| | | name: null, |
| | | type: 'pie', |
| | | radius: ['80%', '90%'], |
| | | avoidLabelOverlap: false, |
| | | itemStyle: { |
| | | borderRadius: 10, |
| | | borderColor: '#fff', |
| | | borderWidth: 0 |
| | | }, |
| | | label: { |
| | | show: false, |
| | | position: 'center' |
| | | }, |
| | | labelLine: { |
| | | show: false |
| | | }, |
| | | data: [ |
| | | { value: list.value[a].totalNum, name: list.value[a].name }, |
| | | ] |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | |
| | | if(a==0){ |
| | | var option0 = deepClone(option) |
| | | option0.color = ['#24c548'] |
| | | option0.title.textStyle.color = '#24c548' |
| | | myChart0.setOption(option0, true); |
| | | } |
| | | if(a==1){ |
| | | var option1 = deepClone(option) |
| | | option1.color = ['#e7bd27'] |
| | | option1.title.textStyle.color = '#e7bd27' |
| | | myChart1.setOption(option1, true); |
| | | } |
| | | if(a==2){ |
| | | var option2 = deepClone(option) |
| | | option2.color = ['#e65c3e'] |
| | | option2.title.textStyle.color = '#e65c3e' |
| | | myChart2.setOption(option2, true); |
| | | } |
| | | if(a==3){ |
| | | var option3 = deepClone(option) |
| | | option3.color = ['#8e66e7'] |
| | | option3.title.textStyle.color = '#8e66e7' |
| | | myChart3.setOption(option3, true); |
| | | } |
| | | if(a==4){ |
| | | var option4 = deepClone(option) |
| | | option4.color = ['#28b8d6'] |
| | | option4.title.textStyle.color = '#28b8d6' |
| | | myChart4.setOption(option4, true); |
| | | } |
| | | } |
| | | |
| | | }; |
| | | |
| | | const form = ref({ |
| | | type:1, |
| | | deptId:1 |
| | | }); |
| | | //部门 |
| | | const department = () => { |
| | | goalManagementApi() |
| | | .getTreedepartment() |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | data.value = res.data.data; |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }; |
| | | const propse = { |
| | | label: 'depName', |
| | | children: 'children', |
| | | value: 'depId', |
| | | }; |
| | | const eaclick=()=>{ |
| | | listApi() |
| | | } |
| | | onMounted(() => { |
| | | listApi() |
| | | department(); |
| | | emergencySuppliesCount() |
| | | }); |
| | | const day=ref(0) |
| | | const listApi=()=>{ |
| | | goalManagementApi().emergencyStat(form.value).then(res=>{ |
| | | if(res.data.code==200){ |
| | | day.value=res.data.data.days |
| | | let date=[] |
| | | let names=[] |
| | | res.data.data.dataList.forEach(item => { |
| | | date.push(item.num) |
| | | names.push(item.name) |
| | | }); |
| | | init(date,names) |
| | | } |
| | | }) |
| | | } |
| | | const main = ref(); |
| | | const init = (data: any,names:any) => { |
| | | var myChart = echarts.init(main.value); |
| | | var option = { |
| | | tooltip: {}, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '5%', |
| | | containLabel: true, |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: names, |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | name: '次数', |
| | | nameTextStyle: { |
| | | color: '#aaa', |
| | | nameLocation: 'start', |
| | | }, |
| | | }, |
| | | color: ['#6394f9'], |
| | | series: [ |
| | | { |
| | | data: data, |
| | | barWidth : 40, |
| | | type: 'bar', |
| | | }, |
| | | ], |
| | | }; |
| | | |
| | | myChart.setOption(option); |
| | | }; |
| | | const data = ref([]) |
| | | return { |
| | | form, |
| | | main, |
| | | init, |
| | | data, |
| | | department, |
| | | propse, |
| | | listApi, |
| | | eaclick, |
| | | day, |
| | | list, |
| | | emergencySuppliesCount, |
| | | params, |
| | | initPies, |
| | | leftClick, |
| | | rightClick, |
| | | echarts0, |
| | | echarts1, |
| | | echarts2, |
| | | echarts3, |
| | | echarts4, |
| | | disabledRight, |
| | | disabledLeft |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .title{ |
| | | text-align: center; |
| | | padding: 20px 0; |
| | | } |
| | | .echart { |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | } |
| | | .el-form { |
| | | padding: 20px 0; |
| | | } |
| | | .pie-body{ |
| | | width: 50%; |
| | | height: 370px; |
| | | display: flex; |
| | | justify-content: space-around; |
| | | flex-wrap: wrap; |
| | | position: relative; |
| | | } |
| | | .pie-item{ |
| | | width: 32%; |
| | | height: 48%; |
| | | margin-right: 1%; |
| | | margin-bottom: 1%; |
| | | } |
| | | .pie-left{ |
| | | position: absolute; |
| | | width: 30px; |
| | | height: 30px; |
| | | left: 0; |
| | | top: 48%; |
| | | cursor: pointer; |
| | | } |
| | | .pie-right{ |
| | | position: absolute; |
| | | width: 30px; |
| | | height: 30px; |
| | | right: 0; |
| | | top: 48%; |
| | | cursor: pointer; |
| | | } |
| | | .disabled-pie{ |
| | | pointer-events:none; |
| | | color: #9b9da1; |
| | | } |
| | | </style> |
| | |
| | | </div> |
| | | <div class="button_Line"> |
| | | <div class="button_Left"> |
| | | <el-button size="default" type="warning" plain :disabled="warning"> |
| | | <el-button size="default" type="warning" plain :disabled="warning" @click="onEdit('修改',deleteAll[0])"> |
| | | <el-icon> |
| | | <Edit /> |
| | | </el-icon>修改 |
| | |
| | | <el-button size="default" type="primary" @click="onOpenAdd"> |
| | | <el-icon> <Plus /> </el-icon>新建 |
| | | </el-button> |
| | | <el-button size="default" type="warning" plain :disabled="warning"> |
| | | <el-button size="default" type="warning" plain :disabled="warning" @click="onEdit('修改', deletAll[0])"> |
| | | <el-icon> <Edit /> </el-icon>修改 |
| | | </el-button> |
| | | <el-button size="default" type="danger" plain @click="onDeleteAll" :disabled="danger"> |
| | |
| | | danger, |
| | | total, |
| | | onUser, |
| | | deletAll |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | <el-button size="default" type="primary" @click="onOpenAdd"> |
| | | <el-icon> <Plus /> </el-icon>新建 |
| | | </el-button> |
| | | <el-button size="default" type="warning" plain :disabled="warning"> |
| | | <el-button size="default" type="warning" plain :disabled="warning" @click="onEdit('修改', deletAll[0])"> |
| | | <el-icon> <Edit /> </el-icon>修改 |
| | | </el-button> |
| | | <el-button size="default" type="danger" plain @click="onDeleteAll" :disabled="danger"> |
| | |
| | | onMaintainAdd, |
| | | onInspectAdd, |
| | | onMyAdds, |
| | | deletAll |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | <el-button size="default" type="primary" @click="onOpenAdd('新建')"> |
| | | <el-icon> <Plus /> </el-icon>新建 |
| | | </el-button> |
| | | <el-button size="default" type="warning" plain :disabled="warning"> |
| | | <el-button size="default" type="warning" plain :disabled="warning" @click="onEdit('修改', deletAll[0])"> |
| | | <el-icon> <Edit /> </el-icon>修改 |
| | | </el-button> |
| | | <el-button size="default" type="danger" plain @click="onDeleteAll" :disabled="danger"> |
| | |
| | | onDeleteAll, |
| | | onEdit, |
| | | onUser, |
| | | deletAll |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | <el-button size="default" type="primary" @click="onOpenAdd"> |
| | | <el-icon> <Plus /> </el-icon>新建 |
| | | </el-button> |
| | | <el-button size="default" type="warning" plain :disabled="warning"> |
| | | <el-button size="default" type="warning" plain :disabled="warning" @click="onEdit('修改', deleteAll[0])"> |
| | | <el-icon> <Edit /> </el-icon>修改 |
| | | </el-button> |
| | | <el-button size="default" type="danger" plain :disabled="danger" @click="onDeleteAll"> |
| | |
| | | .getequipmentInfoStatistics() |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | let arr=[] |
| | | arr=res.data.data |
| | | let date=[] |
| | | let arr = []; |
| | | arr = res.data.data; |
| | | let date = []; |
| | | for (let i = 0; i < arr.length; i++) { |
| | | date.push(arr[i].count) |
| | | if (arr[i].stopStatus == 1) { |
| | | date[0] = arr[i].count; |
| | | } else if (arr[i].stopStatus == 2) { |
| | | date[1] = arr[i].count; |
| | | }else if (arr[i].stopStatus == 3) { |
| | | date[2] = arr[i].count; |
| | | }else if (arr[i].stopStatus == 4) { |
| | | date[3] = arr[i].count; |
| | | }else if (arr[i].stopStatus == -1) { |
| | | date[4] = arr[i].count; |
| | | } |
| | | } |
| | | init(date); |
| | | } else { |
| | |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: ['在用数', '报废数', '维修数', '停用数'], |
| | | data: ['停用 ', '在用', '维修 ', '报废', '超时未保养'], |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button> |
| | | <!-- <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen">修改</el-button> --> |
| | | <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen" |
| | | @click="openD('修改', deletAll[0])">修改</el-button> |
| | | <el-button size="default" :disabled="danger" type="danger" :icon="Delete" @click="onDeleteAll" plain>删除</el-button> |
| | | </div> |
| | | <div> |
| | |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button> |
| | | <!-- <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen">修改</el-button> --> |
| | | <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen" |
| | | @click="openD('修改', deletAll[0])">修改</el-button> |
| | | <el-button size="default" :disabled="danger" type="danger" :icon="Delete" @click="onDeleteAll" plain>删除</el-button> |
| | | </div> |
| | | <div> |
| | |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button> |
| | | <!-- <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen">修改</el-button>--> |
| | | <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen" |
| | | @click="openD('修改', deletAll[0])">修改</el-button> |
| | | <el-button size="default" :disabled="danger" type="danger" :icon="Delete" @click="onDeleteAll" |
| | | plain>删除 |
| | | </el-button> |
| | |
| | | onDeleteAll, |
| | | handleNodeClick, |
| | | timeDate, |
| | | deletAll |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button> |
| | | <!-- <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen">修改</el-button> --> |
| | | <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen" |
| | | @click="openD('修改', deletAll[0])">修改</el-button> |
| | | <el-button size="default" :disabled="danger" type="danger" :icon="Delete" @click="onDeleteAll" plain>删除</el-button> |
| | | </div> |
| | | <div> |
| | |
| | | import { Plus, Delete, Upload, Download, Refresh, View } from '@element-plus/icons-vue'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | |
| | | // import * as XLSX from 'xlsx'; |
| | | import * as XLSX from 'xlsx'; |
| | | |
| | | export default defineComponent({ |
| | | components: { ElButton, ElInput }, |
| | |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button> |
| | | <!-- <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen">修改</el-button> --> |
| | | <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen" |
| | | @click="openD('修改', editRow)">修改</el-button> |
| | | <el-button size="default" :disabled="danger" type="danger" :icon="Delete" plain @click="onDeleteAll">删除 </el-button> |
| | | </div> |
| | | <div> |
| | |
| | | const warning = ref(true); |
| | | const danger = ref(true); |
| | | const deletAll = ref(); |
| | | const editRow = ref() |
| | | const handleSelectionChange = (val: any) => { |
| | | editRow.value = val[0] |
| | | let valId = JSON.parse(JSON.stringify(val)); |
| | | let arr = []; |
| | | for (let i = 0; i < valId.length; i++) { |
| | |
| | | View, |
| | | EditPen, |
| | | Search, |
| | | editRow |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button size="default" type="primary" :icon="Plus" @click="openD('新建')" >新建</el-button> |
| | | <!-- <el-button size="default" type="warning" :disabled="warning" plain :icon="EditPen" @click="openD">修改 </el-button> --> |
| | | <el-button size="default" type="warning" :disabled="warning" plain :icon="EditPen" |
| | | @click="openD('修改', deletAll[0])">修改 </el-button> |
| | | <el-button size="default" type="danger" :disabled="danger" :icon="Delete" plain @click="handleSelectionChange">删除</el-button> |
| | | </div> |
| | | <div> |
| | |
| | | indexNum: '', //目标指标编号 |
| | | memo: '', ////备注信息 |
| | | signDate: '', //责任书签订日期 |
| | | extraFile: '666', //责任书附件 |
| | | extraFile: '', //责任书附件 |
| | | jobId: '', //岗位 |
| | | }); |
| | | const titles = ref(); |
| | |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button> |
| | | <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen">修改</el-button> |
| | | <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen" |
| | | @click="openD('修改', deletAll[0])">修改</el-button> |
| | | <el-button size="default" :disabled="danger" type="danger" :icon="Delete" plain @click="onDeleteAll">删除</el-button> |
| | | </div> |
| | | <div> |
| | |
| | | title: '', ////考核标题 |
| | | }); |
| | | const titles = ref(); |
| | | const titleT = ref(); |
| | | const disabled = ref(false); |
| | | // 打开弹窗 |
| | | const openDailog = (title: string, value: any, id: number) => { |
| | | department(); |
| | | dialogVisible.value = true; |
| | | titles.value = `${title}安全考核管理`; |
| | | titleT.value=title |
| | | disabled.value = title == '查看' ? true : false; |
| | | if (title == '查看' || title == '修改') |
| | | goalManagementApi() |
| | |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | if(titleT.value=='新建'){ |
| | | delete form.value.id |
| | | } |
| | | dialogVisible.value = false; |
| | | let arr = []; |
| | | for (let i = 0; i < form.value.numberDetailJson.length; i++) { |
| | |
| | | console.log(form.value); |
| | | }; |
| | | return { |
| | | titleT, |
| | | rules, |
| | | timeC, |
| | | numberC, |
| | |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="适用范围" size="default"> |
| | | <el-select v-model="form.applyRange" style="width: 100%" placeholder="请选择"> |
| | | <el-option label="安全生产xxx" value="1" /> |
| | | <el-option label="安全生产xxx" value="2" /> |
| | | <el-option label="安全生产责任制考核1" value="1" /> |
| | | <el-option label="安全生产责任制考核2" value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | applyRange: '', ////适用范围 |
| | | }); |
| | | const titles = ref(); |
| | | const titleT = ref(); |
| | | const disabled = ref(false); |
| | | const clickType = ref(false); |
| | | // 打开弹窗 |
| | | const openDailog = (title: string, value: any, id: number) => { |
| | | dialogVisible.value = true; |
| | | titles.value = `${title}安全考核管理`; |
| | | titleT.value=title |
| | | disabled.value = title == '查看' ? true : false; |
| | | if (title == '查看' || title == '修改') { |
| | | goalManagementApi() |
| | |
| | | }; |
| | | // 提交 |
| | | const submitForm = () => { |
| | | if(titleT.value=='新建'){ |
| | | delete form.value.id |
| | | } |
| | | dialogVisible.value = false; |
| | | goalManagementApi() |
| | | .getexamineTemplateAddOrUpdate(form.value) |
| | |
| | | } |
| | | }; |
| | | return { |
| | | titleT, |
| | | index, |
| | | form, |
| | | dialogVisible, |
| | |
| | | <el-input v-model="ruleForm.checkPass" placeholder="目标指标编号" /> |
| | | </el-form-item> |
| | | </el-col> --> |
| | | <el-col :span="6" :offset="1"> |
| | | <el-col :span="11" :offset="1"> |
| | | <el-form-item> |
| | | <el-button size="default" type="primary" @click="listApi()">查询</el-button> |
| | | <el-button size="default" @click="reset">重置</el-button> |
| | |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button> |
| | | <!-- <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen">修改</el-button> --> |
| | | <el-button size="default" :disabled="warning" type="warning" plain :icon="EditPen" |
| | | @click="openD('修改', deletAll[0])">修改</el-button> |
| | | <el-button size="default" :disabled="danger" type="danger" plain :icon="Delete" @click="onDeleteAll">删除</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" title="目标考核" width="70%" draggable @close="closeDialog"> |
| | | <el-dialog v-model="dialogVisible" :before-close="resetForm" :fullscreen="full" title="目标分解" width="60%" draggable> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form :model="form" label-width="120px"> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="安全目标指标" size="default"> |
| | | <el-input v-model="form.qName" :disabled="disabled"> |
| | | <template #append> <el-button :icon="Search" @click="daiInpt" /> </template |
| | | ></el-input> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="daiInpt" /> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> |
| | | <el-tabs v-model="activeName" class="demo-tabs"> |
| | | <el-tab-pane label="目标指标分解" name="1"> |
| | | <el-button type="primary" size="default" @click="daiAdd('新增')" :disabled="disabled">新增</el-button> |
| | | <!-- <el-button type="primary" size="default" @click="daiAdd('新增')" :disabled="disabled">新增</el-button> --> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <el-table :data="formUp.examineList" style="width: 100%"> |
| | | <el-table-column align="center" type="index" label="序号" width="70" /> |
| | | <el-table-column align="center" prop="dutyDepartmentName" label="责任部门" /> |
| | | <el-table-column align="center" prop="examineValue" label="考核指标" /> |
| | | <el-table-column align="center" prop="makerDepartmentName" label="制定部门" /> |
| | | <el-table-column align="center" prop="makeDate" label="制定日期" /> |
| | | <el-table-column align="center" prop="uploadValue" label="上报值" /> |
| | | <el-table-column align="center" prop="uploadDate" label="上报时间" /> |
| | | <el-table-column align="center" prop="examineResult" label="考核结果" > |
| | | <template #default="scope"> |
| | | <div v-if="scope.row.examineResult==1"> |
| | | 合格 |
| | | </div> |
| | | <div v-if="scope.row.examineResult==2"> |
| | | 不合格 |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="examinePersonName" label="考核人" /> |
| | | <el-table-column align="center" prop="examineDate" label="考核时间" /> |
| | | <el-table :data="formUp.targetDivideDetailList" style="width: 100%"> |
| | | <el-table-column align="center" property="dutyDepartmentName" label="责任部门" width="180" /> |
| | | <el-table-column align="center" property="value" label="考核指标" width="180" /> |
| | | <el-table-column align="center" property="makerDepartmentName" label="制定人部门" /> |
| | | <el-table-column align="center" property="makeDate" :formatter="timeDate" label="制定日期" /> |
| | | <el-table-column align="center" property="commitPersonName" label="上报人" /> |
| | | <el-table-column align="center" label="操作"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="daiAdd('查看', scope.row)">查看</el-button> |
| | | <el-button link type="primary" @click="daiAdd('修改', scope.row)">修改</el-button> |
| | | <el-button link type="primary" @click="Delete(scope.row)">删除</el-button> |
| | | <el-button link :disabled="disabled" type="primary" @click="daiAdd('修改', scope.row)">考核</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="closeDialog" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm" size="default">确定</el-button> |
| | | <el-button @click="resetForm" size="default">关闭</el-button> |
| | | <el-button type="primary" v-if="disabled == false" @click="submitForm" size="default">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <DailogSearch ref="Shows" @backNum="onNumber"></DailogSearch> |
| | | <DailogAdd ref="Show" @onAdd="add"></DailogAdd> |
| | | <DailogSearch ref="Shows" @backNum="onNumber"></DailogSearch> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, reactive } from 'vue'; |
| | | import { timeDate } from '/@/assets/index.ts'; |
| | | import { Search, FullScreen } from '@element-plus/icons-vue'; |
| | | import DailogAdd from './DailogAdd.vue'; |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext } from 'element-plus'; |
| | | import DailogSearch from '../../../../components/DailogSearch/DailogSearch.vue'; |
| | | import DailogAdd from './DailogAdd.vue'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | import {deepClone} from "/@/utils/other"; |
| | | import { emit } from 'process'; |
| | | import { deepClone } from '/@/utils/other'; |
| | | export default defineComponent({ |
| | | components: { DailogSearch ,DailogAdd}, |
| | | setup() { |
| | | components: { DailogAdd, DailogSearch }, |
| | | setup(props, { emit }) { |
| | | const dialogVisible = ref<boolean>(false); |
| | | const form = ref({}); |
| | | const form = ref({ |
| | | qName: '', |
| | | indexNum: '', |
| | | year: '', |
| | | value: '', |
| | | targetDivideDetailList: [], |
| | | }); |
| | | const targetType = ref(); |
| | | const disabled = ref(false); |
| | | const titles = ref(); |
| | | const numId=ref() |
| | | const openDailog = (title: string, type: any, id: number) => { |
| | | dialogVisible.value = true; |
| | | titles.value = title; |
| | | targetType.value = type; |
| | | |
| | | disabled.value = title == '查看' ? true : false; |
| | | if (title == '查看' || title == '修改') { |
| | | goalManagementApi() |
| | | .gettargetExamineDetail(id) |
| | | .getTargetMngDetail(id) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | form.value = res.data.data; |
| | | formUp.examineList = res.data.data.examineList |
| | | formUp.targetDivideDetailList = form.value.targetDivideDetailList; |
| | | for(let i=0;i<formUp.targetDivideDetailList.length;i++){ |
| | | formUp.targetDivideDetailList[i].makeDate=timeC(formUp.targetDivideDetailList[i].makeDate) |
| | | } |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | } |
| | | numId.value=id |
| | | }; |
| | | const closeDialog = () => { |
| | | form.value = {} |
| | | formUp.examineList = [] |
| | | dialogVisible.value = false |
| | | const timeC = (timestamp: any) => { |
| | | let a = new Date(timestamp).getTime(); |
| | | const date = new Date(a); |
| | | const Y = date.getFullYear() + '-'; |
| | | const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | const D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' '; |
| | | const h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'; |
| | | const m = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes(); |
| | | const s = date.getSeconds(); // 秒 |
| | | const dateString = Y + M + D + h + m +`:${s}`; |
| | | // console.log('dateString', dateString); // > dateString 2021-07-06 14:23 |
| | | return dateString; |
| | | }; |
| | | const submitForm = () => { |
| | | // formUp.delTargetDivideDetails = arr.value.toString(); |
| | | // formUp.targetId = form.value.id; |
| | | dialogVisible.value = false; |
| | | for(let i=0;i<formUp.examineList.length;i++){ |
| | | delete formUp.examineList[i].dutyDepartmentName |
| | | delete formUp.examineList[i].makerDepartmentName |
| | | } |
| | | formUp.id = form.value.id |
| | | formUp.delIds = arr.value.toString(); |
| | | const onNumber = (val: object) => { |
| | | form.value = val; |
| | | }; |
| | | // 导航 |
| | | const activeName = ref('1'); |
| | | // 表格 |
| | | const tableData = ref([]); |
| | | // 新增弹窗 |
| | | const index = ref<any>(); |
| | | const Show = ref(); |
| | | const daiAdd = (title: string, data: any) => { |
| | | index.value = formUp.targetDivideDetailList.indexOf(data); |
| | | Show.value.openDailog(title, data); |
| | | }; |
| | | const formUp = reactive({ |
| | | targetId: '', //关联的目标指标/外键 |
| | | delTargetDivideDetails: '', //要删除的目标指标分解ID,多个用逗号隔开 |
| | | targetDivideDetailList: [], //目标指标分解列表 |
| | | }); |
| | | |
| | | const add = (val: any) => { |
| | | goalManagementApi() |
| | | .gettargetExamineAddOrUpdate(formUp) |
| | | .getTargetMngDetail(numId.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | form.value = res.data.data; |
| | | formUp.targetDivideDetailList = form.value.targetDivideDetailList; |
| | | for(let i=0;i<formUp.targetDivideDetailList.length;i++){ |
| | | formUp.targetDivideDetailList[i].makeDate=timeC(formUp.targetDivideDetailList[i].makeDate) |
| | | } |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | |
| | | // let obj=JSON.parse(JSON.stringify(form.value)) |
| | | }; |
| | | // 新增 |
| | | const submitForm = () => { |
| | | formUp.delTargetDivideDetails = arr.value.toString(); |
| | | formUp.targetId = form.value.id; |
| | | dialogVisible.value = false; |
| | | for(let i=0;i<formUp.targetDivideDetailList.length;i++){ |
| | | delete formUp.targetDivideDetailList[i].dutyDepartmentName |
| | | delete formUp.targetDivideDetailList[i].makerDepartmentName |
| | | } |
| | | goalManagementApi() |
| | | .gettargetDivideDetail(formUp) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | |
| | | indexNum: '', |
| | | year: '', |
| | | value: '', |
| | | examineList: [], |
| | | targetDivideDetailList: [], |
| | | }; |
| | | tableData.value = []; |
| | | formUp.targetId = ''; |
| | | formUp.delTargetDivideDetails = ''; |
| | | formUp.examineList = []; |
| | | formUp.targetDivideDetailList = []; |
| | | }; |
| | | const arr = ref([]); |
| | | // 删除 |
| | | const Delete = (data: any) => { |
| | | formUp.examineList.splice(form.value.examineList.indexOf(data), 1); |
| | | arr.value.push(data.id); |
| | | }; |
| | | const onNumber = (e: object) => { |
| | | form.value = e; |
| | | }; |
| | | // 导航 |
| | | const activeName = ref('1'); |
| | | // 表格 |
| | | const tableData = ref([]); |
| | | // 安全目标指标弹窗 |
| | | const Shows = ref(); |
| | | const daiInpt = () => { |
| | | Shows.value.openDailog(targetType.value); |
| | | }; |
| | | |
| | | // 新增弹窗 |
| | | const index=ref<any>() |
| | | const Show = ref(); |
| | | const daiAdd = (title: string, data: any) => { |
| | | index.value = formUp.examineList.indexOf(data); |
| | | Show.value.openDailog(title, data); |
| | | // 关闭 |
| | | const resetForm = () => { |
| | | dialogVisible.value = false; |
| | | form.value = { |
| | | qName: '', |
| | | indexNum: '', |
| | | year: '', |
| | | value: '', |
| | | targetDivideDetailList: [], |
| | | }; |
| | | const formUp = reactive({ |
| | | targetId: '', //关联的目标指标/外键 |
| | | delTargetDivideDetails: '', //要删除的目标指标分解ID,多个用逗号隔开 |
| | | examineList: [], //目标指标分解列表 |
| | | }); |
| | | |
| | | const add = (val: any) => { |
| | | const item = deepClone(val) |
| | | if(index.value==-1){ |
| | | |
| | | formUp.examineList.push(item); |
| | | }else{ |
| | | formUp.examineList[index.value] = item; |
| | | } |
| | | console.log(formUp) |
| | | // let obj=JSON.parse(JSON.stringify(form.value)) |
| | | tableData.value = []; |
| | | formUp.targetId = ''; |
| | | formUp.delTargetDivideDetails = ''; |
| | | formUp.targetDivideDetailList = []; |
| | | }; |
| | | |
| | | //全屏 |
| | | const full = ref(false); |
| | | const toggleFullscreen = () => { |
| | |
| | | full.value = false; |
| | | } |
| | | }; |
| | | // 时间格式处理 |
| | | // const timeDate = (data: any) => { |
| | | // let result = new Date(data).getTime(); |
| | | // return result; |
| | | // }; |
| | | return { |
| | | timeC, |
| | | index, |
| | | timeDate, |
| | | arr, |
| | | form, |
| | | dialogVisible, |
| | | openDailog, |
| | | targetType, |
| | | onNumber, |
| | | disabled, |
| | | titles, |
| | | activeName, |
| | | tableData, |
| | | Show, |
| | | daiAdd, |
| | | Shows, |
| | | daiInpt, |
| | | Search, |
| | | full, |
| | | toggleFullscreen, |
| | | FullScreen, |
| | | daiAdd, |
| | | index, |
| | | Show, |
| | | formUp, |
| | | onNumber, |
| | | targetType, |
| | | disabled, |
| | | resetForm, |
| | | titles, |
| | | add, |
| | | closeDialog, |
| | | formUp, |
| | | submitForm, |
| | | Delete |
| | | numId |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | <el-dialog v-model="dialogVisible" :fullscreen="full" :title="titles" width="50%" draggable @close="resetForm(ruleFormRef)"> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form :model="form" :disabled="disabled" label-width="120px" ref="ruleFormRef" :rules="rules"> |
| | | <el-row> |
| | | <!-- <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="责任部门" prop="dutyDepartmentId" size="default"> |
| | | <el-tree-select v-model="form.dutyDepartmentId" check-strictly="true" @current-change="dutyName" :data="data" class="w100" :props="propse" placeholder="请选择" /> |
| | |
| | | <el-col :span="11"> |
| | | <el-form-item label="上报值" prop="uploadValue" size="default"> |
| | | <el-input v-model="form.uploadValue"> |
| | | <!-- <template #append> <el-button :icon="Search" @click="openUser" /> </template>--> |
| | | <template #append> <el-button :icon="Search" @click="openUser" /> </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-date-picker v-model="form.uploadDate" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="请选择" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-row> --> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="考核结果" prop="examineResult" size="default"> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <!-- <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="考核时间" prop="examineDate" size="default"> |
| | | <el-date-picker v-model="form.examineDate" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="请选择" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"></el-col> |
| | | </el-row> |
| | | </el-row> --> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | |
| | | <el-button @click="resetForm(ruleFormRef)" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm(ruleFormRef)" size="default">确定</el-button> |
| | | </span> |
| | |
| | | export default defineComponent({ |
| | | components: { DailogSearchUser }, |
| | | setup(props, { emit }) { |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | const form = ref({ |
| | | "dutyDepartmentId": '', ////责任部门id/外键 |
| | | "examineDate": '', ////考核时间 |
| | | "examinePersonId": '', ////考核人ID/外键 |
| | | "examineResult": '', ////考核结果 1:合格 2:不合格 |
| | | "examineValue": '', ////考核指标 |
| | | "makeDate": '', ////制定日期 |
| | | "makerDepartmentId": '', ////制定部门/外键 |
| | | "uploadDate": '', ////上报时间 |
| | | "uploadValue": "", ////上报值 |
| | | targetDivideDetailId: "", //关联的目标分解/外键 |
| | | examinePersonId: "", |
| | | examinePersonName: '', |
| | | examineResult: "", //考核结果 1:合格 2:不合格 |
| | | id: "", //目标指标ID |
| | | }); |
| | | //部门 |
| | | const department = () => { |
| | | goalManagementApi() |
| | | .getTreedepartment() |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | data.value = res.data.data; |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }; |
| | | const propse = { |
| | | label: 'depName', |
| | | children: 'children', |
| | | value: 'depId', |
| | | }; |
| | | onMounted(() => { |
| | | department(); |
| | | }); |
| | | // const department = () => { |
| | | // goalManagementApi() |
| | | // .getTreedepartment() |
| | | // .then((res) => { |
| | | // if (res.data.code == 200) { |
| | | // data.value = res.data.data; |
| | | // } else { |
| | | // ElMessage.error(res.data.msg); |
| | | // } |
| | | // }); |
| | | // }; |
| | | // const propse = { |
| | | // label: 'depName', |
| | | // children: 'children', |
| | | // value: 'depId', |
| | | // }; |
| | | // onMounted(() => { |
| | | // department(); |
| | | // }); |
| | | const disabled = ref(false); |
| | | // 开启弹窗 |
| | | const titles = ref(); |
| | |
| | | if (title == '查看') { |
| | | disabled.value = true; |
| | | form.value = data; |
| | | // form.value.id = data.targetId; |
| | | form.value.targetDivideDetailId=data.id |
| | | form.value.examinePersonName = data.examinePersonName; |
| | | form.value.examinePersonId=data.examinePersonId |
| | | form.value.examineResult=data.examineResult |
| | | } else if (title == '修改') { |
| | | console.log(data) |
| | | disabled.value = false; |
| | | form.value = data; |
| | | // form.value.id = data.targetId; |
| | | form.value.targetDivideDetailId=data.id |
| | | form.value.examinePersonName = data.examinePersonName; |
| | | form.value.examinePersonId=data.examinePersonId |
| | | form.value.examineResult=data.examineResult |
| | | } else { |
| | | disabled.value = false; |
| | | } |
| | |
| | | Show.value.openDailog(); |
| | | }; |
| | | const rules = reactive<FormRules>({ |
| | | dutyDepartmentId: [ |
| | | { |
| | | required: true, |
| | | message: '责任部门不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | makerDepartmentId: [ |
| | | { |
| | | required: true, |
| | | message: '制定人部门不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | commitPersonId: [ |
| | | { |
| | | required: true, |
| | | message: '上报人不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | examineValue: [ |
| | | { |
| | | required: true, |
| | | message: '考核指标值不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | { |
| | | type: 'number', |
| | | message: '考核指标值只能为数字类型', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | makeDate: [ |
| | | { |
| | | required: true, |
| | | message: '制定日期不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | commitPersonName: [], |
| | | // dutyDepartmentId: [ |
| | | // { |
| | | // required: true, |
| | | // message: '责任部门不能为空', |
| | | // trigger: 'blur', |
| | | // }, |
| | | // ], |
| | | // makerDepartmentId: [ |
| | | // { |
| | | // required: true, |
| | | // message: '制定人部门不能为空', |
| | | // trigger: 'blur', |
| | | // }, |
| | | // ], |
| | | // commitPersonId: [ |
| | | // { |
| | | // required: true, |
| | | // message: '上报人不能为空', |
| | | // trigger: 'blur', |
| | | // }, |
| | | // ], |
| | | // examineValue: [ |
| | | // { |
| | | // required: true, |
| | | // message: '考核指标值不能为空', |
| | | // trigger: 'blur', |
| | | // }, |
| | | // { |
| | | // type: 'number', |
| | | // message: '考核指标值只能为数字类型', |
| | | // trigger: 'blur', |
| | | // }, |
| | | // ], |
| | | // makeDate: [ |
| | | // { |
| | | // required: true, |
| | | // message: '制定日期不能为空', |
| | | // trigger: 'blur', |
| | | // }, |
| | | // ], |
| | | examinePersonName: [], |
| | | examineResult:[] |
| | | |
| | | }); |
| | | const dutyName=(data:any)=>{ |
| | | form.value.dutyDepartmentName=data.depName |
| | | } |
| | | const makerDepartmentName=(data:any)=>{ |
| | | form.value.makerDepartmentName=data.depName |
| | | } |
| | | // const dutyName = (data: any) => { |
| | | // form.value.dutyDepartmentName = data.depName; |
| | | // }; |
| | | // const makerDepartmentName = (data: any) => { |
| | | // form.value.makerDepartmentName = data.depName; |
| | | // }; |
| | | |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | emit('onAdd', form.value); |
| | | console.log(form.value) |
| | | dialogVisible.value = false; |
| | | goalManagementApi().gettargetExamineAddOrUpdate(form.value).then(res=>{ |
| | | if(res.data.code==200){ |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | }else{ |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }) |
| | | // handleClose(formEl) |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | emit('onAdd'); |
| | | }; |
| | | |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | // console.log(formEl); |
| | | if (!formEl) return |
| | | formEl.resetFields(); |
| | | if (!formEl) return; |
| | | // formEl.resetFields(); |
| | | dialogVisible.value = false; |
| | | form.value={} |
| | | form.value = {}; |
| | | }; |
| | | // const handleClose = (formEl: any) => { |
| | | // formEl.resetFields(); |
| | |
| | | full.value = false; |
| | | } |
| | | }; |
| | | const data = ref(); |
| | | // const data = ref(); |
| | | const onUser = (e: any) => { |
| | | console.log(e) |
| | | console.log(e); |
| | | form.value.examinePersonId = e.uid; |
| | | form.value.examinePersonName = e.realName; |
| | | }; |
| | |
| | | titles, |
| | | // handleClose, |
| | | form, |
| | | propse, |
| | | department, |
| | | // propse, |
| | | // department, |
| | | dialogVisible, |
| | | openDailog, |
| | | Show, |
| | |
| | | full, |
| | | toggleFullscreen, |
| | | FullScreen, |
| | | data, |
| | | // data, |
| | | onUser, |
| | | ruleFormRef, |
| | | rules, |
| | | submitForm, |
| | | resetForm, |
| | | dutyName, |
| | | makerDepartmentName |
| | | // dutyName, |
| | | // makerDepartmentName, |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | </el-row> |
| | | </el-form> |
| | | <div class="minCenter"> |
| | | <el-tabs v-model="ruleForm.searchParams.targetType" class="demo-tabs" @tab-click="handleClick"> |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button> |
| | | <!-- <el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button> --> |
| | | </div> |
| | | <div> |
| | | <!-- <el-button size="default" :icon="Refresh"></el-button> --> |
| | | </div> |
| | | </div> |
| | | <el-tab-pane label="目标定制(年)" name="1"> </el-tab-pane> |
| | | <el-tab-pane label="目标定制(月)" name="2"></el-tab-pane> |
| | | <el-tab-pane label="目标定制(半年)" name="3"></el-tab-pane> |
| | | <el-tab-pane label="目标定制(季度)" name="4"></el-tab-pane> |
| | | </el-tabs> |
| | | <el-table ref="multipleTableRef" :data="tableData" style="width: 100%"> |
| | | <el-table-column label="序号" align="center" type="index" width="70" /> |
| | | <el-table-column type="expand"> |
| | | <template #default="scope"> |
| | | <div class="tableC"> |
| | | <el-tabs v-model="activeNames"> |
| | | <el-tab-pane label="目标指标分解" name="1"> |
| | | <el-table :data="scope.row.targetDivideDetailList" style="width: 100%"> |
| | | <el-table-column align="center" prop="dutyDepartmentName" label="责任部门" /> |
| | | <el-table-column align="center" prop="value" label="考核指标" /> |
| | | <el-table-column align="center" prop="makerDepartmentName" label="制定人部门" /> |
| | | <el-table-column align="center" prop="makeDate" :formatter="timeDate" label="制定日期" /> |
| | | <el-table-column align="center" prop="commitPersonName" label="上报人" /> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="安全目标指标" align="center" property="qName" sortable /> |
| | | <el-table-column property="indexNum" align="center" label="考核指标编号" sortable /> |
| | | <el-table-column property="year" label="年度" align="center" sortable show-overflow-tooltip /> |
| | |
| | | <el-table-column label="操作" align="center" width="300" sortable show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="default" :icon="View" @click="openD('查看', scope.row.id)">查看</el-button> |
| | | <el-button link type="primary" size="default" :icon="View" @click="openD('修改', scope.row.id)">修改</el-button> |
| | | <el-button link type="primary" size="default" :icon="View" @click="openD('修改', scope.row.id)">考核</el-button> |
| | | <!--<el-button link type="primary" size="default" :icon="Delete" @click="onDelete(scope.row.id)">删除</el-button>--> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { timeDate } from '/@/assets/index.ts'; |
| | | import Dailog from './component/Dailog.vue'; |
| | | import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus'; |
| | |
| | | qName: '', ////安全目标指标 |
| | | indexNum: '', ////目标指标编号 |
| | | targetType: '1', ////指标类型 1:年指标 2:月指标 |
| | | divideStatus: '', ////分解状态 1:已分解 2:未分解 |
| | | divideStatus: 1, ////分解状态 1:已分解 2:未分解 |
| | | }, |
| | | }); |
| | | // 重置 |
| | |
| | | }; |
| | | const listApi = () => { |
| | | goalManagementApi() |
| | | .getTargetMngList(ruleForm) |
| | | .gettargetExamineList(ruleForm) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | tableData.value = res.data.data; |
| | |
| | | const openD = (title: String, id: number) => { |
| | | openAdd.value.openDailog(title, ruleForm.searchParams.targetType, id); |
| | | }; |
| | | |
| | | const activeNames=ref("1") |
| | | return { |
| | | timeDate, |
| | | activeNames, |
| | | listApi, |
| | | ruleForm, |
| | | resetForm, |
| | |
| | | display: flex; |
| | | justify-content: right; |
| | | } |
| | | .tableC { |
| | | margin: 0 10%; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div> |
| | | <!-- <el-form :model="ruleForm" status-icon label-width="20px" class="topTitle"> |
| | | <el-row> |
| | | <el-col :span="4"> |
| | | <el-form-item> |
| | | <el-input v-model="ruleForm.searchParams.qName" size="default" placeholder="安全目标指标" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item> |
| | | <el-input v-model="ruleForm.searchParams.indexNum" size="default" placeholder="目标指标编号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="16"> |
| | | <el-form-item> |
| | | <el-button type="primary" size="default" @click="listApi">查询</el-button> |
| | | <el-button size="default" @click="resetForm">重置</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> --> |
| | | <div class="minCenter"> |
| | | <div class="btns"> |
| | | <div> |
| | | <el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button> |
| | | <el-button size="default" type="warning" :disabled="warning" :icon="EditPen" plain @click="openD('修改', deletAll[0])">修改</el-button> |
| | | <el-button size="default" type="danger" :disabled="danger" :icon="Delete" plain @click="onDeleteAll">删除</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table ref="multipleTableRef" :data="tableData" @selection-change="handleSelectionChange" style="width: 100%"> |
| | | <el-table-column label="序号" align="center" type="index" width="70" /> |
| | | <el-table-column type="selection" align="center" width="55" /> |
| | | <el-table-column label="名称" align="center" property="typeName" sortable /> |
| | | <el-table-column property="memo" align="center" label="描述" sortable /> |
| | | <!-- <el-table-column property="year" label="年度" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="value" label="指标值" align="center" sortable show-overflow-tooltip /> --> |
| | | <el-table-column label="操作" align="center" sortable show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="View" @click="openD('查看', scope.row.id)">查看</el-button> |
| | | <el-button link type="primary" size="small" :icon="EditPen" @click="openD('修改', scope.row.id)">修改</el-button> |
| | | <el-button link type="primary" size="small" :icon="Delete" @click="onDelete(scope.row.id)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pages"> |
| | | <el-pagination |
| | | v-model:currentPage="currentPage4" |
| | | v-model:page-size="pageSize4" |
| | | :page-sizes="[10, 20, 30, 40]" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <DailogClass ref="Show" @onAdd="add"></DailogClass> |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import DailogClass from '/@/components/DailogClass/index.vue'; |
| | | import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus'; |
| | | import { Plus, Delete, Upload, Download, Refresh, View, EditPen } from '@element-plus/icons-vue'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | export default defineComponent({ |
| | | components: { ElButton, ElInput,DailogClass }, |
| | | setup() { |
| | | // 搜索条件 |
| | | const ruleForm = reactive({ |
| | | pageSize: 10, |
| | | pageIndex: 1, |
| | | searchParams: { |
| | | typeName: '', ////分类名称 |
| | | }, |
| | | }); |
| | | // 下方导航与表格 |
| | | const tableData = ref([]); |
| | | const currentPage4 = ref(); |
| | | const pageSize4 = ref(); |
| | | const total = ref(); |
| | | // const resetForm = () => { |
| | | // ruleForm.searchParams.qName = ''; |
| | | // ruleForm.searchParams.indexNum = ''; |
| | | // listApi(); |
| | | // }; |
| | | const listApi = () => { |
| | | goalManagementApi() |
| | | .gettargetClassList(ruleForm) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | tableData.value = res.data.data; |
| | | currentPage4.value = res.data.pageIndex; |
| | | pageSize4.value = res.data.pageSize; |
| | | total.value = res.data.total; |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }; |
| | | onMounted(() => { |
| | | listApi(); |
| | | }); |
| | | |
| | | const handleSizeChange = (val: number) => { |
| | | // console.log(`${val} items per page`); |
| | | ruleForm.pageSize = val; |
| | | listApi(); |
| | | }; |
| | | const handleCurrentChange = (val: number) => { |
| | | // console.log(`current page: ${val}`); |
| | | ruleForm.pageIndex = val; |
| | | listApi(); |
| | | }; |
| | | const activeNames = ref('1'); |
| | | // 打开弹窗 |
| | | const Show = ref(); |
| | | const openD = (title: String, id: number) => { |
| | | Show.value.openDailog(title, ruleForm.searchParams.targetType,id); |
| | | }; |
| | | // 删除 |
| | | const onDelete = (id: number) => { |
| | | let arr = []; |
| | | arr.push(id); |
| | | ElMessageBox.confirm('确定删除所选项吗?', 'Warning', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | goalManagementApi() |
| | | .gettargetClassDelete(arr) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | listApi(); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | // ElMessage({ |
| | | // type: 'info', |
| | | // message: 'Delete canceled', |
| | | // }); |
| | | }); |
| | | }; |
| | | // 批量删除 |
| | | const warning = ref(true); |
| | | const danger = ref(true); |
| | | const deletAll = ref(); |
| | | const handleSelectionChange = (val: any) => { |
| | | let valId = JSON.parse(JSON.stringify(val)); |
| | | let arr = []; |
| | | for (let i = 0; i < valId.length; i++) { |
| | | arr.push(valId[i].id); |
| | | } |
| | | deletAll.value = arr; |
| | | if (val.length == 1) { |
| | | warning.value = false; |
| | | danger.value = false; |
| | | } else if (val.length == 0) { |
| | | warning.value = true; |
| | | danger.value = true; |
| | | } else { |
| | | warning.value = true; |
| | | danger.value = false; |
| | | } |
| | | }; |
| | | const onDeleteAll = () => { |
| | | ElMessageBox.confirm('确定删除所选项吗?', 'Warning', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | goalManagementApi() |
| | | .gettargetClassDelete(deletAll.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | listApi(); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: 'Delete canceled', |
| | | }); |
| | | }); |
| | | }; |
| | | const add = () => { |
| | | listApi(); |
| | | }; |
| | | return { |
| | | listApi, |
| | | add, |
| | | // resetForm, |
| | | tableData, |
| | | currentPage4, |
| | | pageSize4, |
| | | total, |
| | | ruleForm, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | Show, |
| | | openD, |
| | | activeNames, |
| | | onDelete, |
| | | warning, |
| | | danger, |
| | | deletAll, |
| | | handleSelectionChange, |
| | | onDeleteAll, |
| | | Plus, |
| | | Delete, |
| | | Upload, |
| | | Download, |
| | | Refresh, |
| | | View, |
| | | EditPen, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .topTitle { |
| | | background-color: #fff; |
| | | padding: 20px 0px 20px 0px; |
| | | } |
| | | .minCenter { |
| | | width: 100%; |
| | | background-color: #fff; |
| | | margin-top: 10px; |
| | | padding: 0 20px; |
| | | } |
| | | .btns { |
| | | padding: 20px 0px 10px 0px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | .pages { |
| | | padding: 20px 0; |
| | | display: flex; |
| | | justify-content: right; |
| | | } |
| | | .tableC { |
| | | margin: 0 10%; |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div> |
| | | <el-form :model="ruleForm" status-icon label-width="20px" class="topTitle"> |
| | | <el-row> |
| | | <el-col :span="4"> |
| | | <el-form-item> |
| | | <el-input v-model="ruleForm.searchParams.qName" size="default" placeholder="安全目标指标" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item> |
| | | <el-input v-model="ruleForm.searchParams.indexNum" size="default" placeholder="目标指标编号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="16"> |
| | | <el-form-item> |
| | | <el-button type="primary" size="default" @click="listApi">查询</el-button> |
| | | <el-button size="default" @click="resetForm">重置</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div class="minCenter"> |
| | | <div class="btns"> |
| | | <div> |
| | | <!--<el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button>--> |
| | | <el-button size="default" type="warning" :disabled="warning" :icon="EditPen" plain |
| | | @click="openD('修改', deletAll[0])">修改</el-button> |
| | | <el-button size="default" type="danger" :disabled="danger" :icon="Delete" plain @click="onDeleteAll">删除</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table ref="multipleTableRef" :data="tableData" @selection-change="handleSelectionChange" style="width: 100%"> |
| | | <el-table-column label="序号" align="center" type="index" width="70" /> |
| | | <el-table-column type="selection" align="center" width="55" /> |
| | | <el-table-column type="expand"> |
| | | <template #default="scope"> |
| | | <div class="tableC"> |
| | | <el-tabs v-model="activeNames"> |
| | | <el-tab-pane label="目标指标分解" name="1"> |
| | | <el-table :data="scope.row.targetDivideDetailList" style="width: 100%"> |
| | | <el-table-column align="center" prop="dutyDepartmentName" label="责任部门" /> |
| | | <el-table-column align="center" prop="value" label="考核指标" /> |
| | | <el-table-column align="center" prop="makerDepartmentName" label="制定人部门" /> |
| | | <el-table-column align="center" prop="makeDate" :formatter="timeDate" label="制定日期" /> |
| | | <el-table-column align="center" prop="commitPersonName" label="上报人" /> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="安全目标指标" align="center" property="qName" sortable /> |
| | | <el-table-column property="indexNum" align="center" label="目标指标编号" sortable /> |
| | | <el-table-column property="year" label="年度" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="value" label="指标值" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column label="操作" align="center" sortable show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="View" @click="openD('查看', scope.row.id)">查看</el-button> |
| | | <el-button link type="primary" size="small" :icon="EditPen" @click="openD('修改', scope.row.id)">修改</el-button> |
| | | <el-button link type="primary" size="small" :icon="Delete" @click="onDelete(scope.row.id)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pages"> |
| | | <el-pagination |
| | | v-model:currentPage="currentPage4" |
| | | v-model:page-size="pageSize4" |
| | | :page-sizes="[10, 20, 30, 40]" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <Dailog ref="Show" @addList="add"></Dailog> |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { timeDate } from '/@/assets/index.ts'; |
| | | import search from '../targetSettings/component/search.vue'; |
| | | import Dailog from '../targetDecompositionYear/component/Dailog.vue'; |
| | | import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus'; |
| | | import { Plus, Delete, Upload, Download, Refresh, View, EditPen } from '@element-plus/icons-vue'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | import type { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults'; |
| | | export default defineComponent({ |
| | | components: { ElButton, ElInput, Dailog }, |
| | | setup() { |
| | | // 搜索条件 |
| | | const ruleForm = reactive({ |
| | | pageSize: 10, |
| | | pageIndex: 1, |
| | | searchParams: { |
| | | qName: '', ////安全目标指标 |
| | | indexNum: '', ////目标指标编号 |
| | | targetType: '3', ////指标类型 1:年指标 2:月指标 |
| | | divideStatus: '', ////分解状态 1:已分解 2:未分解 |
| | | }, |
| | | }); |
| | | // 下方导航与表格 |
| | | const tableData = ref([]); |
| | | const currentPage4 = ref(); |
| | | const pageSize4 = ref(); |
| | | const total = ref(); |
| | | const resetForm = () => { |
| | | ruleForm.searchParams.qName = ''; |
| | | ruleForm.searchParams.indexNum = ''; |
| | | listApi() |
| | | }; |
| | | const listApi = () => { |
| | | goalManagementApi() |
| | | .getTargetMngList(ruleForm) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | tableData.value = res.data.data; |
| | | currentPage4.value = res.data.pageIndex; |
| | | pageSize4.value = res.data.pageSize; |
| | | total.value = res.data.total; |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }; |
| | | onMounted(() => { |
| | | listApi(); |
| | | }); |
| | | |
| | | const handleSizeChange = (val: number) => { |
| | | // console.log(`${val} items per page`); |
| | | ruleForm.pageSize = val; |
| | | listApi(); |
| | | }; |
| | | const handleCurrentChange = (val: number) => { |
| | | // console.log(`current page: ${val}`); |
| | | ruleForm.pageIndex = val; |
| | | listApi(); |
| | | }; |
| | | const activeNames = ref('1'); |
| | | // 打开弹窗 |
| | | const Show = ref(); |
| | | const openD = (title: String, id: number) => { |
| | | Show.value.openDailog(title, ruleForm.searchParams.targetType, id); |
| | | }; |
| | | // 删除 |
| | | const onDelete = (id: number) => { |
| | | let arr=[] |
| | | arr.push(id) |
| | | ElMessageBox.confirm('确定删除所选项吗?', 'Warning', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | goalManagementApi() |
| | | .getTargetMngDelete(arr) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | listApi(); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | // ElMessage({ |
| | | // type: 'info', |
| | | // message: 'Delete canceled', |
| | | // }); |
| | | }); |
| | | }; |
| | | // 批量删除 |
| | | const warning = ref(true); |
| | | const danger = ref(true); |
| | | const deletAll = ref(); |
| | | const handleSelectionChange = (val: any) => { |
| | | let valId = JSON.parse(JSON.stringify(val)); |
| | | let arr = []; |
| | | for (let i = 0; i < valId.length; i++) { |
| | | arr.push(valId[i].id); |
| | | } |
| | | deletAll.value = arr |
| | | if (val.length == 1) { |
| | | warning.value = false; |
| | | danger.value = false; |
| | | } else if (val.length == 0) { |
| | | warning.value = true; |
| | | danger.value = true; |
| | | } else { |
| | | warning.value = true; |
| | | danger.value = false; |
| | | } |
| | | }; |
| | | const onDeleteAll = () => { |
| | | ElMessageBox.confirm('确定删除所选项吗?', 'Warning', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | goalManagementApi() |
| | | .getTargetMngDelete(deletAll.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | listApi(); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: 'Delete canceled', |
| | | }); |
| | | }); |
| | | }; |
| | | const add=()=>{ |
| | | listApi() |
| | | } |
| | | return { |
| | | timeDate, |
| | | add, |
| | | listApi, |
| | | resetForm, |
| | | tableData, |
| | | currentPage4, |
| | | pageSize4, |
| | | total, |
| | | ruleForm, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | Show, |
| | | openD, |
| | | activeNames, |
| | | onDelete, |
| | | warning, |
| | | danger, |
| | | deletAll, |
| | | handleSelectionChange, |
| | | onDeleteAll, |
| | | Plus, |
| | | Delete, |
| | | Upload, |
| | | Download, |
| | | Refresh, |
| | | View, |
| | | EditPen, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .minCenter { |
| | | width: 100%; |
| | | background-color: #fff; |
| | | margin-top: 10px; |
| | | padding: 0 20px; |
| | | } |
| | | .btns { |
| | | padding: 0px 0px 10px 0px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | .pages { |
| | | padding: 20px 0; |
| | | display: flex; |
| | | justify-content: right; |
| | | } |
| | | .tableC { |
| | | margin: 0 10%; |
| | | } |
| | | .topTitle { |
| | | background-color: #fff; |
| | | padding: 20px 0px 20px 0px; |
| | | } |
| | | </style> |
| | |
| | | <div class="btns"> |
| | | <div> |
| | | <!--<el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button>--> |
| | | <!-- <el-button size="default" type="warning" :disabled="warning" :icon="EditPen" plain>修改</el-button> --> |
| | | <el-button size="default" type="warning" :disabled="warning" :icon="EditPen" plain |
| | | @click="openD('修改', deletAll[0])">修改</el-button> |
| | | <el-button size="default" type="danger" :disabled="danger" :icon="Delete" plain @click="onDeleteAll">删除</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | <el-table-column align="center" prop="dutyDepartmentName" label="责任部门" /> |
| | | <el-table-column align="center" prop="value" label="考核指标" /> |
| | | <el-table-column align="center" prop="makerDepartmentName" label="制定人部门" /> |
| | | <el-table-column align="center" prop="makeDate" label="制定日期" /> |
| | | <el-table-column align="center" prop="makeDate" :formatter="timeDate" label="制定日期" /> |
| | | <el-table-column align="center" prop="commitPersonName" label="上报人" /> |
| | | </el-table> |
| | | </el-tab-pane> |
| | |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { timeDate } from '/@/assets/index.ts'; |
| | | import search from '../targetSettings/component/search.vue'; |
| | | import Dailog from '../targetDecompositionYear/component/Dailog.vue'; |
| | | import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue'; |
| | |
| | | listApi() |
| | | } |
| | | return { |
| | | timeDate, |
| | | add, |
| | | listApi, |
| | | resetForm, |
对比新文件 |
| | |
| | | <template> |
| | | <div> |
| | | <el-form :model="ruleForm" status-icon label-width="20px" class="topTitle"> |
| | | <el-row> |
| | | <el-col :span="4"> |
| | | <el-form-item> |
| | | <el-input v-model="ruleForm.searchParams.qName" size="default" placeholder="安全目标指标" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item> |
| | | <el-input v-model="ruleForm.searchParams.indexNum" size="default" placeholder="目标指标编号" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="16"> |
| | | <el-form-item> |
| | | <el-button type="primary" size="default" @click="listApi">查询</el-button> |
| | | <el-button size="default" @click="resetForm">重置</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div class="minCenter"> |
| | | <div class="btns"> |
| | | <div> |
| | | <!--<el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button>--> |
| | | <el-button size="default" type="warning" :disabled="warning" :icon="EditPen" plain |
| | | @click="openD('修改', deletAll[0])">修改</el-button> |
| | | <el-button size="default" type="danger" :disabled="danger" :icon="Delete" plain @click="onDeleteAll">删除</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table ref="multipleTableRef" :data="tableData" @selection-change="handleSelectionChange" style="width: 100%"> |
| | | <el-table-column label="序号" align="center" type="index" width="70" /> |
| | | <el-table-column type="selection" align="center" width="55" /> |
| | | <el-table-column type="expand"> |
| | | <template #default="scope"> |
| | | <div class="tableC"> |
| | | <el-tabs v-model="activeNames"> |
| | | <el-tab-pane label="目标指标分解" name="1"> |
| | | <el-table :data="scope.row.targetDivideDetailList" style="width: 100%"> |
| | | <el-table-column align="center" prop="dutyDepartmentName" label="责任部门" /> |
| | | <el-table-column align="center" prop="value" label="考核指标" /> |
| | | <el-table-column align="center" prop="makerDepartmentName" label="制定人部门" /> |
| | | <el-table-column align="center" prop="makeDate" :formatter="timeDate" label="制定日期" /> |
| | | <el-table-column align="center" prop="commitPersonName" label="上报人" /> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="安全目标指标" align="center" property="qName" sortable /> |
| | | <el-table-column property="indexNum" align="center" label="目标指标编号" sortable /> |
| | | <el-table-column property="year" label="年度" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column property="value" label="指标值" align="center" sortable show-overflow-tooltip /> |
| | | <el-table-column label="操作" align="center" sortable show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="View" @click="openD('查看', scope.row.id)">查看</el-button> |
| | | <el-button link type="primary" size="small" :icon="EditPen" @click="openD('修改', scope.row.id)">修改</el-button> |
| | | <el-button link type="primary" size="small" :icon="Delete" @click="onDelete(scope.row.id)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pages"> |
| | | <el-pagination |
| | | v-model:currentPage="currentPage4" |
| | | v-model:page-size="pageSize4" |
| | | :page-sizes="[10, 20, 30, 40]" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | </div> |
| | | <Dailog ref="Show" @addList="add"></Dailog> |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { timeDate } from '/@/assets/index.ts'; |
| | | import search from '../targetSettings/component/search.vue'; |
| | | import Dailog from '../targetDecompositionYear/component/Dailog.vue'; |
| | | import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus'; |
| | | import { Plus, Delete, Upload, Download, Refresh, View, EditPen } from '@element-plus/icons-vue'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | import type { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults'; |
| | | export default defineComponent({ |
| | | components: { ElButton, ElInput, Dailog }, |
| | | setup() { |
| | | // 搜索条件 |
| | | const ruleForm = reactive({ |
| | | pageSize: 10, |
| | | pageIndex: 1, |
| | | searchParams: { |
| | | qName: '', ////安全目标指标 |
| | | indexNum: '', ////目标指标编号 |
| | | targetType: '4', ////指标类型 1:年指标 2:月指标 |
| | | divideStatus: '', ////分解状态 1:已分解 2:未分解 |
| | | }, |
| | | }); |
| | | // 下方导航与表格 |
| | | const tableData = ref([]); |
| | | const currentPage4 = ref(); |
| | | const pageSize4 = ref(); |
| | | const total = ref(); |
| | | const resetForm = () => { |
| | | ruleForm.searchParams.qName = ''; |
| | | ruleForm.searchParams.indexNum = ''; |
| | | listApi() |
| | | }; |
| | | const listApi = () => { |
| | | goalManagementApi() |
| | | .getTargetMngList(ruleForm) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | tableData.value = res.data.data; |
| | | currentPage4.value = res.data.pageIndex; |
| | | pageSize4.value = res.data.pageSize; |
| | | total.value = res.data.total; |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }; |
| | | onMounted(() => { |
| | | listApi(); |
| | | }); |
| | | |
| | | const handleSizeChange = (val: number) => { |
| | | // console.log(`${val} items per page`); |
| | | ruleForm.pageSize = val; |
| | | listApi(); |
| | | }; |
| | | const handleCurrentChange = (val: number) => { |
| | | // console.log(`current page: ${val}`); |
| | | ruleForm.pageIndex = val; |
| | | listApi(); |
| | | }; |
| | | const activeNames = ref('1'); |
| | | // 打开弹窗 |
| | | const Show = ref(); |
| | | const openD = (title: String, id: number) => { |
| | | Show.value.openDailog(title, ruleForm.searchParams.targetType, id); |
| | | }; |
| | | // 删除 |
| | | const onDelete = (id: number) => { |
| | | let arr=[] |
| | | arr.push(id) |
| | | ElMessageBox.confirm('确定删除所选项吗?', 'Warning', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | goalManagementApi() |
| | | .getTargetMngDelete(arr) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | listApi(); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | // ElMessage({ |
| | | // type: 'info', |
| | | // message: 'Delete canceled', |
| | | // }); |
| | | }); |
| | | }; |
| | | // 批量删除 |
| | | const warning = ref(true); |
| | | const danger = ref(true); |
| | | const deletAll = ref(); |
| | | const handleSelectionChange = (val: any) => { |
| | | let valId = JSON.parse(JSON.stringify(val)); |
| | | let arr = []; |
| | | for (let i = 0; i < valId.length; i++) { |
| | | arr.push(valId[i].id); |
| | | } |
| | | deletAll.value = arr |
| | | if (val.length == 1) { |
| | | warning.value = false; |
| | | danger.value = false; |
| | | } else if (val.length == 0) { |
| | | warning.value = true; |
| | | danger.value = true; |
| | | } else { |
| | | warning.value = true; |
| | | danger.value = false; |
| | | } |
| | | }; |
| | | const onDeleteAll = () => { |
| | | ElMessageBox.confirm('确定删除所选项吗?', 'Warning', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | goalManagementApi() |
| | | .getTargetMngDelete(deletAll.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | listApi(); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage({ |
| | | type: 'info', |
| | | message: 'Delete canceled', |
| | | }); |
| | | }); |
| | | }; |
| | | const add=()=>{ |
| | | listApi() |
| | | } |
| | | return { |
| | | timeDate, |
| | | add, |
| | | listApi, |
| | | resetForm, |
| | | tableData, |
| | | currentPage4, |
| | | pageSize4, |
| | | total, |
| | | ruleForm, |
| | | handleSizeChange, |
| | | handleCurrentChange, |
| | | Show, |
| | | openD, |
| | | activeNames, |
| | | onDelete, |
| | | warning, |
| | | danger, |
| | | deletAll, |
| | | handleSelectionChange, |
| | | onDeleteAll, |
| | | Plus, |
| | | Delete, |
| | | Upload, |
| | | Download, |
| | | Refresh, |
| | | View, |
| | | EditPen, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | | .minCenter { |
| | | width: 100%; |
| | | background-color: #fff; |
| | | margin-top: 10px; |
| | | padding: 0 20px; |
| | | } |
| | | .btns { |
| | | padding: 0px 0px 10px 0px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | .pages { |
| | | padding: 20px 0; |
| | | display: flex; |
| | | justify-content: right; |
| | | } |
| | | .tableC { |
| | | margin: 0 10%; |
| | | } |
| | | .topTitle { |
| | | background-color: #fff; |
| | | padding: 20px 0px 20px 0px; |
| | | } |
| | | </style> |
| | |
| | | <el-table-column align="center" property="makerDepartmentName" label="制定人部门" /> |
| | | <el-table-column align="center" property="makeDate" :formatter="timeDate" label="制定日期" /> |
| | | <el-table-column align="center" property="commitPersonName" label="上报人" /> |
| | | <el-table-column align="center" property="操作"> |
| | | <el-table-column align="center" label="操作"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="daiAdd('查看', scope.row)">查看</el-button> |
| | | <el-button link :disabled="disabled" type="primary" @click="daiAdd('修改', scope.row)">修改</el-button> |
| | |
| | | <el-form :model="form" :disabled="disabled" label-width="120px" ref="ruleFormRef" :rules="rules"> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="目标分类" prop="targetTypeId" size="default"> |
| | | <el-select v-model="form.targetTypeId" class="m-2" placeholder="请选择" style="width:100%"> |
| | | <el-option v-for="item in options" :key="item.id" :label="item.typeName" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="责任人" prop="dutyPersonName" size="default"> |
| | | <el-input v-model="form.dutyPersonName"> |
| | | <template #append> <el-button :icon="Search" @click="openUser(1)" /> </template |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="责任部门" prop="dutyDepartmentId" size="default"> |
| | | <el-tree-select v-model="form.dutyDepartmentId" check-strictly="true" @current-change="dutyName" :data="data" class="w100" :props="propse" placeholder="请选择" /> |
| | | <el-tree-select |
| | | v-model="form.dutyDepartmentId" |
| | | check-strictly="true" |
| | | @current-change="dutyName" |
| | | :data="data" |
| | | class="w100" |
| | | :props="propse" |
| | | placeholder="请选择" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="制定人部门" prop="makerDepartmentId" size="default"> |
| | | <el-tree-select v-model="form.makerDepartmentId" :data="data" @current-change="makerName" check-strictly="true" class="w100" :props="propse" placeholder="请选择" /> |
| | | <el-tree-select |
| | | v-model="form.makerDepartmentId" |
| | | :data="data" |
| | | @current-change="makerName" |
| | | check-strictly="true" |
| | | class="w100" |
| | | :props="propse" |
| | | placeholder="请选择" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="制定日期" prop="makeDate" size="default"> |
| | | <el-date-picker v-model="form.makeDate" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="请选择" style="width: 100%" /> |
| | | <el-date-picker |
| | | v-model="form.makeDate" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | type="datetime" |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-col :span="11"> |
| | | <el-form-item label="上报人" prop="commitPersonName" size="default"> |
| | | <el-input v-model="form.commitPersonName"> |
| | | <template #append> <el-button :icon="Search" @click="openUser" /> </template |
| | | <template #append> <el-button :icon="Search" @click="openUser(2)" /> </template |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="计划措施" prop="commitPersonName" size="default"> |
| | | <el-input v-model="form.planDesc"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | |
| | | <el-button @click="resetForm(ruleFormRef)" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm(ruleFormRef)" :disabled="disabled" size="default">确定</el-button> |
| | | </span> |
| | |
| | | export default defineComponent({ |
| | | components: { DailogSearchUser }, |
| | | setup(props, { emit }) { |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | const form = ref({ |
| | | dutyDepartmentId: '', ////责任部门/外键 |
| | | makerDepartmentId: '', ////制定人部门/外键 |
| | |
| | | commitPersonName: '', |
| | | value: '', ////考核指标值 |
| | | makeDate: '', ////制定日期 |
| | | targetTypeId: '', ///目标分类 |
| | | dutyPersonId: '', ///责任人id |
| | | dutyPersonName: '', ///责任人 |
| | | planDesc: '', ///计划措施 |
| | | }); |
| | | //部门 |
| | | const department = () => { |
| | |
| | | }; |
| | | onMounted(() => { |
| | | department(); |
| | | allList() |
| | | }); |
| | | const disabled = ref(false); |
| | | // 开启弹窗 |
| | |
| | | } |
| | | dialogVisible.value = true; |
| | | }; |
| | | // 分类 All |
| | | const allList=()=>{ |
| | | goalManagementApi().gettargetClassAll({}).then(res=>{ |
| | | if(res.data.code==200){ |
| | | options.value=res.data.data |
| | | }else{ |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }) |
| | | } |
| | | // 开启用户弹窗 |
| | | const Show = ref(); |
| | | const openUser = () => { |
| | | Show.value.openDailog(); |
| | | const openUser = (type:any) => { |
| | | Show.value.openDailog(type); |
| | | }; |
| | | const rules = reactive<FormRules>({ |
| | | targetTypeId: [ |
| | | { |
| | | required: true, |
| | | message: '目标分类不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | dutyPersonName: [ |
| | | { |
| | | required: true, |
| | | message: '责任人不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | dutyDepartmentId: [ |
| | | { |
| | | required: true, |
| | |
| | | |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | // console.log(formEl); |
| | | if (!formEl) return |
| | | if (!formEl) return; |
| | | formEl.clearValidate(); |
| | | dialogVisible.value = false; |
| | | form.value={} |
| | | form.value = {}; |
| | | }; |
| | | // const handleClose = (formEl: any) => { |
| | | // formEl.resetFields(); |
| | |
| | | } |
| | | }; |
| | | const data = ref(); |
| | | const onUser = (e: any) => { |
| | | console.log(e) |
| | | const onUser = (e: any, type: any) => { |
| | | console.log(e); |
| | | if (type == 1) { |
| | | form.value.dutyPersonId = e.uid; |
| | | form.value.dutyPersonName = e.realName; |
| | | } else if (type == 2) { |
| | | form.value.commitPersonId = e.uid; |
| | | form.value.commitPersonName = e.realName; |
| | | } |
| | | }; |
| | | const makerName=(data:any)=>{ |
| | | form.value.makerDepartmentName=data.depName |
| | | } |
| | | form.value.makerDepartmentName = data.depName; |
| | | }; |
| | | const dutyName=(data:any)=>{ |
| | | form.value.dutyDepartmentName=data.depName |
| | | } |
| | | form.value.dutyDepartmentName = data.depName; |
| | | }; |
| | | const options = ref([]); |
| | | return { |
| | | options, |
| | | allList, |
| | | disabled, |
| | | makerName, |
| | | dutyName, |
| | |
| | | <div class="btns"> |
| | | <div> |
| | | <!--<el-button size="default" type="primary" :icon="Plus" @click="openD('新建')">新建</el-button>--> |
| | | <!-- <el-button size="default" type="warning" :disabled="warning" :icon="EditPen" plain>修改</el-button> --> |
| | | <el-button size="default" type="warning" :disabled="warning" :icon="EditPen" plain |
| | | @click="openD('修改', deletAll[0])">修改</el-button> |
| | | <el-button size="default" type="danger" :disabled="danger" :icon="Delete" plain @click="onDeleteAll">删除</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | <el-table-column align="center" prop="dutyDepartmentName" label="责任部门" /> |
| | | <el-table-column align="center" prop="value" label="考核指标" /> |
| | | <el-table-column align="center" prop="makerDepartmentName" label="制定人部门" /> |
| | | <el-table-column align="center" prop="makeDate" label="制定日期" /> |
| | | <el-table-column align="center" prop="makeDate" :formatter="timeDate" label="制定日期" /> |
| | | <el-table-column align="center" prop="commitPersonName" label="上报人" /> |
| | | </el-table> |
| | | </el-tab-pane> |
| | |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { timeDate } from '/@/assets/index.ts'; |
| | | import Dailog from './component/Dailog.vue'; |
| | | import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue'; |
| | | import { ElMessageBox, ElMessage, ElButton, ElInput, TabsPaneContext, FormInstance } from 'element-plus'; |
| | |
| | | listApi() |
| | | } |
| | | return { |
| | | timeDate, |
| | | listApi, |
| | | add, |
| | | resetForm, |
| | |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">关闭</el-button> |
| | | <el-button type="primary" @click="dialogVisible = false">确定</el-button> |
| | | <!-- <el-button type="primary" @click="dialogVisible = false">确定</el-button> --> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | searchParams: { |
| | | relateId: '', ////检查记录ID |
| | | relateType:"", |
| | | gmtCreate:[], |
| | | }, |
| | | }); |
| | | const tableData = ref(); |
| | |
| | | dialogVisible.value = true; |
| | | form.value.searchParams.relateId=data |
| | | form.value.searchParams.relateType=type |
| | | goalManagementApi().getworkApproveListCheckData(form.value).then(res=>{ |
| | | goalManagementApi().getworkApproveListCode(form.value).then(res=>{ |
| | | if(res.data.code==200){ |
| | | tableData.value=res.data.data |
| | | } |
| | |
| | | <template> |
| | | <el-dialog :title="titleName" v-model="dialogVisible" @click="resetForm" width="50%" draggable :fullscreen="full" :close-on-click-modal="false"> |
| | | <el-dialog :title="titleName" v-model="dialogVisible" @click="resetForm" width="70%" draggable :fullscreen="full" :close-on-click-modal="false"> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form ref="ruleFormRef" :model="form" size="default" :disabled="disabled" label-width="120px"> |
| | | <div v-if="titleName=='发起审批'"> |
| | |
| | | <el-col :span="11" :offset="2"></el-col> |
| | | </el-row> |
| | | </div> |
| | | <el-table :data="tableData" style="width: 90%;margin:20px auto"> |
| | | <el-table-column align="center" type="index" label="序号" width="80" /> |
| | | <el-table-column align="center" prop="makerDepartmentName" label="责任部门" /> |
| | | <el-table-column align="center" prop="value" label="考核指标" /> |
| | | <el-table-column align="center" prop="dutyDepartmentName" label="制定部门" /> |
| | | <el-table-column align="center" prop="makeDate" :formatter="timeDate" label="制定日期" /> |
| | | <el-table-column align="center" label="检查值"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.commitValue" :disabled="disabledType" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="检查人"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.personName" :disabled="disabledType"> |
| | | <template #append> <el-button :icon="Search" @click="openUsers(scope.row)" /> </template |
| | | ></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div v-if="typeScope"> |
| | | <el-row> |
| | | <el-col> |
| | | <el-form-item label="审批结果" prop="authorUid"> |
| | | <el-radio-group v-model="form.approveResult"> |
| | | <el-radio-group :disabled="disabled" v-model="form.approveResult"> |
| | | <el-radio :label="0">不通过</el-radio> |
| | | <el-radio :label="1">通过</el-radio> |
| | | </el-radio-group> |
| | |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="审批意见" prop="approveMemo"> |
| | | <el-input v-model="form.approveMemo" type="textarea" placeholder="请填写审批意见"></el-input> |
| | | <el-input v-model="form.approveMemo" :disabled="disabled" type="textarea" placeholder="请填写审批意见"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="是否完成" prop="complete"> |
| | | <el-radio-group v-model="form.approveStatus"> |
| | | <el-radio-group v-model="form.approveStatus" :disabled="disabled"> |
| | | <el-radio :label="3">是</el-radio> |
| | | <el-radio :label="2">否</el-radio> |
| | | </el-radio-group> |
| | |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="resetForm" size="default">关闭</el-button> |
| | | <el-button size="default" type="primary" @click="submitForm">确定</el-button> |
| | | <el-button size="default" type="primary" :disabled="disabled" @click="submitForm">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <DailogSearchUserManger ref="userRef" @SearchUser="onUser" /> |
| | | <DailogSearchUser ref="Show" @SearchUser="onUsers"></DailogSearchUser> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { ref, defineComponent } from 'vue'; |
| | | import { timeDate } from '/@/assets/index.ts'; |
| | | import DailogSearchUserManger from '/@/components/DailogSearchUserManger/index.vue'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import DailogSearchUser from '../../../../components/DailogSearchUser/index.vue'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | import { Search, FullScreen } from '@element-plus/icons-vue'; |
| | | export default defineComponent({ |
| | | components: { DailogSearchUserManger }, |
| | | components: { DailogSearchUserManger, DailogSearchUser }, |
| | | setup(props, { emit }) { |
| | | const dialogVisible = ref(false); |
| | | const form = ref({ |
| | |
| | | title: '', //审批标题 |
| | | approvePersonId: '', |
| | | approvePersonName: '', |
| | | approveStatus: 2, |
| | | approveStatus: "", |
| | | approveResult: '', |
| | | relateType: 1, |
| | | relateId: '', |
| | | relateDesc: '', |
| | | }); |
| | | // 提交 |
| | | const submitForm = () => { |
| | | if (titleName.value == '发起审批') { |
| | | let arr = []; |
| | | for (let i = 0; i < tableData.value.length; i++) { |
| | | arr.push({ |
| | | id: tableData.value[i].id, |
| | | value: tableData.value[i].commitValue, |
| | | personName: tableData.value[i].personName, |
| | | personId: tableData.value[i].personId, |
| | | }); |
| | | } |
| | | form.value.approveStatus=2 |
| | | form.value.relateDesc = JSON.stringify(arr); |
| | | goalManagementApi() |
| | | .getworkApproveAdd(form.value) |
| | | .then((res) => { |
| | |
| | | dialogVisible.value = false; |
| | | disabled.value = false; |
| | | disabledT.value = false; |
| | | form.value={} |
| | | formUp.value={} |
| | | form.value = {}; |
| | | formUp.value = {}; |
| | | }; |
| | | // 关闭 |
| | | const resetForm = () => { |
| | | dialogVisible.value = false; |
| | | disabled.value = false; |
| | | disabledT.value = false; |
| | | form.value={} |
| | | formUp.value={} |
| | | form.value = {}; |
| | | formUp.value = {}; |
| | | tableData.value=[]; |
| | | dialogVisible.value = false; |
| | | }; |
| | | const titleName = ref(); |
| | | const typeScope = ref(); |
| | | const disabledT = ref(false); |
| | | const disabled = ref(false); |
| | | const formUp=ref({ |
| | | workName:"", |
| | | title:"", |
| | | approvePersonName:"" |
| | | }) |
| | | workName: '', |
| | | title: '', |
| | | approvePersonName: '', |
| | | }); |
| | | const tableData = ref([]); |
| | | const disabledType=ref() |
| | | // 打开弹窗 |
| | | const openDialog = (title: string, name: string, id: number,type:number) => { |
| | | const openDialog = (title: string, name: any, id: number, type: number,data:any) => { |
| | | dialogVisible.value = true; |
| | | titleName.value = title; |
| | | form.value.relateType=type |
| | | form.value.relateType = type; |
| | | if (title == '发起审批') { |
| | | form.value.relateId = id; |
| | | typeScope.value = false; |
| | | goalManagementApi() |
| | | .getTargetMngDetail(id) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | tableData.value = res.data.data.targetDivideDetailList; |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | disabledType.value=false |
| | | } else if (title == '审批'||title == '查看审批') { |
| | | goalManagementApi() |
| | | .getworkApproveDetail(id) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | form.value = res.data.data; |
| | | form.value.approveStatus="" |
| | | formUp.value.workName=form.value.workName |
| | | formUp.value.title=form.value.title |
| | | formUp.value.approvePersonName=form.value.approvePersonName |
| | | if (form.value.approvePersonName === form.value.submitPersonName) { |
| | | if (data.approveStatus==2&&data.checkApprove==true){ |
| | | disabled.value = false; |
| | | } else { |
| | | } else if(data.approveStatus==2&&data.checkApprove==false) { |
| | | disabled.value = true; |
| | | } |
| | | form.value = res.data.data; |
| | | form.value.approveStatus = ''; |
| | | formUp.value.workName = form.value.workName; |
| | | formUp.value.title = form.value.title; |
| | | formUp.value.approvePersonName = form.value.approvePersonName; |
| | | form.value.workName="" |
| | | form.value.title="" |
| | | form.value.approvePersonName="" |
| | | tableData.value=res.data.data.targetDivideDetailList |
| | | console.log(form.value.approvePersonName) |
| | | } |
| | | }); |
| | | disabledType.value=true |
| | | typeScope.value = true; |
| | | disabledT.value = true; |
| | | } |
| | |
| | | const openUser = () => { |
| | | userRef.value.openDailog(); |
| | | }; |
| | | const index = ref(); |
| | | const Show = ref(); |
| | | const openUsers = (id: any) => { |
| | | index.value = tableData.value.indexOf(id); |
| | | Show.value.openDailog(); |
| | | }; |
| | | const onUser = (val: any) => { |
| | | form.value.approvePersonId = val[0].uid; |
| | | form.value.approvePersonName = val[0].realName; |
| | | }; |
| | | const onUsers = (val: any) => { |
| | | tableData.value[index.value].personName = val.realName; |
| | | tableData.value[index.value].personId = val.uid; |
| | | }; |
| | | //全屏 |
| | | const full = ref(false); |
| | |
| | | } |
| | | }; |
| | | return { |
| | | disabledType, |
| | | index, |
| | | Show, |
| | | onUsers, |
| | | openUsers, |
| | | formUp, |
| | | timeDate, |
| | | tableData, |
| | | onUser, |
| | | dialogVisible, |
| | | form, |
| | |
| | | <el-table-column v-if="activeName == 1" label="操作" align="center" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="default" :icon="EditPen" v-if="scope.row.approveStatus==null" @click="TypeDailog('发起审批','检查',scope.row.id,1)">发起审批</el-button> |
| | | <el-button link type="primary" size="default" :icon="EditPen" v-if="scope.row.approveStatus==2&&scope.row.checkApprove==true" @click="TypeDailog('审批','检查',scope.row.approveId,1)">审批</el-button> |
| | | <el-button link type="primary" size="default" :icon="EditPen" v-if="scope.row.approveStatus==2&&scope.row.checkApprove==false" @click="TypeDailog('查看审批','检查',scope.row.approveId,1)">查看审批</el-button> |
| | | <el-button link type="primary" size="default" :icon="EditPen" v-if="scope.row.approveStatus==2&&scope.row.checkApprove==true" @click="TypeDailog('审批',scope.row.id,scope.row.approveId,1,scope.row)">审批</el-button> |
| | | <el-button link type="primary" size="default" :icon="EditPen" v-if="scope.row.approveStatus==2&&scope.row.checkApprove==false" @click="TypeDailog('查看审批',scope.row.id,scope.row.approveId,1,scope.row)">查看审批</el-button> |
| | | <el-button link type="primary" size="default" :icon="EditPen" v-if="scope.row.approveStatus==3" @click="openDai(scope.row.id,1)" >查看审批流程</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="activeName == 2" label="操作" align="center" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="default" :icon="EditPen" v-if="scope.row.approveStatus==null" @click="TypeDailog('发起审批','检查',scope.row.id,2)">发起审批</el-button> |
| | | <el-button link type="primary" size="default" :icon="EditPen" v-if="scope.row.approveStatus==2&&scope.row.checkApprove==true" @click="TypeDailog('审批','检查',scope.row.approveId,2)">审批</el-button> |
| | | <el-button link type="primary" size="default" :icon="EditPen" v-if="scope.row.approveStatus==2&&scope.row.checkApprove==false" @click="TypeDailog('查看审批','检查',scope.row.approveId,2)">查看审批</el-button> |
| | | <el-button link type="primary" size="default" :icon="EditPen" v-if="scope.row.approveStatus==2&&scope.row.checkApprove==true" @click="TypeDailog('审批',scope.row.id,scope.row.approveId,2,scope.row)">审批</el-button> |
| | | <el-button link type="primary" size="default" :icon="EditPen" v-if="scope.row.approveStatus==2&&scope.row.checkApprove==false" @click="TypeDailog('查看审批',scope.row.id,scope.row.approveId,2,scope.row)">查看审批</el-button> |
| | | <el-button link type="primary" size="default" :icon="EditPen" v-if="scope.row.approveStatus==3" @click="openDai(scope.row.id,2)" >查看审批流程</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | }; |
| | | // 发起审批弹窗 |
| | | const TypeD = ref(); |
| | | const TypeDailog = (title:string,name:string,id:number,type:number) => { |
| | | TypeD.value.openDialog(title,name,id,type); |
| | | const TypeDailog = (title:string,name:string,id:number,type:number,data:any) => { |
| | | TypeD.value.openDialog(title,name,id,type,data); |
| | | }; |
| | | const typeAlign=()=>{ |
| | | listApi(); |
| | |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="指标值" prop="value" size="default"> |
| | | <el-input v-model="form.value" placeholder="请填写指标值" /> |
| | | <el-input v-model.number="form.value" placeholder="请填写指标值" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | }); |
| | | const titles = ref(); |
| | | const disabled = ref(false); |
| | | const titleT=ref() |
| | | // 打开弹窗 |
| | | const openDialog = (title: string, value: any, id: number) => { |
| | | Shows.value = true; |
| | | titleT.value=title |
| | | titles.value = `${title}目标设定`; |
| | | form.value.targetType = value; |
| | | disabled.value = title == '查看' ? true : false; |
| | |
| | | message: '指标值不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | { |
| | | type:"number", |
| | | message: '指标值只能为数字类型', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | level: [], |
| | | completeDate: [], |
| | |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | if(titleT.value=='新建'){ |
| | | delete form.value.id |
| | | } |
| | | Shows.value = false; |
| | | goalManagementApi() |
| | | .getTargetMngAddOrupdata(form.value) |
| | |
| | | openDialog, |
| | | handleClose, |
| | | titles, |
| | | titleT, |
| | | // timeDate, |
| | | Shows, |
| | | form, |
| | |
| | | </div> |
| | | <el-tab-pane label="目标定制(年)" name="1"> </el-tab-pane> |
| | | <el-tab-pane label="目标定制(月)" name="2"></el-tab-pane> |
| | | <el-tab-pane label="目标定制(半年)" name="3"></el-tab-pane> |
| | | <el-tab-pane label="目标定制(季度)" name="4"></el-tab-pane> |
| | | </el-tabs> |
| | | <el-table ref="multipleTableRef" :data="tableData" @selection-change="handleSelectionChange" style="width: 100%"> |
| | | <el-table-column label="序号" align="center" type="index" width="70" /> |
对比新文件 |
| | |
| | | <template> |
| | | <div style="background-color: #fff"> |
| | | <el-row style="padding:20px 0"> |
| | | <el-col :span="4" :offset="17"> |
| | | <el-select v-model="form.targetType" placeholder="" @change="listApi" style="width:100%"> |
| | | <el-option label="年指标" :value="1" /> |
| | | <el-option label="月指标" :value="2" /> |
| | | <el-option label="半年" :value="3" /> |
| | | <el-option label="季度" :value="4" /> |
| | | </el-select> |
| | | </el-col> |
| | | </el-row> |
| | | <div ref="main" style="width: 100%; height: 400px;"></div> |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, onMounted, ref } from 'vue'; |
| | | import * as echarts from 'echarts'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const form = ref({ |
| | | qName: '', |
| | | indexNum: '', |
| | | targetType: 1, |
| | | divideStatus: '', |
| | | }); |
| | | onMounted(() => { |
| | | listApi(); |
| | | }); |
| | | const listApi = () => { |
| | | goalManagementApi() |
| | | .gettargetstatistics(form.value.targetType) |
| | | .then((res) => { |
| | | let arr = []; |
| | | arr.push({ |
| | | value: res.data.data.noComplete, |
| | | name: '未完成', |
| | | }); |
| | | arr.push({ |
| | | value: res.data.data.complete, |
| | | name: '已完成', |
| | | }); |
| | | console.log(arr); |
| | | init(arr); |
| | | }); |
| | | }; |
| | | const main = ref(); |
| | | const init = (data: any) => { |
| | | var myChart = echarts.init(main.value); |
| | | var option = { |
| | | // title: { |
| | | // text: 'Referer of a Website', |
| | | // subtext: 'Fake Data', |
| | | // left: 'center', |
| | | // }, |
| | | tooltip: { |
| | | trigger: 'item', |
| | | }, |
| | | legend: { |
| | | orient: 'vertical', |
| | | left: '30%', |
| | | }, |
| | | series: [ |
| | | { |
| | | // name: 'Access From', |
| | | type: 'pie', |
| | | radius: '90%', |
| | | data: data, |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)', |
| | | }, |
| | | }, |
| | | }, |
| | | ], |
| | | }; |
| | | |
| | | myChart.setOption(option); |
| | | }; |
| | | return { |
| | | form, |
| | | main, |
| | | init, |
| | | listApi, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | |
| | | }); |
| | | //打开模态框 |
| | | const openRFIDDialog = (type: string, value: object) => { |
| | | state.fileList = []; |
| | | state.isShowRFIDDialog = true; |
| | | setTimeout(() => { |
| | | RFIDFormRef.value.clearValidate(); |
| | |
| | | rfidName: '', |
| | | rfidImage: '' |
| | | }; |
| | | state.fileList = []; |
| | | } else { |
| | | state.title = '修改RFID'; |
| | | state.fileList = []; |
| | | state.RFIDForm = JSON.parse(JSON.stringify(value)); |
| | | if (state.RFIDForm.rfidImage === null) return; |
| | | state.fileList = [{ url: state.RFIDForm.rfidImage }]; |
| | |
| | | <template> |
| | | <div class="login-container" :key="once"> |
| | | <div class="topPanel"> |
| | | |
| | | </div> |
| | | <div class="topPanelBg"> |
| | | |
| | | </div> |
| | | <div class="topPanel"></div> |
| | | <div class="topPanelBg"></div> |
| | | <div class="topPanelCont"> |
| | | <div class="topLogo"> |
| | | <img src="../../assets/newMenu/toplogo.png" /> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="leftCont"> |
| | | |
| | | </div> |
| | | <div class="leftCont"></div> |
| | | <div class="topCont"> |
| | | <div class="topInfo"> |
| | | <div class="topTit"> |
| | | 新疆国泰新华<br/>安全风险预警监测系统 |
| | | </div> |
| | | <div class="topTit">新疆国泰新华<br />安全风险预警监测系统</div> |
| | | <div class="topTime"> |
| | | <div class="time"> |
| | | {{time}} |
| | |
| | | <span></span> |
| | | <div class="today"> |
| | | <div>{{date}}</div> |
| | | <div><span>{{weekDay}}</span><span>{{dayTime}}</span></div> |
| | | <div> |
| | | <span>{{ weekDay }}</span |
| | | ><span>{{ dayTime }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="line"> |
| | | |
| | | </div> |
| | | <div class="line"></div> |
| | | </div> |
| | | <div class="menuGrid"> |
| | | <div class="gridCont"> |
| | |
| | | </div> |
| | | <img class="bgImg" src="../../assets/newMenu/card-5.png" /> |
| | | </div> |
| | | <div class="grid-content cont-bg-2" v-throttle @click="render('11')"> |
| | | <div class="grid-content cont-bg-2" v-throttle @click="renderToNew('11')"> |
| | | <div class="toplayer"> |
| | | <img class="iconImg" src="../../assets/newMenu/icon9.png" /> |
| | | <div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="bot-rights"> |
| | | <img src="../../assets/newMenu/pic_line1.png"> |
| | | <img src="../../assets/newMenu/pic_line1.png" /> |
| | | <div>技术支持:苏州国科鸿宇智能科技有限公司</div> |
| | | <img src="../../assets/newMenu/pic_line2.png"> |
| | | <img src="../../assets/newMenu/pic_line2.png" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import { useLoginApi } from '/@/api/login'; |
| | | import { useI18n } from 'vue-i18n'; |
| | | import screenfull from 'screenfull'; |
| | | import router from '../../router' |
| | | import Cookies from 'js-cookie' |
| | | import router from '../../router'; |
| | | import Cookies from 'js-cookie'; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface LoginState { |
| | |
| | | time:string; |
| | | date:string; |
| | | weekDay:string; |
| | | dayTime:string |
| | | dayTime: string; |
| | | } |
| | | |
| | | export default defineComponent({ |
| | |
| | | hour: '2-digit', |
| | | minute: '2-digit', |
| | | second: '2-digit' |
| | | } |
| | | }; |
| | | const state = reactive<LoginState>({ |
| | | tabsActiveName: 'account', |
| | | isScan: false, |
| | |
| | | |
| | | // 当前时间 |
| | | const getDateTime = ()=>{ |
| | | const curTime = new Date().toLocaleString('zh', timeForm).replace(/\//g,'-') |
| | | state.time = curTime.slice(10,16) |
| | | state.date = curTime.slice(0,10) |
| | | let week = ['日','一','二','三','四','五','六'] |
| | | let day = new Date().getDay() |
| | | state.weekDay = '星期' + week[day] |
| | | let curHour = Number(curTime.slice(10,13)) |
| | | if(curHour>=5&&curHour<=10){state.dayTime = '上午'} |
| | | if(curHour>10&&curHour<=12){state.dayTime = '中午'} |
| | | if(curHour>12&&curHour<=18){state.dayTime = '下午'} |
| | | if(curHour>18&&curHour<=22){state.dayTime = '晚上'} |
| | | if(curHour>22){state.dayTime = '午夜'} |
| | | const curTime = new Date().toLocaleString('zh', timeForm).replace(/\//g, '-'); |
| | | state.time = curTime.slice(10, 16); |
| | | state.date = curTime.slice(0, 10); |
| | | let week = ['日', '一', '二', '三', '四', '五', '六']; |
| | | let day = new Date().getDay(); |
| | | state.weekDay = '星期' + week[day]; |
| | | let curHour = Number(curTime.slice(10, 13)); |
| | | if (curHour >= 5 && curHour <= 10) { |
| | | state.dayTime = '上午'; |
| | | } |
| | | if (curHour > 10 && curHour <= 12) { |
| | | state.dayTime = '中午'; |
| | | } |
| | | if (curHour > 12 && curHour <= 18) { |
| | | state.dayTime = '下午'; |
| | | } |
| | | if (curHour > 18 && curHour <= 22) { |
| | | state.dayTime = '晚上'; |
| | | } |
| | | if (curHour > 22) { |
| | | state.dayTime = '午夜'; |
| | | } |
| | | }; |
| | | // 下拉菜单点击时 |
| | | const onLoginOut = () => { |
| | | ElMessageBox({ |
| | |
| | | // router.push({ |
| | | // name: "bigDataScreen" |
| | | // }); |
| | | window.open('http://39.104.85.193:8585/') |
| | | } |
| | | window.open('http://39.104.85.193:8585/'); |
| | | }; |
| | | const throttle = (renderMenu: any, delay: number) => { |
| | | let flag = true; |
| | | let count = 0; |
| | |
| | | return returnMenu.path; |
| | | } |
| | | }; |
| | | |
| | | const renderToNew = () => { |
| | | window.open('http://222.92.213.22:18001/smartlab/', '_blank'); |
| | | }; |
| | | // //点击进入特殊作业 |
| | | // const toSpecialWorkSys = () => { |
| | | // router.push('/layoutPage'); |
| | |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | state.once += 1; |
| | | NextLoading.done() |
| | | NextLoading.done(); |
| | | getDateTime(); |
| | | setInterval(()=>{ |
| | | getDateTime() |
| | | },1000) |
| | | getDateTime(); |
| | | }, 1000); |
| | | // loginBg(); |
| | | // loginApp() |
| | | }); |
| | |
| | | logoMini, |
| | | onLoginOut, |
| | | getDateTime, |
| | | renderToNew, |
| | | toRiskPlatform, |
| | | onScreenfullClick, |
| | | loginIconTwo, |
| | |
| | | top: 15px; |
| | | } |
| | | } |
| | | |
| | | |
| | | .grid-content-1{ |
| | | grid-row-start: 1; |
| | |
| | | height: 44px; |
| | | margin-right: 10px; |
| | | } |
| | | |
| | | } |
| | | .bgImg { |
| | | position: absolute; |
| | |
| | | height: 60px; |
| | | top: 0; |
| | | left: 0; |
| | | background: rgba(255,255,255,.8); |
| | | background: rgba(255, 255, 255, 0.8); |
| | | z-index: 9; |
| | | } |
| | | .topPanelCont { |
| | |
| | | |
| | | .topTit{ |
| | | font-size: 44px; |
| | | font-family: "PingFang SC"; |
| | | font-family: 'PingFang SC'; |
| | | font-weight: bolder; |
| | | text-align: left; |
| | | color: #fff; |
| | | text-shadow: 0 3px 8px rgba(0,0,0,.2); |
| | | text-shadow: 0 3px 8px rgba(0, 0, 0, 0.2); |
| | | } |
| | | |
| | | .topTime{ |
| | | padding: 15px 10px; |
| | | box-sizing: border-box; |
| | | background: rgba(6,64,195,.8); |
| | | background: rgba(6, 64, 195, 0.8); |
| | | border-radius: 8px; |
| | | color: #fff; |
| | | font-family: "PingFang SC"; |
| | | font-family: 'PingFang SC'; |
| | | font-weight: 600; |
| | | font-size: 16px; |
| | | display: flex; |
| | |
| | | .line{ |
| | | width: 120px; |
| | | height: 6px; |
| | | background: #00EEFF; |
| | | background: #00eeff; |
| | | } |
| | | } |
| | | .menuGrid { |
| | |
| | | top: 260px; |
| | | left: 240px; |
| | | .gridCont { |
| | | |
| | | .grid-content { |
| | | border-radius: 16px; |
| | | position: relative; |
| | |
| | | border: none; |
| | | |
| | | &:hover { |
| | | background-image: radial-gradient(ellipse farthest-side at 50% 100%,#48A3FF 0%,#fff 120%); |
| | | box-shadow: 8px 8px 24px rgba(20,97,234,.2), -8px -8px 24px #fafafa; |
| | | background-image: radial-gradient(ellipse farthest-side at 50% 100%, #48a3ff 0%, #fff 120%); |
| | | box-shadow: 8px 8px 24px rgba(20, 97, 234, 0.2), -8px -8px 24px #fafafa; |
| | | } |
| | | } |
| | | .cont-bg-1{ |
| | | background: #D9EAFF; |
| | | background: #d9eaff; |
| | | } |
| | | .cont-bg-2{ |
| | | background: #CDD6FF; |
| | | background: #cdd6ff; |
| | | } |
| | | |
| | | |
| | | /*.grid-content-2{*/ |
| | | /* background-image: linear-gradient(135deg,#0098F5,#1461EA);*/ |
| | |
| | | return state.workType.find((i: { id: number }) => i.id === Number(item))?.name; |
| | | }); |
| | | state.details = JSON.parse(JSON.stringify(row)); |
| | | // state.details.workDetail.otherSpecialWork = state.details.workDetail.otherSpecialWork.split(','); |
| | | // if (state.details.workDetail.otherSpecialWork == null || state.details.workDetail.otherSpecialWork == []) { |
| | | // state.details.workDetail.otherSpecialWork = []; |
| | | // } else { |
| | | // state.details.workDetail.otherSpecialWork.map((item) => { |
| | | // console.log(item, 'item'); |
| | | // if (item == '1') { |
| | | // item = '动火作业'; |
| | | // return item; |
| | | // } else if (item == '2') { |
| | | // item = '受限空间作业'; |
| | | // return item; |
| | | // } else if (item == '3') { |
| | | // item = '吊装作业'; |
| | | // return item; |
| | | // } else if (item == '4') { |
| | | // item = '动土作业'; |
| | | // return item; |
| | | // } else if (item == '5') { |
| | | // item = '断路作业'; |
| | | // return item; |
| | | // } else if (item == '6') { |
| | | // item = '高处作业'; |
| | | // return item; |
| | | // } else if (item == '7') { |
| | | // item = '临时用电作业'; |
| | | // return item; |
| | | // } else { |
| | | // item = '盲板抽堵作业'; |
| | | // return item; |
| | | // } |
| | | // }); |
| | | // } |
| | | // console.log(state.details.workDetail.otherSpecialWork, '666666'); |
| | | state.dialogDetails = true; |
| | | }; |
| | | |
| | |
| | | <el-row class="cardTop"> |
| | | <el-col :span="12" class="mainCardBtn"> |
| | | <el-button type="primary" :icon="Plus" size="default" @click="openApproveRuleDialog('新增', {})">新建</el-button> |
| | | <el-button type="danger" :icon="Delete" size="default" @click="deleteApproveRule" plain>批量删除</el-button> |
| | | <el-button type="danger" :icon="Delete" size="default" @click="deleteMoreApproveRule" plain>批量删除</el-button> |
| | | </el-col> |
| | | <el-button type="primary" :icon="Refresh" size="default" /> |
| | | </el-row> |
| | |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="View" @click="openApproveRuleDialog('查看', scope.row)">查看</el-button> |
| | | <el-button link type="primary" size="small" :icon="Edit" @click="openApproveRuleDialog('修改', scope.row)">修改</el-button> |
| | | <el-button link type="primary" style="color: red" size="small" :icon="Delete" @click="deleteApproveRule(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | type: 'warning' |
| | | }) |
| | | .then(async () => { |
| | | debugger; |
| | | let res = await approveRuleApi().deleteApproveRule(state.deleteList); |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | |
| | | }; |
| | | |
| | | const handleSelectionChange = (val: Array<deleteType>) => { |
| | | debugger; |
| | | state.deleteList.ids = val.map((item) => { |
| | | return item.ruleId; |
| | | }) as []; |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> |
| | | <el-tab-pane label="申请中" name="1"> |
| | | <div style="height: 100%"> |
| | | <el-row class="homeCard"> |
| | | <el-col :span="8"> |
| | | <div class="grid-content topInfo"> |
| | | <el-input v-model="searchWord" placeholder="作业证名称"></el-input> |
| | | <el-button type="primary">查询</el-button> |
| | | <el-button plain>重置</el-button> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <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="toApply()">申请</el-button> |
| | | <!-- <el-button type="danger" :icon="Delete" size="default">删除</el-button>--> |
| | | <!-- <el-button type="success" size="default">设置分类</el-button>--> |
| | | </el-col> |
| | | <el-button type="primary" :icon="Refresh" size="default" @click="reLoadData()" /> |
| | | </el-row> |
| | | <el-table ref="multipleTableRef" :data="applyData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column property="workPermitNo" label="作业申请单号" width="180" /> |
| | | <el-table-column property="applyUname" label="申请人" /> |
| | | <el-table-column property="depName" label="部门名称" /> |
| | | <el-table-column property="operators" label="作业人" /> |
| | | <el-table-column property="workTypeDesc" label="作业类型" /> |
| | | <el-table-column property="workLevelDesc" label="作业等级" /> |
| | | <el-table-column property="applyTime" label="申请时间" width="180" /> |
| | | <el-table-column label="申请状态" width="180"> |
| | | <template #default="scope"> |
| | | <el-tag type="success">{{ scope.row.statusDesc }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" align="center" width="250"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="View" @click="viewRecord(scope.row)">查看</el-button> |
| | | <el-button link type="success" size="small" :icon="Finished" @click="viewStatus(scope.row)">进度</el-button> |
| | | <el-button link type="warning" size="small" :icon="Delete" @click="deleteRecordBtn(scope.row)">取消</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination v-model:currentPage="pageIndex1" v-model:page-size="pageSize1" :page-sizes="[10, 15]" small="false" background layout="total, sizes, prev, pager, next, jumper" :total="totalSize1" @size-change="handleSizeChange1" @current-change="handleCurrentChange1" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-dialog v-model="dialogDetails" title="作业申请详情"> |
| | | <el-form :model="details" label-width="120px"> |
| | | <el-form-item label="作业申请单号"> |
| | | <el-input v-model="details.workPermitNo" readonly /> |
| | | </el-form-item> |
| | | <el-form-item label="申请人"> |
| | | <el-input v-model="details.applyUname" readonly /> |
| | | </el-form-item> |
| | | <el-form-item label="部门名称"> |
| | | <el-input v-model="details.depName" readonly /> |
| | | </el-form-item> |
| | | <el-form-item label="作业人"> |
| | | <el-input v-model="details.operators" readonly type="textarea" /> |
| | | </el-form-item> |
| | | <el-form-item label="作业类型"> |
| | | <el-input v-model="details.workTypeDesc" readonly /> |
| | | </el-form-item> |
| | | <el-form-item label="作业等级"> |
| | | <el-input v-model="details.workLevelDesc" readonly /> |
| | | </el-form-item> |
| | | <el-form-item label="作业内容"> |
| | | <el-input v-model="details.workContent" readonly type="textarea" /> |
| | | </el-form-item> |
| | | <el-form-item label="作业地址"> |
| | | <el-input v-model="details.workLocation" readonly type="textarea" /> |
| | | </el-form-item> |
| | | <el-form-item label="作业方式"> |
| | | <el-input v-model="details.workDetail.hotMethod" readonly type="textarea" /> |
| | | </el-form-item> |
| | | <el-form-item label="关联其他作业"> |
| | | <el-input v-model="details.workDetail.otherSpecialWork" readonly type="textarea" /> |
| | | </el-form-item> |
| | | <el-form-item label="期望开始时间"> |
| | | <el-input v-model="details.expStartTime" readonly /> |
| | | </el-form-item> |
| | | <el-form-item label="期望结束时间"> |
| | | <el-input v-model="details.expEndTime" readonly /> |
| | | </el-form-item> |
| | | <el-form-item label="申请时间"> |
| | | <el-input v-model="details.applyTime" readonly /> |
| | | </el-form-item> |
| | | <el-form-item label="当前状态"> |
| | | <el-input v-model="details.statusDesc" readonly /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="dialogDetails = false" size="default">确认</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogStatus" title="作业申请进度"> |
| | | <el-form v-if="approveInfo.operators.length > 0" style="margin-bottom: 40px"> |
| | | <el-form-item label="申请作业人"> |
| | | <el-input v-model="approveInfo.operators" readonly type="textarea" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="display: flex; flex-direction: column-reverse"> |
| | | <div v-for="(item, index) in approveInfo.approvalSteps" class="stepItem"> |
| | | <div class="stepNum">{{ item.stepSerial }}</div> |
| | | <div class="stepCard"> |
| | | <el-card class="box-card" shadow="always"> |
| | | <div class="text"> |
| | | 审批结果:<span>{{ item.approvalResultDesc }}</span> |
| | | </div> |
| | | <div class="text"> |
| | | 审批类型:<span>{{ item.typeDesc }}</span> |
| | | </div> |
| | | <div class="text" v-show="item.startApprovalTime != null"> |
| | | 开始时间:<span>{{ item.startApprovalTime }}</span> |
| | | </div> |
| | | <div class="approveUnit"> |
| | | <div class="item-tit"><span>审批人</span><span>审批状态</span></div> |
| | | <div class="item-cont" v-for="i in item.stepUnits"> |
| | | <span>{{ i.approvalUname }}</span |
| | | ><span>{{ i.resultDesc }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="approveItem"> |
| | | <div class="item-tit"> |
| | | <span>审批项目</span><span>类型</span> |
| | | <div>措施标准</div> |
| | | </div> |
| | | <div class="item-cont" v-for="i in item.stepItems"> |
| | | <span>{{ i.itemName }}</span |
| | | ><span>{{ i.typeDesc }}</span> |
| | | <div v-if="i.measure !== null"> |
| | | <div> |
| | | <span>作业类型:</span><span>{{ i.measure.workTypeDesc }}</span> |
| | | </div> |
| | | <div> |
| | | <span>措施内容:</span><span>{{ i.measure.context }}</span> |
| | | </div> |
| | | </div> |
| | | <div v-if="i.stand !== null"> |
| | | <div> |
| | | <span>标题名称:</span><span>{{ i.stand.title }}</span> |
| | | </div> |
| | | <div> |
| | | <span>标准内容:</span><span>{{ i.stand.typeDesc }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="text" v-show="item.expFinishApprovalTime != null"> |
| | | 期望结束时间:<span>{{ item.expFinishApprovalTime }}</span> |
| | | </div> |
| | | <div class="text" v-show="item.finishApprovalTime != null"> |
| | | 结束时间:<span>{{ item.finishApprovalTime }}</span> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog v-model="deleteDialog" title="提示" width="30%" center @close="indexClear"> |
| | | <span>您确定要取消该条申请吗?</span> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="deleteDialog = false" size="default">取消</el-button> |
| | | <el-button type="primary" @click="conFirmDelete" size="default">确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="已通过" name="2"> |
| | | <div style="height: 100%"> |
| | | <el-row class="homeCard"> |
| | | <el-col :span="8"> |
| | | <div class="grid-content topInfo"> |
| | | <el-input v-model="searchWord" placeholder="作业证名称"></el-input> |
| | | <el-button type="primary">查询</el-button> |
| | | <el-button plain>重置</el-button> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="homeCard"> |
| | | <div class="main-card"> |
| | | <el-table ref="multipleTableRef" :data="passedData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column type="index" label="编号" width="200" /> |
| | | <el-table-column property="level" label="作业证等级" width="180" sortable /> |
| | | <el-table-column property="applyDate" label="申请日期" sortable /> |
| | | <el-table-column property="name" label="申请人" width="180" /> |
| | | <el-table-column property="department" label="申请部门" width="180" /> |
| | | <el-table-column label="申请状态" width="180"> |
| | | <template #default="scope"> |
| | | <el-tag type="success">{{ scope.row.status }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="pageBtn"> |
| | | <el-pagination v-model:currentPage="pageIndex2" v-model:page-size="pageSize2" :page-sizes="[10, 15]" small="false" background layout="total, sizes, prev, pager, next, jumper" :total="totalSize2" @size-change="handleSizeChange2" @current-change="handleCurrentChange2" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, onMounted } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import { useUserInfo } from '/@/stores/userInfo'; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { useRouter } from 'vue-router'; |
| | | import { Edit, View, Plus, Delete, Refresh, Search, Finished } from '@element-plus/icons-vue'; |
| | | import { ElTable } from 'element-plus'; |
| | | import { FormInstance, FormRules, ElMessage } from 'element-plus'; |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | import type { TabsPaneContext } from 'element-plus'; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface stateType { |
| | | applyData: Array<string>; |
| | | workTimeList: Array<string>; |
| | | multipleSelection: Array<any>; |
| | | deleteArr: Array<any>; |
| | | approveInfo: Object; |
| | | dialogDetails: boolean; |
| | | dialogStatus: boolean; |
| | | deleteDialog: boolean; |
| | | pageIndex1: number; |
| | | pageSize1: number; |
| | | chosenIndex: null | number; |
| | | deleteId: null | number; |
| | | searchWord: string; |
| | | totalSize1: number; |
| | | activeName: string; |
| | | addRecord: {}; |
| | | details: {}; |
| | | statusInfo: {}; |
| | | workType: Array<type>; |
| | | } |
| | | interface type { |
| | | id: number; |
| | | name: string; |
| | | } |
| | | |
| | | export default defineComponent({ |
| | | name: 'myApply', |
| | | components: {}, |
| | | setup() { |
| | | const userInfo = useUserInfo(); |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const router = useRouter(); |
| | | const state = reactive<stateType>({ |
| | | pageIndex1: 1, |
| | | pageSize1: 10, |
| | | totalSize1: 0, |
| | | activeName: '1', |
| | | chosenIndex: null, |
| | | searchWord: '', |
| | | applyData: [], |
| | | workTimeList: [], |
| | | multipleSelection: [], |
| | | approveInfo: { |
| | | approvalSteps: [], |
| | | operators: [] |
| | | }, |
| | | dialogDetails: false, |
| | | dialogStatus: false, |
| | | deleteDialog: false, |
| | | addRecord: {}, |
| | | details: {}, |
| | | statusInfo: {}, |
| | | deleteId: null, |
| | | deleteArr: [], |
| | | 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: '盲板抽堵作业' } |
| | | ] |
| | | }); |
| | | interface User { |
| | | name: string; |
| | | list: []; |
| | | info: string; |
| | | } |
| | | |
| | | // 刷新 |
| | | const reLoadData = async () => { |
| | | getListByPage(); |
| | | }; |
| | | |
| | | // 填写表单 |
| | | const toApply = () => { |
| | | router.push({ |
| | | path: 'workTicket' |
| | | }); |
| | | }; |
| | | |
| | | const handleClick = (tab: TabsPaneContext, event: Event) => { |
| | | console.log(tab, event); |
| | | }; |
| | | |
| | | // 分页获取工作时间组列表 |
| | | const getListByPage = async () => { |
| | | const data = { pageSize: state.pageSize1, pageIndex: state.pageIndex1, searchParams: { name: state.searchWord } }; |
| | | let res = await workApplyApi().getApplyListtPage(data); |
| | | if (res.data.code === '200') { |
| | | state.applyData = JSON.parse(JSON.stringify(res.data.data)); |
| | | state.applyData = state.applyData.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; |
| | | console.log('0212121'); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // 表格数据格式化 |
| | | const toNames = (row, column, cellValue, index) => { |
| | | if (row.list == []) { |
| | | return []; |
| | | } else { |
| | | const nameList = []; |
| | | for (let i = 0; i < row.list.length; i++) { |
| | | for (let t = 0; t < state.workTimeList.length; t++) { |
| | | if (row.list[i] == state.workTimeList[t].id) { |
| | | nameList.push(state.workTimeList[t].name); |
| | | } |
| | | } |
| | | } |
| | | return nameList.join(); |
| | | } |
| | | }; |
| | | |
| | | // 关键词查询记录 |
| | | const searchRecord = async () => { |
| | | if (state.searchWord == '') { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '请输入查询关键词' |
| | | }); |
| | | } else { |
| | | getListByPage(); |
| | | } |
| | | }; |
| | | |
| | | const clearSearch = async () => { |
| | | state.searchWord = ''; |
| | | getListByPage(); |
| | | }; |
| | | |
| | | // 查看进度 |
| | | const viewStatus = (row) => { |
| | | getStatus({ workApplyId: row.workApplyId }); |
| | | state.dialogStatus = true; |
| | | }; |
| | | |
| | | // 查询进度方法 |
| | | const getStatus = async (data: any) => { |
| | | let res = await workApplyApi().getStatus(data); |
| | | if (res.data.code === '200') { |
| | | state.approveInfo = JSON.parse(JSON.stringify(res.data.data)); |
| | | state.approveInfo.operators = Array.from(state.approveInfo.operators, ({ operatorUname }) => operatorUname); |
| | | console.log(state.approveInfo, 'steps'); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const deleteRecordBtn = (row) => { |
| | | state.deleteId = row.workApplyId; |
| | | state.deleteDialog = true; |
| | | }; |
| | | |
| | | // 取消申请方法 |
| | | const deleteRecord = async (data: any) => { |
| | | let res = await workApplyApi().cancelApply(data); |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: res.data.msg |
| | | }); |
| | | getListByPage(); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const conFirmDelete = () => { |
| | | deleteRecord({ workApplyId: state.deleteId }); |
| | | state.deleteDialog = false; |
| | | }; |
| | | |
| | | const handleSizeChange1 = (val: number) => { |
| | | state.pageSize1 = val; |
| | | getListByPage(); |
| | | }; |
| | | const handleCurrentChange1 = (val: number) => { |
| | | state.pageIndex1 = val; |
| | | getListByPage(); |
| | | }; |
| | | |
| | | // 查看记录 |
| | | const viewRecord = (row: any) => { |
| | | row.workDetail.otherSpecialWork = JSON.parse(JSON.stringify(row.workDetail.otherSpecialWork.split(','))).map((item: Array<string>) => { |
| | | return state.workType.find((i: { id: number }) => i.id === Number(item))?.name; |
| | | }); |
| | | state.details = JSON.parse(JSON.stringify(row)); |
| | | state.dialogDetails = true; |
| | | }; |
| | | |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId', value); |
| | | userInfos.value.projectId = value; |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | |
| | | // 页面载入时执行方法 |
| | | onMounted(() => { |
| | | getListByPage(); |
| | | }); |
| | | |
| | | return { |
| | | View, |
| | | Edit, |
| | | Delete, |
| | | Refresh, |
| | | Plus, |
| | | Finished, |
| | | reLoadData, |
| | | toApply, |
| | | handleClick, |
| | | toNames, |
| | | searchRecord, |
| | | clearSearch, |
| | | viewRecord, |
| | | viewStatus, |
| | | deleteRecordBtn, |
| | | conFirmDelete, |
| | | getListByPage, |
| | | handleSizeChange1, |
| | | handleCurrentChange1, |
| | | ...toRefs(state) |
| | | }; |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | $homeNavLengh: 8; |
| | | .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); |
| | | } |
| | | } |
| | | .stepItem { |
| | | display: flex; |
| | | align-items: flex-start; |
| | | margin-top: 30px; |
| | | margin-left: 30px; |
| | | padding-bottom: 30px; |
| | | padding-left: 40px; |
| | | border-left: 1px solid #a0cfff; |
| | | position: relative; |
| | | &:first-of-type { |
| | | margin-top: 30px; |
| | | } |
| | | &:first-of-type { |
| | | margin-bottom: 0; |
| | | border-left: none; |
| | | } |
| | | .stepNum { |
| | | position: absolute; |
| | | width: 40px; |
| | | height: 40px; |
| | | border-radius: 20px; |
| | | box-sizing: border-box; |
| | | font-size: 18px; |
| | | color: #333; |
| | | border: 1px solid #a0cfff; |
| | | line-height: 38px; |
| | | text-align: center; |
| | | left: -20px; |
| | | top: -30px; |
| | | background: #d9ecff; |
| | | } |
| | | .stepCard { |
| | | width: 100%; |
| | | margin-top: -30px; |
| | | |
| | | .box-card { |
| | | width: 100%; |
| | | |
| | | .card-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | |
| | | span { |
| | | font-weight: bold; |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | |
| | | .text { |
| | | width: 100%; |
| | | font-size: 14px; |
| | | margin-bottom: 10px; |
| | | padding-left: 10px; |
| | | |
| | | span { |
| | | font-weight: bolder; |
| | | color: #409eff; |
| | | } |
| | | |
| | | &:last-of-type { |
| | | margin-bottom: 0; |
| | | } |
| | | } |
| | | .approveUnit { |
| | | width: 100%; |
| | | font-size: 14px; |
| | | margin-bottom: 20px; |
| | | padding: 10px 15px; |
| | | border: 1px solid #fff; |
| | | background: #ecf8ff; |
| | | border-radius: 6px; |
| | | .item-tit { |
| | | width: 100%; |
| | | display: flex; |
| | | color: #409eff; |
| | | align-items: flex-start; |
| | | justify-content: space-between; |
| | | padding-bottom: 10px; |
| | | border-bottom: 1px solid #a0cfff; |
| | | |
| | | & > span { |
| | | flex: 1; |
| | | } |
| | | & > div { |
| | | flex: 2; |
| | | text-align: center; |
| | | } |
| | | } |
| | | .item-cont { |
| | | width: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | padding: 10px 0; |
| | | border-bottom: 1px solid #c6e2ff; |
| | | |
| | | & > span { |
| | | flex: 1; |
| | | } |
| | | & > div { |
| | | flex: 2; |
| | | text-align: center; |
| | | |
| | | & > div { |
| | | text-align: left; |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | span { |
| | | width: 45%; |
| | | &:first-of-type { |
| | | width: 30%; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | border-bottom: 0; |
| | | } |
| | | } |
| | | } |
| | | .approveItem { |
| | | width: 100%; |
| | | font-size: 14px; |
| | | margin-bottom: 20px; |
| | | padding: 10px 15px; |
| | | background: #ecf8ff; |
| | | border: 1px solid #fff; |
| | | border-radius: 6px; |
| | | .item-tit { |
| | | width: 100%; |
| | | display: flex; |
| | | color: #409eff; |
| | | align-items: flex-start; |
| | | justify-content: space-between; |
| | | padding-bottom: 10px; |
| | | border-bottom: 1px solid #a0cfff; |
| | | |
| | | & > span { |
| | | flex: 1; |
| | | } |
| | | & > div { |
| | | flex: 2; |
| | | text-align: center; |
| | | } |
| | | } |
| | | .item-cont { |
| | | width: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | padding: 10px 0; |
| | | border-bottom: 1px solid #c6e2ff; |
| | | |
| | | & > span { |
| | | flex: 1; |
| | | } |
| | | & > div { |
| | | flex: 2; |
| | | text-align: center; |
| | | |
| | | & > div { |
| | | text-align: left; |
| | | width: 100%; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | span { |
| | | width: 45%; |
| | | &:first-of-type { |
| | | width: 30%; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | &:last-of-type { |
| | | border-bottom: 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | &:hover .card-header { |
| | | color: #0098f5; |
| | | } |
| | | &:hover .stepNum { |
| | | border: 2px solid #0098f5; |
| | | color: #0098f5; |
| | | } |
| | | } |
| | | .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="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业单位" prop="workDetail.operationDepId"> |
| | | <el-select v-model="form.workDetail.operationDepId"> |
| | | <el-option |
| | | v-for="item in csDepList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="断路原因" prop="workDetail.bcReason"> |
| | | <el-input |
| | | v-model="form.workDetail.bcReason" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="断路地段说明" prop="workDetail.bcExplain"> |
| | | <el-input |
| | | v-model="form.workDetail.bcExplain" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="涉及相关部门" prop="workDetail.involvedDepIds"> |
| | | <el-select v-model="form.workDetail.involvedDepIds" multiple> |
| | | <el-option v-for="item in otherWorkList" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | form: Object, |
| | | workerList: Array<any>, |
| | | csDepList: Array<any>, |
| | | otherWorkList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'brokenForm', |
| | | components: {}, |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 5, |
| | | workLevel: 0, |
| | | workContent: '', |
| | | workLocation: '', |
| | | workDetail:{ |
| | | operationDepId: null, |
| | | bcReason: '', |
| | | bcExplain: '', |
| | | bcPath: '', |
| | | involvedDepIds: [] |
| | | }, |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | workerList:[ |
| | | { |
| | | label: "张三", |
| | | value: 53 |
| | | }, |
| | | { |
| | | label: "李四", |
| | | value: 54 |
| | | }, |
| | | { |
| | | label: "测试一", |
| | | value: 55 |
| | | }, |
| | | { |
| | | label: "测试二", |
| | | value: 56 |
| | | } |
| | | ], |
| | | csDepList: [ |
| | | { |
| | | label: "单位一", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "单位二", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "单位三", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "单位四", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "单位五", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "单位六", |
| | | value: 6 |
| | | } |
| | | ], |
| | | otherWorkList: [ |
| | | { |
| | | label: '部门一', |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: '部门二', |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: '部门三', |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: '部门四', |
| | | value: 4 |
| | | } |
| | | ] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.operationDepId": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bcReason": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bcExplain": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.otherSpecialWork": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.involvedDepIds": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | data.workDetail.involvedDepIds = data.workDetail.involvedDepIds.join(',') |
| | | console.log(data,'data') |
| | | const res = await workApplyApi().postBrokenApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | height: 80px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业等级" prop="workLevel"> |
| | | <el-select v-model="form.workLevel"> |
| | | <el-option |
| | | v-for="item in workLevelList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="动火方式" prop="workDetail.hotMethod"> |
| | | <el-input |
| | | v-model="form.workDetail.hotMethod" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入动火方式" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联作业" prop="workDetail.otherSpecialWork"> |
| | | <el-select v-model="form.workDetail.otherSpecialWork" multiple> |
| | | <el-option |
| | | v-for="item in otherWorkList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | form: Object, |
| | | workerList: Array<any>, |
| | | workTypeList: Array<any>, |
| | | workLevelList: Array<any>, |
| | | otherWorkList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'fireForm', |
| | | components: {}, |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 1, |
| | | workLevel: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | workDetail:{ |
| | | hotMethod: '', |
| | | otherSpecialWork: [] |
| | | }, |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | workerList:[ |
| | | { |
| | | label: "张三", |
| | | value: 53 |
| | | }, |
| | | { |
| | | label: "李四", |
| | | value: 54 |
| | | }, |
| | | { |
| | | label: "测试一", |
| | | value: 55 |
| | | }, |
| | | { |
| | | label: "测试二", |
| | | value: 56 |
| | | } |
| | | ], |
| | | workTypeList: [ |
| | | { |
| | | label: "类型一", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "类型二", |
| | | value: 2 |
| | | } |
| | | ], |
| | | workLevelList: [ |
| | | { |
| | | label: "一级动火作业", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "二级动火作业", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "特级动火作业", |
| | | value: 3 |
| | | } |
| | | ], |
| | | otherWorkList: [ |
| | | { |
| | | label: "动火作业", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "受限空间作业", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "吊装作业", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "动土作业", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "断路作业", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "高处作业", |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: "临时用电作业", |
| | | value: 7 |
| | | }, |
| | | { |
| | | label: "盲板抽堵作业", |
| | | value: 8 |
| | | } |
| | | ] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.hotMethod": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | data.workDetail.otherSpecialWork = data.workDetail.otherSpecialWork.join(',') |
| | | console.log(data,'data') |
| | | const res = await workApplyApi().postFireApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | height: 80px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业单位" prop="workDetail.operationDepId"> |
| | | <el-select v-model="form.workDetail.operationDepId"> |
| | | <el-option |
| | | v-for="item in csDepList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="范围" prop="workDetail.gbScope"> |
| | | <el-input |
| | | v-model="form.workDetail.gbScope" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="动土方式" prop="workDetail.gbMethod"> |
| | | <el-input |
| | | v-model="form.workDetail.gbMethod" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联作业" prop="workDetail.otherSpecialWork"> |
| | | <el-select v-model="form.workDetail.otherSpecialWork" multiple> |
| | | <el-option v-for="item in otherWorkList" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | form: Object, |
| | | workerList: Array<any>, |
| | | csDepList: Array<any>, |
| | | otherWorkList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'groundForm', |
| | | components: {}, |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 4, |
| | | workLevel: 0, |
| | | workContent: '', |
| | | workLocation: '', |
| | | workDetail:{ |
| | | operationDepId: null, |
| | | gbScope: '', |
| | | gbMethod: '', |
| | | gbPath: '', |
| | | otherSpecialWork: [] |
| | | }, |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | workerList:[ |
| | | { |
| | | label: "张三", |
| | | value: 53 |
| | | }, |
| | | { |
| | | label: "李四", |
| | | value: 54 |
| | | }, |
| | | { |
| | | label: "测试一", |
| | | value: 55 |
| | | }, |
| | | { |
| | | label: "测试二", |
| | | value: 56 |
| | | } |
| | | ], |
| | | csDepList: [ |
| | | { |
| | | label: "单位一", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "单位二", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "单位三", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "单位四", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "单位五", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "单位六", |
| | | value: 6 |
| | | } |
| | | ], |
| | | otherWorkList: [ |
| | | { |
| | | label: '动火作业', |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: '受限空间作业', |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: '吊装作业', |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: '动土作业', |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: '断路作业', |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: '高处作业', |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: '临时用电作业', |
| | | value: 7 |
| | | }, |
| | | { |
| | | label: '盲板抽堵作业', |
| | | value: 8 |
| | | } |
| | | ] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.operationDepId": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.gbScope": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.gbMethod": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | data.workDetail.otherSpecialWork = data.workDetail.otherSpecialWork.join(',') |
| | | console.log(data,'data') |
| | | const res = await workApplyApi().postGroundApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | height: 80px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业等级" prop="workLevel"> |
| | | <el-select v-model="form.workLevel"> |
| | | <el-option |
| | | v-for="item in workLevelList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业单位" prop="workDetail.operationDepId"> |
| | | <el-select v-model="form.workDetail.operationDepId"> |
| | | <el-option |
| | | v-for="item in heDepList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业高度" prop="workDetail.operationHeight"> |
| | | <el-input |
| | | v-model="form.workDetail.operationHeight" |
| | | type="number" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联作业" prop="workDetail.otherSpecialWork"> |
| | | <el-select v-model="form.workDetail.otherSpecialWork" multiple> |
| | | <el-option |
| | | v-for="item in otherWorkList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | form: Object, |
| | | workerList: Array<any>, |
| | | workTypeList: Array<any>, |
| | | workLevelList: Array<any>, |
| | | heDepList: Array<any>, |
| | | otherWorkList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'heightForm', |
| | | components: {}, |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 6, |
| | | workLevel: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | workDetail:{ |
| | | operationDepId: '', |
| | | operationHeight: null, |
| | | otherSpecialWork: [] |
| | | }, |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | workerList:[ |
| | | { |
| | | label: "张三", |
| | | value: 53 |
| | | }, |
| | | { |
| | | label: "李四", |
| | | value: 54 |
| | | }, |
| | | { |
| | | label: "测试一", |
| | | value: 55 |
| | | }, |
| | | { |
| | | label: "测试二", |
| | | value: 56 |
| | | } |
| | | ], |
| | | heDepList: [ |
| | | { |
| | | label: "单位一", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "单位二", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "单位三", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "单位四", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "单位五", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "单位六", |
| | | value: 6 |
| | | } |
| | | ], |
| | | workTypeList: [ |
| | | { |
| | | label: "类型一", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "类型二", |
| | | value: 2 |
| | | } |
| | | ], |
| | | workLevelList: [ |
| | | { |
| | | label: "一级高处作业", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "二级高处作业", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "三级高处作业", |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: "特级高处作业", |
| | | value: 7 |
| | | } |
| | | ], |
| | | otherWorkList: [ |
| | | { |
| | | label: "动火作业", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "受限空间作业", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "吊装作业", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "动土作业", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "断路作业", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "高处作业", |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: "临时用电作业", |
| | | value: 7 |
| | | }, |
| | | { |
| | | label: "盲板抽堵作业", |
| | | value: 8 |
| | | } |
| | | ] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.operationDepId": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.operationHeight": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | data.workDetail.otherSpecialWork = data.workDetail.otherSpecialWork.join(',') |
| | | console.log(data,'data') |
| | | const res = await workApplyApi().postHeightApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | height: 80px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业等级" prop="workLevel"> |
| | | <el-select v-model="form.workLevel"> |
| | | <el-option |
| | | v-for="item in workLevelList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="吊装工具名称" prop="workDetail.hoistingToolName"> |
| | | <el-input |
| | | v-model="form.workDetail.hoistingToolName" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="起吊物体质量" prop="workDetail.weightMass"> |
| | | <el-input |
| | | v-model="form.workDetail.weightMass" |
| | | type="number" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | form: Object, |
| | | workerList: Array<any>, |
| | | workLevelList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'hoistForm', |
| | | components: {}, |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 3, |
| | | workLevel: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | workDetail:{ |
| | | hoistingToolName: '', |
| | | weightMass: null |
| | | }, |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | workerList:[ |
| | | { |
| | | label: "张三", |
| | | value: 53 |
| | | }, |
| | | { |
| | | label: "李四", |
| | | value: 54 |
| | | }, |
| | | { |
| | | label: "测试一", |
| | | value: 55 |
| | | }, |
| | | { |
| | | label: "测试二", |
| | | value: 56 |
| | | } |
| | | ], |
| | | workLevelList: [ |
| | | { |
| | | label: "一级吊装作业", |
| | | value: 8 |
| | | }, |
| | | { |
| | | label: "二级吊装作业", |
| | | value: 9 |
| | | }, |
| | | { |
| | | label: "三级吊装作业", |
| | | value: 10 |
| | | } |
| | | ] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.hoistingToolName": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.weightMass": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | data.workDetail.weightMass = Number(data.workDetail.weightMass) |
| | | const res = await workApplyApi().postHoistApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | height: 80px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业等级" prop="workLevel"> |
| | | <el-select v-model="form.workLevel"> |
| | | <el-option |
| | | v-for="item in workLevelList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="盲板编号" prop="workDetail.bpCode"> |
| | | <el-input |
| | | v-model="form.workDetail.bpCode" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="主要介质" prop="workDetail.mainMedia"> |
| | | <el-input |
| | | v-model="form.workDetail.mainMedia" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="温度" prop="workDetail.temperature"> |
| | | <el-input |
| | | v-model="form.workDetail.temperature" |
| | | type="number" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="压力" prop="workDetail.pressure"> |
| | | <el-input |
| | | v-model="form.workDetail.pressure" |
| | | type="number" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="盲板材质" prop="workDetail.bpMaterialQuality"> |
| | | <el-input |
| | | v-model="form.workDetail.bpMaterialQuality" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="盲板规格" prop="workDetail.bpSpecification"> |
| | | <el-input |
| | | v-model="form.workDetail.bpSpecification" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="盲板时间" prop="workDetail.installLine"> |
| | | <el-date-picker |
| | | v-model="form.workDetail.installLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="--" |
| | | start-placeholder="装盲板时间" |
| | | end-placeholder="拆盲板时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="盲板位置" prop="workDetail.bpLocation"> |
| | | <el-input |
| | | v-model="form.workDetail.bpLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联作业" prop="workDetail.otherSpecialWork"> |
| | | <el-select v-model="form.workDetail.otherSpecialWork" multiple> |
| | | <el-option |
| | | v-for="item in otherWorkList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | form: Object, |
| | | workerList: Array<any>, |
| | | csDepList: Array<any>, |
| | | otherWorkList: Array<any>, |
| | | workLevelList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'brokenForm', |
| | | components: {}, |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 8, |
| | | workLevel: null, |
| | | workContent: '', |
| | | workLocation: '', |
| | | workDetail:{ |
| | | bpCode: '', |
| | | mainMedia: '', |
| | | temperature: null, |
| | | pressure: null, |
| | | bpMaterialQuality: '', |
| | | bpSpecification: '', |
| | | bpLocation: '', |
| | | bpLocationMapPath: '', |
| | | installLine: [], |
| | | installBpTime: '', |
| | | uninstallBpTime: '', |
| | | otherSpecialWork: [] |
| | | }, |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | workerList:[ |
| | | { |
| | | label: "张三", |
| | | value: 53 |
| | | }, |
| | | { |
| | | label: "李四", |
| | | value: 54 |
| | | }, |
| | | { |
| | | label: "测试一", |
| | | value: 55 |
| | | }, |
| | | { |
| | | label: "测试二", |
| | | value: 56 |
| | | } |
| | | ], |
| | | workLevelList: [ |
| | | { |
| | | label: "抽盲板作业", |
| | | value: 11 |
| | | }, |
| | | { |
| | | label: "堵盲板作业", |
| | | value: 12 |
| | | } |
| | | ], |
| | | csDepList: [ |
| | | { |
| | | label: "单位一", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "单位二", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "单位三", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "单位四", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "单位五", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "单位六", |
| | | value: 6 |
| | | } |
| | | ], |
| | | otherWorkList: [ |
| | | { |
| | | label: "动火作业", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "受限空间作业", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "吊装作业", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "动土作业", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "断路作业", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "高处作业", |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: "临时用电作业", |
| | | value: 7 |
| | | }, |
| | | { |
| | | label: "盲板抽堵作业", |
| | | value: 8 |
| | | } |
| | | ] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bpCode": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.mainMedia": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.temperature": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.pressure": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bpMaterialQuality": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bpSpecification": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.installLine": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.bpLocation": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | }); |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | state.form.workDetail.installBpTime = JSON.parse(JSON.stringify(state.form.workDetail.installLine))[0] |
| | | state.form.workDetail.uninstallBpTime = JSON.parse(JSON.stringify(state.form.workDetail.installLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | let { installLine, ...data2 } = JSON.parse(JSON.stringify(state.form.workDetail)) |
| | | data.workDetail = data2 |
| | | data.workDetail.otherSpecialWork = data.workDetail.otherSpecialWork.join(',') |
| | | data.workDetail.temperature = Number(data.workDetail.temperature) |
| | | data.workDetail.pressure = Number(data.workDetail.pressure) |
| | | console.log(data,'data') |
| | | const res = await workApplyApi().postPlateApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | height: 80px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="电源接入点" prop="workDetail.powerAccessPoint"> |
| | | <el-input |
| | | v-model="form.workDetail.powerAccessPoint" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="工作电压" prop="workDetail.workingVoltage"> |
| | | <el-input |
| | | v-model="form.workDetail.workingVoltage" |
| | | type="number" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用电设备及功率" prop="workDetail.equipmentAndPower"> |
| | | <el-input |
| | | v-model="form.workDetail.equipmentAndPower" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | form: Object, |
| | | workerList: Array<any>, |
| | | workLevelList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'hoistForm', |
| | | components: {}, |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 7, |
| | | workLevel: 0, |
| | | workContent: '', |
| | | workLocation: '', |
| | | workDetail:{ |
| | | powerAccessPoint: '', |
| | | workingVoltage: null, |
| | | equipmentAndPower: '' |
| | | }, |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | workerList:[ |
| | | { |
| | | label: "张三", |
| | | value: 53 |
| | | }, |
| | | { |
| | | label: "李四", |
| | | value: 54 |
| | | }, |
| | | { |
| | | label: "测试一", |
| | | value: 55 |
| | | }, |
| | | { |
| | | label: "测试二", |
| | | value: 56 |
| | | } |
| | | ], |
| | | workLevelList: [ |
| | | { |
| | | label: "一级吊装作业", |
| | | value: 8 |
| | | }, |
| | | { |
| | | label: "二级吊装作业", |
| | | value: 9 |
| | | }, |
| | | { |
| | | label: "三级吊装作业", |
| | | value: 10 |
| | | } |
| | | ] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLevel: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.powerAccessPoint": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.workingVoltage": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.equipmentAndPower": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | // data.workDetail.weightMass = Number(data.workDetail.weightMass) |
| | | const res = await workApplyApi().postPowerApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | height: 80px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <div style="height: 100%"> |
| | | <el-form :model="form" label-width="150px" :rules="applyRules" ref="ruleFormRef"> |
| | | <div class="homeCard"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业人" prop="operatorUids"> |
| | | <el-select v-model="form.operatorUids" multiple> |
| | | <el-option |
| | | v-for="item in workerList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业时间" prop="workTimeLine"> |
| | | <el-date-picker |
| | | v-model="form.workTimeLine" |
| | | format="YYYY-MM-DD HH:mm" |
| | | value-format="YYYY-MM-DD HH:mm:00" |
| | | type="datetimerange" |
| | | range-separator="至" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业内容" prop="workContent"> |
| | | <el-input |
| | | v-model="form.workContent" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业内容" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="作业地址" prop="workLocation"> |
| | | <el-input |
| | | v-model="form.workLocation" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入作业地址" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="受限空间所属单位" prop="workDetail.csDepId"> |
| | | <el-select v-model="form.workDetail.csDepId"> |
| | | <el-option |
| | | v-for="item in csDepList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="受限空间名称" prop="workDetail.csName"> |
| | | <el-input |
| | | v-model="form.workDetail.csName" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="空间内原有介质" prop="workDetail.csOriginalName"> |
| | | <el-input |
| | | v-model="form.workDetail.csOriginalName" |
| | | autosize |
| | | type="textarea" |
| | | placeholder="请输入" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联作业" prop="workDetail.otherSpecialWork"> |
| | | <el-select v-model="form.workDetail.otherSpecialWork" multiple> |
| | | <el-option v-for="item in otherWorkList" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </el-form> |
| | | <div class="applyBtn"> |
| | | <el-button type="primary" size="large" plain @click="submitForm(ruleFormRef)">发起申请</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | form: Object, |
| | | workerList: Array<any>, |
| | | csDepList: Array<any>, |
| | | otherWorkList: Array<any> |
| | | } |
| | | export default defineComponent({ |
| | | name: 'spaceForm', |
| | | components: {}, |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | form: { |
| | | operatorUids: [], |
| | | workType: 2, |
| | | workLevel: 0, |
| | | workContent: '', |
| | | workLocation: '', |
| | | workDetail:{ |
| | | csDepId: null, |
| | | csName: '', |
| | | csOriginalName: '', |
| | | otherSpecialWork: [] |
| | | }, |
| | | workTimeLine: [], |
| | | expStartTime: '', |
| | | expEndTime: '' |
| | | }, |
| | | workerList:[ |
| | | { |
| | | label: "张三", |
| | | value: 53 |
| | | }, |
| | | { |
| | | label: "李四", |
| | | value: 54 |
| | | }, |
| | | { |
| | | label: "测试一", |
| | | value: 55 |
| | | }, |
| | | { |
| | | label: "测试二", |
| | | value: 56 |
| | | } |
| | | ], |
| | | csDepList: [ |
| | | { |
| | | label: "单位一", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "单位二", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "单位三", |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: "单位四", |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: "单位五", |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: "单位六", |
| | | value: 6 |
| | | } |
| | | ], |
| | | otherWorkList: [ |
| | | { |
| | | label: '动火作业', |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: '受限空间作业', |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: '吊装作业', |
| | | value: 3 |
| | | }, |
| | | { |
| | | label: '动土作业', |
| | | value: 4 |
| | | }, |
| | | { |
| | | label: '断路作业', |
| | | value: 5 |
| | | }, |
| | | { |
| | | label: '高处作业', |
| | | value: 6 |
| | | }, |
| | | { |
| | | label: '临时用电作业', |
| | | value: 7 |
| | | }, |
| | | { |
| | | label: '盲板抽堵作业', |
| | | value: 8 |
| | | } |
| | | ] |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const applyRules = reactive<FormRules>({ |
| | | operatorUids: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workType: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workContent: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workLocation: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | workTimeLine: [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.csDepId": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.csName": [{ required: true, message: '该内容不能为空', trigger: 'blur' }], |
| | | "workDetail.csOriginalName": [{ required: true, message: '该内容不能为空', trigger: 'blur' }] |
| | | }); |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | state.form.expStartTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[0] |
| | | state.form.expEndTime = JSON.parse(JSON.stringify(state.form.workTimeLine))[1] |
| | | let { workTimeLine, ...data } = JSON.parse(JSON.stringify(state.form)) |
| | | data.workDetail.otherSpecialWork = data.workDetail.otherSpecialWork.join(',') |
| | | console.log(data,'data') |
| | | const res = await workApplyApi().postSpaceApply(data) |
| | | if (res.data.code === '200') { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '提交成功!' |
| | | }); |
| | | formEl.resetFields() |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | } |
| | | }) |
| | | } |
| | | // 折线图 |
| | | const renderMenu = async (value: string) => { |
| | | Session.set('projectId',value) |
| | | userInfos.value.projectId = value |
| | | await initBackEndControlRoutes(); |
| | | }; |
| | | return { |
| | | renderMenu, |
| | | Search, |
| | | ruleFormRef, |
| | | applyRules, |
| | | submitForm, |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | height: 80px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="home-container"> |
| | | <el-tabs type="border-card"> |
| | | <el-tab-pane label="动火作业"> |
| | | <fire-form></fire-form> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="受限空间作业"> |
| | | <space-form></space-form> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="吊装作业"> |
| | | <hoist-form></hoist-form> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="动土作业"> |
| | | <ground-form></ground-form> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="断路作业"> |
| | | <broken-form></broken-form> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="高处作业"> |
| | | <height-form></height-form> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="临时用电作业"> |
| | | <power-form></power-form> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="盲板抽堵作业"> |
| | | <plate-form></plate-form> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { toRefs, reactive, defineComponent, ref, defineAsyncComponent } from 'vue'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import { Session } from '/@/utils/storage'; |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; |
| | | |
| | | |
| | | interface stateType { |
| | | |
| | | } |
| | | export default defineComponent({ |
| | | name: 'workTicket', |
| | | components: { |
| | | fireForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workApplyManage/workApplyForm/components/fire.vue')), |
| | | spaceForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workApplyManage/workApplyForm/components/space.vue')), |
| | | hoistForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workApplyManage/workApplyForm/components/hoist.vue')), |
| | | groundForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workApplyManage/workApplyForm/components/ground.vue')), |
| | | brokenForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workApplyManage/workApplyForm/components/broken.vue')), |
| | | heightForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workApplyManage/workApplyForm/components/height.vue')), |
| | | powerForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workApplyManage/workApplyForm/components/power.vue')), |
| | | plateForm: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workApplyManage/workApplyForm/components/plate.vue')) |
| | | }, |
| | | setup() { |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const state = reactive<stateType>({ |
| | | |
| | | }); |
| | | |
| | | return { |
| | | ...toRefs(state), |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home-container { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | position: relative; |
| | | .homeCard{ |
| | | width: 100%; |
| | | padding: 20px; |
| | | box-sizing: border-box; |
| | | background: #fff; |
| | | border-radius: 4px; |
| | | margin-bottom: 20px; |
| | | } |
| | | .applyBtn{ |
| | | width: 100%; |
| | | background: #fff; |
| | | height: 80px; |
| | | z-index: 5; |
| | | box-shadow: 0 -3px 8px rgba(150,150,150,.1); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .el-row{ |
| | | margin-bottom: 20px; |
| | | } |
| | | .el-row:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .el-input{ |
| | | width: 100% !important; |
| | | } |
| | | .el-date-editor::v-deep{ |
| | | width: 100%; |
| | | } |
| | | .el-select{ |
| | | width: 100%; |
| | | } |
| | | .el-cascader{ |
| | | width: 100% !important; |
| | | } |
| | | } |
| | | </style> |