Commit f3fb308c authored by tanjunxin's avatar tanjunxin

fix: 余料退料退料数量改为可填写负数

parent ca10137d
......@@ -7,7 +7,7 @@
均摊明细
</u-button>
</view>
<view class="item input">退料数量:<uni-easyinput v-model="num" trim="all" type="number"
<view class="item input">退料数量:<uni-easyinput v-model="num" trim="all" type="text"
@input="handleChange"></uni-easyinput>/PCS
</view>
<view class="item">申请数量:{{ batchNum }}/PCS</view>
......@@ -132,12 +132,18 @@
this.visible = false
},
handleChange(val) {
if (val > this.batchNum) {
this.$u.toast("退料数量不可以超过申请数量!");
if (!val.replace(/^\d+$/g, '') || val.replace(/^((-\d+)|(0+))$/g, '')) {
if (val.length > 1) {
this.$u.toast("请输入正数、负数或者0");
}
} else {
this.sapList.forEach(ele => {
ele.ERFMG = (val * (ele.quantity / this.totalNum)).toFixed(2);
})
if (val > this.batchNum) {
this.$u.toast("退料数量不可以超过申请数量!");
} else {
this.sapList.forEach(ele => {
ele.ERFMG = (val * (ele.quantity / this.totalNum)).toFixed(2);
})
}
}
},
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment