|
|
|
@ -78,30 +78,6 @@ |
|
|
|
</el-pagination> |
|
|
|
|
|
|
|
<el-tabs v-model="activeName" style="margin-top: 0px; width: 99%;" @tab-click="tabClick" class="customer-tab" type="border-card"> |
|
|
|
<el-tab-pane label="出库单明细" name="outboundDetail"> |
|
|
|
<el-table |
|
|
|
:data="detailList" |
|
|
|
:height="height - 8" |
|
|
|
border |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in columnDetailList" :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> |
|
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
|
|
|
|
<el-tab-pane label="盒清单" name="cases"> |
|
|
|
<el-form label-position="top" style="margin-left: 2px;"> |
|
|
|
<el-button type="primary" size="small" @click="openCaseDialog">新增</el-button> |
|
|
|
@ -263,15 +239,18 @@ |
|
|
|
<el-form-item label="卷标签"> |
|
|
|
<el-input ref="rollNoInput" v-model="caseForm.rollNo" @keyup.enter.native="scanCaseRoll" placeholder="请扫描卷标签" style="width: 200px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="盒数量"> |
|
|
|
<el-input v-model="caseStatistics.casesCount" readonly style="width: 100px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="卷数量"> |
|
|
|
<el-input v-model="caseStatistics.rollCount" readonly style="width: 100px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="物料总数"> |
|
|
|
<el-input v-model="caseStatistics.totalQty" readonly style="width: 100px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<span style="margin-left: 20px; font-size: 14px; display: inline-block; margin-top: 20px;"> |
|
|
|
<span style="color: #606266;">盒数量:</span> |
|
|
|
<span style="color: rgb(38, 92, 147); font-weight: bold;">{{caseStatistics.casesCount}}</span> |
|
|
|
</span> |
|
|
|
<span style="margin-left: 20px; font-size: 14px; display: inline-block; margin-top: 20px;"> |
|
|
|
<span style="color: #606266;">卷数量:</span> |
|
|
|
<span style="color: rgb(38, 92, 147); font-weight: bold;">{{caseStatistics.rollCount}}</span> |
|
|
|
</span> |
|
|
|
<span style="margin-left: 20px; font-size: 14px; display: inline-block; margin-top: 20px;"> |
|
|
|
<span style="color: #606266;">物料总数:</span> |
|
|
|
<span style="color: rgb(38, 92, 147); font-weight: bold;">{{caseStatistics.totalQty}}</span> |
|
|
|
</span> |
|
|
|
</el-form> |
|
|
|
<!-- 中部分:扫描列表 --> |
|
|
|
<el-table |
|
|
|
@ -328,6 +307,15 @@ |
|
|
|
header-align="center" |
|
|
|
align="left"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
label="操作" |
|
|
|
width="80" |
|
|
|
header-align="center" |
|
|
|
align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-link style="cursor: pointer" @click="deleteRollFromList(scope.$index)">删除</el-link> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-footer style="height:35px;margin-top: 15px;text-align:center"> |
|
|
|
<el-button type="primary" @click="applyCaseScan">应用</el-button> |
|
|
|
@ -345,16 +333,13 @@ |
|
|
|
|
|
|
|
import excel from "@/utils/excel-util.js"; |
|
|
|
import boxing from "./com_saleBoxManage_boxing.vue" |
|
|
|
import { |
|
|
|
getOutboundDetailWithRoll, |
|
|
|
searchOutboundNotification |
|
|
|
} from '../../../api/qc/outbound_notification' |
|
|
|
import { |
|
|
|
searchRollForOrderNo, |
|
|
|
searchSoReceiveCasesData, |
|
|
|
deleteSoReceiveCasesData, |
|
|
|
validateAndScanCaseRoll, |
|
|
|
saveCaseRollList |
|
|
|
saveCaseRollList, |
|
|
|
searchOutboundNotificationWithDetail |
|
|
|
} from '../../../api/boxManage/boxManage' |
|
|
|
|
|
|
|
|
|
|
|
@ -383,9 +368,8 @@ export default { |
|
|
|
tagNo:'', |
|
|
|
rollList:[], |
|
|
|
mainDataList:[], |
|
|
|
detailList:[], |
|
|
|
dataListLoading: false, |
|
|
|
activeName: 'outboundDetail', |
|
|
|
activeName: 'cases', |
|
|
|
// 盒清单相关数据 |
|
|
|
casesList: [], |
|
|
|
caseDialogVisible: false, |
|
|
|
@ -513,137 +497,185 @@ export default { |
|
|
|
status: true, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
], |
|
|
|
columnDetailList: [ |
|
|
|
{ |
|
|
|
columnProp: 'relatedOrderNo', |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '750001Table1RelatedOrderNo', |
|
|
|
tableId: "750001Table1", |
|
|
|
tableName: "销售发货清单", |
|
|
|
columnProp: "relatedOrderNo", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: '销售订单号', |
|
|
|
columnLabel: "销售订单号", |
|
|
|
columnWidth: '100', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'relatedOrderLineNo', |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '750001Table1RelatedOrderLineNo', |
|
|
|
tableId: "750001Table1", |
|
|
|
tableName: "销售发货清单", |
|
|
|
columnProp: "relatedOrderLineNo", |
|
|
|
headerAlign: "center", |
|
|
|
align: "right", |
|
|
|
columnLabel: '销售订单行号', |
|
|
|
columnLabel: "销售订单行号", |
|
|
|
columnWidth: '100', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'partNo', |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '750001Table1PartNo', |
|
|
|
tableId: "750001Table1", |
|
|
|
tableName: "销售发货清单", |
|
|
|
columnProp: "partNo", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: '物料编码', |
|
|
|
columnLabel: "物料编码", |
|
|
|
columnWidth: '120', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 120, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'partDesc', |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '750001Table1PartDesc', |
|
|
|
tableId: "750001Table1", |
|
|
|
tableName: "销售发货清单", |
|
|
|
columnProp: "partDesc", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: '物料名称', |
|
|
|
columnLabel: "物料名称", |
|
|
|
columnWidth: '200', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 200, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'outBatchNo', |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '750001Table1OutBatchNo', |
|
|
|
tableId: "750001Table1", |
|
|
|
tableName: "销售发货清单", |
|
|
|
columnProp: "outBatchNo", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: '合约号', |
|
|
|
columnLabel: "合约号", |
|
|
|
columnWidth: '100', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'orderQty', |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '750001Table1OrderQty', |
|
|
|
tableId: "750001Table1", |
|
|
|
tableName: "销售发货清单", |
|
|
|
columnProp: "orderQty", |
|
|
|
headerAlign: "center", |
|
|
|
align: "right", |
|
|
|
columnLabel: '销售订单数量', |
|
|
|
columnLabel: "销售订单数量", |
|
|
|
columnWidth: '100', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'requiredQty', |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '750001Table1RequiredQty', |
|
|
|
tableId: "750001Table1", |
|
|
|
tableName: "销售发货清单", |
|
|
|
columnProp: "requiredQty", |
|
|
|
headerAlign: "center", |
|
|
|
align: "right", |
|
|
|
columnLabel: '要求发货数量', |
|
|
|
columnLabel: "要求发货数量", |
|
|
|
columnWidth: '100', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'rollQty', |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '750001Table1RollQty', |
|
|
|
tableId: "750001Table1", |
|
|
|
tableName: "销售发货清单", |
|
|
|
columnProp: "rollQty", |
|
|
|
headerAlign: "center", |
|
|
|
align: "right", |
|
|
|
columnLabel: '已扫描数量', |
|
|
|
columnLabel: "已扫描数量", |
|
|
|
columnWidth: '100', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'unScanQty', |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '750001Table1UnScanQty', |
|
|
|
tableId: "750001Table1", |
|
|
|
tableName: "销售发货清单", |
|
|
|
columnProp: "unScanQty", |
|
|
|
headerAlign: "center", |
|
|
|
align: "right", |
|
|
|
columnLabel: '未扫描数量', |
|
|
|
columnLabel: "未扫描数量", |
|
|
|
columnWidth: '100', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'unit', |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: this.functionId, |
|
|
|
serialNumber: '750001Table1Unit', |
|
|
|
tableId: "750001Table1", |
|
|
|
tableName: "销售发货清单", |
|
|
|
columnProp: "unit", |
|
|
|
headerAlign: "center", |
|
|
|
align: "left", |
|
|
|
columnLabel: '单位', |
|
|
|
columnLabel: "单位", |
|
|
|
columnWidth: '80', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 100, |
|
|
|
fixed: false |
|
|
|
}, |
|
|
|
], |
|
|
|
exportName: '销售出库单'+this.dayjs().format('YYYYMMDDHHmmss'), |
|
|
|
@ -664,12 +696,10 @@ export default { |
|
|
|
getMainData(){ |
|
|
|
this.searchData.limit = this.pageSize |
|
|
|
this.searchData.page = this.pageIndex |
|
|
|
searchOutboundNotification(this.searchData).then(({data}) => { |
|
|
|
searchOutboundNotificationWithDetail(this.searchData).then(({data}) => { |
|
|
|
if (data.code === 0) { |
|
|
|
this.mainDataList = data.page.list |
|
|
|
this.pageIndex = data.page.currPage |
|
|
|
this.pageSize = data.page.pageSize |
|
|
|
this.totalPage = data.page.totalCount |
|
|
|
this.mainDataList = data.rows |
|
|
|
this.totalPage = this.mainDataList.length |
|
|
|
//判断是否全部存在数据 |
|
|
|
if (this.totalPage > 0) { |
|
|
|
//设置选中行 |
|
|
|
@ -709,9 +739,6 @@ export default { |
|
|
|
if(this.activeName==='boxing'){ |
|
|
|
this.refreshBoxingTable(); |
|
|
|
} |
|
|
|
if(this.activeName==='outboundDetail'){ |
|
|
|
this.refreshDetailTable(); |
|
|
|
} |
|
|
|
if(this.activeName==='rollDetail'){ |
|
|
|
this.refreshRollsTable(); |
|
|
|
} |
|
|
|
@ -723,12 +750,12 @@ export default { |
|
|
|
this.searchData.limit = -1 |
|
|
|
this.searchData.page = 1 |
|
|
|
excel.exportTable({ |
|
|
|
url: "/outbound/searchOutboundNotification", |
|
|
|
url: "/boxForNotification/searchOutboundNotificationWithDetail", |
|
|
|
columnMapping: this.columnArray1,//可以直接用table,不需要的列就剔除 |
|
|
|
mergeSetting: [],//需要合并的列 |
|
|
|
params: this.searchData, |
|
|
|
fileName: this.exportName+".xlsx", |
|
|
|
rowFetcher: res => res.data, |
|
|
|
rowFetcher: res => res.data.rows, |
|
|
|
columnFormatter: [], |
|
|
|
dropColumns: [],//需要剔除的列,例如dropColumns: ["netWeight"],即剔除净重列 |
|
|
|
}); |
|
|
|
@ -743,16 +770,6 @@ export default { |
|
|
|
} |
|
|
|
this.$refs.boxing.init(inData) |
|
|
|
}, |
|
|
|
refreshDetailTable(){ |
|
|
|
let templateData = { |
|
|
|
site: this.currentRow.site, |
|
|
|
buNo: this.currentRow.buNo, |
|
|
|
orderNo: this.currentRow.orderNo, |
|
|
|
} |
|
|
|
getOutboundDetailWithRoll(templateData).then(({data}) => { |
|
|
|
this.detailList = data.rows |
|
|
|
}) |
|
|
|
}, |
|
|
|
refreshRollsTable(){ |
|
|
|
let templateData = { |
|
|
|
site: this.currentRow.site, |
|
|
|
@ -822,14 +839,8 @@ export default { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 尝试从所有出库单明细中匹配物料编码 |
|
|
|
// 这里我们传入所有可能的物料编码,让后端根据卷号自动匹配 |
|
|
|
let partNo = '' |
|
|
|
if(this.detailList && this.detailList.length > 0){ |
|
|
|
// 先尝试第一个物料编码 |
|
|
|
partNo = this.detailList[0].partNo |
|
|
|
} |
|
|
|
|
|
|
|
// 从当前行获取物料编码 |
|
|
|
let partNo = this.currentRow.partNo || '' |
|
|
|
this.caseForm.partNo = partNo |
|
|
|
|
|
|
|
try { |
|
|
|
@ -886,26 +897,94 @@ export default { |
|
|
|
}, 0) |
|
|
|
}, |
|
|
|
|
|
|
|
applyCaseScan(){ |
|
|
|
// 从扫描列表中删除某一行 |
|
|
|
deleteRollFromList(index){ |
|
|
|
this.$confirm('确定删除这条扫描记录吗?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.caseRollList.splice(index, 1) |
|
|
|
this.updateCaseStatistics() |
|
|
|
this.$message.success('删除成功') |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
|
|
|
|
async applyCaseScan(){ |
|
|
|
if(this.caseRollList.length === 0){ |
|
|
|
this.$message.warning('请先扫描卷标签') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 校验数量 |
|
|
|
if(!await this.validateCaseQty()){ |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 应用:保存但不关闭对话框,重置输入框、计数和列表 |
|
|
|
this.saveCaseData(false) |
|
|
|
}, |
|
|
|
|
|
|
|
saveCaseScan(){ |
|
|
|
async saveCaseScan(){ |
|
|
|
if(this.caseRollList.length === 0){ |
|
|
|
this.$message.warning('请先扫描卷标签') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 校验数量 |
|
|
|
if(!await this.validateCaseQty()){ |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 保存:保存后关闭对话框 |
|
|
|
this.saveCaseData(true) |
|
|
|
}, |
|
|
|
|
|
|
|
// 校验盒清单数量不能超过要求发货数量 |
|
|
|
async validateCaseQty(){ |
|
|
|
// 获取当前主信息行的要求发货数量 |
|
|
|
const requiredQty = parseFloat(this.currentRow.requiredQty) || 0 |
|
|
|
if(requiredQty === 0){ |
|
|
|
this.$message.warning('要求发货数量为0,无需装箱') |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
// 计算新扫描的数据总量 |
|
|
|
const newScanQty = this.caseRollList.reduce((sum, item) => { |
|
|
|
return sum + (parseFloat(item.rollQty) || 0) |
|
|
|
}, 0) |
|
|
|
|
|
|
|
// 查询已保存的盒清单数据,计算已装箱的总数量 |
|
|
|
try { |
|
|
|
let templateData = { |
|
|
|
site: this.currentRow.site, |
|
|
|
buNo: this.currentRow.buNo, |
|
|
|
notifyNo: this.currentRow.orderNo, |
|
|
|
} |
|
|
|
const {data} = await searchSoReceiveCasesData(templateData) |
|
|
|
const existingQty = (data.rows || []).reduce((sum, item) => { |
|
|
|
// 只统计相同物料的数量 |
|
|
|
if(item.partNo === this.currentRow.partNo){ |
|
|
|
return sum + (parseFloat(item.rollQty) || 0) |
|
|
|
} |
|
|
|
return sum |
|
|
|
}, 0) |
|
|
|
|
|
|
|
// 总数量 = 已装箱数量 + 新扫描数量 |
|
|
|
const totalQty = existingQty + newScanQty |
|
|
|
|
|
|
|
if(totalQty > requiredQty){ |
|
|
|
this.$message.error(`装箱数量超出限制!要求发货数量:${requiredQty},已装箱:${existingQty},本次扫描:${newScanQty},总计:${totalQty}`) |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
return true |
|
|
|
} catch (error) { |
|
|
|
this.$message.error('校验数量失败,请重试') |
|
|
|
return false |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async saveCaseData(closeDialog){ |
|
|
|
try { |
|
|
|
const {data} = await saveCaseRollList(this.caseRollList) |
|
|
|
|