Commit f3fb308c authored by tanjunxin's avatar tanjunxin

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

parent ca10137d
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
均摊明细 均摊明细
</u-button> </u-button>
</view> </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 @input="handleChange"></uni-easyinput>/PCS
</view> </view>
<view class="item">申请数量:{{ batchNum }}/PCS</view> <view class="item">申请数量:{{ batchNum }}/PCS</view>
...@@ -132,12 +132,18 @@ ...@@ -132,12 +132,18 @@
this.visible = false this.visible = false
}, },
handleChange(val) { handleChange(val) {
if (val > this.batchNum) { if (!val.replace(/^\d+$/g, '') || val.replace(/^((-\d+)|(0+))$/g, '')) {
this.$u.toast("退料数量不可以超过申请数量!"); if (val.length > 1) {
this.$u.toast("请输入正数、负数或者0");
}
} else { } else {
this.sapList.forEach(ele => { if (val > this.batchNum) {
ele.ERFMG = (val * (ele.quantity / this.totalNum)).toFixed(2); 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