suxinf 4 gadi atpakaļ
vecāks
revīzija
a8d4d66a1d

+ 1 - 1
src/App.vue

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

+ 21 - 63
src/views/data/components/UploadRecordDetail.vue

@@ -105,7 +105,8 @@ export default {
       filesList: [],
       index: (this.$route.query && this.$route.query.id) || "",
       detailData: {},
-      areaList: []
+      areaList: [],
+      onlineUrl:'http://8.136.230.133:8080'
     };
   },
   computed: {
@@ -157,22 +158,20 @@ export default {
     },
     // 下载附件
     downloadFile: function (i) {
-      console.log(i);
-      let dataObj = {
-        fileId: this.filesList[i]["id"],
-        informationId: this.filesList[i]["informationId"],
-        //agentId: this.filesList[i]['agentId'] 如果是厂商下载不传agentId
-      };
-      console.log(dataObj);
-      this.dealerDownload(dataObj);
+      // let dataObj = {
+      //   fileId: this.filesList[i]["id"],
+      //   informationId: this.filesList[i]["informationId"],
+      //   //agentId: this.filesList[i]['agentId'] 如果是厂商下载不传agentId
+      // };
+      let reqStr = 'informationId=' + this.filesList[i]["informationId"] + "&" + 'fileId=' + this.filesList[i]["id"];
+      this.dealerDownload(reqStr);
     },
-    // 导出文件
+    // 导出 下载记录文件
     downloadExcel: function () {
-      let id = this.detailData["id"];
-      let data = {
-        informationId: id,
-      };
-      this.exportTem(data);
+      console.log(this.detailData);
+      let reqStr = 'informationId=' + this.detailData["id"];
+      // console.log(reqStr);
+      this.exportTem(reqStr);
     },
     // 上传记录列表接口 获取对应详情
     getFirmsUploadList: function (data = {}) {
@@ -214,30 +213,9 @@ export default {
         });
     },
     // 导出   接口
-    exportTem: function (data) {
-      return new Promise((resolve, reject) => {
-        this.$http({
-          url: "/export",
-          method: "post",
-          data: data,
-          // responseType: "blob",
-        })
-          .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);
-          });
-      });
+    exportTem: function (reqStr) {
+      let url = this.onlineUrl+"/export?" + reqStr;
+      window.open(url)
     },
     // 分页获取所有进销商信息接口
     getDlrData: function (dataObj = {}) {
@@ -278,30 +256,10 @@ export default {
         });
     },
     // 文件下载接口
-    dealerDownload: function (data) {
-      this.$http({
-        method: "post",
-        url: "/dealerDownload",
-        data: data,
-      })
-        .then((res) => {
-          if (res.data.code === 200) {
-            let link = document.createElement("a");
-            link.href = window.URL.createObjectURL(new Blob([res.data]));
-            link.target = "_blank";
-            //文件名和格式
-            link.download = "文件模板.zip";
-            document.body.appendChild(link);
-            link.click();
-            document.body.removeChild(link);
-          } else {
-            console.log(res);
-          }
-        })
-        .catch((err) => {
-          console.log(err);
-        });
-    },
+    dealerDownload: function (reqStr) {
+      let url = this.onlineUrl+"/dealerDownload?" + reqStr;
+      window.open(url)
+    }
   },
 };
 </script>

+ 46 - 32
src/views/parameter/LinkUpload.vue

@@ -24,13 +24,13 @@
           :pageSize="sum"
         ></Table>
       </div>
-      <div class="page" v-if="sum !==0">
+      <div class="page" v-if="sum !== 0">
         <Tablepage
           :totalPage="totalPage"
           :currentPage="currentPage"
           @change_page="changePage"
           @jump_page="jumpPage"
-          :sum='sum'
+          :sum="sum"
         ></Tablepage>
         <Count :sum="sum"></Count>
       </div>
@@ -69,6 +69,7 @@ export default {
       optionList: [],
       selectedForm: "",
       selectedplateForm: {},
+      plateFormId: "", // 平台的id
     };
   },
   computed: {
@@ -112,32 +113,47 @@ export default {
     },
     // 点击编辑
     edit(index, newCount) {
-      let id = this.tableData[index]['id'];
-      let publishPlatformId = this.optionList[index]['id'];
-      this.updateGroupInfo(id, newCount, publishPlatformId).then(() => {
-        this.selectMediaPublishList();
-      })
+      let id = this.tableData[index]["id"];
+      this.updateGroupInfo(id, newCount, this.plateFormId).then(() => {
+        let res = {
+          publishPlatformId: this.plateFormId,
+        };
+        this.selectMediaPublishList(res);
+      });
     },
     // 点击删除
     deleteData(index) {
-      let id = this.tableData[index]['id'];
-      let publishPlatformId = this.optionList[index]['id'];
-      this.deleteGroupInfo(id, publishPlatformId).then(() => {
-        this.selectMediaPublishList();
-      })
+      let id = this.tableData[index]["id"];
+      let res = {
+        id,
+        publishPlatformId: this.plateFormId,
+      };
+      this.deleteMediaPublishInfo(res).then(() => {
+        let dataObj = {
+          publishPlatformId: this.plateFormId,
+        };
+        this.selectMediaPublishList(dataObj);
+      });
     },
     // 模态框保存
     submit: function (time, num, obj) {
       let addTime = time.replace("-", "/");
-      this.addMediaPublishInfo(+num, addTime, obj.platformName, obj.id);
+      this.addMediaPublishInfo(+num, addTime, obj.platformName, obj.id).then(
+        () => {
+          let req = {
+            publishPlatformId: this.plateFormId,
+          };
+          this.selectMediaPublishList(req);
+        }
+      );
       this.modalFlag = false;
     },
-    // slectPlatForm
+    // 选择上传平台
     slectPlatForm: function (e) {
       let index = e.target.options.selectedIndex;
       this.selectedplateForm = this.optionList[index];
-      let id = this.optionList[index]['id'];
-      let req = { id };
+      this.plateFormId = this.optionList[index]["id"];
+      let req = { publishPlatformId: this.plateFormId };
       this.selectMediaPublishList(req);
     },
     // 新增 接口
@@ -204,7 +220,7 @@ export default {
           data: {
             id,
             publishCount,
-            publishPlatformId
+            publishPlatformId,
           },
         })
           .then((res) => {
@@ -224,15 +240,12 @@ export default {
       });
     },
     // 删除 接口
-    deleteGroupInfo: function (id, publishPlatformId) {
+    deleteMediaPublishInfo: function (data) {
       return new Promise((resolve, reject) => {
         this.$http({
           method: "post",
-          url: "/sys/group/deleteGroupInfo",
-          data: {
-            id,
-            publishPlatformId
-          },
+          url: "/base/mediaPublishManager/deleteMediaPublishInfo",
+          data,
         })
           .then((res) => {
             if (res.data && res.data.code === 200) {
@@ -277,16 +290,17 @@ export default {
       });
     },
   },
-  mounted() {
-  },
+  mounted() {},
   created() {
-    this.selectPublishPlatformPage().then(() => {
-      let publishPlatformId = this.optionList[0]['id'];
-      let req = { publishPlatformId };
-      this.selectMediaPublishList(req);
-    }).catch((err) =>{
-      console.log(err)
-    })
+    this.selectPublishPlatformPage()
+      .then(() => {
+        let publishPlatformId = this.optionList[0]["id"];
+        let req = { publishPlatformId };
+        this.selectMediaPublishList(req);
+      })
+      .catch((err) => {
+        console.log(err);
+      });
   },
 };
 </script>