index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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 label="摘要" prop="summary" min-width="180">
  48. <template #default="scope">
  49. <div class="flex flex-col" v-if="scope.row.summary && scope.row.summary.length > 0">
  50. <div v-for="(item, index) in scope.row.summary" :key="index">
  51. <el-text type="info"> {{ item.key }} : {{ item.value }} </el-text>
  52. </div>
  53. </div>
  54. </template>
  55. </el-table-column>
  56. <el-table-column
  57. align="center"
  58. label="流程发起人"
  59. prop="startUser.nickname"
  60. min-width="100"
  61. />
  62. <el-table-column
  63. :formatter="dateFormatter"
  64. align="center"
  65. label="流程发起时间"
  66. prop="processInstanceStartTime"
  67. width="180"
  68. />
  69. <el-table-column align="center" label="抄送节点" prop="activityName" min-width="180" />
  70. <el-table-column align="center" label="抄送人" min-width="100">
  71. <template #default="scope"> {{ scope.row.createUser?.nickname || '系统' }} </template>
  72. </el-table-column>
  73. <el-table-column align="center" label="抄送意见" prop="reason" width="150" />
  74. <el-table-column
  75. align="center"
  76. label="抄送时间"
  77. prop="createTime"
  78. width="180"
  79. :formatter="dateFormatter"
  80. />
  81. <el-table-column align="center" label="操作" fixed="right" width="80">
  82. <template #default="scope">
  83. <el-button link type="primary" @click="handleAudit(scope.row)">详情</el-button>
  84. </template>
  85. </el-table-column>
  86. </el-table>
  87. <!-- 分页 -->
  88. <Pagination
  89. v-model:limit="queryParams.pageSize"
  90. v-model:page="queryParams.pageNo"
  91. :total="total"
  92. @pagination="getList"
  93. />
  94. </ContentWrap>
  95. </template>
  96. <script lang="ts" setup>
  97. import { dateFormatter } from '@/utils/formatTime'
  98. import * as ProcessInstanceApi from '@/api/bpm/processInstance'
  99. defineOptions({ name: 'BpmProcessInstanceCopy' })
  100. const { push } = useRouter() // 路由
  101. const loading = ref(false) // 列表的加载中
  102. const total = ref(0) // 列表的总页数
  103. const list = ref([]) // 列表的数据
  104. const queryParams = reactive({
  105. pageNo: 1,
  106. pageSize: 10,
  107. processInstanceId: '',
  108. processInstanceName: '',
  109. createTime: []
  110. })
  111. const queryFormRef = ref() // 搜索的表单
  112. /** 查询任务列表 */
  113. const getList = async () => {
  114. loading.value = true
  115. try {
  116. const data = await ProcessInstanceApi.getProcessInstanceCopyPage(queryParams)
  117. list.value = data.list
  118. total.value = data.total
  119. } finally {
  120. loading.value = false
  121. }
  122. }
  123. /** 处理审批按钮 */
  124. const handleAudit = (row: any) => {
  125. const query = {
  126. id: row.processInstanceId,
  127. activityId: undefined
  128. }
  129. if (row.activityId) {
  130. query.activityId = row.activityId
  131. }
  132. push({
  133. name: 'BpmProcessInstanceDetail',
  134. query: query
  135. })
  136. }
  137. /** 搜索按钮操作 */
  138. const handleQuery = () => {
  139. queryParams.pageNo = 1
  140. getList()
  141. }
  142. /** 重置按钮操作 */
  143. const resetQuery = () => {
  144. queryFormRef.value.resetFields()
  145. handleQuery()
  146. }
  147. /** 初始化 **/
  148. onMounted(() => {
  149. getList()
  150. })
  151. </script>