|
@@ -112,7 +112,7 @@
|
|
|
import Header from "@components/home/header.vue";
|
|
import Header from "@components/home/header.vue";
|
|
|
import * as dd from "dingtalk-jsapi";
|
|
import * as dd from "dingtalk-jsapi";
|
|
|
import { ref, onMounted } from "vue";
|
|
import { ref, onMounted } from "vue";
|
|
|
-import { getSRMTasks, ssoLogin } from "@/api/user";
|
|
|
|
|
|
|
+import { getSRMTasks, srmLogin } from "@/api/user";
|
|
|
import { useUserStore } from "@/stores/useUserStore";
|
|
import { useUserStore } from "@/stores/useUserStore";
|
|
|
import { Icon } from "@iconify/vue";
|
|
import { Icon } from "@iconify/vue";
|
|
|
import router from "@/router";
|
|
import router from "@/router";
|
|
@@ -129,46 +129,42 @@ const pagination = ref({
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const goBackPage = async (row) => {
|
|
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",
|
|
|
|
|
- // onSuccess: () => {
|
|
|
|
|
- // 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 loading = ElLoading.service({
|
|
|
|
|
- // lock: true,
|
|
|
|
|
- // text: "正在跳转,请稍候...",
|
|
|
|
|
- // background: "rgba(0, 0, 0, 0.7)",
|
|
|
|
|
- // });
|
|
|
|
|
- // 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}`;
|
|
|
|
|
- // setTimeout(() => {
|
|
|
|
|
- // loading.close();
|
|
|
|
|
- // }, 500);
|
|
|
|
|
- // }, 100);
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ const res = await srmLogin({
|
|
|
|
|
+ username: userStore.getUser.username,
|
|
|
|
|
+ });
|
|
|
|
|
+ if (JSON.parse(res).msg === "账号未授权") {
|
|
|
|
|
+ dialogVisible.value = true;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (res) {
|
|
|
|
|
+ const ua = window.navigator.userAgent.toLowerCase();
|
|
|
|
|
+ if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
|
|
|
|
|
+ dd.biz.util.openLink({
|
|
|
|
|
+ url: `https://srm.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`,
|
|
|
|
|
+ onSuccess: () => {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ dd.biz.util.openLink({
|
|
|
|
|
+ url: `https://srm.deepoil.cc/#/workflow-process/request-${row.requestId}`,
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 100);
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const loading = ElLoading.service({
|
|
|
|
|
+ lock: true,
|
|
|
|
|
+ text: "正在跳转,请稍候...",
|
|
|
|
|
+ background: "rgba(0, 0, 0, 0.7)",
|
|
|
|
|
+ });
|
|
|
|
|
+ const newTab = window.open("", "_blank");
|
|
|
|
|
+ newTab.location.href = `https://srm.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`;
|
|
|
|
|
+ setTimeout(function () {
|
|
|
|
|
+ newTab.location.href = `https://srm.deepoil.cc/#/workflow-process/request-${row.requestId}`;
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ }, 500);
|
|
|
|
|
+ }, 500);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleCurrentChange = async (page) => {
|
|
const handleCurrentChange = async (page) => {
|