|
|
@@ -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;
|
|
|
}
|