From ce80500f4642fa9e09a1d7133046856bba3ca804 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Wed, 1 Nov 2023 22:47:58 +0800 Subject: [PATCH] up --- package.json | 2 +- src/components/XyDialog/index.vue | 26 +- src/utils/request.js | 10 +- src/views/task/list/components/addPatrol.vue | 67 +- src/views/task/list/components/addUnit.vue | 628 +++--- .../task/list/components/showPatrol copy.vue | 1169 +++++++++++ src/views/task/list/components/showPatrol.vue | 1832 ++++++++++------- src/views/task/list/patrol.vue | 59 +- src/views/task/list/unit.vue | 17 +- vue.config.js | 2 +- 10 files changed, 2640 insertions(+), 1172 deletions(-) create mode 100644 src/views/task/list/components/showPatrol copy.vue diff --git a/package.json b/package.json index 269d60a..a3f763d 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "avue-plugin-map": "^1.0.1", "axios": "^0.26.1", "core-js": "3.6.5", - "element-ui": "2.13.2", + "element-ui": "^2.15.14", "js-cookie": "2.2.0", "less": "^3.13.1", "moment": "^2.29.2", diff --git a/src/components/XyDialog/index.vue b/src/components/XyDialog/index.vue index 13544f0..74c8da5 100644 --- a/src/components/XyDialog/index.vue +++ b/src/components/XyDialog/index.vue @@ -8,7 +8,7 @@ export default { }, width:{ type:Number, - default:70 + default:65 }, // isFullScreen:{ // type:Boolean, @@ -137,13 +137,14 @@ export default { if(type === "form"){ let formItems = [] Object.keys(form).map((key)=>{ - formItems.push( - - {eval(`{$scopedSlots.${key} ? $scopedSlots.${key}() : ''}`)} - - ) + formItems.push( + + {eval(`{$scopedSlots.${key} ? $scopedSlots.${key}() : ''}`)} + + ) + }) return ( .xy-table-item-label{ - width: 140px; + // width: 140px; + /* width: 160px; */ + min-width: 120px; + padding-right: 0!important; } .xy-table-item-price{ position: relative; @@ -285,9 +289,9 @@ font-size: 15px; .xy-table-item{ display: flex; align-items: center; - + font-size:16px; padding-right: 80px; - margin-bottom:20px; + margin-bottom:10px; &-label{ padding: 0 20px; diff --git a/src/utils/request.js b/src/utils/request.js index ab2f96d..975e453 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -10,9 +10,15 @@ import { } from '@/utils/auth' let loading; -// create an axios instance +// create an axios instance +let baseUrl = '' +if(window.location.origin.indexOf('localhost')>-1){ + baseUrl = process.env.VUE_APP_BASE_API +}else{ + baseUrl = window.location.origin + '/' +} const service = axios.create({ - baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url + baseURL: baseUrl, // url = base url + request url // withCredentials: true, // send cookies when cross-domain requests timeout: 500000 // request timeout }) diff --git a/src/views/task/list/components/addPatrol.vue b/src/views/task/list/components/addPatrol.vue index c0d22d3..dc7cde9 100644 --- a/src/views/task/list/components/addPatrol.vue +++ b/src/views/task/list/components/addPatrol.vue @@ -18,11 +18,11 @@ - *上报日期: + *巡查日期: + placeholder="选择巡查日期"> @@ -53,20 +53,6 @@ - - - - 附件: - - - - - - - - @@ -88,6 +74,20 @@ style="width: 400px;"> + + + + + 附件: + + + + + + + @@ -147,9 +147,9 @@ date: '', site_id: '', ask_id: '', - file_ids: [], ask_introduce: '', - tips: '', + tips: '', + file_ids: [], }, rules: { @@ -159,7 +159,7 @@ }], date: [{ required: true, - message: '请选择上报日期' + message: '请选择巡查日期' }], site_id: [{ required: true, @@ -221,9 +221,9 @@ date: res?.date, site_id: res?.site_id, ask_id: res?.ask_id, - file_ids: res?.file_ids, ask_introduce: res?.ask_introduce, - tips: res?.tips, + tips: res?.tips, + file_ids: res?.file_ids, } for (var f of res.files) { @@ -297,10 +297,9 @@ + diff --git a/src/views/task/list/components/showPatrol.vue b/src/views/task/list/components/showPatrol.vue index 52ec56b..5fad5bd 100644 --- a/src/views/task/list/components/showPatrol.vue +++ b/src/views/task/list/components/showPatrol.vue @@ -1,443 +1,538 @@ - - - - - - - - 退回原因: - - - {{showform.reason}} - - - - - - - - *审核结果: - - - - - - - - - + + + + + 检查问题信息 + + + + + 任务专题 + + {{showform.mission?showform.mission.name:''}} + + + + 上报人 + + {{showform.admin?showform.admin.name:''}} + + + + 状态 + + {{showform.status_name?showform.status_name:''}} + + + + 检查日期 + + {{showform.date}} + + + + 巡查地点 + + {{showform.site?showform.site.name:(showform.address?showform.address:'')}} + + + + 问题类型 + + {{showform.ask?showform.ask.value:''}} + + + + 问题描述 + + {{showform.ask_introduce?showform.ask_introduce:''}} + + + + 整改建议 + + {{showform.tips?showform.tips:''}} + + + + 附件 + + + + + + + + + + 审核分发信息 + + + + + 审核结果 + + + + 不通过 + + + 待领导确认 + + + 通过 + + + + + + 分管领导确认 + + + 待审核 + + + {{showform.check_leader==1?(showform.leader_status==1?'通过':'不通过'):'否'}} + + + + + 重要领导确认 + + + 待审核 + + + {{showform.check_main==1?(showform.main_status==1?'通过':'不通过'):'否'}} + + + + + 用户类型 + + + + {{item.name}} + + + + + {{item.name}} + + + + + + 接收结果 + + + + 部门退回 + + + 待接收 + + + + + 已接收 + + + + + + + 退回原因 + + {{showform.reason?showform.reason:''}} + + + + + + 计划完成时间 + + {{showform.plan_end_date?showform.plan_end_date:''}} + + + + 责任人 + + {{showform.duty_admin?showform.duty_admin.name:''}} + + + + + + + + 整改情况信息 + + + + + 完成情况 + + {{showform.fix_status==1?'已完成':'未完成'}} + + + + 完成时间 + + {{showform.fix_end_date?showform.fix_end_date:''}} + + + + 整改说明 + + {{form.fix_introduce?form.fix_introduce:''}} + + + + 整改附件 + + + + + + + 整改审核结果 + + + + 整改通过 + + + 整改不通过,重新整改 + + + 待领导确认 + + + 待确认 + + + + + + 分管领导确认 + + + 待审核 + + + {{showform.re_check_leader==1?(showform.re_leader_status==1?'通过':'不通过'):'否'}} + + + + + 重要领导确认 + + + 待审核 + + + {{showform.re_check_main==1?(showform.re_main_status==1?'通过':'不通过'):'否'}} + + + + + - - - - 分管领导确认: - - - - 否 - 是 - - - - - - - - 主要领导确认: - - - + + + 审核 + + + + + + *审核结果 + + + + + + + + + + + + 分管领导确认 + + + 否 是 - - - - - - - - 分管领导确认: - - - - - - - - - - - - - 重要领导确认: - - - - - - - - - - - - - - - - - 用户类型选择: - - - + + + + + 分管领导确认 + + + + + + + + + + + 主要领导确认 + + + + 否 + 是 + + + + + + 主要领导确认 + + + + + + + + + + + 用户类型选择 + + + 人员 部门 - - - - - - - - - - - 全选 - - - - {{dept.name}} - - - - - - - - - - - - - - - - - - - - - *接收结果: + + + + + + 选择 + + + + + + + 全选 + + + + {{dept.name}} + - - + + + + + + + + 检查接收 + + + + + + *接收结果 + + + + + - - - - - - *计划完成日期: - - - - - - - - - - - *责任人: - - - - - - - - - - - - - *不接收原因: - - - - {{showform.reason}} - - - - - - - - - - *接收方: - - - - - {{item.name}} - - - - - {{item.name}} - + + + + *计划完成日期 + + + + + + + + + *责任人 + + + + + + + + + + + 不接收原因 + + + + + + + + + + + 提交整改 + + + + + + *完成情况 - - - - - - - *计划完成时间: - - - {{showform.plan_end_date?showform.plan_end_date:''}} - - - - - - - *责任人: - - - {{showform.duty_admin?showform.duty_admin.name:''}} - - - - - - - *整改完成情况: - - - - 已完成 - 未完成 - - - {{form.fix_status==1?'已完成':'未完成'}} + + + + 已完成 + 未完成 + - - - - - - - *整改结束时间: - - - - - - {{form.fix_end_date}} + + + + *完成时间 + + + + - - - - - - - *整改说明: - - - - - {{form.fix_introduce}} + + + + *整改说明 + + + + + + + + 整改附件 + + + + + + + + + + + + + 确认整改 + + + + + + *审核结果 - - - - - - - 整改附件: - - - - - - - - + + + + + + - - - - - - - - *审核结果: - - - - - - - - - - - - - 分管领导确认: - - - - 否 - 是 - - - - - - - - 主要领导确认: - - - + + + + 分管领导确认 + + + 否 是 - - - - - - - - 分管领导确认: - - - - - - - - - - - - - 重要领导确认: - - - - - - - - - - - - - - - - 任务专题: - - - {{showform.mission?showform.mission.name:''}} - - - - - - - 上报日期: - - - {{showform.date}} - - - - - - - 巡查地点: - - - {{showform.site?showform.site.name:''}} - - - - - - - 问题类型: - - - {{showform.ask?showform.ask.value:''}} - - - - - - - 附件: - - - - - - - - - - - - - 问题描述: - - - {{showform.ask_introduce}} - - + + + + + 分管领导确认 + + + + + + + + + + + 主要领导确认 + + + + 否 + 是 + + + + + + 主要领导确认 + + + + + + + + + + - - - - 整改建议: - - - {{showform.tips}} - - + + + 删除 + + 取消 + 审核 + 领导确认 + 接收 + 提交整改 + 确认整改 + 领导确认整改 + + + @@ -454,7 +549,8 @@ } from "@/api/system/dictionary.js"; import { save, - get + get, + del } from "@/api/task/patrol.js"; import { listdept @@ -464,23 +560,57 @@ } from "@/api/common.js" import { getToken - } from '@/utils/auth' + } from '@/utils/auth' export default { - components: { - }, + components: {}, data() { return { isShow: false, - type: 'add', - typeNameList:{ - show:'查看', - check:'审核', - leader:'领导确认', - accept:'接收', - reform:'提交整改', - confirm:'确认整改', - leaderconfirm:'领导确认整改' - }, + type: 'add', + typeNameList: { + show: '查看', + check: '审核', + leader: '领导确认', + accept: '接收', + reform: '提交整改', + confirm: '确认整改', + leaderconfirm: '领导确认整改' + }, + type_name:'', + statusList: [{ + id: -1, + value: '已撤回' + }, { + id: 0, + value: '待审核' + }, { + id: 1, + value: '待领导确认' + }, { + id: 2, + value: '已分发,待接收' + }, { + id: 3, + value: '已接收' + }, { + id: 4, + value: '提交整改' + }, { + id: 5, + value: '已整改' + }, { + id: 6, + value: '不通过' + }, { + id: 7, + value: '整改不通过,重新整改' + }, { + id: 8, + value: '部门退回' + }, { + id: 9, + value: '待领导确认整改' + }], id: '', uploadOther: { token: "" @@ -489,82 +619,92 @@ pictureList: [], showPic: false, showPicUrl: '', - - - showform:{}, - showurl:[], - showfixurl:[], - form: { - backreason:'', - status:'', - check_leader:'', - check_main:'', - leader_status:1, - main_status:1, - name7: 1, - accept_department_ids: [], - accept_admin_ids:[], - accept_status:'', - plan_end_date:'', - duty_admin_id:'', - reason:'', - - accept_admin_name:"", - plan_end_date_name:'', - duty_admin_name:'', - fix_status:1, - fix_end_date:'', - fix_introduce:'', - fix_file_ids:[], - confirm_status:'', - re_check_leader:0, - re_check_main:0, - re_leader_status:1, - re_main_status:1, + + + showform: {}, + showurl: [], + showfixurl: [], + steps_active: 1, + form: { + steps: '', + backreason: '', + status: '', + check_leader: '', + check_main: '', + leader_status: 1, + main_status: 1, + name7: 1, + accept_department_ids: [], + accept_admin_ids: [], + accept_status: '', + plan_end_date: '', + duty_admin_id: '', + reason: '', + + accept_admin_name: "", + plan_end_date_name: '', + duty_admin_name: '', + fix_status: 1, + fix_end_date: '', + fix_introduce: '', + fix_file_ids: [], + confirm_status: '', + re_check_leader: 0, + re_check_main: 0, + re_leader_status: 1, + re_main_status: 1, + + patrol_name: '', + check_name: '', + reform_name: '', + check_form:'', + accept_form:'', + reform_form:'', + confirm_form:'', mission_id: '', date: '', - site_id: '', + site_id: '', ask_id: '', - file_ids: [], ask_introduce: '', tips: '', - }, - - checkList:[{ - id:2, - name:'通过' - },{ - id:6, - name:'不通过' - }], - confirmList:[{ - id:5, - name:'通过' - },{ - id:7, - name:'不通过' - }], - leaderConfirmList:[{ - id:1, - name:'通过' - },{ - id:0, - name:'不通过' - }], - acceptList:[{ - id:3, - name:'接收' - },{ - id:8, - name:'退回' - }], - deptOptions: [], - checkAll: false, - isIndeterminate: true, - userdata:[], - filterMethod(query, item) { - return item.name.indexOf(query) > -1; + file_ids: [], + }, + + checkList: [{ + id: 2, + name: '通过' + }, { + id: 6, + name: '不通过' + }], + confirmList: [{ + id: 5, + name: '通过' + }, { + id: 7, + name: '不通过' + }], + leaderConfirmList: [{ + id: 1, + name: '通过' + }, { + id: 0, + name: '不通过' + }], + acceptList: [{ + id: 3, + name: '接收' + }, { + id: 8, + name: '退回' + }], + deptOptions: [], + checkAll: false, + isIndeterminate: true, + userdata: [], + filterMethod(query, item) { + return item.name.indexOf(query) > -1; }, rules: { @@ -581,159 +721,223 @@ this.loadUser() }, methods: { - //切换用户选择 人员还是部门 清空 - changeName7(e){ - if(e){ - this.form.accept_department_ids = [] - this.form.accept_admin_ids = [] - } - }, - // 切换接收的状态 清空 - changeAcceptStatus(e){ - if(e){ - this.form.duty_admin_id = '' - this.form.reason = '' - this.form.plan_end_date = '' - } - }, - // 选择科室 - loadDeptOptions() { - listdept(). - then((res) => { - for (var m of res) { - m.checked = false; - } - this.deptOptions = res; - }).catch(error => { - console.log(error) - reject(error) - }) - }, - loadUser() { - listCommonuser({ - page_size: 999 - }). - then((res) => { - this.userdata = res.data; - }).catch(error => { - console.log(error) - }) - }, - handleCheckAllChange(val) { - let options = []; - for (var m of this.deptOptions) { - options.push(m.id); - } - this.form.accept_department_ids = val ? options : []; - this.isIndeterminate = false; + showPatrol(id, type) { + }, - handleCheckedDeptSingleChange(v) { - //如果出现取消的操作 就要执行删除 - console.log(v); + deleteList(id){ var that = this; - if (this.form.accept_department_ids) - that.delDeptItem(); - - }, - //删除操作 - delDeptItem() { - for (var m of this.deptOptions) { - if (this.form.accept_department_ids.indexOf(m.id) == -1) { - var d = this.form.accept_department_ids.filter(function(t) { - return t.department_id == m.id; - }) - - if (d.length != 0) { - delDep(d[0].id).then(response => {}).catch(error => { + if (id) { + this.$Modal.confirm({ + title: '确认要删除数据?', + onOk: () => { + del(id).then(response => { + this.$Message.success('操作成功'); + this.isShow = false + this.$emit('refresh') + }).catch(error => { console.log(error) + reject(error) }) + }, + onCancel: () => { + //this.$Message.info('Clicked cancel'); } - - } + }); } - }, - handleCheckedDeptChange(value) { - let checkedCount = value.length; - this.checkAll = checkedCount === this.deptOptions.length; - this.isIndeterminate = checkedCount > 0 && checkedCount < this.deptOptions.length; - }, - - handleRemove(file, fileList) { - this.pictureList = fileList - }, - handlesuccess(response, file, fileList) { - this.pictureList = fileList - }, - handlePictureCardPreview(file) { - this.showPicUrl = file.url; - this.showPic = true; + }, + //切换用户选择 人员还是部门 清空 + changeName7(e) { + if (e) { + this.form.accept_department_ids = [] + this.form.accept_admin_ids = [] + } + }, + // 切换接收的状态 清空 + changeAcceptStatus(e) { + if (e) { + this.form.duty_admin_id = '' + this.form.reason = '' + this.form.plan_end_date = '' + } + }, + // 选择科室 + loadDeptOptions() { + listdept(). + then((res) => { + for (var m of res) { + m.checked = false; + } + this.deptOptions = res; + }).catch(error => { + console.log(error) + reject(error) + }) + }, + loadUser() { + listCommonuser({ + page_size: 999 + }). + then((res) => { + this.userdata = res.data; + }).catch(error => { + console.log(error) + }) + }, + handleCheckAllChange(val) { + let options = []; + for (var m of this.deptOptions) { + options.push(m.id); + } + this.form.accept_department_ids = val ? options : []; + this.isIndeterminate = false; + }, + handleCheckedDeptSingleChange(v) { + //如果出现取消的操作 就要执行删除 + console.log(v); + var that = this; + if (this.form.accept_department_ids) + that.delDeptItem(); + + }, + //删除操作 + delDeptItem() { + for (var m of this.deptOptions) { + if (this.form.accept_department_ids.indexOf(m.id) == -1) { + var d = this.form.accept_department_ids.filter(function(t) { + return t.department_id == m.id; + }) + + if (d.length != 0) { + delDep(d[0].id).then(response => {}).catch(error => { + console.log(error) + }) + } + + } + } + }, + handleCheckedDeptChange(value) { + let checkedCount = value.length; + this.checkAll = checkedCount === this.deptOptions.length; + this.isIndeterminate = checkedCount > 0 && checkedCount < this.deptOptions.length; + }, + + handleRemove(file, fileList) { + this.pictureList = fileList + }, + handlesuccess(response, file, fileList) { + this.pictureList = fileList + }, + handlePictureCardPreview(file) { + this.showPicUrl = file.url; + this.showPic = true; }, async getDetail() { - const res = await get(this.id) - this.showform = res - // 选择人或部门 - let name7value = 1 - if(res.accept_department_ids){ - name7value = res.accept_department_ids.length>0?2:1 - }else if(res.accept_admin_ids){ - name7value = res.accept_admin_ids.length>0?1:1 - }else{ - name7value = 1 - } - - this.form = { - backreason:'', - // 审核 - status:'', - accept_status:'', - check_leader:res.check_leader==1?1:0, - check_main:res.check_main==1?1:0, - leader_status:res.leader_status==1?1:0, - main_status:res.main_status==1?1:0, - name7: name7value, - accept_department_ids: res?.accept_department_ids, - accept_admin_ids:res?.accept_admin_ids, - accept_status:'', - plan_end_date:res?.plan_end_date, - duty_admin_id:res?.duty_admin_id, - reason:res?.reason, - - accept_admin_name:"", - plan_end_date_name:'', - duty_admin_name:'', - fix_status:res.fix_status==1?1:0, - fix_end_date:res?.fix_end_date, - fix_introduce:res?.fix_introduce, - fix_file_ids:res?.fix_file_ids, - confirm_status:'', - re_check_leader:res.re_check_leader==1?1:0, - re_check_main:res.re_check_main==1?1:0, - re_leader_status:res.re_leader_status==1?1:0, - re_main_status:res.re_main_status==1?1:0, + const res = await get(this.id) + + // 选择人或部门 + let name7value = 1 + if (res.accept_department_ids) { + name7value = res.accept_department_ids.length > 0 ? 2 : 1 + } else if (res.accept_admin_ids) { + name7value = res.accept_admin_ids.length > 0 ? 1 : 1 + } else { + name7value = 1 + } + + this.form = { + steps: '', + backreason: '', + // 审核 + status: '', + accept_status: '', + check_leader: res.check_leader == 1 ? 1 : 0, + check_main: res.check_main == 1 ? 1 : 0, + leader_status: res.leader_status == 1 ? 1 : 0, + main_status: res.main_status == 1 ? 1 : 0, + name7: name7value, + accept_department_ids: res?.accept_department_ids, + accept_admin_ids: res?.accept_admin_ids, + accept_status: '', + plan_end_date: res?.plan_end_date, + duty_admin_id: res?.duty_admin_id, + reason: res?.reason, + + accept_admin_name: "", + plan_end_date_name: '', + duty_admin_name: '', + fix_status: res.fix_status == 1 ? 1 : 0, + fix_end_date: res?.fix_end_date, + fix_introduce: res?.fix_introduce, + fix_file_ids: res?.fix_file_ids, + confirm_status: '', + re_check_leader: res.re_check_leader == 1 ? 1 : 0, + re_check_main: res.re_check_main == 1 ? 1 : 0, + re_leader_status: res.re_leader_status == 1 ? 1 : 0, + re_main_status: res.re_main_status == 1 ? 1 : 0, + + patrol_name: '', + check_name: '', + reform_name: "", + check_form:'', + accept_form:'', + reform_form:'', + confirm_form:'', mission_id: res?.mission_id, date: res?.date, site_id: res?.site_id, ask_id: res?.ask_id, - file_ids: res?.file_ids, ask_introduce: res?.ask_introduce, tips: res?.tips, - } - for (var f of res.files) { + file_ids: res?.file_ids, + } + for (var f of res.files) { this.showurl.push(f.url) + } + for (var f of res.fix_files) { + this.pictureList.push({ + url: f.url, + id: f.id, + name: f.original_name + }) + this.showfixurl.push(f.url) + } + if (res.status == 5) { + this.steps_active = 4 + } else if (res.status == 0 || res.status == 8) { + this.steps_active = 1 + } else if (res.status == 1 || res.status == 2) { + this.steps_active = 2 + } else { + this.steps_active = 3 + } + this.statusList.map(item => { + if (item.id == res.status) { + res.status_name = item.value + } + }) + // type 根据status传值 + if(res.status==0||res.status==8){ + this.type='check' + }else if(res.status==1){ + this.type='leader' + }else if(res.status==2){ + this.type='accept' + }else if(res.status==3||res.status==7){ + this.type='reform' + }else if(res.status==4){ + this.type='confirm' + }else if(res.status==9){ + this.type='leaderconfirm' + }else{ + this.type='show' } - for (var f of res.fix_files) { - this.pictureList.push({ - url:f.url, - id:f.id, - name:f.original_name - }) - this.showfixurl.push(f.url) - } + this.type_name = this.typeNameList[this.type] + this.showform = res this.$forceUpdate() }, - submit() { - + submit() { let _files = [] if (this.pictureList.length > 0) { for (var h of this.pictureList) { @@ -747,147 +951,147 @@ } else { this.form.fix_file_ids = [] } - // return - // 审核或领导确认 - if(this.type==='check'){ - if(this.form.accept_department_ids||this.formaccept_admin_ids){ - if(!(this.form.accept_department_ids.length>0||this.form.accept_admin_ids.length>0)){ - Message({ - type: 'warning', - message: `请选择分发的部门或人员` - }) - return - } - } - } - // 需要领导审核 ,status=1 - if(this.type==='check'){ - if(this.form.check_leader==1||this.form.check_main==1){ - this.form.status = 1 - } - } - // 领导审核 - if(this.type==='leader'){ - if(this.form.check_leader==1&&this.form.check_main==1){ - if(this.form.leader_status==1&&this.form.main_status==1){ - this.form.status = 2 - }else{ - this.form.status = 6 - } - }else{ - if(this.form.check_leader==1){ - this.form.status = this.form.leader_status==1?2:6 - }else if(this.form.check_main==1){ - this.form.status = this.form.main_status==1?2:6 - } - } - } - // 部门接收 - if(this.type==='accept'){ - if(this.form.status==3){ - if(!this.form.plan_end_date){ - Message({ - type: 'warning', - message: `请选择计划完成时间` - }) - return - } - if(!this.form.duty_admin_id){ - Message({ - type: 'warning', - message: `请选择责任人` - }) - return - } - }else if(this.form.status==8){ - console.log("this.form.reason",this.form.reason) - if(!this.form.reason){ - Message({ - type: 'warning', - message: `请输入退回理由` - }) - return - } - } - - } - // 提交整改 - if(this.type==='reform'){ - this.form.status = 4 - if(!this.form.fix_end_date){ - Message({ - type: 'warning', - message: `请选择整改结束时间` - }) - return - } - if(!this.form.fix_introduce){ - Message({ - type: 'warning', - message: `请输入整改说明` - }) - return - } - } - - - // 是否需要领导确认整改 status=9 - if(this.type==='confirm'){ - if(this.form.re_check_leader==1||this.form.re_check_main==1){ - this.form.status = 9 - } - } - // 领导确认整改审核 - if(this.type==='leaderconfirm'){ - if(this.form.re_check_leader==1&&this.form.re_check_main==1){ - if(this.form.re_leader_status==1&&this.form.re_main_status==1){ - this.form.status = 5 - }else{ - this.form.status = 7 - } - }else{ - if(this.form.re_check_leader==1){ - this.form.status = this.form.re_leader_status==1?2:6 - }else if(this.form.re_check_main==1){ - this.form.status = this.form.re_main_status==1?2:6 - } - } - } - - if(!this.form.status){ - Message({ - type: 'warning', - message: `请选择状态` - }) - return - } - // return - - save({ - id: this.id, - ...this.form - }).then(res => { - Message({ - type: 'success', - message: `${this.typeNameList[this.type]}成功` - }) - this.isShow = false - this.$emit('refresh') + // return + // 审核或领导确认 + if (this.type === 'check') { + if (this.form.accept_department_ids || this.formaccept_admin_ids) { + if (!(this.form.accept_department_ids.length > 0 || this.form.accept_admin_ids.length > 0)) { + Message({ + type: 'warning', + message: `请选择分发的部门或人员` + }) + return + } + } + } + // 需要领导审核 ,status=1 + if (this.type === 'check') { + if (this.form.check_leader == 1 || this.form.check_main == 1) { + this.form.status = 1 + } + } + // 领导审核 + if (this.type === 'leader') { + if (this.form.check_leader == 1 && this.form.check_main == 1) { + if (this.form.leader_status == 1 && this.form.main_status == 1) { + this.form.status = 2 + } else { + this.form.status = 6 + } + } else { + if (this.form.check_leader == 1) { + this.form.status = this.form.leader_status == 1 ? 2 : 6 + } else if (this.form.check_main == 1) { + this.form.status = this.form.main_status == 1 ? 2 : 6 + } + } + } + // 部门接收 + if (this.type === 'accept') { + if (this.form.status == 3) { + if (!this.form.plan_end_date) { + Message({ + type: 'warning', + message: `请选择计划完成时间` + }) + return + } + if (!this.form.duty_admin_id) { + Message({ + type: 'warning', + message: `请选择责任人` + }) + return + } + } else if (this.form.status == 8) { + console.log("this.form.reason", this.form.reason) + if (!this.form.reason) { + Message({ + type: 'warning', + message: `请输入退回理由` + }) + return + } + } + + } + // 提交整改 + if (this.type === 'reform') { + this.form.status = 4 + if (!this.form.fix_end_date) { + Message({ + type: 'warning', + message: `请选择整改结束时间` + }) + return + } + if (!this.form.fix_introduce) { + Message({ + type: 'warning', + message: `请输入整改说明` + }) + return + } + } + + + // 是否需要领导确认整改 status=9 + if (this.type === 'confirm') { + if (this.form.re_check_leader == 1 || this.form.re_check_main == 1) { + this.form.status = 9 + } + } + // 领导确认整改审核 + if (this.type === 'leaderconfirm') { + if (this.form.re_check_leader == 1 && this.form.re_check_main == 1) { + if (this.form.re_leader_status == 1 && this.form.re_main_status == 1) { + this.form.status = 5 + } else { + this.form.status = 7 + } + } else { + if (this.form.re_check_leader == 1) { + this.form.status = this.form.re_leader_status == 1 ? 5 : 7 + } else if (this.form.re_check_main == 1) { + this.form.status = this.form.re_main_status == 1 ? 5 : 7 + } + } + } + + if (!this.form.status) { + Message({ + type: 'warning', + message: `请选择状态` + }) + return + } + // return + + save({ + id: this.id, + ...this.form + }).then(res => { + Message({ + type: 'success', + message: `${this.typeNameList[this.type]}成功` + }) + this.isShow = false + this.$emit('refresh') }) }, }, watch: { isShow(newVal) { - if (newVal) { + if (newVal) { this.getDetail() // if (this.type === 'check') { // } } else { this.id = '' - this.pictureList = [] - this.showform = {} - this.showurl = [] + this.pictureList = [] + this.showform = {} + this.showurl = [] this.showfixurl = [] this.$refs['dialog'].reset() } @@ -896,28 +1100,76 @@ } - - diff --git a/src/views/task/list/unit.vue b/src/views/task/list/unit.vue index dcf9f94..83906ee 100644 --- a/src/views/task/list/unit.vue +++ b/src/views/task/list/unit.vue @@ -45,7 +45,8 @@ - {{(k.indexOf(".")>-1?item[k.split(".")[0]][k.split(".")[1]]:item[k])}} + + {{k.indexOf(".")>-1?(item[k.split(".")[0]]?item[k.split(".")[0]][k.split(".")[1]]:''):item[k]}} @@ -79,11 +80,13 @@ - {{(item.prop.indexOf(".")>-1?scope.row[item.prop.split(".")[0]][item.prop.split(".")[1]]:scope.row[item.prop])}} + + {{item.prop.indexOf(".")>-1?(scope.row[item.prop.split(".")[0]]?scope.row[item.prop.split(".")[0]][item.prop.split(".")[1]]:''):scope.row[item.prop]}} + - + 编辑 --> - + @@ -241,13 +244,17 @@ }], inspectionTable:{ - '上报日期':'date', + '巡查日期':'date', '状态':'status', '问题类型':'ask.value', '地点':'site.name', + '上报人':'admin.name', }, statusList:[{ + id:-1, + value:'已撤回' + },{ id:0, value:'待审核' },{ diff --git a/vue.config.js b/vue.config.js index 0c45324..b19dc60 100644 --- a/vue.config.js +++ b/vue.config.js @@ -25,7 +25,7 @@ module.exports = { * Detail: https://cli.vuejs.org/config/#publicpath */ publicPath: '/admin/', - outputDir: '/Users/liuxiangyu/Work/szhedao/app/safety-manage/safety-manage-service/public/admin/', + outputDir: '/Users/mac/Documents/朗业/2023/a-河道安全生产/safety-manage-service/public/admin/', assetsDir: 'static', lintOnSave: process.env.NODE_ENV === 'development', productionSourceMap: false,