|
|
|
@ -90,13 +90,15 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column header-align="center" align="center" width="120" label="操作" fixed="right"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a |
|
|
|
<el-button |
|
|
|
v-if="scope.row.pushWmsFlag === 'Y' && scope.row.transportFlag === 'N'" |
|
|
|
type="text" |
|
|
|
:loading="closeTaskLoading" |
|
|
|
:disabled="closeTaskLoading" |
|
|
|
@click="closeTask(scope.row)" |
|
|
|
style="color: #F56C6C;"> |
|
|
|
强制完成 |
|
|
|
</a> |
|
|
|
</el-button> |
|
|
|
<span v-else style="color: #C0C4CC;">-</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
@ -332,13 +334,19 @@ export default { |
|
|
|
this.pageIndex = val |
|
|
|
this.searchTable() |
|
|
|
}, |
|
|
|
// 强制完成仅用于超时未出库任务,后端会再次校验并回写transport_flag - rqrq |
|
|
|
closeTask(row) { |
|
|
|
this.$confirm('确认强制完成此任务?完成后将回写立库取出状态,并释放相关栈板调用和标签预定。', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
// 强制完成先走原有服务校验;仅未满一天时弹掩码密码框,正确后携带确认标记重试 - rqrq |
|
|
|
async closeTask (row) { |
|
|
|
if (this.closeTaskLoading) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.closeTaskLoading = true |
|
|
|
try { |
|
|
|
await this.$confirm('确认强制完成此任务?完成后将回写立库取出状态,并释放相关栈板调用和标签预定。', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
closeOnClickModal: false |
|
|
|
}) |
|
|
|
const params = { |
|
|
|
site: row.site, |
|
|
|
subSite: row.subSite, |
|
|
|
@ -346,20 +354,35 @@ export default { |
|
|
|
itemNo: row.itemNo, |
|
|
|
soorderNo: row.soorderNo |
|
|
|
} |
|
|
|
this.closeTaskLoading = true |
|
|
|
haiAnCloseNotifyTask(params).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success(data.msg || '强制完成成功') |
|
|
|
this.searchTable() |
|
|
|
} else { |
|
|
|
this.$alert(data.msg || '强制完成失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$alert('强制完成失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
}).finally(() => { |
|
|
|
this.closeTaskLoading = false |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
// 首次请求保留原有一天时限与全部状态校验;其它业务错误直接提示 - rqrq |
|
|
|
let { data } = await haiAnCloseNotifyTask(params) |
|
|
|
if (data && data.code !== 0 && typeof data.msg === 'string' && data.msg.indexOf('推送WCS时间未超过1天') === 0) { |
|
|
|
// 密码按现场要求写在前端,Element输入框以星号遮蔽;错误密码留在弹框内,不发送覆盖标记 - rqrq |
|
|
|
await this.$prompt('推送WCS未满1天,请输入密码后强制完成。', '提前强制完成', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
inputType: 'password', |
|
|
|
inputPlaceholder: '请输入密码', |
|
|
|
inputValidator: value => value === 'haianccl' || '密码错误', |
|
|
|
closeOnClickModal: false |
|
|
|
}) |
|
|
|
// 只有前端密码验证通过才发送未满一天确认标记;服务仍重新校验任务状态并在同一事务内释放占用 - rqrq |
|
|
|
const retry = await haiAnCloseNotifyTask({ ...params, forceCloseBeforeOneDay: true }) |
|
|
|
data = retry.data |
|
|
|
} |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success(data.msg || '强制完成成功') |
|
|
|
this.searchTable() |
|
|
|
} else { |
|
|
|
this.$alert((data && data.msg) || '强制完成失败', '错误', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
if (error !== 'cancel' && error !== 'close') { |
|
|
|
this.$message.error((error && error.message) || '强制完成失败') |
|
|
|
} |
|
|
|
} finally { |
|
|
|
this.closeTaskLoading = false |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|