index.vue 3.6 KB

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