|
@@ -10,36 +10,47 @@
|
|
|
<div style="display: flex;align-items: center;justify-content: space-between">
|
|
|
<div>
|
|
|
<!--<el-button type="primary" size="small" @click="DistributionBox">配箱</el-button>-->
|
|
|
- <el-button type="danger" size="small"
|
|
|
- :disabled="detailData.seeDisabled || pleasereviewType || showLock" @click="revokefun">撤销
|
|
|
+ <el-button type="success" size="small" plain :disabled="seeDisabled"
|
|
|
+ @click.stop="equalDistribution2()">配箱
|
|
|
</el-button>
|
|
|
- <el-button type="danger" size="small"
|
|
|
- :disabled="detailData.seeDisabled || pleasereviewType || showLock"
|
|
|
- @click="wholeRevokefun">全部撤销
|
|
|
+ <el-button type="success" size="small" plain :disabled="seeDisabled"
|
|
|
+ @click.stop="equalDistribution(1)">按TEU配箱
|
|
|
</el-button>
|
|
|
- <el-button type="warning" size="small"
|
|
|
- :disabled="detailData.seeDisabled || pleasereviewType || showLock"
|
|
|
- @click="cleanCntrNofun">清除箱号
|
|
|
+ <el-button type="success" size="small" plain :disabled="seeDisabled"
|
|
|
+ @click.stop="equalDistribution(2)">按箱量配箱
|
|
|
</el-button>
|
|
|
<el-button type="primary" size="small"
|
|
|
- :disabled="detailData.seeDisabled || pleasereviewType || showLock" @click="rootEditfun">一键编辑
|
|
|
+ :disabled="detailData.seeDisabled || pleasereviewType || showLock"
|
|
|
+ @click="rootEditfun">一键编辑
|
|
|
</el-button>
|
|
|
<el-button type="primary" size="small"
|
|
|
:disabled="detailData.seeDisabled || pleasereviewType || showLock"
|
|
|
@click="containersSubmitListfun">一键保存
|
|
|
</el-button>
|
|
|
- <el-button type="danger" size="small"
|
|
|
- :disabled="detailData.seeDisabled || pleasereviewType || showLock" @click="handleDelete">一键删除
|
|
|
- </el-button>
|
|
|
<el-button type="success" size="small"
|
|
|
:disabled="detailData.seeDisabled || !assemblyForm.id || pleasereviewType || showLock"
|
|
|
- @click="excelBox = true">导入箱号铅封号
|
|
|
+ @click="oepnexcelBox">导入箱号铅封号
|
|
|
</el-button>
|
|
|
<el-button type="success" size="small" :loading="loadingButton"
|
|
|
:disabled="detailData.seeDisabled || !assemblyForm.id || pleasereviewType || showLock"
|
|
|
@click="extractBoxInformation">提取箱信息
|
|
|
</el-button>
|
|
|
-
|
|
|
+ <el-button type="warning" size="small"
|
|
|
+ :disabled="detailData.seeDisabled || pleasereviewType || showLock"
|
|
|
+ @click="cleanCntrNofun">清除箱号
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" size="small"
|
|
|
+ :disabled="detailData.seeDisabled || pleasereviewType || showLock"
|
|
|
+ @click="revokefun">选定撤销
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" size="small"
|
|
|
+ :disabled="detailData.seeDisabled || pleasereviewType || showLock"
|
|
|
+ @click="wholeRevokefun">全部撤销
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" size="small"
|
|
|
+ :disabled="detailData.seeDisabled || pleasereviewType || showLock"
|
|
|
+ @click="handleDelete">删除配箱
|
|
|
+ </el-button>
|
|
|
<!--<el-button type="warning" size="small"-->
|
|
|
<!-- :disabled="numberfalsefun() || assemblyForm.id"-->
|
|
|
<!-- @click="equalDistribution">平均分配</el-button>-->
|
|
@@ -109,8 +120,8 @@
|
|
|
|
|
|
<el-dialog title="导入箱号,铅封号" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
|
|
|
v-dialog-drag>
|
|
|
- <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading" :upload-before="uploadBefore"
|
|
|
- :upload-after="onSuccess">
|
|
|
+ <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading"
|
|
|
+ :upload-before="uploadBefore" :upload-after="onSuccess">
|
|
|
<template slot="excelTemplate">
|
|
|
<el-button type="primary" @click="handleGet">
|
|
|
点击下载<i class="el-icon-download el-icon--right"></i>
|
|
@@ -144,6 +155,7 @@ import {
|
|
|
containersCleanBoxNo,
|
|
|
containersRevoke,
|
|
|
containersEqualDistribution,
|
|
|
+ distributionBox,
|
|
|
containersSubmitList,
|
|
|
containersExportContainers, containersImportBoxNo, containersList, luHaiTongApiDetail
|
|
|
} from "@/api/iosBasicData/containers";
|
|
@@ -156,7 +168,6 @@ import { decryptLhtData } from "@/util/lhtDataDesc";
|
|
|
import extractBoxInformation
|
|
|
from "@/views/iosBasicData/SeafreightExportF/bills/assembly/DistributionBox/extractBoxInformation.vue";
|
|
|
import { billsAdd } from "@/api/iosBasicData/bills";
|
|
|
-
|
|
|
export default {
|
|
|
components: { SearchQuery, bports, extractBoxInformation },
|
|
|
props: {
|
|
@@ -320,7 +331,7 @@ export default {
|
|
|
return ids.join(",");
|
|
|
}
|
|
|
},
|
|
|
- created() {},
|
|
|
+ created() { },
|
|
|
methods: {
|
|
|
// 提取箱信息
|
|
|
extractBoxInformation() {
|
|
@@ -480,6 +491,17 @@ export default {
|
|
|
cntrNoInput(row, name) {
|
|
|
this.$set(row, name, row[name].toLocaleUpperCase().replace(/[\W]/g, ''))
|
|
|
},
|
|
|
+ oepnexcelBox(){
|
|
|
+ if (!this.assemblyForm.id) {
|
|
|
+ this.$message({
|
|
|
+ message: '请先点击右上角保存按钮,保存数据之后才能添加!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.findObject(this.excelOption.column, "excelFile").action = "/api/blade-los/containers/importBoxNo?billId="+this.assemblyForm.id
|
|
|
+ this.excelBox = true
|
|
|
+ },
|
|
|
uploadBefore(file, done, loading) {
|
|
|
done();
|
|
|
loading = true;
|
|
@@ -498,6 +520,117 @@ export default {
|
|
|
this.assemblyForm.containersList = res.data.data.records
|
|
|
})
|
|
|
},
|
|
|
+ equalDistribution2() {
|
|
|
+ if (!this.assemblyForm.id) {
|
|
|
+ this.$message({
|
|
|
+ message: '请先点击右上角保存按钮,保存数据之后才能添加!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$confirm("是否确认配箱?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ distributionBox({ billId: this.assemblyForm.id }).then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ })
|
|
|
+ this.$emit('billsDetailfun')
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ // 平均箱量
|
|
|
+ equalDistribution(type) {
|
|
|
+ if (!this.assemblyForm.id) {
|
|
|
+ this.$message({
|
|
|
+ message: '请先点击右上角保存按钮,保存数据之后才能添加!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.assemblyForm.waitingBoxList.length <= 0) {
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请先添加集装箱数据!"
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.assemblyForm.preContainersList <= 0) {
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请先添加箱型数据!"
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$confirm("确定平均分配?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.containersEqualDistributionfun(type)
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ // 平均分配接口
|
|
|
+ containersEqualDistributionfun(type) {
|
|
|
+ containersEqualDistribution({
|
|
|
+ pid: this.assemblyForm.id,
|
|
|
+ type: type,
|
|
|
+ waitingBox: this.assemblyForm.waitingBoxList[0]
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.data instanceof Array) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ })
|
|
|
+ this.$emit('billsDetailfun')
|
|
|
+ } else {
|
|
|
+ // 没有除开
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ message: '<span style="color:red">注意!!!件数不能平均分 ,请手工配箱,或者修改件数.</span>\n' +
|
|
|
+ '<table border="1">\n' +
|
|
|
+ ' <thead>\n' +
|
|
|
+ ' <tr>\n' +
|
|
|
+ ' <th></th>\n' +
|
|
|
+ ' <th>件数</th>\n' +
|
|
|
+ ' <th>毛重</th>\n' +
|
|
|
+ ' <th>尺码</th>\n' +
|
|
|
+ ' </tr>\n' +
|
|
|
+ ' </thead>\n' +
|
|
|
+ ' <tbody>\n' +
|
|
|
+ ' <tr>\n' +
|
|
|
+ ' <td>总数</td>\n' +
|
|
|
+ ' <td>' + res.data.data.total.quantity + '</td>\n' +
|
|
|
+ ' <td>' + res.data.data.total.grossWeight + '</td>\n' +
|
|
|
+ ' <td>' + res.data.data.total.grossWeight + '</td>\n' +
|
|
|
+ ' </tr>\n' +
|
|
|
+ ' <tr>\n' +
|
|
|
+ ' <td>入箱</td>\n' +
|
|
|
+ ' <td>' + res.data.data.average.quantity + '</td>\n' +
|
|
|
+ ' <td>' + res.data.data.average.grossWeight + '</td>\n' +
|
|
|
+ ' <td>' + res.data.data.average.grossWeight + '</td>\n' +
|
|
|
+ ' </tr>\n' +
|
|
|
+ ' <tr>\n' +
|
|
|
+ ' <td>差额</td>\n' +
|
|
|
+ ' <td>' + res.data.data.subtract.quantity + '</td>\n' +
|
|
|
+ ' <td>' + res.data.data.subtract.grossWeight + '</td>\n' +
|
|
|
+ ' <td>' + res.data.data.subtract.grossWeight + '</td>\n' +
|
|
|
+ ' </tr>\n' +
|
|
|
+ ' </tbody>\n' +
|
|
|
+ '</table>',
|
|
|
+ duration: 5000
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
// 下载模板
|
|
|
handleGet() {
|
|
|
window.open(
|
|
@@ -518,23 +651,23 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- // 平均分配
|
|
|
- equalDistribution() {
|
|
|
- if (this.assemblyForm.waitingBoxList.length <= 0) {
|
|
|
- this.$message({
|
|
|
- type: "warning",
|
|
|
- message: "请先添加集装箱数据!"
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- this.$confirm("确定平均分配?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- this.$emit('equalDistribution')
|
|
|
- })
|
|
|
- },
|
|
|
+ // // 平均分配
|
|
|
+ // equalDistribution() {
|
|
|
+ // if (this.assemblyForm.waitingBoxList.length <= 0) {
|
|
|
+ // this.$message({
|
|
|
+ // type: "warning",
|
|
|
+ // message: "请先添加集装箱数据!"
|
|
|
+ // });
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // this.$confirm("确定平均分配?", {
|
|
|
+ // confirmButtonText: "确定",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // type: "warning"
|
|
|
+ // }).then(() => {
|
|
|
+ // this.$emit('equalDistribution')
|
|
|
+ // })
|
|
|
+ // },
|
|
|
// 一键编辑
|
|
|
rootEditfun() {
|
|
|
for (let item of this.assemblyForm.containersList) {
|
|
@@ -677,8 +810,8 @@ export default {
|
|
|
},
|
|
|
// 一键删除
|
|
|
handleDelete() {
|
|
|
- for(let item of this.assemblyForm.containersList){
|
|
|
- if(item.quantity>0) return this.$message.error('箱型:'+item.cntrTypeCode+'件数大于0不允许删除')
|
|
|
+ for (let item of this.assemblyForm.containersList) {
|
|
|
+ if (item.quantity > 0) return this.$message.error('箱型:' + item.cntrTypeCode + '件数大于0不允许删除')
|
|
|
}
|
|
|
this.$confirm("确定将全部数据删除?", {
|
|
|
confirmButtonText: "确定",
|
|
@@ -720,8 +853,8 @@ export default {
|
|
|
this.selectionList = arr
|
|
|
this.$emit('selectionChange', this.selectionList)
|
|
|
},
|
|
|
- inPitch(){
|
|
|
- this.$refs.crud.toggleRowSelection(this.assemblyForm.containersList[0],true);
|
|
|
+ inPitch() {
|
|
|
+ this.$refs.crud.toggleRowSelection(this.assemblyForm.containersList[0], true);
|
|
|
},
|
|
|
selectionClear() {
|
|
|
this.selectionList = [];
|