index.vue 3.7 KB

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