suxinf пре 4 година
родитељ
комит
acabb8c438

+ 13 - 1
src/views/data/UploadInfor.vue

@@ -236,6 +236,11 @@ export default {
     addByArea: function () {
       console.log(this.checkedBoxList);
       console.log(JSON.parse(JSON.stringify(this.checkedBoxList)));
+      let dataObj = {
+        localArea: ['东区', '南区']
+      };
+      this.getDlrData(dataObj);
+      this.getAllDlr(dataObj);
     },
     // 自定义添加
     addBySelf: function () {
@@ -273,6 +278,7 @@ export default {
     // 关闭提示框
     closeTipModal: function() {
       this.tipModalFlag = false;
+      this.$router.go(0);
     },
     // 获取某一页面的数据,展示在表格
     changePage: function (page) {
@@ -345,8 +351,11 @@ export default {
       paramData.append("dataDesc", this.inforDes);
       paramData.append("sourceTime", this.materialTime);
       paramData.append("dealerScope", this.scope);
-      if (this.scope !== 1) {
+      console.log(this.scope, 111)
+      if (this.scope === '0') {
          paramData.append("dealerList", this.AllDlr);
+         console.log(1111)
+         console.log(this.AllDlr, 11111);
       }
       console.log(paramData.getAll("dataName"));
       this.$http
@@ -354,6 +363,7 @@ export default {
         .then((res) => {
           if (res.data && res.data.code === 200) {
             this.tipModalFlag = true;
+            this.tipModalText = '上传成功!';
           } else {
             alert("上传失败,请重试");
             console.log(res);
@@ -393,6 +403,7 @@ export default {
       })
         .then((res) => {
           if (res.data && res.data.code === 200) {
+            console.log(res, 'allres');
             this.dlrList = [];
             this.AllDlr = res.data.data;
             let resData = JSON.parse(JSON.stringify(res.data.data));
@@ -419,6 +430,7 @@ export default {
       })
         .then((res) => {
           if (res.data && res.data.code === 200) {
+            console.log(res, 'pageres');
             this.tableData = res.data.data;
             this.sum = res.data.count;
           } else {

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

@@ -139,7 +139,7 @@ export default {
         data: data,
       })
         .then((res) => {
-          console.log(res);
+          console.log(res, '厂商链接上传');
         })
         .catch((err) => {
           console.log(err);

+ 8 - 5
src/views/data/UploadRecord.vue

@@ -119,8 +119,11 @@ export default {
     },
     download: function (i) {
       let id = this.tableData[i].id;
-      console.log(id);
-      this.selectInformationAgentList(id);
+      let dataObj = {
+        agentId: id
+        // informationName:
+      }
+      this.selectInformationAgentList(dataObj);
     },
     delet: function (i) {
       let id = this.tableData[i].id;
@@ -154,13 +157,13 @@ export default {
         });
     },
     // 下载资料接口
-    selectInformationAgentList: function (dataId) {
+    selectInformationAgentList: function (data) {
       return new Promise((resolve, reject) => {
         this.$http({
           url: '/selectInformationAgentList',
           method: "post",
-          data: {id: dataId},
-          responseType: 'blob'
+          data: data,
+          // responseType: 'blob'
         })
           .then((res) => {
             console.log(res);

+ 42 - 27
src/views/data/components/UploadRecordDetail.vue

@@ -39,11 +39,11 @@
           <p style="width: 65px">附件:</p>
           <div class="filesName">
             <p
-              v-for="(item, index) in detailData.files"
+              v-for="(item, index) in filesList"
               :key="index"
               @click="downloadFile(index)"
             >
-              {{ item.name }}
+              {{ item.fileName }}
             </p>
           </div>
         </div>
@@ -115,6 +115,7 @@ export default {
       pageSize: 20,
       tableData: [],
       optionValue: "",
+      filesList: []
     };
   },
   computed: {
@@ -167,37 +168,31 @@ export default {
     },
     // 下载附件
     downloadFile: function (i) {
-      this.selectInformationFileList(i);
+      console.log(i);
+      let dataObj = {
+        fileId: this.filesList[i]['id'],
+        informationId: this.detailData['id'],
+        agentId: this.filesList[i]['informationId']
+      }
+      console.log(dataObj);
+      this.dealerDownload(dataObj);
     },
     // 导出文件
     downloadExcel: function () {
       let id = this.detailData["id"];
-      this.exportTem(id);
+      let data = {
+        informationId: id
+      }
+      this.exportTem(data);
     },
-    // 下载文件接口
-    // selectInformationFileList: function (id) {
-    //   this.$http({
-    //     method: "post",
-    //     url: "/selectInformationFileList",
-    //     data: {
-    //       id: id,
-    //     },
-    //   })
-    //     .then((res) => {
-    //       console.log(res);
-    //     })
-    //     .catch((err) => {
-    //       console.log(err);
-    //     });
-    // },
-    // 导出模板
-    exportTem: function (i) {
+    // 导出   接口
+    exportTem: function (data) {
       return new Promise((resolve, reject) => {
         this.$http({
           url: "/export",
           method: "post",
-          data: { id: i },
-          responseType: "blob",
+          data: data,
+          // responseType: "blob",
         })
           .then((res) => {
             console.log(res);
@@ -206,7 +201,7 @@ export default {
             link.href = window.URL.createObjectURL(new Blob([res.data]));
             link.target = "_blank";
             //文件名和格式
-            link.download = "文件模板.zip";
+            link.download = "下载记录.xlsx";
             document.body.appendChild(link);
             link.click();
             document.body.removeChild(link);
@@ -225,7 +220,7 @@ export default {
       })
         .then((res) => {
           if (res.data && res.data.code === 200) {
-            console.log(res);
+            console.log(res.data.data);
             this.tableData = res.data.data;
             this.sum = res.data.count;
           } else {
@@ -245,7 +240,8 @@ export default {
       })
         .then((res) => {
           if (res.data && res.data.code === 200) {
-            console.log(res , '文件');
+            this.filesList = res.data.data; 
+            console.log(res.data.data , '文件');
           } else {
             console.log(res);
           }
@@ -254,6 +250,25 @@ export default {
           console.log(err);
         });
     },
+    // 文件下载接口
+    dealerDownload: function(data) {
+      this.$http({
+        method: "post",
+        url: "/dealerDownload",
+        data: data
+      })
+        .then((res) => {
+          if (res.data && res.data.code === 200) {
+            this.filesList = res.data.data; 
+            console.log(res.data.data , '文件下载');
+          } else {
+            console.log(res);
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+    }
   },
 };
 </script>