index.vue 3.8 KB

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