liuYb 4 vuotta sitten
vanhempi
commit
7f4bcebaa5

+ 32 - 18
src/components/Modal.vue

@@ -148,7 +148,7 @@ export default {
     },
     fileName: {
       type: String,
-      default: '',
+      default: "",
     },
   },
   data() {
@@ -188,6 +188,7 @@ export default {
 
       releaseChannel: [],
       releasePlate: [],
+      userId: '',
     };
   },
   methods: {
@@ -210,21 +211,22 @@ export default {
       });
       console.log("chexi ", obj);
       //carTypeId  表示车系 id
-     // this.carTypeId = obj.id;
+      // this.carTypeId = obj.id;
 
       //当前月份
       let date = new Date();
       let m = date.getMonth() + 1;
       let y = date.getFullYear();
       let d = y + "/" + m;
-
+console.log(this.ziliaoId)
       let config = {
         url: "",
         data: {
           id: "", //主键值
           month: d,
-          dealerId: "254",
-          dataId: "1386025423408103425",
+          dealerId: this.userId,
+          dataId: this.ziliaoId,
+          //dataId: "1386025423408103425",
           informationName: this.ziliaoName,
           releaseTime: this.ziliaoTime,
           carService: this.carS,
@@ -257,7 +259,7 @@ export default {
       } else {
         //新增
         config.url = "/dealerFeedback";
-        console.log('新增',222)
+        console.log("新增", 222);
       }
 
       this.$emit("update", config);
@@ -299,7 +301,7 @@ export default {
         data: {},
       })
         .then((res) => {
-          console.log(res, 2222222222222222)
+          console.log(res, 2222222222222222);
           if (res.data.code === 200) {
             this.carType = res.data.data;
             this.chooseCarType();
@@ -417,9 +419,12 @@ export default {
     },
 
     initialData: function () {
-      console.log(this.fileName,this.$route.query.informationName)
+      console.log(this.fileName, this.$route.query.informationName);
       this.ziliaoName = this.fileName;
-      this.ziliaoId = this.LinkData.informationId;
+      if(this.LinkData.informationId) this.ziliaoId = this.LinkData.informationId;
+      else{
+        this.ziliaoId =  this.$route.query.informationId;
+      }
 
       this.mediaTitle = this.LinkData.mediaTitle;
       this.mediaUrl = this.LinkData.mediaUrl;
@@ -427,14 +432,14 @@ export default {
 
       this.carT = this.LinkData.carPlatformName;
       let time = this.LinkData.publishDate; //发布时间
-      if(time != null){
+      if (time != null) {
         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;
-      }
+          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;
+        }
       }
 
       //publishPlatformName 发布渠道
@@ -485,7 +490,7 @@ this.readCount&&this.goodCount&&  this.bbsCount&& this.lookingCount */
             obj = this.releaseChannel.find(function (item) {
               return item.platformName === val;
             });
-            console.log(this.releaseC, obj)
+            console.log(this.releaseC, obj);
             //传当前渠道 id,  获取发布版块列表
             this.chooseReleasePlate(obj.id);
           }
@@ -516,12 +521,21 @@ this.readCount&&this.goodCount&&  this.bbsCount&& this.lookingCount */
     },
   },
   mounted() {
+    let localUserId = localStorage.getItem("userId");
+    if (localUserId) {
+      console.log("经销商ID", localUserId);
+      this.userId = localUserId;
+    } else {
+      console.log("经销商ID '-");
+      this.userId = "";
+    }
+
     this.chooseDataName();
     this.chooseCarSeries();
     this.firstContent1Classify();
     this.firstContent2Classify();
 
-this.chooseChannel();
+    this.chooseChannel();
 
     this.initialData();
   },

+ 1 - 1
src/views/data/InforList.vue

@@ -516,7 +516,7 @@ export default {
       if (obj.report == 0 && obj.download != 0 && dateFlag >= 0) {
         this.$router.push({
           path: "/uploadLink/sonUploadLink",
-          query: { informationName: obj.informationName, id: obj.id },
+          query: { informationName: obj.informationName, informationId: obj.id },
         });
       }
     },

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

@@ -556,7 +556,7 @@ export default {
           if (res.data.code === 200) {
             this.platform = res.data.data;
             this.platformVal = this.platform[0].platformName;
-            this.choosePlatform();
+           // this.choosePlatform();
           }
         })
         .catch((err) => {

+ 47 - 8
src/views/data/UploadLink/sonUploadLink.vue

@@ -177,7 +177,7 @@ export default {
       file: "",
       dictList: [],
       onlineUrl: env_url, //'http://8.140.188.129:8080'线上 //http://8.136.230.133:8080 //测试
-      accountId: 2002,
+      accountId: '',
       informationName: this.$route.query.informationName || "",
       ziliaoId: this.$route.query.id || "",
     };
@@ -230,7 +230,8 @@ export default {
         .then((res) => {
           console.log(res);
           //更新数据
-          this.choosePlatform();
+          //this.choosePlatform();
+          this.newGetDataList();
         })
         .catch((err) => {
           console.log(err);
@@ -242,7 +243,7 @@ export default {
       this.showModal2 = !this.showModal2;
       //更新数据
 
-      this.choosePlatform();
+      //this.choosePlatform();
     },
     /* 表格翻页 */
     changePage: function (page) {
@@ -268,22 +269,19 @@ export default {
       console.log(this.currentPage);
     },
     //获取资料列表
-    getDataList: function (config) {
+    getDataList: function () {
       // let date = new Date();
       // let m = date.getMonth() + 1;
       // let y = date.getFullYear();
       // let d = y + "/" + m;
-      console.log(config);
       this.$http({
         url: "/firmsLinkUpload",
         method: "post",
         data: {
           accountId: this.accountId,
-          // month: d,
-          // publishPlatformId: config,
           informationId: this.$route.query.informationId,
           page: this.currentPage,
-          rows: this.pageSize
+          rows: this.pageSize,
         },
       })
         .then((res) => {
@@ -317,6 +315,47 @@ export default {
           console.log(err);
         });
     },
+    newGetDataList: function () {
+      this.$http({
+        url: "/firmsLinkUpload",
+        method: "post",
+        data: {
+          accountId: this.accountId,
+          informationId: this.$route.query.informationId,
+          page: this.currentPage,
+          rows: this.pageSize
+        },
+      })
+        .then((res) => {
+          console.log(res);
+          if (res.data.code === 200) {
+            let data = res.data.data;
+            console.log(data, 333333333333333);
+            this.sum = res.data.count;
+            for (let i = 0, j = 0; j < data.length; i++, j++) {
+              this.$set(this.tableData, i, data[j]);
+            }
+            //修改素材时间显示格式
+            let len = this.tableData.length;
+            for (let i = 0; i < len; i++) {
+              let newValue = "";
+              let temp = this.tableData[i].publishDate;
+              if (this.tableData[i].publishDate.length >= 10) {
+                newValue =
+                  temp.slice(0, 4) +
+                  "/" +
+                  temp.slice(5, 7) +
+                  "/" +
+                  temp.slice(8, 10);
+                this.$set(this.tableData[i], "publishDate", newValue);
+              }
+            }
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    },
     //新增反馈
     addInfo: function () {
       this.showModalAdd = !this.showModalAdd;