zhangqiOMG 2 年之前
父节点
当前提交
dc2da1f697

+ 1 - 1
src/HDrpManagement/aftersalesBill/components/selectAgent.vue

@@ -84,7 +84,7 @@ export default {
       this.tableData = res.data
       this.total = res.total
       this.currentPage = res.pageNumber
-      console.log(this.tableData);
+      // console.log(this.tableData);
       
     },
     handleSizeChange(val) {

+ 1 - 1
src/HDrpManagement/orderManage/details/tabs/productlist.vue

@@ -596,7 +596,7 @@ export default {
       this.columnTitle.push(columnChild)
 
     })
-    console.log(this.columnTitle)
+    // console.log(this.columnTitle)
   },
 }
 

+ 1 - 1
src/HDrpManagement/orderManage/index.vue

@@ -149,7 +149,7 @@ export default {
   },
   methods:{
     list (data) {
-      console.log(data);
+      // console.log(data);
     },
     change () {
       this.$refs.basicLayout.param.content.pageNumber = 1

+ 3 - 3
src/HDrpManagement/orderManage/modules/edit.vue

@@ -444,9 +444,9 @@ export default {
       })
       this.tool.showMessage(res,()=>{
         this.$emit('onSuccess')
-        if (this.data.type === '标准订单' ||  this.data.type === '特殊订单') {
-          this.isusedrebate === 1?this.useRebate(this.data.rebateamount):""
-        }
+        // if (this.data.type === '标准订单' ||  this.data.type === '特殊订单') {
+        //   this.isusedrebate === 1?this.useRebate(this.data.rebateamount):""
+        // }
         
         this.drawer = false
       })

+ 1 - 1
src/HDrpManagement/serveBill/components/selectAgent.vue

@@ -85,7 +85,7 @@ export default {
       this.tableData = res.data
       this.total = res.total
       this.currentPage = res.pageNumber
-      console.log(this.tableData);
+      // console.log(this.tableData);
       
     },
     handleSizeChange(val) {

+ 3 - 3
src/SDrpManagement/agentOrder/modules/edit.vue

@@ -395,9 +395,9 @@ export default {
       })
       this.tool.showMessage(res,()=>{
         this.$emit('onSuccess')
-        if (this.data.type === '标准订单' ||  this.data.type === '特殊订单') {
-          this.isusedrebate === 1?this.useRebate(this.data.rebateamount):""
-        }
+        // if (this.data.type === '标准订单' ||  this.data.type === '特殊订单') {
+        //   this.isusedrebate === 1?this.useRebate(this.data.rebateamount):""
+        // }
       })
     },
     onEditSuccess () {

+ 1 - 1
src/SDrpManagement/agentOrder/modules/productlist.vue

@@ -447,7 +447,7 @@ export default {
       this.columnTitle.push(columnChild)
 
     })
-    console.log(this.columnTitle)
+    // console.log(this.columnTitle)
   },
   watch:{
     value2 (val) {

+ 3 - 3
src/SDrpManagement/salerOrder/modules/edit.vue

@@ -399,9 +399,9 @@ export default {
       })
       this.tool.showMessage(res,()=>{
         this.$emit('onSuccess')
-        if (this.data.type === '标准订单' ||  this.data.type === '特殊订单') {
-          this.isusedrebate === 1?this.useRebate(this.data.rebateamount):""
-        }
+        // if (this.data.type === '标准订单' ||  this.data.type === '特殊订单') {
+        //   this.isusedrebate === 1?this.useRebate(this.data.rebateamount):""
+        // }
       })
     },
     onEditSuccess () {

+ 1 - 1
src/SDrpManagement/salerOrder/modules/productlist.vue

@@ -481,7 +481,7 @@ export default {
       this.columnTitle.push(columnChild)
 
     })
-    console.log(this.columnTitle)
+    // console.log(this.columnTitle)
   },
   watch:{
     value2 (val) {

+ 88 - 43
src/components/normal-basic-layout/details/index.vue

@@ -104,7 +104,6 @@ export default {
       refreshPage:true,
       reportCenterLsit:[],
       systemappid:JSON.parse(sessionStorage.getItem('activeApp')).systemappid,
-      idx:0
     }
   },
   computed:{
@@ -149,17 +148,20 @@ export default {
     reportCenter
   },
   methods:{
-    async queryData (pageNumber) {
-      /* 暴露请求配置 进行修改 */
-      this.$emit('updateParam',this.param)
-      
-      this.param.id = this.turnPageId
-      this.param.content.pageNumber = pageNumber
-      const res = await this.$api.requested(this.param)
-      this.total = res.total
-      // this.$emit('pageChange',res.data[0][this.idname],res.data[0].rowindex)
-      this.$refs['tag']?this.$refs['tag'].queryTag():''
-      this.refresh()
+    // async queryData (pageNumber) {
+    //   this.$emit('updateParam',this.param)
+    //   this.param.id = this.turnPageId
+    //   this.param.content.pageNumber = pageNumber
+    //   const res = await this.$api.requested(this.param)
+    //   this.total = res.total
+    //   this.$refs['tag']?this.$refs['tag'].queryTag():''
+    //   this.refresh()
+    // },
+    async nextData(param,fn) {
+      this.rowStatus = null
+      const res = await this.$api.requested(param)
+      this.$store.dispatch('saveListData',{listData:res.data,param:param})
+      fn?fn():''
     },
     /* 获取是否有报表数据 */
     async getSystemAppid () {
@@ -185,40 +187,61 @@ export default {
         window.open(this.tool.getBaseUrl() + res.data + `&${this.idname}=${data}`)  
       })
     },
-    next () {
-      let nowId = this.$route.query.id
-      let changeId = ''
-      console.log( this.svlistData.listData)
-      if ((this.idx + 1) == this.svlistData.listData.length) return this.$message({
-        message:"已经是当前页最后一条了!",
-        type:'warning'
-      })
-      this.svlistData.listData.forEach((e,index)=>{
-        if (e[this.idname] == nowId) {
-          changeId = this.svlistData.listData[index + 1][this.idname]
-          this.idx = index + 1
+    async next () {
+      const rs = await this.checkPaginationData()
+      if (rs == 0 && this.svlistData.listData.length == 1) return false
+      if (rs == 1 && this.svlistData.param.content.pageNumber == this.svlistData.pageTotal) return false
+      let fun = (rs) =>{
+        let nowId = this.$route.query.id
+        let changeId = ''
+        if (rs == 1) {
+          changeId = this.svlistData.listData[0][this.idname]
+        } else {
+          this.svlistData.listData.forEach((e,index)=>{
+            if (e[this.idname] == nowId) {
+              changeId = this.svlistData.listData[index + 1][this.idname]
+            }
+          })
         }
-      })
-      
-      this.$emit('pageChange',changeId,this.idx)
-      this.refresh()
+        this.$emit('pageChange',changeId,this.idx)
+        this.refresh()
+      }
+      if (rs == 1) {
+        this.svlistData.param.content.pageNumber ++
+        this.nextData(this.svlistData.param,(rs)=>{
+          fun(1)
+        })
+      } else {
+        fun()
+      }
     },
-    previous () {
-      let nowId = this.$route.query.id
-      let changeId = ''
-      if ((this.idx - 1) < 0) return this.$message({
-        message:"当前是第一条",
-        type:'warning'
-      })
-      this.svlistData.listData.forEach((e,index)=>{
-        if (e[this.idname] == nowId) {
-          changeId = this.svlistData.listData[index - 1][this.idname]
-          this.idx = index - 1
+    async previous () {
+      const res = await this.checkPaginationData()
+      if (res == 0 && this.svlistData.param.content.pageNumber == 1) return false
+      const fun = (rs)=>{
+        let nowId = this.$route.query.id
+        let changeId = ''
+       
+        if (rs == 0) {
+          changeId = this.svlistData.listData[this.svlistData.listData.length - 1][this.idname]
+        } else {
+          this.svlistData.listData.forEach((e,index)=>{
+            if (e[this.idname] == nowId) {
+              changeId = this.svlistData.listData[index - 1][this.idname]
+            }
+          })
         }
-      })
-      
-      this.$emit('pageChange',changeId,this.idx)
-      this.refresh()
+        this.$emit('pageChange',changeId,this.idx)
+        this.refresh()
+      }
+      if (res == 0) {
+        this.svlistData.param.content.pageNumber --
+        this.nextData(this.svlistData.param,()=>{
+          fun(0)
+        })
+      } else {
+        fun()
+      }
     },
     onSuccess () {
       this.$emit('onEditSuccess')
@@ -283,10 +306,31 @@ export default {
     },
     closeTags() {
       this.$refs.tag?this.$refs.tag.closeTag():''
+    },
+
+    checkPaginationData () {
+      return new Promise((reslove,reject)=>{
+        let id = this.$route.query.id
+        let n = 0
+        this.svlistData.listData.filter((e,index)=>{
+          if (e[this.idname] == id){
+            n = index
+          }
+        })
+        if (n == 0) {
+          reslove(0)
+        } else if (n == this.svlistData.listData.length - 1) {
+          reslove(1)
+        } else {
+          reslove(-1)
+        }
+      })
     }
   },
   mounted () {
+    // this.checkPaginationData()
     this.idx = this.$route.query.rowindex
+    
   },
   created () {
     this.$emit('detailCreate',this.param)
@@ -297,6 +341,7 @@ export default {
   watch:{
     mainAreaData () {
       // console.log(this.mainAData,'mainAData')
+      // this.checkPaginationData()
     }
   }
 }

+ 1 - 1
src/components/normal-basic-layout/index.vue

@@ -161,7 +161,7 @@ export default {
       this.$emit('listData',this.list)
 
       // 保存一下列表数据用于翻页
-      this.$store.dispatch('saveListData',{listData:this.list,param:this.param})
+      this.$store.dispatch('saveListData',{listData:this.list,param:this.param,pageTotal:res.pageTotal})
     },
     selectChange () {
       this.param.content.pageNumber = 1

+ 1 - 1
src/template/selectAgent/index.vue

@@ -94,7 +94,7 @@ export default {
       this.tableData = res.data
       this.total = res.total
       this.currentPage = res.pageNumber
-      console.log(this.tableData);
+      // console.log(this.tableData);
       
     },
     valueChange (data) {

+ 1 - 1
src/template/selectSaler/index.vue

@@ -104,7 +104,7 @@ export default {
       this.tableData = res.data
       this.total = res.total
       this.currentPage = res.pageNumber
-      console.log(this.tableData);
+      // console.log(this.tableData);
       
     },
     valueChange (data) {

+ 6 - 3
src/utils/tool.js

@@ -24,7 +24,7 @@ export default {
         method:"saveWebClientErrLog",
         content:{
           "keyname":'auth',
-          "log":error
+          "log":JSON.stringify(error)
         }
       })
     }
@@ -55,12 +55,15 @@ export default {
     if (res.code === 0)  return Message({
       message: res.msg,
       type: 'error',
-      
+      duration:3000,
+      showClose:true
     });
 
     Message({
       message: '操作成功',
-      type: 'success'
+      type: 'success',
+      duration:3000,
+      showClose:true
     });
     success?success():''
   },