index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <!-- 工作流 - 抄送我的流程 -->
  2. <template>
  3. <doc-alert
  4. title="审批转办、委派、抄送"
  5. url="https://doc.iocoder.cn/bpm/task-delegation-and-cc/"
  6. />
  7. <ContentWrap>
  8. <!-- 搜索工作栏 -->
  9. <el-form ref="queryFormRef" :inline="true" class="-mb-15px" label-width="68px">
  10. <el-form-item label="流程名称" prop="name">
  11. <el-input
  12. v-model="queryParams.processInstanceName"
  13. @keyup.enter="handleQuery"
  14. class="!w-240px"
  15. clearable
  16. placeholder="请输入流程名称"
  17. />
  18. </el-form-item>
  19. <el-form-item label="抄送时间" prop="createTime">
  20. <el-date-picker
  21. v-model="queryParams.createTime"
  22. :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
  23. class="!w-240px"
  24. end-placeholder="结束日期"
  25. start-placeholder="开始日期"
  26. type="daterange"
  27. value-format="YYYY-MM-DD HH:mm:ss"
  28. />
  29. </el-form-item>
  30. <el-form-item>
  31. <el-button @click="handleQuery">
  32. <Icon class="mr-5px" icon="ep:search" />
  33. 搜索
  34. </el-button>
  35. <el-button @click="resetQuery">
  36. <Icon class="mr-5px" icon="ep:refresh" />
  37. 重置
  38. </el-button>
  39. </el-form-item>
  40. </el-form>
  41. </ContentWrap>
  42. <!-- 列表 -->
  43. <ContentWrap>
  44. <el-table v-loading="loading" :data="list">
  45. <!-- TODO 芋艿:增加摘要 -->
  46. <el-table-column align="center" label="流程名" prop="processInstanceName" min-width="180" />
  47. <el-table-column
  48. align="center"
  49. label="流程发起人"
  50. prop="startUser.nickname"
  51. min-width="100"
  52. />
  53. <el-table-column
  54. :formatter="dateFormatter"
  55. align="center"
  56. label="流程发起时间"
  57. prop="processInstanceStartTime"
  58. width="180"
  59. />
  60. <el-table-column align="center" label="抄送节点" prop="activityName" min-width="180" />
  61. <el-table-column align="center" label="抄送人" min-width="100">
  62. <template #default="scope"> {{ scope.row.createUser?.nickname || '系统' }} </template>
  63. </el-table-column>
  64. <el-table-column align="center" label="抄送意见" prop="reason" width="150" />
  65. <el-table-column
  66. align="center"
  67. label="抄送时间"
  68. prop="createTime"
  69. width="180"
  70. :formatter="dateFormatter"
  71. />
  72. <el-table-column align="center" label="操作" fixed="right" width="80">
  73. <template #default="scope">
  74. <el-button link type="primary" @click="handleAudit(scope.row)">详情</el-button>
  75. </template>
  76. </el-table-column>
  77. </el-table>
  78. <!-- 分页 -->
  79. <Pagination
  80. v-model:limit="queryParams.pageSize"
  81. v-model:page="queryParams.pageNo"
  82. :total="total"
  83. @pagination="getList"
  84. />
  85. </ContentWrap>
  86. </template>
  87. <script lang="ts" setup>
  88. import { dateFormatter } from '@/utils/formatTime'
  89. import * as ProcessInstanceApi from '@/api/bpm/processInstance'
  90. defineOptions({ name: 'BpmProcessInstanceCopy' })
  91. const { push } = useRouter() // 路由
  92. const loading = ref(false) // 列表的加载中
  93. const total = ref(0) // 列表的总页数
  94. const list = ref([]) // 列表的数据
  95. const queryParams = reactive({
  96. pageNo: 1,
  97. pageSize: 10,
  98. processInstanceId: '',
  99. processInstanceName: '',
  100. createTime: []
  101. })
  102. const queryFormRef = ref() // 搜索的表单
  103. /** 查询任务列表 */
  104. const getList = async () => {
  105. loading.value = true
  106. try {
  107. const data = await ProcessInstanceApi.getProcessInstanceCopyPage(queryParams)
  108. list.value = data.list
  109. total.value = data.total
  110. } finally {
  111. loading.value = false
  112. }
  113. }
  114. /** 处理审批按钮 */
  115. const handleAudit = (row: any) => {
  116. const query = {
  117. id: row.processInstanceId,
  118. activityId: undefined
  119. }
  120. if (row.activityId) {
  121. query.activityId = row.activityId
  122. }
  123. push({
  124. name: 'BpmProcessInstanceDetail',
  125. query: query
  126. })
  127. }
  128. /** 搜索按钮操作 */
  129. const handleQuery = () => {
  130. queryParams.pageNo = 1
  131. getList()
  132. }
  133. /** 重置按钮操作 */
  134. const resetQuery = () => {
  135. queryFormRef.value.resetFields()
  136. handleQuery()
  137. }
  138. /** 初始化 **/
  139. onMounted(() => {
  140. getList()
  141. })
  142. </script>