工单bug修复
This commit is contained in:
parent
fee3d8f842
commit
bab932cdbe
|
|
@ -216,49 +216,56 @@ onLoad(async(options) => {
|
||||||
queryParams.value = JSON.parse(options.params)
|
queryParams.value = JSON.parse(options.params)
|
||||||
auditingParams.value.taskId = queryParams.value.taskId
|
auditingParams.value.taskId = queryParams.value.taskId
|
||||||
type.value = queryParams.value.type
|
type.value = queryParams.value.type
|
||||||
}else{ //工单跳转
|
// 直接执行后续操作
|
||||||
|
initPageData();
|
||||||
|
} else { //工单跳转
|
||||||
const urlParams = new URLSearchParams(origin);
|
const urlParams = new URLSearchParams(origin);
|
||||||
queryParams.value.taskId = urlParams.get('taskId');
|
queryParams.value.taskId = urlParams.get('taskId');
|
||||||
queryParams.value.id = urlParams.get('id');
|
queryParams.value.id = urlParams.get('id');
|
||||||
auditingParams.value.taskId =urlParams.get('taskId')
|
auditingParams.value.taskId = urlParams.get('taskId')
|
||||||
const ticketMatch = origin.match(/ticket=([^&]*)/);
|
const ticketMatch = origin.match(/ticket=([^&]*)/);
|
||||||
const ticket = ticketMatch ? ticketMatch[1] : '';
|
const ticket = ticketMatch ? ticketMatch[1] : '';
|
||||||
// uni.showModal({
|
|
||||||
// title: '当前页面路径',
|
try {
|
||||||
// content: ticket,
|
|
||||||
// showCancel: false
|
|
||||||
// })
|
|
||||||
const { data: result } = await iwsLoginAPI({
|
const { data: result } = await iwsLoginAPI({
|
||||||
ticket: ticket,
|
ticket: ticket,
|
||||||
sysType: 1,
|
sysType: 1,
|
||||||
})
|
})
|
||||||
// 1. 获取 token 并存储
|
// 1. 获取token并存储
|
||||||
memberStore.setToken(result.access_token)
|
await memberStore.setToken(result.access_token)
|
||||||
// 2 . 获取用户信息并存储
|
// 2. 获取用户信息并存储
|
||||||
const res = await getUserInfoAPI()
|
const res = await getUserInfoAPI()
|
||||||
memberStore.setUserInfo(res.user)
|
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('id', res.user.userId)
|
||||||
userId.value = res.user.userId
|
userId.value = res.user.userId
|
||||||
uni.setStorageSync('deptName', res.user?.dept?.deptName)
|
uni.setStorageSync('deptName', res.user?.dept?.deptName)
|
||||||
uni.setStorageSync('urlPermissions',res.urlPermissions?res.urlPermissions:[])
|
uni.setStorageSync('urlPermissions', res.urlPermissions ? res.urlPermissions : [])
|
||||||
|
|
||||||
// setTimeout(() => {
|
// 登录完成后执行后续操作
|
||||||
// uni.switchTab({
|
initPageData();
|
||||||
// url: '/pages/picking/details',
|
} catch (error) {
|
||||||
// })
|
console.error('登录失败:', error)
|
||||||
// }, 500)
|
uni.showToast({ title: '登录失败,请重试', icon: 'none' })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const initPageData = () => {
|
||||||
onShow(() => {
|
|
||||||
console.log(queryParams.value)
|
console.log(queryParams.value)
|
||||||
// getCodeDetailData(queryParams.value.id,queryParams.value.publishTask,queryParams.value.typeId)//获取详情
|
|
||||||
getReviewInfo(queryParams.value.id)
|
getReviewInfo(queryParams.value.id)
|
||||||
fetchAuditInfo()
|
fetchAuditInfo()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 移除onShow中的重复逻辑,或保留作为刷新时的处理
|
||||||
|
onShow(() => {
|
||||||
|
// 可以留空或处理页面重新显示时的逻辑
|
||||||
})
|
})
|
||||||
|
// onShow(() => {
|
||||||
|
// console.log(queryParams.value)
|
||||||
|
// // getCodeDetailData(queryParams.value.id,queryParams.value.publishTask,queryParams.value.typeId)//获取详情
|
||||||
|
// getReviewInfo(queryParams.value.id)
|
||||||
|
// fetchAuditInfo()
|
||||||
|
// })
|
||||||
// 获取详情列表
|
// 获取详情列表
|
||||||
const getReviewInfo = async (id) => {
|
const getReviewInfo = async (id) => {
|
||||||
console.log("yyyyyyyyyy",id)
|
console.log("yyyyyyyyyy",id)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue