Browse Source

2026-03-30

标签变动记录增加【异常重试】功能
master
fengyuan_yang 3 weeks ago
parent
commit
e016e2c4a1
  1. 68
      src/views/modules/warehouse/labelTransactionLog.vue

68
src/views/modules/warehouse/labelTransactionLog.vue

@ -169,6 +169,13 @@
@click="batchRetryHandle">
手动重试
</el-button>
<el-button
v-if="isAuth('105006:exceptionTry')"
type="danger"
icon="el-icon-warning-outline"
@click="exceptionRetryHandle">
异常重试
</el-button>
<el-button
icon="el-icon-download"
@click="exportData">
@ -544,6 +551,67 @@ export default {
this.dataListSelections = val
},
//
exceptionRetryHandle() {
if (this.dataListSelections.length === 0) {
this.$message.warning('请选择要重试的记录!')
return
}
const count = this.dataListSelections.length
this.$confirm(`确定要异常重试选中的 ${count} 条记录吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: `正在重试 ${count} 条记录,请稍候...`,
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
//
const retryList = this.dataListSelections.map(item => ({
site: item.site,
buNo: item.buNo,
transactionId: item.transactionId
}))
//
labelTransactionLogRetry({ retryList, isExceptionRetry: true }).then(({ data }) => {
loading.close()
if (data && data.code === 0) {
const result = data.result || {}
const successCount = result.successCount || 0
const failureCount = result.failureCount || 0
let message = `重试完成!成功:${successCount},失败:${failureCount}`
if (successCount === count) {
this.$message.success(message)
} else if (successCount > 0) {
this.$message.warning(message)
} else {
this.$message.error(message)
}
//
if (result.details && result.details.length > 0) {
this.showRetryResultDialog(result.details)
}
//
this.getDataList()
} else {
this.$message.error(data.msg || '重试失败')
}
}).catch(error => {
loading.close()
this.$message.error('重试失败:' + (error.message || '网络错误'))
})
}).catch(() => {})
},
//
batchRetryHandle() {
if (this.dataListSelections.length === 0) {

Loading…
Cancel
Save