Browse Source

优化序号

zhengjinyi 5 years ago
parent
commit
86849ed60a

+ 3 - 1
src/views/club/list.vue

@@ -56,7 +56,7 @@
     >
     >
       <el-table-column align="center" label="序号" width="50">
       <el-table-column align="center" label="序号" width="50">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          {{ scope.$index+1 }}
+          {{ ((pageNum-1)*listQuery.pageSize)+scope.$index+1 }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="账号" width="150" align="center" prop="account" />
       <el-table-column label="账号" width="150" align="center" prop="account" />
@@ -127,6 +127,7 @@ export default {
   components: { Pagination },
   components: { Pagination },
   data() {
   data() {
     return {
     return {
+      pageNum: 0,
       list: null,
       list: null,
       listLoading: true,
       listLoading: true,
       total: 0,
       total: 0,
@@ -190,6 +191,7 @@ export default {
         this.list = data.results
         this.list = data.results
         this.listLoading = false
         this.listLoading = false
         this.total = data.totalRecord
         this.total = data.totalRecord
+        this.pageNum = data.index
       }).catch(() => {
       }).catch(() => {
         // 封装静态数据
         // 封装静态数据
       })
       })

+ 3 - 4
src/views/club/operateList.vue

@@ -52,7 +52,7 @@
     >
     >
       <el-table-column align="center" label="序号" width="50">
       <el-table-column align="center" label="序号" width="50">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          {{ scope.$index+1 }}
+          {{ ((pageNum-1)*listQuery.pageSize)+scope.$index+1 }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="账号" width="130" align="center" prop="account" />
       <el-table-column label="账号" width="130" align="center" prop="account" />
@@ -154,6 +154,7 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
+      pageNum: 0,
       list: null,
       list: null,
       clubTitle: this.$route.query.name,
       clubTitle: this.$route.query.name,
       listLoading: true,
       listLoading: true,
@@ -218,14 +219,12 @@ export default {
       this.listLoading = true
       this.listLoading = true
       getOperatorList(this.listQuery).then(response => {
       getOperatorList(this.listQuery).then(response => {
         const operatorListPage = response.data
         const operatorListPage = response.data
+        this.pageNum = operatorListPage.index
         this.list = operatorListPage.results
         this.list = operatorListPage.results
         this.total = operatorListPage.totalRecord
         this.total = operatorListPage.totalRecord
         this.listLoading = false
         this.listLoading = false
       })
       })
     },
     },
-    handleCurrentChange(val) {
-      console.log(val)
-    },
     handleGenerateCode(row) {
     handleGenerateCode(row) {
       this.dialogVisible = true
       this.dialogVisible = true
       if (row.invitationCode) {
       if (row.invitationCode) {

+ 5 - 3
src/views/goods/list-commonly.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div class="app-container" style="padding: 0 20px;padding-bottom: 0;">
+  <div class="app-container" style="padding: 0 20px;padding-bottom: 20px;">
 
 
     <el-menu :router="true" default-active="/goods/list/commonly" class="el-menu-demo" mode="horizontal">
     <el-menu :router="true" default-active="/goods/list/commonly" class="el-menu-demo" mode="horizontal">
       <el-menu-item index="/goods/list">全部商品</el-menu-item>
       <el-menu-item index="/goods/list">全部商品</el-menu-item>
@@ -55,7 +55,7 @@
     >
     >
       <el-table-column align="center" label="序号" width="50px">
       <el-table-column align="center" label="序号" width="50px">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          {{ scope.$index+1 }}
+          {{ ((pageNum-1)*listQuery.pageSize)+scope.$index+1 }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="商品ID" align="center" prop="id" width="70px" />
       <el-table-column label="商品ID" align="center" prop="id" width="70px" />
@@ -104,7 +104,8 @@ export default {
   components: { Pagination },
   components: { Pagination },
   data() {
   data() {
     return {
     return {
-      modulesId: '3', // 模块3
+      modulesId: '3', // 模块
+      pageNum: 0,
       list: null,
       list: null,
       classify: null,
       classify: null,
       modules: null,
       modules: null,
@@ -143,6 +144,7 @@ export default {
         const { organizeProductsPage, listByEffective } = response.data
         const { organizeProductsPage, listByEffective } = response.data
         this.list = organizeProductsPage.results
         this.list = organizeProductsPage.results
         this.total = organizeProductsPage.totalRecord
         this.total = organizeProductsPage.totalRecord
+        this.pageNum = organizeProductsPage.index
         this.classify = listByEffective
         this.classify = listByEffective
         this.listLoading = false
         this.listLoading = false
       })
       })

+ 4 - 2
src/views/goods/list-preferential.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div class="app-container" style="padding: 0 20px;">
+  <div class="app-container" style="padding: 0 20px;padding-bottom: 20px;">
 
 
     <el-menu :router="true" default-active="/goods/list/preferential" class="el-menu-demo" mode="horizontal">
     <el-menu :router="true" default-active="/goods/list/preferential" class="el-menu-demo" mode="horizontal">
       <el-menu-item index="/goods/list">全部商品</el-menu-item>
       <el-menu-item index="/goods/list">全部商品</el-menu-item>
@@ -55,7 +55,7 @@
     >
     >
       <el-table-column align="center" label="序号" width="50px">
       <el-table-column align="center" label="序号" width="50px">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          {{ scope.$index+1 }}
+          {{ ((pageNum-1)*listQuery.pageSize)+scope.$index+1 }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="商品ID" align="center" prop="id" width="70px" />
       <el-table-column label="商品ID" align="center" prop="id" width="70px" />
@@ -105,6 +105,7 @@ export default {
   data() {
   data() {
     return {
     return {
       modulesId: '2', // 模块2
       modulesId: '2', // 模块2
+      pageNum: 0,
       list: null,
       list: null,
       classify: null,
       classify: null,
       modules: null,
       modules: null,
@@ -143,6 +144,7 @@ export default {
         const { organizeProductsPage, listByEffective } = response.data
         const { organizeProductsPage, listByEffective } = response.data
         this.list = organizeProductsPage.results
         this.list = organizeProductsPage.results
         this.total = organizeProductsPage.totalRecord
         this.total = organizeProductsPage.totalRecord
+        this.pageNum = organizeProductsPage.index
         this.classify = listByEffective
         this.classify = listByEffective
         this.listLoading = false
         this.listLoading = false
       })
       })

+ 4 - 2
src/views/goods/list-preferred.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div class="app-container" style="padding: 0 20px;">
+  <div class="app-container" style="padding: 0 20px;padding-bottom: 20px;">
 
 
     <el-menu :router="true" default-active="/goods/list/preferred" class="el-menu-demo" mode="horizontal">
     <el-menu :router="true" default-active="/goods/list/preferred" class="el-menu-demo" mode="horizontal">
       <el-menu-item index="/goods/list">全部商品</el-menu-item>
       <el-menu-item index="/goods/list">全部商品</el-menu-item>
@@ -55,7 +55,7 @@
     >
     >
       <el-table-column align="center" label="序号" width="50px">
       <el-table-column align="center" label="序号" width="50px">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          {{ scope.$index+1 }}
+          {{ ((pageNum-1)*listQuery.pageSize)+scope.$index+1 }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="商品ID" align="center" prop="id" width="70px" />
       <el-table-column label="商品ID" align="center" prop="id" width="70px" />
@@ -105,6 +105,7 @@ export default {
   data() {
   data() {
     return {
     return {
       modulesId: '1', // 模块1
       modulesId: '1', // 模块1
+      pageNum: 0,
       list: null,
       list: null,
       classify: null,
       classify: null,
       modules: null,
       modules: null,
@@ -143,6 +144,7 @@ export default {
         const { organizeProductsPage, listByEffective } = response.data
         const { organizeProductsPage, listByEffective } = response.data
         this.list = organizeProductsPage.results
         this.list = organizeProductsPage.results
         this.total = organizeProductsPage.totalRecord
         this.total = organizeProductsPage.totalRecord
+        this.pageNum = organizeProductsPage.index
         this.classify = listByEffective
         this.classify = listByEffective
         this.listLoading = false
         this.listLoading = false
       })
       })

+ 3 - 1
src/views/goods/list.vue

@@ -74,7 +74,7 @@
     >
     >
       <el-table-column align="center" label="序号" width="35">
       <el-table-column align="center" label="序号" width="35">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          <span style="white-space:nowrap">{{ scope.$index+1 }}</span>
+          <span style="white-space:nowrap">{{ ((pageNum-1)*listQuery.pageSize)+scope.$index+1 }}</span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="商品ID" align="center" prop="id" width="50" />
       <el-table-column label="商品ID" align="center" prop="id" width="50" />
@@ -183,6 +183,7 @@ export default {
   },
   },
   data: function() {
   data: function() {
     return {
     return {
+      pageNum: 0,
       activeIndex: '0',
       activeIndex: '0',
       list: null,
       list: null,
       modules: null,
       modules: null,
@@ -243,6 +244,7 @@ export default {
       this.listLoading = true
       this.listLoading = true
       getList(this.listQuery).then(response => {
       getList(this.listQuery).then(response => {
         const { organizeProductsPage, listByEffective } = response.data
         const { organizeProductsPage, listByEffective } = response.data
+        this.pageNum = organizeProductsPage.index
         this.list = organizeProductsPage.results
         this.list = organizeProductsPage.results
         this.total = organizeProductsPage.totalRecord
         this.total = organizeProductsPage.totalRecord
         this.classify = listByEffective
         this.classify = listByEffective

+ 3 - 1
src/views/order/list.vue

@@ -98,7 +98,7 @@
     >
     >
       <el-table-column align="center" label="序号" width="50">
       <el-table-column align="center" label="序号" width="50">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          {{ scope.$index+1 }}
+          {{ ((pageNum-1)*listQuery.pageSize)+scope.$index+1 }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="订单ID" align="center" prop="orderID" />
       <el-table-column label="订单ID" align="center" prop="orderID" />
@@ -198,6 +198,7 @@ export default {
   components: { Pagination, Remarks },
   components: { Pagination, Remarks },
   data() {
   data() {
     return {
     return {
+      pageNum: 0,
       list: null,
       list: null,
       listLoading: true,
       listLoading: true,
       total: 0,
       total: 0,
@@ -253,6 +254,7 @@ export default {
       getList(this.listQuery).then(response => {
       getList(this.listQuery).then(response => {
         this.list = response.data.results
         this.list = response.data.results
         this.total = response.data.totalRecord
         this.total = response.data.totalRecord
+        this.pageNum = response.data.index
         this.listLoading = false
         this.listLoading = false
       }).catch(() => {
       }).catch(() => {
         this.listLoading = false
         this.listLoading = false

+ 3 - 1
src/views/order/refund.vue

@@ -59,7 +59,7 @@
     >
     >
       <el-table-column align="center" label="序号" width="50">
       <el-table-column align="center" label="序号" width="50">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          {{ scope.$index+1 }}
+          {{ ((pageNum-1)*listQuery.pageSize)+scope.$index+1 }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
       <el-table-column label="退款编号" align="center" prop="returnedNo" />
       <el-table-column label="退款编号" align="center" prop="returnedNo" />
@@ -124,6 +124,7 @@ export default {
   data() {
   data() {
     return {
     return {
       list: null,
       list: null,
+      pageNum: 0,
       listLoading: true,
       listLoading: true,
       total: 0,
       total: 0,
       searchTimeVal: '',
       searchTimeVal: '',
@@ -155,6 +156,7 @@ export default {
       getRefundList(this.listQuery).then(response => {
       getRefundList(this.listQuery).then(response => {
         this.list = response.data.results
         this.list = response.data.results
         this.total = response.data.totalRecord
         this.total = response.data.totalRecord
+        this.pageNum = response.data.index
         this.listLoading = false
         this.listLoading = false
       }).catch(() => {
       }).catch(() => {
         this.listLoading = false
         this.listLoading = false