From f7a6e516c0fb1ed1872b816f7c08a4754a2b9e45 Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Thu, 19 Jun 2025 16:25:10 +0800 Subject: [PATCH] =?UTF-8?q?iws=E5=B7=A5=E5=8D=95=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages.json | 4 +- src/pages/login/index.vue | 1 - src/pages/picking/review/details.vue | 59 ++++++++++++++++++++++------ src/pages/picking/review/index.vue | 2 +- src/services/standard.js | 2 +- src/utils/http.js | 4 +- 6 files changed, 55 insertions(+), 17 deletions(-) diff --git a/src/pages.json b/src/pages.json index dd9e891..8d5070b 100644 --- a/src/pages.json +++ b/src/pages.json @@ -189,7 +189,9 @@ { "path": "pages/picking/review/details", "style": { - "navigationBarTitleText": "领用申请详情" + "navigationBarTitleText": "", + "navigationStyle": "custom", // 使用自定义导航栏 + "navigationBarBackImage": "" } }, diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index 67d8aee..936efc6 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -46,7 +46,6 @@ onMounted(async () => { if (origin.indexOf('ticket') != -1) { try { uni.showLoading({ title: '登录中' }) - const { data: result } = await iwsLoginAPI({ ticket: origin.split('ticket=')[1].split('#/')[0], sysType: 1, diff --git a/src/pages/picking/review/details.vue b/src/pages/picking/review/details.vue index 3f9dceb..a4678a3 100644 --- a/src/pages/picking/review/details.vue +++ b/src/pages/picking/review/details.vue @@ -154,10 +154,10 @@ import { ref, computed, onUnmounted } from 'vue' import { onLoad, onShow, } from '@dcloudio/uni-app' import { getCodeDeviceListAPI, setOutboundNumAPI, } from '@/services/picking/outbound.js' import { getAuditInfoAPI,receiveDetailAPI,submitAuditingApi } from '@/services/picking/review.js' - +import { appLoginAPI, getUserInfoAPI, iwsLoginAPI } from '@/services/index.js' import { debounce } from 'lodash-es' - - +import { useMemberStore } from '@/stores' +const memberStore = useMemberStore() // const query = defineProps() // 获取上级页面传递的路由参数 // const queryParams = JSON.parse(query.queryParams) const queryParams = ref({ @@ -201,19 +201,54 @@ const toggleForm = () => { const type = ref(1) const userId = uni.getStorageSync('id') +const origin = window.location.href // 页面加载完毕 -onLoad((options) => { - console.log("options",options) - // queryParams.value = JSON.parse(options.params) - // auditingParams.value.taskId = queryParams.value.taskId - // type.value = queryParams.value.type +onLoad(async(options) => { + if (origin.indexOf('params') != -1) { + queryParams.value = JSON.parse(options.params) + auditingParams.value.taskId = queryParams.value.taskId + type.value = queryParams.value.type + }else{ //工单跳转 + const urlParams = new URLSearchParams(origin); + queryParams.value.taskId = urlParams.get('taskId'); + queryParams.value.id = urlParams.get('id'); + auditingParams.value.taskId =urlParams.get('taskId') + const ticketMatch = origin.match(/ticket=([^&]*)/); + const ticket = ticketMatch ? ticketMatch[1] : ''; + // uni.showModal({ + // title: '当前页面路径', + // content: ticket, + // showCancel: false + // }) + const { data: result } = await iwsLoginAPI({ + ticket: ticket, + sysType: 1, + }) + // 1. 获取 token 并存储 + memberStore.setToken(result.access_token) + // 2 . 获取用户信息并存储 + const res = await getUserInfoAPI() + memberStore.setUserInfo(res.user) + // uni.showToast({ title: '登录成功!', icon: 'none' }) + // uni.setStorageSync('username', loginForm.username) + // uni.setStorageSync('password', loginForm.password) + uni.setStorageSync('id', res.user.userId) + uni.setStorageSync('deptName', res.user?.dept?.deptName) + uni.setStorageSync('urlPermissions',res.urlPermissions?res.urlPermissions:[]) + + // setTimeout(() => { + // uni.switchTab({ + // url: '/pages/picking/details', + // }) + // }, 500) + } }) onShow(() => { console.log(queryParams.value) // getCodeDetailData(queryParams.value.id,queryParams.value.publishTask,queryParams.value.typeId)//获取详情 - // getReviewInfo(queryParams.value.id) - // fetchAuditInfo() + getReviewInfo(queryParams.value.id) + fetchAuditInfo() }) // 获取详情列表 const getReviewInfo = async (id) => { @@ -362,6 +397,8 @@ const onHandleOutbound = async () => {