|
|
@ -13,9 +13,16 @@ |
|
|
|
<view class="text_lightblue font_xs">{{dataContent.itemName }}</view> |
|
|
|
<view class="text_lightblue font_xs">{{dataContent.itemDesc1}}</view> |
|
|
|
</view> |
|
|
|
<view class="ljh_right"> |
|
|
|
<text class="tnum">{{dataContent.qty}}</text> |
|
|
|
<view class="ljh_right uni-row uni-flex u-col-center" style=" |
|
|
|
align-items: center;"> |
|
|
|
<text class="tnum" v-if="!isEditCount">{{dataContent.qty}}</text> |
|
|
|
<input v-if="isEditCount" type="digit" v-model="countValue" @input="inputClick" style=" |
|
|
|
width: 180rpx; |
|
|
|
height: 70rpx; |
|
|
|
text-align: center; |
|
|
|
background-color:#DCDCDC" /> |
|
|
|
<text class="tunit">{{dataContent.uom}}</text> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -35,9 +42,25 @@ |
|
|
|
type: Object, |
|
|
|
default: {} |
|
|
|
}, |
|
|
|
isEditCount: { |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
dataContent: { |
|
|
|
handler(newval, oldval) { |
|
|
|
this.countValue = this.dataContent.qty |
|
|
|
}, |
|
|
|
immediate: true, |
|
|
|
deep: true |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
data() { |
|
|
|
return {} |
|
|
|
return { |
|
|
|
countValue: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
filters: { |
|
|
|
statusStyle: function(val) { |
|
|
@ -51,7 +74,37 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
inputClick(value) { |
|
|
|
this.$nextTick(() => { |
|
|
|
if(value.detail.value==""){ |
|
|
|
uni.showToast({ |
|
|
|
title: "输入数量不能为空" |
|
|
|
}) |
|
|
|
this.dataContent.qty = this.countValue; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (value.detail.value < 0) { |
|
|
|
uni.showToast({ |
|
|
|
title: "输入数量不能小于0" |
|
|
|
}) |
|
|
|
this.countValue = this.dataContent.qty; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (value.detail.value > this.dataContent.recommendQty) { |
|
|
|
uni.showToast({ |
|
|
|
title: "输入数量不能大于库存" + this.dataContent.recommendQty |
|
|
|
}) |
|
|
|
this.countValue = this.dataContent.qty |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.dataContent.qty = this.countValue; |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|