From 70875449adba223662ae2994182df05d99fd14c0 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Fri, 24 Nov 2023 14:58:49 +0800 Subject: [PATCH] upup --- src/utils/auth.js | 4 +- src/views/dashboard/index.vue | 141 +++++++++-- src/views/task/list/components/addPatrol.vue | 45 +++- src/views/task/list/components/addPlan.vue | 168 ++++++------- src/views/task/list/components/addUnit.vue | 225 ++++++------------ src/views/task/list/components/showPatrol.vue | 125 ++++++---- src/views/task/list/patrol.vue | 53 +++-- src/views/task/list/plan.vue | 121 +++++----- src/views/task/list/study.vue | 8 +- src/views/task/list/unit.vue | 124 +++++----- 10 files changed, 549 insertions(+), 465 deletions(-) diff --git a/src/utils/auth.js b/src/utils/auth.js index 56be074..b25e6ab 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -34,6 +34,8 @@ export function getUser() { if (Cookies.get('anquanshengc_user')) { return Cookies.get('anquanshengc_user') } else { - return sessionStorage.getItem('anquanshengc_user'); + // return sessionStorage.getItem('anquanshengc_user'); + return sessionStorage.getItem('userInfo'); + } } diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index a4a82d8..b837025 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -3,7 +3,7 @@
- +
@@ -294,22 +294,65 @@ -->
- -
+ +
+
+ 综合数据 +

+
+
+
+

年度计划任务:

+

已完成任务:

+

进度:

+
+
+

安全检查(月/年):

+

安全培训(月/年):

+
+
+

应急演练(年):

+

专项任务开展:

+
+
+

安全隐患数量:

+

安全事件:

+
+
+
+
-
- 检查整改 -

+
+
+ 检查整改 +

+
+
+ + + + + + +
- +
@@ -387,7 +430,13 @@ } from '@/api/task/patrol.js' import checkUnit from '@/views/task/list/components/checkUnit.vue' import addPatrol from '@/views/task/list/components/addPatrol.vue' - import showPatrol from '@/views/task/list/components/showPatrol.vue' + import showPatrol from '@/views/task/list/components/showPatrol.vue' + import { + getparameteritem + } from "@/api/system/dictionary.js"; + import { + listdept + } from "@/api/system/department.js" export default { name: 'Dashboard', computed: { @@ -406,7 +455,26 @@ showPatrol }, data() { - return { + return { + select:{ + question_type:'', + year:'2023', + department_id:'', + month:'', + check_type:'' + }, + questionList:[], + departmentList:[], + checkList:[{ + id: 1, + value: '专项检查' + }, { + id: 2, + value: '资料收集' + }, { + id: 3, + value: '网络安全' + }], paginations: { page: 1, page_size: 5, @@ -566,7 +634,7 @@ width: 240, customFn: (row) => { let arr = [] - return ( < div style = { + return (
+ }> ) }) - } < - /div>) + }
) } }, { label: "计划完成日期", @@ -605,11 +672,11 @@ width: 240, customFn: (row) => { let arr = [] - return ( < div style = { + return (
{ + }> { row.fix_files.map(item => { arr.push(item.url) return ( ) }) - } < - /div>) + }
) } }, { label: "上报人", @@ -695,13 +761,30 @@ }, created() { this.uploadOther.token = getToken(); - // this.initLoad(); + // this.initLoad(); + this.getQuestion() + this.loadDeptOptions() this.getInspectionData() this.getMissionData() this.load(); }, - methods: { + methods: { + changeYear(e){}, + changeMonth(e){}, + async getQuestion() { + const res = await getparameteritem('askList') + this.questionList = res.detail + }, + loadDeptOptions() { + listdept(). + then((res) => { + this.departmentList = res + }).catch(error => { + console.log(error) + reject(error) + }) + }, initLoad() { var that = this; var clientHeight = document.documentElement.clientHeight @@ -944,5 +1027,21 @@ .dialogConcent { overflow-y: auto; + } + .overall{ + background-color: #fff; + height:350px; + padding: 15px; + padding-top: 0; + font-size: 18px; + >div{ + display: flex; + justify-content: space-between; + >p{ + max-width: 50%; + width:50%; + margin-bottom: 60px; + } + } } diff --git a/src/views/task/list/components/addPatrol.vue b/src/views/task/list/components/addPatrol.vue index 6ea979b..a786e49 100644 --- a/src/views/task/list/components/addPatrol.vue +++ b/src/views/task/list/components/addPatrol.vue @@ -5,7 +5,7 @@ + + + + @@ -256,6 +248,7 @@ isShow: false, type: 'add', id: '', + plan_type:1, department_id:'', uploadOther: { token: "" @@ -269,36 +262,23 @@ filterMethod(query, item) { return item.name.indexOf(query) > -1; }, - unitTypeList: [{ - id: 1, - value: '专项检查' - }, { - id: 2, - value: '资料收集' - }, { - id: 3, - value: '网络安全' + planTypeList: [], + statusList:[{ + id:0, + value:'未完成' + },{ + id:1, + value:'开展中' + },{ + id:2, + value:'已完成' }], - endTypeList: [{ - id: 1, - name: '提交文字' - }, { - id: 2, - name: '提交附件' - }, { - id: 3, - name: '提交文字与附件' - }], - studyEndTypeList:[{ - id: 4, - name: '查看即可' - }, { - id: 5, - name: '需要答题' - }], - form: { + form: { + plan_type:'', name: '', - type: '', + type: '', + status:1, + year:'', start_date: '', end_date: '', // count:'', @@ -312,7 +292,15 @@ rules: { name: [{ required: true, - message: '请输入任务名称' + message: '请输入计划名称' + }], + status: [{ + required: true, + message: '请选择计划状态' + }], + year: [{ + required: true, + message: '请选择计划年份' }], start_date: [{ required: true, @@ -330,16 +318,20 @@ } }, created() { - this.uploadOther.token = getToken(); + this.uploadOther.token = getToken(); + this.getPlanList() + this.loadDeptOptions() this.loadUser() }, - methods: { + methods: { + async getPlanList(){ + const res = await getparameteritem('planType') + this.planTypeList = res.detail + }, changeName7(e) { if (e) { this.form.accept_department_ids = [] this.form.accept_admin_ids = [] - this.form.mission_groups = [] - this.form.mission_groups_list = [] } }, // 选择科室 @@ -407,15 +399,16 @@ async getDetail() { const res = await get(this.id) - this.form = { + this.form = { + plan_type:res?.plan_type, name: res?.name, - type: res?.type, + type: res?.type, + year:res.year?res.year:new Date().getFullYear(), start_date: res?.start_date, end_date: res?.end_date, + status:res.status?res.status:1, lefts:'', - name7: res.accept_department_ids.length > 0 ? 2 : (res.accept_admin_ids.length > 0 ? 1 : (res - .groups.length > 0 ? 3 : 1)), - + name7: res.accept_department_ids.length > 0 ? 2 : 1, file_ids: res?.file_ids, content: res?.content, accept_admin_ids: res?.accept_admin_ids, @@ -428,7 +421,6 @@ name: f.original_name }) } - // res.guide_upload ? this.guidePictureList.push(res.guide_upload) : '' }, submit() { let _files = [] @@ -445,7 +437,7 @@ this.form.file_ids = [] } - + console.log("form",this.form) // return if (this.type === 'add') { save({ @@ -453,7 +445,7 @@ }).then(res => { Message({ type: 'success', - message: '新增任务成功' + message: '新增计划成功' }) this.isShow = false this.$emit('refresh') @@ -467,7 +459,7 @@ }).then(res => { Message({ type: 'success', - message: '编辑任务成功' + message: '编辑计划成功' }) this.isShow = false this.$emit('refresh') @@ -486,13 +478,23 @@ if (newVal) { if (this.type === 'editor') { this.getDetail() + } + if(this.type==='add'){ + var date = new Date() + this.form.year = date.getFullYear()+'' } } else { - this.id = '' + this.id = '' + this.plan_type = 1 this.pictureList = [] this.$refs['dialog'].reset() } - }, + }, + plan_type(newval){ + if(newval){ + this.form.plan_type=newval + } + } } } @@ -506,9 +508,9 @@ flex-basis: 100%; } - // ::v-deep .type { - // display: none; - // } + ::v-deep .plan_type { + display: none; + } ::v-deep .el-form>div{ align-items: flex-start!important; } diff --git a/src/views/task/list/components/addUnit.vue b/src/views/task/list/components/addUnit.vue index 2a77584..fbf05ae 100644 --- a/src/views/task/list/components/addUnit.vue +++ b/src/views/task/list/components/addUnit.vue @@ -2,16 +2,7 @@
- + + + + + - - - - - - - @@ -396,7 +277,10 @@ import { getToken } from '@/utils/auth' - import addQuestion from './addQuestion.vue' + import addQuestion from './addQuestion.vue' + import { + listplan + } from '@/api/task/plan.js' export default { components: { addQuestion @@ -419,7 +303,20 @@ userdata: [], filterMethod(query, item) { return item.name.indexOf(query) > -1; - }, + }, + auditStatusList:[{ + id:0, + value:'待审核' + },{ + id:1, + value:'开展中' + },{ + id:2, + value:'不通过' + },{ + id:3, + value:'已完成' + }], unitTypeList: [{ id: 1, value: '专项检查' @@ -446,20 +343,24 @@ }, { id: 5, name: '需要答题' - }], + }], + missionPlanList:[], form: { type: '', + // mission_name:'', name: '', unit_type: '', start_date: '', end_date: '', + mission_plan_id:'', + audit_status:1, lefts:'', name7: 1, is_need_answer:'', is_audit: 0, audit_admin_id: '', - audit_status: 1, + // audit_status: 1, file_ids: '', content: '', @@ -508,10 +409,15 @@ } } - this.loadDeptOptions() + this.loadDeptOptions() + this.getMissionPlan() // this.loadUser() }, methods: { + async getMissionPlan(){ + const res = await listplan({page:1,page_size:9999}) + this.missionPlanList = res.data + }, openQs(){ this.$refs.addQuestion.qsShow=true this.$refs.addQuestion.topicList = this.form.ask @@ -604,19 +510,22 @@ async getDetail() { const res = await get(this.id) this.form = { - type: res?.type, + type: res?.type, + name: res?.name, // mission_name:res?.mission_name, unit_type: res?.unit_type, start_date: res?.start_date, end_date: res?.end_date, + mission_plan_id:res?.mission_plan_id, + audit_status: res.audit_status?res.audit_status:1, lefts:'', name7: res.accept_department_ids.length > 0 ? 2 : (res.accept_admin_ids.length > 0 ? 1 : (res .groups.length > 0 ? 3 : 1)), is_need_answer:'', is_audit: res.audit_admin_id ? 1 : 0, audit_admin_id: res.audit_admin_id ? res.audit_admin_id : '', - audit_status: res.audit_status?res.audit_status:1, + file_ids: res?.file_ids, content: res?.content, end_type: res?.end_type, @@ -693,9 +602,9 @@ return } } + this.form.mission_groups = this.mission_groups_list } - this.form.mission_groups = this.mission_groups_list // return if (this.type === 'add') { save({ @@ -760,7 +669,9 @@ ::v-deep .content, ::v-deep .end_type, ::v-deep .file_ids, - ::v-deep .is_need_answer{ + ::v-deep .is_need_answer, + // ::v-deep .mission_plan_id + { flex-basis: 100%; } diff --git a/src/views/task/list/components/showPatrol.vue b/src/views/task/list/components/showPatrol.vue index e47df6d..dd21d41 100644 --- a/src/views/task/list/components/showPatrol.vue +++ b/src/views/task/list/components/showPatrol.vue @@ -53,7 +53,12 @@ {{showform.site?showform.site.name:(showform.address?showform.address:'')}} - + + + {{showform.ask_department?showform.ask_department:''}} + -