Commit a2571913 authored by 15008242619's avatar 15008242619 Committed by jingnan

退库单退库入库优化(暂不部署正式)

parent b7cabf0e
......@@ -149,9 +149,36 @@ export default {
if (isTkdBack === 0) {
// 退库单退库选人
this.dialogVisible = false
this.setPersonVisible = true
let isMatchBack = 0
this.selectionRows.forEach(item => {
if (item.subTypeName !== 'InStorageUseBack') {
isMatchBack++
}
if (isMatchBack === 0) {
// 全为领用退库
this.setPersonVisible = true
} else if (isMatchBack === this.selectionRows.length) {
const ids = []
if (this.selectionRows && this.selectionRows.length) {
this.selectionRows.forEach(item => item.inStorageRequestItems.forEach(i => ids.push(i.id)))
}
// 全为配套退库
post('/InStorageRequestItem/creator/autoApply', ids).then(res => {
this.$utils.showMessageSuccess('提交成功')
setTimeout(() => {
this.$refs.applyTable.$refs.asCom.getData()
}, 1500)
}).catch(() => {
this.$utils.showMessageWarning('出现异常,提交失败')
}).finally(() => {
this.dialogVisible = false
})
} else {
this.$utils.showMessageWarning('退库原因为退库单退库的领用退库和配套退库不能一起提交')
}
})
} else if (isTkdBack === this.selectionRows.length) {
post('/InventoryRequest/purchaseApply/submit?applyIds=' + this.selectionRows.map(item => Number(item.id))).then(res => {
post('/InStorageRequestItem/purchaseApply/submit?applyIds=' + this.selectionRows.map(item => Number(item.id))).then(res => {
this.$utils.showMessageSuccess('提交成功')
this.$refs.applyTable.$refs.asCom.getData()
}).catch(err => {
......@@ -169,7 +196,7 @@ export default {
setPersonConfirm() {
const ids = []
if (this.selectionRows && this.selectionRows.length) {
this.selectionRows.map(item => item.inStorageRequestItems.map(i => ids.push(i.id)))
this.selectionRows.forEach(item => item.inStorageRequestItems.forEach(i => ids.push(i.id)))
}
post('/InStorageRequestItem/creator/apply?userIds=' + this.form.userIds, ids).then(res => {
this.$utils.showMessageSuccess('提交成功')
......
......@@ -157,7 +157,38 @@ export default {
if (isTkdBack === 0) {
//退库单退库选人
this.dialogVisible = false
this.setPersonVisible = true
let isMatchBack = 0
this.selectionRows.forEach(item => {
if (item.subTypeName !== 'InStorageUseBackItem') {
isMatchBack++
}
if (isMatchBack === 0) {
// 全为领用退库
this.setPersonVisible = true
} else if (isMatchBack === this.selectionRows.length) {
if (this.selectionRows && this.selectionRows.length) {
const params = this.selectionRows.map(item => {
return {
processTaskId: item.processTaskId,
aoName: item.inventoryReq.aoNo
}
})
}
// 全为配套退库
post('/InStorageRequestItem/creator/autoApplyByItems', params).then(res => {
this.$utils.showMessageSuccess('提交成功')
setTimeout(() => {
this.$refs.applyTable.$refs.asCom.getData()
}, 1500)
}).catch(() => {
this.$utils.showMessageWarning('出现异常,提交失败')
}).finally(() => {
this.dialogVisible = false
})
} else {
this.$utils.showMessageWarning('退库原因为退库单退库的领用退库和配套退库不能一起提交')
}
})
} else if (isTkdBack === this.selectionRows.length) {
post('/DxWorkflowTask/apply/pass', this.selectionRows.map(item => item.processTaskId)).then(res => {
this.$utils.showMessageSuccess('提交成功')
......
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