|
|
@ -51,7 +51,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="4"> |
|
|
<el-col :span="4"> |
|
|
<el-form-item label="单据状态"> |
|
|
<el-form-item label="单据状态"> |
|
|
<el-select multiple collapse-tags v-model="searchData.orderStatusList" clearable placeholder="请选择" style="width: 100%"> |
|
|
|
|
|
|
|
|
<el-select multiple collapse-tags v-model="searchData.orderStatusList" clearable placeholder="请选择" style="width: 120%"> |
|
|
<el-option label="待包装" value="待包装"></el-option> |
|
|
<el-option label="待包装" value="待包装"></el-option> |
|
|
<el-option label="待检验" value="待检验"></el-option> |
|
|
<el-option label="待检验" value="待检验"></el-option> |
|
|
<el-option label="已出库" value="已出库"></el-option> |
|
|
<el-option label="已出库" value="已出库"></el-option> |
|
|
@ -170,6 +170,7 @@ |
|
|
<el-form v-if="currentRow.orderStatus === '待包装'" label-position="top" style="margin-left: 2px; display: flex; align-items: center;"> |
|
|
<el-form v-if="currentRow.orderStatus === '待包装'" label-position="top" style="margin-left: 2px; display: flex; align-items: center;"> |
|
|
<el-button type="primary" size="small" @click="openCaseDialog">新增</el-button> |
|
|
<el-button type="primary" size="small" @click="openCaseDialog">新增</el-button> |
|
|
<el-button type="danger" size="small" @click="deleteCaseRecord">删除</el-button> |
|
|
<el-button type="danger" size="small" @click="deleteCaseRecord">删除</el-button> |
|
|
|
|
|
<el-button type="primary" size="small" :loading="printCasesLoading" @click="printSelectedCases">打印</el-button> |
|
|
<span style="margin-left: auto; font-size: 14px; display: flex; align-items: center;"> |
|
|
<span style="margin-left: auto; font-size: 14px; display: flex; align-items: center;"> |
|
|
<span style="margin-right: 20px;"> |
|
|
<span style="margin-right: 20px;"> |
|
|
<span style="color: #606266;">盒标签张数:</span> |
|
|
<span style="color: #606266;">盒标签张数:</span> |
|
|
@ -188,7 +189,7 @@ |
|
|
<el-table |
|
|
<el-table |
|
|
ref="caseTable" |
|
|
ref="caseTable" |
|
|
:data="casesList" |
|
|
:data="casesList" |
|
|
:height="height - 30" |
|
|
|
|
|
|
|
|
:height="height" |
|
|
border |
|
|
border |
|
|
@selection-change="handleCaseSelectionChange" |
|
|
@selection-change="handleCaseSelectionChange" |
|
|
style="width: 100%;"> |
|
|
style="width: 100%;"> |
|
|
@ -254,7 +255,7 @@ |
|
|
<el-tab-pane label="装箱清单" name="rollDetail"> |
|
|
<el-tab-pane label="装箱清单" name="rollDetail"> |
|
|
<el-table |
|
|
<el-table |
|
|
:data="rollList" |
|
|
:data="rollList" |
|
|
:height="height - 20" |
|
|
|
|
|
|
|
|
:height="height + 23" |
|
|
border |
|
|
border |
|
|
style="width: 100%;"> |
|
|
style="width: 100%;"> |
|
|
<el-table-column |
|
|
<el-table-column |
|
|
@ -474,6 +475,7 @@ export default { |
|
|
currentRow: {}, |
|
|
currentRow: {}, |
|
|
selectedCaseRolls: [], // 装盒对话框中选中的卷标签 |
|
|
selectedCaseRolls: [], // 装盒对话框中选中的卷标签 |
|
|
printLoading: false, // 打印loading |
|
|
printLoading: false, // 打印loading |
|
|
|
|
|
printCasesLoading: false, // 扫描装盒页签打印loading |
|
|
searchData:{ |
|
|
searchData:{ |
|
|
orderNo:'', |
|
|
orderNo:'', |
|
|
customerId:'', |
|
|
customerId:'', |
|
|
@ -889,9 +891,9 @@ export default { |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
const windowHeight = window.innerHeight; |
|
|
const windowHeight = window.innerHeight; |
|
|
// 根据搜索条件展开状态动态计算 |
|
|
// 根据搜索条件展开状态动态计算 |
|
|
const headerHeight = this.searchExpanded ? 220 : 154; |
|
|
|
|
|
this.tableHeight = (windowHeight - headerHeight - 178) / 2; |
|
|
|
|
|
this.height = this.tableHeight; |
|
|
|
|
|
|
|
|
const headerHeight = this.searchExpanded ? 220 : 152; |
|
|
|
|
|
this.tableHeight = (windowHeight - headerHeight - 162) / 2; |
|
|
|
|
|
this.height = this.tableHeight - 51; |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
// 切换搜索展开/收起 |
|
|
// 切换搜索展开/收起 |
|
|
@ -992,7 +994,7 @@ export default { |
|
|
orderNo: this.currentRow.orderNo, |
|
|
orderNo: this.currentRow.orderNo, |
|
|
saleOrderNo: this.currentRow.relatedOrderNo || '', // 销售订单号,用于生成箱号 |
|
|
saleOrderNo: this.currentRow.relatedOrderNo || '', // 销售订单号,用于生成箱号 |
|
|
boxType: this.currentRow.orderType, |
|
|
boxType: this.currentRow.orderType, |
|
|
height:Number(this.height)-25, |
|
|
|
|
|
|
|
|
height: this.height, |
|
|
orderStatus: this.currentRow.orderStatus |
|
|
orderStatus: this.currentRow.orderStatus |
|
|
} |
|
|
} |
|
|
this.$refs.boxing.init(inData) |
|
|
this.$refs.boxing.init(inData) |
|
|
@ -1015,7 +1017,7 @@ export default { |
|
|
buNo: this.currentRow ? this.currentRow.buNo : '', |
|
|
buNo: this.currentRow ? this.currentRow.buNo : '', |
|
|
orderNo: this.currentRow ? this.currentRow.orderNo : '', |
|
|
orderNo: this.currentRow ? this.currentRow.orderNo : '', |
|
|
palletType: this.currentRow ? this.currentRow.orderType : '', |
|
|
palletType: this.currentRow ? this.currentRow.orderType : '', |
|
|
height: Number(this.height)-25, |
|
|
|
|
|
|
|
|
height: this.height, |
|
|
orderStatus: this.currentRow ? this.currentRow.orderStatus : '' |
|
|
orderStatus: this.currentRow ? this.currentRow.orderStatus : '' |
|
|
} |
|
|
} |
|
|
this.$refs.pallet.init(inData) |
|
|
this.$refs.pallet.init(inData) |
|
|
@ -1394,6 +1396,84 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 打印选中的盒清单卷标签 |
|
|
|
|
|
async printSelectedCases(){ |
|
|
|
|
|
if(this.selectedCaseRecords.length === 0){ |
|
|
|
|
|
this.$message.warning('请先选择要打印的记录') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.printCasesLoading = true |
|
|
|
|
|
try { |
|
|
|
|
|
// 1. 获取 LODOP 打印控件 |
|
|
|
|
|
const LODOP = getLodop() |
|
|
|
|
|
if (!LODOP) { |
|
|
|
|
|
this.$message.error('无法连接到打印控件,请确保已安装并启动 CLodop!') |
|
|
|
|
|
this.printCasesLoading = false |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 2. 获取默认打印机 |
|
|
|
|
|
const printerCount = LODOP.GET_PRINTER_COUNT() |
|
|
|
|
|
if (printerCount <= 0) { |
|
|
|
|
|
this.$message.error('未检测到打印机,请确保已安装并连接打印机!') |
|
|
|
|
|
this.printCasesLoading = false |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 3. 循环调用存储过程获取打印参数并打印 |
|
|
|
|
|
for (const caseRecord of this.selectedCaseRecords) { |
|
|
|
|
|
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: caseRecord.partNo, |
|
|
|
|
|
labelNo: '', |
|
|
|
|
|
rollNo: caseRecord.rollNo |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const {data: printData} = await callUspPartLabelTemplate(params) |
|
|
|
|
|
if (printData && printData.code === 0 && printData.row) { |
|
|
|
|
|
const labelData = printData.row |
|
|
|
|
|
|
|
|
|
|
|
// 初始化打印任务 |
|
|
|
|
|
LODOP.PRINT_INIT('卷标签打印_' + caseRecord.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(`标签已发送打印, 卷号: ${caseRecord.rollNo}`) |
|
|
|
|
|
} else { |
|
|
|
|
|
console.warn(`获取卷号 ${caseRecord.rollNo} 的打印参数失败`) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.$message.success('打印任务已发送!') |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('打印标签失败:', error) |
|
|
|
|
|
this.$message.error('打印标签失败: ' + (error.message || '请重试')) |
|
|
|
|
|
} finally { |
|
|
|
|
|
this.printCasesLoading = false |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
async deleteCaseRecord(){ |
|
|
async deleteCaseRecord(){ |
|
|
if(this.selectedCaseRecords.length === 0){ |
|
|
if(this.selectedCaseRecords.length === 0){ |
|
|
this.$message.warning('请先选择要删除的记录') |
|
|
this.$message.warning('请先选择要删除的记录') |
|
|
|