| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- /*
- * @Author: tengmingxue 1473375109@qq.com
- * @Date: 2023-09-11 19:36:34
- * @LastEditors: tengmingxue 1473375109@qq.com
- * @LastEditTime: 2023-09-25 21:47:12
- * @FilePath: \xld-gis-admin\src\api\resource\examine.ts
- * @Description: 流程配置信息api
- */
- import { defHttp } from '/@/utils/http/axios';
- enum Api {
- SelectFlowInfo = '/base-center/flow/selectFlowInfo', //查询流程信息
- SaveFlowInfo = '/base-center/flow/saveFlowInfo', //新增、更新流程信息
- SaveFlowInfoAll = '/base-center/flow/insertFlowInfoAll', //新增流程、节点、节点人员信息
- DelFLowInfo = '/base-center/flow/deleteFlowInfo', //删除流程
- SelectLowConfig = '/base-center/flow/selectFlowInfoAll', //查询流程、节点、节点人员信息
- SubmitExamine = '/base-center/flow/saveBussinfo',//发起申请
- SubminExamineResult = '/base-center/flow/submitBussinfo',//审核操作
- GetFlowInfoAll = '/base-center/flow/getFlowInfoAll',//获取所有业务
- }
- /**
- * @description: 查询流程信息
- * @param: page:页数 must
- * @param: rows:每页数据条数 must
- * @param: keyStr:模糊查询关键字
- * @param: id:流程id
- */
- export const queryFlowInfoPage = (params) => {
- params['rows'] = params?.pageSize ? params?.pageSize : 10
- return new Promise<void>((resolve) => {
- defHttp.post({ url: Api.SelectFlowInfo, params: params }).then((res) => {
- const result = res.resp_code === 0 ? res.datas.pageData : []
- result.forEach(item => {
- item['id'] = item['ID']
- });
- resolve(result)
- })
- })
- };
- /**
- * @description:根据流程业务id查询流程配置所有信息
- * @param: ids:字符串数组
- */
- export const queryFlowInfoById = (param) => {
- const data = param.toString()
- // const dataFrom = new FormData()
- // dataFrom.append('',data)
- return new Promise<void>((resolve) => {
- defHttp.post({
- url: Api.SelectLowConfig,
- data,
- headers: {
- 'Content-Type': 'application/json;charset=UTF-8'
- },
- }).then((res) => {
- const result = (res.resp_code === 0 && res.datas.length > 0) ? res.datas[0] : null
- resolve(result)
- })
- })
- }
- /**
- * @description:根据流程业务查询流程配置所有信息
- * @param: ids:字符串数组
- */
- export const queryFlowInfo = async(params) => {
- return new Promise<void>((resolve) => {
- defHttp.post({
- url: Api.SelectLowConfig,
- params,
- headers: {
- 'Content-Type': 'application/json;charset=UTF-8',
- },
- }).then((res) => {
- const result = (res.resp_code === 0) ? res.datas : null
- resolve(result)
- })
- })
- }
- /**
- * @description: 一次提交流程配置信息
- * @param: flowInfo:流程信息 must
- * @param: flowNode:流程步骤结点信息 must
- * @param: flowNodePerson:流程审核人信息 must
- *
- */
- export const addFlowInfoAll = (params) => {
- return new Promise<void>((resolve) => {
- defHttp.post({ url: Api.SaveFlowInfoAll, params }).then((res) => {
- resolve(res)
- })
- })
- };
- /**
- * @description: 批量删除流程信息
- * @param: ids:流程信息id must
- *
- */
- export const delFlowInfo = (params) => {
- const data = params.toString()
- return new Promise<void>((resolve) => {
- defHttp.post({
- url: Api.DelFLowInfo, data, headers: {
- 'Content-Type': 'application/json;charset=UTF-8'
- },
- }).then((res) => {
- resolve(res)
- })
- })
- };
- /**
- * 根据业务类型名称获取流程配置
- */
- export const getFlowConfigByBusinessName = async (name) => {
- return new Promise<void>(async(resolve) => {
- const params = {
- page:1,
- pageSize:200,
- }
- const list = await queryFlowInfoPage(params)
- let result = null
- if(list.length > 0){
- const obj = list.find(item=>item['FLOWNAME']===name)
- if(obj){
- const data = {
- flowInfo:{
- id:obj['ID']
- }
- }
- result = await queryFlowInfo(data)
- }
- else result = null
- }
- else{
- result = null
- }
- resolve(result)
- })
- }
- /**
- * @description: 提交审核信息
- * @param: bussInfo:流程信息 must
- * @param: bussInfo.bussname 业务名称(流程名称)
- * @param: bussInfo.flowid 流程id
- * @param: bussInfo.serverids 资源id
- *
- */
- export const submitExamine = (params) => {
- return new Promise<void>((resolve) => {
- defHttp.post({ url: Api.SubmitExamine, params }).then((res) => {
- resolve(res)
- })
- })
- };
- /**
- * @description: 提交审核结果
- * @param: bussInfoId: 业务id
- * @param: ispass 是否通过
- * @param: opinion 意见 required:false
- * @param: userId 用户ID required:false
- *
- */
- export const subminExamineResult = (params) => {
- return new Promise<void>((resolve) => {
- defHttp.post({ url: Api.SubminExamineResult, params }).then((res) => {
- resolve(res)
- })
- })
- };
- /**
- * @description: 查询发起的业务信息
- * @param: page:页数 must
- * @param: rows:每页数据条数 must
- * @param: keyStr:模糊查询关键字
- * @param: userId:用户id
- */
- export const queryTaskInfoPage = (params) => {
- // params['rows'] = params?.pageSize ? params?.pageSize : 10
- return new Promise<void>((resolve) => {
- defHttp.post({ url: Api.GetFlowInfoAll, params: params }).then((res) => {
- // const result = res.resp_code === 0 ? res.datas.pageData : []
- // result.forEach(item => {
- // item['id'] = item['ID']
- // });
- // resolve(result)
- resolve(res)
- })
- })
- };
|