Преглед изворни кода

订单管理/订货业务/订货订单,操作记录新增翻页

qymljy пре 1 месец
родитељ
комит
4f36806653
1 измењених фајлова са 39 додато и 10 уклоњено
  1. 39 10
      src/components/normal-basic-layout/details/modules/datalog/index.vue

+ 39 - 10
src/components/normal-basic-layout/details/modules/datalog/index.vue

@@ -12,6 +12,18 @@
           {{activity.actionby}} - {{activity.action}} - {{activity.remarks}}
         </el-timeline-item>
       </el-timeline>
+      <div v-if="$route.path == '/orderdetail' || $route.path == '/saler_orderDetails' || $route.path == '/agent_orderDetails'"  class="container normal-panel" style="text-align:right">
+        <el-pagination
+            background
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-sizes="[20, 50, 100, 200]"
+            :page-size="100"
+            layout="total,sizes, prev, pager, next, jumper"
+            :total="total">
+        </el-pagination>
+      </div>
     </div>
   </div>
 </template>
@@ -21,23 +33,40 @@ export default {
   props:['ownertable','editData','idname'],
   data () {
     return {
-      list:[]
-    }
-  },
-  methods:{
-    async queryLogData () {
-      const res = await this.$api.requested({
+      list:[],
+      total:0,
+      currentPage:0,
+      param:{
         "id": 20221114125401,
         "content": {
           "pageNumber": 1,
           "pageSize": 100,
-          "ownertable":this.ownertable,
-          "ownerid":this.$route.query.id?this.$route.query.id:this.editData[this.idname]
+          "ownertable":'',
+          "ownerid":''
         }
-      })
-      this.list = res.data
+      }
     }
   },
+  methods:{
+    async queryLogData () {
+      this.param.content.ownertable = this.ownertable
+      this.param.content.ownerid = this.$route.query.id?this.$route.query.id:this.editData[this.idname]
+      const res = await this.$api.requested(this.param)
+      this.list = res.data
+      this.total = res.total
+      this.currentPage = res.pageNumber
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.queryLogData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.queryLogData()
+    },
+  },
   mounted () {
     this.queryLogData()
   }