|
@@ -152,8 +152,24 @@ export default {
|
|
|
if (val.index === 0) {
|
|
if (val.index === 0) {
|
|
|
this.modalCancel();
|
|
this.modalCancel();
|
|
|
} else {
|
|
} else {
|
|
|
- this.updateItemEvent(this.customData);
|
|
|
|
|
- this.modalCancel();
|
|
|
|
|
|
|
+ const { bigCount,smallCount,bigNum,bigUnit,smallNum,smallUnit,ratio} = this.customData;
|
|
|
|
|
+ const ratioNum = Number(ratio);
|
|
|
|
|
+ //超过库存时 设置为库存最大值 1
|
|
|
|
|
+ if (Number(bigCount) * ratioNum + Number(smallCount) > Number(bigNum) * ratioNum + Number(smallNum)) {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ // title: `库存只有${bigNum}${bigUnit}${smallNum}${smallUnit}`,
|
|
|
|
|
+ title: '库存不足',
|
|
|
|
|
+ icon: "none"
|
|
|
|
|
+ });
|
|
|
|
|
+ this.customData.bigCount = 0;
|
|
|
|
|
+ this.customData.smallCount = 0;
|
|
|
|
|
+ this.delAllEvent(this.customData)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.updateItemEvent(this.customData);
|
|
|
|
|
+ this.modalCancel();
|
|
|
|
|
+ }
|
|
|
|
|
+ // this.updateItemEvent(this.customData);
|
|
|
|
|
+ // this.modalCancel();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|