zuozhengqing
2024-01-03 2e99f3e099c8541808312eae125c7af5a498e122
修改出入库明细headerTitle刷新丢失的问题
2个文件已修改
85 ■■■■■ 已修改文件
src/router/index.js 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/overview/AddOverviewDialog.vue 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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`
src/views/overview/AddOverviewDialog.vue
@@ -767,37 +767,39 @@
              })
            }
            // 产品列表解构
            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()