From 2e99f3e099c8541808312eae125c7af5a498e122 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期三, 03 一月 2024 16:07:00 +0800
Subject: [PATCH] 修改出入库明细headerTitle刷新丢失的问题
---
src/views/overview/AddOverviewDialog.vue | 58 +++++++++++++++--------------
src/router/index.js | 27 ++++++++++---
2 files changed, 50 insertions(+), 35 deletions(-)
diff --git a/src/router/index.js b/src/router/index.js
index 7718b21..9eb031e 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -168,14 +168,27 @@
router.afterEach((to, from, next) => {
- if ((to.path === "/overview/overviewList" || to.path === "/productManage/productList") && to.params.name) {
- console.log(from, next)
- to.meta.title = to.params.name
- // document.title = to.meta.title
- } else if (to.name === "inboundOutboundDetail") {
- to.meta.title = "鍏ュ簱鏄庣粏鎶ヨ〃"
- // document.title = to.meta.title
+ if(window.sessionStorage.getItem('routeName')){
+ if(to.path === "/overview/overviewList"&&to.meta.title!="閲囪喘鍏ュ簱"){
+ window.sessionStorage.setItem("routeName",to.params.name)
+ to.meta.title=to.params.name
+ }else if(to.meta.title==="閲囪喘鍏ュ簱"){
+ to.meta.title = window.sessionStorage.getItem('routeName');
+ }
+ }else{
+ if ((to.path === "/overview/overviewList" || to.path === "/productManage/productList") && to.params.name) {
+ console.log(from, next)
+ window.sessionStorage.setItem("routeName",to.params.name)
+ to.meta.title = window.sessionStorage.getItem('routeName');
+ // document.title = to.meta.title
+ } else if (to.name === "inboundOutboundDetail") {
+ to.meta.title = "鍏ュ簱鏄庣粏鎶ヨ〃"
+ // document.title = to.meta.title
+ }else{
+ // window.sessionStorage.removeItem("routeName")
+ }
}
+
})
// router.beforeEach((to, from, next) => {
// must call `next`
diff --git a/src/views/overview/AddOverviewDialog.vue b/src/views/overview/AddOverviewDialog.vue
index c860cac..70433e6 100644
--- a/src/views/overview/AddOverviewDialog.vue
+++ b/src/views/overview/AddOverviewDialog.vue
@@ -767,37 +767,39 @@
})
}
// 浜у搧鍒楄〃瑙f瀯
- let arr=[]
- if(this.workType===1){
- params.details.map((item)=>{
- arr.push({
- operationId:item.operationId,
- amount:item.amount,
- productId:item.productId
+ if(this.editConfig.title === "缂栬緫"){
+ let arr=[]
+ if(this.workType===1){
+ params.details.map((item)=>{
+ arr.push({
+ operationId:item.operationId,
+ amount:item.amount,
+ productId:item.productId
+ })
})
- })
- params.details=arr
- }else if(this.workType===2){
- params.details.map((item)=>{
- arr.push({
- operationId:item.operationId,
- amount:item.amount,
- fromLocationId:item.fromLocation.id,
- productId:item.productId,
+ params.details=arr
+ }else if(this.workType===2){
+ params.details.map((item)=>{
+ arr.push({
+ operationId:item.operationId,
+ amount:item.amount,
+ fromLocationId:item.fromLocation.id,
+ productId:item.productId,
+ })
})
- })
- params.details=arr
- }else if(this.workType===3){
- params.details.map((item)=>{
- arr.push({
- operationId:item.operationId,
- amount:item.amount,
- fromLocationId:item.fromLocation.id,
- toLocationId:item.toLocation.id,
- productId:item.productId,
+ params.details=arr
+ }else if(this.workType===3){
+ params.details.map((item)=>{
+ arr.push({
+ operationId:item.operationId,
+ amount:item.amount,
+ fromLocationId:item.fromLocation.id,
+ toLocationId:item.toLocation.id,
+ productId:item.productId,
+ })
})
- })
- params.details=arr
+ params.details=arr
+ }
}
let requestUrl = this.editConfig.title === "鏂板缓" ? addOperation : updateOperation
// let params = this.saveParams()
--
Gitblit v1.8.0