|
|
@ -278,10 +278,18 @@ |
|
|
</el-form> |
|
|
</el-form> |
|
|
<!-- 中部分:扫描列表 --> |
|
|
<!-- 中部分:扫描列表 --> |
|
|
<el-table |
|
|
<el-table |
|
|
|
|
|
ref="caseRollTable" |
|
|
:data="caseRollList" |
|
|
:data="caseRollList" |
|
|
border |
|
|
border |
|
|
height="300" |
|
|
height="300" |
|
|
|
|
|
@selection-change="handleCaseRollSelectionChange" |
|
|
style="width: 100%; margin-top: 10px;"> |
|
|
style="width: 100%; margin-top: 10px;"> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
type="selection" |
|
|
|
|
|
width="55" |
|
|
|
|
|
header-align="center" |
|
|
|
|
|
align="center"> |
|
|
|
|
|
</el-table-column> |
|
|
<el-table-column |
|
|
<el-table-column |
|
|
type="index" |
|
|
type="index" |
|
|
label="序号" |
|
|
label="序号" |
|
|
@ -342,7 +350,7 @@ |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
</el-table> |
|
|
</el-table> |
|
|
<el-footer style="height:35px;margin-top: 15px;text-align:center"> |
|
|
<el-footer style="height:35px;margin-top: 15px;text-align:center"> |
|
|
<el-button type="primary" @click="">打印</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" :loading="printLoading" @click="printCaseRolls">打印</el-button> |
|
|
<el-button type="primary" @click="applyCaseScan">应用</el-button> |
|
|
<el-button type="primary" @click="applyCaseScan">应用</el-button> |
|
|
<el-button type="success" @click="saveCaseScan">保存</el-button> |
|
|
<el-button type="success" @click="saveCaseScan">保存</el-button> |
|
|
<el-button @click="closeCaseDialog">关闭</el-button> |
|
|
<el-button @click="closeCaseDialog">关闭</el-button> |
|
|
@ -366,16 +374,23 @@ import { |
|
|
validateAndScanCaseRoll, |
|
|
validateAndScanCaseRoll, |
|
|
saveCaseRollList, |
|
|
saveCaseRollList, |
|
|
searchOutboundNotificationWithDetail, |
|
|
searchOutboundNotificationWithDetail, |
|
|
|
|
|
searchOutboundNotificationWithDetailByPage, |
|
|
updateOrderStatus |
|
|
updateOrderStatus |
|
|
} from '../../../api/boxManage/boxManage' |
|
|
} from '../../../api/boxManage/boxManage' |
|
|
|
|
|
import { callUspPartLabelTemplate } from '@/api/wms/wms' |
|
|
|
|
|
import getLodop from '@/utils/LodopFuncs.js' |
|
|
|
|
|
import labelPrintTemplates from '@/mixins/labelPrintTemplates.js' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
|
|
|
mixins: [labelPrintTemplates], |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
functionId: this.$route.meta.menuId, |
|
|
functionId: this.$route.meta.menuId, |
|
|
height: 200, |
|
|
height: 200, |
|
|
currentRow: {}, |
|
|
currentRow: {}, |
|
|
|
|
|
selectedCaseRolls: [], // 装盒对话框中选中的卷标签 |
|
|
|
|
|
printLoading: false, // 打印loading |
|
|
searchData:{ |
|
|
searchData:{ |
|
|
orderNo:'', |
|
|
orderNo:'', |
|
|
customerId:'', |
|
|
customerId:'', |
|
|
@ -782,24 +797,26 @@ export default { |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
|
|
|
getMainData(){ |
|
|
getMainData(){ |
|
|
|
|
|
this.dataListLoading = true |
|
|
this.searchData.limit = this.pageSize |
|
|
this.searchData.limit = this.pageSize |
|
|
this.searchData.page = this.pageIndex |
|
|
this.searchData.page = this.pageIndex |
|
|
this.searchData.orderStatus = this.searchData.orderStatusList.join(',') |
|
|
this.searchData.orderStatus = this.searchData.orderStatusList.join(',') |
|
|
searchOutboundNotificationWithDetail(this.searchData).then(({data}) => { |
|
|
|
|
|
|
|
|
searchOutboundNotificationWithDetailByPage(this.searchData).then(({data}) => { |
|
|
if (data.code === 0) { |
|
|
if (data.code === 0) { |
|
|
this.mainDataList = data.rows |
|
|
|
|
|
this.totalPage = this.mainDataList.length |
|
|
|
|
|
|
|
|
this.mainDataList = data.page.list |
|
|
|
|
|
this.totalPage = data.page.totalCount |
|
|
//判断是否全部存在数据 |
|
|
//判断是否全部存在数据 |
|
|
if (this.totalPage > 0) { |
|
|
|
|
|
|
|
|
if (this.mainDataList && this.mainDataList.length > 0) { |
|
|
//设置选中行 |
|
|
//设置选中行 |
|
|
this.$refs.mainTable.setCurrentRow(this.mainDataList[0]) |
|
|
this.$refs.mainTable.setCurrentRow(this.mainDataList[0]) |
|
|
this.changeData(this.mainDataList[0]) |
|
|
this.changeData(this.mainDataList[0]) |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.changeData(null) |
|
|
this.changeData(null) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.dataListLoading = false |
|
|
this.dataListLoading = false |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.dataListLoading = false |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
tabClick(tab, event){ |
|
|
tabClick(tab, event){ |
|
|
@ -956,6 +973,7 @@ export default { |
|
|
partNo: '' |
|
|
partNo: '' |
|
|
} |
|
|
} |
|
|
this.caseRollList = [] |
|
|
this.caseRollList = [] |
|
|
|
|
|
this.selectedCaseRolls = [] |
|
|
this.updateCaseStatistics() |
|
|
this.updateCaseStatistics() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -1188,6 +1206,89 @@ export default { |
|
|
this.selectedCaseRecords = selection |
|
|
this.selectedCaseRecords = selection |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 装盒对话框中卷标签选择变化 |
|
|
|
|
|
handleCaseRollSelectionChange(selection){ |
|
|
|
|
|
this.selectedCaseRolls = selection |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 打印选中的卷标签 |
|
|
|
|
|
async printCaseRolls(){ |
|
|
|
|
|
if(this.selectedCaseRolls.length === 0){ |
|
|
|
|
|
this.$message.warning('请先选择要打印的卷标签') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.printLoading = true |
|
|
|
|
|
try { |
|
|
|
|
|
// 1. 获取 LODOP 打印控件 |
|
|
|
|
|
const LODOP = getLodop() |
|
|
|
|
|
if (!LODOP) { |
|
|
|
|
|
this.$message.error('无法连接到打印控件,请确保已安装并启动 CLodop!') |
|
|
|
|
|
this.printLoading = false |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 2. 获取默认打印机 |
|
|
|
|
|
const printerCount = LODOP.GET_PRINTER_COUNT() |
|
|
|
|
|
if (printerCount <= 0) { |
|
|
|
|
|
this.$message.error('未检测到打印机,请确保已安装并连接打印机!') |
|
|
|
|
|
this.printLoading = false |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 3. 循环调用存储过程获取打印参数并打印 |
|
|
|
|
|
for (const rollItem of this.selectedCaseRolls) { |
|
|
|
|
|
const params = { |
|
|
|
|
|
site: this.currentRow.site, |
|
|
|
|
|
buNo: this.currentRow.buNo, |
|
|
|
|
|
menuID: this.$route.meta.menuId, |
|
|
|
|
|
relatedOrderNo: this.currentRow.orderNo, |
|
|
|
|
|
relatedOrderLineNo: this.currentRow.relatedOrderLineNo || '', |
|
|
|
|
|
documentNo: this.currentRow.orderNo, |
|
|
|
|
|
partNo: rollItem.partNo, |
|
|
|
|
|
labelNo: '', |
|
|
|
|
|
rollNo: rollItem.rollNo |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const {data: printData} = await callUspPartLabelTemplate(params) |
|
|
|
|
|
if (printData && printData.code === 0 && printData.row) { |
|
|
|
|
|
const labelData = printData.row |
|
|
|
|
|
|
|
|
|
|
|
// 初始化打印任务 |
|
|
|
|
|
LODOP.PRINT_INIT('卷标签打印_' + rollItem.rollNo) |
|
|
|
|
|
LODOP.SET_PRINT_MODE("PRINT_NOCOLLATE", true) |
|
|
|
|
|
|
|
|
|
|
|
// 根据 labelNo 调用不同的打印方法 |
|
|
|
|
|
if (labelData.labelNo === 'A001') { |
|
|
|
|
|
await this.printLabelA001(LODOP, labelData, false) |
|
|
|
|
|
} else if (labelData.labelNo === 'A002') { |
|
|
|
|
|
this.printLabelA002(LODOP, labelData, false) |
|
|
|
|
|
} else if (labelData.labelNo === 'A003') { |
|
|
|
|
|
this.printLabelA003(LODOP, labelData, false) |
|
|
|
|
|
} else if (labelData.labelNo === 'A004') { |
|
|
|
|
|
this.printLabelA004(LODOP, labelData, false) |
|
|
|
|
|
} else { |
|
|
|
|
|
console.warn(`未知的标签模板:${labelData.labelNo},跳过该标签`) |
|
|
|
|
|
continue |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 执行打印 |
|
|
|
|
|
LODOP.PRINT() |
|
|
|
|
|
console.log(`标签已发送打印, 卷号: ${rollItem.rollNo}`) |
|
|
|
|
|
} else { |
|
|
|
|
|
console.warn(`获取卷号 ${rollItem.rollNo} 的打印参数失败`) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.$message.success('打印任务已发送!') |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('打印标签失败:', error) |
|
|
|
|
|
this.$message.error('打印标签失败: ' + (error.message || '请重试')) |
|
|
|
|
|
} finally { |
|
|
|
|
|
this.printLoading = false |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
async deleteCaseRecord(){ |
|
|
async deleteCaseRecord(){ |
|
|
if(this.selectedCaseRecords.length === 0){ |
|
|
if(this.selectedCaseRecords.length === 0){ |
|
|
this.$message.warning('请先选择要删除的记录') |
|
|
this.$message.warning('请先选择要删除的记录') |
|
|
|