Bladeren bron

问题修改

suxinf 4 jaren geleden
bovenliggende
commit
0d387749f0
2 gewijzigde bestanden met toevoegingen van 25 en 51 verwijderingen
  1. 13 35
      src/views/data/InforList.vue
  2. 12 16
      src/views/data/UploadRecord.vue

+ 13 - 35
src/views/data/InforList.vue

@@ -57,7 +57,6 @@
                 :key="index"
                 :class="{ table_gray: !discolor && index % 2 === 0 }"
               >
-                <!--  <td v-for="(item, i) in obj" :key="i" :style="trStyle"> -->
                 <td>{{ obj.informationName || "-" }}</td>
                 <td>{{ (obj.filePulishTime || "").replace("-", "/") }}</td>
                 <td>{{ obj.accountScope == 1 ? "共通" : "部分" }}</td>
@@ -203,9 +202,6 @@ export default {
     },
     isShowDetail() {
       let flag = this.$route.query && this.$route.query.tag;
-      if (!flag && this.$route.path === '/inforList') {
-        this.getDataListPage();
-      }
       return flag ? true : false;
     },
     showItemOperation: function () {
@@ -235,15 +231,12 @@ export default {
           if (this.downloadSortVal) {
             data.download = this.downloadSortVal === "already" ? true : false;
           }
-          this.newGetDataList(data);
+          this.getDataListPage(data);
         }, 1000)
       }
     }
   },  
   methods: {
-    download: function () {
-      alert("下载");
-    },
     // 获取某一页面的数据,展示在表格
     changePage: function (page) {
       this.currentPage = page;
@@ -263,7 +256,7 @@ export default {
       if (this.downloadSortVal) {
         data.download = this.downloadSortVal === "already" ? true : false;
       }
-      this.newGetDataList(data);
+      this.getDataListPage(data);
     },
     // 点击上一页,下一页,首页,尾页
     jumpPage: function (item) {
@@ -297,7 +290,7 @@ export default {
       if (this.downloadSortVal) {
         data.download = this.downloadSortVal === "already" ? true : false;
       }
-      this.newGetDataList(data);
+      this.getDataListPage(data);
     },
     //下载文件
     downloadPost: function (config) {
@@ -317,30 +310,8 @@ export default {
         },
       });
     },
-    //获取资料列表
-    getDataListPage: function () {
-      this.$http({
-        url: "/firmsUploadListByAgent",
-        method: "post",
-        data: {
-          asc: false,
-          agentId: this.userId,
-          Page: this.currentPage,
-          Rows: this.pageSize,
-        },
-      })
-        .then((res) => {
-          if (res.data.code === 200) {
-            this.tableData = res.data.data;
-            this.sum = res.data.count;
-          }
-        })
-        .catch((err) => {
-          console.log(err);
-        });
-    },
     //条件筛选 获取新的资料列表
-    newGetDataList: function (config) {
+    getDataListPage: function (config) {
       this.$http({
         url: "/firmsUploadListByAgent",
         method: "post",
@@ -416,10 +387,10 @@ export default {
         agentId: this.userId,
       };
       if (!this.searchName) {
-        this.newGetDataList(data);
+        this.getDataListPage(data);
       } else {
         data.informationName = this.searchName;
-        this.newGetDataList(data);
+        this.getDataListPage(data);
       }
     },
     waitToReport: function(obj) {
@@ -449,6 +420,13 @@ export default {
   mounted() {
     this.userId = localStorage.getItem("userId");
     this.getNowDate();
+    const req = {
+            asc: false,
+            agentId: this.userId,
+            Page: this.currentPage,
+            Rows: this.pageSize,
+          };
+    this.getDataListPage(req);
   }
 };
 </script>

+ 12 - 16
src/views/data/UploadRecord.vue

@@ -75,14 +75,6 @@ export default {
     },
     isShowDetail() {
       let flag = this.$route.query && this.$route.query.tag;
-      if (!flag && this.$route.path === "/uploadRecord") {
-        let res = {
-          page: 1,
-          rows: this.pageSize,
-          asc: this.asc,
-        };
-        this.getFirmsUploadList(res);
-      }
       return flag ? true : false;
     },
   },
@@ -102,6 +94,7 @@ export default {
     sort: function () {
       this.asc = this.order === "DESC" ? true : false;
       let data = {
+        informationName: this.inputValue,
         asc: this.asc,
         page: this.currentPage,
         rows: this.pageSize,
@@ -111,6 +104,7 @@ export default {
     changePage: function (page) {
       this.currentPage = page;
       let req = {
+        informationName: this.inputValue,
         page: this.currentPage,
         rows: this.pageSize,
         asc: this.asc,
@@ -134,6 +128,7 @@ export default {
           break;
       }
       let req = {
+        informationName: this.inputValue,
         page: this.currentPage,
         rows: this.pageSize,
         asc: this.asc,
@@ -152,6 +147,7 @@ export default {
       this.deleteInformationInfo(id)
         .then(() => {
           let req = {
+            informationName: this.inputValue,
             page: this.currentPage,
             rows: this.pageSize,
             asc: this.asc,
@@ -224,14 +220,14 @@ export default {
       });
     },
   },
-  // created() {
-  //   let res = {
-  //     page: 1,
-  //     rows: this.pageSize,
-  //     asc: this.asc,
-  //   };
-  //   this.getFirmsUploadList(res);
-  // },
+  created() {
+    let res = {
+      page: 1,
+      rows: this.pageSize,
+      asc: this.asc,
+    };
+    this.getFirmsUploadList(res);
+  },
 };
 </script>