|
...
|
...
|
@@ -5,6 +5,7 @@ import 'package:common_utils/common_utils.dart'; |
|
|
|
import 'package:dio/dio.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/screenutil.dart';
|
|
|
|
import 'package:one_key/constant/state.dart';
|
|
|
|
import 'package:one_key/models/get_seller_info_model.dart';
|
|
|
|
import 'package:one_key/models/personnel_manage_model.dart';
|
|
|
|
import 'package:one_key/net/dio_util.dart';
|
|
...
|
...
|
@@ -23,9 +24,9 @@ import 'package:one_key/widgets/v_empty_view.dart'; |
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
class PersonnelDetailPage extends StatefulWidget {
|
|
|
|
final PersonnelManageSunModel model;
|
|
|
|
final int index;
|
|
|
|
final String position;
|
|
|
|
PersonnelDetailPage({Key key, this.model, this.position}) : super(key: key);
|
|
|
|
PersonnelDetailPage({Key key, this.index, this.position}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_PersonnelDetailPageState createState() => _PersonnelDetailPageState();
|
|
...
|
...
|
@@ -34,75 +35,79 @@ class PersonnelDetailPage extends StatefulWidget { |
|
|
|
class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
|
|
|
|
String roleNameLogin;
|
|
|
|
String accountLogin;
|
|
|
|
bool canEdit = false;
|
|
|
|
// bool canEdit = false;
|
|
|
|
List<String> btnList = [];
|
|
|
|
UserModel userModel;
|
|
|
|
PersonnelProvider personnelProvider;
|
|
|
|
String nickName;
|
|
|
|
String phone;
|
|
|
|
String nickName = '';
|
|
|
|
String phone = '';
|
|
|
|
String dcAdduserCode;
|
|
|
|
String manageShow = '全店未分配客户资源';
|
|
|
|
PersonnelManageSunModel data;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
nickName = widget.model.nickName != null && widget.model.nickName != 'null'
|
|
|
|
? widget.model.nickName
|
|
|
|
: '暂未设置名称';
|
|
|
|
phone = widget.model.phone != null && widget.model.userName != 'null'
|
|
|
|
? widget.model.phone
|
|
|
|
: '添加手机号';
|
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
|
|
|
if (widget.model.openid == null || widget.model.openid == 'null') {
|
|
|
|
// _getStoreBaseinfo();
|
|
|
|
_getWechatQrcode();
|
|
|
|
}
|
|
|
|
_getSellerUserBySellerid();
|
|
|
|
_getAuthUserLists();
|
|
|
|
EventBus().on('personnel_manage_detail_page', (arg) {
|
|
|
|
_getAuthUserLists(showLoading: false);
|
|
|
|
});
|
|
|
|
setState(() {
|
|
|
|
roleNameLogin = userModel.user.role_name;
|
|
|
|
accountLogin = userModel.user.account;
|
|
|
|
|
|
|
|
if (roleNameLogin == '管理员') {
|
|
|
|
canEdit = true;
|
|
|
|
} else if (roleNameLogin == '店长') {
|
|
|
|
if (widget.position == '管理员') {
|
|
|
|
canEdit = false;
|
|
|
|
} else if (widget.position == '店长') {
|
|
|
|
if (accountLogin == widget.model.account) {
|
|
|
|
print('11111');
|
|
|
|
//店长自己
|
|
|
|
canEdit = true;
|
|
|
|
} else {
|
|
|
|
print('333333');
|
|
|
|
canEdit = false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
canEdit = true;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (accountLogin == widget.model.account) {
|
|
|
|
//自己
|
|
|
|
canEdit = true;
|
|
|
|
} else {
|
|
|
|
canEdit = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (canEdit) {
|
|
|
|
btnList = [
|
|
|
|
'移除店员',
|
|
|
|
];
|
|
|
|
if (widget.model.openid == null || widget.model.openid == 'null') {
|
|
|
|
btnList.add('绑定微信');
|
|
|
|
}
|
|
|
|
btnList.add('查看密码');
|
|
|
|
if (widget.model.isOnCall == '0') {
|
|
|
|
btnList.add('设为接单人');
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
btnList = [];
|
|
|
|
}
|
|
|
|
// if (roleNameLogin == '管理员') {
|
|
|
|
// canEdit = true;
|
|
|
|
// } else if (roleNameLogin == '店长') {
|
|
|
|
// if (widget.position == '管理员') {
|
|
|
|
// canEdit = false;
|
|
|
|
// } else if (widget.position == '店长') {
|
|
|
|
// if (accountLogin == data.account) {
|
|
|
|
// print('11111');
|
|
|
|
// //店长自己
|
|
|
|
// canEdit = true;
|
|
|
|
// } else {
|
|
|
|
// print('333333');
|
|
|
|
// canEdit = false;
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// canEdit = true;
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// if (accountLogin == data.account) {
|
|
|
|
// //自己
|
|
|
|
// canEdit = true;
|
|
|
|
// } else {
|
|
|
|
// canEdit = false;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (canEdit) {
|
|
|
|
// btnList = [
|
|
|
|
// '移除店员',
|
|
|
|
// ];
|
|
|
|
// if (data.openid == null || data.openid == 'null') {
|
|
|
|
// btnList.add('绑定微信');
|
|
|
|
// }
|
|
|
|
// btnList.add('查看密码');
|
|
|
|
// if (data.isOnCall == '0') {
|
|
|
|
// btnList.add('设为接单人');
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// btnList = [];
|
|
|
|
// }
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void dispose() {
|
|
|
|
// TODO: implement dispose
|
|
|
|
super.dispose();
|
|
|
|
EventBus().off('personnel_manage_detail_page');
|
|
|
|
}
|
|
|
|
|
|
|
|
///获取店铺信息
|
|
|
|
// _getStoreBaseinfo() async {
|
|
|
|
// GetSellerInfoSunModel itemModel =
|
|
...
|
...
|
@@ -112,11 +117,54 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
///商家编辑页面 ----- 获取经理数据
|
|
|
|
_getSellerUserBySellerid() async {
|
|
|
|
await personnelProvider.getSellerUserBySellerid(context);
|
|
|
|
|
|
|
|
// for (int i = 0; i < personnelProvider.sellerManageList.length; i++) {
|
|
|
|
// if (manageShow == personnelProvider.sellerManageList[i].title) {
|
|
|
|
// personnelProvider.manageSelIndex = i;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取员工信息列表
|
|
|
|
_getAuthUserLists({bool showLoading = true}) async {
|
|
|
|
Map<String, String> params = {
|
|
|
|
"sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
};
|
|
|
|
|
|
|
|
await personnelProvider.getAuthUserLists(context, params,
|
|
|
|
showLoading: showLoading);
|
|
|
|
if (personnelProvider.dataMap != null) {
|
|
|
|
if (widget.position == '管理员') {
|
|
|
|
data = personnelProvider.dataMap.admin.listdata[widget.index];
|
|
|
|
} else if (widget.position == '店长') {
|
|
|
|
data = personnelProvider.dataMap.shopowner.listdata[widget.index];
|
|
|
|
} else if (widget.position == '客户经理') {
|
|
|
|
data = personnelProvider.dataMap.manager.listdata[widget.index];
|
|
|
|
} else if (widget.position == '收银员') {
|
|
|
|
data = personnelProvider.dataMap.cashier.listdata[widget.index];
|
|
|
|
} else if (widget.position == '服务员') {
|
|
|
|
data = personnelProvider.dataMap.waiter.listdata[widget.index];
|
|
|
|
}
|
|
|
|
nickName = data.nickName != null && data.nickName != 'null'
|
|
|
|
? data.nickName
|
|
|
|
: '暂未设置名称';
|
|
|
|
phone =
|
|
|
|
data.phone != null && data.userName != 'null' ? data.phone : '添加手机号';
|
|
|
|
if (data.openid == null || data.openid == 'null') {
|
|
|
|
// _getStoreBaseinfo();
|
|
|
|
_getWechatQrcode();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
///设置接单人
|
|
|
|
_setUserIsCall({bool showLoading = true}) async {
|
|
|
|
Map<String, String> params = {
|
|
|
|
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
'uid': widget.model.id
|
|
|
|
'uid': data.id
|
|
|
|
};
|
|
|
|
|
|
|
|
bool success = await personnelProvider.setUserIsCall(context, params,
|
|
...
|
...
|
@@ -132,20 +180,17 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { |
|
|
|
}
|
|
|
|
|
|
|
|
///删除店员
|
|
|
|
_delSellerClerk({bool showLoading = true}) async {
|
|
|
|
Map<String, String> params = {'seller_user_id': widget.model.id};
|
|
|
|
Future<bool> _delSellerClerk({bool showLoading = true}) async {
|
|
|
|
Map<String, String> params = {'seller_user_id': data.id};
|
|
|
|
|
|
|
|
bool success = await personnelProvider.delSellerClerk(context, params,
|
|
|
|
showLoading: showLoading);
|
|
|
|
if (success) {
|
|
|
|
EventBus().emit('personnel_manage_page');
|
|
|
|
Navigator.pop(context);
|
|
|
|
}
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
///编辑店员
|
|
|
|
_editAuthUser(String name, {bool showLoading = true}) async {
|
|
|
|
Map<String, String> params = {'id': widget.model.id, 'user_name': name};
|
|
|
|
Map<String, String> params = {'id': data.id, 'user_name': name};
|
|
|
|
|
|
|
|
bool success = await personnelProvider.editAuthUser(context, params,
|
|
|
|
showLoading: showLoading);
|
|
...
|
...
|
@@ -159,7 +204,7 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { |
|
|
|
|
|
|
|
/// 账号表-员工绑定手机号
|
|
|
|
_bindPhoneSellerUser(String name, {bool showLoading = true}) async {
|
|
|
|
Map<String, String> params = {'kid': widget.model.id, 'phone': name};
|
|
|
|
Map<String, String> params = {'kid': data.id, 'phone': name};
|
|
|
|
|
|
|
|
bool success = await personnelProvider.bindPhoneSellerUser(context, params,
|
|
|
|
showLoading: showLoading);
|
|
...
|
...
|
@@ -205,7 +250,7 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { |
|
|
|
}
|
|
|
|
} else if (element == '查看密码') {
|
|
|
|
NavigatorUtil.goPersonnelPasswordPage(context,
|
|
|
|
account: widget.model.account, idstr: widget.model.id);
|
|
|
|
account: data.account, idstr: data.id);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
...
|
...
|
@@ -220,7 +265,7 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { |
|
|
|
String id = Provider.of<UserModel>(context, listen: false).user.openid;
|
|
|
|
// https: //xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode/sellerid/商家ID/uid/当前账号ID
|
|
|
|
Response response = await DioUtil.getInstance().getDio().get(
|
|
|
|
"https://xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode?sellerid=$sid&uid=${widget.model.id}");
|
|
|
|
"https://xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode?sellerid=$sid&uid=${data.id}");
|
|
|
|
// Response response = await DioUtil.getInstance().getDio().get(
|
|
|
|
// "https://xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode?sellerid=$sid&uid=$uid");
|
|
|
|
// Response response = await DioUtil.getInstance().getDio().get(
|
|
...
|
...
|
@@ -252,140 +297,372 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { |
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar(
|
|
|
|
'店员详情',
|
|
|
|
'员工详情',
|
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(ScreenUtil().setWidth(40)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
body: Column(children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Stack(
|
|
|
|
children: [
|
|
|
|
VEmptyView(40),
|
|
|
|
widget.model.headimgurl != null &&
|
|
|
|
widget.model.headimgurl != 'null'
|
|
|
|
? CachedNetworkImage(
|
|
|
|
imageUrl: widget.model.headimgurl,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(38 * 2),
|
|
|
|
height: ScreenUtil().setWidth(38 * 2),
|
|
|
|
)
|
|
|
|
: Image.asset(
|
|
|
|
Utils.getImgPath('touxiang'),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(38 * 2),
|
|
|
|
height: ScreenUtil().setWidth(38 * 2),
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
if (canEdit) {
|
|
|
|
DialogUtil.textfeildAlertDialog(context,
|
|
|
|
title: '修改店员名称',
|
|
|
|
text: nickName != '暂未设置名称' ? nickName : '',
|
|
|
|
hintText: '输入店员名称',
|
|
|
|
toast: '请输入店员名称', rCallback: (name) {
|
|
|
|
_editAuthUser(name);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
nickName,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setWidth(36),
|
|
|
|
color: MyColours.color_333333),
|
|
|
|
),
|
|
|
|
canEdit
|
|
|
|
? Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(20)),
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('yd_bianji'),
|
|
|
|
width: ScreenUtil().setWidth(20),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.all(ScreenUtil().setWidth(16 * 2)),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setWidth(57 * 2),
|
|
|
|
left: ScreenUtil().setWidth(40),
|
|
|
|
right: ScreenUtil().setWidth(40)),
|
|
|
|
// height: ScreenUtil().setWidth(154 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
boxShadow: [
|
|
|
|
// BoxShadow(
|
|
|
|
// color: Color.fromRGBO(0, 0, 0, 0.4),
|
|
|
|
// offset: Offset(0, ScreenUtil().setWidth(8)),
|
|
|
|
// spreadRadius: ScreenUtil().setWidth(2),
|
|
|
|
// blurRadius: ScreenUtil().setWidth(34))
|
|
|
|
BoxShadow(
|
|
|
|
color: Color.fromRGBO(0, 0, 0, 0.1),
|
|
|
|
offset: Offset(0, ScreenUtil().setWidth(8)),
|
|
|
|
blurRadius: ScreenUtil().setWidth(20),
|
|
|
|
spreadRadius: ScreenUtil().setWidth(1))
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
VEmptyView(40),
|
|
|
|
canEdit
|
|
|
|
? InkWell(
|
|
|
|
onTap: () {
|
|
|
|
DialogUtil.textfeildAlertDialog(context,
|
|
|
|
title: '修改手机号',
|
|
|
|
text: phone != '添加手机号' ? phone : '',
|
|
|
|
hintText: '输入手机号',
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
toast: '请输入手机号', rCallback: (phone) {
|
|
|
|
_bindPhoneSellerUser(phone);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
bottom: ScreenUtil().setWidth(40)),
|
|
|
|
child: Text(
|
|
|
|
phone,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setWidth(28),
|
|
|
|
color: MyColours.color_199095),
|
|
|
|
)))
|
|
|
|
: widget.model.phone != null &&
|
|
|
|
widget.model.phone != 'null'
|
|
|
|
? Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
bottom: ScreenUtil().setWidth(40)),
|
|
|
|
child: Text(
|
|
|
|
widget.model.phone,
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(18))),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: RoundButton(
|
|
|
|
text: '编辑资料',
|
|
|
|
gradientStart: MyColours.color_ffffff,
|
|
|
|
gradientEnd: MyColours.color_ffffff,
|
|
|
|
borderColor: MyColours.color_438E93,
|
|
|
|
width: ScreenUtil().setWidth(62 * 2),
|
|
|
|
height: ScreenUtil().setWidth(21 * 2),
|
|
|
|
fontSize: 24,
|
|
|
|
isBold: false,
|
|
|
|
textColor: MyColours.color_438E93,
|
|
|
|
radius: ScreenUtil().setWidth(26 * 2),
|
|
|
|
onPressed: () {
|
|
|
|
NavigatorUtil.goPersonnalBaseInfoPage(
|
|
|
|
context, data, widget.position);
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
VEmptyView(38),
|
|
|
|
Text(
|
|
|
|
'姓名: ${nickName == '暂未设置名称' ? '' : nickName}',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
VEmptyView(26),
|
|
|
|
Text(
|
|
|
|
'电话: ${phone == '添加手机号' ? '' : phone}',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
VEmptyView(6),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(14),
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
data == null ||
|
|
|
|
data?.openid == null ||
|
|
|
|
data?.openid == 'null'
|
|
|
|
? SizedBox()
|
|
|
|
: RoundButton(
|
|
|
|
text: '已绑定微信',
|
|
|
|
gradientStart: MyColours.color_438E93,
|
|
|
|
gradientEnd: MyColours.color_438E93,
|
|
|
|
borderColor: MyColours.color_438E93,
|
|
|
|
width: ScreenUtil().setWidth(58 * 2),
|
|
|
|
height: ScreenUtil().setWidth(18 * 2),
|
|
|
|
fontSize: 20,
|
|
|
|
isBold: false,
|
|
|
|
textColor: MyColours.color_ffffff,
|
|
|
|
radius: ScreenUtil().setWidth(10),
|
|
|
|
onPressed: () {}),
|
|
|
|
Text('${widget.position} 工号: ${data?.account}',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setWidth(28),
|
|
|
|
color: MyColours.color_333333),
|
|
|
|
))
|
|
|
|
: SizedBox(),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Provider.of<UserModel>(context, listen: false)
|
|
|
|
.user
|
|
|
|
.sellername,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setWidth(30),
|
|
|
|
color: MyColours.color_333333),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
Text(
|
|
|
|
widget.position,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setWidth(28),
|
|
|
|
color: MyColours.color_199095),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
// MyDivider(
|
|
|
|
// double.infinity,
|
|
|
|
// ScreenUtil().setWidth(10),
|
|
|
|
// color: Color.fromRGBO(235, 234, 239, 1),
|
|
|
|
// ),
|
|
|
|
VEmptyView(60),
|
|
|
|
Wrap(
|
|
|
|
spacing: ScreenUtil().setWidth(20), //主轴上子控件的间距
|
|
|
|
runSpacing: ScreenUtil().setWidth(20), //交叉轴上子控件之间的间距
|
|
|
|
children: _listWidget(btnList), //要显示的子控件集合
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
top: ScreenUtil().setWidth(13 * 2),
|
|
|
|
left: ScreenUtil().setWidth(35 * 2),
|
|
|
|
child:
|
|
|
|
data?.headimgurl != null && data?.headimgurl != 'null'
|
|
|
|
? ClipRRect(
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(80)),
|
|
|
|
child: CachedNetworkImage(
|
|
|
|
imageUrl: data?.headimgurl,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(80 * 2),
|
|
|
|
height: ScreenUtil().setWidth(80 * 2),
|
|
|
|
))
|
|
|
|
: Stack(alignment: Alignment.center, children: [
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil().setWidth(80 * 2),
|
|
|
|
height: ScreenUtil().setWidth(80 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(80)))),
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('personnal_no_image'),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil().setWidth(50 * 2),
|
|
|
|
height: ScreenUtil().setWidth(50 * 2)),
|
|
|
|
),
|
|
|
|
]),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(114),
|
|
|
|
data?.openid == null || data?.openid == 'null'
|
|
|
|
? RoundButton(
|
|
|
|
text: '绑定微信',
|
|
|
|
gradientStart: MyColours.color_438E93,
|
|
|
|
gradientEnd: MyColours.color_438E93,
|
|
|
|
borderColor: MyColours.color_438E93,
|
|
|
|
width: ScreenUtil().setWidth(80 * 2),
|
|
|
|
height: ScreenUtil().setWidth(30 * 2),
|
|
|
|
fontSize: 32,
|
|
|
|
isBold: true,
|
|
|
|
textColor: MyColours.color_ffffff,
|
|
|
|
radius: ScreenUtil().setWidth(12),
|
|
|
|
onPressed: () {
|
|
|
|
if (dcAdduserCode != '' && dcAdduserCode != null) {
|
|
|
|
DialogUtil.openAlertDialogImage(
|
|
|
|
context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660);
|
|
|
|
} else {
|
|
|
|
_getWechatQrcode(need: true);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
: SizedBox(),
|
|
|
|
data?.openid == null || data?.openid == 'null'
|
|
|
|
? VEmptyView(48)
|
|
|
|
: SizedBox(),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
NavigatorUtil.goPersonnelPasswordEditPage(context,
|
|
|
|
idstr: data.id);
|
|
|
|
},
|
|
|
|
child: Text(
|
|
|
|
'重置密码',
|
|
|
|
style: TextStyle(
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
)),
|
|
|
|
// Container(
|
|
|
|
// margin: EdgeInsets.all(ScreenUtil().setWidth(40)),
|
|
|
|
// child: Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// VEmptyView(40),
|
|
|
|
|
|
|
|
// data.headimgurl != null &&
|
|
|
|
// data.headimgurl != 'null'
|
|
|
|
// ? ClipRRect(
|
|
|
|
// borderRadius: BorderRadius.circular(
|
|
|
|
// ScreenUtil().setWidth(80)),
|
|
|
|
// child: CachedNetworkImage(
|
|
|
|
// imageUrl: data.headimgurl,
|
|
|
|
// fit: BoxFit.cover,
|
|
|
|
// width: ScreenUtil().setWidth(80 * 2),
|
|
|
|
// height: ScreenUtil().setWidth(80 * 2),
|
|
|
|
// ))
|
|
|
|
// : Stack(alignment: Alignment.center, children: [
|
|
|
|
// Container(
|
|
|
|
// width: ScreenUtil().setWidth(80 * 2),
|
|
|
|
// height: ScreenUtil().setWidth(80 * 2),
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// color: MyColours.color_f3f3f3,
|
|
|
|
// borderRadius: BorderRadius.circular(
|
|
|
|
// ScreenUtil().setWidth(80)))),
|
|
|
|
// Align(
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// child: Image.asset(
|
|
|
|
// Utils.getImgPath('personnal_no_image'),
|
|
|
|
// fit: BoxFit.cover,
|
|
|
|
// width: ScreenUtil().setWidth(50 * 2),
|
|
|
|
// height: ScreenUtil().setWidth(50 * 2)),
|
|
|
|
// ),
|
|
|
|
// ]),
|
|
|
|
// VEmptyView(40),
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// if (canEdit) {
|
|
|
|
// DialogUtil.textfeildAlertDialog(context,
|
|
|
|
// title: '修改店员名称',
|
|
|
|
// text: nickName != '暂未设置名称' ? nickName : '',
|
|
|
|
// hintText: '输入店员名称',
|
|
|
|
// toast: '请输入店员名称', rCallback: (name) {
|
|
|
|
// _editAuthUser(name);
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Text(
|
|
|
|
// nickName,
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setWidth(36),
|
|
|
|
// color: MyColours.color_333333),
|
|
|
|
// ),
|
|
|
|
// canEdit
|
|
|
|
// ? Padding(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// left: ScreenUtil().setWidth(20)),
|
|
|
|
// child: Image.asset(
|
|
|
|
// Utils.getImgPath('yd_bianji'),
|
|
|
|
// width: ScreenUtil().setWidth(20),
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
// : SizedBox(),
|
|
|
|
// ],
|
|
|
|
// )),
|
|
|
|
// VEmptyView(40),
|
|
|
|
// canEdit
|
|
|
|
// ? InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// DialogUtil.textfeildAlertDialog(context,
|
|
|
|
// title: '修改手机号',
|
|
|
|
// text: phone != '添加手机号' ? phone : '',
|
|
|
|
// hintText: '输入手机号',
|
|
|
|
// keyboardType: TextInputType.number,
|
|
|
|
// toast: '请输入手机号', rCallback: (phone) {
|
|
|
|
// _bindPhoneSellerUser(phone);
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Padding(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// bottom: ScreenUtil().setWidth(40)),
|
|
|
|
// child: Text(
|
|
|
|
// phone,
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setWidth(28),
|
|
|
|
// color: MyColours.color_199095),
|
|
|
|
// )))
|
|
|
|
// : data.phone != null &&
|
|
|
|
// data.phone != 'null'
|
|
|
|
// ? Padding(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// bottom: ScreenUtil().setWidth(40)),
|
|
|
|
// child: Text(
|
|
|
|
// data.phone,
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setWidth(28),
|
|
|
|
// color: MyColours.color_333333),
|
|
|
|
// ))
|
|
|
|
// : SizedBox(),
|
|
|
|
|
|
|
|
// Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Text(
|
|
|
|
// Provider.of<UserModel>(context, listen: false)
|
|
|
|
// .user
|
|
|
|
// .sellername,
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setWidth(30),
|
|
|
|
// color: MyColours.color_333333),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(20),
|
|
|
|
// Text(
|
|
|
|
// widget.position,
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setWidth(28),
|
|
|
|
// color: MyColours.color_199095),
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// // MyDivider(
|
|
|
|
// // double.infinity,
|
|
|
|
// // ScreenUtil().setWidth(10),
|
|
|
|
// // color: Color.fromRGBO(235, 234, 239, 1),
|
|
|
|
// // ),
|
|
|
|
// VEmptyView(60),
|
|
|
|
// Wrap(
|
|
|
|
// spacing: ScreenUtil().setWidth(20), //主轴上子控件的间距
|
|
|
|
// runSpacing: ScreenUtil().setWidth(20), //交叉轴上子控件之间的间距
|
|
|
|
// children: _listWidget(btnList), //要显示的子控件集合
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
InkWell(
|
|
|
|
onTap: () async {
|
|
|
|
await DialogUtil.removePersonnalDialog(
|
|
|
|
context, personnelProvider.sellerManageList, onTap: (map) {
|
|
|
|
print(map);
|
|
|
|
String uid = map['bjtype'];
|
|
|
|
if (uid == '') {
|
|
|
|
//选择了 全店未分配客户资源
|
|
|
|
} else {
|
|
|
|
//选择了某个经理
|
|
|
|
}
|
|
|
|
Future.wait<bool>([
|
|
|
|
// 2秒后返回结果
|
|
|
|
Future.delayed(new Duration(seconds: 2), () {
|
|
|
|
return true;
|
|
|
|
}),
|
|
|
|
// 4秒后返回结果
|
|
|
|
_delSellerClerk()
|
|
|
|
]).then((results) {
|
|
|
|
print(results[0]);
|
|
|
|
if (results[1]) {
|
|
|
|
//删除员工成功
|
|
|
|
EventBus().emit('personnel_manage_page');
|
|
|
|
Navigator.pop(context);
|
|
|
|
}
|
|
|
|
}).catchError((e) {
|
|
|
|
print(e);
|
|
|
|
});
|
|
|
|
|
|
|
|
// DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
// title: '提示',
|
|
|
|
// content: '移除店员后,店员将无法接收门店收款通知,店员收款码也将无法收款',
|
|
|
|
// rTitle: '移除', rCallback: () {
|
|
|
|
// _delSellerClerk();
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: ScreenUtil().setWidth(34 * 2)),
|
|
|
|
child: Text(
|
|
|
|
'移除员工',
|
|
|
|
style: TextStyle(
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
))),
|
|
|
|
]),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|