This commit is contained in:
parent
89fd68034d
commit
fc3ebb9089
|
|
@ -756,56 +756,62 @@ export default {
|
|||
this.queryParams.createBy = this.user.userName
|
||||
// this.queryParams.companyId = this.user.companyId
|
||||
this.queryParams.userId = this.user.userId
|
||||
let res
|
||||
|
||||
if (this.taskId) {
|
||||
this.leaseApplyInfoList.forEach((v) => {
|
||||
v = Object.assign(
|
||||
v,
|
||||
this.queryParams.leaseApplyInfo,
|
||||
try {
|
||||
let res
|
||||
|
||||
if (this.taskId) {
|
||||
this.leaseApplyInfoList.forEach((v) => {
|
||||
v = Object.assign(
|
||||
v,
|
||||
this.queryParams.leaseApplyInfo,
|
||||
)
|
||||
this.$set(
|
||||
v,
|
||||
'leaseApplyDetails',
|
||||
this.queryParams.leaseApplyDetails,
|
||||
)
|
||||
})
|
||||
// 当领料任务被驳回后重新提交时,判断当前状态,如为100 则表示为内部驳回 需要增加参数 souceByRefuse为1
|
||||
if (this.rejectTaskStatus == 100) {
|
||||
this.queryParams.souceByRefuse = 1
|
||||
}
|
||||
this.submitLoading = true
|
||||
const params = {
|
||||
...this.queryParams,
|
||||
taskId: this.taskId,
|
||||
leaseApplyInfoList: this.leaseApplyInfoList,
|
||||
}
|
||||
res = await editLeaseApply(params)
|
||||
} else {
|
||||
// console.log(this.queryParams)
|
||||
let isNum = this.queryParams.leaseApplyDetails.every(
|
||||
(e) => e.num != 0,
|
||||
)
|
||||
this.$set(
|
||||
v,
|
||||
'leaseApplyDetails',
|
||||
this.queryParams.leaseApplyDetails,
|
||||
)
|
||||
})
|
||||
// 当领料任务被驳回后重新提交时,判断当前状态,如为100 则表示为内部驳回 需要增加参数 souceByRefuse为1
|
||||
if (this.rejectTaskStatus == 100) {
|
||||
this.queryParams.souceByRefuse = 1
|
||||
|
||||
if (!isNum) {
|
||||
this.$message.error('机具类型库存量为零无法领料')
|
||||
return
|
||||
}
|
||||
|
||||
this.submitLoading = true
|
||||
res = await submitLeaseApply(this.queryParams)
|
||||
}
|
||||
this.submitLoading = true
|
||||
const params = {
|
||||
...this.queryParams,
|
||||
taskId: this.taskId,
|
||||
leaseApplyInfoList: this.leaseApplyInfoList,
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
})
|
||||
this.submitLoading = false
|
||||
// this.$tab.closeOpenPage({
|
||||
// path: '/claimAndRefund/receive/receiveApply',
|
||||
// })
|
||||
this.$emit('goBackPage')
|
||||
} else {
|
||||
this.submitLoading = false
|
||||
}
|
||||
res = await editLeaseApply(params)
|
||||
} else {
|
||||
// console.log(this.queryParams)
|
||||
let isNum = this.queryParams.leaseApplyDetails.every(
|
||||
(e) => e.num != 0,
|
||||
)
|
||||
|
||||
if (!isNum) {
|
||||
this.$message.error('机具类型库存量为零无法领料')
|
||||
return
|
||||
}
|
||||
|
||||
this.submitLoading = true
|
||||
res = await submitLeaseApply(this.queryParams)
|
||||
}
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
})
|
||||
} catch (error) {
|
||||
this.submitLoading = false
|
||||
// this.$tab.closeOpenPage({
|
||||
// path: '/claimAndRefund/receive/receiveApply',
|
||||
// })
|
||||
this.$emit('goBackPage')
|
||||
} else {
|
||||
} finally {
|
||||
this.submitLoading = false
|
||||
}
|
||||
}
|
||||
|
|
@ -836,8 +842,10 @@ export default {
|
|||
let maxNum = row.num
|
||||
if (row.preNum <= 1) {
|
||||
row.preNum = 1
|
||||
} else if (row.preNum >= maxNum) {
|
||||
row.preNum = maxNum
|
||||
} else if (row.preNum > maxNum) {
|
||||
// row.preNum = maxNum
|
||||
// 提示: 预领数量不能大于库存数量
|
||||
this.$message.error(`该设备的库存为${maxNum},预领数量不可超过此库存,请重新填写!`)
|
||||
}
|
||||
},
|
||||
/////// 设备类型树 切换
|
||||
|
|
|
|||
Loading…
Reference in New Issue