index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <!--流程的流转记录-->
  2. <template>
  3. <div class="tels-restApply-precess-record">
  4. <el-dialog :title="state.dialogTitle" v-model="state.dialogVisible" width="90%" draggable destroy-on-close append-to-body>
  5. <slot name="header"></slot>
  6. <slot>
  7. <vxe-grid v-bind="gridOptions">
  8. <template #expand_content="{ row }">
  9. <div class="mb5 formatted-text">审核意见:{{ row.opinion }}</div>
  10. <annex-list name="附件" readonly businessId="" classify="查看附件" v-model="row.files" />
  11. </template>
  12. <template #action="{ row }">
  13. <el-button link type="primary" @click="onCountersign(row)">查看会签</el-button>
  14. </template>
  15. </vxe-grid>
  16. </slot>
  17. <slot name="footer"></slot>
  18. <template #footer>
  19. <el-button @click="closeDialog" class="default-button">关闭</el-button>
  20. </template>
  21. </el-dialog>
  22. <el-dialog title="查看会签" v-model="countersignDialog" append-to-body draggable destroy-on-close>
  23. <el-form>
  24. <el-row>
  25. <p class="border-title">发起会签信息</p>
  26. <el-row class="pd15 w100">
  27. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
  28. <el-form-item label="发起人:">{{ currentRow.createUserName }}</el-form-item>
  29. </el-col>
  30. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
  31. <el-form-item label="发起部门:">{{ currentRow.createUserName }}</el-form-item>
  32. </el-col>
  33. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
  34. <el-form-item label="发起时间:">{{ currentRow.createUserName }}</el-form-item>
  35. </el-col>
  36. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
  37. <el-form-item label="会签状态:">{{ currentRow.createUserName }}</el-form-item>
  38. </el-col>
  39. <el-col>
  40. <el-form-item label="发起意见:">{{ currentRow.createUserName }}</el-form-item>
  41. </el-col>
  42. </el-row>
  43. <el-divider />
  44. <el-col>
  45. <p class="border-title mt10 mb20">会签部门信息</p>
  46. </el-col>
  47. <el-row style="border: 1px solid #ccc" class="w100 pd10">
  48. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
  49. <el-form-item label="办理部门:">{{ currentRow.createUserName }}</el-form-item>
  50. </el-col>
  51. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
  52. <el-form-item label="期满时间:">{{ currentRow.createUserName }}</el-form-item>
  53. </el-col>
  54. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
  55. <el-form-item label="办理时间:">{{ currentRow.createUserName }}</el-form-item>
  56. </el-col>
  57. <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
  58. <el-form-item label="办理人:">{{ currentRow.createUserName }}</el-form-item>
  59. </el-col>
  60. <el-col>
  61. <el-form-item label="办理意见:">{{ currentRow.createUserName }}</el-form-item>
  62. </el-col>
  63. </el-row>
  64. </el-row>
  65. </el-form>
  66. <template #footer>
  67. <el-button @click="closeDialogCountersign" class="default-button">关闭</el-button>
  68. </template>
  69. </el-dialog>
  70. </div>
  71. </template>
  72. <script setup lang="ts" name="auditRecord">
  73. import { reactive, defineAsyncComponent, ref } from 'vue';
  74. import { workflowTraces } from '@/api/system/workflow';
  75. import { transformFile } from '@/utils/tools';
  76. const AnnexList = defineAsyncComponent(() => import('@/components/AnnexList/index.vue')); // 附件列表
  77. // 定义变量内容
  78. const state = reactive<any>({
  79. dialogVisible: false,
  80. traces: [],
  81. loading: false,
  82. dialogTitle: '流程明细',
  83. });
  84. const currentRow = ref();
  85. const gridOptions = reactive<any>({
  86. border: true,
  87. loading: false,
  88. showOverflow: true,
  89. columnConfig: {
  90. resizable: true,
  91. },
  92. scrollY: {
  93. enabled: true,
  94. gt: 100,
  95. },
  96. rowConfig: { isHover: true, height: 30, useKey: true },
  97. expandConfig: { padding: true },
  98. columns: [
  99. { type: 'seq', width: 50 },
  100. { type: 'expand', width: 50, slots: { content: 'expand_content' } },
  101. { field: 'handleTime', title: '建立时间', width: 160, formatter: 'formatDate' },
  102. { field: 'name', title: '当前节点' },
  103. { field: 'handler', title: '交办人' },
  104. { field: 'name', title: '交办部门' },
  105. { field: 'acceptorName', title: '接办人' },
  106. { field: 'name', title: '接办部门' },
  107. { field: 'name', title: '办理人' },
  108. { field: 'acceptTime', title: '签收时间', width: 160, formatter: 'formatDate' },
  109. { field: 'handleTime', title: '办理时间', width: 160, formatter: 'formatDate' },
  110. { field: 'stepExpiredTime', title: '期满时间', width: 160, formatter: 'formatDate' },
  111. { field: 'expiredStatusText', title: '超期状态',minWidth:120 },
  112. { field: 'traceTypeText', title: '流转状态' },
  113. { field: 'counterSignTypeText', title: '是否会签', width: 90, slots: { default: 'action' } },
  114. ],
  115. data: [],
  116. });
  117. // 打开弹窗
  118. const openDialog = async (row: any) => {
  119. gridOptions.loading = true;
  120. state.dialogVisible = true;
  121. await getTable(row);
  122. currentRow.value = row;
  123. };
  124. const getTable = async (row: any) => {
  125. try {
  126. // 查询审核记录
  127. const { result } = await workflowTraces(row.workflowId);
  128. state.traces = result?.traces ?? [];
  129. state.traces = formatTraces(state.traces);
  130. state.dialogTitle = row.dialogTitle ?? '流程明细';
  131. gridOptions.data = formatTraces(state.traces);
  132. gridOptions.loading = false;
  133. } catch (error) {
  134. console.log(error,'错误')
  135. gridOptions.loading = false;
  136. }
  137. };
  138. const formatTraces = (val: any) => {
  139. if (!val || !val.length) return [];
  140. val.forEach((item: any) => {
  141. item.files = transformFile(item.files);
  142. switch (item.expiredStatus) {
  143. case 0:
  144. item.type = 'success';
  145. break;
  146. case 1:
  147. item.type = 'primary';
  148. break;
  149. case 2:
  150. item.type = 'danger';
  151. break;
  152. default:
  153. break;
  154. }
  155. if (item.traces?.length) {
  156. formatTraces(item.traces);
  157. }
  158. });
  159. return val;
  160. };
  161. // 关闭流程弹窗
  162. const closeDialog = () => {
  163. state.dialogVisible = false;
  164. };
  165. // 会签弹窗
  166. const countersignDialog = ref(false);
  167. // 查看会签
  168. const onCountersign = (row:any)=>{
  169. console.log(row,'111');
  170. countersignDialog.value = true;
  171. }
  172. // 关闭会签弹窗
  173. const closeDialogCountersign = ()=>{
  174. countersignDialog.value = false;
  175. }
  176. // 暴露变量
  177. defineExpose({
  178. openDialog,
  179. closeDialog,
  180. });
  181. </script>