suxinf 4 éve%!(EXTRA string=óta)
szülő
commit
2de86a05e9

+ 27 - 31
src/views/data/InforList.vue

@@ -94,7 +94,12 @@
                     >已完成</span
                   > -->
                   <span v-if="!obj.endDate || (obj.endDate && obj.download >= 1 && obj.report >= 1)" class="noPoint">已完成</span>
-                  <span v-else @click="waitToReport(obj, index)" :class="{noDownLoad: obj.download == '0'}" class="line">待办</span>
+                  <span 
+                    v-else-if="obj.download >= 1 && obj.report == 0 && (obj.endDate.replace(RegExp('-', 'g'), '') - localDate) >= 0"
+                    @click="waitToReport(obj, index)"
+                    class="canJump"
+                  >待办</span>
+                  <span v-else class="noJump">待办</span>
                 </td>
 
                 <td v-if="operation" :style="trStyle" class="operationStyle">
@@ -209,7 +214,8 @@ export default {
       userId: localStorage.getItem("userId") || '',
       endDate: "",
       localReport: "",
-      downLoadFlag: false // 下载以后刷新页面
+      downLoadFlag: false, // 下载以后刷新页面
+      localDate: ""
     };
   },
   computed: {
@@ -218,7 +224,11 @@ export default {
       return Math.ceil(this.sum / this.pageSize);
     },
     isShowDetail() {
-      return this.$route.query && this.$route.query.tag ? true : false;
+      let flag = this.$route.query && this.$route.query.tag;
+      if (!flag && this.$route.path === '/inforList') {
+        this.getDataListPage();
+      }
+      return flag ? true : false;
     },
     showItemOperation: function () {
       if (!this.localReport) {
@@ -435,6 +445,12 @@ export default {
       }
     },
     waitToReport: function(obj) {
+      this.$router.push({
+        path: "/uploadLink/sonUploadLink",
+        query: { informationName: obj.informationName, informationId: obj.id, editFlag: true},
+      });
+    },
+    getNowDate: function() {
       let data = new Date();
       let year = data.getFullYear();
       let month = data.getMonth() + 1;
@@ -449,31 +465,13 @@ export default {
       } else {
         day = day + "";
       }
-      let endDate = obj.endDate.replace(RegExp("-", "g"), "");
-      let localDate = year + month + day;
-      let dateFlag = (+endDate) - (+localDate)
-      if (obj.report == 0 && obj.download != 0 && dateFlag >= 0) {
-        this.$router.push({
-          path: "/uploadLink/sonUploadLink",
-          query: { informationName: obj.informationName, informationId: obj.id },
-        });
-      }
-    },
+      this.localDate = year + month + day;
+    }
   },
-  // watch: {
-  //   //普通的watch监听
-  //   userId(newValue) {
-  //     if(newValue) {
-  //       this.getDataListPage()
-  //     }
-  //   }
-  // },
   mounted() {
-    setTimeout(() => {
-      this.userId = localStorage.getItem("userId");
-      this.getDataListPage();
-    }, 500);
-  },
+    this.userId = localStorage.getItem("userId");
+    this.getNowDate();
+  }
 };
 </script>
 
@@ -574,14 +572,12 @@ export default {
 .showItemOperationStyle {
   display: none;
 }
-.noDownLoad{
+.noJump{
   color: rgb(173, 162, 162);
   cursor: text!important;
-}
-.line{
   text-decoration: underline;
 }
-.noPoint{
-  cursor: text!important;
+.canJump{
+  text-decoration: underline;
 }
 </style>

+ 7 - 7
src/views/data/UploadLink.vue

@@ -88,11 +88,7 @@
                 > -->
                 <span
                   @click="toggleModal(index)"
-                  v-if="
-                    +(obj.endDate || '').replace(RegExp('-', 'g'), '') -
-                      nowDate >=
-                    0
-                  "
+                  v-if="+(obj.endDate || '').replace(RegExp('-', 'g'), '') - nowDate >= 0"
                   >编辑</span
                 >
                 <span @click="viewHistoryRecord(obj, index)">查看</span>
@@ -317,7 +313,6 @@ export default {
     totalPage() {
       return Math.ceil(this.sum / this.pageSize);
     },
-
     showItemOperation: function () {
       let now = new Date().getTime();
       if (!this.endTime) {
@@ -331,6 +326,10 @@ export default {
         }
       }
     },
+    iscomeFromDetailPage() {
+      let flag = this.$route.query && this.$route.query.tag;
+      return flag ? true : false;
+    },
   },
   methods: {
     getNowDate: function () {
@@ -738,6 +737,7 @@ export default {
           informationName: obj.informationName,
           informationId: obj.informationId,
           i: index,
+          editFlag: +(obj.endDate || '').replace(RegExp('-', 'g'), '') - this.nowDate >= 0
         },
       });
     },
@@ -754,7 +754,7 @@ export default {
       this.userId = "";
     }
     // this.getPlatform();
-    //分页取数据
+    // 分页取数据
     let config = {
       Page: this.currentPage,
       Rows: this.pageSize,

+ 13 - 22
src/views/data/UploadLink/sonUploadLink.vue

@@ -2,7 +2,8 @@
   <div class="upload_Link">
     <div class="upHead">
       <div class="topLeftTitle">针对论坛及其他平台链接上传</div>
-      <button class="addButton" @click="addInfo()">新增反馈</button>
+      <button class="addButton" @click="addInfo()" v-if="editFlag == 'true'">新增反馈</button>
+      <button class="addButton" style="cursor: not-allowed" v-else >新增反馈</button>
     </div>
 
     <div class="tableBox">
@@ -75,13 +76,21 @@
             <td
               class="operationStyle"
               style="cursor: pointer"
-              v-if="+(obj.endDate || '').replace(RegExp('-', 'g'), '') - nowDate >= 0"
+               v-if="editFlag == 'true'"
             >
               <span @click="toggleModal(index)">编辑</span>
               <!-- :class="showItemOperation" -->
               <span @click="toggleModal2(index)">删除</span>
               <!-- :class="showItemOperation" -->
             </td>
+            <td
+              class="operationStyle"
+              style="cursor: not-allowed"
+              v-else
+            >
+              <span>编辑</span>
+              <span>删除</span>
+            </td>
           </tr>
         </tbody>
       </table>
@@ -196,7 +205,7 @@ export default {
       accountId: "",
       informationName: this.$route.query.informationName || "",
       ziliaoId: this.$route.query.informationId || "",
-      nowDate: "", //反馈截止时间
+      editFlag: this.$route.query.editFlag || "",
       php_url: php_url,
       isShowresultModal: false,
       resultModalFlag: true,
@@ -219,23 +228,6 @@ export default {
     },
   },
   methods: {
-    getNowDate: function () {
-      let data = new Date();
-      let year = data.getFullYear();
-      let month = data.getMonth() + 1;
-      let day = data.getDate();
-      if (month < 10) {
-        month = "0" + month;
-      } else {
-        month = month + "";
-      }
-      if (day < 10) {
-        day = "0" + month;
-      } else {
-        day = day + "";
-      }
-      this.nowDate = +(year + month + day);
-    },
     /*toggleModal:点击编辑后弹窗; toggleModal2:点击删除后弹窗; toggleModal3:点击导入后弹窗;  */
     toggleModal: function (i) {
       this.modalData = this.tableData[i];
@@ -405,10 +397,9 @@ export default {
       this.accountId = "";
       this.getDataList();
     }
-    this.getNowDate();
   },
   created() {},
-    beforeRouteEnter(to, from, next) {
+  beforeRouteEnter(to, from, next) {
     console.log(from)
     let meta = to.meta;
     meta[2].name = (to.query.informationName || '') + '详情'

+ 32 - 23
src/views/data/UploadRecord.vue

@@ -4,7 +4,12 @@
       <div class="search">
         <div class="input">
           <img src="../../img/search.png" />
-          <input type="text" @focus="focusInput" v-model="inputValue" placeholder="请输入要搜索的资料名"/>
+          <input
+            type="text"
+            @focus="focusInput"
+            v-model="inputValue"
+            placeholder="请输入要搜索的资料名"
+          />
         </div>
         <div class="current_button" @click="search">搜索</div>
       </div>
@@ -43,7 +48,7 @@ import Count from "../../components/Count";
 import Table from "./components/UploadRecordTable";
 import TablePage from "../../components/TablePage";
 import Detail from "./components/UploadRecordDetail";
-import { env_url } from "../../config/env"
+import { env_url } from "../../config/env";
 export default {
   components: {
     Count,
@@ -69,7 +74,16 @@ export default {
       return Math.ceil(this.sum / this.pageSize);
     },
     isShowDetail() {
-      return this.$route.query && this.$route.query.tag ? true : false;
+      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;
     },
   },
   methods: {
@@ -78,11 +92,11 @@ export default {
     },
     search: function () {
       let data = {
-            informationName: this.inputValue,
-            asc: this.asc,
-            page: this.currentPage,
-            rows: this.pageSize,
-          };
+        informationName: this.inputValue,
+        asc: this.asc,
+        page: this.currentPage,
+        rows: this.pageSize,
+      };
       this.getFirmsUploadList(data);
     },
     sort: function () {
@@ -150,14 +164,14 @@ export default {
     },
     detail: function (i) {
       this.$router.push({
-        path: '/UploadRecord/detail',
+        path: "/UploadRecord/detail",
         query: {
           tag: "detail",
           id: i,
           page: this.currentPage,
           rows: this.pageSize,
           asc: this.asc,
-          informationName: this.tableData[i].informationName
+          informationName: this.tableData[i].informationName,
         },
       });
     },
@@ -210,19 +224,14 @@ export default {
       });
     },
   },
-  created() {
-    let res = {
-      page: 1,
-      rows: this.pageSize,
-      asc: this.asc,
-    };
-    this.getFirmsUploadList(res);
-  },
-  // beforeRouteEnter(to, from, next) {
-  //   console.log(to);
-  //   console.log(from);
-  //   next();
-  // }
+  // created() {
+  //   let res = {
+  //     page: 1,
+  //     rows: this.pageSize,
+  //     asc: this.asc,
+  //   };
+  //   this.getFirmsUploadList(res);
+  // },
 };
 </script>
 

+ 1 - 1
src/views/data/components/UploadRecordDetail.vue

@@ -281,7 +281,7 @@ export default {
       let url = this.onlineUrl + "/dealerDownload?" + reqStr;
       window.open(url);
     },
-  }
+  },
 };
 </script>