Commit 19a98f8b860164f03a29e37e21aa5b7f2a7b2193

Authored by wdn127929
1 parent 7c5a5ae2

存酒备注和存酒人

@@ -175,11 +175,14 @@ class WineManageSunModel { @@ -175,11 +175,14 @@ class WineManageSunModel {
175 String wineAmount; 175 String wineAmount;
176 String unit; 176 String unit;
177 String wineNumber; 177 String wineNumber;
  178 + String remark;
  179 + String wineSave;
178 List<UploadImgModel> img = []; 180 List<UploadImgModel> img = [];
179 TextEditingController wineNameC = TextEditingController(); //酒品名称 181 TextEditingController wineNameC = TextEditingController(); //酒品名称
180 TextEditingController wineNumC = TextEditingController(); //存酒数量 182 TextEditingController wineNumC = TextEditingController(); //存酒数量
181 TextEditingController wineUnitC = TextEditingController(); //计量单位 183 TextEditingController wineUnitC = TextEditingController(); //计量单位
182 TextEditingController wineSerialC = TextEditingController(); //存酒编号 184 TextEditingController wineSerialC = TextEditingController(); //存酒编号
  185 + TextEditingController wineRemarkC = TextEditingController(); //存酒备注
183 String wineStock; 186 String wineStock;
184 187
185 String cdate; 188 String cdate;
@@ -194,19 +197,25 @@ class WineManageSunModel { @@ -194,19 +197,25 @@ class WineManageSunModel {
194 this.wineAmount, 197 this.wineAmount,
195 this.unit, 198 this.unit,
196 this.wineNumber, 199 this.wineNumber,
  200 + this.remark,
  201 + this.wineSave,
197 this.img, 202 this.img,
198 this.wineStock, 203 this.wineStock,
199 this.cdate}); 204 this.cdate});
200 205
201 WineManageSunModel.fromJson(Map<String, dynamic> json) { 206 WineManageSunModel.fromJson(Map<String, dynamic> json) {
202 wineName = json['wine_name']; 207 wineName = json['wine_name'];
203 - wineAmount = double.parse(json['wine_amount'] == '' || json['wine_amount'] == null 208 + wineAmount = double.parse(
  209 + json['wine_amount'] == '' || json['wine_amount'] == null
204 ? '0' 210 ? '0'
205 : json['wine_amount']) 211 : json['wine_amount'])
206 - .toInt()  
207 - .toString(); 212 + .toInt()
  213 + .toString();
208 unit = json['unit']; 214 unit = json['unit'];
209 - wineNumber = json['wine_number']?? ""; 215 + wineNumber = json['wine_number'] ?? "";
  216 + remark = json['remark'] ?? '';
  217 + wineSave = json['wine_save'] ?? '';
  218 +
210 // wineStock = json['wine_stock'] ?? ""; 219 // wineStock = json['wine_stock'] ?? "";
211 wineStock = double.parse( 220 wineStock = double.parse(
212 json['wine_stock'] == '' || json['wine_stock'] == null 221 json['wine_stock'] == '' || json['wine_stock'] == null
@@ -243,6 +252,9 @@ class WineManageSunModel { @@ -243,6 +252,9 @@ class WineManageSunModel {
243 data['wine_amount'] = this.wineAmount; 252 data['wine_amount'] = this.wineAmount;
244 data['unit'] = this.unit; 253 data['unit'] = this.unit;
245 data['wine_number'] = this.wineNumber; 254 data['wine_number'] = this.wineNumber;
  255 + data['remark'] = this.remark;
  256 + data['wine_save'] = this.wineSave;
  257 +
246 data['img'] = this.img; 258 data['img'] = this.img;
247 data['wine_stock'] = this.wineStock; 259 data['wine_stock'] = this.wineStock;
248 data['cdate'] = this.cdate; 260 data['cdate'] = this.cdate;
@@ -256,6 +268,8 @@ class WineManageSunMoveModel { @@ -256,6 +268,8 @@ class WineManageSunMoveModel {
256 String wineAmount; 268 String wineAmount;
257 String unit; 269 String unit;
258 String wineNumber; 270 String wineNumber;
  271 + String remark;
  272 + String wineSave;
259 List<String> img; 273 List<String> img;
260 String checkAmount; 274 String checkAmount;
261 String wineStock; 275 String wineStock;
@@ -275,6 +289,8 @@ class WineManageSunMoveModel { @@ -275,6 +289,8 @@ class WineManageSunMoveModel {
275 this.wineAmount, 289 this.wineAmount,
276 this.unit, 290 this.unit,
277 this.wineNumber, 291 this.wineNumber,
  292 + this.remark,
  293 + this.wineSave,
278 this.checkAmount, 294 this.checkAmount,
279 this.img, 295 this.img,
280 this.wineStock, 296 this.wineStock,
@@ -291,6 +307,9 @@ class WineManageSunMoveModel { @@ -291,6 +307,9 @@ class WineManageSunMoveModel {
291 // wineNumC.text = wineAmount ?? ''; 307 // wineNumC.text = wineAmount ?? '';
292 unit = json['unit']; 308 unit = json['unit'];
293 wineNumber = json['wine_number'] ?? ""; 309 wineNumber = json['wine_number'] ?? "";
  310 + remark = json['remark'] ?? '';
  311 +
  312 + wineSave = json['wine_save'] ?? '';
294 // checkAmount = json['check_amount'] ?? ''; 313 // checkAmount = json['check_amount'] ?? '';
295 checkAmount = double.parse( 314 checkAmount = double.parse(
296 json['check_amount'] == '' || json['check_amount'] == null 315 json['check_amount'] == '' || json['check_amount'] == null
@@ -329,6 +348,9 @@ class WineManageSunMoveModel { @@ -329,6 +348,9 @@ class WineManageSunMoveModel {
329 data['wine_amount'] = this.wineAmount; 348 data['wine_amount'] = this.wineAmount;
330 data['unit'] = this.unit; 349 data['unit'] = this.unit;
331 data['wine_number'] = this.wineNumber; 350 data['wine_number'] = this.wineNumber;
  351 + data['remark'] = this.remark;
  352 + data['wine_save'] = this.wineSave;
  353 +
332 data['check_amount'] = this.checkAmount; 354 data['check_amount'] = this.checkAmount;
333 data['img'] = this.img; 355 data['img'] = this.img;
334 data['wine_stock'] = this.wineStock; 356 data['wine_stock'] = this.wineStock;
@@ -342,12 +364,15 @@ class WineCheckModel { @@ -342,12 +364,15 @@ class WineCheckModel {
342 String wineName; 364 String wineName;
343 String unit; 365 String unit;
344 String wineNumber; 366 String wineNumber;
  367 + String remark;
  368 + String wineSave;
345 List<String> img; 369 List<String> img;
346 String checkAmount; 370 String checkAmount;
347 WineCheckModel({ 371 WineCheckModel({
348 this.wineName, 372 this.wineName,
349 this.unit, 373 this.unit,
350 this.wineNumber, 374 this.wineNumber,
  375 + this.remark,
351 this.checkAmount, 376 this.checkAmount,
352 this.img, 377 this.img,
353 }); 378 });
@@ -356,6 +381,9 @@ class WineCheckModel { @@ -356,6 +381,9 @@ class WineCheckModel {
356 wineName = json['wine_name']; 381 wineName = json['wine_name'];
357 unit = json['unit']; 382 unit = json['unit'];
358 wineNumber = json['wine_number'] ?? ""; 383 wineNumber = json['wine_number'] ?? "";
  384 + remark = json['remark'] ?? '';
  385 +
  386 + wineSave = json['wine_save'] ?? '';
359 checkAmount = json['check_amount'] ?? ""; 387 checkAmount = json['check_amount'] ?? "";
360 388
361 // wineNumC.text = wineNumber; 389 // wineNumC.text = wineNumber;
@@ -379,6 +407,10 @@ class WineCheckModel { @@ -379,6 +407,10 @@ class WineCheckModel {
379 data['wine_name'] = this.wineName; 407 data['wine_name'] = this.wineName;
380 data['unit'] = this.unit; 408 data['unit'] = this.unit;
381 data['wine_number'] = this.wineNumber; 409 data['wine_number'] = this.wineNumber;
  410 + data['remark'] = this.remark;
  411 +
  412 + data['wine_save'] = this.wineSave;
  413 +
382 data['check_amount'] = this.checkAmount; 414 data['check_amount'] = this.checkAmount;
383 data['img'] = this.img; 415 data['img'] = this.img;
384 return data; 416 return data;
@@ -311,9 +311,15 @@ class _ApplyOutStoreItemPageState extends State<ApplyOutStoreItemPage> { @@ -311,9 +311,15 @@ class _ApplyOutStoreItemPageState extends State<ApplyOutStoreItemPage> {
311 _textWidget('计量单位', widget.wineManageSunModel.unit), 311 _textWidget('计量单位', widget.wineManageSunModel.unit),
312 VEmptyView(16), 312 VEmptyView(16),
313 _textWidget('存酒编号', widget.wineManageSunModel.wineNumber), 313 _textWidget('存酒编号', widget.wineManageSunModel.wineNumber),
  314 + if (widget.wineManageSunModel.remark != '') VEmptyView(16),
  315 + if (widget.wineManageSunModel.remark != '')
  316 + _textWidget('备注信息', widget.wineManageSunModel.remark),
314 VEmptyView(16), 317 VEmptyView(16),
315 _textWidget('存酒日期', cdateStr), 318 _textWidget('存酒日期', cdateStr),
316 VEmptyView(16), 319 VEmptyView(16),
  320 + if (widget.wineManageSunModel.wineSave != '')
  321 + _textWidget('存酒人', widget.wineManageSunModel.wineSave),
  322 + if (widget.wineManageSunModel.wineSave != '') VEmptyView(16),
317 widget.wineManageSunModel.img == null 323 widget.wineManageSunModel.img == null
318 ? SizedBox() 324 ? SizedBox()
319 : _getGridImg(context, widget.wineManageSunModel.img), 325 : _getGridImg(context, widget.wineManageSunModel.img),
@@ -116,6 +116,8 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> { @@ -116,6 +116,8 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
116 sunMoveModel.checkAmount = element.checkAmount; 116 sunMoveModel.checkAmount = element.checkAmount;
117 sunMoveModel.wineNumber = element.wineNumber; 117 sunMoveModel.wineNumber = element.wineNumber;
118 sunMoveModel.unit = element.unit; 118 sunMoveModel.unit = element.unit;
  119 + sunMoveModel.remark = element.remark;
  120 + sunMoveModel.wineSave = element.wineSave;
119 121
120 sunMoveModel.img = element.img; 122 sunMoveModel.img = element.img;
121 123
@@ -146,6 +148,9 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> { @@ -146,6 +148,9 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
146 'unit': element.unit, //单位 148 'unit': element.unit, //单位
147 'wine_number': element.wineNumber, //存酒编号 149 'wine_number': element.wineNumber, //存酒编号
148 'wine_stock': '${winestockStr}', //剩余库存, 150 'wine_stock': '${winestockStr}', //剩余库存,
  151 + 'remark': element.remark,
  152 + 'wine_save': element.wineSave,
  153 +
149 'cdate': element.cdate, 154 'cdate': element.cdate,
150 'img': element.img == null || element.img.length == 0 155 'img': element.img == null || element.img.length == 0
151 ? null 156 ? null
@@ -223,7 +228,8 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> { @@ -223,7 +228,8 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
223 @override 228 @override
224 Widget build(BuildContext context) { 229 Widget build(BuildContext context) {
225 storeWineProvider = Provider.of<StoreWineProvider>(context, listen: true); 230 storeWineProvider = Provider.of<StoreWineProvider>(context, listen: true);
226 - menuManageProvider = Provider.of<MenuManageProvider>(context, listen: false); 231 + menuManageProvider =
  232 + Provider.of<MenuManageProvider>(context, listen: false);
227 return KeyboardDismissOnTap( 233 return KeyboardDismissOnTap(
228 child: Scaffold( 234 child: Scaffold(
229 appBar: SystemAppBar( 235 appBar: SystemAppBar(
@@ -399,7 +405,8 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> { @@ -399,7 +405,8 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
399 context, modelTemp); 405 context, modelTemp);
400 } else { 406 } else {
401 //直接出库 407 //直接出库
402 - DialogUtil.cupertinoAlertDialog(context,title: '', 408 + DialogUtil.cupertinoAlertDialog(context,
  409 + title: '',
403 content: '确定要取出当前酒品么?', rCallback: () { 410 content: '确定要取出当前酒品么?', rCallback: () {
404 //确定 411 //确定
405 _outWine(modelTemp); 412 _outWine(modelTemp);
@@ -636,6 +636,15 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -636,6 +636,15 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
636 'cdate': cdate, 636 'cdate': cdate,
637 'img': 637 'img':
638 images.length == 0 ? null : json.encode(images), 638 images.length == 0 ? null : json.encode(images),
  639 + 'remark': element.wineRemarkC.text,
  640 + 'wine_save':
  641 + Provider.of<UserModel>(context, listen: false)
  642 + .user
  643 + .nickName ??
  644 + Provider.of<UserModel>(context, listen: false)
  645 + .user
  646 + .account ??
  647 + ''
639 }; 648 };
640 data.add(map); 649 data.add(map);
641 }); 650 });
@@ -168,7 +168,10 @@ class _CreateWineItemPageState extends State<CreateWineItemPage> { @@ -168,7 +168,10 @@ class _CreateWineItemPageState extends State<CreateWineItemPage> {
168 _textFieldWidget( 168 _textFieldWidget(
169 '存酒编号', '点击输入存酒编号', widget.wineManageSunModel.wineSerialC, 169 '存酒编号', '点击输入存酒编号', widget.wineManageSunModel.wineSerialC,
170 keyboardType: TextInputType.numberWithOptions(decimal: true)), 170 keyboardType: TextInputType.numberWithOptions(decimal: true)),
  171 +
171 VEmptyView(16), 172 VEmptyView(16),
  173 + _textFieldWidget(
  174 + '备注信息', '点击输入备注', widget.wineManageSunModel.wineRemarkC),
172 Consumer<UploadImageProvider>(builder: (context, model, _) { 175 Consumer<UploadImageProvider>(builder: (context, model, _) {
173 return ImgPickerWidget( 176 return ImgPickerWidget(
174 scrollController: widget.controller, 177 scrollController: widget.controller,
@@ -156,9 +156,14 @@ class _OutStoreRecordItemPageState extends State<OutStoreRecordItemPage> { @@ -156,9 +156,14 @@ class _OutStoreRecordItemPageState extends State<OutStoreRecordItemPage> {
156 _textWidget('计量单位', widget.wineCheckModel.unit), 156 _textWidget('计量单位', widget.wineCheckModel.unit),
157 VEmptyView(16), 157 VEmptyView(16),
158 _textWidget('存酒编号', widget.wineCheckModel.wineNumber), 158 _textWidget('存酒编号', widget.wineCheckModel.wineNumber),
  159 + if (widget.wineCheckModel.remark != '') VEmptyView(16),
  160 + if (widget.wineCheckModel.remark != '')
  161 + _textWidget('备注信息', widget.wineCheckModel.remark),
159 VEmptyView(16), 162 VEmptyView(16),
160 _textWidget('出库日期', widget.cdate), 163 _textWidget('出库日期', widget.cdate),
161 VEmptyView(16), 164 VEmptyView(16),
  165 + _textWidget('存酒人', widget.wineCheckModel.wineSave),
  166 + VEmptyView(16),
162 widget.wineCheckModel.img != null && 167 widget.wineCheckModel.img != null &&
163 widget.wineCheckModel.img.length > 0 168 widget.wineCheckModel.img.length > 0
164 ? _getGridImg(context, widget.wineCheckModel.img) 169 ? _getGridImg(context, widget.wineCheckModel.img)
@@ -235,6 +235,8 @@ class _SmsCodeInputPageState extends State<SmsCodeInputPage> { @@ -235,6 +235,8 @@ class _SmsCodeInputPageState extends State<SmsCodeInputPage> {
235 sunMoveModel.checkAmount = element.checkAmount; 235 sunMoveModel.checkAmount = element.checkAmount;
236 sunMoveModel.wineNumber = element.wineNumber; 236 sunMoveModel.wineNumber = element.wineNumber;
237 sunMoveModel.unit = element.unit; 237 sunMoveModel.unit = element.unit;
  238 + sunMoveModel.remark = element.remark;
  239 + sunMoveModel.wineSave = element.wineSave;
238 240
239 sunMoveModel.img = element.img; 241 sunMoveModel.img = element.img;
240 242
@@ -270,6 +272,8 @@ class _SmsCodeInputPageState extends State<SmsCodeInputPage> { @@ -270,6 +272,8 @@ class _SmsCodeInputPageState extends State<SmsCodeInputPage> {
270 'wine_amount': element.wineAmount, //初始存酒量 272 'wine_amount': element.wineAmount, //初始存酒量
271 'unit': element.unit, //单位 273 'unit': element.unit, //单位
272 'wine_number': element.wineNumber, //存酒编号 274 'wine_number': element.wineNumber, //存酒编号
  275 + 'remark': element.remark,
  276 + 'wine_save': element.wineSave,
273 'wine_stock': '${winestockStr}', //剩余库存, 277 'wine_stock': '${winestockStr}', //剩余库存,
274 'cdate': element.cdate, 278 'cdate': element.cdate,
275 'img': element.img == null || element.img.length == 0 279 'img': element.img == null || element.img.length == 0
@@ -162,8 +162,13 @@ class _WineDetailItemPageState extends State<WineDetailItemPage> { @@ -162,8 +162,13 @@ class _WineDetailItemPageState extends State<WineDetailItemPage> {
162 VEmptyView(16), 162 VEmptyView(16),
163 _textWidget('存酒编号', widget.wineManageSunModel.wineNumber), 163 _textWidget('存酒编号', widget.wineManageSunModel.wineNumber),
164 VEmptyView(16), 164 VEmptyView(16),
  165 + if (widget.wineManageSunModel.remark != '')
  166 + _textWidget('备注信息', widget.wineManageSunModel.remark),
  167 + if (widget.wineManageSunModel.remark != '') VEmptyView(16),
165 _textWidget('存酒日期', widget.wineManageSunModel.cdate), 168 _textWidget('存酒日期', widget.wineManageSunModel.cdate),
166 - VEmptyView(16), 169 + VEmptyView(16),
  170 + if(widget.wineManageSunModel.wineSave!='') _textWidget('存酒人', widget.wineManageSunModel.wineSave),
  171 + if(widget.wineManageSunModel.wineSave!='') VEmptyView(16),
167 images.length > 0 ? _getGridImg(context, images) : SizedBox(), 172 images.length > 0 ? _getGridImg(context, images) : SizedBox(),
168 images.length > 0 ? VEmptyView(16) : SizedBox(), 173 images.length > 0 ? VEmptyView(16) : SizedBox(),
169 ], 174 ],
@@ -8317,7 +8317,10 @@ class DialogUtil { @@ -8317,7 +8317,10 @@ class DialogUtil {
8317 color: rColor)), 8317 color: rColor)),
8318 onPressed: () { 8318 onPressed: () {
8319 Navigator.of(context).pop(); 8319 Navigator.of(context).pop();
8320 - rCallback(); 8320 + if(rCallback !=null){
  8321 + rCallback();
  8322 + }
  8323 +
8321 }, 8324 },
8322 ), 8325 ),
8323 ], 8326 ],