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 deleteSoReceiveCasesData = data => createAPI('/boxForNotification/deleteSoReceiveCasesData','post',data)
export const validateAndScanCaseRoll = data => createAPI('/boxForNotification/validateAndScanCaseRoll','post',data) export const validateAndScanCaseRoll = data => createAPI('/boxForNotification/validateAndScanCaseRoll','post',data)
export const saveCaseRollList = data => createAPI('/boxForNotification/saveCaseRollList','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-pagination>
<el-tabs v-model="activeName" style="margin-top: 0px; width: 99%;" @tab-click="tabClick" class="customer-tab" type="border-card"> <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-tab-pane label="盒清单" name="cases">
<el-form label-position="top" style="margin-left: 2px;"> <el-form label-position="top" style="margin-left: 2px;">
<el-button type="primary" size="small" @click="openCaseDialog">新增</el-button> <el-button type="primary" size="small" @click="openCaseDialog">新增</el-button>
@ -263,15 +239,18 @@
<el-form-item label="卷标签"> <el-form-item label="卷标签">
<el-input ref="rollNoInput" v-model="caseForm.rollNo" @keyup.enter.native="scanCaseRoll" placeholder="请扫描卷标签" style="width: 200px"></el-input> <el-input ref="rollNoInput" v-model="caseForm.rollNo" @keyup.enter.native="scanCaseRoll" placeholder="请扫描卷标签" style="width: 200px"></el-input>
</el-form-item> </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-form>
<!-- 中部分扫描列表 --> <!-- 中部分扫描列表 -->
<el-table <el-table
@ -328,6 +307,15 @@
header-align="center" header-align="center"
align="left"> align="left">
</el-table-column> </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-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="applyCaseScan">应用</el-button> <el-button type="primary" @click="applyCaseScan">应用</el-button>
@ -345,16 +333,13 @@
import excel from "@/utils/excel-util.js"; import excel from "@/utils/excel-util.js";
import boxing from "./com_saleBoxManage_boxing.vue" import boxing from "./com_saleBoxManage_boxing.vue"
import {
getOutboundDetailWithRoll,
searchOutboundNotification
} from '../../../api/qc/outbound_notification'
import { import {
searchRollForOrderNo, searchRollForOrderNo,
searchSoReceiveCasesData, searchSoReceiveCasesData,
deleteSoReceiveCasesData, deleteSoReceiveCasesData,
validateAndScanCaseRoll, validateAndScanCaseRoll,
saveCaseRollList
saveCaseRollList,
searchOutboundNotificationWithDetail
} from '../../../api/boxManage/boxManage' } from '../../../api/boxManage/boxManage'
@ -383,9 +368,8 @@ export default {
tagNo:'', tagNo:'',
rollList:[], rollList:[],
mainDataList:[], mainDataList:[],
detailList:[],
dataListLoading: false, dataListLoading: false,
activeName: 'outboundDetail',
activeName: 'cases',
// //
casesList: [], casesList: [],
caseDialogVisible: false, caseDialogVisible: false,
@ -513,137 +497,185 @@ export default {
status: true, status: true,
fixed: false fixed: false
}, },
],
columnDetailList: [
{ {
columnProp: 'relatedOrderNo',
userId: this.$store.state.user.name,
functionId: this.functionId,
serialNumber: '750001Table1RelatedOrderNo',
tableId: "750001Table1",
tableName: "销售发货清单",
columnProp: "relatedOrderNo",
headerAlign: "center", headerAlign: "center",
align: "left", align: "left",
columnLabel: '销售订单号',
columnLabel: "销售订单号",
columnWidth: '100',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
sortLv: 0, sortLv: 0,
status: true, 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", headerAlign: "center",
align: "right", align: "right",
columnLabel: '销售订单行号',
columnLabel: "销售订单行号",
columnWidth: '100',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
sortLv: 0, sortLv: 0,
status: true, 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", headerAlign: "center",
align: "left", align: "left",
columnLabel: '物料编码',
columnLabel: "物料编码",
columnWidth: '120',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
sortLv: 0, sortLv: 0,
status: true, 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", headerAlign: "center",
align: "left", align: "left",
columnLabel: '物料名称',
columnLabel: "物料名称",
columnWidth: '200',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
sortLv: 0, sortLv: 0,
status: true, 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", headerAlign: "center",
align: "left", align: "left",
columnLabel: '合约号',
columnLabel: "合约号",
columnWidth: '100',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
sortLv: 0, sortLv: 0,
status: true, 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", headerAlign: "center",
align: "right", align: "right",
columnLabel: '销售订单数量',
columnLabel: "销售订单数量",
columnWidth: '100',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
sortLv: 0, sortLv: 0,
status: true, 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", headerAlign: "center",
align: "right", align: "right",
columnLabel: '要求发货数量',
columnLabel: "要求发货数量",
columnWidth: '100',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
sortLv: 0, sortLv: 0,
status: true, 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", headerAlign: "center",
align: "right", align: "right",
columnLabel: '已扫描数量',
columnLabel: "已扫描数量",
columnWidth: '100',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
sortLv: 0, sortLv: 0,
status: true, 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", headerAlign: "center",
align: "right", align: "right",
columnLabel: '未扫描数量',
columnLabel: "未扫描数量",
columnWidth: '100',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
sortLv: 0, sortLv: 0,
status: true, 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", headerAlign: "center",
align: "left", align: "left",
columnLabel: '单位',
columnLabel: "单位",
columnWidth: '80',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
sortLv: 0, sortLv: 0,
status: true, status: true,
fixed: '',
columnWidth: 100,
fixed: false
}, },
], ],
exportName: '销售出库单'+this.dayjs().format('YYYYMMDDHHmmss'), exportName: '销售出库单'+this.dayjs().format('YYYYMMDDHHmmss'),
@ -664,12 +696,10 @@ export default {
getMainData(){ getMainData(){
this.searchData.limit = this.pageSize this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex this.searchData.page = this.pageIndex
searchOutboundNotification(this.searchData).then(({data}) => {
searchOutboundNotificationWithDetail(this.searchData).then(({data}) => {
if (data.code === 0) { 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) { if (this.totalPage > 0) {
// //
@ -709,9 +739,6 @@ export default {
if(this.activeName==='boxing'){ if(this.activeName==='boxing'){
this.refreshBoxingTable(); this.refreshBoxingTable();
} }
if(this.activeName==='outboundDetail'){
this.refreshDetailTable();
}
if(this.activeName==='rollDetail'){ if(this.activeName==='rollDetail'){
this.refreshRollsTable(); this.refreshRollsTable();
} }
@ -723,12 +750,12 @@ export default {
this.searchData.limit = -1 this.searchData.limit = -1
this.searchData.page = 1 this.searchData.page = 1
excel.exportTable({ excel.exportTable({
url: "/outbound/searchOutboundNotification",
url: "/boxForNotification/searchOutboundNotificationWithDetail",
columnMapping: this.columnArray1,//table columnMapping: this.columnArray1,//table
mergeSetting: [],// mergeSetting: [],//
params: this.searchData, params: this.searchData,
fileName: this.exportName+".xlsx", fileName: this.exportName+".xlsx",
rowFetcher: res => res.data,
rowFetcher: res => res.data.rows,
columnFormatter: [], columnFormatter: [],
dropColumns: [],//dropColumns: ["netWeight"] dropColumns: [],//dropColumns: ["netWeight"]
}); });
@ -743,16 +770,6 @@ export default {
} }
this.$refs.boxing.init(inData) 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(){ refreshRollsTable(){
let templateData = { let templateData = {
site: this.currentRow.site, site: this.currentRow.site,
@ -822,14 +839,8 @@ export default {
return return
} }
//
//
let partNo = ''
if(this.detailList && this.detailList.length > 0){
//
partNo = this.detailList[0].partNo
}
//
let partNo = this.currentRow.partNo || ''
this.caseForm.partNo = partNo this.caseForm.partNo = partNo
try { try {
@ -886,26 +897,94 @@ export default {
}, 0) }, 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){ if(this.caseRollList.length === 0){
this.$message.warning('请先扫描卷标签') this.$message.warning('请先扫描卷标签')
return return
} }
//
if(!await this.validateCaseQty()){
return
}
// //
this.saveCaseData(false) this.saveCaseData(false)
}, },
saveCaseScan(){
async saveCaseScan(){
if(this.caseRollList.length === 0){ if(this.caseRollList.length === 0){
this.$message.warning('请先扫描卷标签') this.$message.warning('请先扫描卷标签')
return return
} }
//
if(!await this.validateCaseQty()){
return
}
// //
this.saveCaseData(true) 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){ async saveCaseData(closeDialog){
try { try {
const {data} = await saveCaseRollList(this.caseRollList) const {data} = await saveCaseRollList(this.caseRollList)

Loading…
Cancel
Save