|
|
@@ -329,10 +329,6 @@
|
|
|
return selectedItems.value.find((s: SelectedItem) => s.itemId === mdItem.itemId) != null
|
|
|
}
|
|
|
|
|
|
- onMounted(() => {
|
|
|
- loadCategories()
|
|
|
- })
|
|
|
-
|
|
|
const handleSearch = (): void => {
|
|
|
page.value = 1
|
|
|
loadItems()
|
|
|
@@ -380,6 +376,8 @@
|
|
|
result['wmPurchaseApplyLineList'] = applyLines
|
|
|
return result
|
|
|
}
|
|
|
+ // 来源页面
|
|
|
+ const fromIndexPage = ref<boolean>(false)
|
|
|
|
|
|
// 保存申请
|
|
|
const saveApplication = (): void => {
|
|
|
@@ -394,7 +392,13 @@
|
|
|
// 清空已选列表
|
|
|
selectedItems.value = []
|
|
|
loadItems()
|
|
|
- }).catch((e) => { // 添加箭头 =>
|
|
|
+ // 如果从index.uvue跳转过来,返回index.uvue
|
|
|
+ if (fromIndexPage.value) {
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateBack()
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+ }).catch((e) => {
|
|
|
console.log(e)
|
|
|
const error = e as UTSError
|
|
|
const errMsg = error?.message
|
|
|
@@ -423,12 +427,28 @@
|
|
|
// 清空已选列表
|
|
|
selectedItems.value = []
|
|
|
loadItems()
|
|
|
+ // 如果从index.uvue跳转过来,返回index.uvue
|
|
|
+ if (fromIndexPage.value) {
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateBack()
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
}).catch((e) => {
|
|
|
const error = e as UTSError
|
|
|
const errMsg = error?.message
|
|
|
uni.showToast({ title: errMsg.toString(), icon: 'none' })
|
|
|
})
|
|
|
}
|
|
|
+ onMounted(() => {
|
|
|
+ loadCategories()
|
|
|
+ // 获取页面参数,判断是否从index.uvue跳转过来
|
|
|
+ const pages = getCurrentPages()
|
|
|
+ const currentPage = pages[pages.length - 1]
|
|
|
+ const options = currentPage.options
|
|
|
+ if (options != null && options.from == 'index') {
|
|
|
+ fromIndexPage.value = true
|
|
|
+ }
|
|
|
+ })
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|