Commit 24ab40d9 authored by zhoutong's avatar zhoutong

封箱

parent 10ed56e7
......@@ -71,6 +71,8 @@ export function createGoods(data) {
});
}
/***************************** 理货 start **********************************/
/**
* 获得获得合包箱分页
*
......@@ -158,4 +160,98 @@ export function getPkgPageByPkgId(params) {
method: "get",
params,
});
}
\ No newline at end of file
}
/**
* 创建合包订单
*
* @export
* @param {*} data
* @return {*}
*/
export function createPkgOrder(data) {
return request({
url: "/ecw/box-pkg-order/create",
method: "post",
data,
});
}
/**
* 批量创建合包订单
*
* @export
* @param {*} data
* @return {*}
*/
export function createBatchPkgOrder(data) {
return request({
url: "/ecw/box-pkg-order/createBatch",
method: "post",
data,
});
}
/**
* 移出合包订单
*
* @export
* @param {*} data
* @return {*}
*/
export function deleteRelate(pkgId, orderId) {
return request({
url: `/ecw/box-pkg-order/deleteRelate`,
method: "delete",
headers:{
'Content-type': 'application/x-www-form-urlencoded'
},
data: 'pkgId='+pkgId+'&orderId='+orderId
});
}
/**
* 批量移出合包订单
*
* @export
* @param {*} data
* @return {*}
*/
export function deleteBatchRelate(data) {
return request({
url: `/ecw/box-pkg-order/deleteBatchRelate`,
method: "post",
data: data
});
}
/**
* 获得封箱数据
*
* @export
* @param {*} data
* @return {*}
*/
export function getMergePkgInfoById(id) {
return request({
url: "/ecw/box-merge-pkg/getMergePkgInfoById?id="+id,
method: "get"
});
}
/**
* 获得封箱标签数据
*
* @export
* @param {*} data
* @return {*}
*/
export function getMergeTagById(id) {
return request({
url: "/ecw/box-merge-pkg/getMergeTagById?id="+id,
method: "get"
});
}
/***************************** 合包 end **********************************/
......@@ -33,7 +33,7 @@
>
</el-row>
<el-row style="margin-top: 5px">
<el-table border :data="pagList" max-height="600px">
<el-table border :data="pagList" max-height="600px">
<el-table-column align="center" :label="$t('序号')" width="50" prop="tidanNum" />
<el-table-column :label="$t('箱号')" align="center" prop="pkgNum" />
<el-table-column :label="$t('尺寸')" width="250px" align="center">
......@@ -59,7 +59,7 @@
<el-button v-if="scope.row.status == 1" type="text" size="small" @click="editMerge(scope.row)">{{ $t('编辑') }}</el-button>
<el-button type="text" size="small" @click="pkgPage(scope.row)">{{ $t('装箱') }}</el-button>
<el-button v-if="scope.row.status != 2" type="text" size="small" @click="deleteMerge(scope.row.id)">{{ $t('删除') }}</el-button>
<el-button type="text" size="small" @click="removeClick('single', scope.row)">{{ $t('打印标签') }}</el-button>
<el-button type="text" size="small" @click="printTag(scope.row.id)">{{ $t('打印标签') }}</el-button>
</template>
</el-table-column>
</el-table>
......@@ -98,13 +98,17 @@
</div>
</el-dialog>
<!-- 装箱 -->
<el-dialog :title="pkgPageTitle" :visible.sync="pkgPagedialogVisible" :fullscreen="true" :modal-append-to-body="false" append-to-body>
<el-dialog :title="pkgPageTitle" :visible.sync="pkgPagedialogVisible" :fullscreen="true" :modal-append-to-body="false" append-to-body @close="pkgPageType=0">
<el-radio-group v-model="pkgPageType">
<el-radio-button :label="1">{{$t('未装箱列表')}}</el-radio-button>
<el-radio-button :label="2">{{$t('已装箱列表')}}</el-radio-button>
<el-radio-button :label="1">{{ $t('未装箱列表') }}</el-radio-button>
<el-radio-button :label="2">{{ $t('已装箱列表') }}</el-radio-button>
</el-radio-group>
<un-pkg-page v-if="pkgPageType == 1" />
<pkg-page v-if="pkgPageType == 2" />
<un-pkg-page v-if="pkgPageType == 1" :pkgData="pkgData" :shipmentObj="shipmentObj" />
<pkg-page v-if="pkgPageType == 2" :pkgData="pkgData" :shipmentObj="shipmentObj" @closeDialog="closeDialog" />
</el-dialog>
<!-- 打印标签 -->
<el-dialog :title="$t('集运封箱标签')" :visible.sync="printdialogVisible" width="300px" :modal-append-to-body="false" append-to-body>
<print-tag v-if="printdialogVisible" :tagData="tagData" />
</el-dialog>
<el-row style="margin-top: 15px" class="operate-button">
......@@ -117,14 +121,16 @@
</template>
<script>
import { getMergePkgList, createMergePkg, updateMergePkg, deleteMergePkg } from '@/api/ecw/boxAir'
import { getMergePkgList, createMergePkg, updateMergePkg, deleteMergePkg, getMergeTagById } from '@/api/ecw/boxAir'
import { formatDate, serviceMsg } from '../../utils'
import unPkgPage from './unPkgPage.vue'
import PkgPage from './pkgPage.vue'
import printTag from './printTag.vue'
export default {
components: {
unPkgPage,
PkgPage
PkgPage,
printTag
},
data() {
return {
......@@ -144,7 +150,10 @@ export default {
isMergeEdit: false,
pkgPageType: 1,
pkgPageTitle: '',
pkgPagedialogVisible: false
pkgPagedialogVisible: false,
pkgData: {},
printdialogVisible: false,
tagData: {}
}
},
created() {
......@@ -213,7 +222,19 @@ export default {
},
pkgPage(row) {
this.pkgPagedialogVisible = true
this.pkgPageTitle = this.$t('合包箱号: ')+row.pkgNum
this.pkgPageType=1
this.pkgPageTitle = this.$t('合包箱号: ') + row.pkgNum
this.pkgData = row
},
printTag(id) {
getMergeTagById(id).then(res=>{
this.tagData = res.data
this.printdialogVisible = true
})
},
closeDialog() {
this.getList()
this.pkgPagedialogVisible = false
},
finish() {}
}
......
<template>
<div>
22
<el-row style="margin-top: 25px">
<el-row>
<el-button size="small" type="primary" @click="removeBatch">{{ $t('批量移出合包') }}</el-button>
<el-button size="small" type="primary" @click="sealBox">{{ $t('封箱') }}</el-button>
</el-row>
<el-row style="margin-top: 5px">
<el-table border :data="pagList" max-height="600px" @select="checkboxSelect" @select-all="checkboxSelect">
<el-table-column type="selection" align="center" width="55" fixed="left" />
<el-table-column align="center" :label="$t('序号')" width="50" type="index" />
<el-table-column :label="$t('订单号')" align="center" prop="orderNo">
<template slot-scope="scope">
{{ scope.row.orderNo }}
</template>
</el-table-column>
<el-table-column :label="$t('商品信息')" width="250px" align="center">
<template slot-scope="{ row }">
<div v-for="item in row.orderItemDOS" :key="item.orderItemId">
{{ $l(item, 'prodTitle') }}
</div>
</template>
</el-table-column>
<el-table-column :label="$t('备案')" align="center">
<template slot-scope="{ row }">
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="row.productRecord" />
</template>
</el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="sumNum">
<template slot-scope="scope">
{{ scope.row.sumNum }}
</template>
</el-table-column>
<el-table-column :label="$t('纸箱尺寸')" align="center">
<template slot-scope="{ row }">
<div v-for="item in row.orderItemDOS" :key="item.orderItemId">
{{ item.warehouseInInfoVO?item.warehouseInInfoVO.boxGauge:'' }}
</div>
</template>
</el-table-column>
<el-table-column :label="$t('体积')" align="center" prop="sumVolume" />
<el-table-column :label="$t('重量')" align="center" prop="sumWeight" />
<el-table-column :label="$t('数量(个)')" align="center" prop="sumQuantity" />
<el-table-column :label="$t('储位')" align="center" prop="positionNo" width="250px">
<template slot-scope="{ row }">
<div v-for="item in row.orderItemDOS" :key="item.orderItemId">
{{ notset(item.positionNo) }}
</div>
</template>
</el-table-column>
<el-table-column :label="$t('理货时间')" align="center">
<template slot-scope="scope">
{{ formatDate(scope.row.tallyTime, 'YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column :label="$t('操作')" align="center" width="160" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button type="text" size="small" @click="removePkg(scope.row)">{{ $t('移出') }}</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getList" />
</el-row>
<!-- 封箱 -->
<el-dialog :title="$t('封箱确认')" :visible.sync="sealBoxdialogVisible" width="700px" :modal-append-to-body="false" append-to-body>
<el-form ref="sealBoxForm" :model="sealBoxForm" label-width="100px">
<el-form-item :label="$t('箱号')" prop="pkgNum">
{{ pkgData.pkgNum }}
</el-form-item>
<el-row>
<el-col :span="8">
<el-form-item :label="$t('长')" prop="pkgLength">
<el-input-number v-model="sealBoxForm.pkgLength" :controls="false" :precision="2" style="width: 100px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('宽')" prop="pkgWidth">
<el-input-number v-model="sealBoxForm.pkgWidth" :controls="false" :precision="2" style="width: 100px" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('高')" prop="pkgHight">
<el-input-number v-model="sealBoxForm.pkgHight" :controls="false" :precision="2" style="width: 100px" />
</el-form-item>
</el-col>
</el-row>
<el-form-item :label="$t('体积')" prop="sumVolume" :rules="[
{ required: true, message: $t('请填写体积')},
{ pattern: /^((0{1}\.\d{1,2})|([1-9]\d*\.{1}\d{1,2})|([1-9]+\d*))$/, message: $t('体积保留两位小数')}
]">
<el-input v-model="sealBoxForm.sumVolume" style="width: 180px">
<template slot="append">
{{ $t('') }}
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('重量')" prop="sumWeight" :rules="[
{ required: true, message: $t('请填写重量')},
{ pattern: /^((0{1}\.\d{1,2})|([1-9]\d*\.{1}\d{1,2})|([1-9]+\d*))$/, message: $t('重量保留两位小数')}
]">
<el-input v-model="sealBoxForm.sumWeight" style="width: 180px">
<template slot="append">
{{ $t('kg') }}
</template>
</el-input>
</el-form-item>
<el-form-item :label="$t('数量')" prop="sumNum" :rules="[
{ required: true, message: $t('请填写数量')},
{ pattern: /^((0{1}\.\d{1,2})|([1-9]\d*\.{1}\d{1,2})|([1-9]+\d*))$/, message: $t('数量保留两位小数')}
]">
<el-input v-model="sealBoxForm.sumNum" style="width: 180px">
<template slot="append">
{{ $t('') }}
</template>
</el-input>
</el-form-item>
</el-form>
<div style="text-align: center">
<el-button size="small" type="primary" @click="sealBoxSubmit">{{ $t('确定') }}</el-button>
<el-button size="small" type="primary" @click="sealBoxdialogVisible = false">{{ $t('取消') }}</el-button>
</div>
</el-dialog>
</el-row>
</div>
</template>
<script>
import { getPkgPageByPkgId, deleteRelate, deleteBatchRelate, getMergePkgInfoById, updateMergePkg } from '@/api/ecw/boxAir'
import { formatDate, serviceMsg } from '../../utils'
export default {
props: {
pkgData: Object,
shipmentObj: Object,
},
data() {
return {
pagList: [],
// 查询参数
queryParams: {
page: 1,
rows: 10
},
total: 0,
// 勾选行
selectedRows: [],
sealBoxdialogVisible: false,
sealBoxForm: {}
}
},
created() {
this.getList()
},
methods: {
getList() {
let queryParams = {
id: this.pkgData.id ,
shipmentId: this.shipmentObj.id,
...this.queryParams
}
getPkgPageByPkgId(queryParams).then((res) => {
this.pagList = res.data.list
this.total = res.data.total
})
},
// 格式化日期
formatDate,
//去重
notset(string) {
if (!string) return string
let arr = string.split(',')
arr = arr.filter((item, index) => {
return arr.indexOf(item) == index
})
return arr.toString()
},
removePkg(row) {
deleteRelate(this.pkgData.id, row.orderId).then(() => {
this.$message.success(this.$t('移出成功'))
this.getList()
})
},
// 选中
checkboxSelect(selection) {
this.selectedRows = selection
},
removeBatch() {
if (this.selectedRows.length === 0) {
this.$message.error(this.$t('请选择需要移出的订单'))
return
}
let data = []
this.selectedRows.forEach((item) => {
let json = {
pkgId: this.pkgData.id,
orderId: item.orderId
}
data.push(json)
})
deleteBatchRelate(data).then(() => {
this.$message.success(this.$t('移出成功'))
this.getList()
})
},
//封箱
sealBox() {
getMergePkgInfoById(this.pkgData.id).then(res=>{
this.sealBoxForm = {
pkgHight: res.data.pkgHight,
pkgLength: res.data.pkgLength,
pkgWidth: res.data.pkgWidth,
sumNum: res.data.sumNum,
sumVolume: res.data.sumVolume,
sumWeight: res.data.sumWeight,
}
this.sealBoxdialogVisible = true
})
},
sealBoxSubmit() {
this.$refs['sealBoxForm'].validate((valid) => {
if (!valid) {
return
}
this.sealBoxForm.shipmentId = this.shipmentObj.id
this.sealBoxForm.id = this.pkgData.id
this.sealBoxForm.status = 3
updateMergePkg(this.sealBoxForm).then(() => {
this.sealBoxdialogVisible = false
this.$confirm(this.$t('箱号:')+this.pkgData.pkgNum+this.$t(',请问是否打印封箱标签?'), this.$t("封箱成功"), {
confirmButtonText: this.$t('立刻打印'),
cancelButtonText: this.$t('稍后再试'),
})
.then((_) => {
})
.catch((_) => {
this.$emit('closeDialog');
});
})
})
}
}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="tag">
<div style="display: flex;height: 200px;">
<div style="border-right: 1px solid #999; width: 125px">
<div>
<p style="margin-top: 1mm; text-align: center">
<span style="text-align: center; font-weight: 600; font-size: 3mm">{{ $t('扫码查看产品数量') }}</span>
</p>
<img :src="tagData.qrCodeUrl" :alt="tagData.qrCodeUrl" style="width: 26mm" />
<p style="margin-top: -1mm; text-align: center">
<span style="text-align: center; font-weight: 600; font-size: 4mm">{{ tagData.mergePkgNo }}</span>
</p>
</div>
</div>
<div style="width: 125px">
<p style="margin-top: 1mm; text-align: center">
<span style="text-align: center; font-weight: 600; font-size: 4mm">EC001141212</span>
</p>
<div style="border: 1px solid #999;margin-left: 10px;" />
<p style="margin-top: 1mm; text-align: center">
<span style="text-align: center; font-weight: 600; font-size: 4mm">{{ tagData.company }}</span>
</p>
<div style="border: 1px solid #999;margin-left: 10px;" />
<p style="margin-top: 1mm; text-align: center">
<span style="text-align: center; font-weight: 600; font-size: 4mm">{{ tagData.startWarehouse }} -> {{ tagData.endWarehouse }}</span>
</p>
<div style="border: 1px solid #999;margin-left: 10px;" />
<div style="display: flex;margin-top: 10px;">
<div style="border-right: 2px solid #999;width: 35px;">
<p style="margin-top: 1mm; text-align: center">
<span style="text-align: center; font-weight: 600; font-size: 4mm">{{ tagData.transportName }}</span>
</p>
</div>
<div style="width: 75px;">
<p style="margin-top: 1mm; text-align: center">
<span style="text-align: center; font-weight: 600; font-size: 3mm">{{ tagData.date }}</span>
</p>
</div>
</div>
</div>
</div>
<div>
<!-- <img :src="tagData.qrCodeUrl" style="margin-left: 10px;width:17mm;vertical-align:middle" /> -->
</div>
<div style="height: 50px;border-top: 1px solid #999;">
<p style="margin-top: 1mm; text-align: center">
<span style="text-align: center; font-weight: 600; font-size: 3mm">E&C Logistics: www.groupage.com</span>
</p>
</div>
</div>
</template>
<script>
export default {
props: {
tagData: Object
},
created() {
console.log(this.tagData, 'tagData')
}
}
</script>
<style scoped>
.tag {
width: 250px;
height: 250px;
/* background-color: #e2dede; */
text-align: center;
padding: 15px;
border: 1px solid #999;
border-radius: 5px;
}
</style>
\ No newline at end of file
<template>
<div>
11
<el-row style="margin-top: 25px">
<el-row>
<el-button size="small" type="primary" @click="createBatch">{{ $t('批量装箱') }}</el-button>
</el-row>
<el-row style="margin-top: 5px">
<el-table border :data="pagList" max-height="600px" @select="checkboxSelect" @select-all="checkboxSelect">
<el-table-column type="selection" align="center" width="55" fixed="left" />
<el-table-column align="center" :label="$t('序号')" width="50" type="index" />
<el-table-column :label="$t('订单号')" align="center" prop="orderNo">
<template slot-scope="scope">
{{ scope.row.orderNo }}
</template>
</el-table-column>
<el-table-column :label="$t('商品信息')" width="250px" align="center">
<template slot-scope="{ row }">
<div v-for="item in row.orderItemDOS" :key="item.orderItemId">
{{ $l(item, 'prodTitle') }}
</div>
</template>
</el-table-column>
<el-table-column :label="$t('备案')" align="center">
<template slot-scope="{ row }">
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="row.productRecord" />
</template>
</el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="sumNum">
<template slot-scope="scope">
{{ scope.row.sumNum }}
</template>
</el-table-column>
<el-table-column :label="$t('纸箱尺寸')" align="center">
<template slot-scope="{ row }">
<div v-for="item in row.orderItemDOS" :key="item.orderItemId">
{{ item.warehouseInInfoVO?item.warehouseInInfoVO.boxGauge:'' }}
</div>
</template>
</el-table-column>
<el-table-column :label="$t('体积')" align="center" prop="sumVolume" />
<el-table-column :label="$t('重量')" align="center" prop="sumWeight" />
<el-table-column :label="$t('数量(个)')" align="center" prop="sumQuantity" />
<el-table-column :label="$t('储位')" align="center" prop="positionNo" width="250px">
<template slot-scope="{ row }">
<div v-for="item in row.orderItemDOS" :key="item.orderItemId">
{{ notset(item.positionNo) }}
</div>
</template>
</el-table-column>
<el-table-column :label="$t('理货时间')" align="center">
<template slot-scope="scope">
{{ formatDate(scope.row.tallyTime, 'YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column :label="$t('操作')" align="center" width="160" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addPkg(scope.row)">{{ $t('装箱') }}</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getList" />
</el-row>
</el-row>
</div>
</template>
<script>
import { getUnPkgPage, createPkgOrder, createBatchPkgOrder } from '@/api/ecw/boxAir'
import { formatDate, serviceMsg } from '../../utils'
export default {
props: {
pkgData: Object,
shipmentObj: Object,
},
data() {
return {
pagList: [],
// 查询参数
queryParams: {
page: 1,
rows: 10,
shipmentId: this.shipmentObj.id,
},
total: 0,
// 勾选行
selectedRows: []
}
},
created() {
this.getList()
},
methods: {
getList() {
getUnPkgPage(this.queryParams).then((res) => {
this.pagList = res.data.list
this.total = res.data.total
})
},
// 格式化日期
formatDate,
//去重
notset(string) {
if (!string) return string
let arr = string.split(',')
arr = arr.filter((item, index) => {
return arr.indexOf(item) == index
})
return arr.toString()
},
addPkg(row) {
let data = {
pkgId: this.pkgData.id,
orderId: row.orderId,
orderItemId: row.orderItemId
}
createPkgOrder(data).then(() => {
this.$message.success(this.$t('装箱成功'))
this.getList()
})
},
// 选中
checkboxSelect(selection) {
this.selectedRows = selection
},
createBatch() {
if (this.selectedRows.length === 0) {
this.$message.error(this.$t('请选择需要装箱的订单'))
return
}
let data = []
this.selectedRows.forEach((item) => {
let json = {
pkgId: this.pkgData.id,
orderId: item.orderId,
orderItemId: item.orderItemId
}
data.push(json)
})
createBatchPkgOrder(data).then(() => {
this.$message.success(this.$t('装箱成功'))
this.getList()
})
}
}
}
</script>
<style>
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment