1
0

index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div class="completeLc">
  3. <div class="search-box">
  4. <a-form :model="formSearch" layout="inline" :label-col="labelCol">
  5. <a-form-item label="流程名称:">
  6. <a-input style="width:240px" placeholder="请输入..." allowClear v-model:value="formSearch.name" />
  7. </a-form-item>
  8. <a-form-item label="标识Key:">
  9. <a-input style="width:240px" placeholder="请输入..." allowClear v-model:value="formSearch.key" />
  10. </a-form-item>
  11. <a-form-item label="结束时间:">
  12. <a-range-picker v-model:value="formSearch.timer" :forfmat="dateFormat" />
  13. </a-form-item>
  14. <a-form-item label="">
  15. <a-button style="margin-right:10px" type="primary" preIcon="ant-design:search-outlined"
  16. @click="getSearch">查询</a-button>
  17. <a-button type="plain" @click="reset">重置</a-button>
  18. </a-form-item>
  19. </a-form>
  20. </div>
  21. <div class="content-box">
  22. <a-table size="small" :dataSource="dataSource" :columns="columns" :scroll="{ y: 730 }"
  23. :pagination="pagination">
  24. <template #action="{ record }">
  25. <a-button type="link" style="color:#3DF6FF" @click="getClick({ event: 'sp', row: record })">
  26. 审批历史
  27. </a-button>
  28. <a-button type="link" style="color:#3DF6FF" @click="getClick({ event: 'bd', row: record })">
  29. 表单数据
  30. </a-button>
  31. <a-popconfirm title="是否确认删除!" ok-text="确定" cancel-text="取消"
  32. @confirm="getClick({ event: 'del', row: record })">
  33. <a-button type="link" style="color:#3DF6FF">
  34. 删除
  35. </a-button>
  36. </a-popconfirm>
  37. </template>
  38. </a-table>
  39. </div>
  40. <!-- 审批详情弹窗 -->
  41. <a-modal v-model:visible="visibleSp" :footer="null" width="1000px" :title="titleSp" centered destroyOnClose>
  42. <HistorySp :historySpList="historySpList"></HistorySp>
  43. </a-modal>
  44. <!-- 表单数据弹窗 -->
  45. <a-modal v-model:visible="visibleForm" width="1000px" :footer="null" :title="titleForm" centered destroyOnClose>
  46. <formSp :formSpData="formSpData"></formSp>
  47. </a-modal>
  48. </div>
  49. </template>
  50. <script setup lang="ts">
  51. import { ref, reactive, onMounted } from 'vue'
  52. import HistorySp from '../progressLc/common/HistorySp.vue'
  53. import formSp from '../progressLc/common/formSp.vue'
  54. import { columns } from './completeLc.data'
  55. import { getFinishedProcess, getHistoricFlow, getForm } from './completeLc.api'
  56. const labelCol = { style: { width: '80px' } };
  57. let dateFormat = ref('YYYY-MM-DD')
  58. //查询参数
  59. let formSearch = reactive({
  60. name: '',
  61. key: '',
  62. timer: [],
  63. })
  64. //数据列表
  65. let dataSource = ref<any[]>([])
  66. //分页参数配置
  67. let pagination = reactive({
  68. current: 1, // 当前页码
  69. pageSize: 10, // 每页显示条数
  70. total: 0, // 总条目数,后端返回
  71. // showTotal: (total, range) => `${range[0]}-${range[1]} 条,总共 ${total} 条`, // 分页右下角显示信息
  72. showSizeChanger: true, // 是否可改变每页显示条数
  73. pageSizeOptions: ['10', '20', '50',], // 可选的每页显示条数
  74. })
  75. //审批历史数据
  76. let visibleSp = ref(false)
  77. let titleSp = ref('审批历史')
  78. let historySpList = reactive<any[]>([])
  79. //表单数据
  80. let visibleForm = ref(false)
  81. let titleForm = ref('')
  82. let formSpData = ref({})
  83. //获取列表数据
  84. async function getFinishedProcessList() {
  85. let res = await getFinishedProcess({ name: formSearch.name, key: formSearch.key, pageNumber: pagination.current, pageSize: pagination.pageSize })
  86. console.log(res, '列表数据------------')
  87. if (res.length != 0) {
  88. res.forEach(el => {
  89. el.versionC = 'v.1'
  90. })
  91. dataSource.value = res
  92. }
  93. }
  94. //获取审批历史列表数据
  95. async function getHistoricFlowList() {
  96. let res = await getHistoricFlow()
  97. console.log(res, '审批历史------------')
  98. if (res.length != 0) {
  99. historySpList.length = 0
  100. res.forEach(el => {
  101. historySpList.push({ name: el.name, username: el.assignees[0].username, deleteReason: el.deleteReason, comment: el.comment, startTime: el.startTime, endTime: el.endTime })
  102. })
  103. }
  104. }
  105. //获取审批-表单数据
  106. async function getFormList(param) {
  107. let res = await getForm(param)
  108. console.log(res, '表单数据------------')
  109. formSpData.value = res
  110. }
  111. //table操作
  112. function getClick(data) {
  113. switch (data.event) {
  114. case 'sp':
  115. visibleSp.value = true
  116. getHistoricFlowList()
  117. break;
  118. case 'bd':
  119. visibleForm.value = true
  120. titleForm.value = `查看流程业务信息${data.row.name}`
  121. getFormList({ tableId: data.row.tableId, tableName: data.row.tableName })
  122. break;
  123. case 'del':
  124. break;
  125. }
  126. }
  127. //查询
  128. function getSearch() {
  129. pagination.current = 1
  130. getFinishedProcessList()
  131. }
  132. //重置
  133. function reset() {
  134. formSearch.key = ''
  135. formSearch.name = ''
  136. formSearch.timer.length = 0
  137. pagination.current = 1
  138. getFinishedProcessList()
  139. }
  140. onMounted(() => {
  141. getFinishedProcessList()
  142. })
  143. </script>
  144. <style lang="less" scoped>
  145. .completeLc {
  146. position: relative;
  147. width: 100%;
  148. height: 100%;
  149. padding: 15px;
  150. box-sizing: border-box;
  151. .search-box {
  152. height: 50px;
  153. }
  154. .content-box {
  155. height: calc(100% - 40px);
  156. }
  157. }
  158. :deep(.zxm-form-item-label > label) {
  159. color: #fff;
  160. }
  161. :deep(.zxm-input-affix-wrapper) {
  162. color: #fff;
  163. background-color: #ffffff00;
  164. border: 1px solid #3ad8ff77 !important;
  165. }
  166. :deep(.zxm-input){
  167. color: #fff !important;
  168. background-color: #ffffff00 !important;
  169. }
  170. :deep(.zxm-picker) {
  171. color: #fff;
  172. background-color: #ffffff00;
  173. border: 1px solid #3ad8ff77 !important;
  174. }
  175. :deep(.zxm-picker-separator) {
  176. color: #fff !important;
  177. }
  178. :deep(.anticon.zxm-input-clear-icon){
  179. color:#fff;
  180. }
  181. </style>