拼箱提示优化,不强制修改数据
This commit is contained in:
@@ -50,8 +50,9 @@
|
||||
</view>
|
||||
<view>
|
||||
<u--text bold type="primary" size="36" text="请填写拼箱后主箱总零件数:"></u--text>
|
||||
<u--input placeholder="请输入拼箱后主箱总零件数" type="number" border="surround" v-model="mainPackageActionNum"
|
||||
@input="numInput2"></u--input>
|
||||
<u--input placeholder="请输入拼箱后主箱总零件数" type="number" border="surround"
|
||||
v-model="mainPackageActionNum"></u--input>
|
||||
<!-- @input="numInput2" -->
|
||||
<u--text size="24" type="error" text="如需要拼箱后零件号结果为48个,则填写数字48."></u--text>
|
||||
<u--text size="24" type="error" text="结果需要大于主箱零件数,小于已扫零件数"></u--text>
|
||||
</view>
|
||||
@@ -234,6 +235,9 @@
|
||||
}
|
||||
},
|
||||
modalConfirm() {
|
||||
if (!this.checkInput()) {
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
setTimeout(() => {
|
||||
this.loading = false;
|
||||
@@ -286,6 +290,45 @@
|
||||
return;
|
||||
}
|
||||
},
|
||||
// 检查输入的数值
|
||||
checkInput() {
|
||||
const num = this.mainPackageActionNum * 1;
|
||||
const packageList = this.newMaterialList;
|
||||
const minQuantity = packageList[0]?.quantity * 1;
|
||||
const maxQuantity = this.quantityTotal * 1;
|
||||
if (packageList.length < 1) {
|
||||
uni.showModal({
|
||||
title: '输入错误提示',
|
||||
content: '需要至少两箱才能拼箱!',
|
||||
showCancel: false,
|
||||
confirmText: '确认'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (num < minQuantity) {
|
||||
this.$nextTick(() => {
|
||||
uni.showModal({
|
||||
title: '输入错误提示',
|
||||
content: '输入值小于主箱零件数!请增加数字!',
|
||||
showCancel: false,
|
||||
confirmText: '确认'
|
||||
});
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if (num > maxQuantity) {
|
||||
this.$nextTick(() => {
|
||||
uni.showModal({
|
||||
title: '输入错误提示',
|
||||
content: '输入值大于总零件数!请减小数字!',
|
||||
showCancel: false,
|
||||
confirmText: '确认'
|
||||
});
|
||||
})
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
numInput2(value) {
|
||||
const num = value * 1;
|
||||
const packageList = this.newMaterialList;
|
||||
|
||||
Reference in New Issue
Block a user