From ddf07c2b8488b14513ba1d7d2c2f3cc75e339b10 Mon Sep 17 00:00:00 2001 From: tianhao <2524518601@qq.com> Date: Tue, 1 Sep 2020 17:30:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?bug=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/par/examperiod/ExamPeriod.vue | 109 +++++++----- src/views/par/parworkinfo/ParWorkInfoDept.vue | 155 ++++++++++-------- src/views/par/parworkinfo/ParWorkInfoUnit.vue | 154 +++++++++-------- src/views/par/parworkinfo/ParWorkInfoUser.vue | 149 +++++++++-------- 4 files changed, 323 insertions(+), 244 deletions(-) diff --git a/src/views/par/examperiod/ExamPeriod.vue b/src/views/par/examperiod/ExamPeriod.vue index bbaaafd..9eef56d 100644 --- a/src/views/par/examperiod/ExamPeriod.vue +++ b/src/views/par/examperiod/ExamPeriod.vue @@ -1,13 +1,13 @@ @@ -135,9 +143,15 @@ export default { xs: { span: 24 }, sm: { span: 16 } }, + rules: { + kpzqmc: [{ required: true, message: '考评周期名称不能为空', trigger: 'blur' }], + bz: [{ required: true, message: '备注不能为空', trigger: 'blur' }] + }, modelVisible: false, // 弹出框显示 operate: 'query', // 当前操作 - selectInfo: {}, // 选中的数据 + selectInfo: { + kpzqmc: '' + }, // 选中的数据 confirmLoading: false, // Loading url: '/par/examperiod', // ajax请求地址 loading: false @@ -192,40 +206,47 @@ export default { }, // 确认 handleOk () { - this.confirmLoading = true - if (this.operate === 'detile') { - // 详情 - this.confirmLoading = false - // 关闭编辑框 - this.modelVisible = false - } - if (this.operate === 'add') { - // 新增 - this.actionParam = { - url: '/par/examperiod/insert', - action: 'POST', - parameter: {}, - data: this.selectInfo, - message: '新增成功' - } - } - if (this.operate === 'edit') { - // 修改 - this.actionParam = { - url: '/par/examperiod/update', - action: 'POST', - parameter: {}, - data: this.selectInfo, - message: '修改成功' + const vm = this + this.$refs.ruleForm.validate(valid => { + if (valid) { + vm.confirmLoading = true + if (vm.operate === 'detile') { + // 详情 + vm.confirmLoading = false + // 关闭编辑框 + vm.modelVisible = false + } + if (vm.operate === 'add') { + // 新增 + vm.actionParam = { + url: '/par/examperiod/insert', + action: 'POST', + parameter: {}, + data: vm.selectInfo, + message: '新增成功' + } + } + if (vm.operate === 'edit') { + // 修改 + vm.actionParam = { + url: '/par/examperiod/update', + action: 'POST', + parameter: {}, + data: vm.selectInfo, + message: '修改成功' + } + } + // 调用请求 + return method(vm.actionParam).then(res => { + vm.confirmLoading = false + // 关闭编辑框 + vm.modelVisible = false + // 刷新列表 + vm.$refs.stable.refresh(true) + }) + } else { + return false } - } - // 调用请求 - return method(this.actionParam).then(res => { - this.confirmLoading = false - // 关闭编辑框 - this.modelVisible = false - // 刷新列表 - this.$refs.stable.refresh(true) }) }, exportExcel () { diff --git a/src/views/par/parworkinfo/ParWorkInfoDept.vue b/src/views/par/parworkinfo/ParWorkInfoDept.vue index c37def3..965d291 100644 --- a/src/views/par/parworkinfo/ParWorkInfoDept.vue +++ b/src/views/par/parworkinfo/ParWorkInfoDept.vue @@ -102,8 +102,8 @@ >编辑 派发 - - 打卡 + + 打卡 {{ gzlbEcho(text) }} {{ gzztEcho(text) }} @@ -122,10 +122,15 @@ :confirmLoading="confirmLoading" centered > - + - + - + - + 个人工作备忘 - + - + 问题类型 任务类型 工作类型 - + - - + - - + - 自定义 - + - - + - + - + - + - + 不选视为永久有效 - + - + - + - + - - + - - + @@ -464,7 +468,12 @@ export default { staffList: [], currentRole: 'unitRole', qdShow: false, - fileList: [] + fileList: [], + rules: { + zxr: [{ required: true, message: '请选择执行人', trigger: 'change' }], + gzlb: [{ required: true, message: '请选择工作类别', trigger: 'change' }], + gznr: [{ required: true, message: '工作内容不能为空', trigger: 'blur' }] + } } }, created () { @@ -482,6 +491,7 @@ export default { }).then(resDept => { console.log('人员部门查询', resDept) const deptId = resDept.result.id + vm.userInfo.deptCode = deptId // 获取当前部门下人员 query('/par/parworkinfo' + '/getStaffInfoByOrgId', 'GET', { id: deptId @@ -717,7 +727,9 @@ export default { console.log('点击操作', action, selectInfo) this.operate = action // 记录当前操作 this.selectInfo = Object.assign({}, selectInfo) // 记录当前操作的数据 - this.selectInfo.sfszqxgz = '2' + if (action === 'add') { + this.selectInfo.sfszqxgz = '2' + } const dateFormat = 'YYYY-MM-DD' if (this.selectInfo.kssj) { this.selectInfo.kssj = moment(this.selectInfo.kssj, dateFormat) @@ -736,8 +748,8 @@ export default { } else { this.zqShow = false } - const zdyzq = this.selectInfo.zdyzq ? this.selectInfo.zdyzq : '' - if (zdyzq === '6') { + const zq = this.selectInfo.zq ? this.selectInfo.zq : '' + if (zq === '6') { this.zdyzqShow = true } else { this.zdyzqShow = false @@ -785,41 +797,48 @@ export default { }, // 确认 handleOk () { - this.confirmLoading = true - this.selectInfo.zxrlb = '2' - if (this.operate === 'detile') { - // 详情 - this.confirmLoading = false - // 关闭编辑框 - this.modelVisible = false - } - if (this.operate === 'add') { - // 新增 - this.actionParam = { - url: '/par/parworkinfo/insert', - action: 'POST', - parameter: {}, - data: this.selectInfo, - message: '新增成功' - } - } - if (this.operate === 'edit') { - // 修改 - this.actionParam = { - url: '/par/parworkinfo/update', - action: 'POST', - parameter: {}, - data: this.selectInfo, - message: '修改成功' + const vm = this + this.$refs.ruleForm.validate(valid => { + if (valid) { + vm.confirmLoading = true + vm.selectInfo.zxrlb = '2' + if (vm.operate === 'detile') { + // 详情 + vm.confirmLoading = false + // 关闭编辑框 + vm.modelVisible = false + } + if (vm.operate === 'add') { + // 新增 + vm.actionParam = { + url: '/par/parworkinfo/insert', + action: 'POST', + parameter: {}, + data: vm.selectInfo, + message: '新增成功' + } + } + if (vm.operate === 'edit') { + // 修改 + vm.actionParam = { + url: '/par/parworkinfo/update', + action: 'POST', + parameter: {}, + data: vm.selectInfo, + message: '修改成功' + } + } + // 调用请求 + return method(vm.actionParam).then(res => { + vm.confirmLoading = false + // 关闭编辑框 + vm.modelVisible = false + // 刷新列表 + vm.$refs.stable.refresh(true) + }) + } else { + return false } - } - // 调用请求 - return method(this.actionParam).then(res => { - this.confirmLoading = false - // 关闭编辑框 - this.modelVisible = false - // 刷新列表 - this.$refs.stable.refresh(true) }) } } diff --git a/src/views/par/parworkinfo/ParWorkInfoUnit.vue b/src/views/par/parworkinfo/ParWorkInfoUnit.vue index 46f48d3..475b096 100644 --- a/src/views/par/parworkinfo/ParWorkInfoUnit.vue +++ b/src/views/par/parworkinfo/ParWorkInfoUnit.vue @@ -115,10 +115,16 @@ :confirmLoading="confirmLoading" centered > - + - + - + - + 个人工作备忘 - + - + 工作类型 - + - - + - - + - 自定义 - + - - + - + - + - + - + 不选视为永久有效 - + - + - + - + - - + - + @@ -454,7 +460,12 @@ export default { staffList: [], currentRole: 'unitRole', qdShow: false, - fileList: [] + fileList: [], + rules: { + zxr: [{ required: true, message: '请选择执行单位', trigger: 'change' }], + gzlb: [{ required: true, message: '请选择工作类别', trigger: 'change' }], + gznr: [{ required: true, message: '工作内容不能为空', trigger: 'blur' }] + } } }, created () { @@ -467,9 +478,9 @@ export default { vm.orgTree = vm.genernateTree(res.result.data) }) // 获取所有人员 - query('/admin/pmUser' + '/query', 'GET').then(res => { + query('/admin/pmUser' + '/findStaffAll', 'GET').then(res => { console.log('人员查询', res) - vm.staffList = res.result.data + vm.staffList = res.result }) console.log('当前登录用户', this.userInfo) }, @@ -701,7 +712,9 @@ export default { console.log('点击操作', action, selectInfo) this.operate = action // 记录当前操作 this.selectInfo = Object.assign({}, selectInfo) // 记录当前操作的数据 - this.selectInfo.sfszqxgz = '2' + if (action === 'add') { + this.selectInfo.sfszqxgz = '2' + } const dateFormat = 'YYYY-MM-DD' if (this.selectInfo.kssj) { this.selectInfo.kssj = moment(this.selectInfo.kssj, dateFormat) @@ -720,8 +733,8 @@ export default { } else { this.zqShow = false } - const zdyzq = this.selectInfo.zdyzq ? this.selectInfo.zdyzq : '' - if (zdyzq === '6') { + const zq = this.selectInfo.zq ? this.selectInfo.zq : '' + if (zq === '6') { this.zdyzqShow = true } else { this.zdyzqShow = false @@ -769,41 +782,48 @@ export default { }, // 确认 handleOk () { - this.confirmLoading = true - this.selectInfo.zxrlb = '1' - if (this.operate === 'detile') { - // 详情 - this.confirmLoading = false - // 关闭编辑框 - this.modelVisible = false - } - if (this.operate === 'add') { - // 新增 - this.actionParam = { - url: '/par/parworkinfo/insert', - action: 'POST', - parameter: {}, - data: this.selectInfo, - message: '新增成功' - } - } - if (this.operate === 'edit') { - // 修改 - this.actionParam = { - url: '/par/parworkinfo/update', - action: 'POST', - parameter: {}, - data: this.selectInfo, - message: '修改成功' + const vm = this + this.$refs.ruleForm.validate(valid => { + if (valid) { + vm.confirmLoading = true + vm.selectInfo.zxrlb = '1' + if (vm.operate === 'detile') { + // 详情 + vm.confirmLoading = false + // 关闭编辑框 + vm.modelVisible = false + } + if (vm.operate === 'add') { + // 新增 + vm.actionParam = { + url: '/par/parworkinfo/insert', + action: 'POST', + parameter: {}, + data: vm.selectInfo, + message: '新增成功' + } + } + if (vm.operate === 'edit') { + // 修改 + vm.actionParam = { + url: '/par/parworkinfo/update', + action: 'POST', + parameter: {}, + data: vm.selectInfo, + message: '修改成功' + } + } + // 调用请求 + return method(vm.actionParam).then(res => { + vm.confirmLoading = false + // 关闭编辑框 + vm.modelVisible = false + // 刷新列表 + vm.$refs.stable.refresh(true) + }) + } else { + return false } - } - // 调用请求 - return method(this.actionParam).then(res => { - this.confirmLoading = false - // 关闭编辑框 - this.modelVisible = false - // 刷新列表 - this.$refs.stable.refresh(true) }) } } diff --git a/src/views/par/parworkinfo/ParWorkInfoUser.vue b/src/views/par/parworkinfo/ParWorkInfoUser.vue index cb138ed..ce02163 100644 --- a/src/views/par/parworkinfo/ParWorkInfoUser.vue +++ b/src/views/par/parworkinfo/ParWorkInfoUser.vue @@ -78,10 +78,16 @@ :confirmLoading="confirmLoading" centered > - + - + 个人工作备忘 - + - + 问题类型 任务类型 工作类型 - + - - + - - + - 自定义 - + - - + - + - + - + - + - + - + - + - + - - + - + @@ -400,7 +406,11 @@ export default { staffList: [], currentRole: 'unitRole', qdShow: false, - currDate: moment(new Date()) + currDate: moment(new Date()), + rules: { + gzlb: [{ required: true, message: '请选择工作类别', trigger: 'change' }], + gznr: [{ required: true, message: '工作内容不能为空', trigger: 'blur' }] + } } }, created () { @@ -558,7 +568,9 @@ export default { console.log('点击操作', action, selectInfo) this.operate = action // 记录当前操作 this.selectInfo = Object.assign({}, selectInfo) // 记录当前操作的数据 - this.selectInfo.sfszqxgz = '2' + if (action === 'add') { + this.selectInfo.sfszqxgz = '2' + } const dateFormat = 'YYYY-MM-DD' if (selectInfo.kssj) { this.selectInfo.kssj = moment(this.selectInfo.kssj, dateFormat) @@ -577,8 +589,8 @@ export default { } else { this.zqShow = false } - const zdyzq = this.selectInfo.zdyzq ? this.selectInfo.zdyzq : '' - if (zdyzq === '6') { + const zq = this.selectInfo.zq ? this.selectInfo.zq : '' + if (zq === '6') { this.zdyzqShow = true } else { this.zdyzqShow = false @@ -626,43 +638,50 @@ export default { }, // 确认 handleOk () { - this.confirmLoading = true - this.selectInfo.zxrlb = '2' - this.selectInfo.zxr = this.userInfo.id - this.selectInfo.pfzt = '1' - if (this.operate === 'detile') { - // 详情 - this.confirmLoading = false - // 关闭编辑框 - this.modelVisible = false - } - if (this.operate === 'add') { - // 新增 - this.actionParam = { - url: '/par/parworkinfo/insert', - action: 'POST', - parameter: {}, - data: this.selectInfo, - message: '新增成功' - } - } - if (this.operate === 'edit') { - // 修改 - this.actionParam = { - url: '/par/parworkinfo/update', - action: 'POST', - parameter: {}, - data: this.selectInfo, - message: '修改成功' + const vm = this + this.$refs.ruleForm.validate(valid => { + if (valid) { + vm.confirmLoading = true + vm.selectInfo.zxrlb = '2' + vm.selectInfo.zxr = vm.userInfo.id + vm.selectInfo.pfzt = '1' + if (vm.operate === 'detile') { + // 详情 + vm.confirmLoading = false + // 关闭编辑框 + vm.modelVisible = false + } + if (vm.operate === 'add') { + // 新增 + vm.actionParam = { + url: '/par/parworkinfo/insert', + action: 'POST', + parameter: {}, + data: vm.selectInfo, + message: '新增成功' + } + } + if (vm.operate === 'edit') { + // 修改 + vm.actionParam = { + url: '/par/parworkinfo/update', + action: 'POST', + parameter: {}, + data: vm.selectInfo, + message: '修改成功' + } + } + // 调用请求 + return method(vm.actionParam).then(res => { + vm.confirmLoading = false + // 关闭编辑框 + vm.modelVisible = false + // 刷新列表 + vm.$refs.stable.refresh(true) + }) + } else { + return false } - } - // 调用请求 - return method(this.actionParam).then(res => { - this.confirmLoading = false - // 关闭编辑框 - this.modelVisible = false - // 刷新列表 - this.$refs.stable.refresh(true) }) } } -- Gitee From 11c2ced7d2405eaff1fd4b994c2ebe86529a6cb5 Mon Sep 17 00:00:00 2001 From: tianhao <2524518601@qq.com> Date: Wed, 2 Sep 2020 09:09:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/statisticalreport/StatisticalReport.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/statisticalreport/StatisticalReport.vue b/src/views/statisticalreport/StatisticalReport.vue index 94ba743..d1b21ad 100644 --- a/src/views/statisticalreport/StatisticalReport.vue +++ b/src/views/statisticalreport/StatisticalReport.vue @@ -200,7 +200,7 @@ export default { // console.log("内容结果", res); // }); const vm = this - query('/par/statisticalreport/content', 'GET').then(res => { + query('/par/statisticalreport/content', 'GET', vm.queryParam).then(res => { console.log('内容结果', res) vm.contentList = res.result this.confirmLoading = false -- Gitee