4 changed files with 549 additions and 10 deletions
-
9src/api/boxManage/boxManage.js
-
1src/views/modules/boxManage/com_saleBoxManage_boxing.vue
-
491src/views/modules/boxManage/com_saleBoxManage_pallet.vue
-
40src/views/modules/boxManage/saleBoxManage.vue
@ -0,0 +1,491 @@ |
|||
<template> |
|||
<div class="customer-css"> |
|||
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;"> |
|||
<el-form-item > |
|||
<el-button type="primary" @click="searchTable()">查询</el-button> |
|||
<el-button v-if="searchData.orderStatus === '待包装'" type="primary" @click="newPallet()">新增托</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table |
|||
:data="dataList" |
|||
:height=searchData.height |
|||
border |
|||
v-loading="dataListLoading" |
|||
style="width: 100%; "> |
|||
<el-table-column |
|||
header-align="center" |
|||
align="center" |
|||
width="150" |
|||
label="操作"> |
|||
<template slot-scope="scope"> |
|||
<a type="text" size="small" v-if="scope.row.status==='已封托'" @click="palletModelOpen(scope.row)">查看</a> |
|||
<template v-if="searchData.orderStatus === '待包装'"> |
|||
<a type="text" size="small" v-if="scope.row.status!=='已封托'" @click="palletModelOpen(scope.row)">装托</a> |
|||
<a type="text" size="small" v-if="scope.row.status==='未封托'" @click="fengTuo(scope.row)">封托</a> |
|||
<a type="text" size="small" v-if="scope.row.status==='已封托'" @click="chaiTuo(scope.row)">拆托</a> |
|||
<a type="text" size="small" v-if="scope.row.status!=='已封托'" @click="deletePallet(scope.row)">删除</a> |
|||
</template> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
v-for="(item,index) in columnList" :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-dialog title="箱清单" :visible.sync="palletModelFlag" width="700px" @close="searchTable" style="margin-top: 7px" v-drag :close-on-click-modal="false"> |
|||
<el-form class="sl" inline="inline" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
|||
<el-row> |
|||
<el-form-item label="销售发货单号"> |
|||
<el-input v-model="palletData.orderNo" disabled style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="托盘号"> |
|||
<el-input v-model="palletData.palletNo" disabled style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
</el-row> |
|||
<el-row v-if="!scanDisabled"> |
|||
<el-form-item label="扫描装托"> |
|||
<el-input v-model="scanBoxNo" ref="scanBoxNo" :disabled="scanDisabled" @keyup.enter.native="handlePalletAction" style="width: 200px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="操作类型" > |
|||
<el-radio-group v-model="palletActionType" > |
|||
<el-radio label="add" border>添加</el-radio> |
|||
<el-radio label="delete" border>删除</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
</el-row> |
|||
</el-form> |
|||
<el-table |
|||
:height="300" |
|||
:data="modelList" |
|||
stripe |
|||
border |
|||
style="width: 100%;"> |
|||
<el-table-column |
|||
prop="orderId" |
|||
header-align="center" |
|||
align="center" |
|||
min-width="60" |
|||
label="序号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="boxNo" |
|||
header-align="center" |
|||
align="center" |
|||
min-width="100" |
|||
label="箱号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="boxesQty" |
|||
header-align="center" |
|||
align="right" |
|||
min-width="100" |
|||
label="数量"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="receivedDate" |
|||
header-align="center" |
|||
align="center" |
|||
min-width="100" |
|||
label="装托日期"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="receivedBy" |
|||
header-align="center" |
|||
align="left" |
|||
min-width="100" |
|||
label="装托人"> |
|||
</el-table-column> |
|||
|
|||
</el-table> |
|||
<el-footer style="height:40px;margin-top: 25px;text-align:center"> |
|||
<el-button @click="palletModelFlag = false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
|
|||
import { |
|||
deletePallet, |
|||
newPallet, |
|||
scanPalletBox, |
|||
searchPalletDetail, |
|||
searchPalletList, |
|||
updatePalletStatus, |
|||
deletePalletBox |
|||
} from '../../../api/boxManage/boxManage' |
|||
|
|||
export default { |
|||
components: { |
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
dataList: [], |
|||
searchData: { |
|||
site: '', |
|||
username: '', |
|||
buNo: '', |
|||
orderNo: '', |
|||
palletType: '', |
|||
orderStatus: '', |
|||
height:'300', |
|||
page: 1, |
|||
limit: 1000 |
|||
}, |
|||
scanDisabled: false, |
|||
dataListLoading: false, |
|||
currentRow:'', |
|||
columnList: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: this.functionId, |
|||
serialNumber: '750002Table2PalletNo', |
|||
tableId: "750002Table2", |
|||
tableName: "托清单", |
|||
columnProp: "palletNo", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "托盘标签", |
|||
columnWidth: '120', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: false |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: this.functionId, |
|||
serialNumber: '750002Table2Status', |
|||
tableId: "750002Table2", |
|||
tableName: "托清单", |
|||
columnProp: "status", |
|||
headerAlign: "center", |
|||
align: "center", |
|||
columnLabel: "状态", |
|||
columnWidth: '80', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: false |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: this.functionId, |
|||
serialNumber: '750002Table2BoxesQty', |
|||
tableId: "750002Table2", |
|||
tableName: "托清单", |
|||
columnProp: "boxesQty", |
|||
headerAlign: "center", |
|||
align: "right", |
|||
columnLabel: "箱数", |
|||
columnWidth: '80', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: false |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: this.functionId, |
|||
serialNumber: '750002Table2CreatedBy', |
|||
tableId: "750002Table2", |
|||
tableName: "托清单", |
|||
columnProp: "createdBy", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "创建人", |
|||
columnWidth: '100', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: false |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: this.functionId, |
|||
serialNumber: '750002Table2CreatedDate', |
|||
tableId: "750002Table2", |
|||
tableName: "托清单", |
|||
columnProp: "createdDate", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "创建时间", |
|||
columnWidth: '100', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: false |
|||
}, |
|||
], |
|||
modelList:[], |
|||
palletData:{ |
|||
site:'', |
|||
orderNo:'', |
|||
palletNo:'', |
|||
buNo:'', |
|||
boxesQty: 0, |
|||
}, |
|||
scanBoxNo:'', |
|||
palletModelFlag: false, |
|||
palletActionType: 'add', // 新增:添加/删除模式 |
|||
} |
|||
}, |
|||
methods: { |
|||
//初始化组件的参数 |
|||
init(inData) { |
|||
//初始化参数 |
|||
this.searchData = JSON.parse(JSON.stringify(inData)); |
|||
//刷新表格 |
|||
this.searchTable(); |
|||
}, |
|||
searchTable(){ |
|||
searchPalletList(this.searchData).then(({data}) => { |
|||
//区分请求成功和失败的状况 |
|||
if (data && data.code == 0) { |
|||
this.dataList = data.rows |
|||
} else { |
|||
this.dataList = []; |
|||
} |
|||
}); |
|||
}, |
|||
newPallet(){ |
|||
this.$confirm(`确定为此销售发货单新建托?`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
let inData={ |
|||
site: this.searchData.site, |
|||
createdBy: this.$store.state.user.name, |
|||
buNo: this.searchData.buNo, |
|||
orderNo: this.searchData.orderNo, |
|||
palletType: this.searchData.palletType, |
|||
status:'未封托', |
|||
boxesQty: 0, |
|||
} |
|||
newPallet(inData).then(({data}) => { |
|||
if (data && data.code == 0) { |
|||
this.$message.success( '操作成功') |
|||
this.searchTable(); |
|||
let data2={ |
|||
site: this.searchData.site, |
|||
palletNo: data.palletNo, |
|||
buNo: this.searchData.buNo, |
|||
} |
|||
this.searchPallet(data2) |
|||
this.palletModelFlag = true |
|||
this.palletActionType='add' |
|||
this.$nextTick(() => { |
|||
this.$refs.scanBoxNo.focus(); |
|||
}); |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
palletModelOpen(row){ |
|||
let inData={ |
|||
site: row.site, |
|||
palletNo: row.palletNo, |
|||
buNo: row.buNo, |
|||
} |
|||
this.searchPallet(inData) |
|||
if(row.status==='未封托'){ |
|||
this.scanDisabled=false |
|||
}else { |
|||
this.scanDisabled = true |
|||
} |
|||
this.scanBoxNo='' |
|||
this.palletModelFlag = true |
|||
this.palletActionType='add' |
|||
this.$nextTick(() => { |
|||
this.$refs.scanBoxNo.focus(); |
|||
}); |
|||
}, |
|||
searchPallet(inData){ |
|||
searchPalletDetail(inData).then(({data}) => { |
|||
if (data && data.code == 0) { |
|||
this.modelList=data.rows |
|||
this.palletData=data.row |
|||
} |
|||
}) |
|||
}, |
|||
deletePallet(row){ |
|||
this.$confirm(`确定删除此托?`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
let inData={ |
|||
id: row.id, |
|||
} |
|||
deletePallet(inData).then(({data}) => { |
|||
if (data && data.code == 0) { |
|||
this.$message.success( '操作成功') |
|||
this.searchTable(); |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
fengTuo(row){ |
|||
this.$confirm(`确定封托?`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
let inData={ |
|||
id: row.id, |
|||
status: '已封托' |
|||
} |
|||
updatePalletStatus(inData).then(({data}) => { |
|||
if (data && data.code == 0) { |
|||
this.$message.success( '操作成功') |
|||
this.searchTable(); |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
chaiTuo(row){ |
|||
this.$confirm(`确定拆托?`, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
let inData={ |
|||
id: row.id, |
|||
status: '未封托' |
|||
} |
|||
updatePalletStatus(inData).then(({data}) => { |
|||
if (data && data.code == 0) { |
|||
this.$message.success( '操作成功') |
|||
this.searchTable(); |
|||
} else { |
|||
this.$alert(data.msg, '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
handlePalletAction(){ |
|||
if(this.palletActionType==='add'){ |
|||
this.addBoxToPallet() |
|||
}else{ |
|||
this.deleteBoxFromPallet() |
|||
} |
|||
}, |
|||
addBoxToPallet(){ |
|||
if(!this.scanBoxNo){ |
|||
this.$message.warning('请扫描箱号') |
|||
return |
|||
} |
|||
let inData={ |
|||
site: this.palletData.site, |
|||
buNo: this.palletData.buNo, |
|||
palletNo: this.palletData.palletNo, |
|||
boxNo: this.scanBoxNo, |
|||
receivedBy: this.$store.state.user.name, |
|||
} |
|||
scanPalletBox(inData).then(({data}) => { |
|||
if (data && data.code == 0) { |
|||
this.$message.success('装托成功') |
|||
this.scanBoxNo='' |
|||
let data2={ |
|||
site: this.palletData.site, |
|||
palletNo: this.palletData.palletNo, |
|||
buNo: this.palletData.buNo, |
|||
} |
|||
this.searchPallet(data2) |
|||
this.$refs.scanBoxNo.focus(); |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
this.scanBoxNo='' |
|||
this.$refs.scanBoxNo.focus(); |
|||
} |
|||
}) |
|||
}, |
|||
deleteBoxFromPallet(){ |
|||
if(!this.scanBoxNo){ |
|||
this.$message.warning('请扫描箱号') |
|||
return |
|||
} |
|||
let inData={ |
|||
site: this.palletData.site, |
|||
buNo: this.palletData.buNo, |
|||
palletNo: this.palletData.palletNo, |
|||
boxNo: this.scanBoxNo, |
|||
} |
|||
deletePalletBox(inData).then(({data}) => { |
|||
if (data && data.code == 0) { |
|||
this.$message.success('删除成功') |
|||
this.scanBoxNo='' |
|||
let data2={ |
|||
site: this.palletData.site, |
|||
palletNo: this.palletData.palletNo, |
|||
buNo: this.palletData.buNo, |
|||
} |
|||
this.searchPallet(data2) |
|||
this.$refs.scanBoxNo.focus(); |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
this.scanBoxNo='' |
|||
this.$refs.scanBoxNo.focus(); |
|||
} |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
.rq .auto /deep/ .el-form-item__content{ |
|||
height: auto; |
|||
line-height: 1.5; |
|||
} |
|||
/deep/ .el-table__fixed-right-patch { |
|||
display: none !important; |
|||
} |
|||
.sl .el-radio--medium.is-bordered { |
|||
padding: 2px 5px 0px 5px; |
|||
border-radius: 4px; |
|||
height: 20px; |
|||
} |
|||
</style> |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue