Showing
17 changed files
with
620 additions
and
272 deletions
| @@ -41,15 +41,17 @@ class PersonnelManageModelData extends Object { | @@ -41,15 +41,17 @@ class PersonnelManageModelData extends Object { | ||
| 41 | 41 | ||
| 42 | @JsonKey(name: 'manager') | 42 | @JsonKey(name: 'manager') |
| 43 | Manager manager; | 43 | Manager manager; |
| 44 | + | ||
| 45 | + @JsonKey(name: 'welcome') | ||
| 46 | + Welcome welcome; | ||
| 47 | + | ||
| 48 | + @JsonKey(name: 'reception') | ||
| 49 | + Reception reception; | ||
| 50 | + | ||
| 44 | bool select = false; | 51 | bool select = false; |
| 45 | 52 | ||
| 46 | - PersonnelManageModelData( | ||
| 47 | - this.admin, | ||
| 48 | - this.shopowner, | ||
| 49 | - this.cashier, | ||
| 50 | - this.waiter, | ||
| 51 | - this.manager, | ||
| 52 | - ); | 53 | + PersonnelManageModelData(this.admin, this.shopowner, this.cashier, |
| 54 | + this.waiter, this.manager, this.welcome, this.reception); | ||
| 53 | 55 | ||
| 54 | factory PersonnelManageModelData.fromJson(Map<String, dynamic> srcJson) => | 56 | factory PersonnelManageModelData.fromJson(Map<String, dynamic> srcJson) => |
| 55 | _$PersonnelManageModelDataFromJson(srcJson); | 57 | _$PersonnelManageModelDataFromJson(srcJson); |
| @@ -119,19 +121,18 @@ class PersonnelManageSunModel extends Object { | @@ -119,19 +121,18 @@ class PersonnelManageSunModel extends Object { | ||
| 119 | bool select = false; | 121 | bool select = false; |
| 120 | 122 | ||
| 121 | PersonnelManageSunModel( | 123 | PersonnelManageSunModel( |
| 122 | - this.id, | ||
| 123 | - this.openid, | ||
| 124 | - this.userName, | ||
| 125 | - this.nickName, | ||
| 126 | - this.isFirst, | ||
| 127 | - this.roleId, | ||
| 128 | - this.phone, | ||
| 129 | - this.code, | ||
| 130 | - this.account, | ||
| 131 | - this.isOnCall, | ||
| 132 | - this.headimgurl, | ||
| 133 | - this.isStoreWine | ||
| 134 | - ); | 124 | + this.id, |
| 125 | + this.openid, | ||
| 126 | + this.userName, | ||
| 127 | + this.nickName, | ||
| 128 | + this.isFirst, | ||
| 129 | + this.roleId, | ||
| 130 | + this.phone, | ||
| 131 | + this.code, | ||
| 132 | + this.account, | ||
| 133 | + this.isOnCall, | ||
| 134 | + this.headimgurl, | ||
| 135 | + this.isStoreWine); | ||
| 135 | 136 | ||
| 136 | factory PersonnelManageSunModel.fromJson(Map<String, dynamic> srcJson) => | 137 | factory PersonnelManageSunModel.fromJson(Map<String, dynamic> srcJson) => |
| 137 | _$PersonnelManageSunModelFromJson(srcJson); | 138 | _$PersonnelManageSunModelFromJson(srcJson); |
| @@ -223,3 +224,47 @@ class Manager extends Object { | @@ -223,3 +224,47 @@ class Manager extends Object { | ||
| 223 | 224 | ||
| 224 | Map<String, dynamic> toJson() => _$ManagerToJson(this); | 225 | Map<String, dynamic> toJson() => _$ManagerToJson(this); |
| 225 | } | 226 | } |
| 227 | + | ||
| 228 | +@JsonSerializable() | ||
| 229 | +class Welcome extends Object { | ||
| 230 | + @JsonKey(name: 'listdata') | ||
| 231 | + List<PersonnelManageSunModel> listdata; | ||
| 232 | + | ||
| 233 | + @JsonKey(name: 'role_id') | ||
| 234 | + String roleId; | ||
| 235 | + | ||
| 236 | + int hasWechatNum; //已绑定微信数量 | ||
| 237 | + bool select = false; | ||
| 238 | + | ||
| 239 | + Welcome( | ||
| 240 | + this.listdata, | ||
| 241 | + this.roleId, | ||
| 242 | + ); | ||
| 243 | + | ||
| 244 | + factory Welcome.fromJson(Map<String, dynamic> srcJson) => | ||
| 245 | + _$WelcomeFromJson(srcJson); | ||
| 246 | + | ||
| 247 | + Map<String, dynamic> toJson() => _$WelcomeToJson(this); | ||
| 248 | +} | ||
| 249 | + | ||
| 250 | +@JsonSerializable() | ||
| 251 | +class Reception extends Object { | ||
| 252 | + @JsonKey(name: 'listdata') | ||
| 253 | + List<PersonnelManageSunModel> listdata; | ||
| 254 | + | ||
| 255 | + @JsonKey(name: 'role_id') | ||
| 256 | + String roleId; | ||
| 257 | + | ||
| 258 | + int hasWechatNum; //已绑定微信数量 | ||
| 259 | + bool select = false; | ||
| 260 | + | ||
| 261 | + Reception( | ||
| 262 | + this.listdata, | ||
| 263 | + this.roleId, | ||
| 264 | + ); | ||
| 265 | + | ||
| 266 | + factory Reception.fromJson(Map<String, dynamic> srcJson) => | ||
| 267 | + _$ReceptionFromJson(srcJson); | ||
| 268 | + | ||
| 269 | + Map<String, dynamic> toJson() => _$ReceptionToJson(this); | ||
| 270 | +} |
| @@ -43,6 +43,12 @@ PersonnelManageModelData _$PersonnelManageModelDataFromJson( | @@ -43,6 +43,12 @@ PersonnelManageModelData _$PersonnelManageModelDataFromJson( | ||
| 43 | json['manager'] == null | 43 | json['manager'] == null |
| 44 | ? null | 44 | ? null |
| 45 | : Manager.fromJson(json['manager'] as Map<String, dynamic>), | 45 | : Manager.fromJson(json['manager'] as Map<String, dynamic>), |
| 46 | + json['welcome'] == null | ||
| 47 | + ? null | ||
| 48 | + : Welcome.fromJson(json['welcome'] as Map<String, dynamic>), | ||
| 49 | + json['reception'] == null | ||
| 50 | + ? null | ||
| 51 | + : Reception.fromJson(json['reception'] as Map<String, dynamic>), | ||
| 46 | ); | 52 | ); |
| 47 | } | 53 | } |
| 48 | 54 | ||
| @@ -54,6 +60,8 @@ Map<String, dynamic> _$PersonnelManageModelDataToJson( | @@ -54,6 +60,8 @@ Map<String, dynamic> _$PersonnelManageModelDataToJson( | ||
| 54 | 'cashier': instance.cashier, | 60 | 'cashier': instance.cashier, |
| 55 | 'waiter': instance.waiter, | 61 | 'waiter': instance.waiter, |
| 56 | 'manager': instance.manager, | 62 | 'manager': instance.manager, |
| 63 | + 'welcome': instance.welcome, | ||
| 64 | + 'reception': instance.reception | ||
| 57 | }; | 65 | }; |
| 58 | 66 | ||
| 59 | Admin _$AdminFromJson(Map<String, dynamic> json) { | 67 | Admin _$AdminFromJson(Map<String, dynamic> json) { |
| @@ -170,3 +178,35 @@ Map<String, dynamic> _$ManagerToJson(Manager instance) => <String, dynamic>{ | @@ -170,3 +178,35 @@ Map<String, dynamic> _$ManagerToJson(Manager instance) => <String, dynamic>{ | ||
| 170 | 'listdata': instance.listdata, | 178 | 'listdata': instance.listdata, |
| 171 | 'role_id': instance.roleId, | 179 | 'role_id': instance.roleId, |
| 172 | }; | 180 | }; |
| 181 | + | ||
| 182 | +Welcome _$WelcomeFromJson(Map<String, dynamic> json) { | ||
| 183 | + return Welcome( | ||
| 184 | + (json['listdata'] as List) | ||
| 185 | + ?.map((e) => e == null | ||
| 186 | + ? null | ||
| 187 | + : PersonnelManageSunModel.fromJson(e as Map<String, dynamic>)) | ||
| 188 | + ?.toList(), | ||
| 189 | + json['role_id'] as String, | ||
| 190 | + ); | ||
| 191 | +} | ||
| 192 | + | ||
| 193 | +Map<String, dynamic> _$WelcomeToJson(Welcome instance) => <String, dynamic>{ | ||
| 194 | + 'listdata': instance.listdata, | ||
| 195 | + 'role_id': instance.roleId, | ||
| 196 | + }; | ||
| 197 | + | ||
| 198 | +Reception _$ReceptionFromJson(Map<String, dynamic> json) { | ||
| 199 | + return Reception( | ||
| 200 | + (json['listdata'] as List) | ||
| 201 | + ?.map((e) => e == null | ||
| 202 | + ? null | ||
| 203 | + : PersonnelManageSunModel.fromJson(e as Map<String, dynamic>)) | ||
| 204 | + ?.toList(), | ||
| 205 | + json['role_id'] as String, | ||
| 206 | + ); | ||
| 207 | +} | ||
| 208 | + | ||
| 209 | +Map<String, dynamic> _$ReceptionToJson(Reception instance) => <String, dynamic>{ | ||
| 210 | + 'listdata': instance.listdata, | ||
| 211 | + 'role_id': instance.roleId, | ||
| 212 | + }; |
| @@ -31,7 +31,7 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | @@ -31,7 +31,7 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | ||
| 31 | void initState() { | 31 | void initState() { |
| 32 | // TODO: implement initState | 32 | // TODO: implement initState |
| 33 | super.initState(); | 33 | super.initState(); |
| 34 | - titleList = ['管理员', '店长', '客户经理', '收银员', '服务员']; | 34 | + titleList = ['管理员', '店长', '客户经理', '收银员', '服务员', '前台', '迎宾']; |
| 35 | WidgetsBinding.instance.addPostFrameCallback((timeStamp) { | 35 | WidgetsBinding.instance.addPostFrameCallback((timeStamp) { |
| 36 | _getAuthUserLists(showLoading: false); | 36 | _getAuthUserLists(showLoading: false); |
| 37 | }); | 37 | }); |
| @@ -91,6 +91,18 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | @@ -91,6 +91,18 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | ||
| 91 | item.select = true; | 91 | item.select = true; |
| 92 | } | 92 | } |
| 93 | } | 93 | } |
| 94 | + for (PersonnelManageSunModel item | ||
| 95 | + in personnelProvider.dataMap.reception.listdata) { | ||
| 96 | + if (uid == item.id) { | ||
| 97 | + item.select = true; | ||
| 98 | + } | ||
| 99 | + } | ||
| 100 | + for (PersonnelManageSunModel item | ||
| 101 | + in personnelProvider.dataMap.welcome.listdata) { | ||
| 102 | + if (uid == item.id) { | ||
| 103 | + item.select = true; | ||
| 104 | + } | ||
| 105 | + } | ||
| 94 | } | 106 | } |
| 95 | personnelProvider.dataMap.admin.select = | 107 | personnelProvider.dataMap.admin.select = |
| 96 | !personnelProvider.dataMap.admin.listdata.any((value) { | 108 | !personnelProvider.dataMap.admin.listdata.any((value) { |
| @@ -112,6 +124,14 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | @@ -112,6 +124,14 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | ||
| 112 | !personnelProvider.dataMap.waiter.listdata.any((value) { | 124 | !personnelProvider.dataMap.waiter.listdata.any((value) { |
| 113 | return value.select == false; | 125 | return value.select == false; |
| 114 | }); | 126 | }); |
| 127 | + personnelProvider.dataMap.reception.select = | ||
| 128 | + !personnelProvider.dataMap.reception.listdata.any((value) { | ||
| 129 | + return value.select == false; | ||
| 130 | + }); | ||
| 131 | + personnelProvider.dataMap.welcome.select = | ||
| 132 | + !personnelProvider.dataMap.welcome.listdata.any((value) { | ||
| 133 | + return value.select == false; | ||
| 134 | + }); | ||
| 115 | _btnAllSelect(); | 135 | _btnAllSelect(); |
| 116 | personnelProvider.notifyListeners(); | 136 | personnelProvider.notifyListeners(); |
| 117 | } | 137 | } |
| @@ -123,7 +143,9 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | @@ -123,7 +143,9 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | ||
| 123 | personnelProvider.dataMap.cashier.select && | 143 | personnelProvider.dataMap.cashier.select && |
| 124 | personnelProvider.dataMap.manager.select && | 144 | personnelProvider.dataMap.manager.select && |
| 125 | personnelProvider.dataMap.admin.select && | 145 | personnelProvider.dataMap.admin.select && |
| 126 | - personnelProvider.dataMap.shopowner.select) { | 146 | + personnelProvider.dataMap.shopowner.select && |
| 147 | + personnelProvider.dataMap.reception.select && | ||
| 148 | + personnelProvider.dataMap.welcome.select) { | ||
| 127 | personnelProvider.dataMap.select = true; | 149 | personnelProvider.dataMap.select = true; |
| 128 | } else { | 150 | } else { |
| 129 | personnelProvider.dataMap.select = false; | 151 | personnelProvider.dataMap.select = false; |
| @@ -157,6 +179,8 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | @@ -157,6 +179,8 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | ||
| 157 | personnelProvider.dataMap.manager.select = true; | 179 | personnelProvider.dataMap.manager.select = true; |
| 158 | personnelProvider.dataMap.admin.select = true; | 180 | personnelProvider.dataMap.admin.select = true; |
| 159 | personnelProvider.dataMap.shopowner.select = true; | 181 | personnelProvider.dataMap.shopowner.select = true; |
| 182 | + personnelProvider.dataMap.reception.select = true; | ||
| 183 | + personnelProvider.dataMap.welcome.select = true; | ||
| 160 | for (PersonnelManageSunModel item | 184 | for (PersonnelManageSunModel item |
| 161 | in personnelProvider.dataMap.waiter.listdata) { | 185 | in personnelProvider.dataMap.waiter.listdata) { |
| 162 | item.select = true; | 186 | item.select = true; |
| @@ -177,12 +201,22 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | @@ -177,12 +201,22 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | ||
| 177 | in personnelProvider.dataMap.shopowner.listdata) { | 201 | in personnelProvider.dataMap.shopowner.listdata) { |
| 178 | item.select = true; | 202 | item.select = true; |
| 179 | } | 203 | } |
| 204 | + for (PersonnelManageSunModel item | ||
| 205 | + in personnelProvider.dataMap.reception.listdata) { | ||
| 206 | + item.select = true; | ||
| 207 | + } | ||
| 208 | + for (PersonnelManageSunModel item | ||
| 209 | + in personnelProvider.dataMap.welcome.listdata) { | ||
| 210 | + item.select = true; | ||
| 211 | + } | ||
| 180 | } else { | 212 | } else { |
| 181 | personnelProvider.dataMap.waiter.select = false; | 213 | personnelProvider.dataMap.waiter.select = false; |
| 182 | personnelProvider.dataMap.cashier.select = false; | 214 | personnelProvider.dataMap.cashier.select = false; |
| 183 | personnelProvider.dataMap.manager.select = false; | 215 | personnelProvider.dataMap.manager.select = false; |
| 184 | personnelProvider.dataMap.admin.select = false; | 216 | personnelProvider.dataMap.admin.select = false; |
| 185 | personnelProvider.dataMap.shopowner.select = false; | 217 | personnelProvider.dataMap.shopowner.select = false; |
| 218 | + personnelProvider.dataMap.reception.select = false; | ||
| 219 | + personnelProvider.dataMap.welcome.select = false; | ||
| 186 | for (PersonnelManageSunModel item | 220 | for (PersonnelManageSunModel item |
| 187 | in personnelProvider.dataMap.waiter.listdata) { | 221 | in personnelProvider.dataMap.waiter.listdata) { |
| 188 | item.select = false; | 222 | item.select = false; |
| @@ -203,6 +237,14 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | @@ -203,6 +237,14 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | ||
| 203 | in personnelProvider.dataMap.shopowner.listdata) { | 237 | in personnelProvider.dataMap.shopowner.listdata) { |
| 204 | item.select = false; | 238 | item.select = false; |
| 205 | } | 239 | } |
| 240 | + for (PersonnelManageSunModel item | ||
| 241 | + in personnelProvider.dataMap.reception.listdata) { | ||
| 242 | + item.select = false; | ||
| 243 | + } | ||
| 244 | + for (PersonnelManageSunModel item | ||
| 245 | + in personnelProvider.dataMap.welcome.listdata) { | ||
| 246 | + item.select = false; | ||
| 247 | + } | ||
| 206 | } | 248 | } |
| 207 | setState(() {}); | 249 | setState(() {}); |
| 208 | }, | 250 | }, |
| @@ -261,6 +303,12 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | @@ -261,6 +303,12 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | ||
| 261 | } else if (title == '服务员') { | 303 | } else if (title == '服务员') { |
| 262 | data = personnelProvider.dataMap.waiter.listdata; | 304 | data = personnelProvider.dataMap.waiter.listdata; |
| 263 | select = personnelProvider.dataMap.waiter.select; | 305 | select = personnelProvider.dataMap.waiter.select; |
| 306 | + } else if (title == '前台') { | ||
| 307 | + data = personnelProvider.dataMap.reception.listdata; | ||
| 308 | + select = personnelProvider.dataMap.reception.select; | ||
| 309 | + } else if (title == '迎宾') { | ||
| 310 | + data = personnelProvider.dataMap.welcome.listdata; | ||
| 311 | + select = personnelProvider.dataMap.welcome.select; | ||
| 264 | } | 312 | } |
| 265 | } | 313 | } |
| 266 | 314 | ||
| @@ -304,6 +352,19 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | @@ -304,6 +352,19 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | ||
| 304 | .dataMap.waiter.select; | 352 | .dataMap.waiter.select; |
| 305 | select = personnelProvider | 353 | select = personnelProvider |
| 306 | .dataMap.waiter.select; | 354 | .dataMap.waiter.select; |
| 355 | + } else if (title == '前台') { | ||
| 356 | + personnelProvider | ||
| 357 | + .dataMap.reception.select = | ||
| 358 | + !personnelProvider | ||
| 359 | + .dataMap.reception.select; | ||
| 360 | + select = personnelProvider | ||
| 361 | + .dataMap.reception.select; | ||
| 362 | + } else if (title == '迎宾') { | ||
| 363 | + personnelProvider.dataMap.welcome.select = | ||
| 364 | + !personnelProvider | ||
| 365 | + .dataMap.welcome.select; | ||
| 366 | + select = personnelProvider | ||
| 367 | + .dataMap.welcome.select; | ||
| 307 | } | 368 | } |
| 308 | if (select) { | 369 | if (select) { |
| 309 | for (PersonnelManageSunModel item | 370 | for (PersonnelManageSunModel item |
| @@ -420,6 +481,16 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | @@ -420,6 +481,16 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | ||
| 420 | .dataMap.waiter.select = false; | 481 | .dataMap.waiter.select = false; |
| 421 | select = personnelProvider | 482 | select = personnelProvider |
| 422 | .dataMap.waiter.select; | 483 | .dataMap.waiter.select; |
| 484 | + } else if (title == '前台') { | ||
| 485 | + personnelProvider.dataMap.reception | ||
| 486 | + .select = false; | ||
| 487 | + select = personnelProvider | ||
| 488 | + .dataMap.reception.select; | ||
| 489 | + } else if (title == '迎宾') { | ||
| 490 | + personnelProvider | ||
| 491 | + .dataMap.welcome.select = false; | ||
| 492 | + select = personnelProvider | ||
| 493 | + .dataMap.welcome.select; | ||
| 423 | } | 494 | } |
| 424 | } | 495 | } |
| 425 | } else { | 496 | } else { |
| @@ -449,6 +520,16 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | @@ -449,6 +520,16 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | ||
| 449 | .dataMap.waiter.select = true; | 520 | .dataMap.waiter.select = true; |
| 450 | select = personnelProvider | 521 | select = personnelProvider |
| 451 | .dataMap.waiter.select; | 522 | .dataMap.waiter.select; |
| 523 | + } else if (title == '前台') { | ||
| 524 | + personnelProvider.dataMap.reception | ||
| 525 | + .select = true; | ||
| 526 | + select = personnelProvider | ||
| 527 | + .dataMap.reception.select; | ||
| 528 | + } else if (title == '迎宾') { | ||
| 529 | + personnelProvider | ||
| 530 | + .dataMap.welcome.select = true; | ||
| 531 | + select = personnelProvider | ||
| 532 | + .dataMap.welcome.select; | ||
| 452 | } | 533 | } |
| 453 | _btnAllSelect(); | 534 | _btnAllSelect(); |
| 454 | } | 535 | } |
| @@ -542,6 +623,18 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | @@ -542,6 +623,18 @@ class _CouponToPersonnalPageState extends State<CouponToPersonnalPage> { | ||
| 542 | uids += item.id + ','; | 623 | uids += item.id + ','; |
| 543 | } | 624 | } |
| 544 | } | 625 | } |
| 626 | + for (PersonnelManageSunModel item | ||
| 627 | + in personnelProvider.dataMap.reception.listdata) { | ||
| 628 | + if (item.select) { | ||
| 629 | + uids += item.id + ','; | ||
| 630 | + } | ||
| 631 | + } | ||
| 632 | + for (PersonnelManageSunModel item | ||
| 633 | + in personnelProvider.dataMap.welcome.listdata) { | ||
| 634 | + if (item.select) { | ||
| 635 | + uids += item.id + ','; | ||
| 636 | + } | ||
| 637 | + } | ||
| 545 | if (uids.endsWith(',')) { | 638 | if (uids.endsWith(',')) { |
| 546 | uids = uids.substring(0, uids.length - 1); | 639 | uids = uids.substring(0, uids.length - 1); |
| 547 | } | 640 | } |
| @@ -1219,6 +1219,17 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -1219,6 +1219,17 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 1219 | print(userModel.user.openid); | 1219 | print(userModel.user.openid); |
| 1220 | print(widget.rid); | 1220 | print(widget.rid); |
| 1221 | print(widget.uid); | 1221 | print(widget.uid); |
| 1222 | + bool notDo = userModel.user.role_name != '管理员' && | ||
| 1223 | + userModel.user.role_name != '店长' && | ||
| 1224 | + widget.uid != "null" && | ||
| 1225 | + (widget.uid != userModel.user.openid && | ||
| 1226 | + userModel.user.role_name != '前台') && | ||
| 1227 | + userModel.user.role_name != '前台'; | ||
| 1228 | + | ||
| 1229 | + bool notDoWechat = userModel.user.role_name != '管理员' && | ||
| 1230 | + userModel.user.role_name != '店长' && | ||
| 1231 | + widget.uid != "null" && | ||
| 1232 | + widget.uid != userModel.user.openid; | ||
| 1222 | return Scaffold( | 1233 | return Scaffold( |
| 1223 | resizeToAvoidBottomInset: false, | 1234 | resizeToAvoidBottomInset: false, |
| 1224 | backgroundColor: MyColours.color_ffffff, | 1235 | backgroundColor: MyColours.color_ffffff, |
| @@ -1589,17 +1600,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -1589,17 +1600,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 1589 | detailEntity.cusdem ?? | 1600 | detailEntity.cusdem ?? |
| 1590 | "", | 1601 | "", |
| 1591 | callback: () { | 1602 | callback: () { |
| 1592 | - if (userModel.user | ||
| 1593 | - .role_name != | ||
| 1594 | - '管理员' && | ||
| 1595 | - userModel.user | ||
| 1596 | - .role_name != | ||
| 1597 | - '店长' && | ||
| 1598 | - widget.uid != | ||
| 1599 | - "null" && | ||
| 1600 | - widget.uid != | ||
| 1601 | - userModel.user | ||
| 1602 | - .openid) { | 1603 | + if (notDo) { |
| 1603 | return; | 1604 | return; |
| 1604 | } else { | 1605 | } else { |
| 1605 | //备注弹窗 | 1606 | //备注弹窗 |
| @@ -2162,17 +2163,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2162,17 +2163,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2162 | text: '填写预订人信息', | 2163 | text: '填写预订人信息', |
| 2163 | fontSize: 28, | 2164 | fontSize: 28, |
| 2164 | isBold: false, | 2165 | isBold: false, |
| 2165 | - textColor: userModel.user.role_name != '管理员' && | ||
| 2166 | - userModel | ||
| 2167 | - .user | ||
| 2168 | - .role_name != | ||
| 2169 | - '店长' && | ||
| 2170 | - widget.uid != | ||
| 2171 | - "null" && | ||
| 2172 | - widget.uid != | ||
| 2173 | - userModel | ||
| 2174 | - .user | ||
| 2175 | - .openid | 2166 | + textColor: notDo |
| 2176 | ? MyColours | 2167 | ? MyColours |
| 2177 | .color_999999 | 2168 | .color_999999 |
| 2178 | : Colors.white, | 2169 | : Colors.white, |
| @@ -2182,47 +2173,17 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2182,47 +2173,17 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2182 | .setWidth(240), | 2173 | .setWidth(240), |
| 2183 | radius: ScreenUtil() | 2174 | radius: ScreenUtil() |
| 2184 | .setWidth(10), | 2175 | .setWidth(10), |
| 2185 | - borderColor: userModel.user.role_name != '管理员' && | ||
| 2186 | - userModel | ||
| 2187 | - .user | ||
| 2188 | - .role_name != | ||
| 2189 | - '店长' && | ||
| 2190 | - widget.uid != | ||
| 2191 | - "null" && | ||
| 2192 | - widget.uid != | ||
| 2193 | - userModel | ||
| 2194 | - .user | ||
| 2195 | - .openid | 2176 | + borderColor: notDo |
| 2196 | ? MyColours | 2177 | ? MyColours |
| 2197 | .color_999999 | 2178 | .color_999999 |
| 2198 | : MyColours | 2179 | : MyColours |
| 2199 | .color_199095, | 2180 | .color_199095, |
| 2200 | - gradientStart: userModel.user.role_name != '管理员' && | ||
| 2201 | - userModel | ||
| 2202 | - .user | ||
| 2203 | - .role_name != | ||
| 2204 | - '店长' && | ||
| 2205 | - widget.uid != | ||
| 2206 | - "null" && | ||
| 2207 | - widget.uid != | ||
| 2208 | - userModel | ||
| 2209 | - .user | ||
| 2210 | - .openid | 2181 | + gradientStart: notDo |
| 2211 | ? MyColours | 2182 | ? MyColours |
| 2212 | .color_ffffff | 2183 | .color_ffffff |
| 2213 | : MyColours | 2184 | : MyColours |
| 2214 | .color_199095, | 2185 | .color_199095, |
| 2215 | - gradientEnd: userModel.user.role_name != '管理员' && | ||
| 2216 | - userModel | ||
| 2217 | - .user | ||
| 2218 | - .role_name != | ||
| 2219 | - '店长' && | ||
| 2220 | - widget.uid != | ||
| 2221 | - "null" && | ||
| 2222 | - widget.uid != | ||
| 2223 | - userModel | ||
| 2224 | - .user | ||
| 2225 | - .openid | 2186 | + gradientEnd: notDo |
| 2226 | ? MyColours | 2187 | ? MyColours |
| 2227 | .color_ffffff | 2188 | .color_ffffff |
| 2228 | : MyColours | 2189 | : MyColours |
| @@ -2231,18 +2192,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2231,18 +2192,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2231 | // setState(() { | 2192 | // setState(() { |
| 2232 | // setTop = true; | 2193 | // setTop = true; |
| 2233 | // }); | 2194 | // }); |
| 2234 | - if (userModel.user | ||
| 2235 | - .role_name != | ||
| 2236 | - '管理员' && | ||
| 2237 | - userModel.user | ||
| 2238 | - .role_name != | ||
| 2239 | - '店长' && | ||
| 2240 | - widget.uid != | ||
| 2241 | - "null" && | ||
| 2242 | - widget.uid != | ||
| 2243 | - userModel | ||
| 2244 | - .user | ||
| 2245 | - .openid) { | 2195 | + if (notDo) { |
| 2246 | return; | 2196 | return; |
| 2247 | } else { | 2197 | } else { |
| 2248 | NavigatorUtil | 2198 | NavigatorUtil |
| @@ -2494,20 +2444,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2494,20 +2444,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2494 | null && | 2444 | null && |
| 2495 | formatPhone != | 2445 | formatPhone != |
| 2496 | '') { | 2446 | '') { |
| 2497 | - if (userModel | ||
| 2498 | - .user | ||
| 2499 | - .role_name != | ||
| 2500 | - '管理员' && | ||
| 2501 | - userModel | ||
| 2502 | - .user | ||
| 2503 | - .role_name != | ||
| 2504 | - '店长' && | ||
| 2505 | - widget.uid != | ||
| 2506 | - "null" && | ||
| 2507 | - widget.uid != | ||
| 2508 | - userModel | ||
| 2509 | - .user | ||
| 2510 | - .openid) { | 2447 | + if (notDo) { |
| 2511 | } else { | 2448 | } else { |
| 2512 | DialogUtil | 2449 | DialogUtil |
| 2513 | .goPhone( | 2450 | .goPhone( |
| @@ -2672,11 +2609,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2672,11 +2609,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2672 | flex: 1, | 2609 | flex: 1, |
| 2673 | child: InkWell( | 2610 | child: InkWell( |
| 2674 | onTap: () { | 2611 | onTap: () { |
| 2675 | - NavigatorUtil | ||
| 2676 | - .goOrderAdvanceHomePage( | ||
| 2677 | - context, | ||
| 2678 | - detailEntity, | ||
| 2679 | - widget.rid); | 2612 | + if (!notDoWechat) { |
| 2613 | + NavigatorUtil | ||
| 2614 | + .goOrderAdvanceHomePage( | ||
| 2615 | + context, | ||
| 2616 | + detailEntity, | ||
| 2617 | + widget.rid); | ||
| 2618 | + } | ||
| 2680 | }, | 2619 | }, |
| 2681 | child: Container( | 2620 | child: Container( |
| 2682 | margin: EdgeInsets.only( | 2621 | margin: EdgeInsets.only( |
| @@ -2687,8 +2626,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2687,8 +2626,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2687 | MyColours.color_ffffff, | 2626 | MyColours.color_ffffff, |
| 2688 | border: Border.all( | 2627 | border: Border.all( |
| 2689 | width: w(1), | 2628 | width: w(1), |
| 2690 | - color: MyColours | ||
| 2691 | - .color_438E93), | 2629 | + color: notDoWechat |
| 2630 | + ? MyColours | ||
| 2631 | + .color_999999 | ||
| 2632 | + : MyColours | ||
| 2633 | + .color_438E93), | ||
| 2692 | borderRadius: | 2634 | borderRadius: |
| 2693 | BorderRadius.circular( | 2635 | BorderRadius.circular( |
| 2694 | ScreenUtil() | 2636 | ScreenUtil() |
| @@ -2698,8 +2640,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2698,8 +2640,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2698 | alignment: Alignment.center, | 2640 | alignment: Alignment.center, |
| 2699 | child: Text('预点菜', | 2641 | child: Text('预点菜', |
| 2700 | style: TextStyle( | 2642 | style: TextStyle( |
| 2701 | - color: MyColours | ||
| 2702 | - .color_438E93, | 2643 | + color: notDoWechat |
| 2644 | + ? MyColours | ||
| 2645 | + .color_999999 | ||
| 2646 | + : MyColours | ||
| 2647 | + .color_438E93, | ||
| 2703 | fontSize: | 2648 | fontSize: |
| 2704 | ScreenUtil() | 2649 | ScreenUtil() |
| 2705 | .setSp( | 2650 | .setSp( |
| @@ -2736,17 +2681,20 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2736,17 +2681,20 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2736 | // _nameStr.length - | 2681 | // _nameStr.length - |
| 2737 | // 1); | 2682 | // 1); |
| 2738 | // } | 2683 | // } |
| 2739 | - | ||
| 2740 | - NavigatorUtil | ||
| 2741 | - .goInvicationPage( | ||
| 2742 | - context, | ||
| 2743 | - detailEntity.id, | ||
| 2744 | - ); | 2684 | + if (!notDoWechat) { |
| 2685 | + NavigatorUtil | ||
| 2686 | + .goInvicationPage( | ||
| 2687 | + context, | ||
| 2688 | + detailEntity.id, | ||
| 2689 | + ); | ||
| 2690 | + } | ||
| 2745 | }, | 2691 | }, |
| 2746 | child: Container( | 2692 | child: Container( |
| 2747 | decoration: BoxDecoration( | 2693 | decoration: BoxDecoration( |
| 2748 | - color: | ||
| 2749 | - MyColours.color_199095, | 2694 | + color: notDoWechat |
| 2695 | + ? MyColours.color_999999 | ||
| 2696 | + : MyColours | ||
| 2697 | + .color_199095, | ||
| 2750 | borderRadius: | 2698 | borderRadius: |
| 2751 | BorderRadius.circular( | 2699 | BorderRadius.circular( |
| 2752 | ScreenUtil() | 2700 | ScreenUtil() |
| @@ -3165,10 +3113,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -3165,10 +3113,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 3165 | horizontal: ScreenUtil().setHeight(40)), | 3113 | horizontal: ScreenUtil().setHeight(40)), |
| 3166 | decoration: BoxDecoration( | 3114 | decoration: BoxDecoration( |
| 3167 | border: Border.all( | 3115 | border: Border.all( |
| 3168 | - color: userModel.user.role_name != '管理员' && | ||
| 3169 | - userModel.user.role_name != '店长' && | ||
| 3170 | - widget.uid != "null" && | ||
| 3171 | - widget.uid != userModel.user.openid | 3116 | + color: notDo |
| 3172 | ? MyColours.color_999999 | 3117 | ? MyColours.color_999999 |
| 3173 | : MyColours.color_199095, | 3118 | : MyColours.color_199095, |
| 3174 | width: ScreenUtil().setWidth(2)), | 3119 | width: ScreenUtil().setWidth(2)), |
| @@ -3183,11 +3128,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -3183,11 +3128,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 3183 | Expanded( | 3128 | Expanded( |
| 3184 | child: _cancelAndChangeBtn(() { | 3129 | child: _cancelAndChangeBtn(() { |
| 3185 | print('点击变更预订'); | 3130 | print('点击变更预订'); |
| 3186 | - if (userModel.user.role_name != '管理员' && | ||
| 3187 | - userModel.user.role_name != '店长' && | ||
| 3188 | - widget.uid != "null" && | ||
| 3189 | - widget.uid != | ||
| 3190 | - userModel.user.openid) { | 3131 | + if (notDo) { |
| 3191 | } else { | 3132 | } else { |
| 3192 | NavigatorUtil.goNoteBookChangeFPage( | 3133 | NavigatorUtil.goNoteBookChangeFPage( |
| 3193 | context, | 3134 | context, |
| @@ -3195,50 +3136,24 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -3195,50 +3136,24 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 3195 | widget.rid); | 3136 | widget.rid); |
| 3196 | } | 3137 | } |
| 3197 | }, '变更预订', | 3138 | }, '变更预订', |
| 3198 | - fontColor: userModel | ||
| 3199 | - .user.role_name != | ||
| 3200 | - '管理员' && | ||
| 3201 | - userModel | ||
| 3202 | - .user.role_name != | ||
| 3203 | - '店长' && | ||
| 3204 | - widget.uid != "null" && | ||
| 3205 | - widget.uid != | ||
| 3206 | - userModel.user.openid | 3139 | + fontColor: notDo |
| 3207 | ? MyColours.color_999999 | 3140 | ? MyColours.color_999999 |
| 3208 | : MyColours.color_199095)), | 3141 | : MyColours.color_199095)), |
| 3209 | MyDivider( | 3142 | MyDivider( |
| 3210 | ScreenUtil().setWidth(2), | 3143 | ScreenUtil().setWidth(2), |
| 3211 | ScreenUtil().setWidth(50), | 3144 | ScreenUtil().setWidth(50), |
| 3212 | - color: | ||
| 3213 | - userModel.user.role_name != '管理员' && | ||
| 3214 | - userModel.user.role_name != | ||
| 3215 | - '店长' && | ||
| 3216 | - widget.uid != "null" && | ||
| 3217 | - widget.uid != | ||
| 3218 | - userModel.user.openid | ||
| 3219 | - ? MyColours.color_999999 | ||
| 3220 | - : MyColours.color_199095, | 3145 | + color: notDo |
| 3146 | + ? MyColours.color_999999 | ||
| 3147 | + : MyColours.color_199095, | ||
| 3221 | ), | 3148 | ), |
| 3222 | Expanded( | 3149 | Expanded( |
| 3223 | child: _cancelAndChangeBtn(() { | 3150 | child: _cancelAndChangeBtn(() { |
| 3224 | - if (userModel.user.role_name != '管理员' && | ||
| 3225 | - userModel.user.role_name != '店长' && | ||
| 3226 | - widget.uid != "null" && | ||
| 3227 | - widget.uid != | ||
| 3228 | - userModel.user.openid) { | 3151 | + if (notDo) { |
| 3229 | } else { | 3152 | } else { |
| 3230 | _showCancelWidget(context); | 3153 | _showCancelWidget(context); |
| 3231 | } | 3154 | } |
| 3232 | }, '取消预订', | 3155 | }, '取消预订', |
| 3233 | - fontColor: userModel | ||
| 3234 | - .user.role_name != | ||
| 3235 | - '管理员' && | ||
| 3236 | - userModel | ||
| 3237 | - .user.role_name != | ||
| 3238 | - '店长' && | ||
| 3239 | - widget.uid != "null" && | ||
| 3240 | - widget.uid != | ||
| 3241 | - userModel.user.openid | 3156 | + fontColor: notDo |
| 3242 | ? MyColours.color_999999 | 3157 | ? MyColours.color_999999 |
| 3243 | : MyColours.color_199095)), | 3158 | : MyColours.color_199095)), |
| 3244 | ], | 3159 | ], |
| @@ -3284,15 +3199,19 @@ class TitleAndBtn extends StatelessWidget { | @@ -3284,15 +3199,19 @@ class TitleAndBtn extends StatelessWidget { | ||
| 3284 | @override | 3199 | @override |
| 3285 | Widget build(BuildContext context) { | 3200 | Widget build(BuildContext context) { |
| 3286 | bool hasAuthority = true; // | 3201 | bool hasAuthority = true; // |
| 3287 | - if (title == "备注") { | ||
| 3288 | - UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 3289 | - if (userModel.user.role_name != '管理员' && | ||
| 3290 | - userModel.user.role_name != '店长' && | ||
| 3291 | - uid != "null" && | ||
| 3292 | - uid != userModel.user.openid) { | ||
| 3293 | - hasAuthority = false; | ||
| 3294 | - } | 3202 | + // if (title == "备注") { |
| 3203 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 3204 | + bool notDo = (userModel.user.role_name != '管理员' && | ||
| 3205 | + userModel.user.role_name != '店长' && | ||
| 3206 | + uid != "null" && | ||
| 3207 | + (uid != userModel.user.openid && | ||
| 3208 | + userModel.user.role_name != '前台') && | ||
| 3209 | + userModel.user.role_name != '前台') || | ||
| 3210 | + userModel.user.role_name == '迎宾'; | ||
| 3211 | + if (notDo) { | ||
| 3212 | + hasAuthority = false; | ||
| 3295 | } | 3213 | } |
| 3214 | + // } | ||
| 3296 | 3215 | ||
| 3297 | return Container( | 3216 | return Container( |
| 3298 | color: MyColours.color_ffffff, | 3217 | color: MyColours.color_ffffff, |
| @@ -3312,16 +3231,24 @@ class TitleAndBtn extends StatelessWidget { | @@ -3312,16 +3231,24 @@ class TitleAndBtn extends StatelessWidget { | ||
| 3312 | ), | 3231 | ), |
| 3313 | ), | 3232 | ), |
| 3314 | Spacer(), | 3233 | Spacer(), |
| 3315 | - Text( | ||
| 3316 | - "选填", | ||
| 3317 | - style: TextStyle( | ||
| 3318 | - color: MyColours.color_353535, | ||
| 3319 | - fontSize: ScreenUtil().setSp(30)), | ||
| 3320 | - softWrap: true, | ||
| 3321 | - ), | 3234 | + if (Provider.of<UserModel>(context, listen: false) |
| 3235 | + .user | ||
| 3236 | + .role_name != | ||
| 3237 | + '迎宾') | ||
| 3238 | + Text( | ||
| 3239 | + "选填", | ||
| 3240 | + style: TextStyle( | ||
| 3241 | + color: MyColours.color_353535, | ||
| 3242 | + fontSize: ScreenUtil().setSp(30)), | ||
| 3243 | + softWrap: true, | ||
| 3244 | + ), | ||
| 3322 | HEmptyView(10), | 3245 | HEmptyView(10), |
| 3323 | InkWell( | 3246 | InkWell( |
| 3324 | - onTap: callback, | 3247 | + onTap: () { |
| 3248 | + if (hasAuthority) { | ||
| 3249 | + callback(); | ||
| 3250 | + } | ||
| 3251 | + }, | ||
| 3325 | child: Container( | 3252 | child: Container( |
| 3326 | height: ScreenUtil().setWidth(44), | 3253 | height: ScreenUtil().setWidth(44), |
| 3327 | decoration: BoxDecoration( | 3254 | decoration: BoxDecoration( |
| @@ -3367,6 +3294,7 @@ class TitleAndTextfield extends StatefulWidget { | @@ -3367,6 +3294,7 @@ class TitleAndTextfield extends StatefulWidget { | ||
| 3367 | final bool isPrice; | 3294 | final bool isPrice; |
| 3368 | 3295 | ||
| 3369 | final VoidCallback callback; | 3296 | final VoidCallback callback; |
| 3297 | + final String uid; | ||
| 3370 | 3298 | ||
| 3371 | const TitleAndTextfield( | 3299 | const TitleAndTextfield( |
| 3372 | {Key key, | 3300 | {Key key, |
| @@ -3378,7 +3306,8 @@ class TitleAndTextfield extends StatefulWidget { | @@ -3378,7 +3306,8 @@ class TitleAndTextfield extends StatefulWidget { | ||
| 3378 | this.controller, | 3306 | this.controller, |
| 3379 | this.focusNode, | 3307 | this.focusNode, |
| 3380 | this.isPrice = true, | 3308 | this.isPrice = true, |
| 3381 | - this.callback}) | 3309 | + this.callback, |
| 3310 | + this.uid}) | ||
| 3382 | : super(key: key); | 3311 | : super(key: key); |
| 3383 | 3312 | ||
| 3384 | @override | 3313 | @override |
| @@ -3389,9 +3318,23 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> | @@ -3389,9 +3318,23 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> | ||
| 3389 | with WidgetsBindingObserver { | 3318 | with WidgetsBindingObserver { |
| 3390 | // FocusNode numberFocusNode = new FocusNode(); | 3319 | // FocusNode numberFocusNode = new FocusNode(); |
| 3391 | OverlayEntry overlayEntry; | 3320 | OverlayEntry overlayEntry; |
| 3321 | + bool hasAuthority = true; // | ||
| 3392 | @override | 3322 | @override |
| 3393 | void initState() { | 3323 | void initState() { |
| 3394 | super.initState(); | 3324 | super.initState(); |
| 3325 | + | ||
| 3326 | + // if (title == "备注") { | ||
| 3327 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 3328 | + bool notDo = (userModel.user.role_name != '管理员' && | ||
| 3329 | + userModel.user.role_name != '店长' && | ||
| 3330 | + widget.uid != "null" && | ||
| 3331 | + (widget.uid != userModel.user.openid && | ||
| 3332 | + userModel.user.role_name != '前台') && | ||
| 3333 | + userModel.user.role_name != '前台') || | ||
| 3334 | + userModel.user.role_name == '迎宾'; | ||
| 3335 | + if (notDo) { | ||
| 3336 | + hasAuthority = false; | ||
| 3337 | + } | ||
| 3395 | WidgetsBinding.instance.addObserver(this); | 3338 | WidgetsBinding.instance.addObserver(this); |
| 3396 | // if (Platform.isIOS) { | 3339 | // if (Platform.isIOS) { |
| 3397 | widget.focusNode.addListener(() { | 3340 | widget.focusNode.addListener(() { |
| @@ -3538,13 +3481,14 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> | @@ -3538,13 +3481,14 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> | ||
| 3538 | // widget.detailModel.strTF.trim().length > 0 | 3481 | // widget.detailModel.strTF.trim().length > 0 |
| 3539 | // ? Text("¥", style: TextStyle(color: MyColours.color_199095)) | 3482 | // ? Text("¥", style: TextStyle(color: MyColours.color_199095)) |
| 3540 | // : SizedBox(), | 3483 | // : SizedBox(), |
| 3541 | - Text( | ||
| 3542 | - "选填", | ||
| 3543 | - style: TextStyle( | ||
| 3544 | - color: MyColours.color_353535, | ||
| 3545 | - fontSize: ScreenUtil().setSp(30)), | ||
| 3546 | - softWrap: true, | ||
| 3547 | - ), | 3484 | + if (hasAuthority) |
| 3485 | + Text( | ||
| 3486 | + "选填", | ||
| 3487 | + style: TextStyle( | ||
| 3488 | + color: MyColours.color_353535, | ||
| 3489 | + fontSize: ScreenUtil().setSp(30)), | ||
| 3490 | + softWrap: true, | ||
| 3491 | + ), | ||
| 3548 | HEmptyView(6), | 3492 | HEmptyView(6), |
| 3549 | Container( | 3493 | Container( |
| 3550 | constraints: | 3494 | constraints: |
| @@ -3554,7 +3498,9 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> | @@ -3554,7 +3498,9 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> | ||
| 3554 | border: Border( | 3498 | border: Border( |
| 3555 | bottom: BorderSide( | 3499 | bottom: BorderSide( |
| 3556 | width: ScreenUtil().setWidth(2), | 3500 | width: ScreenUtil().setWidth(2), |
| 3557 | - color: MyColours.color_199095))), | 3501 | + color: hasAuthority |
| 3502 | + ? MyColours.color_199095 | ||
| 3503 | + : MyColours.color_999999))), | ||
| 3558 | child: IntrinsicWidth( | 3504 | child: IntrinsicWidth( |
| 3559 | child: TextField( | 3505 | child: TextField( |
| 3560 | controller: widget.controller, | 3506 | controller: widget.controller, |
| @@ -3563,6 +3509,7 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> | @@ -3563,6 +3509,7 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> | ||
| 3563 | // LengthLimitingTextInputFormatter(9), | 3509 | // LengthLimitingTextInputFormatter(9), |
| 3564 | // FilteringTextInputFormatter.digitsOnly | 3510 | // FilteringTextInputFormatter.digitsOnly |
| 3565 | // ], | 3511 | // ], |
| 3512 | + enabled: hasAuthority, | ||
| 3566 | 3513 | ||
| 3567 | inputFormatters: widget.isPrice | 3514 | inputFormatters: widget.isPrice |
| 3568 | ? [ | 3515 | ? [ |
| @@ -3577,13 +3524,17 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> | @@ -3577,13 +3524,17 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> | ||
| 3577 | //输入文本的样式 | 3524 | //输入文本的样式 |
| 3578 | style: TextStyle( | 3525 | style: TextStyle( |
| 3579 | fontSize: ScreenUtil().setSp(30), | 3526 | fontSize: ScreenUtil().setSp(30), |
| 3580 | - color: MyColours.color_199095), | 3527 | + color: hasAuthority |
| 3528 | + ? MyColours.color_199095 | ||
| 3529 | + : MyColours.color_333333), | ||
| 3581 | textAlign: TextAlign.right, | 3530 | textAlign: TextAlign.right, |
| 3582 | textInputAction: TextInputAction.done, | 3531 | textInputAction: TextInputAction.done, |
| 3583 | decoration: InputDecoration( | 3532 | decoration: InputDecoration( |
| 3584 | hintText: "修改", | 3533 | hintText: "修改", |
| 3585 | hintStyle: TextStyle( | 3534 | hintStyle: TextStyle( |
| 3586 | - color: MyColours.color_199095, | 3535 | + color: hasAuthority |
| 3536 | + ? MyColours.color_199095 | ||
| 3537 | + : MyColours.color_999999, | ||
| 3587 | fontSize: ScreenUtil().setSp(30), | 3538 | fontSize: ScreenUtil().setSp(30), |
| 3588 | ), | 3539 | ), |
| 3589 | prefix: widget.detailModel.strTF != null && | 3540 | prefix: widget.detailModel.strTF != null && |
| @@ -103,26 +103,41 @@ class _FeastBoardPageState extends State<FeastBoardPage> { | @@ -103,26 +103,41 @@ class _FeastBoardPageState extends State<FeastBoardPage> { | ||
| 103 | content, | 103 | content, |
| 104 | hasLeftBorder = true, | 104 | hasLeftBorder = true, |
| 105 | isSelect = false}) { | 105 | isSelect = false}) { |
| 106 | + bool canDo = true; | ||
| 107 | + if (content == '创建宴会') { | ||
| 108 | + canDo = | ||
| 109 | + Provider.of<UserModel>(context, listen: false).user.role_name != '迎宾'; | ||
| 110 | + } | ||
| 111 | + | ||
| 106 | return InkWell( | 112 | return InkWell( |
| 107 | onTap: onPress, | 113 | onTap: onPress, |
| 108 | child: Container( | 114 | child: Container( |
| 109 | height: h(48), | 115 | height: h(48), |
| 110 | decoration: BoxDecoration( | 116 | decoration: BoxDecoration( |
| 111 | - color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff, | 117 | + color: isSelect |
| 118 | + ? canDo | ||
| 119 | + ? MyColours.color_438E93 | ||
| 120 | + : MyColours.color_999999 | ||
| 121 | + : MyColours.color_ffffff, | ||
| 112 | border: Border( | 122 | border: Border( |
| 113 | bottom: BorderSide( | 123 | bottom: BorderSide( |
| 114 | - color: MyColours.color_438E93, | 124 | + color: |
| 125 | + canDo ? MyColours.color_438E93 : MyColours.color_999999, | ||
| 115 | width: ScreenUtil().setWidth(2)), | 126 | width: ScreenUtil().setWidth(2)), |
| 116 | top: BorderSide( | 127 | top: BorderSide( |
| 117 | - color: MyColours.color_438E93, | 128 | + color: |
| 129 | + canDo ? MyColours.color_438E93 : MyColours.color_999999, | ||
| 118 | width: ScreenUtil().setWidth(2)), | 130 | width: ScreenUtil().setWidth(2)), |
| 119 | left: hasLeftBorder | 131 | left: hasLeftBorder |
| 120 | ? BorderSide( | 132 | ? BorderSide( |
| 121 | - color: MyColours.color_438E93, | 133 | + color: canDo |
| 134 | + ? MyColours.color_438E93 | ||
| 135 | + : MyColours.color_999999, | ||
| 122 | width: ScreenUtil().setWidth(2)) | 136 | width: ScreenUtil().setWidth(2)) |
| 123 | : BorderSide.none, | 137 | : BorderSide.none, |
| 124 | right: BorderSide( | 138 | right: BorderSide( |
| 125 | - color: MyColours.color_438E93, | 139 | + color: |
| 140 | + canDo ? MyColours.color_438E93 : MyColours.color_999999, | ||
| 126 | width: ScreenUtil().setWidth(2)))), | 141 | width: ScreenUtil().setWidth(2)))), |
| 127 | child: Align( | 142 | child: Align( |
| 128 | alignment: Alignment.center, | 143 | alignment: Alignment.center, |
| @@ -363,10 +378,10 @@ class _FeastBoardPageState extends State<FeastBoardPage> { | @@ -363,10 +378,10 @@ class _FeastBoardPageState extends State<FeastBoardPage> { | ||
| 363 | // ScreenUtil().setWidth(12), | 378 | // ScreenUtil().setWidth(12), |
| 364 | // ScreenUtil().setWidth(32)), | 379 | // ScreenUtil().setWidth(32)), |
| 365 | padding: EdgeInsets.only( | 380 | padding: EdgeInsets.only( |
| 366 | - bottom: ScreenUtil().setWidth(10), | 381 | + bottom: ScreenUtil().setWidth(0), |
| 367 | left: ScreenUtil().setWidth(5), | 382 | left: ScreenUtil().setWidth(5), |
| 368 | right: ScreenUtil().setWidth(5), | 383 | right: ScreenUtil().setWidth(5), |
| 369 | - top: ScreenUtil().setWidth(10)), | 384 | + top: ScreenUtil().setWidth(0)), |
| 370 | child: Container( | 385 | child: Container( |
| 371 | decoration: BoxDecoration( | 386 | decoration: BoxDecoration( |
| 372 | borderRadius: BorderRadius.circular( | 387 | borderRadius: BorderRadius.circular( |
| @@ -425,10 +440,10 @@ class _FeastBoardPageState extends State<FeastBoardPage> { | @@ -425,10 +440,10 @@ class _FeastBoardPageState extends State<FeastBoardPage> { | ||
| 425 | // ScreenUtil().setWidth(12), | 440 | // ScreenUtil().setWidth(12), |
| 426 | // ScreenUtil().setWidth(32)), | 441 | // ScreenUtil().setWidth(32)), |
| 427 | padding: EdgeInsets.only( | 442 | padding: EdgeInsets.only( |
| 428 | - bottom: ScreenUtil().setWidth(10), | 443 | + bottom: ScreenUtil().setWidth(0), |
| 429 | left: ScreenUtil().setWidth(5), | 444 | left: ScreenUtil().setWidth(5), |
| 430 | right: ScreenUtil().setWidth(5), | 445 | right: ScreenUtil().setWidth(5), |
| 431 | - top: ScreenUtil().setWidth(10)), | 446 | + top: ScreenUtil().setWidth(0)), |
| 432 | child: Container( | 447 | child: Container( |
| 433 | decoration: BoxDecoration( | 448 | decoration: BoxDecoration( |
| 434 | borderRadius: BorderRadius.circular( | 449 | borderRadius: BorderRadius.circular( |
| @@ -604,8 +619,14 @@ class _FeastBoardPageState extends State<FeastBoardPage> { | @@ -604,8 +619,14 @@ class _FeastBoardPageState extends State<FeastBoardPage> { | ||
| 604 | Expanded( | 619 | Expanded( |
| 605 | child: _callButton( | 620 | child: _callButton( |
| 606 | onPress: () async { | 621 | onPress: () async { |
| 607 | - NavigatorUtil.goFeastCreatePage(context, | ||
| 608 | - isCreate: true); | 622 | + if (Provider.of<UserModel>(context, listen: false) |
| 623 | + .user | ||
| 624 | + .role_name != | ||
| 625 | + '迎宾') { | ||
| 626 | + NavigatorUtil.goFeastCreatePage(context, | ||
| 627 | + isCreate: true); | ||
| 628 | + } | ||
| 629 | + | ||
| 609 | }, | 630 | }, |
| 610 | content: '创建宴会', | 631 | content: '创建宴会', |
| 611 | hasLeftBorder: true, | 632 | hasLeftBorder: true, |
| 1 | import 'package:cached_network_image/cached_network_image.dart'; | 1 | import 'package:cached_network_image/cached_network_image.dart'; |
| 2 | import 'package:flutter/material.dart'; | 2 | import 'package:flutter/material.dart'; |
| 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 4 | +import 'package:one_key/provider/user_model.dart'; | ||
| 4 | import 'package:provider/provider.dart'; | 5 | import 'package:provider/provider.dart'; |
| 5 | 6 | ||
| 6 | import '../../constant/state.dart'; | 7 | import '../../constant/state.dart'; |
| @@ -22,6 +23,7 @@ import '../../widgets/v_empty_view.dart'; | @@ -22,6 +23,7 @@ import '../../widgets/v_empty_view.dart'; | ||
| 22 | 23 | ||
| 23 | class FeastDetailPage extends StatefulWidget { | 24 | class FeastDetailPage extends StatefulWidget { |
| 24 | final String rid; | 25 | final String rid; |
| 26 | + | ||
| 25 | final bool canEdit; | 27 | final bool canEdit; |
| 26 | FeastDetailPage({Key key, this.rid, this.canEdit = true}) : super(key: key); | 28 | FeastDetailPage({Key key, this.rid, this.canEdit = true}) : super(key: key); |
| 27 | 29 | ||
| @@ -33,10 +35,13 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | @@ -33,10 +35,13 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | ||
| 33 | FeastModel feastModel; | 35 | FeastModel feastModel; |
| 34 | ScrollController _scrollController = ScrollController(); | 36 | ScrollController _scrollController = ScrollController(); |
| 35 | 37 | ||
| 38 | + bool notDo = true; | ||
| 39 | + | ||
| 36 | @override | 40 | @override |
| 37 | void initState() { | 41 | void initState() { |
| 38 | // TODO: implement initState | 42 | // TODO: implement initState |
| 39 | super.initState(); | 43 | super.initState(); |
| 44 | + | ||
| 40 | Utils.changeStatusColor(color: MyColours.color_438E93); | 45 | Utils.changeStatusColor(color: MyColours.color_438E93); |
| 41 | 46 | ||
| 42 | WidgetsBinding.instance.addPostFrameCallback((_) { | 47 | WidgetsBinding.instance.addPostFrameCallback((_) { |
| @@ -61,6 +66,14 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | @@ -61,6 +66,14 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | ||
| 61 | Map<String, String> pramas = {'rid': widget.rid}; // | 66 | Map<String, String> pramas = {'rid': widget.rid}; // |
| 62 | bool success = await feastModel.getBanquetById(context, pramas); | 67 | bool success = await feastModel.getBanquetById(context, pramas); |
| 63 | if (success) { | 68 | if (success) { |
| 69 | + // UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 70 | + | ||
| 71 | + // notDo = (userModel.user.role_name != '管理员' && | ||
| 72 | + // userModel.user.role_name != '店长' && | ||
| 73 | + // widget.uid != "null" && | ||
| 74 | + // (widget.uid != userModel.user.openid && | ||
| 75 | + // userModel.user.role_name != '前台') && | ||
| 76 | + // userModel.user.role_name != '前台') ||userModel.user.role_name == '迎宾' ; | ||
| 64 | // _uploadImageProvider.feastRemarkContractImageList = []; | 77 | // _uploadImageProvider.feastRemarkContractImageList = []; |
| 65 | // feastModel.banquetDetail.contractInfo.contractImages.forEach((element) { | 78 | // feastModel.banquetDetail.contractInfo.contractImages.forEach((element) { |
| 66 | // UploadImgModel uploadImgModel = UploadImgModel(); | 79 | // UploadImgModel uploadImgModel = UploadImgModel(); |
| @@ -738,26 +751,37 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | @@ -738,26 +751,37 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | ||
| 738 | hasLeftBorder = true, | 751 | hasLeftBorder = true, |
| 739 | Color textColor = MyColours.color_438E93, | 752 | Color textColor = MyColours.color_438E93, |
| 740 | isSelect = false}) { | 753 | isSelect = false}) { |
| 754 | + bool canDo = | ||
| 755 | + Provider.of<UserModel>(context, listen: false).user.role_name != '迎宾'; | ||
| 741 | return InkWell( | 756 | return InkWell( |
| 742 | onTap: onPress, | 757 | onTap: onPress, |
| 743 | child: Container( | 758 | child: Container( |
| 744 | height: h(48), | 759 | height: h(48), |
| 745 | decoration: BoxDecoration( | 760 | decoration: BoxDecoration( |
| 746 | - color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff, | 761 | + color: isSelect |
| 762 | + ? canDo | ||
| 763 | + ? MyColours.color_438E93 | ||
| 764 | + : MyColours.color_999999 | ||
| 765 | + : MyColours.color_ffffff, | ||
| 747 | border: Border( | 766 | border: Border( |
| 748 | bottom: BorderSide( | 767 | bottom: BorderSide( |
| 749 | - color: MyColours.color_438E93, | 768 | + color: |
| 769 | + canDo ? MyColours.color_438E93 : MyColours.color_999999, | ||
| 750 | width: ScreenUtil().setWidth(2)), | 770 | width: ScreenUtil().setWidth(2)), |
| 751 | top: BorderSide( | 771 | top: BorderSide( |
| 752 | - color: MyColours.color_438E93, | 772 | + color: |
| 773 | + canDo ? MyColours.color_438E93 : MyColours.color_999999, | ||
| 753 | width: ScreenUtil().setWidth(2)), | 774 | width: ScreenUtil().setWidth(2)), |
| 754 | left: hasLeftBorder | 775 | left: hasLeftBorder |
| 755 | ? BorderSide( | 776 | ? BorderSide( |
| 756 | - color: MyColours.color_438E93, | 777 | + color: canDo |
| 778 | + ? MyColours.color_438E93 | ||
| 779 | + : MyColours.color_999999, | ||
| 757 | width: ScreenUtil().setWidth(2)) | 780 | width: ScreenUtil().setWidth(2)) |
| 758 | : BorderSide.none, | 781 | : BorderSide.none, |
| 759 | right: BorderSide( | 782 | right: BorderSide( |
| 760 | - color: MyColours.color_438E93, | 783 | + color: |
| 784 | + canDo ? MyColours.color_438E93 : MyColours.color_999999, | ||
| 761 | width: ScreenUtil().setWidth(2)))), | 785 | width: ScreenUtil().setWidth(2)))), |
| 762 | child: Align( | 786 | child: Align( |
| 763 | alignment: Alignment.center, | 787 | alignment: Alignment.center, |
| @@ -1302,20 +1326,39 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | @@ -1302,20 +1326,39 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | ||
| 1302 | Expanded( | 1326 | Expanded( |
| 1303 | child: _callButton( | 1327 | child: _callButton( |
| 1304 | onPress: () { | 1328 | onPress: () { |
| 1305 | - _showCancelWidget(context); | 1329 | + if (Provider.of<UserModel>(context, |
| 1330 | + listen: false) | ||
| 1331 | + .user | ||
| 1332 | + .role_name != | ||
| 1333 | + '迎宾') { | ||
| 1334 | + _showCancelWidget(context); | ||
| 1335 | + } | ||
| 1306 | }, | 1336 | }, |
| 1307 | content: '丢单', | 1337 | content: '丢单', |
| 1308 | hasLeftBorder: true, | 1338 | hasLeftBorder: true, |
| 1309 | - textColor: MyColours.color_E34D59, | 1339 | + textColor: Provider.of<UserModel>(context, |
| 1340 | + listen: false) | ||
| 1341 | + .user | ||
| 1342 | + .role_name != | ||
| 1343 | + '迎宾' | ||
| 1344 | + ? MyColours.color_E34D59 | ||
| 1345 | + : MyColours.color_999999, | ||
| 1310 | isSelect: false)), | 1346 | isSelect: false)), |
| 1311 | Expanded( | 1347 | Expanded( |
| 1312 | child: _callButton( | 1348 | child: _callButton( |
| 1313 | onPress: () async { | 1349 | onPress: () async { |
| 1314 | - NavigatorUtil.goFeastCreatePage(context, | ||
| 1315 | - rid: widget.rid, | ||
| 1316 | - banquetDetail: { | ||
| 1317 | - 'object': feastModel.banquetDetailMap | ||
| 1318 | - }); | 1350 | + if (Provider.of<UserModel>(context, |
| 1351 | + listen: false) | ||
| 1352 | + .user | ||
| 1353 | + .role_name != | ||
| 1354 | + '迎宾') { | ||
| 1355 | + NavigatorUtil.goFeastCreatePage(context, | ||
| 1356 | + rid: widget.rid, | ||
| 1357 | + banquetDetail: { | ||
| 1358 | + 'object': feastModel.banquetDetailMap | ||
| 1359 | + }); | ||
| 1360 | + } | ||
| 1361 | + | ||
| 1319 | // selectMenu = '签约'; | 1362 | // selectMenu = '签约'; |
| 1320 | // menuSet.add('定金'); | 1363 | // menuSet.add('定金'); |
| 1321 | // menuSet.add('签约'); | 1364 | // menuSet.add('签约'); |
| @@ -29,11 +29,13 @@ class FeastPage extends StatefulWidget { | @@ -29,11 +29,13 @@ class FeastPage extends StatefulWidget { | ||
| 29 | class _FeastPageState extends State<FeastPage> { | 29 | class _FeastPageState extends State<FeastPage> { |
| 30 | ScrollController controller = ScrollController(); | 30 | ScrollController controller = ScrollController(); |
| 31 | FeastModel feastModel; | 31 | FeastModel feastModel; |
| 32 | - | 32 | + bool notDo = false; |
| 33 | @override | 33 | @override |
| 34 | void initState() { | 34 | void initState() { |
| 35 | super.initState(); | 35 | super.initState(); |
| 36 | WidgetsBinding.instance.addPostFrameCallback((_) { | 36 | WidgetsBinding.instance.addPostFrameCallback((_) { |
| 37 | + notDo = | ||
| 38 | + Provider.of<UserModel>(context, listen: false).user.role_name == '迎宾'; | ||
| 37 | _getBanquetByTime(); | 39 | _getBanquetByTime(); |
| 38 | _getBanquetBeFollow(); | 40 | _getBanquetBeFollow(); |
| 39 | // scrollController.jumpTo(scrollController.position.minScrollExtent); | 41 | // scrollController.jumpTo(scrollController.position.minScrollExtent); |
| @@ -100,7 +102,9 @@ class _FeastPageState extends State<FeastPage> { | @@ -100,7 +102,9 @@ class _FeastPageState extends State<FeastPage> { | ||
| 100 | title, | 102 | title, |
| 101 | style: TextStyle( | 103 | style: TextStyle( |
| 102 | fontSize: ScreenUtil().setSp(28), | 104 | fontSize: ScreenUtil().setSp(28), |
| 103 | - color: MyColours.color_515151), | 105 | + color: title != '宴会看板' && notDo |
| 106 | + ? MyColours.color_999999 | ||
| 107 | + : MyColours.color_515151), | ||
| 104 | ) | 108 | ) |
| 105 | ], | 109 | ], |
| 106 | )); | 110 | )); |
| @@ -123,15 +127,21 @@ class _FeastPageState extends State<FeastPage> { | @@ -123,15 +127,21 @@ class _FeastPageState extends State<FeastPage> { | ||
| 123 | NavigatorUtil.goFeastBoardPage(context); | 127 | NavigatorUtil.goFeastBoardPage(context); |
| 124 | }), | 128 | }), |
| 125 | upAndDown('y_new', '新建宴会', onTap: () { | 129 | upAndDown('y_new', '新建宴会', onTap: () { |
| 126 | - NavigatorUtil.goFeastCreatePage(context, isCreate: true); | 130 | + if (!notDo) { |
| 131 | + NavigatorUtil.goFeastCreatePage(context, isCreate: true); | ||
| 132 | + } | ||
| 127 | }), | 133 | }), |
| 128 | InkWell( | 134 | InkWell( |
| 129 | onTap: () { | 135 | onTap: () { |
| 130 | - NavigatorUtil.goFeastFollowUpPage(context); | 136 | + if (!notDo) { |
| 137 | + NavigatorUtil.goFeastFollowUpPage(context); | ||
| 138 | + } | ||
| 131 | }, | 139 | }, |
| 132 | child: Stack(clipBehavior: Clip.none, children: [ | 140 | child: Stack(clipBehavior: Clip.none, children: [ |
| 133 | upAndDown('y_schedule', '待跟进', onTap: () { | 141 | upAndDown('y_schedule', '待跟进', onTap: () { |
| 134 | - NavigatorUtil.goFeastFollowUpPage(context); | 142 | + if (!notDo) { |
| 143 | + NavigatorUtil.goFeastFollowUpPage(context); | ||
| 144 | + } | ||
| 135 | }), | 145 | }), |
| 136 | feastModel.beFollowData != null && | 146 | feastModel.beFollowData != null && |
| 137 | feastModel.beFollowData.length > 0 | 147 | feastModel.beFollowData.length > 0 |
| @@ -159,7 +169,9 @@ class _FeastPageState extends State<FeastPage> { | @@ -159,7 +169,9 @@ class _FeastPageState extends State<FeastPage> { | ||
| 159 | : SizedBox() | 169 | : SizedBox() |
| 160 | ])), | 170 | ])), |
| 161 | upAndDown('y_money', '定金管理', onTap: () { | 171 | upAndDown('y_money', '定金管理', onTap: () { |
| 162 | - NavigatorUtil.goFeastDepositDataPage(context); | 172 | + if (!notDo) { |
| 173 | + NavigatorUtil.goFeastDepositDataPage(context); | ||
| 174 | + } | ||
| 163 | }) | 175 | }) |
| 164 | ], | 176 | ], |
| 165 | ), | 177 | ), |
| @@ -126,6 +126,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -126,6 +126,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 126 | WidgetsBinding.instance.addObserver(this); | 126 | WidgetsBinding.instance.addObserver(this); |
| 127 | 127 | ||
| 128 | _currIndex = widget.initialIndex; | 128 | _currIndex = widget.initialIndex; |
| 129 | + | ||
| 130 | + if (Provider.of<UserModel>(context, listen: false).user.role_name == '迎宾') { | ||
| 131 | + _currIndex = 1; | ||
| 132 | + } | ||
| 129 | if (App.sp.containsKey('sellerEdate')) { | 133 | if (App.sp.containsKey('sellerEdate')) { |
| 130 | List<String> data = App.sp.getStringList('sellerEdate'); | 134 | List<String> data = App.sp.getStringList('sellerEdate'); |
| 131 | if (data.contains('-1')) { | 135 | if (data.contains('-1')) { |
| @@ -184,7 +188,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -184,7 +188,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 184 | List<PullMarketingByUidSunModel> data = | 188 | List<PullMarketingByUidSunModel> data = |
| 185 | Provider.of<UserModel>(context, listen: false) | 189 | Provider.of<UserModel>(context, listen: false) |
| 186 | .pullMarketingByUidSunModel; | 190 | .pullMarketingByUidSunModel; |
| 187 | - if (data != null) { | 191 | + if (data != null && |
| 192 | + Provider.of<UserModel>(context, listen: false).user.role_name != | ||
| 193 | + '迎宾') { | ||
| 188 | if (data.length > 0) { | 194 | if (data.length > 0) { |
| 189 | Future.delayed(Duration(milliseconds: 300), () { | 195 | Future.delayed(Duration(milliseconds: 300), () { |
| 190 | DialogUtil.cupertinoAlertDialog(context, | 196 | DialogUtil.cupertinoAlertDialog(context, |
| @@ -223,9 +229,12 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -223,9 +229,12 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 223 | } | 229 | } |
| 224 | }); | 230 | }); |
| 225 | 231 | ||
| 226 | - timer = Timer.periodic(Duration(minutes: 3), (_) { | ||
| 227 | - _getAllUnMessages(); | ||
| 228 | - }); | 232 | + if (Provider.of<UserModel>(context, listen: false).user.role_name != |
| 233 | + '迎宾') { | ||
| 234 | + timer = Timer.periodic(Duration(minutes: 3), (_) { | ||
| 235 | + _getAllUnMessages(); | ||
| 236 | + }); | ||
| 237 | + } | ||
| 229 | 238 | ||
| 230 | _getUnMsgNum(); | 239 | _getUnMsgNum(); |
| 231 | }); | 240 | }); |
| @@ -1259,6 +1268,14 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -1259,6 +1268,14 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 1259 | } | 1268 | } |
| 1260 | } | 1269 | } |
| 1261 | 1270 | ||
| 1271 | + if (Provider.of<UserModel>(context, listen: false) | ||
| 1272 | + .user | ||
| 1273 | + .role_name == | ||
| 1274 | + '迎宾' && | ||
| 1275 | + (index == 0 || index == 2)) { | ||
| 1276 | + return; | ||
| 1277 | + } | ||
| 1278 | + | ||
| 1262 | if (mounted) { | 1279 | if (mounted) { |
| 1263 | setState(() { | 1280 | setState(() { |
| 1264 | _currIndex = index; | 1281 | _currIndex = index; |
| @@ -51,6 +51,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -51,6 +51,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 51 | 51 | ||
| 52 | String outDay = ''; //过期天数 | 52 | String outDay = ''; //过期天数 |
| 53 | DateTime edate; //过期时间 | 53 | DateTime edate; //过期时间 |
| 54 | + bool notDo = false; | ||
| 54 | @override | 55 | @override |
| 55 | void initState() { | 56 | void initState() { |
| 56 | // TODO: implement initState | 57 | // TODO: implement initState |
| @@ -65,6 +66,9 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -65,6 +66,9 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 65 | }); | 66 | }); |
| 66 | }); | 67 | }); |
| 67 | WidgetsBinding.instance.addPostFrameCallback((_) async { | 68 | WidgetsBinding.instance.addPostFrameCallback((_) async { |
| 69 | + notDo = | ||
| 70 | + Provider.of<UserModel>(context, listen: false).user.role_name == '迎宾'; | ||
| 71 | + | ||
| 68 | ///获取商家时间区间内订单数量 | 72 | ///获取商家时间区间内订单数量 |
| 69 | _getSellerReserveTotal(); | 73 | _getSellerReserveTotal(); |
| 70 | 74 | ||
| @@ -516,8 +520,10 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -516,8 +520,10 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 516 | ), | 520 | ), |
| 517 | InkWell( | 521 | InkWell( |
| 518 | onTap: () { | 522 | onTap: () { |
| 519 | - NavigatorUtil.goSmsManagePage(context, | ||
| 520 | - smsInfoData: smsInfoData); | 523 | + if (!notDo) { |
| 524 | + NavigatorUtil.goSmsManagePage(context, | ||
| 525 | + smsInfoData: smsInfoData); | ||
| 526 | + } | ||
| 521 | }, | 527 | }, |
| 522 | child: Column( | 528 | child: Column( |
| 523 | mainAxisAlignment: MainAxisAlignment.center, | 529 | mainAxisAlignment: MainAxisAlignment.center, |
| @@ -547,9 +553,15 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -547,9 +553,15 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 547 | VEmptyView(8), | 553 | VEmptyView(8), |
| 548 | RoundButton( | 554 | RoundButton( |
| 549 | text: '充值短信', | 555 | text: '充值短信', |
| 550 | - gradientStart: MyColours.color_438E93, | ||
| 551 | - gradientEnd: MyColours.color_438E93, | ||
| 552 | - borderColor: MyColours.color_438E93, | 556 | + gradientStart: notDo |
| 557 | + ? MyColours.color_999999 | ||
| 558 | + : MyColours.color_438E93, | ||
| 559 | + gradientEnd: notDo | ||
| 560 | + ? MyColours.color_999999 | ||
| 561 | + : MyColours.color_438E93, | ||
| 562 | + borderColor: notDo | ||
| 563 | + ? MyColours.color_999999 | ||
| 564 | + : MyColours.color_438E93, | ||
| 553 | width: ScreenUtil().setWidth(48 * 2), | 565 | width: ScreenUtil().setWidth(48 * 2), |
| 554 | height: ScreenUtil().setWidth(18 * 2), | 566 | height: ScreenUtil().setWidth(18 * 2), |
| 555 | fontSize: 20, | 567 | fontSize: 20, |
| @@ -557,9 +569,11 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -557,9 +569,11 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 557 | textColor: MyColours.color_ffffff, | 569 | textColor: MyColours.color_ffffff, |
| 558 | radius: ScreenUtil().setWidth(8), | 570 | radius: ScreenUtil().setWidth(8), |
| 559 | onPressed: () { | 571 | onPressed: () { |
| 560 | - NavigatorUtil.goSmsManagePage( | ||
| 561 | - context, | ||
| 562 | - smsInfoData: smsInfoData); | 572 | + if (!notDo) { |
| 573 | + NavigatorUtil.goSmsManagePage( | ||
| 574 | + context, | ||
| 575 | + smsInfoData: smsInfoData); | ||
| 576 | + } | ||
| 563 | }) | 577 | }) |
| 564 | ], | 578 | ], |
| 565 | )), | 579 | )), |
| @@ -573,7 +587,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -573,7 +587,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 573 | onTap: () { | 587 | onTap: () { |
| 574 | // NavigatorUtil.goMyIntegralPage(context, | 588 | // NavigatorUtil.goMyIntegralPage(context, |
| 575 | // sunModel: myModel.integralSunModel); | 589 | // sunModel: myModel.integralSunModel); |
| 576 | - if (outDay != '') { | 590 | + if (outDay != '' && !notDo) { |
| 577 | if (outDay == '0') { | 591 | if (outDay == '0') { |
| 578 | DialogUtil | 592 | DialogUtil |
| 579 | .cupertinoAlertSellerHasEdateDialog( | 593 | .cupertinoAlertSellerHasEdateDialog( |
| @@ -634,9 +648,15 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -634,9 +648,15 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 634 | VEmptyView(8), | 648 | VEmptyView(8), |
| 635 | RoundButton( | 649 | RoundButton( |
| 636 | text: '有效期', | 650 | text: '有效期', |
| 637 | - gradientStart: MyColours.color_438E93, | ||
| 638 | - gradientEnd: MyColours.color_438E93, | ||
| 639 | - borderColor: MyColours.color_438E93, | 651 | + gradientStart: notDo |
| 652 | + ? MyColours.color_999999 | ||
| 653 | + : MyColours.color_438E93, | ||
| 654 | + gradientEnd: notDo | ||
| 655 | + ? MyColours.color_999999 | ||
| 656 | + : MyColours.color_438E93, | ||
| 657 | + borderColor: notDo | ||
| 658 | + ? MyColours.color_999999 | ||
| 659 | + : MyColours.color_438E93, | ||
| 640 | width: ScreenUtil().setWidth(48 * 2), | 660 | width: ScreenUtil().setWidth(48 * 2), |
| 641 | height: ScreenUtil().setWidth(18 * 2), | 661 | height: ScreenUtil().setWidth(18 * 2), |
| 642 | fontSize: 20, | 662 | fontSize: 20, |
| @@ -644,7 +664,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -644,7 +664,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 644 | textColor: MyColours.color_ffffff, | 664 | textColor: MyColours.color_ffffff, |
| 645 | radius: ScreenUtil().setWidth(8), | 665 | radius: ScreenUtil().setWidth(8), |
| 646 | onPressed: () { | 666 | onPressed: () { |
| 647 | - if (outDay != '') { | 667 | + if (outDay != '' && !notDo) { |
| 648 | if (outDay == '0') { | 668 | if (outDay == '0') { |
| 649 | DialogUtil | 669 | DialogUtil |
| 650 | .cupertinoAlertSellerHasEdateDialog( | 670 | .cupertinoAlertSellerHasEdateDialog( |
| @@ -693,11 +713,15 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -693,11 +713,15 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 693 | UserModel userModel = Provider.of<UserModel>(context, listen: false); | 713 | UserModel userModel = Provider.of<UserModel>(context, listen: false); |
| 694 | bool isRoleLow = userModel.user.role_name == '收银员' || | 714 | bool isRoleLow = userModel.user.role_name == '收银员' || |
| 695 | userModel.user.role_name == '服务员' || | 715 | userModel.user.role_name == '服务员' || |
| 696 | - userModel.user.role_name == '客户经理' | 716 | + userModel.user.role_name == '客户经理' || |
| 717 | + userModel.user.role_name == '前台' || | ||
| 718 | + userModel.user.role_name == '迎宾' | ||
| 697 | ? true | 719 | ? true |
| 698 | : false; | 720 | : false; |
| 699 | bool isRoleLowNoManage = userModel.user.role_name == '收银员' || | 721 | bool isRoleLowNoManage = userModel.user.role_name == '收银员' || |
| 700 | - userModel.user.role_name == '服务员' | 722 | + userModel.user.role_name == '服务员' || |
| 723 | + userModel.user.role_name == '前台' || | ||
| 724 | + userModel.user.role_name == '迎宾' | ||
| 701 | ? true | 725 | ? true |
| 702 | : false; | 726 | : false; |
| 703 | return Container( | 727 | return Container( |
| @@ -772,31 +796,42 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -772,31 +796,42 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 772 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, | 796 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, |
| 773 | children: [ | 797 | children: [ |
| 774 | InkWell( | 798 | InkWell( |
| 775 | - onTap: () { | 799 | + onTap: () { |
| 800 | + if (!notDo) { | ||
| 776 | NavigatorUtil.goBaseInfoPage( | 801 | NavigatorUtil.goBaseInfoPage( |
| 777 | context, FromPage.FromPageMyPage); | 802 | context, FromPage.FromPageMyPage); |
| 778 | - }, | ||
| 779 | - child: _item( | ||
| 780 | - Utils.getImgPath('grxx'), '个人信息')), | 803 | + } |
| 804 | + }, | ||
| 805 | + child: _item(Utils.getImgPath('grxx'), '个人信息', | ||
| 806 | + isRowLow: notDo), | ||
| 807 | + ), | ||
| 781 | InkWell( | 808 | InkWell( |
| 782 | onTap: () { | 809 | onTap: () { |
| 783 | - NavigatorUtil.goMyCustomerPage(context); | 810 | + if (!notDo) { |
| 811 | + NavigatorUtil.goMyCustomerPage(context); | ||
| 812 | + } | ||
| 784 | }, | 813 | }, |
| 785 | child: _item( | 814 | child: _item( |
| 786 | - Utils.getImgPath('wdkq'), '我的客情')), | 815 | + Utils.getImgPath('wdkq'), '我的客情', |
| 816 | + isRowLow: notDo)), | ||
| 787 | InkWell( | 817 | InkWell( |
| 788 | onTap: () { | 818 | onTap: () { |
| 789 | - NavigatorUtil.goCouponPage(context); | 819 | + if (!notDo) { |
| 820 | + NavigatorUtil.goCouponPage(context); | ||
| 821 | + } | ||
| 790 | }, | 822 | }, |
| 791 | - child: | ||
| 792 | - _item(Utils.getImgPath('yhq'), '优惠券')), | 823 | + child: _item(Utils.getImgPath('yhq'), '优惠券', |
| 824 | + isRowLow: notDo)), | ||
| 793 | InkWell( | 825 | InkWell( |
| 794 | onTap: () { | 826 | onTap: () { |
| 795 | - NavigatorUtil.goRemarkManagerPage( | ||
| 796 | - context); | 827 | + if (!notDo) { |
| 828 | + NavigatorUtil.goRemarkManagerPage( | ||
| 829 | + context); | ||
| 830 | + } | ||
| 797 | }, | 831 | }, |
| 798 | child: _item( | 832 | child: _item( |
| 799 | - Utils.getImgPath('cybz'), '常用备注')), | 833 | + Utils.getImgPath('cybz'), '常用备注', |
| 834 | + isRowLow: notDo)), | ||
| 800 | ], | 835 | ], |
| 801 | ), | 836 | ), |
| 802 | VEmptyView(68), | 837 | VEmptyView(68), |
| @@ -806,18 +841,25 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -806,18 +841,25 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 806 | children: [ | 841 | children: [ |
| 807 | InkWell( | 842 | InkWell( |
| 808 | onTap: () { | 843 | onTap: () { |
| 809 | - NavigatorUtil.goMyPlanDishHomePage( | ||
| 810 | - context); | 844 | + if (!notDo) { |
| 845 | + NavigatorUtil.goMyPlanDishHomePage( | ||
| 846 | + context); | ||
| 847 | + } | ||
| 811 | }, | 848 | }, |
| 812 | child: _item( | 849 | child: _item( |
| 813 | - Utils.getImgPath('cdgl'), '套餐排菜')), | 850 | + Utils.getImgPath('cdgl'), '套餐排菜', |
| 851 | + isRowLow: notDo)), | ||
| 814 | InkWell( | 852 | InkWell( |
| 815 | onTap: () { | 853 | onTap: () { |
| 816 | - NavigatorUtil.goStoreWineManageHomePage( | ||
| 817 | - context); | 854 | + if (!notDo) { |
| 855 | + NavigatorUtil | ||
| 856 | + .goStoreWineManageHomePage( | ||
| 857 | + context); | ||
| 858 | + } | ||
| 818 | }, | 859 | }, |
| 819 | child: _item( | 860 | child: _item( |
| 820 | - Utils.getImgPath('khcj'), '客户存酒')), | 861 | + Utils.getImgPath('khcj'), '客户存酒', |
| 862 | + isRowLow: notDo)), | ||
| 821 | InkWell( | 863 | InkWell( |
| 822 | onTap: () {}, child: _item('', '空空空空')), | 864 | onTap: () {}, child: _item('', '空空空空')), |
| 823 | InkWell( | 865 | InkWell( |
| @@ -151,6 +151,10 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { | @@ -151,6 +151,10 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { | ||
| 151 | data = personnelProvider.dataMap.cashier.listdata[widget.index]; | 151 | data = personnelProvider.dataMap.cashier.listdata[widget.index]; |
| 152 | } else if (widget.position == '服务员') { | 152 | } else if (widget.position == '服务员') { |
| 153 | data = personnelProvider.dataMap.waiter.listdata[widget.index]; | 153 | data = personnelProvider.dataMap.waiter.listdata[widget.index]; |
| 154 | + } else if (widget.position == '前台') { | ||
| 155 | + data = personnelProvider.dataMap.reception.listdata[widget.index]; | ||
| 156 | + } else if (widget.position == '迎宾') { | ||
| 157 | + data = personnelProvider.dataMap.welcome.listdata[widget.index]; | ||
| 154 | } | 158 | } |
| 155 | nickName = data.nickName != null && data.nickName != 'null' | 159 | nickName = data.nickName != null && data.nickName != 'null' |
| 156 | ? data.nickName | 160 | ? data.nickName |
| @@ -35,7 +35,7 @@ class _PersonnelManagePageState extends State<PersonnelManagePage> { | @@ -35,7 +35,7 @@ class _PersonnelManagePageState extends State<PersonnelManagePage> { | ||
| 35 | void initState() { | 35 | void initState() { |
| 36 | // TODO: implement initState | 36 | // TODO: implement initState |
| 37 | super.initState(); | 37 | super.initState(); |
| 38 | - titleList = ['管理员', '店长', '客户经理', '收银员', '服务员']; | 38 | + titleList = ['管理员', '店长', '客户经理', '收银员', '服务员', '前台', '迎宾']; |
| 39 | WidgetsBinding.instance.addPostFrameCallback((timeStamp) { | 39 | WidgetsBinding.instance.addPostFrameCallback((timeStamp) { |
| 40 | _getAuthUserLists(showLoading: false); | 40 | _getAuthUserLists(showLoading: false); |
| 41 | }); | 41 | }); |
| @@ -158,6 +158,18 @@ class _PersonnelManagePageState extends State<PersonnelManagePage> { | @@ -158,6 +158,18 @@ class _PersonnelManagePageState extends State<PersonnelManagePage> { | ||
| 158 | hasWechatNum = personnelProvider | 158 | hasWechatNum = personnelProvider |
| 159 | .dataMap.waiter.hasWechatNum | 159 | .dataMap.waiter.hasWechatNum |
| 160 | .toString(); | 160 | .toString(); |
| 161 | + } else if (title == '前台') { | ||
| 162 | + data = personnelProvider.dataMap.reception.listdata; | ||
| 163 | + roleId = personnelProvider.dataMap.reception.roleId; | ||
| 164 | + hasWechatNum = personnelProvider | ||
| 165 | + .dataMap.reception.hasWechatNum | ||
| 166 | + .toString(); | ||
| 167 | + } else if (title == '迎宾') { | ||
| 168 | + data = personnelProvider.dataMap.welcome.listdata; | ||
| 169 | + roleId = personnelProvider.dataMap.welcome.roleId; | ||
| 170 | + hasWechatNum = personnelProvider | ||
| 171 | + .dataMap.welcome.hasWechatNum | ||
| 172 | + .toString(); | ||
| 161 | } | 173 | } |
| 162 | } | 174 | } |
| 163 | 175 |
| @@ -173,6 +173,20 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage> | @@ -173,6 +173,20 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage> | ||
| 173 | data = element; | 173 | data = element; |
| 174 | } | 174 | } |
| 175 | }); | 175 | }); |
| 176 | + } else if (userModel.user.role_name == '前台') { | ||
| 177 | + personnelProvider.dataMap.reception.listdata.forEach((element) { | ||
| 178 | + if (element.id == userModel.user.openid) { | ||
| 179 | + //找到自己 | ||
| 180 | + data = element; | ||
| 181 | + } | ||
| 182 | + }); | ||
| 183 | + } else if (userModel.user.role_name == '迎宾') { | ||
| 184 | + personnelProvider.dataMap.welcome.listdata.forEach((element) { | ||
| 185 | + if (element.id == userModel.user.openid) { | ||
| 186 | + //找到自己 | ||
| 187 | + data = element; | ||
| 188 | + } | ||
| 189 | + }); | ||
| 176 | } | 190 | } |
| 177 | 191 | ||
| 178 | isStoreWine = data.isStoreWine == '1' ? true : false; | 192 | isStoreWine = data.isStoreWine == '1' ? true : false; |
| @@ -380,7 +394,6 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage> | @@ -380,7 +394,6 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage> | ||
| 380 | return KeyboardDismissOnTap( | 394 | return KeyboardDismissOnTap( |
| 381 | child: Scaffold( | 395 | child: Scaffold( |
| 382 | resizeToAvoidBottomInset: false, | 396 | resizeToAvoidBottomInset: false, |
| 383 | - | ||
| 384 | appBar: SystemAppBar( | 397 | appBar: SystemAppBar( |
| 385 | '存酒管理', | 398 | '存酒管理', |
| 386 | onTap: () { | 399 | onTap: () { |
| @@ -410,7 +410,10 @@ class NoteBookItemFState extends State<NoteBookItemF> | @@ -410,7 +410,10 @@ class NoteBookItemFState extends State<NoteBookItemF> | ||
| 410 | if (userModel.user.role_name != '管理员' && | 410 | if (userModel.user.role_name != '管理员' && |
| 411 | userModel.user.role_name != '店长' && | 411 | userModel.user.role_name != '店长' && |
| 412 | notebook.uid != "null" && | 412 | notebook.uid != "null" && |
| 413 | - notebook.uid != userModel.user.openid) { | 413 | + (notebook.uid != userModel.user.openid && |
| 414 | + userModel.user.role_name != '前台') && | ||
| 415 | + userModel.user.role_name != '前台' && | ||
| 416 | + userModel.user.role_name != '迎宾') { | ||
| 414 | canDo = false; | 417 | canDo = false; |
| 415 | } else { | 418 | } else { |
| 416 | if (notebook.status == '0' || | 419 | if (notebook.status == '0' || |
| @@ -445,6 +448,10 @@ class NoteBookItemFState extends State<NoteBookItemF> | @@ -445,6 +448,10 @@ class NoteBookItemFState extends State<NoteBookItemF> | ||
| 445 | if (notebook.status == '2') { | 448 | if (notebook.status == '2') { |
| 446 | widthBtn = 208.0; | 449 | widthBtn = 208.0; |
| 447 | } | 450 | } |
| 451 | + if (userModel.user.role_name == '迎宾') { | ||
| 452 | + widthBtn = 328.0; | ||
| 453 | + } | ||
| 454 | + | ||
| 448 | return Stack( | 455 | return Stack( |
| 449 | clipBehavior: Clip.none, | 456 | clipBehavior: Clip.none, |
| 450 | alignment: Alignment.centerRight, | 457 | alignment: Alignment.centerRight, |
| @@ -586,7 +593,7 @@ class NoteBookItemFState extends State<NoteBookItemF> | @@ -586,7 +593,7 @@ class NoteBookItemFState extends State<NoteBookItemF> | ||
| 586 | ), | 593 | ), |
| 587 | notebook.phoneStr.isNotEmpty | 594 | notebook.phoneStr.isNotEmpty |
| 588 | ? Text( | 595 | ? Text( |
| 589 | - '(' + | 596 | + ' (' + |
| 590 | Utils.showEndPhone( | 597 | Utils.showEndPhone( |
| 591 | '${notebook.phoneStr}') + | 598 | '${notebook.phoneStr}') + |
| 592 | ')', | 599 | ')', |
| @@ -775,10 +782,14 @@ class NoteBookItemFState extends State<NoteBookItemF> | @@ -775,10 +782,14 @@ class NoteBookItemFState extends State<NoteBookItemF> | ||
| 775 | setReserveStatus('3'); | 782 | setReserveStatus('3'); |
| 776 | }, | 783 | }, |
| 777 | ), | 784 | ), |
| 778 | - notebook.status == '2' | 785 | + notebook.status == '2' || |
| 786 | + userModel.user.role_name == | ||
| 787 | + '迎宾' | ||
| 779 | ? SizedBox() | 788 | ? SizedBox() |
| 780 | : HEmptyView(44), | 789 | : HEmptyView(44), |
| 781 | - notebook.status == '2' | 790 | + notebook.status == '2' || |
| 791 | + userModel.user.role_name == | ||
| 792 | + '迎宾' | ||
| 782 | ? SizedBox() | 793 | ? SizedBox() |
| 783 | : InkWell( | 794 | : InkWell( |
| 784 | onTap: () { | 795 | onTap: () { |
| @@ -422,7 +422,10 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple> | @@ -422,7 +422,10 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple> | ||
| 422 | if (userModel.user.role_name != '管理员' && | 422 | if (userModel.user.role_name != '管理员' && |
| 423 | userModel.user.role_name != '店长' && | 423 | userModel.user.role_name != '店长' && |
| 424 | notebook.uid != "null" && | 424 | notebook.uid != "null" && |
| 425 | - notebook.uid != userModel.user.openid) { | 425 | + (notebook.uid != userModel.user.openid && |
| 426 | + userModel.user.role_name != '前台') && | ||
| 427 | + userModel.user.role_name != '前台' && | ||
| 428 | + userModel.user.role_name != '迎宾') { | ||
| 426 | canDo = false; | 429 | canDo = false; |
| 427 | } else { | 430 | } else { |
| 428 | if (notebook.status == '0' || | 431 | if (notebook.status == '0' || |
| @@ -457,6 +460,9 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple> | @@ -457,6 +460,9 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple> | ||
| 457 | if (notebook.status == '2') { | 460 | if (notebook.status == '2') { |
| 458 | widthBtn = 208.0; | 461 | widthBtn = 208.0; |
| 459 | } | 462 | } |
| 463 | + if (userModel.user.role_name == '迎宾') { | ||
| 464 | + widthBtn = 328.0; | ||
| 465 | + } | ||
| 460 | return Stack( | 466 | return Stack( |
| 461 | clipBehavior: Clip.none, | 467 | clipBehavior: Clip.none, |
| 462 | alignment: Alignment.centerRight, | 468 | alignment: Alignment.centerRight, |
| @@ -756,10 +762,14 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple> | @@ -756,10 +762,14 @@ class NoteBookItemSimpleState extends State<NoteBookItemSimple> | ||
| 756 | setReserveStatus('3'); | 762 | setReserveStatus('3'); |
| 757 | }, | 763 | }, |
| 758 | ), | 764 | ), |
| 759 | - notebook.status == '2' | 765 | + notebook.status == '2' || |
| 766 | + userModel.user.role_name == | ||
| 767 | + '迎宾' | ||
| 760 | ? SizedBox() | 768 | ? SizedBox() |
| 761 | : HEmptyView(44), | 769 | : HEmptyView(44), |
| 762 | - notebook.status == '2' | 770 | + notebook.status == '2' || |
| 771 | + userModel.user.role_name == | ||
| 772 | + '迎宾' | ||
| 763 | ? SizedBox() | 773 | ? SizedBox() |
| 764 | : InkWell( | 774 | : InkWell( |
| 765 | onTap: () { | 775 | onTap: () { |
| @@ -927,6 +927,18 @@ class FeastModel extends ChangeNotifier { | @@ -927,6 +927,18 @@ class FeastModel extends ChangeNotifier { | ||
| 927 | model.roleName = '服务员'; | 927 | model.roleName = '服务员'; |
| 928 | sellerManageList.add(model); | 928 | sellerManageList.add(model); |
| 929 | } | 929 | } |
| 930 | + | ||
| 931 | + for (PersonnelManageSunModel item in dataMap.reception.listdata) { | ||
| 932 | + FilterBtnModel model = returnModel(item); | ||
| 933 | + model.roleName = '前台'; | ||
| 934 | + sellerManageList.add(model); | ||
| 935 | + } | ||
| 936 | + | ||
| 937 | + for (PersonnelManageSunModel item in dataMap.welcome.listdata) { | ||
| 938 | + FilterBtnModel model = returnModel(item); | ||
| 939 | + model.roleName = '迎宾'; | ||
| 940 | + sellerManageList.add(model); | ||
| 941 | + } | ||
| 930 | pageStatePersonnalHome = PageState.Success; | 942 | pageStatePersonnalHome = PageState.Success; |
| 931 | notifyListeners(); | 943 | notifyListeners(); |
| 932 | return true; | 944 | return true; |
| @@ -1338,7 +1350,9 @@ class FeastModel extends ChangeNotifier { | @@ -1338,7 +1350,9 @@ class FeastModel extends ChangeNotifier { | ||
| 1338 | }; | 1350 | }; |
| 1339 | BaseResp<dynamic> baseResp = await DioUtil() | 1351 | BaseResp<dynamic> baseResp = await DioUtil() |
| 1340 | .request<dynamic>(context, Method.get, HttpUrl.get_setmeal, | 1352 | .request<dynamic>(context, Method.get, HttpUrl.get_setmeal, |
| 1341 | - data: params, showLoading:pageStateSetmeal == PageState.Loading ? false: isShowLoading) | 1353 | + data: params, |
| 1354 | + showLoading: | ||
| 1355 | + pageStateSetmeal == PageState.Loading ? false : isShowLoading) | ||
| 1342 | .catchError((error) { | 1356 | .catchError((error) { |
| 1343 | print(error.toString()); | 1357 | print(error.toString()); |
| 1344 | if (error is MyError) { | 1358 | if (error is MyError) { |
| @@ -1407,7 +1421,9 @@ class FeastModel extends ChangeNotifier { | @@ -1407,7 +1421,9 @@ class FeastModel extends ChangeNotifier { | ||
| 1407 | {isShowLoading = true}) async { | 1421 | {isShowLoading = true}) async { |
| 1408 | BaseResp<dynamic> baseResp = await DioUtil() | 1422 | BaseResp<dynamic> baseResp = await DioUtil() |
| 1409 | .request<dynamic>(context, Method.get, HttpUrl.get_setmeal_by_id, | 1423 | .request<dynamic>(context, Method.get, HttpUrl.get_setmeal_by_id, |
| 1410 | - data: params, showLoading:pageStateMenu == PageState.Loading ? false: isShowLoading) | 1424 | + data: params, |
| 1425 | + showLoading: | ||
| 1426 | + pageStateMenu == PageState.Loading ? false : isShowLoading) | ||
| 1411 | .catchError((error) { | 1427 | .catchError((error) { |
| 1412 | print(error.toString()); | 1428 | print(error.toString()); |
| 1413 | if (error is MyError) { | 1429 | if (error is MyError) { |
| @@ -1695,7 +1711,9 @@ class FeastModel extends ChangeNotifier { | @@ -1695,7 +1711,9 @@ class FeastModel extends ChangeNotifier { | ||
| 1695 | }; | 1711 | }; |
| 1696 | BaseResp<dynamic> baseResp = await DioUtil() | 1712 | BaseResp<dynamic> baseResp = await DioUtil() |
| 1697 | .request<dynamic>(context, Method.get, HttpUrl.get_deposit, | 1713 | .request<dynamic>(context, Method.get, HttpUrl.get_deposit, |
| 1698 | - data: params, showLoading:pageStateDeposit == PageState.Loading ? false: isShowLoading) | 1714 | + data: params, |
| 1715 | + showLoading: | ||
| 1716 | + pageStateDeposit == PageState.Loading ? false : isShowLoading) | ||
| 1699 | .catchError((error) { | 1717 | .catchError((error) { |
| 1700 | print(error.toString()); | 1718 | print(error.toString()); |
| 1701 | if (error is MyError) { | 1719 | if (error is MyError) { |
| @@ -111,6 +111,18 @@ class PersonnelProvider extends ChangeNotifier { | @@ -111,6 +111,18 @@ class PersonnelProvider extends ChangeNotifier { | ||
| 111 | dataMap.waiter.hasWechatNum++; | 111 | dataMap.waiter.hasWechatNum++; |
| 112 | } | 112 | } |
| 113 | } | 113 | } |
| 114 | + dataMap.welcome.hasWechatNum = 0; | ||
| 115 | + for (PersonnelManageSunModel item in dataMap.welcome.listdata) { | ||
| 116 | + if (item.openid != null && item.openid != 'null' && item.openid != '') { | ||
| 117 | + dataMap.welcome.hasWechatNum++; | ||
| 118 | + } | ||
| 119 | + } | ||
| 120 | + dataMap.reception.hasWechatNum = 0; | ||
| 121 | + for (PersonnelManageSunModel item in dataMap.reception.listdata) { | ||
| 122 | + if (item.openid != null && item.openid != 'null' && item.openid != '') { | ||
| 123 | + dataMap.reception.hasWechatNum++; | ||
| 124 | + } | ||
| 125 | + } | ||
| 114 | } else { | 126 | } else { |
| 115 | Utils.showToast(baseResp.msg ?? ""); | 127 | Utils.showToast(baseResp.msg ?? ""); |
| 116 | } | 128 | } |
| @@ -167,7 +179,7 @@ class PersonnelProvider extends ChangeNotifier { | @@ -167,7 +179,7 @@ class PersonnelProvider extends ChangeNotifier { | ||
| 167 | print(error.toString()); | 179 | print(error.toString()); |
| 168 | }); | 180 | }); |
| 169 | if (baseResp != null && baseResp.code == Constant.status_success) { | 181 | if (baseResp != null && baseResp.code == Constant.status_success) { |
| 170 | - if (baseResp.data.length == 1 ) { | 182 | + if (baseResp.data.length == 1) { |
| 171 | return true; | 183 | return true; |
| 172 | } | 184 | } |
| 173 | } else { | 185 | } else { |
| @@ -192,7 +204,7 @@ class PersonnelProvider extends ChangeNotifier { | @@ -192,7 +204,7 @@ class PersonnelProvider extends ChangeNotifier { | ||
| 192 | }); | 204 | }); |
| 193 | if (baseResp != null && baseResp.code == Constant.status_success) { | 205 | if (baseResp != null && baseResp.code == Constant.status_success) { |
| 194 | // if (baseResp.data == 1) { | 206 | // if (baseResp.data == 1) { |
| 195 | - return true; | 207 | + return true; |
| 196 | // } | 208 | // } |
| 197 | } else { | 209 | } else { |
| 198 | Utils.showToast(baseResp.msg ?? ""); | 210 | Utils.showToast(baseResp.msg ?? ""); |
| @@ -1614,7 +1614,8 @@ class DialogUtil { | @@ -1614,7 +1614,8 @@ class DialogUtil { | ||
| 1614 | FocusNode()); //点击空白处隐藏键盘 | 1614 | FocusNode()); //点击空白处隐藏键盘 |
| 1615 | }, | 1615 | }, |
| 1616 | keyboardType: title == '新建套餐' | 1616 | keyboardType: title == '新建套餐' |
| 1617 | - ? TextInputType.numberWithOptions(decimal: true) | 1617 | + ? TextInputType.numberWithOptions( |
| 1618 | + decimal: true) | ||
| 1618 | : TextInputType.text, | 1619 | : TextInputType.text, |
| 1619 | ), | 1620 | ), |
| 1620 | )), | 1621 | )), |
| @@ -1885,7 +1886,8 @@ class DialogUtil { | @@ -1885,7 +1886,8 @@ class DialogUtil { | ||
| 1885 | FocusNode()); //点击空白处隐藏键盘 | 1886 | FocusNode()); //点击空白处隐藏键盘 |
| 1886 | }, | 1887 | }, |
| 1887 | keyboardType: title == '新建套餐' | 1888 | keyboardType: title == '新建套餐' |
| 1888 | - ? TextInputType.numberWithOptions(decimal: true) | 1889 | + ? TextInputType.numberWithOptions( |
| 1890 | + decimal: true) | ||
| 1889 | : TextInputType.text, | 1891 | : TextInputType.text, |
| 1890 | ), | 1892 | ), |
| 1891 | )), | 1893 | )), |
| @@ -3861,7 +3863,8 @@ class DialogUtil { | @@ -3861,7 +3863,8 @@ class DialogUtil { | ||
| 3861 | fontSize: ScreenUtil().setSp(32), | 3863 | fontSize: ScreenUtil().setSp(32), |
| 3862 | ), | 3864 | ), |
| 3863 | ), | 3865 | ), |
| 3864 | - keyboardType: TextInputType.numberWithOptions(decimal: true), | 3866 | + keyboardType: TextInputType.numberWithOptions( |
| 3867 | + decimal: true), | ||
| 3865 | onChanged: (value) { | 3868 | onChanged: (value) { |
| 3866 | state(() {}); | 3869 | state(() {}); |
| 3867 | }, | 3870 | }, |
| @@ -6131,7 +6134,7 @@ class DialogUtil { | @@ -6131,7 +6134,7 @@ class DialogUtil { | ||
| 6131 | child: Container( | 6134 | child: Container( |
| 6132 | padding: | 6135 | padding: |
| 6133 | EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(72)), | 6136 | EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(72)), |
| 6134 | - height: ScreenUtil().setWidth(height), | 6137 | + // height: ScreenUtil().setWidth(height), |
| 6135 | decoration: BoxDecoration( | 6138 | decoration: BoxDecoration( |
| 6136 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(30))), | 6139 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(30))), |
| 6137 | child: Card( | 6140 | child: Card( |
| @@ -6139,6 +6142,7 @@ class DialogUtil { | @@ -6139,6 +6142,7 @@ class DialogUtil { | ||
| 6139 | borderRadius: BorderRadius.all( | 6142 | borderRadius: BorderRadius.all( |
| 6140 | Radius.circular(ScreenUtil().setWidth(30)))), //设置圆角 | 6143 | Radius.circular(ScreenUtil().setWidth(30)))), //设置圆角 |
| 6141 | child: Column( | 6144 | child: Column( |
| 6145 | + mainAxisSize: MainAxisSize.min, | ||
| 6142 | children: [ | 6146 | children: [ |
| 6143 | VEmptyView(40), | 6147 | VEmptyView(40), |
| 6144 | Container( | 6148 | Container( |
-
Please register or login to post a comment