|
|
@ -132,6 +132,13 @@ |
|
|
</el-button> |
|
|
</el-button> |
|
|
</div> |
|
|
</div> |
|
|
<div class="action-right"> |
|
|
<div class="action-right"> |
|
|
|
|
|
<el-button |
|
|
|
|
|
v-if="isAuth('105006:try')" |
|
|
|
|
|
type="warning" |
|
|
|
|
|
icon="el-icon-refresh-right" |
|
|
|
|
|
@click="batchRetryHandle"> |
|
|
|
|
|
手动重试 |
|
|
|
|
|
</el-button> |
|
|
<el-button |
|
|
<el-button |
|
|
icon="el-icon-download" |
|
|
icon="el-icon-download" |
|
|
@click="exportData"> |
|
|
@click="exportData"> |
|
|
@ -165,7 +172,14 @@ |
|
|
:data="dataList" |
|
|
:data="dataList" |
|
|
border |
|
|
border |
|
|
v-loading="dataListLoading" |
|
|
v-loading="dataListLoading" |
|
|
|
|
|
@selection-change="selectionChangeHandle" |
|
|
style="width: 100%;"> |
|
|
style="width: 100%;"> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
type="selection" |
|
|
|
|
|
header-align="center" |
|
|
|
|
|
align="center" |
|
|
|
|
|
width="50"> |
|
|
|
|
|
</el-table-column> |
|
|
<el-table-column prop="buNo" label="BU" header-align="center" align="center" width="80"></el-table-column> |
|
|
<el-table-column prop="buNo" label="BU" header-align="center" align="center" width="80"></el-table-column> |
|
|
<el-table-column prop="transactionId" label="变动单号" header-align="center" align="left" min-width="150" show-overflow-tooltip></el-table-column> |
|
|
<el-table-column prop="transactionId" label="变动单号" header-align="center" align="left" min-width="150" show-overflow-tooltip></el-table-column> |
|
|
<el-table-column prop="documentType" label="变动类型" header-align="center" align="center" width="100"></el-table-column> |
|
|
<el-table-column prop="documentType" label="变动类型" header-align="center" align="center" width="100"></el-table-column> |
|
|
@ -211,7 +225,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { labelTransactionLogList } from '@/api/warehouse/labelTransactionLog.js' |
|
|
|
|
|
|
|
|
import { labelTransactionLogList, labelTransactionLogRetry } from '@/api/warehouse/labelTransactionLog.js' |
|
|
import { getSiteAndBuByUserName2 } from '@/api/qc/qc.js' |
|
|
import { getSiteAndBuByUserName2 } from '@/api/qc/qc.js' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
@ -248,6 +262,7 @@ export default { |
|
|
activeTab: 'all', |
|
|
activeTab: 'all', |
|
|
dataList: [], |
|
|
dataList: [], |
|
|
dataListLoading: false, |
|
|
dataListLoading: false, |
|
|
|
|
|
dataListSelections: [], |
|
|
pageIndex: 1, |
|
|
pageIndex: 1, |
|
|
pageSize: 20, |
|
|
pageSize: 20, |
|
|
totalPage: 0, |
|
|
totalPage: 0, |
|
|
@ -391,6 +406,76 @@ export default { |
|
|
currentChangeHandle(val) { |
|
|
currentChangeHandle(val) { |
|
|
this.pageIndex = val |
|
|
this.pageIndex = val |
|
|
this.getDataList() |
|
|
this.getDataList() |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 多选变化 |
|
|
|
|
|
selectionChangeHandle(val) { |
|
|
|
|
|
this.dataListSelections = val |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 批量手动重试 |
|
|
|
|
|
batchRetryHandle() { |
|
|
|
|
|
if (this.dataListSelections.length === 0) { |
|
|
|
|
|
this.$message.warning('请选择要重试的记录!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 校验:只能选择待传输(syncedFlag不为'已传输')且有错误消息的记录 |
|
|
|
|
|
const invalidItems = this.dataListSelections.filter(item => |
|
|
|
|
|
item.syncedFlag === '已传输' || !item.syncedErrorMsg || item.syncedErrorMsg.trim() === '' |
|
|
|
|
|
) |
|
|
|
|
|
if (invalidItems.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 }).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) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
this.getDataList() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || '重试失败') |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
loading.close() |
|
|
|
|
|
this.$message.error('重试失败:' + (error.message || '网络错误')) |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(() => {}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|