oaDoneList.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <div class="todo-list">
  3. <Header />
  4. <div class="content mt-15">
  5. <div class="flex gap-5 items-center mb-4 bg-[#f9f9f9] py-2">
  6. <p class="flex items-center">
  7. <Icon
  8. icon="mynaui:arrow-up-down"
  9. class="icon pr-1 h-6 w-6"
  10. color="#014099"
  11. />OA已办任务列表
  12. </p>
  13. <el-button
  14. type="primary"
  15. round
  16. size="default"
  17. color="#02409b"
  18. @click="router.back()"
  19. ><Icon
  20. icon="mynaui:corner-up-left"
  21. class="icon pr-1"
  22. width="20"
  23. height="20"
  24. />&#36820;&#22238;</el-button
  25. >
  26. </div>
  27. <div class="h-[90vh]">
  28. <el-table
  29. :data="oaTasks"
  30. style="width: 100%"
  31. height="80vh"
  32. :empty-text="
  33. loading
  34. ? '&#21152;&#36733;&#20013;...'
  35. : '&#26242;&#26080;&#25968;&#25454;'
  36. "
  37. :header-cell-style="{
  38. backgroundColor: '#e9f7ff',
  39. color: 'black',
  40. fontWeight: '400',
  41. }"
  42. :cell-style="{
  43. color: 'black',
  44. }"
  45. >
  46. <el-table-column
  47. type="index"
  48. label="&#24207;&#21495;"
  49. width="80"
  50. fixed="left"
  51. align="center"
  52. :index="getIndex"
  53. />
  54. <el-table-column
  55. prop="requestName"
  56. label="&#35831;&#27714;&#26631;&#39064;"
  57. min-width="220"
  58. fixed="left"
  59. align="center"
  60. />
  61. <el-table-column
  62. prop="workflowBaseInfo.workflowTypeName"
  63. label="&#27969;&#31243;&#31867;&#22411;"
  64. width="140"
  65. align="center"
  66. />
  67. <el-table-column
  68. prop="requestLevel"
  69. label="&#32039;&#24613;&#31243;&#24230;"
  70. width="100"
  71. align="center"
  72. />
  73. <el-table-column
  74. prop="status"
  75. label="&#36335;&#24452;&#29366;&#24577;"
  76. width="100"
  77. align="center"
  78. />
  79. <el-table-column
  80. prop="sysName"
  81. label="&#31995;&#32479;&#21517;&#31216;"
  82. width="140"
  83. align="center"
  84. />
  85. <el-table-column
  86. prop="createTime"
  87. label="&#21019;&#24314;&#26102;&#38388;"
  88. width="180"
  89. align="center"
  90. />
  91. <el-table-column
  92. prop="creatorName"
  93. label="&#21019;&#24314;&#20154;&#21517;&#31216;"
  94. width="120"
  95. align="center"
  96. />
  97. <el-table-column
  98. prop="currentNodeName"
  99. label="&#24403;&#21069;&#33410;&#28857;&#21517;&#31216;"
  100. width="140"
  101. align="center"
  102. />
  103. <el-table-column
  104. prop="lastOperateTime"
  105. label="&#26368;&#21518;&#25805;&#20316;&#26102;&#38388;"
  106. width="180"
  107. align="center"
  108. />
  109. <el-table-column
  110. prop="lastOperatorName"
  111. label="&#26368;&#21518;&#25805;&#20316;&#20154;&#21517;&#31216;"
  112. width="140"
  113. align="center"
  114. />
  115. <el-table-column
  116. prop="receiveTime"
  117. label="&#25509;&#25910;&#26102;&#38388;"
  118. width="180"
  119. align="center"
  120. />
  121. <el-table-column
  122. prop="workflowBaseInfo.workflowName"
  123. label="&#27969;&#31243;&#21517;&#31216;"
  124. min-width="200"
  125. align="center"
  126. />
  127. <el-table-column
  128. label="&#25805;&#20316;"
  129. width="120"
  130. fixed="right"
  131. align="center"
  132. >
  133. <template #default="scope">
  134. <span
  135. class="text-[#02409b] cursor-pointer"
  136. @click="goBackPage(scope.row)"
  137. >&#22788;&#29702;</span
  138. >
  139. </template>
  140. </el-table-column>
  141. </el-table>
  142. <div class="pagination-wrap">
  143. <el-pagination
  144. v-model:current-page="pagination.pageNum"
  145. v-model:page-size="pagination.pageSize"
  146. :total="pagination.total"
  147. :page-sizes="[10, 20, 50, 100]"
  148. layout="total, sizes, prev, pager, next"
  149. background
  150. @current-change="handleCurrentChange"
  151. @size-change="handleSizeChange"
  152. />
  153. </div>
  154. </div>
  155. </div>
  156. <Footer />
  157. </div>
  158. </template>
  159. <script setup>
  160. import Header from "@components/home/header.vue";
  161. import { ref, onMounted } from "vue";
  162. import { getOATasks, ssoLogin } from "@/api/user";
  163. import { useUserStore } from "@/stores/useUserStore";
  164. import { Icon } from "@iconify/vue";
  165. import router from "@/router";
  166. const userStore = useUserStore();
  167. const oaTasks = ref([]);
  168. const loading = ref(false);
  169. const pagination = ref({
  170. pageNum: 1,
  171. pageSize: 10,
  172. total: 0,
  173. });
  174. const getIndex = (index) => {
  175. return (pagination.value.pageNum - 1) * pagination.value.pageSize + index + 1;
  176. };
  177. const getDoneList = async () => {
  178. if (!userStore.getUser.username) return;
  179. loading.value = true;
  180. try {
  181. const res = await getOATasks({
  182. id: userStore.getUser.username,
  183. pageNum: pagination.value.pageNum,
  184. pageSize: pagination.value.pageSize,
  185. });
  186. oaTasks.value = res.doneList || [];
  187. pagination.value.total = Number(res.doneCount ?? oaTasks.value.length ?? 0);
  188. } finally {
  189. loading.value = false;
  190. }
  191. };
  192. const handleCurrentChange = (page) => {
  193. pagination.value.pageNum = page;
  194. getDoneList();
  195. };
  196. const handleSizeChange = (size) => {
  197. pagination.value.pageSize = size;
  198. pagination.value.pageNum = 1;
  199. getDoneList();
  200. };
  201. const goBackPage = async (row) => {
  202. const res = await ssoLogin({
  203. username: userStore.getUser.username,
  204. });
  205. if (res) {
  206. const ua = window.navigator.userAgent.toLowerCase();
  207. if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
  208. dd.biz.util.openLink({
  209. url:
  210. "https://yfoa.keruioil.com/wui/index.html" +
  211. "?ssoToken=" +
  212. res +
  213. "#/main", // 先跳你的 SSO 链接
  214. onSuccess: () => {
  215. // 延迟跳目标业务地址(和你原来 setTimeout 逻辑一致)
  216. setTimeout(() => {
  217. dd.biz.util.openLink({
  218. url: `https://yfoa.keruioil.com/spa/workflow/static4form/index.html?_rdm=1776063595284#/main/workflow/req?requestid=${row.requestId}`,
  219. });
  220. }, 100);
  221. },
  222. });
  223. } else {
  224. const newTab = window.open("", "_blank");
  225. newTab.location.href =
  226. "https://yfoa.keruioil.com/wui/index.html" +
  227. "?ssoToken=" +
  228. res +
  229. "#/main";
  230. setTimeout(function () {
  231. newTab.location.href = `https://yfoa.keruioil.com/spa/workflow/static4form/index.html?_rdm=1776063595284#/main/workflow/req?requestid=${row.requestId}`;
  232. }, 100);
  233. }
  234. }
  235. };
  236. onMounted(async () => {
  237. if (userStore.getUser.username) {
  238. getDoneList();
  239. }
  240. });
  241. </script>
  242. <style scoped>
  243. .todo-list {
  244. display: flex;
  245. flex-direction: column;
  246. min-height: 100%;
  247. }
  248. .content {
  249. padding: 16px 20px;
  250. margin-top: 100px;
  251. }
  252. .pagination-wrap {
  253. display: flex;
  254. justify-content: flex-end;
  255. margin-top: 16px;
  256. }
  257. </style>