Commit fd57a2e8b902f328e7f568f89b9f212df8c94d6d

Authored by wdn127929
1 parent dce1c2ae

存酒出库不能输入0

... ... @@ -117,12 +117,13 @@ class _ApplyOutStoreItemPageState extends State<ApplyOutStoreItemPage> {
// print(value);
if (value != null && value.trim().length > 0) {
bool isNumber =
Utils.isInteger(value); //判断输入的内容是否是数字
Utils.isIntegerS(value); //判断输入的内容是否是数字
if (!isNumber) {
Utils.showToast('请输入整数');
controller.text = '';
return;
}
if (double.parse(value) >
double.parse(
widget.wineManageSunModel.wineAmount)) {
... ... @@ -132,6 +133,8 @@ class _ApplyOutStoreItemPageState extends State<ApplyOutStoreItemPage> {
}
widget.wineManageSunModel.checkAmount = value;
// controller.text = value;
} else {
widget.wineManageSunModel.checkAmount = '0';
}
// if (value.trim().isEmpty || value.trim().length > 11) {
... ...
... ... @@ -107,9 +107,9 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
// break outerloop;
// }
if (element.checkAmount != null &&
if (element.checkAmount != null && element.checkAmount != '0'&&
element.checkAmount != '' &&
int.parse(element.checkAmount) > 0) {
int.parse(element.checkAmount ) > 0) {
//有输入数量
WineCheckModel sunMoveModel = WineCheckModel();
sunMoveModel.wineName = element.wineName;
... ... @@ -314,6 +314,8 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
itemBuilder: (context, index) {
WineManageSunMoveModel wineManageModel =
widget.wineManageDetail.wineDataMove[index];
return ApplyOutStoreItemPage(
wineManageSunModel: wineManageModel,
controller: _controller,
... ... @@ -369,7 +371,7 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
// }
if (element.wineNumC.text != null &&
element.wineNumC.text.trim().length > 0) {
element.wineNumC.text.trim().length > 0 &&element.wineNumC.text != '0') {
//有一个输入数量即可提交出库申请
can = true;
break outerloop;
... ...
... ... @@ -226,7 +226,7 @@ class _SmsCodeInputPageState extends State<SmsCodeInputPage> {
// break outerloop;
// }
if (element.checkAmount != null &&
if (element.checkAmount != null && element.checkAmount != '0'&&
element.checkAmount != '' &&
double.parse(element.checkAmount) > 0) {
//有输入数量
... ...
... ... @@ -167,6 +167,13 @@ class Utils {
return reg.hasMatch(str);
}
// 验证是否为数字
static bool isIntegerS(String str) {
final reg = RegExp(r'^[0-9]\d*$');
print('$str 是否数字:${reg.hasMatch(str)}');
return reg.hasMatch(str);
}
//请求参数按key按ASCII排序key1=value1&key2=value2&...&keyN=valueN
static String keySort(Map<String, String> oldParamsMap) {
List attrKeys = oldParamsMap.keys.toList();
... ...