|
@@ -28,7 +28,7 @@
|
|
|
</el-popconfirm>
|
|
|
</div>
|
|
|
<div class="fr">
|
|
|
- <el-button type="primary" size="mini" @click="downLoadFns">导出</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="downLoadFns">导出</el-button>
|
|
|
<el-button type="primary" size="mini" @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="mini">导入</el-button>
|
|
@@ -271,7 +271,7 @@ export default {
|
|
|
async created() {
|
|
|
this.getTree();
|
|
|
// this.getAdminWebsit(1);
|
|
|
- this.getList({ pageNum: 1, pageSize: 10 });
|
|
|
+ this.getList();
|
|
|
this.getDealerDataList({ pageNum: 1, pageSize: -1 });
|
|
|
this.getUserList(1);
|
|
|
// this.getSelectList({ sysDictEnum: "PRODUCT_TYPE" });
|
|
@@ -326,21 +326,13 @@ export default {
|
|
|
// 导入
|
|
|
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,
|
|
|
- });
|
|
|
+ await this.getList();
|
|
|
} else {
|
|
|
this.$message.error(result.message);
|
|
|
}
|
|
@@ -349,7 +341,7 @@ export default {
|
|
|
downLoadFn() {
|
|
|
downloadFiles("/customer/pt/download");
|
|
|
},
|
|
|
- //下载模板
|
|
|
+ //下载模板
|
|
|
downLoadFns() {
|
|
|
downloadFiles("/customer/pt/export");
|
|
|
},
|
|
@@ -466,7 +458,7 @@ export default {
|
|
|
await deleDealerStockList({ ids: res });
|
|
|
}
|
|
|
|
|
|
- this.getList({ pageNum: 1, pageSize: 10 });
|
|
|
+ this.getList();
|
|
|
|
|
|
this.$message.success("删除成功");
|
|
|
this.ids = [];
|
|
@@ -527,7 +519,7 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs["addForm"].clearValidate();
|
|
|
});
|
|
|
- this.getList({ pageNum: 1, pageSize: 10 });
|
|
|
+ this.getList();
|
|
|
this.dialogForm = false;
|
|
|
},
|
|
|
//取消
|
|
@@ -563,41 +555,31 @@ export default {
|
|
|
// 更改每页数量
|
|
|
handleSizeChange(val) {
|
|
|
this.pageSize = val;
|
|
|
- // this.currentPage = 1
|
|
|
- this.getList({
|
|
|
- pageNum: this.currentPage,
|
|
|
- pageSize: this.pageSize,
|
|
|
- customerName: this.searchForm.customerName,
|
|
|
- });
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.getList();
|
|
|
},
|
|
|
// 更改当前页
|
|
|
handleCurrentChange(val) {
|
|
|
this.currentPage = val;
|
|
|
- this.getList({
|
|
|
- pageNum: this.currentPage,
|
|
|
- pageSize: this.pageSize,
|
|
|
- customerName: this.searchForm.customerName,
|
|
|
- });
|
|
|
+ this.getList();
|
|
|
},
|
|
|
//搜索功能
|
|
|
- async searchFn() {
|
|
|
- // console.log(this.searchForm);
|
|
|
+ searchFn() {
|
|
|
this.currentPage = 1;
|
|
|
- await this.getList({
|
|
|
- customerName: this.searchForm.customerName,
|
|
|
- pageNum: this.currentPage,
|
|
|
- pageSize: this.pageSize,
|
|
|
- });
|
|
|
+ this.getList();
|
|
|
},
|
|
|
//重置
|
|
|
clearFn() {
|
|
|
- console.log(this.$refs.searchForm);
|
|
|
this.$refs.searchForm.resetFields();
|
|
|
},
|
|
|
//获取列表数据
|
|
|
- async getList(data) {
|
|
|
- const res = await getDealerStockList(data);
|
|
|
-
|
|
|
+ async getList() {
|
|
|
+ let params = {
|
|
|
+ customerName: this.searchForm.customerName,
|
|
|
+ pageNum: this.currentPage,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ };
|
|
|
+ const res = await getDealerStockList(params);
|
|
|
this.dataList = res.data.records;
|
|
|
this.listTotal = res.data.total;
|
|
|
},
|