Browse Source

关务:模板维护按照客户+运输方式维护

java8
han\hanst 5 months ago
parent
commit
4b012b0344
  1. 4
      src/api/ecss/ecss.js
  2. 44
      src/utils/export-options.js
  3. 3
      src/views/modules/ecss/codelnotify.vue
  4. 260
      src/views/modules/ecss/codelnotifyConfirm.vue
  5. 3
      src/views/modules/ecss/createDeclaration.vue
  6. 241
      src/views/modules/ecss/pallet_upload_excel.vue

4
src/api/ecss/ecss.js

@ -46,6 +46,8 @@ export const deleteHsCode= data => createAPI(`/ecss/coDel/deleteHsCode`,'post',d
export const searchCoDelPalletData= data => createAPI(`/ecss/coDel/searchCoDelPalletData`,'post',data) export const searchCoDelPalletData= data => createAPI(`/ecss/coDel/searchCoDelPalletData`,'post',data)
export const searchCoDelPalletDataNew= data => createAPI(`/ecss/coDel/searchCoDelPalletDataNew`,'post',data)
export const saveCoDelPalletDataByExcel= data => createAPI(`/ecss/coDel/saveCoDelPalletDataByExcel`,'post',data) export const saveCoDelPalletDataByExcel= data => createAPI(`/ecss/coDel/saveCoDelPalletDataByExcel`,'post',data)
export const searchEcssCoDelPalletHeaderData= data => createAPI(`/ecss/coDel/searchEcssCoDelPalletHeaderData`,'post',data) export const searchEcssCoDelPalletHeaderData= data => createAPI(`/ecss/coDel/searchEcssCoDelPalletHeaderData`,'post',data)
export const searchEcssCoDelPalletDetailData= data => createAPI(`/ecss/coDel/searchEcssCoDelPalletDetailData`,'post',data) export const searchEcssCoDelPalletDetailData= data => createAPI(`/ecss/coDel/searchEcssCoDelPalletDetailData`,'post',data)
@ -86,6 +88,8 @@ export const getNotifyPartDetail = data => createAPI(`/ecss/coDel/getNotifyPartD
export const saveOneClickPacking = data => createAPI(`/ecss/coDel/saveOneClickPacking`,'post',data) export const saveOneClickPacking = data => createAPI(`/ecss/coDel/saveOneClickPacking`,'post',data)
export const savePalletMaintenance = data => createAPI(`/ecss/coDel/savePalletMaintenance`,'post',data)
export const getCustomerInfo = data => createAPI(`/ecss/coDel/getCustomerInfo`,'post',data) export const getCustomerInfo = data => createAPI(`/ecss/coDel/getCustomerInfo`,'post',data)
export const searchEcssTemplateData = data => createAPI(`/ecss/coDel/searchEcssTemplateData`,'post',data) export const searchEcssTemplateData = data => createAPI(`/ecss/coDel/searchEcssTemplateData`,'post',data)

44
src/utils/export-options.js

@ -9,8 +9,16 @@ const PalletSku = {
columnLabel: "发票号", columnLabel: "发票号",
}, },
{ {
columnProp: "seqNo",
columnLabel: "托盘号/箱号",
columnProp: "boxQty",
columnLabel: "箱数",
},
{
columnProp: "grossWeight",
columnLabel: "毛重",
},
{
columnProp: "netWeight",
columnLabel: "净重",
}, },
{ {
columnProp: "customerPO", columnProp: "customerPO",
@ -24,42 +32,10 @@ const PalletSku = {
columnProp: "qty", columnProp: "qty",
columnLabel: "数量", columnLabel: "数量",
}, },
{
columnProp: "boxQty",
columnLabel: "箱数",
},
{ {
columnProp: "rolls", columnProp: "rolls",
columnLabel: "Rolls", columnLabel: "Rolls",
}, },
{
columnProp: "pallet_qty",
columnLabel: "托数",
},
{
columnProp: "length",
columnLabel: "长(M)",
},
{
columnProp: "width",
columnLabel: "宽(M)",
},
{
columnProp: "height",
columnLabel: "高(M)",
},
{
columnProp: "volume",
columnLabel: "体积",
},
{
columnProp: "grossWeight",
columnLabel: "毛重",
},
{
columnProp: "netWeight",
columnLabel: "净重",
},
{ {
columnProp: "shippingMode", columnProp: "shippingMode",
columnLabel: "运输方式", columnLabel: "运输方式",

3
src/views/modules/ecss/codelnotify.vue

@ -696,6 +696,7 @@
updateEcssDelDetail, updateEcssDelDetail,
deleteEcssDelDetail, deleteEcssDelDetail,
searchCoDelPalletData, searchCoDelPalletData,
searchCoDelPalletDataNew,
queryPartListAll, queryPartListAll,
searchTemplateList, searchTemplateList,
getCustomers, getCustomers,
@ -2005,7 +2006,7 @@
}); });
} }
if(this.activeName==='pallet'){ if(this.activeName==='pallet'){
searchCoDelPalletData(this.currentRow).then(({data}) => {
searchCoDelPalletDataNew(this.currentRow).then(({data}) => {
// //
if (data && data.code == 0) { if (data && data.code == 0) {
this.dataList3 = data.rows this.dataList3 = data.rows

260
src/views/modules/ecss/codelnotifyConfirm.vue

@ -152,7 +152,8 @@
<el-tab-pane label="手工装箱" name="box"> <el-tab-pane label="手工装箱" name="box">
<el-button @click="oneClickPacking()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'一键装箱'}}</el-button> <el-button @click="oneClickPacking()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'一键装箱'}}</el-button>
<el-button @click="upLoadPallet()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'导入装箱单'}}</el-button> <el-button @click="upLoadPallet()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'导入装箱单'}}</el-button>
<el-button @click="newPalletModel()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'装箱'}}</el-button>
<el-button @click="palletMaintenance()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'栈板维护'}}</el-button>
<!-- <el-button @click="newPalletModel()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'装箱'}}</el-button>-->
<el-button @click="exportExcel()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'导出模版'}}</el-button> <el-button @click="exportExcel()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'导出模版'}}</el-button>
<el-table <el-table
:data="dataList4" :data="dataList4"
@ -168,7 +169,7 @@
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<a type="text" size="small" @click="boxDetailModel(scope.row)">箱明细</a>
<!-- <a type="text" size="small" @click="boxDetailModel(scope.row)">箱明细</a>-->
<a type="text" size="small" @click="updatePalletModel(scope.row)">修改</a> <a type="text" size="small" @click="updatePalletModel(scope.row)">修改</a>
<a type="text" size="small" @click="deletePallet(scope.row)">删除</a> <a type="text" size="small" @click="deletePallet(scope.row)">删除</a>
</template> </template>
@ -497,32 +498,12 @@
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<el-dialog title="一键装箱" :close-on-click-modal="false" v-drag :visible.sync="oneClickPackingModelFlag" width="400px">
<el-form label-position="top" style="margin-left: 7px;margin-top: -5px;">
<el-dialog title="一键装箱" :close-on-click-modal="false" v-drag :visible.sync="oneClickPackingModelFlag" width="170px">
<el-form label-position="top" style="margin-left: 7px;margin-top: 10px;">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="''" > <el-form-item :label="''" >
<template #label>
<span slot="label" style="" class="big-label">
<a href="#" @click="palletFlag=true">栈板</a>
</span>
</template>
<el-input v-model="oneClickPackingModelData.pallet" disabled ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'栈板编号'" >
<el-input v-model="oneClickPackingModelData.palletRemark" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'栈板高度(M)'" >
<el-input v-model="oneClickPackingModelData.height" type="number" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="'数量'" >
<el-input v-model="oneClickPackingModelData.palletQty" type="number" ></el-input>
<el-checkbox style="font-weight: bold" v-model="oneClickPackingModelData.boxRemnant">是否显示零数箱</el-checkbox>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -532,6 +513,50 @@
<el-button type="primary" @click="oneClickPackingModelFlag=false">关闭</el-button> <el-button type="primary" @click="oneClickPackingModelFlag=false">关闭</el-button>
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<el-dialog title="栈板维护" :close-on-click-modal="false" v-drag :visible.sync="palletMaintenanceModelFlag" width="450px">
<!-- 栈板记录列表 -->
<div style="margin: 15px 0;">
<div style="margin-bottom: 10px;">
<span style="font-weight: bold; margin-right: 10px;">栈板记录:</span>
<el-button type="primary" size="small" @click="addPalletMaintenanceRecord">添加行</el-button>
</div>
<el-table :data="palletMaintenanceRecords" border style="width: 100%; margin-bottom: 15px;" class="zxClass"
max-height="200" v-if="palletMaintenanceRecords.length > 0">
<el-table-column label="栈板" min-width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.pallet" disabled style="width: 100%;">
<template slot="append">
<el-button @click="selectPalletMaintenance(scope.$index)" size="mini" type="primary">选择</el-button>
</template>
</el-input>
</template>
</el-table-column>
<el-table-column label="栈板高度(M)" width="90">
<template slot-scope="scope">
<el-input v-model="scope.row.height" type="text" placeholder="请输入高度" style="width: 100%;"></el-input>
</template>
</el-table-column>
<el-table-column label="托数" width="80">
<template slot-scope="scope">
<el-input v-model="scope.row.palletQty" type="text" placeholder="请输入托数" style="width: 100%;"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="40">
<template slot-scope="scope">
<a type="text" size="mini" @click="removePalletMaintenanceRecord(scope.$index)">删除</a>
</template>
</el-table-column>
</el-table>
<div v-if="palletMaintenanceRecords.length === 0" style="text-align: center; color: #999; padding: 20px; border: 1px dashed #ddd;">
暂无栈板记录请点击"添加行"按钮添加
</div>
</div>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="savePalletMaintenance()">确定</el-button>
<el-button type="primary" @click="palletMaintenanceModelFlag=false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="物料信息" @close="closePartDialog" @open="openPartDialog" :visible.sync="partFlag" width="559px" v-drag> <el-dialog title="物料信息" @close="closePartDialog" @open="openPartDialog" :visible.sync="partFlag" width="559px" v-drag>
<el-form inline="inline" label-position="top" :model="partData" style="margin-left: 7px;margin-top: -5px;"> <el-form inline="inline" label-position="top" :model="partData" style="margin-left: 7px;margin-top: -5px;">
@ -639,6 +664,7 @@
updateEcssDel, updateEcssDel,
cancerConfirmEcssDel, cancerConfirmEcssDel,
searchCoDelPalletData, searchCoDelPalletData,
searchCoDelPalletDataNew,
searchEcssCoDelPalletHeaderData, searchEcssCoDelPalletHeaderData,
searchEcssCoDelPalletDetailData, searchEcssCoDelPalletDetailData,
savePalletHeader, savePalletHeader,
@ -646,6 +672,7 @@
savePalletDetail, savePalletDetail,
deletePalletDetail, deletePalletDetail,
saveOneClickPacking, saveOneClickPacking,
savePalletMaintenance,
getNotifyPartDetail, getNotifyPartDetail,
searchPalletList, searchPalletList,
updateExportFlag updateExportFlag
@ -704,11 +731,15 @@
}, },
oneClickPackingModelFlag:false, oneClickPackingModelFlag:false,
oneClickPackingModelData:{ oneClickPackingModelData:{
pallet:'',
palletRemark:'',
height:'',
palletQty:'',
},
boxRemnant: false,
},
//
oneClickPalletRecords: [],
currentOneClickPalletIndex: -1, //
//
palletMaintenanceModelFlag: false,
palletMaintenanceRecords: [],
currentPalletMaintenanceIndex: -1, //
palletModelFlag:false, palletModelFlag:false,
palletModelData:{ palletModelData:{
addFlag:0, addFlag:0,
@ -2097,7 +2128,7 @@
}); });
} }
if(this.activeName==='pallet'){ if(this.activeName==='pallet'){
searchCoDelPalletData(this.currentRow).then(({data}) => {
searchCoDelPalletDataNew(this.currentRow).then(({data}) => {
// //
if (data && data.code == 0) { if (data && data.code == 0) {
this.dataList3 = data.rows this.dataList3 = data.rows
@ -2232,8 +2263,8 @@
}) })
return false return false
} }
/* if(this.currentRow.notifyStatus!==''){
this.$alert('仓库未确认无法导入装箱清单!', '错误', {
/*if(this.currentRow.walMartOrderFlag==='Y'){
this.$alert('沃尔玛订单暂时无法导入装箱清单!', '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
return false return false
@ -2317,7 +2348,6 @@
}, },
updatePalletModel(row){ updatePalletModel(row){
this.palletModelData=JSON.parse(JSON.stringify(row)) this.palletModelData=JSON.parse(JSON.stringify(row))
this.palletModelData.pallet=row.palletNo
this.palletModelData.palletRemark=row.palletRemark this.palletModelData.palletRemark=row.palletRemark
this.palletModelData.addFlag=1 this.palletModelData.addFlag=1
this.palletModelFlag=true this.palletModelFlag=true
@ -2519,7 +2549,7 @@
this.dataList5 = data.rows this.dataList5 = data.rows
} }
}) })
searchCoDelPalletData(this.currentRow).then(({data}) => {
searchCoDelPalletDataNew(this.currentRow).then(({data}) => {
if (data && data.code == 0) { if (data && data.code == 0) {
this.dataList3 = data.rows this.dataList3 = data.rows
} else { } else {
@ -2578,37 +2608,27 @@
return false return false
} */ } */
this.oneClickPackingModelData={ this.oneClickPackingModelData={
addFlag:0,
site:this.currentRow.site,
buNo:this.currentRow.buNo,
delNo:this.currentRow.delNo,
seqNo:'',
palletNo:'',
palletQty:'',
length:'',
width:'',
height:'',
volume:'',
grossWeight:'',
netWeight:'',
palletRemark:'',
boxRemnant: false,
} }
//
this.oneClickPalletRecords = []
this.oneClickPalletRecords.push({
pallet: '',
palletQty: '',
height: ''
})
this.oneClickPackingModelFlag=true this.oneClickPackingModelFlag=true
}, },
saveOneClickPacking(){ saveOneClickPacking(){
if(this.oneClickPackingModelData.palletQty===''||this.oneClickPackingModelData.palletQty==null){
this.$alert('请输入数量!', '错误', {
confirmButtonText: '确定'
})
return false
}
if(this.oneClickPackingModelData.height===''||this.oneClickPackingModelData.height==null){
this.$alert('请输入栈板高度(M)!', '错误', {
confirmButtonText: '确定'
})
return false
let saveData = {
site: this.currentRow.site,
buNo: this.currentRow.buNo,
delNo: this.currentRow.delNo,
boxRemnant: this.oneClickPackingModelData.boxRemnant,
palletRecords: JSON.stringify(this.oneClickPalletRecords)
} }
saveOneClickPacking(this.oneClickPackingModelData).then(({data}) => {
saveOneClickPacking(saveData).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.refreshCurrentTabTable() this.refreshCurrentTabTable()
this.oneClickPackingModelFlag=false; this.oneClickPackingModelFlag=false;
@ -2626,6 +2646,24 @@
}) })
}, },
//
addOneClickPalletRecord() {
this.oneClickPalletRecords.push({
pallet: '',
palletQty: '',
height: ''
})
},
removeOneClickPalletRecord(index) {
this.oneClickPalletRecords.splice(index, 1)
},
selectOneClickPallet(index) {
this.currentOneClickPalletIndex = index
this.palletFlag = true
},
openPalletDialog () { openPalletDialog () {
// //
this.searchPalletList(); this.searchPalletList();
@ -2635,7 +2673,7 @@
this.palletFlag = false this.palletFlag = false
}, },
searchPalletList () { searchPalletList () {
this.palletData.buNo = this.oneOrAll===2?this.oneClickPackingModelData.buNo:this.palletModelData.buNo
this.palletData.buNo = (this.oneOrAll===2 || this.oneOrAll===3)?this.currentRow.buNo:this.palletModelData.buNo
searchPalletList(this.palletData).then(({data}) => { searchPalletList(this.palletData).then(({data}) => {
if (data && data.code === 0){ if (data && data.code === 0){
this.palletList = data.rows; this.palletList = data.rows;
@ -2644,12 +2682,108 @@
}, },
palletRowDblclick (row) { palletRowDblclick (row) {
if (this.oneOrAll===2) { if (this.oneOrAll===2) {
this.oneClickPackingModelData.pallet = row.palletNo
//
if (this.currentOneClickPalletIndex >= 0) {
this.oneClickPalletRecords[this.currentOneClickPalletIndex].pallet = row.palletNo
}
} else if (this.oneOrAll===3) {
//
if (this.currentPalletMaintenanceIndex >= 0) {
this.palletMaintenanceRecords[this.currentPalletMaintenanceIndex].pallet = row.palletNo
}
} else { } else {
this.palletModelData.pallet = row.palletNo this.palletModelData.pallet = row.palletNo
} }
this.palletFlag = false this.palletFlag = false
}, },
//
palletMaintenance() {
this.oneOrAll = 3;
if(this.currentRow.site===''||this.currentRow.site==null){
this.$alert('请先选择发货通知单!', '错误', {
confirmButtonText: '确定'
})
return false
}
//
this.palletMaintenanceRecords = []
this.palletMaintenanceRecords.push({
pallet: '',
palletQty: '',
height: ''
})
this.palletMaintenanceModelFlag = true
},
addPalletMaintenanceRecord() {
this.palletMaintenanceRecords.push({
pallet: '',
palletQty: '',
height: ''
})
},
removePalletMaintenanceRecord(index) {
this.palletMaintenanceRecords.splice(index, 1)
},
selectPalletMaintenance(index) {
this.currentPalletMaintenanceIndex = index
this.palletFlag = true
},
savePalletMaintenance() {
//
for (let i = 0; i < this.palletMaintenanceRecords.length; i++) {
const record = this.palletMaintenanceRecords[i]
if (!record.pallet) {
this.$alert(`${i + 1}行栈板不能为空!`, '错误', {
confirmButtonText: '确定'
})
return false
}
if (!record.palletQty || record.palletQty <= 0) {
this.$alert(`${i + 1}行托数必须大于0!`, '错误', {
confirmButtonText: '确定'
})
return false
}
if (!record.height || record.height <= 0) {
this.$alert(`${i + 1}行栈板高度必须大于0!`, '错误', {
confirmButtonText: '确定'
})
return false
}
}
//
let saveData = {
site: this.currentRow.site,
buNo: this.currentRow.buNo,
delNo: this.currentRow.delNo,
palletRecords: JSON.stringify(this.palletMaintenanceRecords),
}
// 使APImaintenanceOnly
savePalletMaintenance(saveData).then(({data}) => {
if (data && data.code === 0) {
this.refreshCurrentTabTable()
this.palletMaintenanceModelFlag = false;
this.$message({
message: '栈板记录新增成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
}, },
activated() { activated() {
this.searchTable() this.searchTable()

3
src/views/modules/ecss/createDeclaration.vue

@ -501,6 +501,7 @@
searchEcssCoDelNotifyHeaderForDanZheng, searchEcssCoDelNotifyHeaderForDanZheng,
searchEcssCoDelNotifyDetail, searchEcssCoDelNotifyDetail,
searchCoDelPalletData, searchCoDelPalletData,
searchCoDelPalletDataNew,
getDeclarationDefaultData, getDeclarationDefaultData,
saveDeclaration, saveDeclaration,
}from "@/api/ecss/ecss.js" }from "@/api/ecss/ecss.js"
@ -1603,7 +1604,7 @@
}); });
} }
if(this.activeName==='pallet'){ if(this.activeName==='pallet'){
searchCoDelPalletData(this.currentRow).then(({data}) => {
searchCoDelPalletDataNew(this.currentRow).then(({data}) => {
// //
if (data && data.code == 0) { if (data && data.code == 0) {
this.dataList3 = data.rows this.dataList3 = data.rows

241
src/views/modules/ecss/pallet_upload_excel.vue

@ -1,10 +1,10 @@
<template> <template>
<div class="customer-css"> <div class="customer-css">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="400px" style="height: 520px;" class="customer-dialog" @close="deleteFile">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="450px" class="customer-dialog" @close="deleteFile">
<el-form :inline="true" label-position="top" label-width="80px"> <el-form :inline="true" label-position="top" label-width="80px">
<el-row> <el-row>
<el-form-item label="BU"> <el-form-item label="BU">
<el-select v-model="pageData.buNo" placeholder="请选择" disabled style="width: 120px">
<el-select v-model="pageData.buNo" placeholder="请选择" disabled style="width: 130px">
<el-option <el-option
v-for = "i in buList" v-for = "i in buList"
:key = "i.buNo" :key = "i.buNo"
@ -14,47 +14,132 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="'CMC Invoice:'"> <el-form-item :label="'CMC Invoice:'">
<el-input v-model="pageData.cmcInvoice" disabled style="width: 120px"></el-input>
<el-input v-model="pageData.cmcInvoice" disabled style="width: 140px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label=" "> <el-form-item label=" ">
<!-- <download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button&#45;&#45;primary el-button&#45;&#45;medium">
{{ '导出模版' }}
</download-excel>-->
<el-button type="primary" @click="exportExcel()">下载文件模板</el-button> <el-button type="primary" @click="exportExcel()">下载文件模板</el-button>
</el-form-item> </el-form-item>
</el-row> </el-row>
<el-row>
<el-col :span="24">
</el-form>
<!-- 栈板托数记录 -->
<div style="margin: 15px 0;">
<div style="margin-bottom: 10px;">
<span style="font-weight: bold; margin-right: 10px;">栈板记录:</span>
<el-button type="primary" size="small" @click="addPalletRecord">添加行</el-button>
</div>
<el-table :data="palletRecords" border style="width: 100%; margin-bottom: 15px;" class="zxClass"
max-height="200" v-if="palletRecords.length > 0">
<el-table-column label="栈板" min-width="100">
<template slot-scope="scope">
<el-input v-model="scope.row.pallet" disabled style="width: 100%;">
<template slot="append">
<el-button @click="selectPallet(scope.$index)" size="mini" type="primary">选择</el-button>
</template>
</el-input>
</template>
</el-table-column>
<el-table-column label="栈板高度(M)" width="90">
<template slot-scope="scope">
<el-input v-model="scope.row.height" type="text" placeholder="请输入高度" style="width: 100%;"></el-input>
</template>
</el-table-column>
<el-table-column label="托数" width="80">
<template slot-scope="scope">
<el-input v-model="scope.row.palletQty" type="text" placeholder="请输入托数" style="width: 100%;"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="40">
<template slot-scope="scope">
<a type="text" size="mini" @click="removePalletRecord(scope.$index)">删除</a>
</template>
</el-table-column>
</el-table>
<div v-if="palletRecords.length === 0" style="text-align: center; color: #999; padding: 20px; border: 1px dashed #ddd;">
暂无栈板记录请点击"添加行"按钮添加
</div>
</div>
<!-- 文件上传区域 -->
<div style="margin: 15px 0;">
<div style="font-weight: bold; margin-bottom: 10px;">文件上传:</div>
<el-upload class="customer-upload" drag action="javascript:void(0);" ref="uploadFile" :limit="1" accept=".xlsx,.xls" <el-upload class="customer-upload" drag action="javascript:void(0);" ref="uploadFile" :limit="1" accept=".xlsx,.xls"
:before-upload="beforeUploadHandle" :on-change="onChange" :auto-upload="false" style="text-align: left;"> :before-upload="beforeUploadHandle" :on-change="onChange" :auto-upload="false" style="text-align: left;">
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
</el-upload> </el-upload>
</el-col>
</el-row>
</el-form>
</div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveUploadFile">保存</el-button> <el-button type="primary" @click="saveUploadFile">保存</el-button>
<el-button type="primary" @click="closeDialog">关闭</el-button> <el-button type="primary" @click="closeDialog">关闭</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 栈板选择弹窗 -->
<el-dialog title="栈板" @close="closePalletDialog" @open="openPalletDialog" :visible.sync="palletFlag" width="559px" v-drag>
<el-form inline="inline" label-position="top" :model="palletData" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="栈板类型">
<el-input v-model="palletData.palletType" clearable style="width: 110px"></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" style="padding: 3px 12px" @click="searchPalletList()">查询</el-button>
</el-form-item>
</el-form>
<el-table
:height="300"
:data="palletList"
stripe
highlight-current-row
border
@row-dblclick="palletRowDblclick"
style="width: 100%;">
<el-table-column
prop="palletNo"
header-align="center"
align="center"
width="120"
label="栈板编码">
</el-table-column>
<el-table-column
prop="palletType"
header-align="center"
align="center"
label="栈板类型">
</el-table-column>
<el-table-column
prop="applicationArea"
header-align="center"
align="center"
label="应用环境">
</el-table-column>
<el-table-column
prop="length"
header-align="center"
align="center"
label="长(M)">
</el-table-column>
<el-table-column
prop="width"
header-align="center"
align="center"
label="宽(M)">
</el-table-column>
<el-table-column
prop="height"
header-align="center"
align="center"
label="栈板高(M)">
</el-table-column>
</el-table>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button @click="palletFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {queryFileId} from "@/api/qc/qc.js" import {queryFileId} from "@/api/qc/qc.js"
import {saveCoDelPalletDataByExcel,searchEcssCoDelNotifyDetail} from '@/api/ecss/ecss.js'
import {saveCoDelPalletDataByExcel,searchEcssCoDelNotifyDetail,updateExportFlag,searchPalletList} from '@/api/ecss/ecss.js'
import {downLoadObjectFile} from '@/api/eam/eam_object_list.js' import {downLoadObjectFile} from '@/api/eam/eam_object_list.js'
import {getBuList}from '@/api/factory/site.js' import {getBuList}from '@/api/factory/site.js'
import excel from "@/utils/excel-util.js"; import excel from "@/utils/excel-util.js";
@ -74,6 +159,13 @@
cmcInvoice:'', cmcInvoice:'',
createBy: this.$store.state.user.name, createBy: this.$store.state.user.name,
}, },
//
palletRecords: [],
//
palletFlag: false,
palletList: [],
palletData: {},
currentPalletIndex: -1, //
// start // start
exportData: [], exportData: [],
exportName: '装箱数据导入模版', exportName: '装箱数据导入模版',
@ -165,10 +257,28 @@
columnFormatter: [], columnFormatter: [],
dropColumns: [],//dropColumns: ["netWeight"] dropColumns: [],//dropColumns: ["netWeight"]
}); });
// export_flag
let updateData = {
site: this.pageData.site,
buNo: this.pageData.buNo,
delNo: this.pageData.delNo,
exportFlag: 'Y',
updateBy: this.$store.state.user.name
}
updateExportFlag(updateData).then(({data}) => {
if (data.code === 0) {
console.info('更新采购:');
}
}).catch(error => {
this.$message.warning('导出成功,但更新导出状态失败');
console.error('更新导出状态失败:', error);
});
}, },
// //
init (inData) { init (inData) {
this.fileList = [] this.fileList = []
this.palletRecords = [] //
let tempData = { let tempData = {
username: this.$store.state.user.name, username: this.$store.state.user.name,
} }
@ -188,6 +298,14 @@
walMartOrderFlag: inData.walMartOrderFlag, walMartOrderFlag: inData.walMartOrderFlag,
createBy: this.$store.state.user.name, createBy: this.$store.state.user.name,
} }
//
this.palletRecords.push({
pallet: '',
palletQty: '',
height: ''
})
// //
this.visible = true this.visible = true
}, },
@ -214,6 +332,7 @@
}, },
deleteFile(){ deleteFile(){
this.fileList = [] this.fileList = []
this.palletRecords = [] //
// //
this.$refs.uploadFile.clearFiles() this.$refs.uploadFile.clearFiles()
// //
@ -228,6 +347,24 @@
this.$message.error("请先上传文件!") this.$message.error("请先上传文件!")
return false return false
} }
//
for (let i = 0; i < this.palletRecords.length; i++) {
const record = this.palletRecords[i]
if (!record.pallet) {
this.$message.error(`${i + 1}行栈板不能为空!`)
return false
}
if (!record.palletQty || record.palletQty <= 0) {
this.$message.error(`${i + 1}行托数必须大于0!`)
return false
}
if (!record.height || record.height <= 0) {
this.$message.error(`${i + 1}行栈板高度必须大于0!`)
return false
}
}
const formData = new FormData() const formData = new FormData()
formData.append("buNo",this.pageData.buNo) formData.append("buNo",this.pageData.buNo)
formData.append("site",this.pageData.site) formData.append("site",this.pageData.site)
@ -236,6 +373,8 @@
formData.append("walMartOrderFlag",this.pageData.walMartOrderFlag) formData.append("walMartOrderFlag",this.pageData.walMartOrderFlag)
formData.append("username",this.$store.state.user.name) formData.append("username",this.$store.state.user.name)
formData.append("file", this.fileList[0].raw) formData.append("file", this.fileList[0].raw)
//
formData.append("palletRecords", JSON.stringify(this.palletRecords))
// formData.append("createBy", this.pageData.createBy) // formData.append("createBy", this.pageData.createBy)
saveCoDelPalletDataByExcel(formData).then(({data}) => { saveCoDelPalletDataByExcel(formData).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
@ -328,6 +467,62 @@
return s return s
}, },
//
addPalletRecord() {
this.palletRecords.push({
pallet: '',
palletQty: '',
height: ''
})
console.log('添加栈板记录:', this.palletRecords)
},
removePalletRecord(index) {
this.palletRecords.splice(index, 1)
},
selectPallet(index) {
console.log('选择栈板,索引:', index)
this.currentPalletIndex = index
this.palletFlag = true
},
openPalletDialog() {
this.palletData = {}
this.searchPalletList()
},
closePalletDialog() {
this.palletData = {}
this.palletList = []
},
searchPalletList() {
let searchData = {
palletType: this.palletData.palletType || '',
buNo: this.pageData.buNo
}
searchPalletList(searchData).then(({data}) => {
if (data.code === 0) {
this.palletList = data.rows || []
}
})
},
palletRowDblclick(row) {
if (this.currentPalletIndex >= 0) {
this.palletRecords[this.currentPalletIndex].pallet = row.palletNo
}
this.palletFlag = false
},
} }
} }
</script> </script>
<style scoped>
/deep/ .zxClass .cell {
line-height: 24px;
font-size: 12px;
height: 24px;
}
</style>
Loading…
Cancel
Save