diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/BpmOALeaveController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/BpmOALeaveController.java index 41c691a27..e39a0747f 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/BpmOALeaveController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/BpmOALeaveController.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.adminserver.modules.bpm.controller.oa; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.OALeaveCreateReqVO; +import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.BpmOALeaveCreateReqVO; import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.OALeavePageReqVO; import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.OALeaveRespVO; import cn.iocoder.yudao.adminserver.modules.bpm.convert.oa.OALeaveConvert; @@ -39,7 +39,7 @@ public class BpmOALeaveController { @PostMapping("/create") @ApiOperation("创建请求申请") - public CommonResult createLeave(@Valid @RequestBody OALeaveCreateReqVO createReqVO) { + public CommonResult createLeave(@Valid @RequestBody BpmOALeaveCreateReqVO createReqVO) { return success(leaveService.createLeave(getLoginUserId(), createReqVO)); } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveCreateReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveCreateReqVO.java similarity index 88% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveCreateReqVO.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveCreateReqVO.java index 4fbe3148e..b411e4a1a 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/OALeaveCreateReqVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/oa/vo/BpmOALeaveCreateReqVO.java @@ -14,5 +14,5 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class OALeaveCreateReqVO extends BpmOALeaveBaseVO { +public class BpmOALeaveCreateReqVO extends BpmOALeaveBaseVO { } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/oa/OALeaveConvert.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/oa/OALeaveConvert.java index 3b49b10b0..3c5ae82eb 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/oa/OALeaveConvert.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/oa/OALeaveConvert.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.adminserver.modules.bpm.convert.oa; -import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.OALeaveCreateReqVO; +import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.BpmOALeaveCreateReqVO; import cn.iocoder.yudao.adminserver.modules.bpm.controller.oa.vo.OALeaveRespVO; import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.leave.OALeaveDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -19,7 +19,7 @@ public interface OALeaveConvert { OALeaveConvert INSTANCE = Mappers.getMapper(OALeaveConvert.class); - OALeaveDO convert(OALeaveCreateReqVO bean); + OALeaveDO convert(BpmOALeaveCreateReqVO bean); OALeaveRespVO convert(OALeaveDO bean); diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/BpmOALeaveService.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/BpmOALeaveService.java index 80d180c59..7048d3b6e 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/BpmOALeaveService.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/BpmOALeaveService.java @@ -6,8 +6,6 @@ import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.leave.OALeaveDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import javax.validation.Valid; -import java.util.Collection; -import java.util.List; /** * 请假申请 Service 接口 @@ -24,7 +22,7 @@ public interface BpmOALeaveService { * @param createReqVO 创建信息 * @return 编号 */ - Long createLeave(Long userId, @Valid OALeaveCreateReqVO createReqVO); + Long createLeave(Long userId, @Valid BpmOALeaveCreateReqVO createReqVO); /** * 删除请假申请 diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/impl/OALeaveServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/impl/OALeaveServiceImpl.java index 2278665e1..05aecee3f 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/impl/OALeaveServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/oa/impl/OALeaveServiceImpl.java @@ -44,7 +44,7 @@ public class OALeaveServiceImpl implements BpmOALeaveService { @Override @Transactional(rollbackFor = Exception.class) - public Long createLeave(Long userId, OALeaveCreateReqVO createReqVO) { + public Long createLeave(Long userId, BpmOALeaveCreateReqVO createReqVO) { // TODO 芋道源码 // 校验是否超过请假天数的上限; long day = DateUtil.betweenDay(createReqVO.getStartTime(), createReqVO.getEndTime(), false); diff --git a/yudao-admin-ui/src/api/oa/leave.js b/yudao-admin-ui/src/api/oa/leave.js index 2c51f3e47..3ff4040b7 100644 --- a/yudao-admin-ui/src/api/oa/leave.js +++ b/yudao-admin-ui/src/api/oa/leave.js @@ -3,7 +3,7 @@ import request from '@/utils/request' // 创建请假申请 export function createLeave(data) { return request({ - url: '/oa/leave/create', + url: '/bpm/oa/leave/create', method: 'post', data: data }) @@ -20,7 +20,7 @@ export function deleteLeave(id) { // 获得请假申请 export function getLeave(id) { return request({ - url: '/oa/leave/get?id=' + id, + url: '/bpm/oa/leave/get?id=' + id, method: 'get' }) } @@ -33,18 +33,3 @@ export function getLeavePage(query) { params: query }) } - -export function createFormKeyLeave(data) { - return request({ - url: '/oa/leave/form-key/create', - method: 'post', - data: data - }) -} - -export function getLeaveApplyMembers() { - return request({ - url: '/oa/leave/getLeaveApplyMembers', - method: 'get' - }) -} diff --git a/yudao-admin-ui/src/router/index.js b/yudao-admin-ui/src/router/index.js index 79529d446..17a82ed97 100644 --- a/yudao-admin-ui/src/router/index.js +++ b/yudao-admin-ui/src/router/index.js @@ -123,16 +123,21 @@ export const constantRoutes = [ ] }, { - path: '/flow', + path: '/bpm', component: Layout, hidden: true, redirect: 'noredirect', children: [ { - path: 'leave/apply', + path: 'oa/leave/create', component: (resolve) => require(['@/views/bpm/oa/leave/create'], resolve), - name: '请假表单-申请', - meta: { title: '请假表单-申请', icon: 'form' } + name: '发起 OA 请假', + meta: { title: '发起 OA 请假', icon: 'form' } + }, { + path: 'oa/leave/detail', + component: (resolve) => require(['@/views/bpm/oa/leave/detail'], resolve), + name: '查看 OA 请假', + meta: { title: '查看 OA 请假', icon: 'view' } } ] }, diff --git a/yudao-admin-ui/src/views/bpm/oa/leave/create.vue b/yudao-admin-ui/src/views/bpm/oa/leave/create.vue index b56167802..53a43ef21 100644 --- a/yudao-admin-ui/src/views/bpm/oa/leave/create.vue +++ b/yudao-admin-ui/src/views/bpm/oa/leave/create.vue @@ -8,38 +8,26 @@ - - - + + + - + - - - - 确 定 + 提 交 diff --git a/yudao-admin-ui/src/views/bpm/oa/leave/index.vue b/yudao-admin-ui/src/views/bpm/oa/leave/index.vue index 030b55350..31b7feed6 100644 --- a/yudao-admin-ui/src/views/bpm/oa/leave/index.vue +++ b/yudao-admin-ui/src/views/bpm/oa/leave/index.vue @@ -30,7 +30,7 @@ - 新增 + 发起请假 @@ -58,7 +58,7 @@ @@ -67,58 +67,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ getDictDataLabel(DICT_TYPE.OA_LEAVE_STATUS, form.status) }} - - {{form.userId}} - {{ parseTime(form.startTime) }} - {{ parseTime(form.endTime) }} - - {{ getDictDataLabel(DICT_TYPE.BPM_OA_LEAVE_TYPE, form.leaveType) }} - - {{form.reason}} - {{ parseTime(form.applyTime) }} - - - - @@ -156,17 +104,9 @@ export default { leaveType: null, reason: null, }, - // 表单参数 - form: {}, - // 表单校验 - rules: { - startTime: [{ required: true, message: "开始时间不能为空", trigger: "blur" }], - endTime: [{ required: true, message: "结束时间不能为空", trigger: "blur" }], - }, + leaveTypeDictData: getDictDatas(DICT_TYPE.BPM_OA_LEAVE_TYPE), leaveResultData: getDictDatas(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT), - - dialogDetailVisible: false, // TODO 芋艿:后面挪到详情页 }; }, created() { @@ -186,25 +126,6 @@ export default { this.loading = false; }); }, - /** 取消按钮 */ - cancel() { - this.open = false; - this.reset(); - }, - /** 表单重置 */ - reset() { - this.form = { - id: undefined, - status: undefined, - userId: undefined, - startTime: undefined, - endTime: undefined, - leaveType: undefined, - reason: undefined, - applyTime: undefined, - }; - this.resetForm("form"); - }, /** 搜索按钮操作 */ handleQuery() { this.queryParams.pageNo = 1; @@ -212,54 +133,22 @@ export default { }, /** 重置按钮操作 */ resetQuery() { - this.dateRangeStartTime = []; - this.dateRangeEndTime = []; this.dateRangeCreateTime = []; this.resetForm("queryForm"); this.handleQuery(); }, /** 新增按钮操作 */ handleAdd() { - getLeaveApplyMembers().then(response => { - const route = { - path: '/flow/leave/apply', - query: { - hr: response.data.hr, - pm: response.data.pm, - bm : response.data.bm - } - } - this.$router.replace(route); - }); + this.$router.push({ path: "/bpm/oa/leave/create"}); }, /** 详情按钮操作 */ handleDetail(row) { - this.reset(); - const id = row.id; - getLeave(id).then(response => { - this.form = response.data; - this.dialogDetailVisible = true - this.title = "请假详情"; - }); + this.$router.push({ path: "/bpm/oa/leave/detail", query: { id: row.id}}); }, /** 查看审批进度的操作 */ handleProcessDetail(row) { this.$router.push({ path: "/bpm/process-instance/detail", query: { id: row.processInstanceId}}); }, - /** 提交按钮 */ - submitForm() { - this.$refs["form"].validate(valid => { - if (!valid) { - return; - } - // 添加的提交 - createLeave(this.form).then(response => { - this.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); - }); - }, resultFormat(row, column) { return getDictDataLabel(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, row.result) },