|
|
@ -36,6 +36,7 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item :label="' '"> |
|
|
<el-form-item :label="' '"> |
|
|
<el-button type="primary" :loading="searchLoading" @click="getDataList()">查询</el-button> |
|
|
<el-button type="primary" :loading="searchLoading" @click="getDataList()">查询</el-button> |
|
|
|
|
|
<el-button type="success" icon="el-icon-printer" @click="openShipmentLineQueryDialog">打印</el-button> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
|
|
|
|
|
|
@ -641,12 +642,73 @@ |
|
|
|
|
|
|
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 通过输入SHIPMENT查询ShipmentLine并打印 --> |
|
|
|
|
|
<el-dialog |
|
|
|
|
|
title="ShipmentLine打印" |
|
|
|
|
|
:visible.sync="shipmentLineQueryDialogVisible" |
|
|
|
|
|
width="90%" |
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
@close="resetShipmentLineQueryDialog" |
|
|
|
|
|
> |
|
|
|
|
|
<el-form :inline="true" size="small" @submit.native.prevent> |
|
|
|
|
|
<el-form-item label="SHIPMENT"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="dialogShipmentId" |
|
|
|
|
|
clearable |
|
|
|
|
|
placeholder="请输入SHIPMENT" |
|
|
|
|
|
style="width: 220px" |
|
|
|
|
|
@keyup.enter.native="searchShipmentLineByDialog" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
<el-button type="primary" :loading="shipmentLineLoading" @click="searchShipmentLineByDialog">查询</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<div v-if="currentShipmentId" style="margin-bottom: 8px; font-size: 12px;"> |
|
|
|
|
|
当前SHIPMENTID:{{ currentShipmentId }} |
|
|
|
|
|
</div> |
|
|
|
|
|
<el-table |
|
|
|
|
|
:data="shipmentLineList" |
|
|
|
|
|
height="420" |
|
|
|
|
|
border |
|
|
|
|
|
v-loading="shipmentLineLoading" |
|
|
|
|
|
style="width: 100%;" |
|
|
|
|
|
> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
v-for="(item,index) in columnShipmentLineList" :key="index" |
|
|
|
|
|
:sortable="item.columnSortable" |
|
|
|
|
|
:prop="item.columnProp" |
|
|
|
|
|
:header-align="item.headerAlign" |
|
|
|
|
|
:show-overflow-tooltip="item.showOverflowTooltip" |
|
|
|
|
|
:align="item.align" |
|
|
|
|
|
:fixed="item.fixed==''?false:item.fixed" |
|
|
|
|
|
:min-width="item.columnWidth" |
|
|
|
|
|
:label="item.columnLabel" |
|
|
|
|
|
> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column fixed="right" header-align="center" align="center" width="80" label="操作"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-link |
|
|
|
|
|
type="primary" |
|
|
|
|
|
style="cursor: pointer" |
|
|
|
|
|
:disabled="printLoading" |
|
|
|
|
|
@click="printShipmentLine(scope.row)" |
|
|
|
|
|
>打印</el-link> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
<!-- shipmentline打印设置:标签类型/模板/打印机由后端按 customerId(receiverId) 自动匹配,红框部分已注释 --> |
|
|
<!-- shipmentline打印设置:标签类型/模板/打印机由后端按 customerId(receiverId) 自动匹配,红框部分已注释 --> |
|
|
<el-dialog |
|
|
<el-dialog |
|
|
title="标签打印设置" |
|
|
title="标签打印设置" |
|
|
:visible.sync="shipmentLinePrintDialogVisible" |
|
|
:visible.sync="shipmentLinePrintDialogVisible" |
|
|
width="480px" |
|
|
width="480px" |
|
|
:close-on-click-modal="false" |
|
|
:close-on-click-modal="false" |
|
|
|
|
|
append-to-body |
|
|
@close="resetShipmentLinePrintForm" |
|
|
@close="resetShipmentLinePrintForm" |
|
|
> |
|
|
> |
|
|
<el-alert |
|
|
<el-alert |
|
|
@ -1980,6 +2042,8 @@ export default { |
|
|
shipmentLineLoading: false, |
|
|
shipmentLineLoading: false, |
|
|
currentShipmentId: '', |
|
|
currentShipmentId: '', |
|
|
currentReceiverId: '', |
|
|
currentReceiverId: '', |
|
|
|
|
|
shipmentLineQueryDialogVisible: false, |
|
|
|
|
|
dialogShipmentId: '', |
|
|
shipmentLinePrintDialogVisible: false, |
|
|
shipmentLinePrintDialogVisible: false, |
|
|
printLoading: false, |
|
|
printLoading: false, |
|
|
printShipmentLineRow: null, |
|
|
printShipmentLineRow: null, |
|
|
@ -3210,28 +3274,59 @@ export default { |
|
|
|
|
|
|
|
|
let receiverId = row.receiverId || row.RECEIVER_ID |
|
|
let receiverId = row.receiverId || row.RECEIVER_ID |
|
|
if (!receiverId) { |
|
|
if (!receiverId) { |
|
|
|
|
|
receiverId = await this.fetchReceiverIdByShipment(shipmentId, row.site) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!receiverId) { |
|
|
|
|
|
this.$message.warning('未获取到receiverId') |
|
|
|
|
|
} |
|
|
|
|
|
this.currentReceiverId = receiverId || '' |
|
|
|
|
|
this.loadShipmentLineList(row, true) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
openShipmentLineQueryDialog() { |
|
|
|
|
|
this.shipmentLineQueryDialogVisible = true |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
resetShipmentLineQueryDialog() { |
|
|
|
|
|
this.dialogShipmentId = '' |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async searchShipmentLineByDialog() { |
|
|
|
|
|
const shipmentId = (this.dialogShipmentId || '').trim() |
|
|
|
|
|
if (!shipmentId) { |
|
|
|
|
|
this.$message.warning('请输入SHIPMENT') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.currentShipmentId = shipmentId |
|
|
|
|
|
this.currentReceiverId = '' |
|
|
|
|
|
|
|
|
|
|
|
const site = (this.currentRow && this.currentRow.site) || this.$store.state.user.site |
|
|
|
|
|
const receiverId = await this.fetchReceiverIdByShipment(shipmentId, site) |
|
|
|
|
|
if (!receiverId) { |
|
|
|
|
|
this.$message.warning('未获取到receiverId') |
|
|
|
|
|
} |
|
|
|
|
|
this.currentReceiverId = receiverId || '' |
|
|
|
|
|
this.loadShipmentLineList({ soorderNo: shipmentId, site }, false) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async fetchReceiverIdByShipment(shipmentId, site) { |
|
|
try { |
|
|
try { |
|
|
const site = row.site || this.currentRow.site || this.$store.state.user.site |
|
|
|
|
|
|
|
|
const querySite = site || (this.currentRow && this.currentRow.site) || this.$store.state.user.site |
|
|
const { data } = await getShipmentListForIssure({ |
|
|
const { data } = await getShipmentListForIssure({ |
|
|
site, |
|
|
|
|
|
|
|
|
site: querySite, |
|
|
orderNo: shipmentId, |
|
|
orderNo: shipmentId, |
|
|
}) |
|
|
}) |
|
|
if (data && data.code === 0 && data.rows && data.rows.length > 0) { |
|
|
if (data && data.code === 0 && data.rows && data.rows.length > 0) { |
|
|
const matched = data.rows.find(item => |
|
|
const matched = data.rows.find(item => |
|
|
String(item.SHIPMENT_ID || item.shipmentId) === String(shipmentId) |
|
|
String(item.SHIPMENT_ID || item.shipmentId) === String(shipmentId) |
|
|
) || data.rows[0] |
|
|
) || data.rows[0] |
|
|
receiverId = matched.receiverId || matched.RECEIVER_ID |
|
|
|
|
|
|
|
|
return matched.receiverId || matched.RECEIVER_ID || '' |
|
|
} |
|
|
} |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
this.$message.error('获取shipment信息失败') |
|
|
this.$message.error('获取shipment信息失败') |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!receiverId) { |
|
|
|
|
|
this.$message.warning('未获取到receiverId') |
|
|
|
|
|
} |
|
|
|
|
|
this.currentReceiverId = receiverId || '' |
|
|
|
|
|
this.loadShipmentLineList(row) |
|
|
|
|
|
|
|
|
return '' |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
normalizeShipmentLineRow(row) { |
|
|
normalizeShipmentLineRow(row) { |
|
|
@ -3251,9 +3346,9 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
loadShipmentLineList(row) { |
|
|
|
|
|
|
|
|
loadShipmentLineList(row, switchTab = true) { |
|
|
const params = { |
|
|
const params = { |
|
|
site: row.site || this.currentRow.site || this.$store.state.user.site, |
|
|
|
|
|
|
|
|
site: row.site || (this.currentRow && this.currentRow.site) || this.$store.state.user.site, |
|
|
orderNo: row.soorderNo, |
|
|
orderNo: row.soorderNo, |
|
|
} |
|
|
} |
|
|
this.shipmentLineLoading = true |
|
|
this.shipmentLineLoading = true |
|
|
@ -3261,7 +3356,9 @@ export default { |
|
|
.then(({ data }) => { |
|
|
.then(({ data }) => { |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
this.shipmentLineList = (data.rows || []).map(item => this.normalizeShipmentLineRow(item)) |
|
|
this.shipmentLineList = (data.rows || []).map(item => this.normalizeShipmentLineRow(item)) |
|
|
|
|
|
if (switchTab) { |
|
|
this.activeTable = 'shipmentLinePrint' |
|
|
this.activeTable = 'shipmentLinePrint' |
|
|
|
|
|
} |
|
|
if (this.shipmentLineList.length === 0) { |
|
|
if (this.shipmentLineList.length === 0) { |
|
|
this.$message.warning('未查询到ShipmentLine数据') |
|
|
this.$message.warning('未查询到ShipmentLine数据') |
|
|
} |
|
|
} |
|
|
@ -3281,7 +3378,7 @@ export default { |
|
|
|
|
|
|
|
|
printShipmentLine(row) { |
|
|
printShipmentLine(row) { |
|
|
if (!this.currentReceiverId) { |
|
|
if (!this.currentReceiverId) { |
|
|
this.$message.warning('未获取到receiverId,请先双击已申请SHIPMENT') |
|
|
|
|
|
|
|
|
this.$message.warning('未获取到receiverId,请先查询SHIPMENT') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
this.printShipmentLineRow = row |
|
|
this.printShipmentLineRow = row |
|
|
@ -3324,7 +3421,7 @@ export default { |
|
|
labelType: this.printForm.labelType, |
|
|
labelType: this.printForm.labelType, |
|
|
printerName: this.printForm.printerName, |
|
|
printerName: this.printForm.printerName, |
|
|
copies: this.printForm.copies, |
|
|
copies: this.printForm.copies, |
|
|
site: this.currentRow.site || this.$store.state.user.site, |
|
|
|
|
|
|
|
|
site: (this.currentRow && this.currentRow.site) || this.$store.state.user.site, |
|
|
userId: localStorage.getItem('userName'), |
|
|
userId: localStorage.getItem('userName'), |
|
|
username: localStorage.getItem('userName'), |
|
|
username: localStorage.getItem('userName'), |
|
|
consignmentId: String(row.shipmentId || ''), |
|
|
consignmentId: String(row.shipmentId || ''), |
|
|
|