feat:ActionBar上一票下一票优化 可传递额外参数

zth
yujinlong 3 weeks ago
parent 0c0a275e0d
commit a97bf805e1

@ -199,6 +199,7 @@
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { useGo } from '/@/hooks/web/usePage' import { useGo } from '/@/hooks/web/usePage'
import { closePage } from '/@/hooks/web/common' import { closePage } from '/@/hooks/web/common'
import { setObjToUrlParams } from '/@/utils'
export default defineComponent({ export default defineComponent({
name: 'ActionBar', name: 'ActionBar',
props: { props: {
@ -335,21 +336,22 @@
extraIndex = index - 1 extraIndex = index - 1
} else { } else {
// //
if (index == 19) { if (index == ids.length - 1) {
return createMessage.warning('该票为当前页码最后一票!') return createMessage.warning('该票为当前页码最后一票!')
} }
id = ids[index + 1] id = ids[index + 1]
extraIndex = index + 1 extraIndex = index + 1
} }
const extraQuery = props?.getExtraQuery(extraIndex) || {} const extraQuery = props?.getExtraQuery ? props?.getExtraQuery(extraIndex) : {}
go({ const goParams = {
path: route.path,
query: {
id, id,
...extraQuery, ...extraQuery,
}, }
go({
path: route.path,
query: goParams,
}) })
closePage(route.path + '?id=' + id) closePage(setObjToUrlParams(route.path, goParams))
} else { } else {
createMessage.warning('列表页面数据丢失,请回退列表页面后重试!') createMessage.warning('列表页面数据丢失,请回退列表页面后重试!')
} }

@ -218,8 +218,6 @@
// Query // Query
const getActionExtraQuery = (index) => { const getActionExtraQuery = (index) => {
const obj = appStore.getIdsData const obj = appStore.getIdsData
console.log('expenseAccount', obj['expenseAccount'])
console.log('index', index)
if (obj && obj['expenseAccount']) { if (obj && obj['expenseAccount']) {
const preData = obj['expenseAccount'][index] const preData = obj['expenseAccount'][index]

@ -177,8 +177,8 @@
go({ go({
path: '/expenseAccountDetail', path: '/expenseAccountDetail',
query: { query: {
type: pageType,
id: row.id, id: row.id,
type: pageType,
tabName: pageType == 'EDIT' ? '报销单申请' : '报销单详情', tabName: pageType == 'EDIT' ? '报销单申请' : '报销单详情',
}, },
}) })

Loading…
Cancel
Save