Commit c1077f57 authored by jingnan's avatar jingnan 👀

EditReqAmount组件增加退库入库最大值校验

parent c925ef3a
......@@ -46,7 +46,7 @@ export default {
components: { AddOutStorageUseDetailDialog, AdjustOccupyCom },
provide() { // 用于报废领用申领数量编辑校验
return {
useRequestType: this.basicData.useRequestType
parentType_Inject: this.basicData.useRequestType
}
},
props: {
......
......@@ -30,9 +30,9 @@ export default {
}
},
inject: {
'useRequestType': {
'parentType_Inject': {
default: () => {
return { useRequestType: '' }
return { parentType_Inject: '' }
}
}
},
......@@ -61,8 +61,12 @@ export default {
},
methods: {
handleChange() {
if (this.useRequestType === 'scrapUse' && this.form.extSupportingItemVO && this.reqAmount > this.form.extSupportingItemVO.reqAmount) {
return this.$utils.showMessageWarning('当前物料可申领数量不足!')
if (this.parentType_Inject === 'scrapUse' && this.form.extSupportingItemVO && this.reqAmount > this.form.extSupportingItemVO.reqAmount) {
this.maxNum = this.form.extSupportingItemVO.reqAmount
}
const maxAmount = this.form.outsideAmount - this.form.backedAmount - this.form.backAmount - this.form.scrapCount
if (this.parentType_Inject === '退库入库' && this.form.reqAmount > maxAmount) {
this.maxNum = maxAmount
}
this.$emit('input', this.reqAmount)
if (this.form.id) {
......
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