|
@ -31,12 +31,13 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<u-line /> |
|
|
<u-line /> |
|
|
<view class="uni-flex uni-row space-between padding title u-col-center"> |
|
|
<view class="uni-flex uni-row space-between padding title u-col-center"> |
|
|
<text>总数量 : </text> |
|
|
<text>总数量 : </text> |
|
|
<view class="uni-flex uni-row uni-center" style="align-items: center;"> |
|
|
<view class="uni-flex uni-row uni-center" style="align-items: center;"> |
|
|
<input class="qty_input" v-model="allQty" :focus="false" type="number" |
|
|
<input class="qty_input" v-model="allQty" :focus="false" type="number" |
|
|
@confirm="confirm()" /> |
|
|
@input="checkNum" @confirm="confirm()" :maxlength="maxlength" /> |
|
|
<uom :uom="dataContent.uom"></uom> |
|
|
<uom :uom="dataContent.uom"></uom> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
@ -69,7 +70,8 @@ |
|
|
allQty: 0, |
|
|
allQty: 0, |
|
|
stdCount: 0, |
|
|
stdCount: 0, |
|
|
labelQty: 0, |
|
|
labelQty: 0, |
|
|
recommendQty: 0 |
|
|
recommendQty: 0, |
|
|
|
|
|
maxlength: 10 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
@ -104,6 +106,20 @@ |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
checkNum(e) { |
|
|
|
|
|
let value = e.detail.value; |
|
|
|
|
|
let dot = value.indexOf('.'); //包含小数点 |
|
|
|
|
|
let reg = /^[0-9]+$/; //正整数 |
|
|
|
|
|
if (dot > -1) { |
|
|
|
|
|
this.maxlength = dot + 7; //长度是小数点后两位 |
|
|
|
|
|
if (value.length > dot + 7) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (reg.test(value)) { //如果是正整数不包含小数点 |
|
|
|
|
|
this.maxlength = 10; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
openEditPopup() { |
|
|
openEditPopup() { |
|
|
this.$refs.popup.open('bottom') |
|
|
this.$refs.popup.open('bottom') |
|
|
}, |
|
|
}, |
|
@ -148,7 +164,8 @@ |
|
|
} else { |
|
|
} else { |
|
|
if (this.recommendQty != 0) { |
|
|
if (this.recommendQty != 0) { |
|
|
if (this.allQty > this.recommendQty) { |
|
|
if (this.allQty > this.recommendQty) { |
|
|
if (this.settingParam.allowBiggerQty != null && this.settingParam.allowBiggerQty == "TRUE") { |
|
|
if (this.settingParam.allowBiggerQty != null && this.settingParam.allowBiggerQty == |
|
|
|
|
|
"TRUE") { |
|
|
this.callback(); |
|
|
this.callback(); |
|
|
} else { |
|
|
} else { |
|
|
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许大于推荐数量[' + |
|
|
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许大于推荐数量[' + |
|
@ -159,7 +176,8 @@ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} else if (this.allQty < this.recommendQty) { |
|
|
} else if (this.allQty < this.recommendQty) { |
|
|
if (this.settingParam.allowSmallerQty != null && this.settingParam.allowSmallerQty == "TRUE") { |
|
|
if (this.settingParam.allowSmallerQty != null && this.settingParam.allowSmallerQty == |
|
|
|
|
|
"TRUE") { |
|
|
this.callback(); |
|
|
this.callback(); |
|
|
} else { |
|
|
} else { |
|
|
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许小于推荐数量[' + |
|
|
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许小于推荐数量[' + |
|
|