材料站-退料保存后刷新

This commit is contained in:
bb_pan 2025-09-24 21:14:33 +08:00
parent fe302379bb
commit fad4f0dc06
1 changed files with 53 additions and 36 deletions

View File

@ -336,7 +336,7 @@ export default {
teamId: null,
proId: null,
agreementId: null, //id
agreementIds:[],
agreementIds: [],
agreementCode: null, //code
// companyId: '', //
// createBy: '', //
@ -668,42 +668,59 @@ export default {
this.$message.error('退料数量不能为空!')
return
}
this.queryParams.backApplyInfo = {
id: this.rowId,
backPerson: this.queryParams.backPerson,
phone: this.queryParams.phone,
remark: this.queryParams.remark,
agreementIds: this.queryParams.agreementIds,
isBack,
taskId: this.queryParams.taskId,
createBy: sessionStorage.getItem('userName')
}
if (this.rowId != '') {
let params = {
backApplyInfo: this.queryParams.backApplyInfo,
backApplyDetailsList: this.queryParams.equipmentList
//
this.$confirm(`是否确认${isBack == 1 ? '退料' : '暂存'}`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const loading = this.$loading()
try {
this.queryParams.backApplyInfo = {
id: this.rowId,
backPerson: this.queryParams.backPerson,
phone: this.queryParams.phone,
remark: this.queryParams.remark,
agreementIds: this.queryParams.agreementIds,
isBack,
taskId: this.queryParams.taskId,
createBy: sessionStorage.getItem('userName')
}
if (this.rowId != '') {
let params = {
backApplyInfo: this.queryParams.backApplyInfo,
backApplyDetailsList: this.queryParams.equipmentList
}
if (params.backApplyInfo.signUrl) delete params.backApplyInfo.signUrl
const res = await editBackApply(params)
if (res.code == 200) {
this.$message({ type: 'success', message: res.msg })
setTimeout(() => {
// this.$emit('goBackPage')
//
this.$tab.refreshPage({ path: '/materialsStation/toolsBack/back' })
}, 500)
}
} else {
let params = {
backApplyInfo: this.queryParams.backApplyInfo,
backApplyDetailsList: this.queryParams.equipmentList
}
const res = await addBackApply(params)
if (res.code == 200) {
this.$message({ type: 'success', message: res.msg })
setTimeout(() => {
// this.$emit('goBackPage')
this.$tab.refreshPage({ path: '/materialsStation/toolsBack/back' })
}, 500)
}
}
} catch (error) {
console.log('🚀 ~ handleAdd ~ error:', error)
} finally {
loading.close()
}
if (params.backApplyInfo.signUrl) delete params.backApplyInfo.signUrl
const res = await editBackApply(params)
if (res.code == 200) {
this.$message({ type: 'success', message: res.msg })
setTimeout(() => {
this.$emit('goBackPage')
}, 1000)
}
} else {
let params = {
backApplyInfo: this.queryParams.backApplyInfo,
backApplyDetailsList: this.queryParams.equipmentList
}
const res = await addBackApply(params)
if (res.code == 200) {
this.$message({ type: 'success', message: res.msg })
setTimeout(() => {
this.$emit('goBackPage')
}, 1000)
}
}
})
}
})
},