Browse Source

2025-10-14

销售发货装箱新增盒清单功能
master
fengyuan_yang 3 months ago
parent
commit
04c8b24902
  1. 3
      src/api/boxManage/boxManage.js
  2. 303
      src/views/modules/boxManage/saleBoxManage.vue

3
src/api/boxManage/boxManage.js

@ -16,3 +16,6 @@ export const searchSoReceiveCasesData = data => createAPI('/boxForNotification/s
export const deleteSoReceiveCasesData = data => createAPI('/boxForNotification/deleteSoReceiveCasesData','post',data)
export const validateAndScanCaseRoll = data => createAPI('/boxForNotification/validateAndScanCaseRoll','post',data)
export const saveCaseRollList = data => createAPI('/boxForNotification/saveCaseRollList','post',data)
// 查询出库通知单主记录(关联明细)
export const searchOutboundNotificationWithDetail = data => createAPI('/boxForNotification/searchOutboundNotificationWithDetail','post',data)

303
src/views/modules/boxManage/saleBoxManage.vue

@ -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)

Loading…
Cancel
Save