mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 04:08:43 +08:00 
			
		
		
		
	实现 OA 请假的取消申请
This commit is contained in:
		@@ -9,14 +9,6 @@ export function createLeave(data) {
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 删除请假申请
 | 
			
		||||
export function deleteLeave(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/oa/leave/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得请假申请
 | 
			
		||||
export function getLeave(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
@@ -1,9 +0,0 @@
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export function getStartForm(processKey) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/workflow/process/definition/getStartForm?processKey='+processKey,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -1,91 +0,0 @@
 | 
			
		||||
import request from '@/utils/request'
 | 
			
		||||
 | 
			
		||||
// 创建请假申请
 | 
			
		||||
export function createLeave(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/oa/leave/create',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 更新请假申请
 | 
			
		||||
export function updateLeave(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/oa/leave/update',
 | 
			
		||||
    method: 'put',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 删除请假申请
 | 
			
		||||
export function deleteLeave(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/oa/leave/delete?id=' + id,
 | 
			
		||||
    method: 'delete'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得请假申请
 | 
			
		||||
export function getLeave(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/oa/leave/get?id=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 获得待办任务分页
 | 
			
		||||
export function getTodoTaskPage(query) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/workflow/task/todo/page',
 | 
			
		||||
    method: 'get',
 | 
			
		||||
    params: query
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 签收任务
 | 
			
		||||
export function claimTask(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/workflow/task/claim?id=' + id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function completeTask(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/workflow/task/complete',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function taskSteps(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/workflow/task/task-steps',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function getTaskFormKey(data) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/workflow/task/formKey',
 | 
			
		||||
    method: 'post',
 | 
			
		||||
    data: data
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function processHistorySteps(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/workflow/task/process/history-steps?id='+id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export function getHighlightImg(id) {
 | 
			
		||||
  return request({
 | 
			
		||||
    url: '/workflow/task/process/highlight-img?processInstanceId='+id,
 | 
			
		||||
    method: 'get'
 | 
			
		||||
  })
 | 
			
		||||
}
 | 
			
		||||
@@ -26,8 +26,9 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { createLeave} from "@/api/oa/leave"
 | 
			
		||||
import { createLeave}  from "@/api/bpm/leave"
 | 
			
		||||
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "LeaveCreate",
 | 
			
		||||
  components: {
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { getLeave} from "@/api/oa/leave"
 | 
			
		||||
import { getLeave}  from "@/api/bpm/leave"
 | 
			
		||||
import {getDictDatas, DICT_TYPE, getDictDataLabel} from '@/utils/dict'
 | 
			
		||||
export default {
 | 
			
		||||
  name: "LeaveDetail",
 | 
			
		||||
 
 | 
			
		||||
@@ -56,8 +56,10 @@
 | 
			
		||||
          <span>{{ parseTime(scope.row.createTime) }}</span>
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
 | 
			
		||||
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
 | 
			
		||||
        <template slot-scope="scope">
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleCancel(scope.row)"
 | 
			
		||||
                     v-if="scope.row.result === 1">取消请假</el-button>
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)">详情</el-button>
 | 
			
		||||
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleProcessDetail(scope.row)">审批进度</el-button>
 | 
			
		||||
        </template>
 | 
			
		||||
@@ -71,8 +73,9 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { createLeave, getLeaveApplyMembers, getLeave, getLeavePage} from "@/api/oa/leave"
 | 
			
		||||
import { getLeavePage } from "@/api/bpm/leave"
 | 
			
		||||
import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict'
 | 
			
		||||
import {cancelProcessInstance} from "@/api/bpm/processInstance";
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "Leave",
 | 
			
		||||
@@ -88,20 +91,14 @@ export default {
 | 
			
		||||
      total: 0,
 | 
			
		||||
      // 请假申请列表
 | 
			
		||||
      list: [],
 | 
			
		||||
      // 弹出层标题
 | 
			
		||||
      title: "",
 | 
			
		||||
      // 是否显示弹出层
 | 
			
		||||
      open: false,
 | 
			
		||||
      //审批进度弹出层
 | 
			
		||||
      dateRangeCreateTime: [],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 10,
 | 
			
		||||
        processInstanceId: null,
 | 
			
		||||
        status: null,
 | 
			
		||||
        userId: null,
 | 
			
		||||
        leaveType: null,
 | 
			
		||||
        result: null,
 | 
			
		||||
        type: null,
 | 
			
		||||
        reason: null,
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
@@ -149,6 +146,22 @@ export default {
 | 
			
		||||
    handleProcessDetail(row) {
 | 
			
		||||
      this.$router.push({ path: "/bpm/process-instance/detail", query: { id: row.processInstanceId}});
 | 
			
		||||
    },
 | 
			
		||||
    /** 取消请假 */
 | 
			
		||||
    handleCancel(row) {
 | 
			
		||||
      const id = row.processInstanceId;
 | 
			
		||||
      this.$prompt('请输入取消原因?', "取消流程", {
 | 
			
		||||
        type: 'warning',
 | 
			
		||||
        confirmButtonText: "确定",
 | 
			
		||||
        cancelButtonText: "取消",
 | 
			
		||||
        inputPattern: /^[\s\S]*.*[^\s][\s\S]*$/, // 判断非空,且非空格
 | 
			
		||||
        inputErrorMessage: "取消原因不能为空",
 | 
			
		||||
      }).then(({ value }) => {
 | 
			
		||||
        return cancelProcessInstance(id, value);
 | 
			
		||||
      }).then(() => {
 | 
			
		||||
        this.getList();
 | 
			
		||||
        this.msgSuccess("取消成功");
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    resultFormat(row, column) {
 | 
			
		||||
      return getDictDataLabel(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, row.result)
 | 
			
		||||
    },
 | 
			
		||||
 
 | 
			
		||||
@@ -192,7 +192,7 @@ export default {
 | 
			
		||||
    /** 取消按钮操作 */
 | 
			
		||||
    handleCancel(row) {
 | 
			
		||||
      const id = row.id;
 | 
			
		||||
      this.$prompt('请输出取消原因?', "取消流程", {
 | 
			
		||||
      this.$prompt('请输入取消原因?', "取消流程", {
 | 
			
		||||
        type: 'warning',
 | 
			
		||||
        confirmButtonText: "确定",
 | 
			
		||||
        cancelButtonText: "取消",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user