|
|
|
@ -176,6 +176,13 @@ |
|
|
|
@click="exceptionRetryHandle"> |
|
|
|
异常重试 |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
v-if="isAuth('105006:exceptionClose')" |
|
|
|
type="info" |
|
|
|
icon="el-icon-circle-close" |
|
|
|
@click="exceptionCloseHandle"> |
|
|
|
异常关闭 |
|
|
|
</el-button> |
|
|
|
<el-button |
|
|
|
icon="el-icon-download" |
|
|
|
@click="exportData"> |
|
|
|
@ -262,7 +269,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { labelTransactionLogList, labelTransactionLogRetry } from '@/api/warehouse/labelTransactionLog.js' |
|
|
|
import { labelTransactionLogList, labelTransactionLogRetry, labelTransactionLogClose } from '@/api/warehouse/labelTransactionLog.js' |
|
|
|
import { getSiteAndBuByUserName2 } from '@/api/qc/qc.js' |
|
|
|
import { getWarehouseList } from '@/api/wms/wms.js' |
|
|
|
import excel from '@/utils/excel-util.js' // 导入导出工具类 |
|
|
|
@ -612,6 +619,67 @@ export default { |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 异常关闭 |
|
|
|
exceptionCloseHandle() { |
|
|
|
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 closeList = this.dataListSelections.map(item => ({ |
|
|
|
site: item.site, |
|
|
|
buNo: item.buNo, |
|
|
|
transactionId: item.transactionId |
|
|
|
})) |
|
|
|
|
|
|
|
// 调用批量关闭接口 |
|
|
|
labelTransactionLogClose({ closeList }).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) { |
|
|
|
|