index.ts 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. import request from '@/config/axios'
  2. export type InullyApplyFormType = {
  3. id: string
  4. nickname?: string
  5. nullyApplyUserId: string
  6. flowInstanceId: string
  7. voidFlowInstanceId: string
  8. iNullied: string
  9. voidFlowCode: string
  10. voidFlowDesc: string
  11. voidFlowName: string
  12. nullyApplyTime: string
  13. nullyReason: string
  14. }
  15. export type CallbackFormType = {
  16. flowInsId: string
  17. currentActInsId: string
  18. currentActTempId: string
  19. participantId: string
  20. position: string
  21. callbackRemark: string
  22. iBranchReturn?: string
  23. }
  24. const jsonToFormData = (json: Object) => {
  25. const formData = new FormData()
  26. const keys = Object.keys(json)
  27. keys.forEach((key) => {
  28. if (json[key] instanceof Object) {
  29. formData.append(key, JSON.stringify(json[key]))
  30. } else {
  31. formData.append(key, json[key])
  32. }
  33. })
  34. return formData
  35. }
  36. // 获取办件中心Tab列表
  37. export const officeCenterModule = async () => {
  38. return await request.postOriginal(
  39. {
  40. url: '/HandlerCaseCenter/officeCenterModule',
  41. headersType: 'application/form-data'
  42. },
  43. '/workflow'
  44. )
  45. }
  46. // 获取办件中心列表
  47. export const getHandlerCaseCenterList = async (data) => {
  48. return await request.postOriginal(
  49. {
  50. url: '/HandlerCaseCenter/list',
  51. data: jsonToFormData(data),
  52. headersType: 'application/form-data'
  53. },
  54. '/workflow'
  55. )
  56. }
  57. // 获取办件中心模板列表
  58. export const getFlowTemplateTree = async () => {
  59. return await request.postOriginal(
  60. { url: '/TFlowTemplateApi/selectFlowTemplateTree' },
  61. '/workflow'
  62. )
  63. }
  64. // 发起流程
  65. export const addTProcessEngine = async (templateId: string) => {
  66. const formData = new FormData()
  67. formData.append('templateId', templateId)
  68. return await request.postOriginal(
  69. {
  70. url: '/TProcessEngine/add',
  71. data: formData,
  72. headersType: 'application/form-data'
  73. },
  74. '/workflow'
  75. )
  76. }
  77. // 获取办件中心汇总数据
  78. export const getHandlerCaseCenterCount = async (data) => {
  79. return await request.postOriginal(
  80. { url: '/HandlerCaseCenter/count', data: data, headersType: 'application/form-data' },
  81. '/workflow'
  82. )
  83. }
  84. // 获取流程模版列表
  85. export const GetFlowTemplateTreeData = async () => {
  86. return await request.postOriginal(
  87. {
  88. url: '/TFlowTemplate/GetFlowTemplateTreeData',
  89. data: null,
  90. headersType: 'application/form-data'
  91. },
  92. '/workflow'
  93. )
  94. }
  95. // 获取办件中心新建办件模板
  96. export const getFlowTemplateTreeDataByUser = async (data) => {
  97. return await request.postOriginal(
  98. {
  99. url: '/TFlowTemplate/GetFlowTemplateTreeDataByUser',
  100. data: data,
  101. headersType: 'application/form-data'
  102. },
  103. '/workflow'
  104. )
  105. }
  106. //办件中心“追回”操作
  107. export const recoverActivity = async (data: {
  108. activityInstanceId: string
  109. participantId: string
  110. }) => {
  111. return await request.postOriginal(
  112. {
  113. url: '/HandlerCaseCenter/recoverActivity',
  114. data: jsonToFormData(data),
  115. headersType: 'application/form-data'
  116. },
  117. '/workflow'
  118. )
  119. }
  120. //办件中心“解挂”操作
  121. export const addIHangUp = async (data: { activityInstanceId: string; isRecover: number }) => {
  122. return await request.postOriginal(
  123. {
  124. url: '/IHangUp/add',
  125. data: jsonToFormData(data),
  126. headersType: 'application/form-data'
  127. },
  128. '/workflow'
  129. )
  130. }
  131. //办件中心“恢复作废”操作
  132. export const addINullyApply = async (data: {
  133. activityInstanceId: string
  134. voidFlowInstanceId: string
  135. isRecover: number
  136. }) => {
  137. return await request.postOriginal(
  138. {
  139. url: '/INullyApply/add',
  140. data: jsonToFormData(data),
  141. headersType: 'application/form-data'
  142. },
  143. '/workflow'
  144. )
  145. }
  146. //办件中心“彻底作废”操作
  147. export const completelyVoidINullyApply = async (data: { flowInstanceId: string }) => {
  148. return await request.postOriginal(
  149. {
  150. url: '/INullyApply/completelyVoid',
  151. data: jsonToFormData(data),
  152. headersType: 'application/form-data'
  153. },
  154. '/workflow'
  155. )
  156. }
  157. //办件中心“挂起”操作
  158. export const isHangUp = async (data: { activityInstanceId: string }) => {
  159. // {"activityInstanceId": rowObj.ACTIVITYINSID}
  160. return await request.postOriginal(
  161. {
  162. url: '/Transfer/isHangUp',
  163. data: data,
  164. headersType: 'application/form-data'
  165. },
  166. '/workflow'
  167. )
  168. }
  169. //效验该流程是否已经作废
  170. export const isFlowVoid = async (data: { flowInstanceId: string }) => {
  171. return await request.postOriginal(
  172. {
  173. url: '/Transfer/isVoid',
  174. data: jsonToFormData(data),
  175. headersType: 'application/form-data'
  176. },
  177. '/workflow'
  178. )
  179. }
  180. //获取提交作废的参数
  181. export const getINullyApplyExample = async (data: {
  182. voidFlowInstanceId: string
  183. isRecover: number
  184. }) => {
  185. return await request.postOriginal(
  186. {
  187. url: '/INullyApply/getExample',
  188. data: jsonToFormData(data),
  189. headersType: 'application/form-data'
  190. },
  191. '/workflow'
  192. )
  193. }
  194. //办件中心“作废”操作
  195. export const saveINullyApply = async (data: { nullyApply: InullyApplyFormType }) => {
  196. return await request.postOriginal(
  197. {
  198. url: '/INullyApply/save',
  199. data: jsonToFormData(data),
  200. headersType: 'application/form-data'
  201. },
  202. '/workflow'
  203. )
  204. }
  205. //获取退回所在流程信息
  206. export const getCalBackActivityNew = async (data: {
  207. activityInstanceId: string
  208. flowInsId: string
  209. }) => {
  210. return await request.postOriginal(
  211. {
  212. url: '/HandlerCaseCenter/getCalBackActivityNew',
  213. data: jsonToFormData(data),
  214. headersType: 'application/form-data'
  215. },
  216. '/workflow'
  217. )
  218. }
  219. //检查退件
  220. export const checkReturnMethod = async (data: {
  221. paramMap: {
  222. flowInsId: string
  223. currentActInsId: string
  224. currentActTempId: string
  225. participantId: string
  226. position: string
  227. callbackRemark: string
  228. }
  229. backToActivitys: {
  230. callbackActTempId: string
  231. callbackActInsId: string
  232. }[]
  233. }) => {
  234. return await request.postOriginal(
  235. {
  236. url: '/HandlerCaseCenter/checkReturnMethod',
  237. data: jsonToFormData(data),
  238. headersType: 'application/form-data'
  239. },
  240. '/workflow'
  241. )
  242. }
  243. //发起退回操作
  244. export const callbackActivitySure = async (data: {
  245. paramMap: CallbackFormType
  246. backToActivitys: {
  247. callbackActTempId: string
  248. callbackActInsId: string
  249. }[]
  250. }) => {
  251. return await request.postOriginal(
  252. {
  253. url: '/HandlerCaseCenter/callbackActivity',
  254. data: jsonToFormData(data),
  255. headersType: 'application/form-data'
  256. },
  257. '/workflow'
  258. )
  259. }
  260. //公共待办件提示
  261. export const openOfficeTip = async (data: {
  262. activityInsId: string
  263. particiPantId: string
  264. isView: boolean
  265. }) => {
  266. return await request.postOriginal(
  267. {
  268. url: '/HandlerCaseCenter/openOfficeTip',
  269. data: jsonToFormData(data),
  270. headersType: 'application/form-data'
  271. },
  272. '/workflow'
  273. )
  274. }
  275. //转流程办理页面
  276. export const saveAndGetUrl = async (data: {
  277. activityInsId: string
  278. flowInsId: string
  279. participantId: string
  280. status: string
  281. userId: string | null
  282. isView: boolean
  283. }) => {
  284. return await request.postOriginal(
  285. {
  286. url: '/HandlerCaseCenter/saveAndGetUrl',
  287. data: jsonToFormData(data),
  288. headersType: 'application/form-data'
  289. },
  290. '/workflow'
  291. )
  292. }