index.vue 4.1 KB

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