suxinf 5 роки тому
батько
коміт
5700addc2f

+ 1 - 1
src/App.vue

@@ -38,7 +38,7 @@ export default {
     return {
       navTitle1: ' > 数据管理',
       navTitle2: '',
-      isManufacturer: 'distributor', // distributor 经销商 manufacturer 厂商
+      isManufacturer: 'manufacturer', // distributor 经销商 manufacturer 厂商
       userAccount: ''
     }
   },

+ 46 - 43
src/views/parameter/CarSeries.vue

@@ -11,17 +11,17 @@
           @edit="edit"
           @delet_data="deleteData"
           @car_type="carType"
-          :pageSize="sum"
+          :pageSize="pageSize"
         ></Table>
       </div>
-      <!-- <div class="page">
+      <div class="page">
         <Tablepage
           :totalPage="totalPage"
           :currentPage="currentPage"
           @change_page="changePage"
           @jump_page="jumpPage"
         ></Tablepage>
-      </div> -->
+      </div>
       <div class="modal" v-if="modalFlag">
         <Modal
           :modalFlag="modalFlag"
@@ -38,7 +38,7 @@
 
 <script>
 import Count from "../../components/Count";
-// import Tablepage from "../../components/TablePage";
+import Tablepage from "../../components/TablePage";
 import Table from "./components/Carseries/CarSeriesTable";
 import Modal from "./components/Carseries/CarSeriesModal";
 import CarType from "./components/Carseries/CarType";
@@ -46,25 +46,24 @@ export default {
   components: {
     Count,
     Table,
-    // Tablepage,
+    Tablepage,
     Modal,
     CarType,
   },
   data() {
     return {
       sum: 0, // 一共有多少条数据
-      // pageSize: 20, // 每页展示的数据
-      // currentPage: 1,
-      // 表格配置
+      pageSize: 20, // 每页展示的数据
+      currentPage: 1,
       tableData: [],
       modalFlag: false, // 控制模态框展示
     };
   },
   computed: {
     // 表格总页数
-    // totalPage() {
-    //   return Math.ceil(this.sum / this.pageSize);
-    // },
+    totalPage() {
+      return Math.ceil(this.sum / this.pageSize);
+    },
     // 获取路由参数
     queryTag() {
       return this.$route.query && this.$route.query.tag ? 0 : 1;
@@ -72,28 +71,28 @@ export default {
   },
   methods: {
     // 获取某一页面的数据,展示在表格
-    // changePage: function (page) {
-    //   this.currentPage = page;
-    //   console.log(page);
-    // },
+    changePage: function (page) {
+      this.currentPage = page;
+      this.getDateList(this.currentPage, this.pageSize);
+    },
     // 点击上一页,下一页,首页,尾页
-    // jumpPage: function (item) {
-    //   switch (item) {
-    //     case 1:
-    //       this.currentPage = 1;
-    //       break;
-    //     case 2:
-    //       this.currentPage = this.currentPage - 1;
-    //       break;
-    //     case 3:
-    //       this.currentPage = this.currentPage + 1;
-    //       break;
-    //     case 4:
-    //       this.currentPage = this.totalPage;
-    //       break;
-    //   }
-    //   console.log(this.currentPage);
-    // },
+    jumpPage: function (item) {
+      switch (item) {
+        case 1:
+          this.currentPage = 1;
+          break;
+        case 2:
+          this.currentPage = this.currentPage - 1;
+          break;
+        case 3:
+          this.currentPage = this.currentPage + 1;
+          break;
+        case 4:
+          this.currentPage = this.totalPage;
+          break;
+      }
+      this.getDateList(this.currentPage, this.pageSize);
+    },
     // 展示、隐藏模态框
     showModal: function () {
       this.modalFlag = !this.modalFlag;
@@ -101,35 +100,36 @@ export default {
     // 模态框保存
     submit: function (car) {
       this.addCarSeries(car).then(() => {
-        this.getDateList();
+        this.currentPage = Math.ceil((this.sum + 1) / this.pageSize);
+        this.getDateList(this.currentPage, this.pageSize);
       });
       this.modalFlag = false;
     },
     // 点击编辑
     edit(index, newName) {
       let id = this.tableData[index]["id"];
-      console.log(id, newName);
       let req = {
         id,
         typeName: newName,
       };
       this.updataCarTypeInfo(req).then(() => {
-        this.getDateList();
+        this.getDateList(this.currentPage, this.pageSize);
       });
     },
     // 点击删除
     deleteData: function (index) {
       let id = this.tableData[index]["id"];
-      console.log(id);
       this.deleteCarTypeInfo(id).then(() => {
-        this.getDateList();
+        this.currentPage = Math.ceil((this.sum - 1) / this.pageSize);
+        this.getDateList(this.currentPage, this.pageSize);
       });
-      console.log("删除", index);
     },
     // 点击系列车型
     carType: function (index) {
       // 页面变化
-      this.$router.push({ query: { tag: "vehicle_type", id: this.tableData[index]['id'] } });
+      this.$router.push({
+        query: { tag: "vehicle_type", id: this.tableData[index]["id"] },
+      });
     },
     // 新增车系  接口
     addCarSeries: function (typeName) {
@@ -154,11 +154,14 @@ export default {
       });
     },
     // 获取列表数据  接口
-    getDateList: function () {
+    getDateList: function (page, rows) {
       this.$http({
         method: "post",
         url: "/base/carTypeManager/selectCarTypePage",
-        data: {},
+        data: {
+          page,
+          rows,
+        },
       })
         .then((res) => {
           if (res.data && res.data.code === 200) {
@@ -203,7 +206,7 @@ export default {
           method: "post",
           data: {
             id,
-            parentId:id
+            parentId: id,
           },
         })
           .then((res) => {
@@ -223,7 +226,7 @@ export default {
   },
   mounted() {},
   created() {
-    this.getDateList();
+    this.getDateList(this.currentPage, this.pageSize);
   },
 };
 </script>

+ 12 - 8
src/views/parameter/ContentCategory1.vue

@@ -65,7 +65,7 @@ export default {
     // 获取某一页面的数据,展示在表格
     changePage: function (page) {
       this.currentPage = page;
-      console.log(page);
+      this.getDateList(this.currentPage, this.pageSize);
     },
     // 点击上一页,下一页,首页,尾页
     jumpPage: function (item) {
@@ -83,7 +83,7 @@ export default {
           this.currentPage = this.totalPage;
           break;
       }
-      console.log(this.currentPage);
+      this.getDateList(this.currentPage, this.pageSize);
     },
     // 展示、隐藏模态框
     showModal: function () {
@@ -92,19 +92,21 @@ export default {
     // 点击编辑
     edit(index, newName) {
       this.updataDict(newName, index).then(() => {
-        this.getDateList();
+        this.getDateList(this.currentPage, this.pageSize);
       });
     },
     // 点击删除
     deleteData(index) {
       this.deleteDict(index).then(() => {
-        this.getDateList();
+        this.currentPage = Math.ceil((this.sum - 1) / this.pageSize);
+        this.getDateList(this.currentPage, this.pageSize);
       });
     },
     // 新增车型模态框 保存
     submit: function (name) {
       this.addList(name).then(() => {
-        this.getDateList();
+        this.currentPage = Math.ceil((this.sum + 1) / this.pageSize);
+        this.getDateList(this.currentPage, this.pageSize);
       });
       this.modalFlag = false;
     },
@@ -132,17 +134,20 @@ export default {
       });
     },
     // 获取列表数据   接口
-    getDateList: function () {
+    getDateList: function (page, rows) {
       this.$http({
         method: "post",
         url: "/sys/dataDict/selectSysDataDictPage",
         data: {
           dictCode: this.dictList[1]["dictCode"],
           parentId: this.dictList[1]["id"],
+          page,
+          rows
         },
       })
         .then((res) => {
           if (res.data && res.data.code === 200) {
+            console.log(res.data.data);
             this.tableData = res.data.data;
             this.sum = res.data.count;
           } else {
@@ -239,8 +244,7 @@ export default {
   created() {
     this.selectSysDataDictList()
       .then(() => {
-        this.getDateList();
-        console.log(this.dictList);
+        this.getDateList(this.currentPage, this.pageSize);
       })
       .catch((err) => {
         console.log(err);

+ 12 - 8
src/views/parameter/ContentCategory2.vue

@@ -52,7 +52,7 @@ export default {
       currentPage: 1,
       tableData: [],
       modalFlag: false, // 控制模态框展示
-      dictList: []
+      dictList: [],
     };
   },
   computed: {
@@ -70,7 +70,7 @@ export default {
     // 获取某一页面的数据,展示在表格
     changePage: function (page) {
       this.currentPage = page;
-      console.log(page);
+      this.getDateList(this.currentPage, this.pageSize);
     },
     // 点击上一页,下一页,首页,尾页
     jumpPage: function (item) {
@@ -88,7 +88,7 @@ export default {
           this.currentPage = this.totalPage;
           break;
       }
-      console.log(this.currentPage);
+      this.getDateList(this.currentPage, this.pageSize);
     },
     // 展示、隐藏模态框
     showModal: function () {
@@ -97,19 +97,21 @@ export default {
     // 点击编辑
     edit(index, newName) {
       this.updataDict(newName, index).then(() => {
-        this.getDateList();
+        this.getDateList(this.currentPage, this.pageSize);
       });
     },
     // 点击删除
     deleteData(index) {
       this.deleteDict(index).then(() => {
-        this.getDateList();
+        this.currentPage = Math.ceil((this.sum - 1) / this.pageSize);
+        this.getDateList(this.currentPage, this.pageSize);
       });
     },
     // 新增分类模态框 保存
     submit: function (name) {
       this.addList(name).then(() => {
-        this.getDateList();
+        this.currentPage = Math.ceil((this.sum + 1) / this.pageSize);
+        this.getDateList(this.currentPage, this.pageSize);
       });
       this.modalFlag = false;
     },
@@ -137,13 +139,15 @@ export default {
       });
     },
     // 获取列表数据   接口
-    getDateList: function () {
+    getDateList: function (page, rows) {
       this.$http({
         method: "post",
         url: "/sys/dataDict/selectSysDataDictPage",
         data: {
           dictCode: this.dictList[2]["dictCode"],
           parentId: this.dictList[2]["id"],
+          page,
+          rows,
         },
       })
         .then((res) => {
@@ -245,7 +249,7 @@ export default {
   created() {
     this.selectSysDataDictList()
       .then(() => {
-        this.getDateList();
+        this.getDateList(1, this.pageSize);
         console.log(this.dictList);
       })
       .catch((err) => {

+ 2 - 3
src/views/parameter/Grouping.vue

@@ -101,14 +101,13 @@ export default {
     // 模态框保存,
     submit: function (groupName) {
       this.addGroupInfo(groupName).then(() => {
-        this.currentPage = this.totalPage;
+        this.currentPage = Math.ceil((this.sum + 1) / this.pageSize);
         this.selectGroupList(this.currentPage, this.pageSize);
       });
       this.modalFlag = false;
     },
     // 点击编辑
     edit(index, newName) {
-      console.log(index, newName);
       let id = this.tableData[index]["id"];
       this.updateGroupInfo(id, newName).then(() => {
         this.selectGroupList(this.currentPage, this.pageSize);
@@ -116,9 +115,9 @@ export default {
     },
     // 点击删除
     deleteData: function (index) {
-      console.log("删除", index);
       let id = this.tableData[index]["id"];
       this.deleteGroupInfo(id).then(() => {
+        this.currentPage = Math.ceil((this.sum - 1) / this.pageSize);
         this.selectGroupList(this.currentPage, this.pageSize);
       });
     },

+ 3 - 3
src/views/parameter/LinkUpload.vue

@@ -141,6 +141,7 @@ export default {
         publishPlatformId: this.plateFormId,
       };
       this.deleteMediaPublishInfo(res).then(() => {
+        this.currentPage = Math.ceil((this.sum - 1) / this.pageSize);
         let dataObj = {
           publishPlatformId: this.plateFormId,
           page: this.currentPage,
@@ -152,9 +153,8 @@ export default {
     // 模态框保存
     submit: function (time, num, obj) {
       let addTime = time.replace("-", "/");
-      this.addMediaPublishInfo(+num, addTime, obj.platformName, obj.id).then(
-        () => {
-          this.currentPage = this.totalPage;
+      this.addMediaPublishInfo(+num, addTime, obj.platformName, obj.id).then( () => {
+          this.currentPage = Math.ceil((this.sum + 1) / this.pageSize);
           let req = {
             publishPlatformId: this.plateFormId,
             page: this.currentPage,

+ 12 - 10
src/views/parameter/MediaPlatform.vue

@@ -47,7 +47,7 @@ export default {
   },
   data() {
     return {
-      sum: 100, // 一共有多少条数据
+      sum: 0, // 一共有多少条数据
       pageSize: 20, // 每页展示的数据
       currentPage: 1,
       tableData: [{ title: "微信公众号", str: "123", deletFlag: true }],
@@ -70,7 +70,7 @@ export default {
     // 获取某一页面的数据,展示在表格
     changePage: function (page) {
       this.currentPage = page;
-      console.log(page);
+      this.getDateList(this.currentPage, this.pageSize);
     },
     // 点击上一页,下一页,首页,尾页
     jumpPage: function (item) {
@@ -88,7 +88,7 @@ export default {
           this.currentPage = this.totalPage;
           break;
       }
-      console.log(this.currentPage);
+      this.getDateList(this.currentPage, this.pageSize);
     },
 
     // 展示、隐藏模态框
@@ -98,21 +98,22 @@ export default {
     // 点击编辑
     edit(index, newName) {
       this.updataDict(newName, index).then(() => {
-        this.getDateList();
+        this.getDateList(this.currentPage, this.pageSize);
       });
     },
     // 点击删除
     deleteData(index) {
       this.deleteDict(index).then(() => {
-        this.getDateList();
+        this.currentPage = Math.ceil((this.sum - 1) / this.pageSize);
+        this.getDateList(this.currentPage, this.pageSize);
         alert("删除成功");
       });
     },
     // 新增车型模态框 保存
     submit: function (name) {
-      console.log("保存", name);
       this.addList(name).then(() => {
-        this.getDateList();
+        this.currentPage = Math.ceil((this.sum + 1) / this.pageSize);
+        this.getDateList(this.currentPage, this.pageSize);
       });
       this.modalFlag = false;
     },
@@ -140,13 +141,15 @@ export default {
       });
     },
     // 获取列表数据   接口
-    getDateList: function () {
+    getDateList: function (page, rows) {
       this.$http({
         method: "post",
         url: "/sys/dataDict/selectSysDataDictPage",
         data: {
           dictCode: this.dictList[3]["dictCode"],
           parentId: this.dictList[3]["id"],
+          page,
+          rows,
         },
       })
         .then((res) => {
@@ -248,8 +251,7 @@ export default {
   mounted() {
     this.selectSysDataDictList()
       .then(() => {
-        this.getDateList();
-        console.log(this.dictList);
+        this.getDateList(1, this.pageSize);
       })
       .catch((err) => {
         console.log(err);

+ 2 - 0
src/views/parameter/PlatformModule.vue

@@ -101,6 +101,7 @@ export default {
     // 模态框保存
     submit: function (plateName) {
       this.addPublishPlatformInfo(plateName).then(() => {
+        this.currentPage = Math.ceil((this.sum + 1) / this.pageSize);
         this.selectPublishPlatformPage(this.currentPage, this.pageSize);
       });
       this.modalFlag = false;
@@ -117,6 +118,7 @@ export default {
     deleteData: function (index) {
       let id = this.tableData[index]["id"];
       this.deletePublishPlatformInfo(id).then(() => {
+        this.currentPage = Math.ceil((this.sum - 1) / this.pageSize);
         this.selectPublishPlatformPage(this.currentPage, this.pageSize);
       });
     },

+ 1 - 1
src/views/parameter/components/Carseries/CarSeriesTable.vue

@@ -104,7 +104,7 @@ export default {
     closeModal: function () {
       this.deleteModalFlag = false;
     },
-    // 生成点击编辑按钮所用flag,
+    // 生成点击编辑按钮所用flag,
     getEditArr: function () {
       let arr = new Array(this.pageSize).fill(false);
       this.editFlag = arr;

+ 2 - 0
src/views/parameter/components/Carseries/CarType.vue

@@ -105,12 +105,14 @@ export default {
     deleteData(index) {
       let id = this.tableData[index]["id"];
       this.deleteCarTypeInfo(id).then(() => {
+        this.currentPage = Math.ceil((this.sum - 1) / this.pageSize);
         this.getData(this.currentPage, this.pageSize);
       });
     },
     // 新增车型模态框 保存
     submit: function (car) {
       this.addCarSeries(car).then(() => {
+        this.currentPage = Math.ceil((this.sum + 1) / this.pageSize);
         this.getData(this.currentPage, this.pageSize);
         this.modalFlag = false;
       });

+ 2 - 9
src/views/parameter/components/Grouping/GroupMember.vue

@@ -8,7 +8,6 @@
       <div class="table">
         <Table
           :tableData="tableData"
-          @edit="edit"
           @delet_data="deleteData"
           :pageSize="sum"
         ></Table>
@@ -89,21 +88,16 @@ export default {
     showModal: function () {
       this.modalFlag = !this.modalFlag;
     },
-    // 点击编辑
-    edit(index, newName) {
-      console.log(index, newName);
-    },
     // 点击删除
     deleteData(index) {
       let req = {
         id: this.tableData[index]["id"],
         groupId: this.groupId,
       };
-      console.log(req);
       this.deleteAgentInfo(req).then(() => {
+        this.currentPage = Math.ceil((this.sum - 1) / this.pageSize);
         this.selectAgentInfoPage(this.groupId, this.currentPage, this.pageSize);
       });
-      console.log("删除", index);
     },
     // 新增车型模态框 保存
     submit: function (list) {
@@ -112,9 +106,8 @@ export default {
         groupId: this.groupId,
         agentId: strReq,
       };
-      console.log(req, "入参");
       this.groupAddDlr(req).then(() => {
-        this.currentPage = this.totalPage;
+        this.currentPage = Math.ceil((this.sum + 1) / this.pageSize);
         this.selectAgentInfoPage(this.groupId, this.currentPage, this.pageSize);
       });
       ///sys/agentGroup/bindAgentGroup 调用这个接口来新增小组成员

+ 2 - 2
src/views/parameter/components/PlatformModule/DetailPage.vue

@@ -116,9 +116,9 @@ export default {
     },
     // 点击删除
     deleteData(index) {
-      console.log("删除", index);
       let parentId = this.parentId;
       let id = this.tableData[index]["id"];
+      this.currentPage = Math.ceil((this.sum - 1) / this.pageSize);
       this.deletePublishPlatformInfo(parentId, id).then(() => {
         this.selectPublishPlatformPage(
           this.parentId,
@@ -130,7 +130,7 @@ export default {
     // 新增板块模态框 保存
     submit: function (platetName) {
       let parentId = this.parentId;
-      this.currentPage = this.totalPage;
+      this.currentPage = Math.ceil((this.sum + 1) / this.pageSize);
       this.addPublishPlatformInfo(parentId, platetName).then(() => {
         this.selectPublishPlatformPage(
           this.parentId,