|
@@ -14,18 +14,29 @@
|
|
</el-card> -->
|
|
</el-card> -->
|
|
<!-- 筛选条件 -->
|
|
<!-- 筛选条件 -->
|
|
<div>
|
|
<div>
|
|
- <el-form label-width="100px" size="small" label-position="left">
|
|
|
|
|
|
+ <el-form
|
|
|
|
+ ref="searchForm"
|
|
|
|
+ :model="searchForm"
|
|
|
|
+ label-width="100px"
|
|
|
|
+ size="small"
|
|
|
|
+ label-position="left"
|
|
|
|
+ >
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
- <el-form-item label="经销商名称" prop="account">
|
|
|
|
- <el-input placeholder="请输入经销商名称"></el-input>
|
|
|
|
|
|
+ <el-form-item label="经销商名称" prop="customerName">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="searchForm.customerName"
|
|
|
|
+ placeholder="请输入经销商名称"
|
|
|
|
+ ></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
<el-col :xs="24" :sm="12" :lg="18">
|
|
<el-col :xs="24" :sm="12" :lg="18">
|
|
<el-form-item label="" class="fr">
|
|
<el-form-item label="" class="fr">
|
|
- <el-button size="small">清空</el-button>
|
|
|
|
- <el-button size="small" type="primary">搜索</el-button>
|
|
|
|
|
|
+ <el-button size="small" @click="clearFn">清空</el-button>
|
|
|
|
+ <el-button size="small" type="primary" @click="searchFn"
|
|
|
|
+ >搜索</el-button
|
|
|
|
+ >
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -66,7 +77,7 @@
|
|
<el-table-column
|
|
<el-table-column
|
|
align="center"
|
|
align="center"
|
|
label="经销商编码"
|
|
label="经销商编码"
|
|
- prop="customerName"
|
|
|
|
|
|
+ prop="customerNumber"
|
|
min-width="160"
|
|
min-width="160"
|
|
show-overflow-tooltip
|
|
show-overflow-tooltip
|
|
/>
|
|
/>
|
|
@@ -126,7 +137,12 @@
|
|
show-overflow-tooltip
|
|
show-overflow-tooltip
|
|
>
|
|
>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button type="text" class="textColor">编辑</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ class="textColor"
|
|
|
|
+ @click="editFn(scope.row.id)"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ >
|
|
<el-popconfirm
|
|
<el-popconfirm
|
|
@onConfirm="deleFn(scope.row.id)"
|
|
@onConfirm="deleFn(scope.row.id)"
|
|
title="这是一段内容确定删除吗?"
|
|
title="这是一段内容确定删除吗?"
|
|
@@ -156,15 +172,24 @@
|
|
|
|
|
|
<!-- 弹窗 -->
|
|
<!-- 弹窗 -->
|
|
<el-dialog
|
|
<el-dialog
|
|
- title="经销商工程机押金比例设置"
|
|
|
|
|
|
+ :title="title"
|
|
:visible.sync="showDialog"
|
|
:visible.sync="showDialog"
|
|
width="30%"
|
|
width="30%"
|
|
:show-close="false"
|
|
:show-close="false"
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
>
|
|
>
|
|
- <el-form :model="dialogForm" label-width="100px" label-position="right">
|
|
|
|
|
|
+ <el-form
|
|
|
|
+ ref="dialogForm"
|
|
|
|
+ :model="dialogForm"
|
|
|
|
+ label-width="100px"
|
|
|
|
+ label-position="right"
|
|
|
|
+ >
|
|
<el-form-item label="经销商名称">
|
|
<el-form-item label="经销商名称">
|
|
- <el-select v-model="dialogForm.customerId" placeholder="名称">
|
|
|
|
|
|
+ <el-select
|
|
|
|
+ class="inputStyle"
|
|
|
|
+ v-model="dialogForm.customerId"
|
|
|
|
+ placeholder="名称"
|
|
|
|
+ >
|
|
<el-option
|
|
<el-option
|
|
v-for="item in dealerList"
|
|
v-for="item in dealerList"
|
|
:key="item.id"
|
|
:key="item.id"
|
|
@@ -183,20 +208,22 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="开始时间">
|
|
<el-form-item label="开始时间">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
|
|
+ class="inputStyle"
|
|
v-model="dialogForm.startTime"
|
|
v-model="dialogForm.startTime"
|
|
- type="date"
|
|
|
|
- placeholder="选择日期"
|
|
|
|
- format="yyyy 年 MM 月 dd 日"
|
|
|
|
|
|
+ type="datetime"
|
|
|
|
+ placeholder="选择日期时间"
|
|
|
|
+ default-time="00:00:00"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
>
|
|
>
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="结束时间">
|
|
<el-form-item label="结束时间">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
|
|
+ class="inputStyle"
|
|
v-model="dialogForm.endTime"
|
|
v-model="dialogForm.endTime"
|
|
- type="date"
|
|
|
|
- placeholder="选择日期"
|
|
|
|
- format="yyyy 年 MM 月 dd 日"
|
|
|
|
|
|
+ type="datetime"
|
|
|
|
+ placeholder="选择日期时间"
|
|
|
|
+ default-time="23:59:59"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
>
|
|
>
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
@@ -211,7 +238,7 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
- <el-button @click="showDialog = false">取 消</el-button>
|
|
|
|
|
|
+ <el-button @click="cancelFn">取 消</el-button>
|
|
<el-button type="primary" @click="addDataListFn">确 定</el-button>
|
|
<el-button type="primary" @click="addDataListFn">确 定</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -224,16 +251,21 @@ import {
|
|
getDealerDepositAdd,
|
|
getDealerDepositAdd,
|
|
getDealerList,
|
|
getDealerList,
|
|
deleDealerDeposit,
|
|
deleDealerDeposit,
|
|
|
|
+ editDealerDeposit,
|
|
|
|
+ infoDealerDeposit,
|
|
} from "@/api/basic_data/dealer";
|
|
} from "@/api/basic_data/dealer";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ title: "",
|
|
currentPage: 1, // 当前页码
|
|
currentPage: 1, // 当前页码
|
|
pageSize: 10, // 每页数量
|
|
pageSize: 10, // 每页数量
|
|
listTotal: 0, // 列表
|
|
listTotal: 0, // 列表
|
|
listLoading: false, // 列表加载loading
|
|
listLoading: false, // 列表加载loading
|
|
- screenForm: {},
|
|
|
|
|
|
+ searchForm: {
|
|
|
|
+ customerName: "",
|
|
|
|
+ },
|
|
dialogForm: {
|
|
dialogForm: {
|
|
amount: 0,
|
|
amount: 0,
|
|
customerId: "",
|
|
customerId: "",
|
|
@@ -255,6 +287,29 @@ export default {
|
|
await this.getDealerDataList({ pageNum: 1, pageSize: 10 });
|
|
await this.getDealerDataList({ pageNum: 1, pageSize: 10 });
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //取消
|
|
|
|
+ cancelFn() {
|
|
|
|
+ this.dialogForm = {
|
|
|
|
+ amount: 0,
|
|
|
|
+ customerId: "",
|
|
|
|
+ customerName: "",
|
|
|
|
+ customerNumber: "",
|
|
|
|
+ endTime: "",
|
|
|
|
+
|
|
|
|
+ rate: 0,
|
|
|
|
+ remark: "",
|
|
|
|
+ startTime: "",
|
|
|
|
+ };
|
|
|
|
+ this.showDialog = false;
|
|
|
|
+ },
|
|
|
|
+ //编辑
|
|
|
|
+ async editFn(id) {
|
|
|
|
+ console.log(id);
|
|
|
|
+ this.title = "编辑经销商工程机配置";
|
|
|
|
+ const res = await infoDealerDeposit({ id });
|
|
|
|
+ this.dialogForm = res.data;
|
|
|
|
+ this.showDialog = true;
|
|
|
|
+ },
|
|
//删除
|
|
//删除
|
|
async deleFn(id) {
|
|
async deleFn(id) {
|
|
await deleDealerDeposit({ id });
|
|
await deleDealerDeposit({ id });
|
|
@@ -266,17 +321,7 @@ export default {
|
|
const res = await getDealerList(data);
|
|
const res = await getDealerList(data);
|
|
this.dealerList = res.data.records;
|
|
this.dealerList = res.data.records;
|
|
},
|
|
},
|
|
- // 提交筛选表单
|
|
|
|
- submitScreenForm() {
|
|
|
|
- this.currentPage = 1;
|
|
|
|
- this.getList({ pageNum: 1, pageSize: 10 });
|
|
|
|
- },
|
|
|
|
- // 重置筛选表单
|
|
|
|
- resetScreenForm() {
|
|
|
|
- this.$refs.screenForm.resetFields();
|
|
|
|
- this.currentPage = 1;
|
|
|
|
- this.getList({ pageNum: 1, pageSize: 10 });
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
// 更改每页数量
|
|
// 更改每页数量
|
|
handleSizeChange(val) {
|
|
handleSizeChange(val) {
|
|
this.pageSize = val;
|
|
this.pageSize = val;
|
|
@@ -291,7 +336,11 @@ export default {
|
|
//搜索功能
|
|
//搜索功能
|
|
async searchFn() {
|
|
async searchFn() {
|
|
console.log(this.searchForm);
|
|
console.log(this.searchForm);
|
|
- await this.getList({ ...this.searchForm, pageNum: 1, pageSize: 10 });
|
|
|
|
|
|
+ await this.getList({
|
|
|
|
+ keyword: this.searchForm.customerName,
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ });
|
|
},
|
|
},
|
|
//重置
|
|
//重置
|
|
clearFn() {
|
|
clearFn() {
|
|
@@ -309,21 +358,38 @@ export default {
|
|
let res = this.dealerList.filter(
|
|
let res = this.dealerList.filter(
|
|
(v) => v.id === this.dialogForm.customerId
|
|
(v) => v.id === this.dialogForm.customerId
|
|
)[0];
|
|
)[0];
|
|
- console.log(res);
|
|
|
|
|
|
+
|
|
this.dialogForm.customerName = res.name;
|
|
this.dialogForm.customerName = res.name;
|
|
this.dialogForm.customerNumber = res.number;
|
|
this.dialogForm.customerNumber = res.number;
|
|
|
|
|
|
- console.log(this.dialogForm);
|
|
|
|
- await getDealerDepositAdd({
|
|
|
|
- ...this.dialogForm,
|
|
|
|
- rate: Number(this.dialogForm.rate),
|
|
|
|
- amount: Number(this.dialogForm.amount),
|
|
|
|
- });
|
|
|
|
- this.$message.success("添加成功");
|
|
|
|
- await this.getList({ pageNum: 1, pageSize: 10 });
|
|
|
|
|
|
+ if (this.dialogForm.id) {
|
|
|
|
+ await editDealerDeposit({ ...this.dialogForm });
|
|
|
|
+ this.$message.success("编辑成功");
|
|
|
|
+ } else {
|
|
|
|
+ await getDealerDepositAdd({
|
|
|
|
+ ...this.dialogForm,
|
|
|
|
+ rate: Number(this.dialogForm.rate),
|
|
|
|
+ amount: Number(this.dialogForm.amount),
|
|
|
|
+ });
|
|
|
|
+ this.$message.success("添加成功");
|
|
|
|
+ }
|
|
|
|
+ this.dialogForm = {
|
|
|
|
+ amount: 0,
|
|
|
|
+ customerId: "",
|
|
|
|
+ customerName: "",
|
|
|
|
+ customerNumber: "",
|
|
|
|
+ endTime: "",
|
|
|
|
+
|
|
|
|
+ rate: 0,
|
|
|
|
+ remark: "",
|
|
|
|
+ startTime: "",
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ this.getList({ pageNum: 1, pageSize: 10 });
|
|
this.showDialog = false;
|
|
this.showDialog = false;
|
|
},
|
|
},
|
|
addFn() {
|
|
addFn() {
|
|
|
|
+ this.title = "新增经销商工程机配置";
|
|
this.showDialog = true;
|
|
this.showDialog = true;
|
|
},
|
|
},
|
|
},
|
|
},
|
|
@@ -331,6 +397,9 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
+::v-deep .el-textarea__inner {
|
|
|
|
+ resize: none;
|
|
|
|
+}
|
|
::v-deep .el-form {
|
|
::v-deep .el-form {
|
|
.inputStyle {
|
|
.inputStyle {
|
|
width: 80%;
|
|
width: 80%;
|