liuYb 4 年之前
父節點
當前提交
8a803a4f9a

+ 16 - 13
src/components/Modal.vue

@@ -189,7 +189,7 @@ export default {
       obj = this.carSeries.find(function (item) {
         return item.typeName === nameCarS;
       });
-      console.log("chexi ", obj)
+      console.log("chexi ", obj);
       //carTypeId  表示车系 id
       this.carTypeId = obj.id;
       //获取车型名 this.carT
@@ -261,7 +261,7 @@ export default {
     },
     chooseCarType: function () {
       //获取车系 id
-      let obj={};
+      let obj = {};
       let nameCarS = this.carS;
       obj = this.carSeries.find(function (item) {
         return item.typeName === nameCarS;
@@ -363,23 +363,26 @@ export default {
     },
 
     initialData: function () {
-       this.ziliaoId = this.LinkData.informationId;
-       
+      this.ziliaoId = this.LinkData.informationId;
+
       this.mediaTitle = this.LinkData.mediaTitle;
       this.mediaUrl = this.LinkData.mediaUrl;
       this.carS = this.LinkData.carTypeName;
-      
+
       this.carT = this.LinkData.carPlatformName;
       let time = this.LinkData.publishDate;
-      let m = time.slice(time.length-2,time.length);
-      let y = time.slice(0,4);
-      let temp=y + "-" + m + "-" + "01";
-      this.ziliaoTime = temp;
-      console.log("console.log(this.forceUpdate);", typeof time, m ,y);
+      if (time.length > 4) {
+        let y = time.slice(0, 4);
+        let m = time.slice(5, 7);
+        let d = time.slice(8, 10);
+        let temp = y + "-" + m + "-" + d;
+        this.ziliaoTime = temp;
+      }
+      //console.log("console.log(this.forceUpdate);", typeof time, m, y);
 
       //缺少对应列表值 已有资料名在数据中无法查询到
       this.releaseP = this.LinkData.publishSourceName;
-      
+
       this.contentName1 = this.LinkData.contentTypeName;
       this.contentName2 = this.LinkData.contentTypeName;
     },
@@ -397,7 +400,7 @@ export default {
 
     this.initialData();
   },
-/*   created() {
+  /*   created() {
     console.log(this.LinkData);
     this.ziliaoId = this.LinkData.id;
     console.log(this.ziliaoId);
@@ -477,7 +480,7 @@ div {
 }
 .btn-confirm {
   color: #fff;
-  background-color: #2d8cf0;
+  background-color: #0056a0;
 }
 .bodyRow {
   display: flex;

+ 17 - 5
src/views/data/InforList.vue

@@ -200,7 +200,8 @@ export default {
         height: "30px",
         overflow: "hidden",
       },
-      onlineUrl:'http://8.136.230.133:8080'
+      onlineUrl: "http://8.136.230.133:8080",
+      userId: 254,
     };
   },
   computed: {
@@ -241,14 +242,17 @@ export default {
           break;
       }
       console.log(this.currentPage);
-      this.getDataListPage(this.currentPage)
+      this.getDataListPage(this.currentPage);
     },
     //下载文件
     downloadPost: function (config) {
       console.log("下载文件:", config);
-      let url = this.onlineUrl+"/dealerDownload?informationId="+config.data.informationId 
-      window.open(url)
-    /*   return new Promise((resolve, reject) => {
+      let url =
+        this.onlineUrl +
+        "/dealerDownload?informationId=" +
+        config.data.informationId;
+      window.open(url);
+      /*   return new Promise((resolve, reject) => {
         this.$http({
           url: config.url,
           method: "get",
@@ -389,6 +393,14 @@ export default {
     },
   },
   mounted() {
+    let localUserId = localStorage.getItem("userId");
+    if (localUserId) {
+      console.log("经销商ID",localUserId);
+      this.userId = localUserId;
+    } else {
+      console.log("经销商ID 254");
+      this.userId = 254;
+    }
     this.getDataList();
   },
 };

+ 22 - 33
src/views/data/UploadLink.vue

@@ -263,6 +263,7 @@ export default {
         endTime: null,
         id: "",
         informationId: "",
+        informationName: "",
         localArea: "",
         mediaTitle: null,
         mediaTypeName: "",
@@ -276,6 +277,7 @@ export default {
       },
       file: "",
       dictList: [],
+      onlineUrl: "http://8.136.230.133:8080",
     };
   },
   computed: {
@@ -331,12 +333,12 @@ export default {
       })
         .then((res) => {
           console.log(res);
+          //更新数据
+          this.choosePlatform();
         })
         .catch((err) => {
           console.log(err);
         });
-        //更新数据
-        this.choosePlatform();
     },
 
     toDel: function (n) {
@@ -353,6 +355,7 @@ export default {
         });
       } */
       this.showModal2 = !this.showModal2;
+      //更新数据
       this.choosePlatform();
     },
     /* 表格翻页 */
@@ -404,7 +407,8 @@ export default {
               i < this.tableData.length && j < data.length;
               i++, j++
             ) {
-              this.tableData.splice(i, 1, data[j]);
+              //this.tableData.splice(i, 1, data[j]);
+              this.$set(this.tableData, i, data[j]);
             }
             console.log(data.length, this.tableData.length);
             console.log(this.tableData);
@@ -438,7 +442,10 @@ export default {
     }, */
     //导出excel
     onOutputExcel: function () {
-      this.$http({
+      let url = this.onlineUrl + "/exportNoFactory";
+      console.log("导出excel:", url);
+      window.open(url);
+      /*   this.$http({
         url: "/exportNoFactory",
         method: "get",
         params: {
@@ -453,7 +460,7 @@ export default {
         })
         .catch((err) => {
           console.log(err);
-        });
+        }); */
     },
     //导入excel
     /*   onImportExcel: function () {
@@ -530,12 +537,13 @@ export default {
       obj = this.platform.find(function (item) {
         return item.platformName === val;
       });
-      this.selectedPlatform = val;
+      this.selectedPlatform = obj.platformName;
       this.selectedPlatformId = obj.id;
+
       //获取可发布数量
       this.getReleaseQuantity(obj.id);
 
-      //发布平台ID
+      //更新列表数据
       this.getDataList(obj.id);
 
       //获取发布版块
@@ -555,7 +563,7 @@ export default {
           publishPlatformId: val,
           publishMonth: d,
           //id: val,
-          // month: d,
+          //month: d,
         },
       })
         .then((res) => {
@@ -600,8 +608,11 @@ export default {
     },
     //导入模板
     importTemplate: function () {
-      this.$http({
-        //url: "/exportNoFactory",
+      let str = "反馈链接上传导入表模板(经销商).xlsx";
+      let url = this.onlineUrl + "/downloadTemplate?templateName=" + str;
+      console.log("下载导入模板:", url);
+      window.open(url);
+      /*   this.$http({
         url: "/downloadTemplate",
         method: "get",
         params: {
@@ -616,29 +627,7 @@ export default {
         })
         .catch((err) => {
           console.log(err);
-        });
-      /*    return new Promise((resolve, reject) => {
-        this.$http({
-          url: "/exportNoFactory",
-          method: "get",
-          params: "反馈链接上传导入表模板(经销商).xlsx"
-        })
-          .then((res) => {
-            console.log(res);
-            resolve(res);
-            let link = document.createElement("a");
-            link.href = window.URL.createObjectURL(new Blob([res.data]));
-            link.target = "_blank";
-            //文件名和格式
-            link.download = "文件模板.xlsx";
-            document.body.appendChild(link);
-            link.click();
-            document.body.removeChild(link);
-          })
-          .catch((err) => {
-            reject(err);
-          });
-      }); */
+        }); */
     },
     //导入
     /*   importFile: function () {

+ 2 - 1
src/views/data/components/UploadLinkModalDelete.vue

@@ -44,7 +44,7 @@ export default {
     },
     sonDataDel: function () {
       this.itemIndex = this.chooseItemIndex;
-      this.$emit("dataDel", this.itemIndex);
+      
 
       this.$http({
         url: "/deleteAccountReportRecordInfo",
@@ -55,6 +55,7 @@ export default {
       })
         .then((res) => {
           console.log("已删除", res);
+          this.$emit("dataDel", this.itemIndex);
         })
         .catch((err) => {
           console.log(err);