|
@@ -41,7 +41,7 @@
|
|
size="small"
|
|
size="small"
|
|
class="textColor"
|
|
class="textColor"
|
|
slot="reference"
|
|
slot="reference"
|
|
- >删除</el-button
|
|
|
|
|
|
+ >批量删除</el-button
|
|
>
|
|
>
|
|
</el-popconfirm>
|
|
</el-popconfirm>
|
|
</div>
|
|
</div>
|
|
@@ -176,8 +176,8 @@
|
|
>
|
|
>
|
|
<el-form
|
|
<el-form
|
|
ref="addForm"
|
|
ref="addForm"
|
|
- :rules="rules"
|
|
|
|
:model="addForm"
|
|
:model="addForm"
|
|
|
|
+ :rules="rules"
|
|
label-width="100px"
|
|
label-width="100px"
|
|
label-position="right"
|
|
label-position="right"
|
|
>
|
|
>
|
|
@@ -185,7 +185,7 @@
|
|
<el-select
|
|
<el-select
|
|
class="selectStyle"
|
|
class="selectStyle"
|
|
v-model="addForm.customerId"
|
|
v-model="addForm.customerId"
|
|
- placeholder="名称"
|
|
|
|
|
|
+ placeholder="请选择"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="item in dealerList"
|
|
v-for="item in dealerList"
|
|
@@ -200,7 +200,7 @@
|
|
<el-select
|
|
<el-select
|
|
class="selectStyle"
|
|
class="selectStyle"
|
|
v-model="addForm.mainId"
|
|
v-model="addForm.mainId"
|
|
- placeholder="名称"
|
|
|
|
|
|
+ placeholder="请选择"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="item in categoryList"
|
|
v-for="item in categoryList"
|
|
@@ -215,7 +215,7 @@
|
|
<el-select
|
|
<el-select
|
|
class="selectStyle"
|
|
class="selectStyle"
|
|
v-model="addForm.oneParentId"
|
|
v-model="addForm.oneParentId"
|
|
- placeholder="名称"
|
|
|
|
|
|
+ placeholder="请选择"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="item in oneList"
|
|
v-for="item in oneList"
|
|
@@ -230,7 +230,7 @@
|
|
<el-select
|
|
<el-select
|
|
class="selectStyle"
|
|
class="selectStyle"
|
|
v-model="addForm.twoParentId"
|
|
v-model="addForm.twoParentId"
|
|
- placeholder="名称"
|
|
|
|
|
|
+ placeholder="请选择"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="item in twoList"
|
|
v-for="item in twoList"
|
|
@@ -245,7 +245,7 @@
|
|
><el-select
|
|
><el-select
|
|
class="selectStyle"
|
|
class="selectStyle"
|
|
v-model="addForm.threeParentId"
|
|
v-model="addForm.threeParentId"
|
|
- placeholder="名称"
|
|
|
|
|
|
+ placeholder="请选择"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
v-for="item in threeList"
|
|
v-for="item in threeList"
|
|
@@ -307,14 +307,26 @@ export default {
|
|
serviceId: "",
|
|
serviceId: "",
|
|
mainId: "",
|
|
mainId: "",
|
|
},
|
|
},
|
|
- // rules: {
|
|
|
|
- // mainId: [
|
|
|
|
- // { required: true, message: "请选择存货分类", trigger: "change" },
|
|
|
|
- // ],
|
|
|
|
- // customerId: [
|
|
|
|
- // { required: true, message: "请选择经销商", trigger: "change" },
|
|
|
|
- // ],
|
|
|
|
- // },
|
|
|
|
|
|
+ rules: {
|
|
|
|
+ mainId: [
|
|
|
|
+ { required: true, message: "请选择存货分类", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ customerId: [
|
|
|
|
+ { required: true, message: "请选择经销商", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ oneParentId: [
|
|
|
|
+ { required: true, message: "请选择一级区域", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ twoParentId: [
|
|
|
|
+ { required: true, message: "请选择二级区域", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ threeParentId: [
|
|
|
|
+ { required: true, message: "请选择三级区域", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ serviceId: [
|
|
|
|
+ { required: true, message: "请选择业务员", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
|
|
currentPage: 1, // 当前页码
|
|
currentPage: 1, // 当前页码
|
|
pageSize: 10, // 每页数量
|
|
pageSize: 10, // 每页数量
|
|
@@ -333,6 +345,7 @@ export default {
|
|
threeList: [], //三级区域数据
|
|
threeList: [], //三级区域数据
|
|
userList: [], //业务员
|
|
userList: [], //业务员
|
|
ids: [],
|
|
ids: [],
|
|
|
|
+ rowID: null, //编辑ID
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
@@ -373,13 +386,14 @@ export default {
|
|
|
|
|
|
async editFn(id) {
|
|
async editFn(id) {
|
|
this.title = "编辑";
|
|
this.title = "编辑";
|
|
|
|
+ this.rowID = id;
|
|
let res = await getCustomerPtDetail({ id });
|
|
let res = await getCustomerPtDetail({ id });
|
|
console.log(res);
|
|
console.log(res);
|
|
this.addForm.customerId = res.data.customerId;
|
|
this.addForm.customerId = res.data.customerId;
|
|
this.addForm.mainId = res.data.mainId;
|
|
this.addForm.mainId = res.data.mainId;
|
|
- this.addForm.oneParentId = res.data.adminWebsitId1;
|
|
|
|
- this.addForm.twoParentId = res.data.adminWebsitId2;
|
|
|
|
- this.addForm.threeParentId = res.data.adminWebsitId3;
|
|
|
|
|
|
+ this.addForm.oneParentId = res.data.adminWebsitId2;
|
|
|
|
+ this.addForm.twoParentId = res.data.adminWebsitId3;
|
|
|
|
+ this.addForm.threeParentId = res.data.adminCompanyId;
|
|
this.addForm.serviceId = res.data.serviceId;
|
|
this.addForm.serviceId = res.data.serviceId;
|
|
|
|
|
|
this.dialogForm = true;
|
|
this.dialogForm = true;
|
|
@@ -426,30 +440,7 @@ export default {
|
|
this.dialogForm = true;
|
|
this.dialogForm = true;
|
|
},
|
|
},
|
|
async addDataListFn() {
|
|
async addDataListFn() {
|
|
- // await this.$refs.addForm.validate();
|
|
|
|
- // let id = this.dealerList.filter((i) => {
|
|
|
|
- // return i.id === this.addForm.customerId;
|
|
|
|
- // })[0];
|
|
|
|
- // console.log(id, "id");
|
|
|
|
- // let res = findElem(this.dealerList, "id", this.addForm.customerId);
|
|
|
|
- // console.log(11111, res);
|
|
|
|
- // let res = this.dealerList.filter(
|
|
|
|
- // (v) => v.id === this.addForm.customerId
|
|
|
|
- // )[0];
|
|
|
|
- // console.log(res);
|
|
|
|
- // this.addForm.customerName = res.name;
|
|
|
|
- // this.addForm.customerNumber = res.number;
|
|
|
|
- // let res2 = this.selectList.filter(
|
|
|
|
- // (v) => v.sysDictId === this.addForm.mainId
|
|
|
|
- // )[0];
|
|
|
|
- // console.log(res2);
|
|
|
|
- // this.addForm.mainName = res2.dictValue;
|
|
|
|
- // console.log(this.addForm);
|
|
|
|
- // await getDealerStockAdd({ ...this.addForm });
|
|
|
|
- // this.$message.success("添加成功");
|
|
|
|
- // await this.$refs.addForm.resetFields();
|
|
|
|
- // await this.getList({ pageNum: 1, pageSize: 10 });
|
|
|
|
-
|
|
|
|
|
|
+ await this.$refs.addForm.validate();
|
|
console.log(this.addForm);
|
|
console.log(this.addForm);
|
|
let data = this.dealerList.filter((v) => {
|
|
let data = this.dealerList.filter((v) => {
|
|
return v.id === this.addForm.customerId;
|
|
return v.id === this.addForm.customerId;
|
|
@@ -473,18 +464,37 @@ export default {
|
|
};
|
|
};
|
|
|
|
|
|
if (this.title == "编辑") {
|
|
if (this.title == "编辑") {
|
|
- await getCustomerPtUpdate(value);
|
|
|
|
|
|
+ await getCustomerPtUpdate({ ...value, id: this.rowID });
|
|
|
|
+
|
|
this.$message.success("编辑成功");
|
|
this.$message.success("编辑成功");
|
|
} else {
|
|
} else {
|
|
await getDealerStockAdd(value);
|
|
await getDealerStockAdd(value);
|
|
this.$message.success("添加成功");
|
|
this.$message.success("添加成功");
|
|
}
|
|
}
|
|
|
|
+ this.addForm.customerId = "";
|
|
|
|
+ this.addForm.mainId = "";
|
|
|
|
+ this.addForm.oneParentId = "";
|
|
|
|
+ this.addForm.twoParentId = "";
|
|
|
|
+ this.addForm.threeParentId = "";
|
|
|
|
+ this.addForm.serviceId = "";
|
|
|
|
+ this.userList = [];
|
|
|
|
+ this.twoList = [];
|
|
|
|
+ this.threeList = [];
|
|
this.getList({ pageNum: 1, pageSize: 10 });
|
|
this.getList({ pageNum: 1, pageSize: 10 });
|
|
this.dialogForm = false;
|
|
this.dialogForm = false;
|
|
},
|
|
},
|
|
//取消
|
|
//取消
|
|
async cancelFn() {
|
|
async cancelFn() {
|
|
- await this.$refs.addForm.resetFields();
|
|
|
|
|
|
+ await this.$refs.addForm.clearValidate();
|
|
|
|
+ this.addForm.customerId = "";
|
|
|
|
+ this.addForm.mainId = "";
|
|
|
|
+ this.addForm.oneParentId = "";
|
|
|
|
+ this.addForm.twoParentId = "";
|
|
|
|
+ this.addForm.threeParentId = "";
|
|
|
|
+ this.addForm.serviceId = "";
|
|
|
|
+ this.userList = [];
|
|
|
|
+ this.twoList = [];
|
|
|
|
+ this.threeList = [];
|
|
this.dialogForm = false;
|
|
this.dialogForm = false;
|
|
},
|
|
},
|
|
//获取经销商数据
|
|
//获取经销商数据
|
|
@@ -529,9 +539,9 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
-// ::v-deep .el-popover__reference {
|
|
|
|
-// margin-left: 10px;
|
|
|
|
-// }
|
|
|
|
|
|
+::v-deep .el-popover__reference {
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+}
|
|
// ::v-deep .selectStyle .el-input--suffix {
|
|
// ::v-deep .selectStyle .el-input--suffix {
|
|
// width: 200%;
|
|
// width: 200%;
|
|
// }
|
|
// }
|