|
@@ -58,6 +58,20 @@
|
|
>
|
|
>
|
|
</el-popconfirm>
|
|
</el-popconfirm>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="fr">
|
|
|
|
+ <el-button type="primary" size="small" @click="downLoadFn"
|
|
|
|
+ >下载模板</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-upload
|
|
|
|
+ class="import-btn"
|
|
|
|
+ action=""
|
|
|
|
+ :http-request="handleImport"
|
|
|
|
+ :file-list="importFileList"
|
|
|
|
+ :show-file-list="false"
|
|
|
|
+ >
|
|
|
|
+ <el-button type="primary" size="small">导入</el-button>
|
|
|
|
+ </el-upload>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="mymain-container">
|
|
<div class="mymain-container">
|
|
@@ -323,10 +337,12 @@ import {
|
|
getWalletCustomerList,
|
|
getWalletCustomerList,
|
|
} from "@/api/basic_data/dealer";
|
|
} from "@/api/basic_data/dealer";
|
|
import { getDealerList } from "@/api/basic_data/dealer";
|
|
import { getDealerList } from "@/api/basic_data/dealer";
|
|
|
|
+import { downloadFiles, handleImport } from "@/utils/util";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ importFileList: [],
|
|
isDisabled: true,
|
|
isDisabled: true,
|
|
title: "",
|
|
title: "",
|
|
dialogForm: false,
|
|
dialogForm: false,
|
|
@@ -431,6 +447,33 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 导入
|
|
|
|
+ async handleImport(param) {
|
|
|
|
+ const file = param.file;
|
|
|
|
+
|
|
|
|
+ const formData = new FormData();
|
|
|
|
+ formData.append("file", file);
|
|
|
|
+
|
|
|
|
+ let result = await handleImport("/customer/pt/importData", formData);
|
|
|
|
+
|
|
|
|
+ console.log(result);
|
|
|
|
+ this.importFileList = [];
|
|
|
|
+ if (result.code == 200) {
|
|
|
|
+ this.$message.success("导入成功");
|
|
|
|
+ await this.getList({
|
|
|
|
+ customerName: this.searchForm.customerName,
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(result.message);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //下载模板
|
|
|
|
+ downLoadFn() {
|
|
|
|
+ downloadFiles("/customer/pt/download");
|
|
|
|
+ },
|
|
|
|
+
|
|
// //改变产品大类
|
|
// //改变产品大类
|
|
// changeSelectFn(value) {
|
|
// changeSelectFn(value) {
|
|
// // const res = this.categoryList.filter((v) => v.productCategoryId == value);
|
|
// // const res = this.categoryList.filter((v) => v.productCategoryId == value);
|
|
@@ -641,6 +684,10 @@ export default {
|
|
.add-right {
|
|
.add-right {
|
|
margin-right: 10px;
|
|
margin-right: 10px;
|
|
}
|
|
}
|
|
|
|
+.import-btn {
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ display: inline-block;
|
|
|
|
+}
|
|
// ::v-deep .selectStyle .el-input--suffix {
|
|
// ::v-deep .selectStyle .el-input--suffix {
|
|
// width: 200%;
|
|
// width: 200%;
|
|
// }
|
|
// }
|