index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. class="!w-240px"
  14. clearable
  15. placeholder="请输入流程名称"
  16. />
  17. </el-form-item>
  18. <el-form-item label="抄送时间" prop="createTime">
  19. <el-date-picker
  20. v-model="queryParams.createTime"
  21. :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
  22. class="!w-240px"
  23. end-placeholder="结束日期"
  24. start-placeholder="开始日期"
  25. type="daterange"
  26. value-format="YYYY-MM-DD HH:mm:ss"
  27. />
  28. </el-form-item>
  29. <el-form-item>
  30. <el-button @click="handleQuery">
  31. <Icon class="mr-5px" icon="ep:search" />
  32. 搜索
  33. </el-button>
  34. <el-button @click="resetQuery">
  35. <Icon class="mr-5px" icon="ep:refresh" />
  36. 重置
  37. </el-button>
  38. </el-form-item>
  39. </el-form>
  40. </ContentWrap>
  41. <!-- 列表 -->
  42. <ContentWrap>
  43. <el-table v-loading="loading" :data="list">
  44. <el-table-column align="center" label="流程名" prop="processInstanceName" min-width="180" />
  45. <el-table-column align="center" label="流程发起人" prop="startUserName" min-width="100" />
  46. <el-table-column
  47. :formatter="dateFormatter"
  48. align="center"
  49. label="流程发起时间"
  50. prop="processInstanceStartTime"
  51. width="180"
  52. />
  53. <el-table-column align="center" label="抄送任务" prop="taskName" min-width="180" />
  54. <el-table-column align="center" label="抄送人" prop="creatorName" min-width="100" />
  55. <el-table-column
  56. align="center"
  57. label="抄送时间"
  58. prop="createTime"
  59. width="180"
  60. :formatter="dateFormatter"
  61. />
  62. <el-table-column align="center" label="操作" fixed="right" width="80">
  63. <template #default="scope">
  64. <el-button link type="primary" @click="handleAudit(scope.row)">详情</el-button>
  65. </template>
  66. </el-table-column>
  67. </el-table>
  68. <!-- 分页 -->
  69. <Pagination
  70. v-model:limit="queryParams.pageSize"
  71. v-model:page="queryParams.pageNo"
  72. :total="total"
  73. @pagination="getList"
  74. />
  75. </ContentWrap>
  76. </template>
  77. <script lang="ts" setup>
  78. import { dateFormatter } from '@/utils/formatTime'
  79. import * as ProcessInstanceApi from '@/api/bpm/processInstance'
  80. defineOptions({ name: 'BpmProcessInstanceCopy' })
  81. const { push } = useRouter() // 路由
  82. const loading = ref(false) // 列表的加载中
  83. const total = ref(0) // 列表的总页数
  84. const list = ref([]) // 列表的数据
  85. const queryParams = reactive({
  86. pageNo: 1,
  87. pageSize: 10,
  88. processInstanceId: '',
  89. processInstanceName: '',
  90. createTime: []
  91. })
  92. const queryFormRef = ref() // 搜索的表单
  93. /** 查询任务列表 */
  94. const getList = async () => {
  95. loading.value = true
  96. try {
  97. const data = await ProcessInstanceApi.getProcessInstanceCopyPage(queryParams)
  98. list.value = data.list
  99. total.value = data.total
  100. } finally {
  101. loading.value = false
  102. }
  103. }
  104. /** 处理审批按钮 */
  105. const handleAudit = (row: any) => {
  106. push({
  107. name: 'BpmProcessInstanceDetail',
  108. query: {
  109. id: row.processInstanceId
  110. }
  111. })
  112. }
  113. /** 搜索按钮操作 */
  114. const handleQuery = () => {
  115. queryParams.pageNo = 1
  116. getList()
  117. }
  118. /** 重置按钮操作 */
  119. const resetQuery = () => {
  120. queryFormRef.value.resetFields()
  121. handleQuery()
  122. }
  123. /** 初始化 **/
  124. onMounted(() => {
  125. getList()
  126. })
  127. </script>