diff --git a/src/views/par/examperiod/ExamPeriod.vue b/src/views/par/examperiod/ExamPeriod.vue index bbaaafd36e15528028dfb0a8ebe9d1d760d9dbc1..9eef56db34ab41a09e4357b6d219d76c4b443f09 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 c37def35c447f2fc41bbf311459240cffaa734f1..965d29151d9892ed8823bb8a77ebe36f5b92e761 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 46f48d38de1712a421a01c3409db4dcbee238dea..475b096c905f799c4209860a724f2e13f723decd 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 cb138edb6c80db5d6c19d866cfd687337e72c958..ce021633e0de8bbbe0c554d233dde6765e0a26e6 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) }) } } diff --git a/src/views/statisticalreport/StatisticalReport.vue b/src/views/statisticalreport/StatisticalReport.vue index 94ba74378b15bb5d6e7bef1496e2928ef9f192ba..d1b21ad699fc1b00324d05496ca96496ea6bf21b 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