Showing
10 changed files
with
195 additions
and
81 deletions
| @@ -157,25 +157,32 @@ class WineManageSunModel { | @@ -157,25 +157,32 @@ class WineManageSunModel { | ||
| 157 | TextEditingController wineNumC = TextEditingController(); //存酒数量 | 157 | TextEditingController wineNumC = TextEditingController(); //存酒数量 |
| 158 | TextEditingController wineUnitC = TextEditingController(); //计量单位 | 158 | TextEditingController wineUnitC = TextEditingController(); //计量单位 |
| 159 | TextEditingController wineSerialC = TextEditingController(); //存酒编号 | 159 | TextEditingController wineSerialC = TextEditingController(); //存酒编号 |
| 160 | + String wineStock; | ||
| 161 | + | ||
| 162 | + String cdate; | ||
| 160 | 163 | ||
| 161 | // List<String> imageData = [ | 164 | // List<String> imageData = [ |
| 162 | // 'https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg', | 165 | // 'https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg', |
| 163 | // 'https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg' | 166 | // 'https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg' |
| 164 | // ]; | 167 | // ]; |
| 165 | 168 | ||
| 166 | - WineManageSunModel({ | ||
| 167 | - this.wineName, | ||
| 168 | - this.wineAmount, | ||
| 169 | - this.unit, | ||
| 170 | - this.wineNumber, | ||
| 171 | - this.img, | ||
| 172 | - }); | 169 | + WineManageSunModel( |
| 170 | + {this.wineName, | ||
| 171 | + this.wineAmount, | ||
| 172 | + this.unit, | ||
| 173 | + this.wineNumber, | ||
| 174 | + this.img, | ||
| 175 | + this.wineStock, | ||
| 176 | + this.cdate}); | ||
| 173 | 177 | ||
| 174 | WineManageSunModel.fromJson(Map<String, dynamic> json) { | 178 | WineManageSunModel.fromJson(Map<String, dynamic> json) { |
| 175 | wineName = json['wine_name']; | 179 | wineName = json['wine_name']; |
| 176 | wineAmount = json['wine_amount']; | 180 | wineAmount = json['wine_amount']; |
| 177 | unit = json['unit']; | 181 | unit = json['unit']; |
| 178 | wineNumber = json['wine_number'] ?? ""; | 182 | wineNumber = json['wine_number'] ?? ""; |
| 183 | + wineStock = json['wine_stock'] ?? ""; | ||
| 184 | + cdate = json['cdate'] ?? ""; | ||
| 185 | + | ||
| 179 | img = <UploadImgModel>[]; | 186 | img = <UploadImgModel>[]; |
| 180 | if (json['img'] != null) { | 187 | if (json['img'] != null) { |
| 181 | img = <UploadImgModel>[]; | 188 | img = <UploadImgModel>[]; |
| @@ -204,6 +211,8 @@ class WineManageSunModel { | @@ -204,6 +211,8 @@ class WineManageSunModel { | ||
| 204 | data['unit'] = this.unit; | 211 | data['unit'] = this.unit; |
| 205 | data['wine_number'] = this.wineNumber; | 212 | data['wine_number'] = this.wineNumber; |
| 206 | data['img'] = this.img; | 213 | data['img'] = this.img; |
| 214 | + data['wine_stock'] = this.wineStock; | ||
| 215 | + data['cdate'] = this.cdate; | ||
| 207 | 216 | ||
| 208 | return data; | 217 | return data; |
| 209 | } | 218 | } |
| @@ -216,6 +225,8 @@ class WineManageSunMoveModel { | @@ -216,6 +225,8 @@ class WineManageSunMoveModel { | ||
| 216 | String wineNumber; | 225 | String wineNumber; |
| 217 | List<String> img; | 226 | List<String> img; |
| 218 | String checkAmount; | 227 | String checkAmount; |
| 228 | + String wineStock; | ||
| 229 | + String cdate; | ||
| 219 | // TextEditingController wineNameC = TextEditingController(); //酒品名称 | 230 | // TextEditingController wineNameC = TextEditingController(); //酒品名称 |
| 220 | TextEditingController wineNumC = TextEditingController(); //存酒数量 | 231 | TextEditingController wineNumC = TextEditingController(); //存酒数量 |
| 221 | // TextEditingController wineUnitC = TextEditingController(); //计量单位 | 232 | // TextEditingController wineUnitC = TextEditingController(); //计量单位 |
| @@ -226,14 +237,15 @@ class WineManageSunMoveModel { | @@ -226,14 +237,15 @@ class WineManageSunMoveModel { | ||
| 226 | // 'https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg' | 237 | // 'https://www.ssfiction.com/wp-content/uploads/2020/08/20200805_5f2b1669e9a24.jpg' |
| 227 | // ]; | 238 | // ]; |
| 228 | 239 | ||
| 229 | - WineManageSunMoveModel({ | ||
| 230 | - this.wineName, | ||
| 231 | - this.wineAmount, | ||
| 232 | - this.unit, | ||
| 233 | - this.wineNumber, | ||
| 234 | - this.checkAmount, | ||
| 235 | - this.img, | ||
| 236 | - }); | 240 | + WineManageSunMoveModel( |
| 241 | + {this.wineName, | ||
| 242 | + this.wineAmount, | ||
| 243 | + this.unit, | ||
| 244 | + this.wineNumber, | ||
| 245 | + this.checkAmount, | ||
| 246 | + this.img, | ||
| 247 | + this.wineStock, | ||
| 248 | + this.cdate}); | ||
| 237 | 249 | ||
| 238 | WineManageSunMoveModel.fromJson(Map<String, dynamic> json) { | 250 | WineManageSunMoveModel.fromJson(Map<String, dynamic> json) { |
| 239 | wineName = json['wine_name']; | 251 | wineName = json['wine_name']; |
| @@ -242,6 +254,8 @@ class WineManageSunMoveModel { | @@ -242,6 +254,8 @@ class WineManageSunMoveModel { | ||
| 242 | unit = json['unit']; | 254 | unit = json['unit']; |
| 243 | wineNumber = json['wine_number'] ?? ""; | 255 | wineNumber = json['wine_number'] ?? ""; |
| 244 | checkAmount = json['check_amount'] ?? ''; | 256 | checkAmount = json['check_amount'] ?? ''; |
| 257 | + wineStock = json['wine_stock'] ?? ""; | ||
| 258 | + cdate = json['cdate'] ?? ""; | ||
| 245 | 259 | ||
| 246 | // wineNumC.text = wineNumber; | 260 | // wineNumC.text = wineNumber; |
| 247 | 261 | ||
| @@ -267,6 +281,9 @@ class WineManageSunMoveModel { | @@ -267,6 +281,9 @@ class WineManageSunMoveModel { | ||
| 267 | data['wine_number'] = this.wineNumber; | 281 | data['wine_number'] = this.wineNumber; |
| 268 | data['check_amount'] = this.checkAmount; | 282 | data['check_amount'] = this.checkAmount; |
| 269 | data['img'] = this.img; | 283 | data['img'] = this.img; |
| 284 | + data['wine_stock'] = this.wineStock; | ||
| 285 | + data['cdate'] = this.cdate; | ||
| 286 | + | ||
| 270 | return data; | 287 | return data; |
| 271 | } | 288 | } |
| 272 | } | 289 | } |
| @@ -775,10 +775,12 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | @@ -775,10 +775,12 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> { | ||
| 775 | 775 | ||
| 776 | //接口 | 776 | //接口 |
| 777 | Map marketingData = { | 777 | Map marketingData = { |
| 778 | - 'is_transpond': is_transpond ? '1' : '0', | ||
| 779 | - 'is_arrival': is_arrival ? '1' : '0', | ||
| 780 | - 'is_online_book': is_online_book ? '1' : '0', | ||
| 781 | - 'is_order': is_order ? '1' : '0', | 778 | + 'is_transpond': is_transpond ? '1' : '0', //转发同行客人 |
| 779 | + 'is_arrival': is_arrival ? '1' : '0', //确认到店 | ||
| 780 | + 'is_online_book': is_online_book ? '1' : '0', //在线预订 | ||
| 781 | + 'is_order': is_order ? '1' : '0', //去点餐 | ||
| 782 | + 'is_coupon': '0', //代金券暂时 | ||
| 783 | + 'is_recharge': '0', //充值券暂时 | ||
| 782 | 'is_link': is_link ? '1' : '0', | 784 | 'is_link': is_link ? '1' : '0', |
| 783 | 'wecomle': welcomeTextC.text, | 785 | 'wecomle': welcomeTextC.text, |
| 784 | 'logo': _uploadImageProvider.firstImage.qiniuUrl, | 786 | 'logo': _uploadImageProvider.firstImage.qiniuUrl, |
| @@ -119,8 +119,9 @@ class _ApplyOutStoreItemPageState extends State<ApplyOutStoreItemPage> { | @@ -119,8 +119,9 @@ class _ApplyOutStoreItemPageState extends State<ApplyOutStoreItemPage> { | ||
| 119 | return; | 119 | return; |
| 120 | } | 120 | } |
| 121 | widget.wineManageSunModel.checkAmount = value; | 121 | widget.wineManageSunModel.checkAmount = value; |
| 122 | - controller.text = value; | 122 | + // controller.text = value; |
| 123 | } | 123 | } |
| 124 | + | ||
| 124 | 125 | ||
| 125 | // if (value.trim().isEmpty || value.trim().length > 11) { | 126 | // if (value.trim().isEmpty || value.trim().length > 11) { |
| 126 | // //内容为空,或 超过11位 | 127 | // //内容为空,或 超过11位 |
| @@ -39,8 +39,8 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> { | @@ -39,8 +39,8 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> { | ||
| 39 | super.initState(); | 39 | super.initState(); |
| 40 | 40 | ||
| 41 | widget.wineManageDetail.wineDataMove.forEach((element) { | 41 | widget.wineManageDetail.wineDataMove.forEach((element) { |
| 42 | - element.wineNumC.text = element.wineAmount; //出库数量初始化剩余库存量 | ||
| 43 | - element.checkAmount = element.wineAmount; //出库数量初始化剩余库存量 | 42 | + element.wineNumC.text = element.wineStock; //出库数量初始化剩余库存量 |
| 43 | + element.checkAmount = element.wineStock; //出库数量初始化剩余库存量 | ||
| 44 | }); | 44 | }); |
| 45 | } | 45 | } |
| 46 | 46 |
| 1 | import 'dart:convert'; | 1 | import 'dart:convert'; |
| 2 | 2 | ||
| 3 | +import 'package:common_utils/common_utils.dart'; | ||
| 3 | import 'package:flutter/material.dart'; | 4 | import 'package:flutter/material.dart'; |
| 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 5 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 5 | import 'package:one_key/pages/my/store_wine_manage/create_wine_item_page.dart'; | 6 | import 'package:one_key/pages/my/store_wine_manage/create_wine_item_page.dart'; |
| @@ -469,6 +470,8 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { | @@ -469,6 +470,8 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { | ||
| 469 | } | 470 | } |
| 470 | } | 471 | } |
| 471 | if (can) { | 472 | if (can) { |
| 473 | + String cdate = DateUtil.formatDate(DateTime.now(), | ||
| 474 | + format: DateFormats.full); | ||
| 472 | List<Map<String, String>> data = []; | 475 | List<Map<String, String>> data = []; |
| 473 | dataWine.forEach((element) { | 476 | dataWine.forEach((element) { |
| 474 | List<String> images = []; | 477 | List<String> images = []; |
| @@ -480,6 +483,8 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { | @@ -480,6 +483,8 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { | ||
| 480 | 'wine_amount': element.wineNumC.text, | 483 | 'wine_amount': element.wineNumC.text, |
| 481 | 'unit': element.wineUnitC.text, | 484 | 'unit': element.wineUnitC.text, |
| 482 | 'wine_number': element.wineSerialC.text, | 485 | 'wine_number': element.wineSerialC.text, |
| 486 | + 'wine_stock': element.wineNumC.text, | ||
| 487 | + 'cdate': cdate, | ||
| 483 | 'img': | 488 | 'img': |
| 484 | images.length == 0 ? null : json.encode(images), | 489 | images.length == 0 ? null : json.encode(images), |
| 485 | }; | 490 | }; |
| @@ -495,7 +500,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { | @@ -495,7 +500,7 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { | ||
| 495 | .openid, | 500 | .openid, |
| 496 | 'rname': nameC.text, | 501 | 'rname': nameC.text, |
| 497 | 'sex': '${sexSelectIndex + 1}', //性别 1 男 2 女 3 公司 | 502 | 'sex': '${sexSelectIndex + 1}', //性别 1 男 2 女 3 公司 |
| 498 | - 'is_member': '1', //会员状态 | 503 | + 'is_member': null, //会员状态 |
| 499 | 'phone': phoneC.text, | 504 | 'phone': phoneC.text, |
| 500 | 'wine': json.encode(data) | 505 | 'wine': json.encode(data) |
| 501 | }; | 506 | }; |
| @@ -254,20 +254,61 @@ class _SmsCodeInputPageState extends State<SmsCodeInputPage> { | @@ -254,20 +254,61 @@ class _SmsCodeInputPageState extends State<SmsCodeInputPage> { | ||
| 254 | bool success = await storeWineProvider | 254 | bool success = await storeWineProvider |
| 255 | .setStoreWineBySellerCheck(context, pramas, | 255 | .setStoreWineBySellerCheck(context, pramas, |
| 256 | showLoading: true); | 256 | showLoading: true); |
| 257 | + | ||
| 257 | if (success) { | 258 | if (success) { |
| 258 | - // | ||
| 259 | - Navigator.pop(context); | ||
| 260 | - Navigator.pop(context); | ||
| 261 | - Navigator.pop(context); | ||
| 262 | - //刷新首页数据 | ||
| 263 | - bus.emit('refresh_wine_home_list',{ | ||
| 264 | - 'index':1 | 259 | + List<Map<String, String>> data = []; |
| 260 | + widget.wineManageDetail.wineDataMove.forEach((element) { | ||
| 261 | + int wineStock = int.parse(element.wineAmount) - | ||
| 262 | + int.parse(element.checkAmount); | ||
| 263 | + Map<String, String> map = { | ||
| 264 | + 'wine_name': element.wineName, //酒名称 | ||
| 265 | + 'wine_amount': element.wineAmount, //初始存酒量 | ||
| 266 | + 'unit': element.unit, //单位 | ||
| 267 | + 'wine_number': element.wineNumber, //存酒编号 | ||
| 268 | + 'wine_stock': wineStock.toString(), //剩余库存, | ||
| 269 | + 'cdate': element.cdate, | ||
| 270 | + 'img': element.img == null || element.img.length == 0 | ||
| 271 | + ? null | ||
| 272 | + : json.encode(element.img), | ||
| 273 | + }; | ||
| 274 | + data.add(map); | ||
| 265 | }); | 275 | }); |
| 266 | 276 | ||
| 267 | - DialogUtil.cupertinoAlertDialogOnly(context, | ||
| 268 | - content: | ||
| 269 | - '客户${widget.wineManageDetail.rname + widget.wineManageDetail.sexStr}的酒品已经出库。\n您可以在存酒管理-出库记录中查看详细信息。', | ||
| 270 | - rTitle: '我知道了'); | 277 | + Map<String, String> pramasreresh = { |
| 278 | + 'id': widget.wineManageDetail.id, | ||
| 279 | + 'sid': Provider.of<UserModel>(context, listen: false) | ||
| 280 | + .user | ||
| 281 | + .sellerid, | ||
| 282 | + 'uid': Provider.of<UserModel>(context, listen: false) | ||
| 283 | + .user | ||
| 284 | + .openid, | ||
| 285 | + 'rname': widget.wineManageDetail.rname, | ||
| 286 | + 'sex': widget.wineManageDetail.sex, //性别 1 男 2 女 3 公司 | ||
| 287 | + 'is_member': widget.wineManageDetail.isMember, //会员状态 | ||
| 288 | + 'phone': widget.wineManageDetail.phone, | ||
| 289 | + 'wine': json.encode(data) | ||
| 290 | + }; | ||
| 291 | + // if (widget.id != null) { | ||
| 292 | + //修改存酒信息 | ||
| 293 | + // pramas['id'] = widget.id; | ||
| 294 | + // } | ||
| 295 | + bool succesReresh = await storeWineProvider | ||
| 296 | + .setStoreWineBySeller(context, pramasreresh, | ||
| 297 | + showLoading: true); | ||
| 298 | + if (succesReresh) { | ||
| 299 | + //刷新库存数量成功 | ||
| 300 | + // | ||
| 301 | + Navigator.pop(context); | ||
| 302 | + Navigator.pop(context); | ||
| 303 | + Navigator.pop(context); | ||
| 304 | + //刷新首页数据 | ||
| 305 | + bus.emit('refresh_wine_home_list', {'index': 1}); | ||
| 306 | + | ||
| 307 | + DialogUtil.cupertinoAlertDialogOnly(context, | ||
| 308 | + content: | ||
| 309 | + '客户${widget.wineManageDetail.rname + widget.wineManageDetail.sexStr}的酒品已经出库。\n您可以在存酒管理-出库记录中查看详细信息。', | ||
| 310 | + rTitle: '我知道了'); | ||
| 311 | + } | ||
| 271 | } | 312 | } |
| 272 | }, | 313 | }, |
| 273 | )) | 314 | )) |
| @@ -156,12 +156,14 @@ class _WineDetailItemPageState extends State<WineDetailItemPage> { | @@ -156,12 +156,14 @@ class _WineDetailItemPageState extends State<WineDetailItemPage> { | ||
| 156 | widget.wineManageSunModel.wineName, | 156 | widget.wineManageSunModel.wineName, |
| 157 | ), | 157 | ), |
| 158 | VEmptyView(16), | 158 | VEmptyView(16), |
| 159 | - _textWidget('存酒数量', widget.wineManageSunModel.wineAmount), | 159 | + _textWidget('剩余数量', widget.wineManageSunModel.wineStock), |
| 160 | VEmptyView(16), | 160 | VEmptyView(16), |
| 161 | _textWidget('计量单位', widget.wineManageSunModel.unit), | 161 | _textWidget('计量单位', widget.wineManageSunModel.unit), |
| 162 | VEmptyView(16), | 162 | VEmptyView(16), |
| 163 | _textWidget('存酒编号', widget.wineManageSunModel.wineNumber), | 163 | _textWidget('存酒编号', widget.wineManageSunModel.wineNumber), |
| 164 | VEmptyView(16), | 164 | VEmptyView(16), |
| 165 | + _textWidget('存酒日期', widget.wineManageSunModel.cdate), | ||
| 166 | + VEmptyView(16), | ||
| 165 | images.length > 0 ? _getGridImg(context, images) : SizedBox(), | 167 | images.length > 0 ? _getGridImg(context, images) : SizedBox(), |
| 166 | images.length > 0 ? VEmptyView(16) : SizedBox(), | 168 | images.length > 0 ? VEmptyView(16) : SizedBox(), |
| 167 | ], | 169 | ], |
| @@ -278,49 +278,78 @@ class _WineDetailPageState extends State<WineDetailPage> { | @@ -278,49 +278,78 @@ class _WineDetailPageState extends State<WineDetailPage> { | ||
| 278 | return false; | 278 | return false; |
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | - // UserModel userModel = | ||
| 282 | - // Provider.of<UserModel>(context, listen: false); | ||
| 283 | - // if (userModel.user.role_name == '管理员' || | ||
| 284 | - // userModel.user.role_name == '店长') { | 281 | + bool can = false; |
| 285 | 282 | ||
| 286 | - WineManageModel modelTemp = | ||
| 287 | - WineManageModel.fromJson2(storeWineProvider | ||
| 288 | - .wineManageDetail | ||
| 289 | - .toJson()); | ||
| 290 | - modelTemp.wineData = []; | 283 | + outerloop: |
| 284 | + for (int i = 0; | ||
| 285 | + i < | ||
| 286 | + storeWineProvider | ||
| 287 | + .wineManageDetail.wineDataMove.length; | ||
| 288 | + i++) { | ||
| 289 | + WineManageSunMoveModel element = storeWineProvider | ||
| 290 | + .wineManageDetail.wineDataMove[i]; | ||
| 291 | + if (int.parse(element.wineStock) > 0) { | ||
| 292 | + can = true; | ||
| 293 | + break outerloop; | ||
| 294 | + } | ||
| 291 | 295 | ||
| 292 | - // modelTemp.cdate = | ||
| 293 | - // storeWineProvider.wineManageDetail.cdate; | ||
| 294 | - // modelTemp.id = | ||
| 295 | - // storeWineProvider.wineManageDetail.id; | ||
| 296 | - // modelTemp.isMember = | ||
| 297 | - // storeWineProvider.wineManageDetail.isMember; | ||
| 298 | - // modelTemp.nickName = | ||
| 299 | - // storeWineProvider.wineManageDetail.nickName; | ||
| 300 | - // modelTemp.phone = | ||
| 301 | - // storeWineProvider.wineManageDetail.phone; | ||
| 302 | - // modelTemp.rname = | ||
| 303 | - // storeWineProvider.wineManageDetail.rname; | ||
| 304 | - // modelTemp.sex = | ||
| 305 | - // storeWineProvider.wineManageDetail.sex; | ||
| 306 | - // modelTemp.sexStr = | ||
| 307 | - // storeWineProvider.wineManageDetail.sexStr; | 296 | + // innerloop: |
| 297 | + // for (UploadImgModel item in element.img) { | ||
| 298 | + // if (item.process < 1) { | ||
| 299 | + // Utils.showToast('正在上传图片,请稍等'); | ||
| 300 | + // // return false; | ||
| 301 | + // can = false; | ||
| 302 | + // break outerloop; | ||
| 303 | + // } | ||
| 304 | + // } | ||
| 305 | + } | ||
| 306 | + if (can) { | ||
| 307 | + // UserModel userModel = | ||
| 308 | + // Provider.of<UserModel>(context, listen: false); | ||
| 309 | + // if (userModel.user.role_name == '管理员' || | ||
| 310 | + // userModel.user.role_name == '店长') { | ||
| 308 | 311 | ||
| 309 | - NavigatorUtil.goApplyOutStorePage( | ||
| 310 | - context, | ||
| 311 | - modelTemp, | ||
| 312 | - ); | ||
| 313 | - // } else { | ||
| 314 | - // bool needRefresh = | ||
| 315 | - // await NavigatorUtil.goCouponEditPage(context); | ||
| 316 | - // print(needRefresh); | ||
| 317 | - // if (needRefresh != null && needRefresh) { | ||
| 318 | - // bus.emit('refresh_coupon_list_f'); | ||
| 319 | - // //刷新页面数据 | ||
| 320 | - // // _controller.callRefresh(); | ||
| 321 | - // // _couponNetworkData(tabController.index); | ||
| 322 | - // } | ||
| 323 | - // } | 312 | + WineManageModel modelTemp = |
| 313 | + WineManageModel.fromJson2(storeWineProvider | ||
| 314 | + .wineManageDetail | ||
| 315 | + .toJson()); | ||
| 316 | + modelTemp.wineData = []; | ||
| 317 | + | ||
| 318 | + // modelTemp.cdate = | ||
| 319 | + // storeWineProvider.wineManageDetail.cdate; | ||
| 320 | + // modelTemp.id = | ||
| 321 | + // storeWineProvider.wineManageDetail.id; | ||
| 322 | + // modelTemp.isMember = | ||
| 323 | + // storeWineProvider.wineManageDetail.isMember; | ||
| 324 | + // modelTemp.nickName = | ||
| 325 | + // storeWineProvider.wineManageDetail.nickName; | ||
| 326 | + // modelTemp.phone = | ||
| 327 | + // storeWineProvider.wineManageDetail.phone; | ||
| 328 | + // modelTemp.rname = | ||
| 329 | + // storeWineProvider.wineManageDetail.rname; | ||
| 330 | + // modelTemp.sex = | ||
| 331 | + // storeWineProvider.wineManageDetail.sex; | ||
| 332 | + // modelTemp.sexStr = | ||
| 333 | + // storeWineProvider.wineManageDetail.sexStr; | ||
| 334 | + | ||
| 335 | + NavigatorUtil.goApplyOutStorePage( | ||
| 336 | + context, | ||
| 337 | + modelTemp, | ||
| 338 | + ); | ||
| 339 | + // } else { | ||
| 340 | + // bool needRefresh = | ||
| 341 | + // await NavigatorUtil.goCouponEditPage(context); | ||
| 342 | + // print(needRefresh); | ||
| 343 | + // if (needRefresh != null && needRefresh) { | ||
| 344 | + // bus.emit('refresh_coupon_list_f'); | ||
| 345 | + // //刷新页面数据 | ||
| 346 | + // // _controller.callRefresh(); | ||
| 347 | + // // _couponNetworkData(tabController.index); | ||
| 348 | + // } | ||
| 349 | + } else { | ||
| 350 | + Utils.showToast('已全部取出!'); | ||
| 351 | + return false; | ||
| 352 | + } | ||
| 324 | }, | 353 | }, |
| 325 | )), | 354 | )), |
| 326 | ], | 355 | ], |
| @@ -123,7 +123,7 @@ class _WineInStoreItemState extends State<WineInStoreItem> { | @@ -123,7 +123,7 @@ class _WineInStoreItemState extends State<WineInStoreItem> { | ||
| 123 | Container( | 123 | Container( |
| 124 | // width: ScreenUtil().setWidth(60 * 2), | 124 | // width: ScreenUtil().setWidth(60 * 2), |
| 125 | child: Text( | 125 | child: Text( |
| 126 | - '${wineManageSunModel.wineAmount}${wineManageSunModel.unit}', | 126 | + '${wineManageSunModel.wineStock}${wineManageSunModel.unit}', |
| 127 | maxLines: 1, | 127 | maxLines: 1, |
| 128 | overflow: TextOverflow.ellipsis, | 128 | overflow: TextOverflow.ellipsis, |
| 129 | style: TextStyle( | 129 | style: TextStyle( |
| @@ -88,17 +88,34 @@ class StoreWineProvider with ChangeNotifier { | @@ -88,17 +88,34 @@ class StoreWineProvider with ChangeNotifier { | ||
| 88 | data: params, showLoading: showLoading) | 88 | data: params, showLoading: showLoading) |
| 89 | .catchError((error) { | 89 | .catchError((error) { |
| 90 | print(error.toString()); | 90 | print(error.toString()); |
| 91 | - Utils.showToast('新建存酒失败,请重试'); | 91 | + if (params['id'] != null) { |
| 92 | + Utils.showToast('修改存酒失败,请重试'); | ||
| 93 | + } else { | ||
| 94 | + Utils.showToast('新建存酒失败,请重试'); | ||
| 95 | + } | ||
| 92 | return false; | 96 | return false; |
| 93 | }); | 97 | }); |
| 94 | if (baseResp.code == Constant.status_success) { | 98 | if (baseResp.code == Constant.status_success) { |
| 95 | - if (baseResp.data is Map && baseResp.data['id'] is String) { | ||
| 96 | - return true; | 99 | + if (params['id'] != null) { |
| 100 | + //修改存酒信息 | ||
| 101 | + if (baseResp.data == 1 || baseResp.data == 0) { | ||
| 102 | + return true; | ||
| 103 | + } else { | ||
| 104 | + Utils.showToast('修改存酒失败,请重试'); | ||
| 105 | + } | ||
| 97 | } else { | 106 | } else { |
| 98 | - Utils.showToast('新建存酒失败,请重试'); | 107 | + if (baseResp.data is Map && baseResp.data['id'] is String) { |
| 108 | + return true; | ||
| 109 | + } else { | ||
| 110 | + Utils.showToast('新建存酒失败,请重试'); | ||
| 111 | + } | ||
| 99 | } | 112 | } |
| 100 | } else { | 113 | } else { |
| 101 | - Utils.showToast(baseResp.msg ?? '新建存酒失败,请重试'); | 114 | + if (params['id'] != null) { |
| 115 | + Utils.showToast(baseResp.msg ?? '修改存酒失败,请重试'); | ||
| 116 | + } else { | ||
| 117 | + Utils.showToast(baseResp.msg ?? '新建存酒失败,请重试'); | ||
| 118 | + } | ||
| 102 | } | 119 | } |
| 103 | return false; | 120 | return false; |
| 104 | } | 121 | } |
-
Please register or login to post a comment