|
|
@@ -38,7 +38,6 @@
|
|
|
class="selectStyle"
|
|
|
v-model="scope"
|
|
|
autocomplete="off"
|
|
|
- @change="scopeChange"
|
|
|
>
|
|
|
<option value="1">共通</option>
|
|
|
<option value="0">部分</option>
|
|
|
@@ -68,11 +67,9 @@
|
|
|
v-model="addByCustomize"
|
|
|
/>
|
|
|
<datalist id="dlrs">
|
|
|
- <option
|
|
|
- v-for="(dlr, index) in dlrList"
|
|
|
- :key="index"
|
|
|
- :value="dlr.dlrCode || dlr.dlrName"
|
|
|
- ></option>
|
|
|
+ <option v-for="(item, index) in dlrList" :key="index" :value="item">
|
|
|
+ {{ item }}
|
|
|
+ </option>
|
|
|
</datalist>
|
|
|
<button @click.prevent="addBySelf">添加</button>
|
|
|
</div>
|
|
|
@@ -83,7 +80,7 @@
|
|
|
<div class="optionBox" v-if="optionFlag">
|
|
|
<ul>
|
|
|
<li v-for="(item, index) in groupList" :key="index">
|
|
|
- <p>{{ item }}</p>
|
|
|
+ <p>{{ item.groupName }}</p>
|
|
|
<img
|
|
|
src="../../img/add.png"
|
|
|
@click="addGroup(index)"
|
|
|
@@ -177,7 +174,6 @@ export default {
|
|
|
localMonth: "",
|
|
|
tableData: [], // 表格显示的数据
|
|
|
AllDlr: [], // 所有进销商数据
|
|
|
- dealerList: [], // 筛选以后的数据
|
|
|
imgFlag: new Array(20).fill(true), // 筛选栏用添加图片还是删除图片
|
|
|
// 文件
|
|
|
};
|
|
|
@@ -212,10 +208,6 @@ export default {
|
|
|
// this.materialTime = this.localMonth.replace('-', '/');
|
|
|
console.log(this.materialTime);
|
|
|
},
|
|
|
- // 进销商范围变化
|
|
|
- scopeChange: function () {
|
|
|
- console.log(this.scope, "1是共通", "0是部分");
|
|
|
- },
|
|
|
// 显示隐藏按小组添加下拉框
|
|
|
showOption() {
|
|
|
this.optionFlag = !this.optionFlag;
|
|
|
@@ -234,13 +226,13 @@ export default {
|
|
|
},
|
|
|
// 点击按区域添加button
|
|
|
addByArea: function () {
|
|
|
+ console.log(this.checkedBoxList);
|
|
|
console.log(JSON.parse(JSON.stringify(this.checkedBoxList)));
|
|
|
},
|
|
|
// 自定义添加
|
|
|
addBySelf: function () {
|
|
|
- console.log(this.addByCustomize);
|
|
|
let data = {
|
|
|
- dlrCode: this.addByCustomize,
|
|
|
+ queryParams: this.addByCustomize,
|
|
|
};
|
|
|
this.getDlrData(data);
|
|
|
this.getAllDlr(data);
|
|
|
@@ -259,10 +251,10 @@ export default {
|
|
|
this.addGroupList = [];
|
|
|
this.addFlag.forEach((item, index) => {
|
|
|
if (!item) {
|
|
|
- this.addGroupList.push(this.groupList[index]);
|
|
|
+ this.addGroupList.push(this.groupList[index]['id']);
|
|
|
}
|
|
|
});
|
|
|
- console.log(JSON.parse(JSON.stringify(this.addGroupList)));
|
|
|
+ console.log(this.addGroupList);
|
|
|
this.optionFlag = false;
|
|
|
},
|
|
|
// 筛选
|
|
|
@@ -317,9 +309,9 @@ export default {
|
|
|
getFileInfo: function (event) {
|
|
|
this.file = event.target.files;
|
|
|
this.fileDes = [];
|
|
|
- this.file.forEach((item) => {
|
|
|
- this.fileDes.push(item.name);
|
|
|
- });
|
|
|
+ this.file.forEach((item) => {
|
|
|
+ this.fileDes.push(item.name);
|
|
|
+ });
|
|
|
},
|
|
|
// 获取当前的月份
|
|
|
getLocalMonth: function () {
|
|
|
@@ -341,6 +333,9 @@ export default {
|
|
|
paramData.append("dataDesc", this.inforDes);
|
|
|
paramData.append("sourceTime", this.materialTime);
|
|
|
paramData.append("dealerScope", this.scope);
|
|
|
+ if (this.scope !== 1) {
|
|
|
+ paramData.append("dealerList", this.AllDlr);
|
|
|
+ }
|
|
|
console.log(paramData.getAll("dataName"));
|
|
|
this.$http
|
|
|
.uploadFile("/firmsUpload", paramData)
|
|
|
@@ -389,16 +384,11 @@ export default {
|
|
|
this.dlrList = [];
|
|
|
this.AllDlr = res.data.data;
|
|
|
let resData = JSON.parse(JSON.stringify(res.data.data));
|
|
|
+ console.log(resData);
|
|
|
resData.forEach((item) => {
|
|
|
// 获取自定义下拉框的值
|
|
|
- if (item.dlrCode || item.dlrName) {
|
|
|
- this.dlrList.push({
|
|
|
- dlrCode: item.dlrCode,
|
|
|
- });
|
|
|
- this.dlrList.push({
|
|
|
- dlrName: item.dlrName,
|
|
|
- });
|
|
|
- }
|
|
|
+ this.dlrList.push(item.dlrName);
|
|
|
+ this.dlrList.push(item.dlrCode);
|
|
|
});
|
|
|
} else {
|
|
|
console.log(res);
|
|
|
@@ -427,6 +417,25 @@ export default {
|
|
|
console.log(err);
|
|
|
});
|
|
|
},
|
|
|
+ // 获取小组接口
|
|
|
+ selectGroupList: function () {
|
|
|
+ this.$http({
|
|
|
+ method: "post",
|
|
|
+ url: "/sys/group/selectGroupList",
|
|
|
+ data: {},
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data && res.data.code === 200) {
|
|
|
+ this.groupList = res.data.data;
|
|
|
+ console.log(this.groupList);
|
|
|
+ } else {
|
|
|
+ console.log(res);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getLocalMonth();
|
|
|
@@ -438,6 +447,7 @@ export default {
|
|
|
this.getDlrData();
|
|
|
// 获取所有的资料名称
|
|
|
this.getAllDataName();
|
|
|
+ this.selectGroupList();
|
|
|
},
|
|
|
};
|
|
|
</script>
|