liuYb лет назад: 4
Родитель
Сommit
d60886c1ef

+ 13 - 24
src/components/Modal.vue

@@ -64,20 +64,12 @@
         </div>
         <div class="bodyRow">
           <span>标题</span>
-          <input
-            type="text"
-            placeholder="文章标题"
-            v-model="mediaTitle"
-          />
+          <input type="text" placeholder="文章标题" v-model="mediaTitle" />
           <!--     <span>{{LinkData}}</span> -->
         </div>
         <div class="bodyRow">
           <span>链接</span>
-          <input
-            type="text"
-            placeholder="文章发布地址"
-            v-model="mediaUrl"
-          />
+          <input type="text" placeholder="文章发布地址" v-model="mediaUrl" />
         </div>
       </div>
       <div class="modal-footer">
@@ -105,13 +97,9 @@ export default {
         return [];
       },
     },
-    //dataset_link: String,
   },
   data() {
     return {
-      formData: new FormData(),
-      //LinkData: "",
-      // dataset_link: "",
       mediaTitle: "",
       mediaUrl: "",
     };
@@ -121,23 +109,24 @@ export default {
       this.$emit("closeme");
     },
     onSubmit() {
-     
       this.$emit("closeme");
     },
     edit: function () {
-      console.log("edit:", this.mediaTitle)
       let config = {
-              url: "/dealerDownload",
-              data: {
-                Title: this.mediaTitle,
-                Url: this.mediaUrl,
-              },
-            };
+        url: "/dealerDownload",
+        data: {
+          Title: this.mediaTitle,
+          Url: this.mediaUrl,
+        },
+      };
+      console.log("edit2:", config);
       this.$emit("update", config);
     },
     test: function () {
-     /*  this.mediaTitle=this.LinkData.mediaTitle;
-      this.mediaUrl=this.LinkData.mediaUrl; */
+      this.mediaTitle = this.LinkData.mediaTitle;
+      this.mediaUrl = this.LinkData.mediaUrl;
+      console.log("test1:", this.LinkData);
+      console.log("test2:", this.mediaTitle);
     },
   },
   mounted() {

+ 20 - 11
src/views/account/AccountManage.vue

@@ -23,8 +23,9 @@
             <td v-for="(obj, i) in tableData" :key="i">
               {{ obj.dataName }}
             </td>
-            <td class="operationStyle" @click="toggleModal">
-              <span>编辑</span>
+            <td class="operationStyle">
+              <span @click="toggleModal">编辑</span>
+              <span>示例</span>
             </td>
           </tr>
           <tr class="tbodyStyle">
@@ -38,8 +39,9 @@
             <td v-for="(obj, i) in tableData" :key="i">
               {{ obj.dataName }}
             </td>
-            <td class="operationStyle" @click="toggleModal">
-              <span>编辑</span>
+            <td class="operationStyle">
+              <span @click="toggleModal">编辑</span>
+              <span>示例</span>
             </td>
           </tr>
           <tr class="tbodyStyle">
@@ -53,8 +55,9 @@
             <td v-for="(obj, i) in tableData" :key="i">
               {{ obj.dataName }}
             </td>
-            <td class="operationStyle" @click="toggleModal">
-              <span>编辑</span>
+            <td class="operationStyle">
+              <span @click="toggleModal">编辑</span>
+              <span>示例</span>
             </td>
           </tr>
           <tr class="tbodyStyle">
@@ -68,8 +71,9 @@
             <td v-for="(obj, i) in tableData" :key="i">
               {{ obj.dataName }}
             </td>
-            <td class="operationStyle" @click="toggleModal">
-              <span>编辑</span>
+            <td class="operationStyle">
+              <span @click="toggleModal">编辑</span>
+              <span>示例</span>
             </td>
           </tr>
           <tr class="tbodyStyle">
@@ -83,8 +87,9 @@
             <td v-for="(obj, i) in tableData" :key="i">
               {{ obj.dataName }}
             </td>
-            <td class="operationStyle" @click="toggleModal">
-              <span>编辑</span>
+            <td class="operationStyle">
+              <span @click="toggleModal">编辑</span>
+              <span>示例</span>
             </td>
           </tr>
         </tbody>
@@ -142,7 +147,7 @@ export default {
         .then((res) => {
           console.log(res);
           if (res.data.code === 200) {
-          //  this.tableData = res.data.data;
+            //  this.tableData = res.data.data;
           }
         })
         .catch((err) => {
@@ -179,6 +184,10 @@ export default {
 }
 .operationStyle span {
   color: #027db4;
+  width: 100%;
+}
+.operationStyle span:nth-child(1) {
+  margin-right: 32px;
 }
 .upload_record div:nth-child(1) {
   margin: 16px;

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

@@ -99,7 +99,7 @@
       </div>
     </div>
     <div v-else>
-      <Detail :detailData="tableData" :nowIndex="nowIndex"></Detail>
+      <Detail :detailData="tableData" :nowIndex="nowIndex" :fileData="tableFileData"></Detail>
     </div>
   </div>
 </template>
@@ -142,7 +142,6 @@ export default {
         {
           name: "下载",
           function: (obj) => {
-            //this.download();
             let config = {
               url: "/dealerDownload",
               data: {
@@ -161,13 +160,16 @@ export default {
         }, */
         {
           name: "查看详情>",
-          function: (i) => {
-            this.showDetail(i);
+          function: (obj) => {
+            let data = {
+              informationId: obj.id,
+            };
+            this.showDetail(data);
           },
         },
       ],
       // 表格配置
-      sum: 240, // 一共有多少条数据
+      sum: 10, // 一共有多少条数据
       pageSize: 20, // 每页展示的数据
       discolor: false, // flase是隔行变色
       currentPage: 1,
@@ -182,6 +184,7 @@ export default {
           asc: "false",
         },
       ],
+      tableFileData: [],
       tableHeadStyle: {
         background: "#848484",
         height: "30px",
@@ -201,10 +204,6 @@ export default {
     },
   },
   methods: {
-    showDetail: function () {
-      //alert("展示详情");
-      this.initialPage = !this.initialPage;
-    },
     feedback: () => {
       alert("反馈");
     },
@@ -260,6 +259,23 @@ export default {
           });
       });
     },
+    //查看详情
+    showDetail: function (config) {
+      this.$http({
+        url: "/selectInformationFileList",
+        method: "post",
+        data: config,
+      })
+        .then((res) => {
+          if (res.data.code === 200) {
+            this.tableFileData = res.data.data;
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });
+        this.initialPage = !this.initialPage;
+    },
     //获取资料列表
     getDataList: function () {
       this.$http({
@@ -314,13 +330,13 @@ export default {
       this.newGetDataList(data);
     }, */
     //下载筛选
-    sortByDownload: function () {
+    /* sortByDownload: function () {
       if (this.downloadSortVal === "notyet") {
         console.log("notyet");
       } else if (this.downloadSortVal === "already") {
         console.log("already");
       }
-    },
+    }, */
     //搜索资料名
     searchByName: function () {
       console.log("insearchByName", this.searchName);

+ 123 - 21
src/views/data/UploadLink.vue

@@ -29,25 +29,25 @@
             :class="{ table_gray: index % 2 === 0 }"
           >
             <td v-if="flag">{{ index + 1 }}</td>
-            <td>{{ obj.informationId }}</td>
+            <td>{{ obj.informationId || "2021/03/04" }}</td>
             <!-- 资料名称 待定-->
-            <td>{{ obj.publishDate }}</td>
+            <td>{{ obj.publishDate || "2021/03/04" }}</td>
             <!-- 发布日期 -->
-            <td>{{ obj.carTypeName }}</td>
+            <td>{{ obj.carTypeName || "2021/03/04" }}</td>
             <!-- 车系 -->
-            <td>{{ obj.carPlatformName }}</td>
+            <td>{{ obj.carPlatformName || "2021/03/04" }}</td>
             <!-- 车型 -->
-            <td>{{ obj.publishSourceName }}</td>
+            <td>{{ obj.publishSourceName || "2021/03/04" }}</td>
             <!-- 发布版块 -->
-            <td>{{ obj.projectTypeName }}</td>
+            <td>{{ obj.projectTypeName || "2021/03/04" }}</td>
             <!-- 项目分类 -->
-            <td>{{ obj.contentTypeName }}</td>
+            <td>{{ obj.contentTypeName || "2021/03/04" }}</td>
             <!-- 内容分类 -->
-            <td>{{ obj.contentTypeName }}</td>
+            <td>{{ obj.contentTypeName || "2021/03/04" }}</td>
             <!-- 内容分类 -->
-            <td>{{ obj.mediaTitle }}</td>
+            <td>{{ obj.mediaTitle || "2021/03/04" }}</td>
             <!-- 稿件标题 -->
-            <td>{{ obj.mediaUrl }}</td>
+            <td>{{ obj.mediaUrl || "2021/03/04" }}</td>
             <!-- 链接 -->
             <td class="operationStyle">
               <span @click="toggleModal(index)">编辑</span>
@@ -78,8 +78,24 @@
     <div class="pageBottom">
       <div class="fileOperation">
         <span class="operationStyle xiahuaxian">导入模板</span>
-        <button @click="toggleModal3()">导入</button>
-        <button @click="toggleModal4()">导出</button>
+        <!--  <button @click="toggleModal3()">导入</button> -->
+        <!-- <button @click="importDataList">导入</button> -->
+        <label for="fileInput" @change="onImportExcel()"
+          >导入<input
+            type="file"
+            name="fileName"
+            id="fileInput"
+            multiple
+            accept=".xlsx, .xls"
+        /></label>
+        <!-- <button @click="toggleModal4()">导出</button> -->
+        <label for="fileOutput" @change="onOutputExcel()"
+          >导出<input
+            type="file"
+            name="fileName"
+            id="fileOutput"
+            accept=".xlsx, .xls"
+        /></label>
       </div>
       <TablePage
         :currentPage="currentPage"
@@ -152,7 +168,7 @@ export default {
       showModal3: false,
       showModal4: false,
       // 表格配置
-      sum: 240, // 一共有多少条数据
+      sum: 20, // 一共有多少条数据
       pageSize: 20, // 每页展示的数据
       discolor: false, // false是隔行变色
       currentPage: 1,
@@ -281,7 +297,7 @@ export default {
       console.log("editTitle文件:", val);
       //this.Linkdata = new Array(val);
       this.$http({
-        url: "/firmsLinkUpload",
+        url: "/dealerFeedback",
         method: "post",
         data: val.data,
       })
@@ -291,9 +307,6 @@ export default {
         .catch((err) => {
           console.log(err);
         });
-      //console.log("inEditTitle:", this.Linkdata);
-
-      this.getDataList();
     },
 
     toDel: function (n) {
@@ -338,25 +351,94 @@ export default {
     //获取资料列表
     getDataList: function () {
       this.$http({
-        //url: "/dealerFeedback",selectMediaAccountPage
         url: "/firmsLinkUpload",
         method: "post",
         data: {},
       })
         .then((res) => {
-          console.log("uploadLink res:", res);
           if (res.data.code === 200) {
             this.tableData = res.data.data;
-            console.log("uploadLink tableData:", this.tableData);
           }
+          console.log("uploadLink this.tableData:", this.tableData);
         })
         .catch((err) => {
           console.log(err);
         });
     },
+    //导入经销商反馈信息  经销商反馈服务>导入经销商反馈信息
+    importDataList: function () {
+      this.file = event.target.files;
+      this.fileDes = [];
+      this.file.forEach((item) => {
+        this.fileDes.push(item.name);
+      });
+
+      /*  this.$http({
+        url: "/importDealerFeedback",
+        method: "post",
+        data: {},
+      })
+        .then((res) => {
+          if (res.data.code === 200) {
+            this.tableData = res.data.data;
+          }
+        })
+        .catch((err) => {
+          console.log(err);
+        });*/
+    },
+    //导出excel
+    onOutputExcel: function () {},
+    //导入excel
+    onImportExcel: function () {
+      /* // 获取上传的文件对象
+      const { files } = file.target;
+      // 通过FileReader对象读取文件
+      const fileReader = new FileReader();
+      fileReader.onload = (event) => {
+        try {
+          const { result } = event.target;
+          // 以二进制流方式读取得到整份excel表格对象
+          const workbook = XLSX.read(result, { type: "binary" });
+          // 存储获取到的数据
+          let data = [];
+          // 遍历每张工作表进行读取(这里默认只读取第一张表)
+          for (const sheet in workbook.Sheets) {
+            // esline-disable-next-line
+            if (workbook.Sheets.hasOwnProperty(sheet)) {
+              // 利用 sheet_to_json 方法将 excel 转成 json 数据
+              data = data.concat(
+                XLSX.utils.sheet_to_json(workbook.Sheets[sheet])
+              );
+              // break; // 如果只取第一张表,就取消注释这行
+            }
+          }
+          // 最终获取到并且格式化后的 json 数据
+          const uploadData = data.map((item) => {
+            return {
+              id: Number(item["人员ID"]),
+              name: item["姓名"],
+              idType: this.findIdType(item["证件类型"], "string"),
+              credentialsId: item["证件号码"],
+              tel: item["固定电话"],
+              mobile: item["移动电话"],
+            };
+          });
+          console.log(uploadData); //这里得到了后端需要的json数据,调用接口传给后端就行了
+          //message.success('上传成功!') //这里用了antd中的message组件
+          console.log("上传成功!");
+        } catch (e) {
+          // 这里可以抛出文件类型错误不正确的相关提示
+          //  message.error('文件类型不正确!');
+          console.log("文件类型不正确!");
+        }
+      };
+      // 以二进制方式打开文件
+      fileReader.readAsBinaryString(files[0]); */
+    },
   },
   mounted() {
-    this.getDataList();
+    //this.getDataList();
   },
 };
 </script>
@@ -486,6 +568,26 @@ export default {
 .fileOperation button {
   border-radius: 4px;
 }
+.fileOperation span {
+  margin-right: 16px;
+}
+.fileOperation {
+  border-radius: 4px;
+  label {
+    margin-right: 16px;
+    height: 30px;
+    line-height: 30px;
+    width: 56px;
+    background-color: #0056a0;
+    color: #fff;
+    text-align: center;
+    font-size: 14px;
+    input {
+      display: none;
+    }
+  }
+}
+
 .timeLimitStyle {
   padding: 10px;
 }

+ 37 - 25
src/views/data/components/InfoListItemDetail.vue

@@ -13,10 +13,9 @@
           <span>上传时间:</span>
           <span>{{ detailData[nowIndex].fileUploadDate }}</span>
         </div>
-        <div class="multiDetail">
+       <!--  <div class="multiDetail">
           <div class="firstColumn">
             <span>车系:</span>
-            <!-- carSeries -->
             <span>{{
               detailData[nowIndex].spread
             }}</span>
@@ -27,7 +26,7 @@
               {{ detailData[nowIndex].spread }}
             </span>
           </div>
-        </div>
+        </div> -->
         <div class="multiDetail">
           <div class="firstColumn">
             <span>素材时间:</span>
@@ -48,12 +47,12 @@
           <span>附件:</span>
           <div class="filesName">
             <p
-              v-for="(item, index) in dataObj.files"
+              v-for="(item, index) in fileData"
               :key="index"
               @click="downloadFile(index)"
             >
-              {{ item.name }}
-            </p>附件附件
+              {{ item.fileName || "附件附件" }}
+            </p>
           </div>
         </div>
       </div>
@@ -70,6 +69,12 @@ export default {
         return [];
       },
     },
+    fileData: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
     nowIndex: {
       type: Number,
       default: -1,
@@ -89,29 +94,36 @@ export default {
   },
   methods: {
     // 下载附件
-    downloadFile: function (i) {
-      console.log(i);
-    },
-      //获取资料列表
-    getDataList: function () {
-  /*     this.$http({
-        url: "/firmsUploadListByAgent",
-        method: "post",
-        data: {},
-      })
-        .then((res) => {
-          console.log(res);
-          if (res.data.code === 200) {
-            this.tableData = res.data.data;
-          }
+    downloadFile: function (index) {
+      let config={
+        informationId: this.fileData[index].id
+      }
+      console.log("下载附件:", config);
+      return new Promise((resolve, reject) => {
+        this.$http({
+          url: '/selectInformationFileList',
+          method: "post",
+          data: config,
         })
-        .catch((err) => {
-          console.log(err);
-        }); */
+          .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 = "文件模板.txt";
+            document.body.appendChild(link);
+            link.click();
+            document.body.removeChild(link);
+          })
+          .catch((err) => {
+            reject(err);
+          });
+      });
     },
   },
   mounted() {
-    this.getDataList();
   },
 };
 </script>