Commit 7322547730e8f81dcc928187d8696dff87aa4cdc

Authored by wdn127929
1 parent f376c561

客户详情店长管理员进入全店客情,其他人自己进入自己,不是自己的置灰

@@ -103,6 +103,7 @@ class NotebookDetail { @@ -103,6 +103,7 @@ class NotebookDetail {
103 OrderInfo orderInfo; 103 OrderInfo orderInfo;
104 String con_amount; 104 String con_amount;
105 String gid; 105 String gid;
  106 + String guest_uid;
106 String place_order_name; //下单人 107 String place_order_name; //下单人
107 108
108 dynamic is_user_comments; //是否评价过 109 dynamic is_user_comments; //是否评价过
@@ -303,7 +304,7 @@ class NotebookDetail { @@ -303,7 +304,7 @@ class NotebookDetail {
303 304
304 @override 305 @override
305 String toString() { 306 String toString() {
306 - 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,place_order_name:$place_order_name,is_user_comments:$is_user_comments,up_date:$up_date}'; 307 + 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,place_order_name:$place_order_name,is_user_comments:$is_user_comments,up_date:$up_date}';
307 } 308 }
308 } 309 }
309 310
@@ -50,6 +50,7 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) { @@ -50,6 +50,7 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) {
50 ? null 50 ? null
51 : OrderInfo.fromJson(json['order_info'] as Map<String, dynamic>) 51 : OrderInfo.fromJson(json['order_info'] as Map<String, dynamic>)
52 ..gid = json['gid'] as String 52 ..gid = json['gid'] as String
  53 + ..guest_uid=json['guest_uid'] as String
53 ..place_order_name = json['place_order_name'] as String 54 ..place_order_name = json['place_order_name'] as String
54 ..is_user_comments = json['is_user_comments'] as dynamic 55 ..is_user_comments = json['is_user_comments'] as dynamic
55 ..up_date = json['up_date'] as String; 56 ..up_date = json['up_date'] as String;
@@ -89,6 +90,7 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) => @@ -89,6 +90,7 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) =>
89 'order': instance.order, 90 'order': instance.order,
90 'order_info': instance.orderInfo, 91 'order_info': instance.orderInfo,
91 'gid': instance.gid, 92 'gid': instance.gid,
  93 + 'guest_uid':instance.guest_uid,
92 'place_order_name': instance.place_order_name, 94 'place_order_name': instance.place_order_name,
93 'is_user_comments': instance.is_user_comments, 95 'is_user_comments': instance.is_user_comments,
94 'up_date':instance.up_date, 96 'up_date':instance.up_date,
@@ -490,4 +490,9 @@ class HttpUrl { @@ -490,4 +490,9 @@ class HttpUrl {
490 static const String get_marketing_sms_template = 490 static const String get_marketing_sms_template =
491 "?service=App.SendSMS.GetMarketingSmsTemplate"; // 获取营销短信模板列表 491 "?service=App.SendSMS.GetMarketingSmsTemplate"; // 获取营销短信模板列表
492 492
  493 +
  494 +static const String get_report_field =
  495 + "?service=App.Seller.GetReportField"; // 获取App导出字段
  496 +
  497 +
493 } 498 }
@@ -52,6 +52,7 @@ import 'package:one_key/models/table.dart' as t; @@ -52,6 +52,7 @@ import 'package:one_key/models/table.dart' as t;
52 import '../../app.dart'; 52 import '../../app.dart';
53 53
54 import '../../models/customer_by_seller_model.dart'; 54 import '../../models/customer_by_seller_model.dart';
  55 +import '../../models/customer_list_model.dart';
55 import '../../models/reserve_deposit_model.dart'; 56 import '../../models/reserve_deposit_model.dart';
56 import '../../provider/collect_store_provider.dart'; 57 import '../../provider/collect_store_provider.dart';
57 import '../../utils/screen_util.dart'; 58 import '../../utils/screen_util.dart';
@@ -1746,6 +1747,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1746,6 +1747,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1746 showMsg: "加载中,请稍后...", 1747 showMsg: "加载中,请稍后...",
1747 ); 1748 );
1748 } else { 1749 } else {
  1750 + bool customerBtnHigh =
  1751 + Provider.of<UserModel>(context, listen: false)
  1752 + .user
  1753 + .openid ==
  1754 + detailEntity.guest_uid;
1749 return Column( 1755 return Column(
1750 children: [ 1756 children: [
1751 Expanded( 1757 Expanded(
@@ -3043,51 +3049,66 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -3043,51 +3049,66 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
3043 .rnameStr, 3049 .rnameStr,
3044 textColor: MyColours 3050 textColor: MyColours
3045 .color_515151), 3051 .color_515151),
3046 - (detailEntity.status ==  
3047 - "4" && 3052 + (detailEntity.status == "4" &&
3048 detailEntity 3053 detailEntity
3049 .cancel != 3054 .cancel !=
3050 null && 3055 null &&
3051 - (detailEntity  
3052 - .phone == 3056 + (detailEntity.phone ==
3053 null || 3057 null ||
3054 - detailEntity  
3055 - .phone == 3058 + detailEntity.phone ==
3056 '')) 3059 ''))
3057 ? SizedBox() 3060 ? SizedBox()
3058 - : InkWell(  
3059 - onTap: () {  
3060 - if (formatPhone !=  
3061 - null &&  
3062 - formatPhone !=  
3063 - '') {  
3064 - if (Utils.getAuthority(  
3065 - context,  
3066 - '订座详情-电话') ||  
3067 - widget.uid ==  
3068 - userModel  
3069 - .user.openid ||  
3070 - (userModel.user.role_name == '店长' &&  
3071 - detailEntity.role_name !=  
3072 - '管理员' &&  
3073 - detailEntity.role_name !=  
3074 - '店长')) {  
3075 - DialogUtil  
3076 - .goPhone(  
3077 - formatPhone);  
3078 - }  
3079 - }  
3080 - },  
3081 - child: RowMultiText(  
3082 - "电话",  
3083 - detailEntity.phone == null  
3084 - ? ''  
3085 - : (Utils.getAuthority(context, '订座详情-电话') || widget.uid == userModel.user.openid || (userModel.user.role_name == '店长' && detailEntity.role_name != '管理员' && detailEntity.role_name != '店长'))  
3086 - ? detailEntity.phone  
3087 - : Utils.starPhone(detailEntity.phone),  
3088 - textColor: MyColours.color_515151,  
3089 - textColorR: MyColours.color_438E93,  
3090 - imageName: 'phone_detail')), 3061 + : InkWell(
  3062 + onTap: () {
  3063 + if (formatPhone !=
  3064 + null &&
  3065 + formatPhone !=
  3066 + '') {
  3067 + if (Utils.getAuthority(
  3068 + context,
  3069 + '订座详情-电话') ||
  3070 + widget.uid ==
  3071 + userModel
  3072 + .user
  3073 + .openid ||
  3074 + (userModel
  3075 + .user.role_name ==
  3076 + '店长' &&
  3077 + detailEntity.role_name !=
  3078 + '管理员' &&
  3079 + detailEntity.role_name !=
  3080 + '店长')) {
  3081 + DialogUtil
  3082 + .goPhone(
  3083 + formatPhone);
  3084 + }
  3085 + }
  3086 + },
  3087 + child: RowMultiText(
  3088 + "电话",
  3089 + detailEntity.phone ==
  3090 + null
  3091 + ? ''
  3092 + : (Utils.getAuthority(context, '订座详情-电话') ||
  3093 + widget.uid ==
  3094 + userModel
  3095 + .user.openid ||
  3096 + (userModel.user.role_name == '店长' &&
  3097 + detailEntity.role_name !=
  3098 + '管理员' &&
  3099 + detailEntity.role_name !=
  3100 + '店长'))
  3101 + ? detailEntity
  3102 + .phone
  3103 + : Utils.starPhone(detailEntity
  3104 + .phone),
  3105 + textColor: MyColours
  3106 + .color_515151,
  3107 + textColorR:
  3108 + MyColours
  3109 + .color_438E93,
  3110 + imageName:
  3111 + 'phone_detail')),
3091 (detailEntity.status == 3112 (detailEntity.status ==
3092 "4" && 3113 "4" &&
3093 detailEntity 3114 detailEntity
@@ -3127,12 +3148,16 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -3127,12 +3148,16 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
3127 w(72), 3148 w(72),
3128 height: 3149 height:
3129 w(22), 3150 w(22),
3130 - borderColor:  
3131 - MyColours  
3132 - .color_438E93,  
3133 - textColor:  
3134 - MyColours  
3135 - .color_438E93, 3151 + borderColor: customerBtnHigh
  3152 + ? MyColours
  3153 + .color_438E93
  3154 + : MyColours
  3155 + .color_999999,
  3156 + textColor: customerBtnHigh
  3157 + ? MyColours
  3158 + .color_438E93
  3159 + : MyColours
  3160 + .color_999999,
3136 gradientStart: 3161 gradientStart:
3137 MyColours 3162 MyColours
3138 .color_ffffff, 3163 .color_ffffff,
@@ -3156,32 +3181,83 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -3156,32 +3181,83 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
3156 (v) {}); 3181 (v) {});
3157 return; 3182 return;
3158 } 3183 }
3159 - //gid 跳转客户详情页面  
3160 - CustomerBySellerSunModel userHistoryEntity = CustomerBySellerSunModel(  
3161 - null,  
3162 - null,  
3163 - detailEntity  
3164 - .phone,  
3165 - null,  
3166 - null,  
3167 - null,  
3168 - null,  
3169 - null,  
3170 - null,  
3171 - null,  
3172 - null, 3184 +
  3185 + //管理员和店长跳转全店客情
  3186 + // 其他人是自己的客户跳转,不是置灰
  3187 +
  3188 + UserModel
  3189 + userModel =
  3190 + Provider.of<UserModel>(
  3191 + context,
  3192 + listen: false);
  3193 +
  3194 + if (userModel.user.role_name ==
  3195 + '管理员' ||
  3196 + userModel.user.role_name ==
  3197 + '店长') {
  3198 + //gid 跳转客户详情页面
  3199 + CustomerBySellerSunModel userHistoryEntity = CustomerBySellerSunModel(
  3200 + null,
  3201 + null,
  3202 + detailEntity.phone,
  3203 + null,
  3204 + null,
  3205 + null,
  3206 + null,
  3207 + null,
  3208 + null,
  3209 + null,
  3210 + null,
  3211 + detailEntity.gid,
  3212 + null,
  3213 + null,
  3214 + null,
  3215 + null);
  3216 + NavigatorUtil.goCustomerDetailPage(
  3217 + context,
  3218 + userHistoryEntity,
  3219 + FromPage.FromPageMessagePage);
  3220 + } else if (userModel
  3221 + .user
  3222 + .openid ==
3173 detailEntity 3223 detailEntity
3174 - .gid,  
3175 - null,  
3176 - null,  
3177 - null,  
3178 - null);  
3179 -  
3180 - NavigatorUtil.goCustomerDetailPage(  
3181 - context,  
3182 - userHistoryEntity,  
3183 - FromPage  
3184 - .FromPageMessagePage); 3224 + .guest_uid) {
  3225 + //当前客户是登录人的客户
  3226 + // 进入我的客户详情
  3227 + CustomerListSunModel userHistoryEntity = CustomerListSunModel(
  3228 + null,
  3229 + null,
  3230 + null,
  3231 + null,
  3232 + null,
  3233 + detailEntity.phone,
  3234 + null,
  3235 + null,
  3236 + null,
  3237 + null,
  3238 + null,
  3239 + null,
  3240 + null,
  3241 + null,
  3242 + null,
  3243 + null,
  3244 + null,
  3245 + null,
  3246 + null,
  3247 + null,
  3248 + null,
  3249 + null,
  3250 + detailEntity.gid,
  3251 + null,
  3252 + null,
  3253 + null);
  3254 +
  3255 + NavigatorUtil.goMyCustomerDetailPage(
  3256 + context,
  3257 + userHistoryEntity,
  3258 + FromPage.FromPageMyCustomer,
  3259 + userModel.user.openid);
  3260 + }
3185 }, 3261 },
3186 ), 3262 ),
3187 )) 3263 ))