Browse Source

Merge branch 'mergeBranch' of http://124.70.211.186:3000/zhangqi/yos_web into mergeBranch

codeMan 2 years ago
parent
commit
36067d299a

+ 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

+ 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) {

+ 7 - 6
src/SDrpManagement/ProductGroup/index.vue

@@ -27,8 +27,8 @@
       </selectPeople>
     </div>
     <selectClass ref="class" @brandChange="brandChange" @onClassChange="onClassChange" @Search="Search" @clearSearch="clearSearch" @clickField="clickField" :default="true"></selectClass>
-    <div v-if="Object.keys(productGroup).length > 0">
-      <div class="group-list content">
+    <div class="content" v-if="Object.keys(productGroup).length > 0">
+      <div class="group-list">
         <div class="group-item" v-for="item in productGroup" :key="item.sa_itemgroupid" @click="itemClick(item)">
           <div class="top">
             <el-image style="width:100%;width: 200px" :src="item.attinfos[0].url" fit="contain" />
@@ -239,18 +239,19 @@ export default {
   overflow-y: scroll;
 }
 .group .group-list {
-  /* display: grid; */
-  /* column-gap: 24px; */
+  /* display: grid;
+  column-gap: 24px;
   box-sizing: border-box;
   background-color: transparent;
-  /* grid-template-columns: repeat(8, 1fr); */
+  grid-template-columns: repeat(5, 1fr); */
   padding-top:36px;
   display: flex;
   flex-wrap: wrap;
+  align-items: flex-start;
 }
 .group .group-list .group-item {
   width: 261px;
-  /* max-width: 357px; */
+  max-width: 357px;
   background: #ffffff;
   transition: all 0.1s ease-in;
   cursor: pointer;

+ 3 - 2
src/SDrpManagement/Products/modules/list.vue

@@ -20,8 +20,8 @@
           </div>
         </el-col>
       </el-row> -->
-      <div v-if="list.length > 0">
-        <div class="group-list content">
+      <div v-if="list.length > 0" class="content">
+        <div class="group-list">
 <!--          <div  @click="$router.push({path:'/ProductDetails',query:{id:item.itemid,brandid:params.content.brandids[0]}})" class="group-item" v-for="item in list" :key="item.index">-->
           <div  class="group-item" v-for="item in list" :key="item.index">
             <div class="top">
@@ -155,6 +155,7 @@ export default {
   /* grid-template-columns: repeat(8, 1fr); */
   display: flex;
   flex-wrap: wrap;
+  align-items: flex-start;
 }
 .group .group-list .group-item {
   width: 261px;

+ 1 - 1
src/SDrpManagement/agentOrder/details/index.vue

@@ -227,7 +227,7 @@ export default {
     },
     // 监听切换数据,上一页,下一页
     pageChange (id,rowindex,tabIndex) {
-      this.$router.replace({path:'/orderdetail',query:{id:id,rowindex:rowindex}})
+      this.$router.replace({path:'/agent_orderDetails',query:{id:id,rowindex:rowindex}})
       this.queryMainData(id)
     },
     // 提交审核订单

+ 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) {

+ 1 - 1
src/SDrpManagement/salerOrder/details/index.vue

@@ -287,7 +287,7 @@ export default {
     },
     // 监听切换数据,上一页,下一页
     pageChange (id,rowindex,tabIndex) {
-      this.$router.replace({path:'/orderdetail',query:{id:id,rowindex:rowindex}})
+      this.$router.replace({path:'/saler_orderDetails',query:{id:id,rowindex:rowindex}})
       this.queryMainData(id)
     },
     // 提交审核订单

+ 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) {

+ 93 - 46
src/components/normal-basic-layout/details/index.vue

@@ -19,11 +19,10 @@
             <slot name="customOperation"></slot>
           </div>
           <el-button v-if="tool.checkAuth($route.name,'delete') && delApiId" :type="checkDisabled()?'':'primary'" class="inline-16" size="mini" :disabled="checkDisabled()" @click="deleteData">删 除</el-button>
-         
-<!--          <div v-if="!pageChange">
+         <div>
             <el-button size="mini" icon="el-icon-arrow-left" @click="previous()"></el-button>
             <el-button size="mini" @click="next()"><i class="el-icon-arrow-right"></i></el-button>
-          </div>-->
+          </div>
         </div>
       </div>
       <div>
@@ -104,7 +103,6 @@ export default {
       refreshPage:true,
       reportCenterLsit:[],
       systemappid:JSON.parse(sessionStorage.getItem('activeApp')).systemappid,
-      idx:0
     }
   },
   computed:{
@@ -149,17 +147,21 @@ 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) {
+      console.log('执行')
+      this.rowStatus = null
+      const res = await this.$api.requested(param)
+      this.$store.dispatch('saveListData',{listData:res.data,param:param,pageTotal:res.pageTotal})
+      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,33 @@ 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
+        console.log(this.svlistData.listData)
+        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 +343,7 @@ export default {
   watch:{
     mainAreaData () {
       // console.log(this.mainAData,'mainAData')
+      // this.checkPaginationData()
     }
   }
 }

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

@@ -162,7 +162,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():''
   },