|
@@ -1,6 +1,29 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
-
|
|
|
+ <div class="alert alert-primary" role="alert">
|
|
|
+ A simple primary alert—check it out!
|
|
|
+ </div>
|
|
|
+ <div class="alert alert-secondary" role="alert">
|
|
|
+ A simple secondary alert—check it out!
|
|
|
+ </div>
|
|
|
+ <div class="alert alert-success" role="alert">
|
|
|
+ A simple success alert—check it out!
|
|
|
+ </div>
|
|
|
+ <div class="alert alert-danger" role="alert">
|
|
|
+ A simple danger alert—check it out!
|
|
|
+ </div>
|
|
|
+ <div class="alert alert-warning" role="alert">
|
|
|
+ A simple warning alert—check it out!
|
|
|
+ </div>
|
|
|
+ <div class="alert alert-info" role="alert">
|
|
|
+ A simple info alert—check it out!
|
|
|
+ </div>
|
|
|
+ <div class="alert alert-light" role="alert">
|
|
|
+ A simple light alert—check it out!
|
|
|
+ </div>
|
|
|
+ <div class="alert alert-dark" role="alert">
|
|
|
+ A simple dark alert—check it out!
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -27,21 +50,21 @@ export default {
|
|
|
timer: null,
|
|
|
leftData: [],
|
|
|
rightData: [],
|
|
|
- leftTotal:100,
|
|
|
- rightTotal:100,
|
|
|
+ leftTotal: 100,
|
|
|
+ rightTotal: 100,
|
|
|
leftQuery: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- labelId:null,
|
|
|
+ labelId: null,
|
|
|
customerName: null,
|
|
|
- phone:null
|
|
|
+ phone: null,
|
|
|
},
|
|
|
rightQuery: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- labelId:null,
|
|
|
+ labelId: null,
|
|
|
customerName: null,
|
|
|
- phone:null
|
|
|
+ phone: null,
|
|
|
},
|
|
|
};
|
|
|
},
|
|
@@ -49,13 +72,13 @@ export default {
|
|
|
this.init();
|
|
|
},
|
|
|
methods: {
|
|
|
- getLeftData(){
|
|
|
+ getLeftData() {
|
|
|
// this.leftData = [];
|
|
|
selectNotCustomerLabelInfo(this.leftQuery)
|
|
|
.then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.leftData = res.rows;
|
|
|
- this.leftTotal = res.total
|
|
|
+ this.leftTotal = res.total;
|
|
|
} else {
|
|
|
throw new Error("");
|
|
|
}
|
|
@@ -65,9 +88,8 @@ export default {
|
|
|
this.leftTotal = 0;
|
|
|
this.msgError("拉取左边标签用户失败,请刷新~");
|
|
|
});
|
|
|
-
|
|
|
},
|
|
|
- getRightData(){
|
|
|
+ getRightData() {
|
|
|
// this.rightData = [];
|
|
|
selectPhoneList(this.rightQuery)
|
|
|
.then((res) => {
|
|
@@ -83,17 +105,20 @@ export default {
|
|
|
this.rightTotal = 0;
|
|
|
this.msgError("拉取右边标签用户失败,请刷新~");
|
|
|
});
|
|
|
-
|
|
|
},
|
|
|
- handleMoveLabel(direction = 'right', type = 1, row, labelIdArr){ // type 1 传row type 2 idArr direction right 向右转移 left 向左转移
|
|
|
- const changeArr = []
|
|
|
- if(type == 1){
|
|
|
- changeArr.push(row.phone)
|
|
|
- }else if(type == 2){
|
|
|
- changeArr = labelIdArr
|
|
|
- }
|
|
|
+ handleMoveLabel(direction = "right", type = 1, row, labelIdArr) {
|
|
|
+ // type 1 传row type 2 idArr direction right 向右转移 left 向左转移
|
|
|
+ const changeArr = [];
|
|
|
+ if (type == 1) {
|
|
|
+ changeArr.push(row.phone);
|
|
|
+ } else if (type == 2) {
|
|
|
+ changeArr = labelIdArr;
|
|
|
+ }
|
|
|
const query = {
|
|
|
- labelId: direction == 'right' ? this.leftQuery.labelId : this.rightQuery.labelId,
|
|
|
+ labelId:
|
|
|
+ direction == "right"
|
|
|
+ ? this.leftQuery.labelId
|
|
|
+ : this.rightQuery.labelId,
|
|
|
flag: "1",
|
|
|
phoneList: changeArr,
|
|
|
};
|
|
@@ -102,36 +127,35 @@ export default {
|
|
|
} else if (direction == "left") {
|
|
|
query.flag = "1";
|
|
|
}
|
|
|
- addAndDelCustomerLabel(query).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.getLeftData();
|
|
|
- this.getRightData();
|
|
|
- } else {
|
|
|
- throw new Error("");
|
|
|
- }
|
|
|
- }).catch((err)=>{
|
|
|
-
|
|
|
- });
|
|
|
-
|
|
|
+ addAndDelCustomerLabel(query)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.getLeftData();
|
|
|
+ this.getRightData();
|
|
|
+ } else {
|
|
|
+ throw new Error("");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {});
|
|
|
},
|
|
|
- clearLeftQuery(labelId = this.leftQuery.labelId){
|
|
|
- this.leftQuery = {
|
|
|
+ clearLeftQuery(labelId = this.leftQuery.labelId) {
|
|
|
+ this.leftQuery = {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
labelId,
|
|
|
customerName: null,
|
|
|
- phone:null
|
|
|
- }
|
|
|
+ phone: null,
|
|
|
+ };
|
|
|
},
|
|
|
- clearRightQuery(labelId = this.rightQuery.labelId){
|
|
|
+ clearRightQuery(labelId = this.rightQuery.labelId) {
|
|
|
console.log(this.rightQuery);
|
|
|
- this.rightQuery = {
|
|
|
+ this.rightQuery = {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
labelId,
|
|
|
customerName: null,
|
|
|
- phone:null
|
|
|
- }
|
|
|
+ phone: null,
|
|
|
+ };
|
|
|
},
|
|
|
handleSelectionChange(val) {
|
|
|
let changeArr = [];
|
|
@@ -173,8 +197,8 @@ export default {
|
|
|
// this.msgError("拉取标签下用户信息失败");
|
|
|
// });
|
|
|
// },
|
|
|
- toggleLabel(){
|
|
|
- console.log('hahaha');
|
|
|
+ toggleLabel() {
|
|
|
+ console.log("hahaha");
|
|
|
},
|
|
|
|
|
|
getLabelList() {
|
|
@@ -188,7 +212,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
// transfer(originlArr, direction, changeArr) {
|
|
|
-
|
|
|
+
|
|
|
// const query = {
|
|
|
// labelId: this.activeNames,
|
|
|
// flag: "1",
|