| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- <template>
- <div class="todo-list">
- <Header />
- <div class="content mt-15">
- <div class="flex gap-5 items-center mb-4 bg-[#f9f9f9] py-2">
- <p class="flex items-center">
- <Icon
- icon="mynaui:arrow-up-down"
- class="icon pr-1 h-6 w-6"
- color="#014099"
- />OA已办任务列表
- </p>
- <el-button
- type="primary"
- round
- size="default"
- color="#02409b"
- @click="router.back()"
- ><Icon
- icon="mynaui:corner-up-left"
- class="icon pr-1"
- width="20"
- height="20"
- />返回</el-button
- >
- </div>
- <div class="h-[90vh]">
- <el-table
- :data="oaTasks"
- style="width: 100%"
- height="80vh"
- :empty-text="
- loading
- ? '加载中...'
- : '暂无数据'
- "
- :header-cell-style="{
- backgroundColor: '#e9f7ff',
- color: 'black',
- fontWeight: '400',
- }"
- :cell-style="{
- color: 'black',
- }"
- >
- <el-table-column
- type="index"
- label="序号"
- width="80"
- fixed="left"
- align="center"
- :index="getIndex"
- />
- <el-table-column
- prop="requestName"
- label="请求标题"
- min-width="220"
- fixed="left"
- align="center"
- />
- <el-table-column
- prop="workflowBaseInfo.workflowTypeName"
- label="流程类型"
- width="140"
- align="center"
- />
- <el-table-column
- prop="requestLevel"
- label="紧急程度"
- width="100"
- align="center"
- />
- <el-table-column
- prop="status"
- label="路径状态"
- width="100"
- align="center"
- />
- <el-table-column
- prop="sysName"
- label="系统名称"
- width="140"
- align="center"
- />
- <el-table-column
- prop="createTime"
- label="创建时间"
- width="180"
- align="center"
- />
- <el-table-column
- prop="creatorName"
- label="创建人名称"
- width="120"
- align="center"
- />
- <el-table-column
- prop="currentNodeName"
- label="当前节点名称"
- width="140"
- align="center"
- />
- <el-table-column
- prop="lastOperateTime"
- label="最后操作时间"
- width="180"
- align="center"
- />
- <el-table-column
- prop="lastOperatorName"
- label="最后操作人名称"
- width="140"
- align="center"
- />
- <el-table-column
- prop="receiveTime"
- label="接收时间"
- width="180"
- align="center"
- />
- <el-table-column
- prop="workflowBaseInfo.workflowName"
- label="流程名称"
- min-width="200"
- align="center"
- />
- <el-table-column
- label="操作"
- width="120"
- fixed="right"
- align="center"
- >
- <template #default="scope">
- <span
- class="text-[#02409b] cursor-pointer"
- @click="goBackPage(scope.row)"
- >处理</span
- >
- </template>
- </el-table-column>
- </el-table>
- <div class="pagination-wrap">
- <el-pagination
- v-model:current-page="pagination.pageNum"
- v-model:page-size="pagination.pageSize"
- :total="pagination.total"
- :page-sizes="[10, 20, 50, 100]"
- layout="total, sizes, prev, pager, next"
- background
- @current-change="handleCurrentChange"
- @size-change="handleSizeChange"
- />
- </div>
- </div>
- </div>
- <Footer />
- </div>
- </template>
- <script setup>
- import Header from "@components/home/header.vue";
- import { ref, onMounted } from "vue";
- import { getOATasks, ssoLogin } from "@/api/user";
- import { useUserStore } from "@/stores/useUserStore";
- import { Icon } from "@iconify/vue";
- import router from "@/router";
- const userStore = useUserStore();
- const oaTasks = ref([]);
- const loading = ref(false);
- const pagination = ref({
- pageNum: 1,
- pageSize: 10,
- total: 0,
- });
- const getIndex = (index) => {
- return (pagination.value.pageNum - 1) * pagination.value.pageSize + index + 1;
- };
- const getDoneList = async () => {
- if (!userStore.getUser.username) return;
- loading.value = true;
- try {
- const res = await getOATasks({
- id: userStore.getUser.username,
- pageNum: pagination.value.pageNum,
- pageSize: pagination.value.pageSize,
- });
- oaTasks.value = res.doneList || [];
- pagination.value.total = Number(res.doneCount ?? oaTasks.value.length ?? 0);
- } finally {
- loading.value = false;
- }
- };
- const handleCurrentChange = (page) => {
- pagination.value.pageNum = page;
- getDoneList();
- };
- const handleSizeChange = (size) => {
- pagination.value.pageSize = size;
- pagination.value.pageNum = 1;
- getDoneList();
- };
- const goBackPage = async (row) => {
- const res = await ssoLogin({
- username: userStore.getUser.username,
- });
- if (res) {
- const ua = window.navigator.userAgent.toLowerCase();
- if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
- dd.biz.util.openLink({
- url:
- "https://yfoa.keruioil.com/wui/index.html" +
- "?ssoToken=" +
- res +
- "#/main", // 先跳你的 SSO 链接
- onSuccess: () => {
- // 延迟跳目标业务地址(和你原来 setTimeout 逻辑一致)
- setTimeout(() => {
- dd.biz.util.openLink({
- url: `https://yfoa.keruioil.com/spa/workflow/static4form/index.html?_rdm=1776063595284#/main/workflow/req?requestid=${row.requestId}`,
- });
- }, 100);
- },
- });
- } else {
- const newTab = window.open("", "_blank");
- newTab.location.href =
- "https://yfoa.keruioil.com/wui/index.html" +
- "?ssoToken=" +
- res +
- "#/main";
- setTimeout(function () {
- newTab.location.href = `https://yfoa.keruioil.com/spa/workflow/static4form/index.html?_rdm=1776063595284#/main/workflow/req?requestid=${row.requestId}`;
- }, 100);
- }
- }
- };
- onMounted(async () => {
- if (userStore.getUser.username) {
- getDoneList();
- }
- });
- </script>
- <style scoped>
- .todo-list {
- display: flex;
- flex-direction: column;
- min-height: 100%;
- }
- .content {
- padding: 16px 20px;
- margin-top: 100px;
- }
- .pagination-wrap {
- display: flex;
- justify-content: flex-end;
- margin-top: 16px;
- }
- </style>
|