index.vue 4.5 KB

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