|
|
@ -28,6 +28,7 @@ |
|
|
<el-button @click="getDataList()" type="primary">查询</el-button> |
|
|
<el-button @click="getDataList()" type="primary">查询</el-button> |
|
|
<el-button @click="resetQuery()" type="default">重置</el-button> |
|
|
<el-button @click="resetQuery()" type="default">重置</el-button> |
|
|
<el-button @click="showOtherInboundDialog()" type="success">其它入库标签打印</el-button> |
|
|
<el-button @click="showOtherInboundDialog()" type="success">其它入库标签打印</el-button> |
|
|
|
|
|
<el-button @click="showFailedPrintTasksDialog()" type="warning">失败打印任务重试</el-button> |
|
|
<!-- 导出按钮 - rqrq --> |
|
|
<!-- 导出按钮 - rqrq --> |
|
|
<download-excel |
|
|
<download-excel |
|
|
:fields="fields()" |
|
|
:fields="fields()" |
|
|
@ -195,11 +196,62 @@ |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 失败打印任务重试弹窗 --> |
|
|
|
|
|
<el-dialog |
|
|
|
|
|
title="失败打印任务列表" |
|
|
|
|
|
:visible.sync="failedPrintTasksVisible" |
|
|
|
|
|
width="600px" |
|
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
|
<el-table |
|
|
|
|
|
:data="failedPrintTasksList" |
|
|
|
|
|
border |
|
|
|
|
|
stripe |
|
|
|
|
|
v-loading="failedPrintTasksLoading" |
|
|
|
|
|
max-height="400" |
|
|
|
|
|
style="width: 100%"> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="unitId" |
|
|
|
|
|
label="标签号" |
|
|
|
|
|
min-width="150" |
|
|
|
|
|
align="center" |
|
|
|
|
|
header-align="center"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="printerIp" |
|
|
|
|
|
label="打印机IP" |
|
|
|
|
|
min-width="120" |
|
|
|
|
|
align="center" |
|
|
|
|
|
header-align="center"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="retryCount" |
|
|
|
|
|
label="打印次数" |
|
|
|
|
|
width="80" |
|
|
|
|
|
align="center" |
|
|
|
|
|
header-align="center"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
prop="createdDate" |
|
|
|
|
|
label="创建时间" |
|
|
|
|
|
min-width="150" |
|
|
|
|
|
align="center" |
|
|
|
|
|
header-align="center"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
{{ formatDate(scope.row.createdDate) }} |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button @click="failedPrintTasksVisible = false">取消</el-button> |
|
|
|
|
|
<el-button type="primary" @click="retryAllFailedTasks()" :loading="retryLoading">重试全部</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { getHandlingUnitLabelList, reprintLabel, deleteLabel } from '@/api/warehouse/labelQuery' |
|
|
|
|
|
|
|
|
import { getHandlingUnitLabelList, reprintLabel, deleteLabel, getFailedPrintTasks, retryFailedPrintTasks } from '@/api/warehouse/labelQuery' |
|
|
import { searchSysLanguagePackList, saveUserFavorite, searchUserFavorite } from '@/api/sysLanguage' |
|
|
import { searchSysLanguagePackList, saveUserFavorite, searchUserFavorite } from '@/api/sysLanguage' |
|
|
import { createOtherInboundHU, printLabel } from '@/api/warehouse/otherInbound' |
|
|
import { createOtherInboundHU, printLabel } from '@/api/warehouse/otherInbound' |
|
|
|
|
|
|
|
|
@ -455,7 +507,12 @@ export default { |
|
|
{ required: true, message: '包装数不能为空', trigger: 'blur' }, |
|
|
{ required: true, message: '包装数不能为空', trigger: 'blur' }, |
|
|
{ type: 'number', min: 1, message: '包装数必须大于等于1', trigger: 'blur' } |
|
|
{ type: 'number', min: 1, message: '包装数必须大于等于1', trigger: 'blur' } |
|
|
] |
|
|
] |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
// 失败打印任务相关 |
|
|
|
|
|
failedPrintTasksVisible: false, |
|
|
|
|
|
failedPrintTasksLoading: false, |
|
|
|
|
|
failedPrintTasksList: [], |
|
|
|
|
|
retryLoading: false |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
activated() { |
|
|
activated() { |
|
|
@ -799,6 +856,75 @@ export default { |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
return Promise.reject(error) |
|
|
return Promise.reject(error) |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 显示失败打印任务对话框 |
|
|
|
|
|
*/ |
|
|
|
|
|
async showFailedPrintTasksDialog() { |
|
|
|
|
|
this.failedPrintTasksVisible = true |
|
|
|
|
|
this.failedPrintTasksLoading = true |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
const { data } = await getFailedPrintTasks({ |
|
|
|
|
|
site: localStorage.getItem('site') |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.failedPrintTasksList = data.rows || [] |
|
|
|
|
|
if (this.failedPrintTasksList.length === 0) { |
|
|
|
|
|
this.$message.warning('没有失败的打印任务') |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || '查询失败') |
|
|
|
|
|
this.failedPrintTasksList = [] |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
this.$message.error('查询失败:' + error.message) |
|
|
|
|
|
this.failedPrintTasksList = [] |
|
|
|
|
|
} finally { |
|
|
|
|
|
this.failedPrintTasksLoading = false |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 重试全部失败的打印任务 |
|
|
|
|
|
*/ |
|
|
|
|
|
async retryAllFailedTasks() { |
|
|
|
|
|
if (this.failedPrintTasksList.length === 0) { |
|
|
|
|
|
this.$message.warning('没有需要重试的任务') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.$confirm(`确定要重试全部 ${this.failedPrintTasksList.length} 个失败的打印任务吗?`, '重试确认', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(async () => { |
|
|
|
|
|
this.retryLoading = true |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
const { data } = await retryFailedPrintTasks({ |
|
|
|
|
|
site: localStorage.getItem('site') |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.$message.success(`成功将 ${data.count || 0} 个任务重新加入打印队列`) |
|
|
|
|
|
// 关闭对话框 |
|
|
|
|
|
this.failedPrintTasksVisible = false |
|
|
|
|
|
// 清空列表 |
|
|
|
|
|
this.failedPrintTasksList = [] |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || '重试失败') |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
this.$message.error('重试失败:' + error.message) |
|
|
|
|
|
} finally { |
|
|
|
|
|
this.retryLoading = false |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
// 用户取消重试 |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|