|
@@ -247,7 +247,17 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="一级区域" prop="oneParentId">
|
|
|
|
|
|
+ <el-form-item label="区域" prop="region">
|
|
|
|
+ <el-cascader
|
|
|
|
+ ref="locationCascader"
|
|
|
|
+ v-model="addForm.region"
|
|
|
|
+ class="selectStyle"
|
|
|
|
+ :options="options"
|
|
|
|
+ :props="props"
|
|
|
|
+ clearable
|
|
|
|
+ ></el-cascader>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <!-- <el-form-item label="一级区域" prop="oneParentId">
|
|
<el-select
|
|
<el-select
|
|
class="selectStyle"
|
|
class="selectStyle"
|
|
v-model="addForm.oneParentId"
|
|
v-model="addForm.oneParentId"
|
|
@@ -297,7 +307,7 @@
|
|
>
|
|
>
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
- </el-form-item>
|
|
|
|
|
|
+ </el-form-item> -->
|
|
<el-form-item label="对应业务员" prop="serviceId">
|
|
<el-form-item label="对应业务员" prop="serviceId">
|
|
<el-select
|
|
<el-select
|
|
class="selectStyle"
|
|
class="selectStyle"
|
|
@@ -337,11 +347,35 @@ 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 { getDepartmentList } from "@/api/setting";
|
|
import { downloadFiles, handleImport } from "@/utils/util";
|
|
import { downloadFiles, handleImport } from "@/utils/util";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ props: {
|
|
|
|
+ checkStrictly: true,
|
|
|
|
+ value: "adminWebsitId",
|
|
|
|
+ label: "name",
|
|
|
|
+
|
|
|
|
+ // expandTrigger: "hover",
|
|
|
|
+ // lazy: true,
|
|
|
|
+ // lazyLoad(node, resolve) {
|
|
|
|
+ // console.log(node);
|
|
|
|
+ // const { value } = node;
|
|
|
|
+ // setTimeout(async () => {
|
|
|
|
+ // let res = await getAdminWebsitByparent({
|
|
|
|
+ // parentId: value,
|
|
|
|
+ // });
|
|
|
|
+ // let aaa = res.data.map((v) => {
|
|
|
|
+ // return { value: v.adminWebsitId, label: v.name };
|
|
|
|
+ // });
|
|
|
|
+
|
|
|
|
+ // resolve(aaa);
|
|
|
|
+ // }, 0);
|
|
|
|
+ // },
|
|
|
|
+ },
|
|
|
|
+ options: [],
|
|
importFileList: [],
|
|
importFileList: [],
|
|
isDisabled: true,
|
|
isDisabled: true,
|
|
title: "",
|
|
title: "",
|
|
@@ -350,23 +384,25 @@ export default {
|
|
customerId: "",
|
|
customerId: "",
|
|
customerName: "",
|
|
customerName: "",
|
|
customerNumber: "",
|
|
customerNumber: "",
|
|
- oneParentId: "",
|
|
|
|
- twoParentId: "",
|
|
|
|
- threeParentId: "",
|
|
|
|
|
|
+ region: [],
|
|
|
|
+ // oneParentId: "",
|
|
|
|
+ // twoParentId: "",
|
|
|
|
+ // threeParentId: "",
|
|
serviceId: "",
|
|
serviceId: "",
|
|
customerWalletId: "",
|
|
customerWalletId: "",
|
|
},
|
|
},
|
|
mainId: null,
|
|
mainId: null,
|
|
rules: {
|
|
rules: {
|
|
customerId: [
|
|
customerId: [
|
|
- { required: true, message: "请选择经销商名称", trigger: "blur" },
|
|
|
|
|
|
+ { required: true, message: "请选择经销商名称", trigger: "change" },
|
|
],
|
|
],
|
|
customerWalletId: [
|
|
customerWalletId: [
|
|
- { required: true, message: "请选择经销商钱包", trigger: "blur" },
|
|
|
|
- ],
|
|
|
|
- oneParentId: [
|
|
|
|
- { required: true, message: "请选择一级区域", trigger: "blur" },
|
|
|
|
|
|
+ { required: true, message: "请选择经销商钱包", trigger: "change" },
|
|
],
|
|
],
|
|
|
|
+ region: [{ required: true, message: "请选择区域", trigger: "change" }],
|
|
|
|
+ // oneParentId: [
|
|
|
|
+ // { required: true, message: "请选择一级区域", trigger: "blur" },
|
|
|
|
+ // ],
|
|
// twoParentId: [
|
|
// twoParentId: [
|
|
// { required: true, message: "请选择二级区域", trigger: "blur" },
|
|
// { required: true, message: "请选择二级区域", trigger: "blur" },
|
|
// ],
|
|
// ],
|
|
@@ -374,7 +410,7 @@ export default {
|
|
// { required: true, message: "请选择三级区域", trigger: "blur" },
|
|
// { required: true, message: "请选择三级区域", trigger: "blur" },
|
|
// ],
|
|
// ],
|
|
serviceId: [
|
|
serviceId: [
|
|
- { required: true, message: "请选择业务员", trigger: "blur" },
|
|
|
|
|
|
+ { required: true, message: "请选择业务员", trigger: "change" },
|
|
],
|
|
],
|
|
},
|
|
},
|
|
|
|
|
|
@@ -390,16 +426,17 @@ export default {
|
|
dealerList: [],
|
|
dealerList: [],
|
|
// selectList: [],
|
|
// selectList: [],
|
|
walletList: [], //产品大类列表
|
|
walletList: [], //产品大类列表
|
|
- oneList: [], //一级区域数据
|
|
|
|
- twoList: [], //二级区域数据
|
|
|
|
- threeList: [], //三级区域数据
|
|
|
|
|
|
+ // oneList: [], //一级区域数据
|
|
|
|
+ // twoList: [], //二级区域数据
|
|
|
|
+ // threeList: [], //三级区域数据
|
|
userList: [], //业务员
|
|
userList: [], //业务员
|
|
ids: [],
|
|
ids: [],
|
|
rowID: null, //编辑ID
|
|
rowID: null, //编辑ID
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
- this.getAdminWebsit(1);
|
|
|
|
|
|
+ this.getTree();
|
|
|
|
+ // this.getAdminWebsit(1);
|
|
this.getList({ pageNum: 1, pageSize: 10 });
|
|
this.getList({ pageNum: 1, pageSize: 10 });
|
|
this.getDealerDataList({ pageNum: 1, pageSize: -1 });
|
|
this.getDealerDataList({ pageNum: 1, pageSize: -1 });
|
|
this.getUserList(1);
|
|
this.getUserList(1);
|
|
@@ -407,11 +444,16 @@ export default {
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
watch: {
|
|
watch: {
|
|
|
|
+ "addForm.region": function (newValue) {
|
|
|
|
+ // console.log(newValue, 888);
|
|
|
|
+ if (newValue) {
|
|
|
|
+ this.getUserList(newValue[newValue.length - 1]);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
"addForm.customerId": async function (newValue) {
|
|
"addForm.customerId": async function (newValue) {
|
|
if (newValue) {
|
|
if (newValue) {
|
|
// this.addForm.customerWalletId = "";
|
|
// this.addForm.customerWalletId = "";
|
|
const res = this.dealerList.filter((i) => i.id == newValue);
|
|
const res = this.dealerList.filter((i) => i.id == newValue);
|
|
-
|
|
|
|
this.addForm.customerName = res[0].name;
|
|
this.addForm.customerName = res[0].name;
|
|
this.addForm.customerNumber = res[0].number;
|
|
this.addForm.customerNumber = res[0].number;
|
|
let res2 = await getWalletCustomerList({
|
|
let res2 = await getWalletCustomerList({
|
|
@@ -421,30 +463,30 @@ export default {
|
|
this.walletList = res2.data;
|
|
this.walletList = res2.data;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- "addForm.oneParentId": async function (newValue) {
|
|
|
|
- if (newValue) {
|
|
|
|
- let res = await getAdminWebsitByparent({
|
|
|
|
- parentId: newValue,
|
|
|
|
- // mainId: this.mainId,
|
|
|
|
- });
|
|
|
|
- this.twoList = res.data;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "addForm.twoParentId": async function (newValue) {
|
|
|
|
- if (newValue) {
|
|
|
|
- let res = await getAdminWebsitByparent({
|
|
|
|
- parentId: newValue,
|
|
|
|
- // mainId: this.mainId,
|
|
|
|
- });
|
|
|
|
- this.getUserList(newValue);
|
|
|
|
- this.threeList = res.data;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- "addForm.threeParentId": async function (newValue) {
|
|
|
|
- if (newValue) {
|
|
|
|
- this.getUserList(newValue);
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
|
|
+ // "addForm.oneParentId": async function (newValue) {
|
|
|
|
+ // if (newValue) {
|
|
|
|
+ // let res = await getAdminWebsitByparent({
|
|
|
|
+ // parentId: newValue,
|
|
|
|
+ // // mainId: this.mainId,
|
|
|
|
+ // });
|
|
|
|
+ // this.twoList = res.data;
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ // "addForm.twoParentId": async function (newValue) {
|
|
|
|
+ // if (newValue) {
|
|
|
|
+ // let res = await getAdminWebsitByparent({
|
|
|
|
+ // parentId: newValue,
|
|
|
|
+ // // mainId: this.mainId,
|
|
|
|
+ // });
|
|
|
|
+ // this.getUserList(newValue);
|
|
|
|
+ // this.threeList = res.data;
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ // "addForm.threeParentId": async function (newValue) {
|
|
|
|
+ // if (newValue) {
|
|
|
|
+ // this.getUserList(newValue);
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 导入
|
|
// 导入
|
|
@@ -484,28 +526,34 @@ export default {
|
|
async changeFn(v) {
|
|
async changeFn(v) {
|
|
this.addForm.customerWalletId = "";
|
|
this.addForm.customerWalletId = "";
|
|
},
|
|
},
|
|
- async changeOneFn(v) {
|
|
|
|
- this.addForm.twoParentId = "";
|
|
|
|
- this.addForm.threeParentId = "";
|
|
|
|
- this.addForm.serviceId = "";
|
|
|
|
- },
|
|
|
|
- async changeTwoFn(v) {
|
|
|
|
- this.addForm.threeParentId = "";
|
|
|
|
- this.addForm.serviceId = "";
|
|
|
|
- },
|
|
|
|
- async changeThreeFn(v) {
|
|
|
|
- this.addForm.serviceId = "";
|
|
|
|
- },
|
|
|
|
|
|
+ // async changeOneFn(v) {
|
|
|
|
+ // this.addForm.twoParentId = "";
|
|
|
|
+ // this.addForm.threeParentId = "";
|
|
|
|
+ // this.addForm.serviceId = "";
|
|
|
|
+ // },
|
|
|
|
+ // async changeTwoFn(v) {
|
|
|
|
+ // this.addForm.threeParentId = "";
|
|
|
|
+ // this.addForm.serviceId = "";
|
|
|
|
+ // },
|
|
|
|
+ // async changeThreeFn(v) {
|
|
|
|
+ // this.addForm.serviceId = "";
|
|
|
|
+ // },
|
|
async editFn(id) {
|
|
async editFn(id) {
|
|
this.title = "经销商业务关系管理 ";
|
|
this.title = "经销商业务关系管理 ";
|
|
this.rowID = id;
|
|
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.customerWalletId = res.data.customerWalletId;
|
|
this.addForm.customerWalletId = res.data.customerWalletId;
|
|
- this.addForm.oneParentId = res.data.adminWebsitId1;
|
|
|
|
- this.addForm.twoParentId = res.data.adminWebsitId2;
|
|
|
|
- this.addForm.threeParentId = res.data.adminWebsitId3;
|
|
|
|
|
|
+ // this.addForm.oneParentId = res.data.adminWebsitId1;
|
|
|
|
+ // this.addForm.twoParentId = res.data.adminWebsitId2;
|
|
|
|
+ // this.addForm.threeParentId = res.data.adminWebsitId3;
|
|
|
|
+ this.addForm.region = [
|
|
|
|
+ res.data.adminWebsitId1,
|
|
|
|
+ res.data.adminWebsitId2,
|
|
|
|
+ res.data.adminWebsitId3,
|
|
|
|
+ ];
|
|
this.addForm.serviceId = res.data.serviceId;
|
|
this.addForm.serviceId = res.data.serviceId;
|
|
|
|
|
|
this.dialogForm = true;
|
|
this.dialogForm = true;
|
|
@@ -518,16 +566,36 @@ export default {
|
|
isCustomer: 0,
|
|
isCustomer: 0,
|
|
adminWebsitId: v,
|
|
adminWebsitId: v,
|
|
});
|
|
});
|
|
|
|
+ if (res.data.records.length == 0) {
|
|
|
|
+ this.addForm.serviceId = "";
|
|
|
|
+ }
|
|
this.userList = res.data.records;
|
|
this.userList = res.data.records;
|
|
},
|
|
},
|
|
- //根据父级查询部门
|
|
|
|
- async getAdminWebsit(data) {
|
|
|
|
- let res = await getAdminWebsitByparent({
|
|
|
|
- parentId: data,
|
|
|
|
- // mainId: this.mainId,
|
|
|
|
|
|
+ // 获取部门列表
|
|
|
|
+ getTree() {
|
|
|
|
+ getDepartmentList().then((res) => {
|
|
|
|
+ // console.log(res, 8888);
|
|
|
|
+
|
|
|
|
+ this.options = res.data[0].children;
|
|
});
|
|
});
|
|
- this.oneList = res.data;
|
|
|
|
},
|
|
},
|
|
|
|
+ // //根据父级查询部门
|
|
|
|
+ // async getAdminWebsit(data) {
|
|
|
|
+ // let res = await getAdminWebsitByparent({
|
|
|
|
+ // parentId: data,
|
|
|
|
+ // // mainId: this.mainId,
|
|
|
|
+ // });
|
|
|
|
+ // let arr = res.data.map((v) => {
|
|
|
|
+ // return {
|
|
|
|
+ // value: v.adminWebsitId,
|
|
|
|
+ // label: v.name,
|
|
|
|
+ // };
|
|
|
|
+ // });
|
|
|
|
+
|
|
|
|
+ // // this.options = arr;
|
|
|
|
+
|
|
|
|
+ // this.oneList = res.data;
|
|
|
|
+ // },
|
|
// //获取产品品类数据
|
|
// //获取产品品类数据
|
|
// async getCategoryList() {
|
|
// async getCategoryList() {
|
|
// let res = await getProductCategoryList();
|
|
// let res = await getProductCategoryList();
|
|
@@ -566,7 +634,7 @@ export default {
|
|
this.$message.success("删除成功");
|
|
this.$message.success("删除成功");
|
|
this.ids = [];
|
|
this.ids = [];
|
|
},
|
|
},
|
|
- addFn() {
|
|
|
|
|
|
+ async addFn() {
|
|
this.title = "经销商业务关系管理";
|
|
this.title = "经销商业务关系管理";
|
|
|
|
|
|
this.dialogForm = true;
|
|
this.dialogForm = true;
|
|
@@ -580,8 +648,8 @@ export default {
|
|
let data3 = this.userList.filter((v) => {
|
|
let data3 = this.userList.filter((v) => {
|
|
return v.adminUserId == this.addForm.serviceId;
|
|
return v.adminUserId == this.addForm.serviceId;
|
|
});
|
|
});
|
|
- console.log(data3);
|
|
|
|
- console.log(data2, 22222);
|
|
|
|
|
|
+ // console.log(data3);
|
|
|
|
+ // console.log(data2, 22222);
|
|
|
|
|
|
let value = {
|
|
let value = {
|
|
customerId: this.addForm.customerId,
|
|
customerId: this.addForm.customerId,
|
|
@@ -602,33 +670,52 @@ export default {
|
|
await getDealerStockAdd(value);
|
|
await getDealerStockAdd(value);
|
|
this.$message.success("添加成功");
|
|
this.$message.success("添加成功");
|
|
}
|
|
}
|
|
|
|
+ if (this.$refs.locationCascader) {
|
|
|
|
+ this.$refs.locationCascader.$refs.panel.activePath = [];
|
|
|
|
+ this.$refs.locationCascader.$refs.panel.calculateCheckedNodePaths();
|
|
|
|
+ }
|
|
this.addForm.customerId = "";
|
|
this.addForm.customerId = "";
|
|
this.addForm.customerNumber = "";
|
|
this.addForm.customerNumber = "";
|
|
this.addForm.customerName = "";
|
|
this.addForm.customerName = "";
|
|
this.addForm.customerWalletId = "";
|
|
this.addForm.customerWalletId = "";
|
|
- this.addForm.oneParentId = "";
|
|
|
|
- this.addForm.twoParentId = "";
|
|
|
|
- this.addForm.threeParentId = "";
|
|
|
|
|
|
+ this.addForm.region = [];
|
|
|
|
+ // this.addForm.oneParentId = "";
|
|
|
|
+ // this.addForm.twoParentId = "";
|
|
|
|
+ // this.addForm.threeParentId = "";
|
|
this.addForm.serviceId = "";
|
|
this.addForm.serviceId = "";
|
|
- this.userList = [];
|
|
|
|
- this.twoList = [];
|
|
|
|
- this.threeList = [];
|
|
|
|
|
|
+ // this.userList = [];
|
|
|
|
+ // this.twoList = [];
|
|
|
|
+ // this.threeList = [];
|
|
|
|
+ this.walletList = [];
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs["addForm"].clearValidate();
|
|
|
|
+ });
|
|
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.clearValidate();
|
|
|
|
|
|
+ if (this.$refs.locationCascader) {
|
|
|
|
+ this.$refs.locationCascader.$refs.panel.activePath = [];
|
|
|
|
+ this.$refs.locationCascader.$refs.panel.calculateCheckedNodePaths();
|
|
|
|
+ }
|
|
|
|
+
|
|
this.addForm.customerId = "";
|
|
this.addForm.customerId = "";
|
|
this.addForm.customerNumber = "";
|
|
this.addForm.customerNumber = "";
|
|
this.addForm.customerWalletId = "";
|
|
this.addForm.customerWalletId = "";
|
|
- this.addForm.oneParentId = "";
|
|
|
|
- this.addForm.twoParentId = "";
|
|
|
|
- this.addForm.threeParentId = "";
|
|
|
|
|
|
+ this.addForm.region = [];
|
|
|
|
+ // this.addForm.oneParentId = "";
|
|
|
|
+ // this.addForm.twoParentId = "";
|
|
|
|
+ // this.addForm.threeParentId = "";
|
|
this.addForm.serviceId = "";
|
|
this.addForm.serviceId = "";
|
|
- this.userList = [];
|
|
|
|
- this.twoList = [];
|
|
|
|
- this.threeList = [];
|
|
|
|
|
|
+ // this.userList = [];
|
|
|
|
+ // this.twoList = [];
|
|
|
|
+ // this.threeList = [];
|
|
|
|
+ this.walletList = [];
|
|
|
|
+
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs["addForm"].clearValidate();
|
|
|
|
+ });
|
|
this.dialogForm = false;
|
|
this.dialogForm = false;
|
|
},
|
|
},
|
|
//获取经销商数据
|
|
//获取经销商数据
|