|
@@ -18,24 +18,8 @@
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :xs="24" :sm="12" :lg="6">
|
|
|
|
- <el-form-item label="存货分类编码" prop="bianMa">
|
|
|
|
- <el-input
|
|
|
|
- v-model="searchForm.mainId"
|
|
|
|
- placeholder="请输入"
|
|
|
|
- ></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="6">
|
|
|
|
- <el-form-item label="存货分类" prop="mainName">
|
|
|
|
- <el-input
|
|
|
|
- v-model="searchForm.mainName"
|
|
|
|
- placeholder="请输入"
|
|
|
|
- ></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="6">
|
|
|
|
|
|
+ <el-col :xs="24" :sm="12" :lg="18">
|
|
<el-form-item label="" class="fr">
|
|
<el-form-item label="" class="fr">
|
|
<el-button size="small" @click="clearFn">清空</el-button>
|
|
<el-button size="small" @click="clearFn">清空</el-button>
|
|
<el-button size="small" type="primary" @click="searchFn"
|
|
<el-button size="small" type="primary" @click="searchFn"
|
|
@@ -87,6 +71,13 @@
|
|
></el-table-column>
|
|
></el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
align="center"
|
|
align="center"
|
|
|
|
+ label="经销商编码"
|
|
|
|
+ prop="customerNumber"
|
|
|
|
+ min-width="160"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ align="center"
|
|
label="经销商名称"
|
|
label="经销商名称"
|
|
prop="customerName"
|
|
prop="customerName"
|
|
min-width="160"
|
|
min-width="160"
|
|
@@ -94,15 +85,15 @@
|
|
></el-table-column>
|
|
></el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
align="center"
|
|
align="center"
|
|
- label="存货分类编码"
|
|
|
|
- prop="mainId"
|
|
|
|
|
|
+ label="产品大类(钱包)"
|
|
|
|
+ prop="mainName"
|
|
min-width="160"
|
|
min-width="160"
|
|
show-overflow-tooltip
|
|
show-overflow-tooltip
|
|
></el-table-column>
|
|
></el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
align="center"
|
|
align="center"
|
|
- label="存货分类名称"
|
|
|
|
- prop="mainName"
|
|
|
|
|
|
+ label="业务员"
|
|
|
|
+ prop="serviceName"
|
|
min-width="160"
|
|
min-width="160"
|
|
show-overflow-tooltip
|
|
show-overflow-tooltip
|
|
></el-table-column>
|
|
></el-table-column>
|
|
@@ -142,6 +133,12 @@
|
|
show-overflow-tooltip
|
|
show-overflow-tooltip
|
|
>
|
|
>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
|
+ <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="这是一段内容确定删除吗?"
|
|
@@ -171,7 +168,7 @@
|
|
|
|
|
|
<!-- 弹窗 -->
|
|
<!-- 弹窗 -->
|
|
<el-dialog
|
|
<el-dialog
|
|
- title="编辑"
|
|
|
|
|
|
+ :title="title"
|
|
:visible.sync="dialogForm"
|
|
:visible.sync="dialogForm"
|
|
width="30%"
|
|
width="30%"
|
|
:show-close="false"
|
|
:show-close="false"
|
|
@@ -199,17 +196,77 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="存货分类" prop="mainId">
|
|
|
|
|
|
+ <el-form-item label="产品大类" prop="mainId">
|
|
<el-select
|
|
<el-select
|
|
class="selectStyle"
|
|
class="selectStyle"
|
|
v-model="addForm.mainId"
|
|
v-model="addForm.mainId"
|
|
|
|
+ placeholder="名称"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in categoryList"
|
|
|
|
+ :key="item.productCategoryId"
|
|
|
|
+ :label="item.productCategoryName"
|
|
|
|
+ :value="item.productCategoryId"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="一级区域" prop="oneParentId">
|
|
|
|
+ <el-select
|
|
|
|
+ class="selectStyle"
|
|
|
|
+ v-model="addForm.oneParentId"
|
|
|
|
+ placeholder="名称"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in oneList"
|
|
|
|
+ :key="item.adminWebsitId"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.adminWebsitId"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="二级区域" prop="twoParentId">
|
|
|
|
+ <el-select
|
|
|
|
+ class="selectStyle"
|
|
|
|
+ v-model="addForm.twoParentId"
|
|
|
|
+ placeholder="名称"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in twoList"
|
|
|
|
+ :key="item.adminWebsitId"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.adminWebsitId"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="三级区域" prop="threeParentId"
|
|
|
|
+ ><el-select
|
|
|
|
+ class="selectStyle"
|
|
|
|
+ v-model="addForm.threeParentId"
|
|
|
|
+ placeholder="名称"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in threeList"
|
|
|
|
+ :key="item.adminWebsitId"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.adminWebsitId"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="对应业务员" prop="serviceId">
|
|
|
|
+ <el-select
|
|
|
|
+ class="selectStyle"
|
|
|
|
+ v-model="addForm.serviceId"
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
>
|
|
>
|
|
<el-option
|
|
<el-option
|
|
- v-for="item in selectList"
|
|
|
|
- :key="item.value"
|
|
|
|
- :label="item.dictValue"
|
|
|
|
- :value="item.sysDictId"
|
|
|
|
|
|
+ v-for="(item, i) in userList"
|
|
|
|
+ :key="i"
|
|
|
|
+ :label="item.nickName"
|
|
|
|
+ :value="item.adminUserId"
|
|
>
|
|
>
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
@@ -229,28 +286,35 @@ import {
|
|
getDealerStockAdd,
|
|
getDealerStockAdd,
|
|
deleDealerStockList,
|
|
deleDealerStockList,
|
|
getDictionaries,
|
|
getDictionaries,
|
|
|
|
+ getProductCategoryList,
|
|
|
|
+ getAdminWebsitByparent,
|
|
|
|
+ getAdminUserList,
|
|
|
|
+ getCustomerPtDetail,
|
|
|
|
+ getCustomerPtUpdate,
|
|
} from "@/api/basic_data/dealer";
|
|
} from "@/api/basic_data/dealer";
|
|
import { getDealerList } from "@/api/basic_data/dealer";
|
|
import { getDealerList } from "@/api/basic_data/dealer";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ title: "",
|
|
dialogForm: false,
|
|
dialogForm: false,
|
|
addForm: {
|
|
addForm: {
|
|
- customerName: "",
|
|
|
|
customerId: "",
|
|
customerId: "",
|
|
- customerNumber: "",
|
|
|
|
|
|
+ oneParentId: "",
|
|
|
|
+ twoParentId: "",
|
|
|
|
+ threeParentId: "",
|
|
|
|
+ serviceId: "",
|
|
mainId: "",
|
|
mainId: "",
|
|
- mainName: "",
|
|
|
|
- },
|
|
|
|
- rules: {
|
|
|
|
- mainId: [
|
|
|
|
- { required: true, message: "请选择存货分类", trigger: "change" },
|
|
|
|
- ],
|
|
|
|
- customerId: [
|
|
|
|
- { required: true, message: "请选择经销商", trigger: "change" },
|
|
|
|
- ],
|
|
|
|
},
|
|
},
|
|
|
|
+ // rules: {
|
|
|
|
+ // mainId: [
|
|
|
|
+ // { required: true, message: "请选择存货分类", trigger: "change" },
|
|
|
|
+ // ],
|
|
|
|
+ // customerId: [
|
|
|
|
+ // { required: true, message: "请选择经销商", trigger: "change" },
|
|
|
|
+ // ],
|
|
|
|
+ // },
|
|
|
|
|
|
currentPage: 1, // 当前页码
|
|
currentPage: 1, // 当前页码
|
|
pageSize: 10, // 每页数量
|
|
pageSize: 10, // 每页数量
|
|
@@ -258,23 +322,83 @@ export default {
|
|
|
|
|
|
searchForm: {
|
|
searchForm: {
|
|
customerName: "",
|
|
customerName: "",
|
|
- mainId: "",
|
|
|
|
- mainName: "",
|
|
|
|
},
|
|
},
|
|
dataList: [], // 列表数据
|
|
dataList: [], // 列表数据
|
|
listLoading: false, // 列表加载loading
|
|
listLoading: false, // 列表加载loading
|
|
dealerList: [],
|
|
dealerList: [],
|
|
selectList: [],
|
|
selectList: [],
|
|
|
|
+ categoryList: [], //产品大类列表
|
|
|
|
+ oneList: [], //一级区域数据
|
|
|
|
+ twoList: [], //二级区域数据
|
|
|
|
+ threeList: [], //三级区域数据
|
|
|
|
+ userList: [], //业务员
|
|
ids: [],
|
|
ids: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
async created() {
|
|
async created() {
|
|
this.getList({ pageNum: 1, pageSize: 10 });
|
|
this.getList({ pageNum: 1, pageSize: 10 });
|
|
- this.getDealerDataList({ pageNum: 1, pageSize: 10 });
|
|
|
|
|
|
+ this.getDealerDataList({ pageNum: -1, pageSize: 10 });
|
|
this.getSelectList({ sysDictEnum: "PRODUCT_TYPE" });
|
|
this.getSelectList({ sysDictEnum: "PRODUCT_TYPE" });
|
|
|
|
+ this.getCategoryList();
|
|
|
|
+ this.getAdminWebsit(1);
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
|
|
+ watch: {
|
|
|
|
+ "addForm.oneParentId": async function (newValue) {
|
|
|
|
+ if (newValue) {
|
|
|
|
+ let res = await getAdminWebsitByparent({ parentId: newValue });
|
|
|
|
+ this.twoList = res.data;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "addForm.twoParentId": async function (newValue) {
|
|
|
|
+ if (newValue) {
|
|
|
|
+ let res = await getAdminWebsitByparent({ parentId: newValue });
|
|
|
|
+ this.threeList = res.data;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ "addForm.threeParentId": async function (newValue) {
|
|
|
|
+ if (newValue) {
|
|
|
|
+ let res = await getAdminUserList({
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ isCustomer: 0,
|
|
|
|
+ adminWebsitId: newValue,
|
|
|
|
+ });
|
|
|
|
+ this.userList = res.data.records;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //编辑
|
|
|
|
+
|
|
|
|
+ async editFn(id) {
|
|
|
|
+ this.title = "编辑";
|
|
|
|
+ let res = await getCustomerPtDetail({ id });
|
|
|
|
+ console.log(res);
|
|
|
|
+ this.addForm.customerId = res.data.customerId;
|
|
|
|
+ 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.serviceId = res.data.serviceId;
|
|
|
|
+
|
|
|
|
+ this.dialogForm = true;
|
|
|
|
+ },
|
|
|
|
+ //获取业务员数据
|
|
|
|
+ async getUserList() {
|
|
|
|
+ // await getAdminUserList({ pageNum: 1 });
|
|
|
|
+ },
|
|
|
|
+ //根据父级查询部门
|
|
|
|
+ async getAdminWebsit(data) {
|
|
|
|
+ let res = await getAdminWebsitByparent({ parentId: data });
|
|
|
|
+ this.oneList = res.data;
|
|
|
|
+ },
|
|
|
|
+ //获取产品品类数据
|
|
|
|
+ async getCategoryList() {
|
|
|
|
+ let res = await getProductCategoryList();
|
|
|
|
+ console.log(res);
|
|
|
|
+ this.categoryList = res.data;
|
|
|
|
+ },
|
|
// 筛选部分数据或者单个
|
|
// 筛选部分数据或者单个
|
|
hanleSelect(selection) {
|
|
hanleSelect(selection) {
|
|
// this.ids = selection.map((k) => {
|
|
// this.ids = selection.map((k) => {
|
|
@@ -293,40 +417,69 @@ export default {
|
|
async deleFn(id) {
|
|
async deleFn(id) {
|
|
this.ids.push(id);
|
|
this.ids.push(id);
|
|
let res = this.ids.toString();
|
|
let res = this.ids.toString();
|
|
-
|
|
|
|
await deleDealerStockList({ ids: res });
|
|
await deleDealerStockList({ ids: res });
|
|
this.getList({ pageNum: 1, pageSize: 10 });
|
|
this.getList({ pageNum: 1, pageSize: 10 });
|
|
this.$message.success("删除成功");
|
|
this.$message.success("删除成功");
|
|
},
|
|
},
|
|
addFn() {
|
|
addFn() {
|
|
|
|
+ this.title = "新增";
|
|
this.dialogForm = true;
|
|
this.dialogForm = true;
|
|
},
|
|
},
|
|
async addDataListFn() {
|
|
async addDataListFn() {
|
|
- await this.$refs.addForm.validate();
|
|
|
|
-
|
|
|
|
|
|
+ // await this.$refs.addForm.validate();
|
|
// let id = this.dealerList.filter((i) => {
|
|
// let id = this.dealerList.filter((i) => {
|
|
// return i.id === this.addForm.customerId;
|
|
// return i.id === this.addForm.customerId;
|
|
// })[0];
|
|
// })[0];
|
|
// console.log(id, "id");
|
|
// console.log(id, "id");
|
|
// let res = findElem(this.dealerList, "id", this.addForm.customerId);
|
|
// let res = findElem(this.dealerList, "id", this.addForm.customerId);
|
|
// console.log(11111, res);
|
|
// 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;
|
|
|
|
|
|
+ // 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 });
|
|
|
|
+
|
|
console.log(this.addForm);
|
|
console.log(this.addForm);
|
|
|
|
+ let data = this.dealerList.filter((v) => {
|
|
|
|
+ return v.id === this.addForm.customerId;
|
|
|
|
+ });
|
|
|
|
|
|
- await getDealerStockAdd({ ...this.addForm });
|
|
|
|
- this.$message.success("添加成功");
|
|
|
|
- await this.$refs.addForm.resetFields();
|
|
|
|
- await this.getList({ pageNum: 1, pageSize: 10 });
|
|
|
|
|
|
+ let data2 = this.categoryList.filter((v) => {
|
|
|
|
+ return v.productCategoryId == this.addForm.mainId;
|
|
|
|
+ });
|
|
|
|
+ let data3 = this.userList.filter((v) => {
|
|
|
|
+ return v.adminUserId == this.addForm.serviceId;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ let value = {
|
|
|
|
+ customerId: this.addForm.customerId,
|
|
|
|
+ customerName: data[0].name,
|
|
|
|
+ customerNumber: data[0].number,
|
|
|
|
+ mainId: this.addForm.mainId,
|
|
|
|
+ mainName: data2[0].productCategoryName,
|
|
|
|
+ serviceId: this.addForm.serviceId,
|
|
|
|
+ serviceName: data3[0].nickName,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ if (this.title == "编辑") {
|
|
|
|
+ await getCustomerPtUpdate(value);
|
|
|
|
+ this.$message.success("编辑成功");
|
|
|
|
+ } else {
|
|
|
|
+ await getDealerStockAdd(value);
|
|
|
|
+ this.$message.success("添加成功");
|
|
|
|
+ }
|
|
|
|
+ this.getList({ pageNum: 1, pageSize: 10 });
|
|
this.dialogForm = false;
|
|
this.dialogForm = false;
|
|
},
|
|
},
|
|
//取消
|
|
//取消
|
|
@@ -339,7 +492,6 @@ export default {
|
|
const res = await getDealerList(data);
|
|
const res = await getDealerList(data);
|
|
this.dealerList = res.data.records;
|
|
this.dealerList = res.data.records;
|
|
},
|
|
},
|
|
-
|
|
|
|
// 更改每页数量
|
|
// 更改每页数量
|
|
handleSizeChange(val) {
|
|
handleSizeChange(val) {
|
|
this.pageSize = val;
|
|
this.pageSize = val;
|