Commit 01f37b0a73988ae485520f8f57a1aa872166a7d2

Authored by wdn127929
1 parent 258dc5d8

制定服务人员

... ... @@ -135,6 +135,7 @@ class Constant {
'人数': ['管理员', '店长', '前台'],
'图片备注': ['管理员', '店长', '前台'],
'用餐类型': ['管理员', '店长', '前台'],
'服务人员': ['管理员', '店长', '前台'],
'消费金额': [
'管理员',
'店长',
... ... @@ -207,5 +208,8 @@ class Constant {
'管理员',
'前台',
],
'设置服务人员':[ '管理员',
'店长',]
};
}
... ...
... ... @@ -118,6 +118,9 @@ class NotebookDetail {
List<String> photo_note; //图片备注
String serve_name;//服务人员
String serve_uid;//服务人员uid
String get statuImgAssets {
switch (status) {
case "0":
... ... @@ -312,7 +315,7 @@ class NotebookDetail {
@override
String toString() {
return 'NotebookDetail{id: $id, uid: $uid ,con_amount:$con_amount,abolition: $abolition, tableinfo: $tableinfo,actual_pum:$actual_pum, pnum: $pnum, rname: $rname, sex: $sex, phone: $phone, cusdem: $cusdem, cusman: $cusman, ddate: $ddate, is_set_ddate: $is_set_ddate, ddate_solt: $ddate_solt, status: $status, action: $action, type: $type, note_name: $note_name, seller_user_phone:$seller_user_phone, nick_name: $nick_name,channel: $channel, cdate: $cdate, demands: $demands, tables: $tables, cancel: $cancel, gid: $gid,guest_uid:$guest_uid,reserve_type:$reserve_type,place_order_name:$place_order_name,is_user_comments:$is_user_comments,deposit_cancel:$deposit_cancel,up_date:$up_date,log_photo:$log_photo,photo_note:$photo_note}';
return 'NotebookDetail{id: $id, uid: $uid ,con_amount:$con_amount,abolition: $abolition, tableinfo: $tableinfo,actual_pum:$actual_pum, pnum: $pnum, rname: $rname, sex: $sex, phone: $phone, cusdem: $cusdem, cusman: $cusman, ddate: $ddate, is_set_ddate: $is_set_ddate, ddate_solt: $ddate_solt, status: $status, action: $action, type: $type, note_name: $note_name, seller_user_phone:$seller_user_phone, nick_name: $nick_name,channel: $channel, cdate: $cdate, demands: $demands, tables: $tables, cancel: $cancel, gid: $gid,guest_uid:$guest_uid,reserve_type:$reserve_type,place_order_name:$place_order_name,is_user_comments:$is_user_comments,deposit_cancel:$deposit_cancel,up_date:$up_date,log_photo:$log_photo,photo_note:$photo_note,serve_name:$serve_name,serve_uid:$serve_uid}';
}
}
... ...
... ... @@ -19,6 +19,14 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) {
});
}
}
String servename;
String serveuid;
if (json['serve_name'] != null) {
servename = json['serve_name']['nick_name'];
serveuid = json['serve_name']['id'];
}
return NotebookDetail()
..id = json['id'] as String
..uid = json['uid'] as String
... ... @@ -69,7 +77,9 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) {
..up_date = json['up_date'] as String
..deposit_cancel = json['deposit_cancel'] as String
..log_photo = json['log_photo'] as String
..photo_note = images;
..photo_note = images
..serve_name = servename
..serve_uid = serveuid;
}
Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) =>
... ... @@ -111,7 +121,9 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) =>
'up_date': instance.up_date,
'deposit_cancel': instance.deposit_cancel,
'log_photo': instance.log_photo,
'photo_note': instance.photo_note
'photo_note': instance.photo_note,
'serve_name': instance.serve_name,
'serve_uid': instance.serve_uid,
};
OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) {
return OrderInfo(
... ...
... ... @@ -118,6 +118,10 @@ class PersonnelManageSunModel extends Object {
@JsonKey(name: 'is_store_wine')
String isStoreWine;
@JsonKey(name: 'account_type')
String accountType;
bool select = false;
PersonnelManageSunModel(
... ... @@ -132,7 +136,9 @@ class PersonnelManageSunModel extends Object {
this.account,
this.isOnCall,
this.headimgurl,
this.isStoreWine);
this.isStoreWine,
this.accountType
);
factory PersonnelManageSunModel.fromJson(Map<String, dynamic> srcJson) =>
_$PersonnelManageSunModelFromJson(srcJson);
... ...
... ... @@ -95,6 +95,7 @@ PersonnelManageSunModel _$PersonnelManageSunModelFromJson(
json['is_on_call'] as String,
json['headimgurl'] as String,
json['is_store_wine'] as String,
json['account_type'] as String,
);
}
... ... @@ -112,7 +113,8 @@ Map<String, dynamic> _$PersonnelManageSunModelToJson(
'account': instance.account,
'is_on_call': instance.isOnCall,
'headimgurl': instance.headimgurl,
'is_store_wine': instance.isStoreWine
'is_store_wine': instance.isStoreWine,
'account_type': instance..accountType,
};
Shopowner _$ShopownerFromJson(Map<String, dynamic> json) {
... ...
class SellerUserAccountTypeModel {
int ret;
List<SellerUserAccountTypeSunModel> data;
String msg;
SellerUserAccountTypeModel({this.ret, this.data, this.msg});
SellerUserAccountTypeModel.fromJson(Map<String, dynamic> json) {
if (json["ret"] is int) {
ret = json["ret"];
}
if (json["data"] is List) {
data = json["data"] == null
? null
: (json["data"] as List)
.map((e) => SellerUserAccountTypeSunModel.fromJson(e))
.toList();
}
if (json["msg"] is String) {
msg = json["msg"];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> _data = <String, dynamic>{};
_data["ret"] = ret;
if (data != null) {
_data["data"] = data?.map((e) => e.toJson()).toList();
}
_data["msg"] = msg;
return _data;
}
}
class SellerUserAccountTypeSunModel {
String id;
String nickName;
String roleId;
String authUserId;
String seatOpenid;
String sellerOpenid;
String sellerid;
String sellerCode;
String account;
String phone;
String userToken;
String registrationId;
String connectionId;
String pcWorkid;
String pcConnectionId;
String alias;
String password;
String sn;
String isOnCall;
String isStoreWine;
dynamic isShowRanmePhone;
String accountType;
String cdate;
bool select = false;
SellerUserAccountTypeSunModel(
{this.id,
this.nickName,
this.roleId,
this.authUserId,
this.seatOpenid,
this.sellerOpenid,
this.sellerid,
this.sellerCode,
this.account,
this.phone,
this.userToken,
this.registrationId,
this.connectionId,
this.pcWorkid,
this.pcConnectionId,
this.alias,
this.password,
this.sn,
this.isOnCall,
this.isStoreWine,
this.isShowRanmePhone,
this.accountType,
this.cdate,
this.select});
SellerUserAccountTypeSunModel.fromJson(Map<String, dynamic> json) {
if (json["id"] is String) {
id = json["id"];
}
if (json["nick_name"] is String) {
nickName = json["nick_name"];
}
if (json["role_id"] is String) {
roleId = json["role_id"];
}
if (json["auth_user_id"] is String) {
authUserId = json["auth_user_id"];
}
if (json["seat_openid"] is String) {
seatOpenid = json["seat_openid"];
}
if (json["seller_openid"] is String) {
sellerOpenid = json["seller_openid"];
}
if (json["sellerid"] is String) {
sellerid = json["sellerid"];
}
if (json["seller_code"] is String) {
sellerCode = json["seller_code"];
}
if (json["account"] is String) {
account = json["account"];
}
if (json["phone"] is String) {
phone = json["phone"];
}
if (json["user_token"] is String) {
userToken = json["user_token"];
}
if (json["registrationId"] is String) {
registrationId = json["registrationId"];
}
if (json["connection_id"] is String) {
connectionId = json["connection_id"];
}
if (json["pc_workid"] is String) {
pcWorkid = json["pc_workid"];
}
if (json["pc_connection_id"] is String) {
pcConnectionId = json["pc_connection_id"];
}
if (json["alias"] is String) {
alias = json["alias"];
}
if (json["password"] is String) {
password = json["password"];
}
if (json["sn"] is String) {
sn = json["sn"];
}
if (json["is_on_call"] is String) {
isOnCall = json["is_on_call"];
}
if (json["is_store_wine"] is String) {
isStoreWine = json["is_store_wine"];
}
isShowRanmePhone = json["is_show_ranme_phone"];
if (json["account_type"] is String) {
accountType = json["account_type"];
}
if (json["cdate"] is String) {
cdate = json["cdate"];
}
select = json["select"] ?? false;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> _data = <String, dynamic>{};
_data["id"] = id;
_data["nick_name"] = nickName;
_data["role_id"] = roleId;
_data["auth_user_id"] = authUserId;
_data["seat_openid"] = seatOpenid;
_data["seller_openid"] = sellerOpenid;
_data["sellerid"] = sellerid;
_data["seller_code"] = sellerCode;
_data["account"] = account;
_data["phone"] = phone;
_data["user_token"] = userToken;
_data["registrationId"] = registrationId;
_data["connection_id"] = connectionId;
_data["pc_workid"] = pcWorkid;
_data["pc_connection_id"] = pcConnectionId;
_data["alias"] = alias;
_data["password"] = password;
_data["sn"] = sn;
_data["is_on_call"] = isOnCall;
_data["is_store_wine"] = isStoreWine;
_data["is_show_ranme_phone"] = isShowRanmePhone;
_data["account_type"] = accountType;
_data["cdate"] = cdate;
_data["select"] = select;
return _data;
}
}
... ...
... ... @@ -7,6 +7,7 @@ class User {
String openid; //商户openid
String account; //账号
String role_name; //角色名称
String role_name_addition; //角色名称(只订不服,只服不订)
String sellerid; //商户id
String sellercode; //商户编号
String sellername; //商户名称
... ... @@ -32,6 +33,7 @@ class User {
this.openid,
this.account,
this.role_name,
this.role_name_addition,
this.sellerid,
this.sellercode,
this.sellername,
... ... @@ -58,6 +60,6 @@ class User {
@override
String toString() {
return 'User{openid: $openid, account: $account, role_name: $role_name, sellerid: $sellerid, sellercode: $sellercode, sellername: $sellername,sellerimage:$sellerimage, sellerphone: $sellerphone, sellerAddr: $sellerAddr, scatter: $scatter, room: $room, cassette: $cassette, morning: $morning, noon: $noon, night: $night ,userphone:$userphone,userphoneMyPage:$userphoneMyPage,token:$token,nickName:$nickName,edate:$edate,tokenLoginOut:$tokenLoginOut,sellerVersion:$sellerVersion}';
return 'User{openid: $openid, account: $account, role_name: $role_name,role_name_addition:$role_name_addition, sellerid: $sellerid, sellercode: $sellercode, sellername: $sellername,sellerimage:$sellerimage, sellerphone: $sellerphone, sellerAddr: $sellerAddr, scatter: $scatter, room: $room, cassette: $cassette, morning: $morning, noon: $noon, night: $night ,userphone:$userphone,userphoneMyPage:$userphoneMyPage,token:$token,nickName:$nickName,edate:$edate,tokenLoginOut:$tokenLoginOut,sellerVersion:$sellerVersion}';
}
}
... ...
... ... @@ -11,6 +11,7 @@ User _$UserFromJson(Map<String, dynamic> json) {
json['openid'] as String,
json['account'] as String,
json['role_name'] as String,
json['role_name_addition'] as String,
json['sellerid'] as String,
json['sellercode'] as String,
json['sellername'] as String,
... ... @@ -29,8 +30,7 @@ User _$UserFromJson(Map<String, dynamic> json) {
json['nickname'] as String,
json['edate'] as String,
json['tokenLoginOut'] as String,
json['sellerVersion'] as String,
json['sellerVersion'] as String,
);
}
... ... @@ -38,6 +38,7 @@ Map<String, dynamic> _$UserToJson(User instance) => <String, dynamic>{
'openid': instance.openid,
'account': instance.account,
'role_name': instance.role_name,
'role_name_addition': instance.role_name_addition,
'sellerid': instance.sellerid,
'sellercode': instance.sellercode,
'sellername': instance.sellername,
... ... @@ -51,10 +52,10 @@ Map<String, dynamic> _$UserToJson(User instance) => <String, dynamic>{
'noon': instance.noon,
'night': instance.night,
'userphone': instance.userphone,
'userphoneMyPage':instance.userphoneMyPage,
'userphoneMyPage': instance.userphoneMyPage,
'token': instance.token,
'nickname': instance.nickName,
'edate': instance.edate,
'tokenLoginOut':instance.tokenLoginOut,
'sellerVersion':instance.sellerVersion
'tokenLoginOut': instance.tokenLoginOut,
'sellerVersion': instance.sellerVersion
};
... ...
... ... @@ -530,6 +530,14 @@ class HttpUrl {
"?service=App.Reserve.SetReserveImgText"; // 保存预订详情自定义图文
static const String get_reserve_img_text =
"?service=App.Reserve.GetReserveImgText"; // 获取预订详情自定义图文
static const String set_seller_user_account_type =
"?service=App.Seller.SetSellerUserAccountType"; // 设置账号服务类型
static const String get_seller_user_account_type =
"?service=App.Seller.GetSellerUserAccountType"; // 获取账号服务类型
static const String set_serve_uid_by_rid =
"?service=App.Reserve.SetServeUidByRid"; // 设置订单服务经理
}
... ...
... ... @@ -58,6 +58,7 @@ import '../../models/reserveA_action_log_modol.dart';
import '../../models/reserve_deposit_model.dart';
import '../../models/upload_img_model.dart';
import '../../provider/collect_store_provider.dart';
import '../../provider/personnel_provider.dart';
import '../../provider/upload_img_provider.dart';
import '../../utils/screen_util.dart';
import '../../utils/upload_image_util.dart';
... ... @@ -133,10 +134,12 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
ScrollController controller = ScrollController();
String reserveType = '普通用餐';
UploadImageProvider _uploadImageProvider;
String server = '修改';
String serveruid;
List<UploadImgModel> remarkImgs = [];
List<ReserveDepositSunModel> reserveDepositList = []; //订单订金数据
PersonnelProvider personnelProvider;
@override
void initState() {
... ... @@ -151,6 +154,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
affinity: TextAffinity.downstream,
offset: value.toString().length)));
});
_getSellerUserAccountType();
getSellerVersion();
_getReserveTypeField();
_initCancel();
... ... @@ -222,6 +226,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
});
}
_getSellerUserAccountType() async {
await personnelProvider.getSellerUserAccountType(context, {
'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid,
'account_type': '1,3'
});
}
///获取七牛云token
///
_getQiniuInfo() async {
... ... @@ -238,15 +249,14 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
'rid': widget.rid,
};
await detailModel.getReserveDepositByRid(context, params);
detailModel.reserveDepositList.forEach((element) {
if(element.payType != '微信预订通知'){
reserveDepositList.add(element);
}
else if (element.payType == '微信预订通知' && element.tradeState == 'SUCCESS'){
reserveDepositList.add(element);
}
});
detailModel.reserveDepositList.forEach((element) {
if (element.payType != '微信预订通知') {
reserveDepositList.add(element);
} else if (element.payType == '微信预订通知' &&
element.tradeState == 'SUCCESS') {
reserveDepositList.add(element);
}
});
}
///获取核餐记录
... ... @@ -518,6 +528,9 @@ else if (element.payType == '微信预订通知' && element.tradeState == 'SUCCE
isShowLoading: isShowLoading);
remarkImgs = [];
server = detailEntity.serve_name ?? '修改';
serveruid = detailEntity.serve_uid;
if (detailEntity.photo_note != null && detailEntity.photo_note.length > 0) {
detailEntity.photo_note.forEach((element) {
... ... @@ -971,8 +984,7 @@ else if (element.payType == '微信预订通知' && element.tradeState == 'SUCCE
}).toList(),
)),
VEmptyView(34),
if (reserveDepositList.length >
0)
if (reserveDepositList.length > 0)
_depositWidget(),
MyDivider(double.infinity, w(1),
color: MyColours.color_E7E7E7)
... ... @@ -1692,7 +1704,7 @@ else if (element.payType == '微信预订通知' && element.tradeState == 'SUCCE
style: TextStyle(color: MyColours.color_515151, fontSize: font(15)),
),
Spacer(),
RoundButton(
RoundButton(
text: '添加一项',
radius: r(11),
width: w(72),
... ... @@ -1788,7 +1800,8 @@ else if (element.payType == '微信预订通知' && element.tradeState == 'SUCCE
djText('支付方式 ', '${data.payType}'),
],
),
Spacer(), Column(
Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
... ... @@ -1798,7 +1811,7 @@ else if (element.payType == '微信预订通知' && element.tradeState == 'SUCCE
// '${data.nickName == null ? '' : data.nickName}'),
],
),
HEmptyView(32),
HEmptyView(32),
],
))
])));
... ... @@ -2269,6 +2282,8 @@ else if (element.payType == '微信预订通知' && element.tradeState == 'SUCCE
UserModel userModel = Provider.of<UserModel>(context, listen: false);
collectStoreProvider =
Provider.of<CollectStoreProvider>(context, listen: true);
personnelProvider = Provider.of<PersonnelProvider>(context, listen: true);
print(userModel.user.role_name);
print(userModel.user.openid);
print(widget.rid);
... ... @@ -2611,41 +2626,93 @@ else if (element.payType == '微信预订通知' && element.tradeState == 'SUCCE
))
]),
TitleAndBtn(
title: "用餐类型",
content: reserveType,
// list: personNumList,
detailModel: model,
callback: () {
FocusScope.of(context)
.requestFocus(
FocusNode()); //隐藏键盘
// 存储
DialogUtil
.openDishTypeSelectModalBottomSheet(
context,
detailModel
.reserveTypes,
reserveType,
rCallback:
(value) async {
if (value != null) {
reserveType = value;
setState(() {});
bool sucess =
await detailModel
.upReserveInfo(
context,
widget.rid,
reserveType:
reserveType,
needToast:
false);
if (sucess) {}
}
});
}),
Row(children: [
Expanded(
flex: 1,
child: TitleAndBtn(
title: "用餐类型",
content: reserveType,
// list: personNumList,
detailModel: model,
callback: () {
FocusScope.of(context)
.requestFocus(
FocusNode()); //隐藏键盘
// 存储
DialogUtil
.openDishTypeSelectModalBottomSheet(
context,
detailModel
.reserveTypes,
reserveType,
rCallback:
(value) async {
if (value != null) {
reserveType = value;
setState(() {});
bool sucess =
await detailModel
.upReserveInfo(
context,
widget
.rid,
reserveType:
reserveType,
needToast:
false);
if (sucess) {}
}
});
}),
),
HEmptyView(60),
Expanded(
flex: 1,
child: TitleAndBtn(
title: "服务人员",
content: server,
// list: personNumList,
detailModel: model,
callback: () {
FocusScope.of(context)
.requestFocus(
FocusNode()); //隐藏键盘
// 存储
DialogUtil
.openServeTypeSelectModalBottomSheet(
context,
personnelProvider
.serverList,
server,
serveruid,
rCallback:
(value) async {
if (value != null) {
server =
value['name'];
serveruid =
value['uid'];
setState(() {});
bool sucess =
await detailModel
.setServeUidByRid(
context, {
'rid': widget.rid,
'serveuid':
serveruid
});
if (sucess) {
// Utils.showToast(msg)
}
}
});
}),
)
]),
// ),
// Offstage(
... ... @@ -5009,10 +5076,11 @@ class TitleAndBtn extends StatelessWidget {
return Container(
color: MyColours.color_ffffff,
width: double.infinity,
// width: double.infinity,
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(25)),
alignment: Alignment.center,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Align(
... ... @@ -5024,7 +5092,7 @@ class TitleAndBtn extends StatelessWidget {
fontSize: ScreenUtil().setSp(30)),
),
),
Spacer(),
// Spacer(),
// if (Utils.getAuthority(context, title) ||
// uid == userModel.user.openid)
// Text(
... ... @@ -5043,7 +5111,8 @@ class TitleAndBtn extends StatelessWidget {
}
},
child: Container(
height: ScreenUtil().setWidth(44),
constraints: BoxConstraints(maxWidth: w(80)),
// height: ScreenUtil().setWidth(44),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
... ... @@ -5052,16 +5121,25 @@ class TitleAndBtn extends StatelessWidget {
uid == userModel.user.openid)
? MyColours.color_199095
: MyColours.color_999999))),
child: Text(
content == null || content == '' || content == '请选择'
? "修改"
: content,
style: TextStyle(
color: (Utils.getAuthority(context, title) ||
uid == userModel.user.openid)
? MyColours.color_199095
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(32))),
child: Wrap(
children: [
Text(
content == null || content == '' || content == '请选择'
? "修改"
: content,
maxLines: 2,
textAlign: TextAlign.right,
style: TextStyle(
// decoration: TextDecoration.underline,
overflow: TextOverflow.ellipsis,
color: (Utils.getAuthority(context, title) ||
uid == userModel.user.openid)
? MyColours.color_199095
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(32)))
],
),
),
),
// title == '人数' || title == '消费金额'
... ...
... ... @@ -56,6 +56,7 @@ import '../../provider/customer_provider.dart';
import '../../provider/feast_model.dart';
import '../../provider/marketing_center_provider.dart';
import '../../provider/notebook_detail_model.dart';
import '../../provider/personnel_provider.dart';
import '../../provider/remark_manager_model.dart';
import '../../provider/store_base_info_provider.dart';
import '../../utils/event_bus.dart';
... ... @@ -115,6 +116,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
final XgFlutterPlugin tpush = new XgFlutterPlugin();
PersonnelProvider personnelProvider;
//实现监听
Future<dynamic> platformCallHandler(MethodCall call) async {
switch (call.method) {
... ... @@ -238,6 +241,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
// initPlatformState();
// });
getSellerVersion();
_getAuthUserLists();
initPlatformState();
_getTableList();
... ... @@ -299,6 +303,88 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
});
}
_saveUser(String rolename) async {
if (App.sp.containsKey('user')) {
String s = App.sp.getString('user');
User _user = User.fromJson(json.decode(s));
_user.role_name_addition = rolename;
_user.role_name = '迎宾';
await UserModel().saveUserInfo(_user);
}
}
//获取员工信息列表
_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) {
User user = Provider.of<UserModel>(context, listen: false).user;
if (user.role_name == '管理员') {
personnelProvider.dataMap.admin.listdata.forEach((element) {
if (user.openid == element.id) {
if (element.accountType == '3') {
_saveUser('管理员');
}
}
});
} else if (user.role_name == '店长') {
personnelProvider.dataMap.shopowner.listdata.forEach((element) {
if (user.openid == element.id) {
if (element.accountType == '3') {
_saveUser('店长');
}
}
});
} else if (user.role_name == '客户经理') {
personnelProvider.dataMap.manager.listdata.forEach((element) {
if (user.openid == element.id) {
if (element.accountType == '3') {
_saveUser('客户经理');
}
}
});
} else if (user.role_name == '收银员') {
personnelProvider.dataMap.cashier.listdata.forEach((element) {
if (user.openid == element.id) {
if (element.accountType == '3') {
_saveUser('收银员');
}
}
});
} else if (user.role_name == '服务员') {
personnelProvider.dataMap.waiter.listdata.forEach((element) {
if (user.openid == element.id) {
if (element.accountType == '3') {
_saveUser('服务员');
}
}
});
} else if (user.role_name == '前台') {
personnelProvider.dataMap.reception.listdata.forEach((element) {
if (user.openid == element.id) {
if (element.accountType == '3') {
_saveUser('前台');
}
}
});
} else if (user.role_name == '迎宾') {
personnelProvider.dataMap.welcome.listdata.forEach((element) {
if (user.openid == element.id) {
if (element.accountType == '3') {
_saveUser( '迎宾');
}
}
});
}
}
}
getSellerVersion() async {
await collectStoreProvider.getSellerVersion(context);
if (Constant.normalApp) {
... ... @@ -1550,6 +1636,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
// ScreenUtil.init(context, width: 750, height: 1334);
collectStoreProvider =
Provider.of<CollectStoreProvider>(context, listen: true);
personnelProvider = Provider.of<PersonnelProvider>(context, listen: true);
return new WillPopScope(
child: Scaffold(
bottomNavigationBar: BottomNavigationBar(
... ...
... ... @@ -474,7 +474,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
'员工编号:' +
model.user.account +
" " +
model.user.role_name,
model.user.role_name_addition,
TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_ffffff,
... ...
... ... @@ -25,6 +25,8 @@ import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../../utils/screen_util.dart';
class PersonnelDetailPage extends StatefulWidget {
final int index;
final String position;
... ... @@ -51,7 +53,9 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
String isStoreWine = '0';
Timer timer;
bool isall = false;
bool isbook = false;
bool isserver = false;
@override
void initState() {
super.initState();
... ... @@ -163,6 +167,13 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
} else if (widget.position == '迎宾') {
data = personnelProvider.dataMap.welcome.listdata[widget.index];
}
if (data.accountType == null || data.accountType == '1') {
isall = true;
} else if (data.accountType == '2') {
isbook = true;
} else if (data.accountType == '3') {
isserver = true;
}
nickName = data.nickName != null && data.nickName != 'null'
? data.nickName
: '暂未设置名称';
... ... @@ -171,8 +182,8 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
if (data.openid == null || data.openid == 'null') {
// _getStoreBaseinfo();
_getWechatQrcode();
}else{
_getReplaceWechatQrcode();
} else {
_getReplaceWechatQrcode();
}
uid = data.id;
isStoreWine = data.isStoreWine ?? '0';
... ... @@ -284,7 +295,7 @@ _getReplaceWechatQrcode();
// });
// return list;
// }
///获取二维码
///获取二维码
_getReplaceWechatQrcode({bool need = false}) async {
if (timer != null && timer.isActive) {
timer.cancel();
... ... @@ -323,6 +334,25 @@ _getReplaceWechatQrcode();
// } else {}
}
_itemRadioWidget(bool select, String title, {GestureTapCallback onTap}) {
return InkWell(
onTap: onTap,
child: Row(children: [
Image.asset(
Utils.getImgPath(
select ? 'plan_dish_select' : 'plan_dish_unselect'),
width: w(20),
),
HEmptyView(6),
Text(
title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
),
]));
}
///获取二维码
_getWechatQrcode({bool need = false}) async {
if (timer != null && timer.isActive) {
... ... @@ -361,6 +391,14 @@ _getReplaceWechatQrcode();
// } else {}
}
_setSellerUserAccountType(String accountType) async {
Map<String, String> params = {
'uid': Provider.of<UserModel>(context, listen: false).user.openid,
'account_type': accountType
};
await personnelProvider.setSellerUserAccountType(context, params);
}
@override
Widget build(BuildContext context) {
userModel = Provider.of<UserModel>(context, listen: false);
... ... @@ -514,7 +552,84 @@ _getReplaceWechatQrcode();
)
],
),
VEmptyView(114),
VEmptyView(56),
Container(
height: w(84),
padding:
EdgeInsets.symmetric(horizontal: w(20), vertical: w(12)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'预订与服务权限',
style: TextStyle(
fontSize: font(16), color: MyColours.color_515151),
),
VEmptyView(24),
Container(
height: w(24),
child: Row(
children: [
HEmptyView(32),
_itemRadioWidget(isall, '预订及服务', onTap: () {
if (Utils.getAuthority(context, '设置服务人员')) {
if (!isall) {
setState(() {
isall = true;
isbook = false;
isserver = false;
});
_setSellerUserAccountType('1');
}
} else {
Utils.showToast('您没有相关权限权限');
}
}),
Spacer(),
_itemRadioWidget(isbook, '只订不服', onTap: () {
if (Utils.getAuthority(context, '设置服务人员')) {
if (!isbook) {
setState(() {
isbook = true;
isall = false;
isserver = false;
});
_setSellerUserAccountType('2');
}
} else {
Utils.showToast('您没有相关权限权限');
}
}),
Spacer(),
_itemRadioWidget(isserver, '只服不订', onTap: () {
if (Utils.getAuthority(context, '设置服务人员')) {
if (!isserver) {
setState(() {
isserver = true;
isall = false;
isbook = false;
});
_setSellerUserAccountType('3');
}
} else {
Utils.showToast('您没有相关权限权限');
}
}),
HEmptyView(30),
],
),
)
],
),
),
Padding(
padding: EdgeInsets.only(left: w(20), right: w(16)),
child: MyDivider(double.infinity, w(1),
color: MyColours.color_DBDBDB)),
VEmptyView(32),
(data?.openid == null || data?.openid == 'null')
? RoundButton(
... ... @@ -556,7 +671,7 @@ _getReplaceWechatQrcode();
}
}),
// if (data?.openid == null || data?.openid == 'null')
VEmptyView(48),
VEmptyView(48),
InkWell(
onTap: () {
NavigatorUtil.goPersonnelPasswordEditPage(context,
... ...
... ... @@ -431,6 +431,24 @@ class NotebookDetailModel extends ChangeNotifier {
}
}
// 设置订单服务经理
setServeUidByRid(BuildContext context, Map<String, String> params) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.post, HttpUrl.set_serve_uid_by_rid,
data: params, showLoading: false)
.catchError((error) {
print(error.toString());
return false;
});
if (baseResp.code == Constant.status_success) {
return true;
} else {
Utils.showToast(baseResp.msg);
}
return false;
}
// 编辑订单附加信息
Future<bool> upReserveInfo(BuildContext context, String rid,
... ...
... ... @@ -13,6 +13,8 @@ import 'package:one_key/provider/user_model.dart';
import 'package:one_key/utils/utils.dart';
import 'package:provider/provider.dart';
import '../models/seller_user_account_type.dart';
/**
* 员工管理
*/
... ... @@ -21,6 +23,58 @@ class PersonnelProvider extends ChangeNotifier {
String password = '';
List<FilterBtnModel> sellerManageList = []; //经理数据 ---- 商家编辑页面
int manageSelIndex; //当前选中
List<SellerUserAccountTypeSunModel> serverList = []; //服务人员
/// 设置账号服务类型
Future<bool> setSellerUserAccountType(
BuildContext context, Map<String, String> params,
{showLoading = false}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(
context, Method.post, HttpUrl.set_seller_user_account_type,
data: params, showLoading: showLoading)
.catchError((error) {
print(error.toString());
Utils.showToast('设置失败,请重试');
});
if (baseResp != null && baseResp.code == Constant.status_success) {
if (baseResp.data != '') {
Utils.showToast('设置成功');
return true;
} else {
Utils.showToast(baseResp.msg ?? "设置失败,请重试");
}
} else {
Utils.showToast(baseResp.msg ?? "设置失败,请重试");
}
return false;
}
/// 获取账号服务类型
getSellerUserAccountType(BuildContext context, Map<String, String> params,
{showLoading = false}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.post, HttpUrl.get_seller_user_account_type,
data: params, showLoading: showLoading)
.catchError((error) {
print(error.toString());
});
if (baseResp != null && baseResp.code == Constant.status_success) {
serverList =
SellerUserAccountTypeModel.fromJson(baseResp.responseData).data;
} else {
Utils.showToast(baseResp?.msg ?? "");
}
notifyListeners();
return serverList;
}
///商家详情编辑页面 ------ 获取经理数据
Future<List<FilterBtnModel>> getSellerUserBySellerid(BuildContext context,
... ... @@ -123,6 +177,8 @@ class PersonnelProvider extends ChangeNotifier {
dataMap.reception.hasWechatNum++;
}
}
} else {
Utils.showToast(baseResp?.msg ?? "");
}
... ...
... ... @@ -320,12 +320,14 @@ var homeHandler = new Handler(
create: (_) => CollectStoreProvider(),
child: ChangeNotifierProvider<BaseIndoProvider>(
create: (_) => BaseIndoProvider(),
child: HomePage(
child: ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child:HomePage(
initialIndex: int.parse(initialIndex),
needReresh: needRefresh,
mine: mine,
date: dateTime,
solt: solt)))));
solt: solt))))));
});
// 跳转到主页
... ... @@ -374,12 +376,14 @@ var reserveDetailHandler = new Handler(
create: (_) => MarketingCenterProvider(),
child: ChangeNotifierProvider<CollectStoreProvider>(
create: (_) => CollectStoreProvider(),
child: NotebookDetailPage(
child: ChangeNotifierProvider<PersonnelProvider>(
create: (_) => PersonnelProvider(),
child: NotebookDetailPage(
rid,
mid: mid,
uid: uid,
fromNotify: fromNotify,
))))));
)))))));
});
// 跳转预订详情页
... ...
... ... @@ -42,6 +42,7 @@ import '../models/customer_label_model.dart';
import '../models/get_reserve_type_field_model.dart';
import '../models/radio_model.dart';
import '../models/seller_template_color_list_model.dart';
import '../models/seller_user_account_type.dart';
import '../models/seller_version_model.dart';
import '../models/theme_color_model.dart';
import '../pages/my/marketing_center/theme_model.dart';
... ... @@ -141,6 +142,83 @@ class DialogUtil {
return temp;
}
static List<Widget> serverSelectBtn(
List<SellerUserAccountTypeSunModel> menuSunModel,
state,
CustomCallBackMap callback) {
List<Widget> temp = [];
for (int i = 0; i < menuSunModel.length; i++) {
SellerUserAccountTypeSunModel practiceModel = menuSunModel[i];
temp.add(InkWell(
onTap: () {
for (int j = 0; j < menuSunModel.length; j++) {
menuSunModel[j].select = false;
}
menuSunModel[i].select = true;
callback({
'uid': menuSunModel[i].id,
'name': menuSunModel[i].nickName ?? menuSunModel[i].account
});
state(() {});
},
child: Container(
// height: w(34),
padding:
EdgeInsets.symmetric(horizontal: w(10), vertical: w(5)),
decoration: BoxDecoration(
border: Border.all(
color: practiceModel.select
? MyColours.color_438E93
: MyColours.color_515151,
width: w(1)),
borderRadius: BorderRadius.circular(r(5)),
color: practiceModel.select
? MyColours.color_438E93
: MyColours.color_ffffff,
),
child: Text(practiceModel.nickName ?? practiceModel.account,
style: TextStyle(
fontSize: font(14),
color: practiceModel.select
? MyColours.color_ffffff
: MyColours.color_515151,
)),
))
// RoundButton(
// text: practiceModel.name,
// // bgColor: MyColours.color_ffffff,
// gradientStart: practiceModel.select
// ? MyColours.color_438E93
// : MyColours.color_ffffff,
// gradientEnd: practiceModel.select
// ? MyColours.color_438E93
// : MyColours.color_ffffff,
// // width: w(80),
// padding: EdgeInsets.symmetric(horizontal: w(10), vertical: w(5)),
// height: w(34),
// isBold: false,
// radius: r(5),
// textColor: practiceModel.select
// ? MyColours.color_ffffff
// : MyColours.color_515151,
// borderColor: practiceModel.select
// ? MyColours.color_438E93
// : MyColours.color_515151,
// onPressed: () {
// for (int j = 0; j < menuSunModel.length; j++) {
// menuSunModel[j].select = false;
// }
// menuSunModel[i].select = true;
// callback(menuSunModel[i].name);
// state(() {});
// },
// )
);
}
return temp;
}
static List<Widget> dishSelectBtn(
List<GetReserveTypeFieldsSunModel> menuSunModel,
state,
... ... @@ -319,6 +397,111 @@ class DialogUtil {
});
}
///服务人员
static openServeTypeSelectModalBottomSheet(
context,
List<SellerUserAccountTypeSunModel> servers,
String serve,
String serveuid,
{VoidCallback lCallback,
CustomCallBackMap rCallback}) async {
String selectType = serve;
String uid = serveuid;
if (serveuid != '修改') {
servers.forEach((element) {
element.select = false;
if (element.id == serveuid) {
element.select = true;
}
});
}
final option = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
isDismissible: false,
isScrollControlled: true,
builder: (BuildContext context) {
return StatefulBuilder(builder: (context, state) {
return Container(
padding: EdgeInsets.symmetric(horizontal: w(12)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(10)),
topRight: Radius.circular(ScreenUtil().setWidth(10)))),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop();
},
child: Container(
// width: double.infinity,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: w(15),
vertical: ScreenUtil().setWidth(40)),
child: Text(
"取消",
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_438E93),
),
)),
Container(
// width: double.infinity,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(40)),
child: Text(
"选择服务人员",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E6000000),
),
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pop();
rCallback({'uid': uid, 'name': selectType});
},
child: Container(
// width: double.infinity,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
horizontal: w(15),
vertical: ScreenUtil().setWidth(40)),
child: Text("确定",
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_438E93)),
)),
]),
VEmptyView(50),
Wrap(
spacing: w(12),
runSpacing: w(12),
children: serverSelectBtn(servers, state, (value) {
selectType = value['name'];
uid = value['uid'];
})),
VEmptyView(50),
]));
});
});
servers.forEach((element) {
element.select = false;
});
}
///用餐类型
static openDishTypeSelectModalBottomSheet(context,
List<GetReserveTypeFieldsSunModel> reserveTypes, String reserveType,
... ... @@ -1833,14 +2016,16 @@ class DialogUtil {
HEmptyView(70),
],
),
VEmptyView(40),
Padding(
padding:EdgeInsets.symmetric(horizontal: w(24)),
child: Text('如需把离职员工的客户移交给其他员工,请使用带客情维护功能的周到安排商家软件版本。详情请联系400-000-9690',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color: Color.fromRGBO(0, 0, 0, 0.6)))),
VEmptyView(40),
Padding(
padding:
EdgeInsets.symmetric(horizontal: w(24)),
child: Text(
'如需把离职员工的客户移交给其他员工,请使用带客情维护功能的周到安排商家软件版本。详情请联系400-000-9690',
style: TextStyle(
fontSize: ScreenUtil().setSp(20),
color:
Color.fromRGBO(0, 0, 0, 0.6)))),
VEmptyView(40),
MyDivider(
double.infinity, ScreenUtil().setWidth(2),
... ... @@ -4232,11 +4417,11 @@ class DialogUtil {
List<t.Table> selectTables,
CustomCallBackMap onTap,
CustomCallBackMap onTapDel}) async {
print(isMerge);
print(isLock);
print(isMerge);
print(isLock);
print(selectTables);
print(table.lockTname);
print(selectTables);
print(table.lockTname);
TextEditingController controller = TextEditingController();
controller.text = name;
... ... @@ -4255,7 +4440,12 @@ class DialogUtil {
String rid = table.rid;
String areaName = table.rname;
bool delBtnState = isLock == '1'&&table.lockTname != '' &&table.lockTname != null || isMerge == '1' &&selectTables !=null&&selectTables.length > 0 ? true:false;
bool delBtnState = isLock == '1' &&
table.lockTname != '' &&
table.lockTname != null ||
isMerge == '1' && selectTables != null && selectTables.length > 0
? true
: false;
// StateSetter globalState;
// //输入框焦点
// focusNode.addListener(() {
... ... @@ -4780,13 +4970,17 @@ class DialogUtil {
width: ScreenUtil().setWidth(88 * 2),
height: ScreenUtil().setWidth(36 * 2),
radius: ScreenUtil().setWidth(10),
gradientStart:delBtnState ? MyColours.color_999999 : MyColours.color_E34D59,
gradientEnd:delBtnState ? MyColours.color_999999: MyColours.color_E34D59,
gradientStart: delBtnState
? MyColours.color_999999
: MyColours.color_E34D59,
gradientEnd: delBtnState
? MyColours.color_999999
: MyColours.color_E34D59,
textColor: MyColours.color_ffffff,
isBold: false,
fontSize: 28,
onPressed: () {
if(delBtnState){
if (delBtnState) {
return;
}
DialogUtil.cupertinoAlertDialog(context,
... ... @@ -6409,7 +6603,7 @@ class DialogUtil {
onPress: () {
// NavigatorUtil.goHomePage(context,
// initialIndex: 0);
NavigatorUtil.goHomePageSim(context,
NavigatorUtil.goHomePageSim(context,
initialIndex: 0);
},
)
... ... @@ -6562,7 +6756,6 @@ class DialogUtil {
onPress: () {
NavigatorUtil.goHomePage(context,
initialIndex: 0);
},
)
],
... ... @@ -8399,6 +8592,7 @@ class DialogUtil {
);
return action;
}
///店铺临近过期弹窗
static cupertinoAlertSellerEdateDialogSim(BuildContext context,
{String title = "",
... ... @@ -8842,7 +9036,6 @@ class DialogUtil {
);
}
///店铺临近过期弹窗
static cupertinoAlertSellerHasEdateDialog(BuildContext context,
{String title = "",
... ...