选择物品类型后,增加校验当前领用是否超过库存,超过弹框提示

This commit is contained in:
bb_pan 2025-03-04 17:37:44 +08:00
parent cf2de901ae
commit 757262be2f
2 changed files with 43 additions and 1 deletions

View File

@ -314,3 +314,12 @@ export const outboundOrderApi = (params) => {
params,
})
}
// 领料申请-校验是否在审核
export function getNumISenough(params) {
return request({
url: '/base/tm_task/getNumISenough',
method: 'get',
params,
})
}

View File

@ -270,6 +270,7 @@ import {
editLeaseApply,
getLeaseApplyListAll,
getLeaseApplyAuditListAll,
getNumISenough,
} from '@/api/claimAndRefund/receive'
import {
@ -834,8 +835,27 @@ export default {
}
},
///////
deviceTypeChange(val) {
async deviceTypeChange(val) {
console.log(val)
const warnMsg = await this.handleDeviceType(val[val.length - 1])
// console.log('🚀 ~ deviceTypeChange-->> ~ warnMsg:', warnMsg)
if (warnMsg) {
//
this.$confirm(warnMsg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.handleData(val)
})
.catch(() => {})
} else {
this.handleData(val)
}
},
handleData(val) {
let nodes = null
nodes =
this.$refs.deviceTypeCascader.getCheckedNodes().length > 0
@ -876,6 +896,19 @@ export default {
this.deviceType = {}
},
// -
async handleDeviceType(val) {
// console.log('🚀 ~ handleDeviceType ~ val:', val)
//getNumISenough
try {
const res = await getNumISenough({ typeId: val })
// console.log('🚀 ~ handleDeviceType ~ res:', res)
return res.data.warnMsg
} catch (error) {
console.log('🚀 ~ handleDeviceType ~ error:', error)
}
},
////
handelTableItemData(node) {
const template = JSON.parse(