|
@@ -10,11 +10,13 @@
|
|
accordion
|
|
accordion
|
|
>
|
|
>
|
|
<el-collapse-item
|
|
<el-collapse-item
|
|
- :title="ele.labelName"
|
|
|
|
:name="ele.id"
|
|
:name="ele.id"
|
|
- v-for="ele in labelList.labelArr"
|
|
|
|
|
|
+ v-for="(ele, index) in labelList.labelArr"
|
|
:key="ele.id"
|
|
:key="ele.id"
|
|
>
|
|
>
|
|
|
|
+ <template slot="title">
|
|
|
|
+ 标签{{index + 1}} <i class="header-icon el-icon-info"></i> <b>{{ ele.labelName}}</b>
|
|
|
|
+ </template>
|
|
<el-transfer
|
|
<el-transfer
|
|
v-model="customerLabelList"
|
|
v-model="customerLabelList"
|
|
:props="{
|
|
:props="{
|
|
@@ -26,8 +28,30 @@
|
|
filterable
|
|
filterable
|
|
:titles="['未加入', '已加入']"
|
|
:titles="['未加入', '已加入']"
|
|
>
|
|
>
|
|
- <div class="transfer-footer" slot="left-footer" style='text-align:center' v-show="!loading">数据拉取完成,可点击操作</div>
|
|
|
|
- <div class="transfer-footer" slot="right-footer" style='text-align:center' >数据拉取中,请稍后...</div>
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="transfer-footer"
|
|
|
|
+ slot="left-footer"
|
|
|
|
+ style="text-align: center"
|
|
|
|
+ v-show="!loading"
|
|
|
|
+ >
|
|
|
|
+ 数据拉取完成,可点击操作
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ class="transfer-footer"
|
|
|
|
+ slot="right-footer"
|
|
|
|
+ style="text-align: center"
|
|
|
|
+ v-show="loading"
|
|
|
|
+ >
|
|
|
|
+ 数据拉取中,请稍后...
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ class="transfer-footer"
|
|
|
|
+ slot="right-footer"
|
|
|
|
+ style="text-align: center"
|
|
|
|
+ v-show="error"
|
|
|
|
+ >
|
|
|
|
+ 数据失败,请刷新重试
|
|
|
|
+ </div>
|
|
</el-transfer>
|
|
</el-transfer>
|
|
</el-collapse-item>
|
|
</el-collapse-item>
|
|
</el-collapse>
|
|
</el-collapse>
|
|
@@ -44,39 +68,44 @@ import {
|
|
deleteLabelRuleDetail,
|
|
deleteLabelRuleDetail,
|
|
addDetail,
|
|
addDetail,
|
|
selectCustomerLabelInfo,
|
|
selectCustomerLabelInfo,
|
|
|
|
+ addAndDelCustomerLabel,
|
|
|
|
+ selectPhoneList,
|
|
} from "@/api/label/label";
|
|
} from "@/api/label/label";
|
|
export default {
|
|
export default {
|
|
name: "Label_SetLabel",
|
|
name: "Label_SetLabel",
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- value4: [15],
|
|
|
|
- activeNames: ["1"],
|
|
|
|
|
|
+ activeNames: undefined,
|
|
labelList: {},
|
|
labelList: {},
|
|
notCustomerLabelList: [],
|
|
notCustomerLabelList: [],
|
|
customerLabelList: [],
|
|
customerLabelList: [],
|
|
- loading : false
|
|
|
|
|
|
+ loading: false,
|
|
|
|
+ error: false,
|
|
|
|
+ currentLabelId: undefined,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- notCustomerLabelListCom(){
|
|
|
|
- return (this.notCustomerLabelList||[]).map((ele)=>{
|
|
|
|
- ele.label = ele.phone + '_' + ele.customerName
|
|
|
|
- return ele
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ notCustomerLabelListCom() {
|
|
|
|
+ return (this.notCustomerLabelList || []).map((ele) => {
|
|
|
|
+ ele.label = ele.phone + "_" + ele.customerName;
|
|
|
|
+ return ele;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.init();
|
|
this.init();
|
|
- setTimeout(()=>{
|
|
|
|
|
|
+ setTimeout(() => {
|
|
console.log(this.notCustomerLabelListCom);
|
|
console.log(this.notCustomerLabelListCom);
|
|
- },1000)
|
|
|
|
|
|
+ }, 1000);
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
init() {
|
|
init() {
|
|
this.getList();
|
|
this.getList();
|
|
|
|
+ console.log(this.getRightUser.bind(this));
|
|
},
|
|
},
|
|
|
|
+
|
|
handleChange(val) {
|
|
handleChange(val) {
|
|
- this.getLabelUser(val)
|
|
|
|
|
|
+ this.getLabelUser(val);
|
|
},
|
|
},
|
|
getLabelUser(id) {
|
|
getLabelUser(id) {
|
|
selectCustomerLabelInfo({
|
|
selectCustomerLabelInfo({
|
|
@@ -90,6 +119,28 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ getRightUser() {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ selectPhoneList({
|
|
|
|
+ labelId: this.activeNames,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.customerLabelList = res.rows;
|
|
|
|
+ this.loading = false;
|
|
|
|
+ } else {
|
|
|
|
+ this.customerLabelList = [];
|
|
|
|
+ throw new Error("");
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.loading = false;
|
|
|
|
+ this.error = true;
|
|
|
|
+ this.customerLabelList = [];
|
|
|
|
+ this.notCustomerLabelList = [];
|
|
|
|
+ this.msgError("拉取数据失败,请刷新重试");
|
|
|
|
+ });
|
|
|
|
+ },
|
|
getList() {
|
|
getList() {
|
|
return sysDeptDemoList().then((res) => {
|
|
return sysDeptDemoList().then((res) => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
@@ -100,29 +151,44 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- transfer(e1, e2, e3) {
|
|
|
|
- console.log(e1, e2, e3);
|
|
|
|
- this.value4 = [];
|
|
|
|
-
|
|
|
|
|
|
+ transfer(originlArr, direction, changeArr) {
|
|
|
|
+ const query = {
|
|
|
|
+ labelId: this.activeNames,
|
|
|
|
+ flag: "1",
|
|
|
|
+ phoneList: changeArr,
|
|
|
|
+ };
|
|
|
|
+ if (direction == "right") {
|
|
|
|
+ query.flag = "0";
|
|
|
|
+ } else if (direction == "left") {
|
|
|
|
+ query.flag = "1";
|
|
|
|
+ }
|
|
|
|
+ addAndDelCustomerLabel(query).then((res) => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.getRightUser();
|
|
|
|
+ } else {
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
+
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
.collapse {
|
|
.collapse {
|
|
width: 800px;
|
|
width: 800px;
|
|
margin: 0 auto;
|
|
margin: 0 auto;
|
|
|
|
+
|
|
.el-collapse-item__wrap {
|
|
.el-collapse-item__wrap {
|
|
// border-bottom: 1px solid;
|
|
// border-bottom: 1px solid;
|
|
}
|
|
}
|
|
-
|
|
|
|
- .el-transfer-panel{
|
|
|
|
- width: 300px;
|
|
|
|
- height: 600px;
|
|
|
|
|
|
+
|
|
|
|
+ .el-transfer-panel {
|
|
|
|
+ width: 300px;
|
|
|
|
+ height: 600px;
|
|
}
|
|
}
|
|
- .el-transfer-panel__list.is-filterable{
|
|
|
|
- height: 465px;
|
|
|
|
|
|
+
|
|
|
|
+ .el-transfer-panel__list.is-filterable {
|
|
|
|
+ height: 465px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-</style>
|
|
|
|
|
|
+</style>
|