|
...
|
...
|
@@ -64,8 +64,6 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
bool distribution = false;
|
|
|
|
int page = 1;
|
|
|
|
|
|
|
|
List pageData = [];
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
distribution = widget.distribution;
|
|
...
|
...
|
@@ -95,15 +93,27 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
// item.select = true;
|
|
|
|
// // item.select = false;
|
|
|
|
// }
|
|
|
|
for (FilterBtnModel item in customerProvider.filterHydList) {
|
|
|
|
item.select = false;
|
|
|
|
// if (item.id == '${customerProvider.index}') {
|
|
|
|
// item.select = true;
|
|
|
|
// }
|
|
|
|
// for (FilterBtnModel item in customerProvider.filterHydList) {
|
|
|
|
// item.select = false;
|
|
|
|
// // if (item.id == '${customerProvider.index}') {
|
|
|
|
// // item.select = true;
|
|
|
|
// // }
|
|
|
|
// }
|
|
|
|
int selectNum = 0;
|
|
|
|
customerProvider.filterHydList.forEach((element) {
|
|
|
|
if (element.select) {
|
|
|
|
selectNum++;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
if (selectNum <= 1) {
|
|
|
|
//选中一个或者0个
|
|
|
|
for (FilterBtnModel item in customerProvider.filterHydList) {
|
|
|
|
item.select = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
page = 1;
|
|
|
|
pageData = [];
|
|
|
|
customerProvider.pageData = [];
|
|
|
|
_getContantData(first: true);
|
|
|
|
}
|
|
|
|
});
|
|
...
|
...
|
@@ -128,9 +138,12 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
// }
|
|
|
|
page = 1;
|
|
|
|
|
|
|
|
_getContantData(first: first);
|
|
|
|
// _getSellerGuestManage();
|
|
|
|
// _getContantData(first: first);
|
|
|
|
_filterLabelList();
|
|
|
|
_getSellerGuestManage();
|
|
|
|
_getManagerAndList();
|
|
|
|
|
|
|
|
// _getManagerAndList();
|
|
|
|
});
|
|
|
|
|
|
|
|
bus.on("refresh_guest_list", (arg) {
|
|
...
|
...
|
@@ -139,14 +152,14 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
|
|
|
|
bus.on("onload_guest_list", (arg) {
|
|
|
|
print(arg);
|
|
|
|
if (!pageData.contains(arg)) {
|
|
|
|
pageData.add(arg);
|
|
|
|
pageData.removeWhere((element) => element == 0);
|
|
|
|
if (!customerProvider.pageData.contains(arg)) {
|
|
|
|
customerProvider.pageData.add(arg);
|
|
|
|
customerProvider.pageData.removeWhere((element) => element == 0);
|
|
|
|
_onload();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
bus.on("onrefresh_guest_list", (arg) {
|
|
|
|
if (!pageData.contains(0)) {
|
|
|
|
if (!customerProvider.pageData.contains(0)) {
|
|
|
|
_onrefresh();
|
|
|
|
}
|
|
|
|
});
|
|
...
|
...
|
@@ -160,6 +173,11 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
_getManagerAndList() async {
|
|
|
|
await _getSellerGuestManage();
|
|
|
|
await _getContantData();
|
|
|
|
}
|
|
|
|
|
|
|
|
_onload() {
|
|
|
|
page++;
|
|
|
|
_getContantData(showLoading: false, load: true);
|
|
...
|
...
|
@@ -167,7 +185,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
|
|
|
|
_onrefresh() {
|
|
|
|
page = 1;
|
|
|
|
pageData = [0];
|
|
|
|
customerProvider.pageData = [0];
|
|
|
|
_getContantData(showLoading: false);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -184,6 +202,9 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
// model.id = item.id;
|
|
|
|
model1.title = '未分配经理';
|
|
|
|
model1.select = false;
|
|
|
|
if (distribution) {
|
|
|
|
model1.select = true;
|
|
|
|
}
|
|
|
|
customerProvider.filterManageList.add(model1);
|
|
|
|
if (model != null &&
|
|
|
|
model.sellerUser != null &&
|
|
...
|
...
|
@@ -285,28 +306,28 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
//
|
|
|
|
//
|
|
|
|
// params['uid'] 经理ID
|
|
|
|
if (first && widget.uidStr != null && widget.uidStr != '') {
|
|
|
|
params['uid'] = widget.uidStr;
|
|
|
|
} else {
|
|
|
|
String uid = '';
|
|
|
|
List<FilterBtnModel> tempfilterManage =
|
|
|
|
List.from(customerProvider.filterManageList);
|
|
|
|
if (tempfilterManage.length > 0) {
|
|
|
|
tempfilterManage.removeAt(0);
|
|
|
|
}
|
|
|
|
for (FilterBtnModel item in tempfilterManage) {
|
|
|
|
if (item.select) {
|
|
|
|
uid += '${item.id},';
|
|
|
|
}
|
|
|
|
// if (first && widget.uidStr != null && widget.uidStr != '') {
|
|
|
|
// params['uid'] = widget.uidStr;
|
|
|
|
// } else {
|
|
|
|
String uid = '';
|
|
|
|
List<FilterBtnModel> tempfilterManage =
|
|
|
|
List.from(customerProvider.filterManageList);
|
|
|
|
if (tempfilterManage.length > 0) {
|
|
|
|
tempfilterManage.removeAt(0);
|
|
|
|
}
|
|
|
|
for (FilterBtnModel item in tempfilterManage) {
|
|
|
|
if (item.select) {
|
|
|
|
uid += '${item.id},';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (uid.length > 0) {
|
|
|
|
if (uid.endsWith(',')) {
|
|
|
|
uid = uid.substring(0, uid.length - 1);
|
|
|
|
}
|
|
|
|
params['uid'] = uid;
|
|
|
|
if (uid.length > 0) {
|
|
|
|
if (uid.endsWith(',')) {
|
|
|
|
uid = uid.substring(0, uid.length - 1);
|
|
|
|
}
|
|
|
|
params['uid'] = uid;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (customerProvider.controllerstime.text.trim().length > 0) {
|
|
|
|
// params['stime'] = customerProvider.controllerstime.text;
|
|
...
|
...
|
@@ -357,16 +378,16 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
}
|
|
|
|
}
|
|
|
|
print(customerProvider.filterManageList);
|
|
|
|
if (first) {
|
|
|
|
if (distribution) {
|
|
|
|
params['distribution'] = '1';
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (customerProvider.filterManageList.length > 0 &&
|
|
|
|
customerProvider.filterManageList[0].select) {
|
|
|
|
params['distribution'] = '1';
|
|
|
|
}
|
|
|
|
// if (first) {
|
|
|
|
// if (distribution) {
|
|
|
|
// params['distribution'] = '1';
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
if (customerProvider.filterManageList.length > 0 &&
|
|
|
|
customerProvider.filterManageList[0].select) {
|
|
|
|
params['distribution'] = '1';
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
await customerProvider.getCustomerBySeller(context, params,
|
|
|
|
showLoading: load);
|
|
...
|
...
|
@@ -377,9 +398,9 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
// customerProvider.checkValue = false;
|
|
|
|
// }
|
|
|
|
// if (first || customerProvider.checkValue) {
|
|
|
|
if (first) {
|
|
|
|
customerProvider.addAll();
|
|
|
|
}
|
|
|
|
// if (first) {
|
|
|
|
// customerProvider.addAll();
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
|
|
|
|
// ///选中的联系人widget
|
|
...
|
...
|
@@ -557,14 +578,14 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
// _searchSellerLocation();
|
|
|
|
// customerProvider.searchData(value);
|
|
|
|
page = 1;
|
|
|
|
pageData = [];
|
|
|
|
customerProvider.pageData = [];
|
|
|
|
_getContantData(showLoading: false);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
page = 1;
|
|
|
|
pageData = [];
|
|
|
|
customerProvider.pageData = [];
|
|
|
|
_getContantData(showLoading: false);
|
|
|
|
// contantShowModel.searchData(
|
|
|
|
// contantShowModel.controller.text);
|
|
...
|
...
|
@@ -595,7 +616,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
page = 1;
|
|
|
|
pageData = [];
|
|
|
|
customerProvider.pageData = [];
|
|
|
|
_getContantData(showLoading: false);
|
|
|
|
// customerProvider.searchData('');
|
|
|
|
}));
|
|
...
|
...
|
@@ -780,7 +801,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
showFilter = false;
|
|
|
|
});
|
|
|
|
page = 1;
|
|
|
|
pageData = [];
|
|
|
|
customerProvider.pageData = [];
|
|
|
|
_getContantData();
|
|
|
|
}, tapWhiteBack: () {
|
|
|
|
Navigator.of(context).pop();
|
|
...
|
...
|
@@ -1631,7 +1652,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
model.pageState = PageState.Loading;
|
|
|
|
model.notifyListeners();
|
|
|
|
page = 1;
|
|
|
|
pageData = [];
|
|
|
|
customerProvider.pageData = [];
|
|
|
|
_getContantData();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有客户哦",
|
...
|
...
|
|