Commit b6438373 authored by dragondean@qq.com's avatar dragondean@qq.com

完善海运卸柜和空运到仓

parent eb666c55
...@@ -46,9 +46,34 @@ ...@@ -46,9 +46,34 @@
</p> </p>
</el-row> </el-row>
<el-row>
<el-form inline>
<el-form-item :label="$t('订单号')">
<el-input v-model="queryParams.orderNo" :placeholder="$t('请输入订单号')" clearable></el-input>
</el-form-item>
<el-form-item :label="$t('始发仓')">
<el-select v-model="queryParams.startWarehouseIds" :placeholder="$t('请选择始发仓')" clearable multiple>
<el-option v-for="item in exportWarehouseList" :label="$l(item, 'title')" :value="$l(item, 'title')" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓')">
<el-select v-model="queryParams.destWarehouseIds" :placeholder="$t('请选择目的仓')" clearable multiple>
<el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="$l(item, 'title')" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('订单状态')">
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status" :filter="statusDictFilter" clearable />
</el-form-item>
<el-form-item>
<el-button @click="batchUnLoad" :disabled="!multipleSelection.length">{{$t('选中订单一键卸柜')}}</el-button>
</el-form-item>
</el-form>
</el-row>
<!-- 表格 --> <!-- 表格 -->
<el-row class="table-area"> <el-row class="table-area">
<el-table v-loading="loading" :data="pageData.sectionOrderList" border max-height="500px"> <el-table v-loading="loading" :data="filteredOrderList" border max-height="500px" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column :label="$t('序号')" align="center" width="50" prop="tidanNum" /> <el-table-column :label="$t('序号')" align="center" width="50" prop="tidanNum" />
<el-table-column :label="$t('订单号')" align="center" prop="orderNo"> <el-table-column :label="$t('订单号')" align="center" prop="orderNo">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -177,6 +202,11 @@ ...@@ -177,6 +202,11 @@
<el-dialog custom-class="shipping-dialog" :title="$t('异常')" :visible.sync="dialogVisible" width="600px" :modal-append-to-body=false append-to-body> <el-dialog custom-class="shipping-dialog" :title="$t('异常')" :visible.sync="dialogVisible" width="600px" :modal-append-to-body=false append-to-body>
<unloadingError v-if="dialogVisible" @closeDialog="closeDialog" v-bind="$attrs" :currRow="currRow" /> <unloadingError v-if="dialogVisible" @closeDialog="closeDialog" v-bind="$attrs" :currRow="currRow" />
</el-dialog> </el-dialog>
<el-dialog :title="$t('批量卸柜选中订单')" :visible="batchUnloading" :before-close="handleCloseBatchUnloading" append-to-body>
<template v-for="item in batchLogs">
<div>{{item}}</div>
</template>
</el-dialog>
</div> </div>
</template> </template>
...@@ -196,6 +226,8 @@ import { ...@@ -196,6 +226,8 @@ import {
import { serviceMsg, getTotlContent, toReviewDetail } from "../../utils"; import { serviceMsg, getTotlContent, toReviewDetail } from "../../utils";
import WorkFlow from "@/components/WorkFlow"; import WorkFlow from "@/components/WorkFlow";
import Decimal from "decimal.js"; import Decimal from "decimal.js";
import { getWarehouseList } from '@/api/ecw/warehouse'
import Template from '@/views/cms/template/index.vue'
/** /**
* 开始卸柜 * 开始卸柜
...@@ -203,7 +235,7 @@ import Decimal from "decimal.js"; ...@@ -203,7 +235,7 @@ import Decimal from "decimal.js";
export default { export default {
name: "startUnloading", name: "startUnloading",
inheritAttrs: false, inheritAttrs: false,
components: { unloadingError, WorkFlow }, components: { Template, unloadingError, WorkFlow },
data() { data() {
return { return {
// 标签号 // 标签号
...@@ -241,10 +273,25 @@ export default { ...@@ -241,10 +273,25 @@ export default {
}, },
selectedUsers: [], selectedUsers: [],
sectionOrderList: [], sectionOrderList: [],
ulWarehouseTime: null ulWarehouseTime: null,
warehouseList:[],
// 筛选参数
queryParams:{
orderNo: '',
startWarehouseIds:[],
destWarehouseIds:[],
status: null
},
// 表格选中的
multipleSelection: [],
// 是否正在批量卸柜
batchUnloading: false,
// 批量操作的日志
batchLogs:[]
}; };
}, },
created() { created() {
getWarehouseList().then(res => this.warehouseList = res.data)
this.getLoadGoodsList(); this.getLoadGoodsList();
// 部分 // 部分
getSectionList({ shipmentId: this.$attrs.shipmentObj.id }).then((res) => { getSectionList({ shipmentId: this.$attrs.shipmentObj.id }).then((res) => {
...@@ -485,8 +532,73 @@ export default { ...@@ -485,8 +532,73 @@ export default {
toReviewDetail.apply(this, [cabinetUnloadApprovalInfo.bpmProcessId]); toReviewDetail.apply(this, [cabinetUnloadApprovalInfo.bpmProcessId]);
this.$emit("closeStart", "close"); this.$emit("closeStart", "close");
}, },
// 表格多选
handleSelectionChange(selection) {
console.log({selection})
this.multipleSelection = selection
},
async batchUnLoad(){
if(!this.multipleSelection?.length){
return this.$message(this.$t('请先选择订单'))
}
if(!this.ulWarehouseTime){
return this.$message(this.$t('请选择卸柜时间'))
}
console.log('批量卸柜')
this.batchUnloading = true
this.batchLogs = []
for(const item of this.multipleSelection){
if(!this.batchUnloading)break;
const time = new Date()
const timeStr = [time.getHours(), time.getMinutes(), time.getSeconds()].map(item => item.toString().padStart(2, '0')).join(':')
await airBatchUnload({
orderNo: item.orderNo,
shipmentId: this.$attrs.shipmentObj.id,
unloadTime: this.ulWarehouseTime
}).then((res) => {
this.batchLogs.push(`${timeStr} 订单号:${item.orderNo}卸柜成功`)
}).catch((err) => {
this.batchLogs.push(`${timeStr} 订单号:${item.orderNo}卸柜失败` + JSON.stringify(err))
});
}
this.batchLogs.push("批量卸柜完成")
this.getLoadGoodsList();
},
handleCloseBatchUnloading(){
this.batchUnloading = false
},
// 过滤订单状态筛选字典内容
statusDictFilter(item){
if(item.cssClass && item.cssClass != 'air'){
return false
}
return true
},
}, },
computed: { computed: {
exportWarehouseList(){
/* tradeType 1 进口,2出口,3进出口 */
return this.warehouseList.filter(item => item.tradeType == 2 || item.tradeType == 3)
},
importWarehouseList(){
return this.warehouseList.filter(item => item.tradeType == 1 || item.tradeType == 3)
},
filteredOrderList(){
if(!this.pageData?.sectionOrderList?.length) return []
return this.pageData.sectionOrderList.filter((item) => {
if(this.queryParams.orderNo && item.orderNo.indexOf(this.queryParams.orderNo) == -1)return false
if(this.queryParams.startWarehouseIds?.length && this.queryParams.startWarehouseIds.indexOf(item.startWarehouseName) === -1){
return false
}
if(this.queryParams.destWarehouseIds?.length && this.queryParams.destWarehouseIds.indexOf(item.destWarehouseName) === -1){
return false
}
if(this.queryParams.status && this.queryParams.status != item.status){
return false
}
return true
})
},
/* 是否审核中 */ /* 是否审核中 */
isUnderReview() { isUnderReview() {
const { currNode, shipmentObj } = this.$attrs; const { currNode, shipmentObj } = this.$attrs;
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<el-row> <el-row>
<el-form inline> <el-form inline>
<el-form-item :label="$t('订单号')"> <el-form-item :label="$t('订单号')">
<el-input v-model="queryParams.orderNo" :placeholder="$t('请输入订单号')"></el-input> <el-input v-model="queryParams.orderNo" :placeholder="$t('请输入订单号')" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('始发仓')"> <el-form-item :label="$t('始发仓')">
<el-select v-model="queryParams.startWarehouseIds" :placeholder="$t('请选择始发仓')" clearable multiple> <el-select v-model="queryParams.startWarehouseIds" :placeholder="$t('请选择始发仓')" clearable multiple>
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
<el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="$l(item, 'title')" :key="item.id"></el-option> <el-option v-for="item in importWarehouseList" :label="$l(item, 'title')" :value="$l(item, 'title')" :key="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('订单状态')">
<dict-selector :type="DICT_TYPE.ORDER_STATUS" v-model="queryParams.status" :filter="statusDictFilter" clearable />
</el-form-item>
<el-form-item> <el-form-item>
<el-button @click="batchUnLoad" :disabled="!multipleSelection.length">{{$t('选中订单一键卸柜')}}</el-button> <el-button @click="batchUnLoad" :disabled="!multipleSelection.length">{{$t('选中订单一键卸柜')}}</el-button>
</el-form-item> </el-form-item>
...@@ -256,7 +259,8 @@ export default { ...@@ -256,7 +259,8 @@ export default {
queryParams:{ queryParams:{
orderNo: '', orderNo: '',
startWarehouseIds:[], startWarehouseIds:[],
destWarehouseIds:[] destWarehouseIds:[],
status: null
}, },
// 表格选中的 // 表格选中的
multipleSelection: [], multipleSelection: [],
...@@ -517,7 +521,6 @@ export default { ...@@ -517,7 +521,6 @@ export default {
if(!this.batchUnloading)break; if(!this.batchUnloading)break;
const time = new Date() const time = new Date()
const timeStr = [time.getHours(), time.getMinutes(), time.getSeconds()].map(item => item.toString().padStart(2, '0')).join(':') const timeStr = [time.getHours(), time.getMinutes(), time.getSeconds()].map(item => item.toString().padStart(2, '0')).join(':')
this.batchLogs.push(`${timeStr} 订单号:${item.orderNo}正在卸柜`)
await batchUnload({ await batchUnload({
orderNo: item.orderNo, orderNo: item.orderNo,
shipmentId: this.$attrs.shipmentObj.id, shipmentId: this.$attrs.shipmentObj.id,
...@@ -533,7 +536,14 @@ export default { ...@@ -533,7 +536,14 @@ export default {
}, },
handleCloseBatchUnloading(){ handleCloseBatchUnloading(){
this.batchUnloading = false this.batchUnloading = false
},
// 过滤订单状态筛选字典内容
statusDictFilter(item){
if(item.cssClass && item.cssClass != 'sea'){
return false
} }
return true
},
}, },
computed: { computed: {
exportWarehouseList(){ exportWarehouseList(){
...@@ -546,13 +556,16 @@ export default { ...@@ -546,13 +556,16 @@ export default {
filteredOrderList(){ filteredOrderList(){
if(!this.pageData?.sectionOrderList?.length) return [] if(!this.pageData?.sectionOrderList?.length) return []
return this.pageData.sectionOrderList.filter((item) => { return this.pageData.sectionOrderList.filter((item) => {
if(this.queryParams.orderNo && this.queryParams.orderNo != item.orderNo)return false if(this.queryParams.orderNo && item.orderNo.indexOf(this.queryParams.orderNo) == -1 )return false
if(this.queryParams.startWarehouseIds?.length && this.queryParams.startWarehouseIds.indexOf(item.startWarehouseName) === -1){ if(this.queryParams.startWarehouseIds?.length && this.queryParams.startWarehouseIds.indexOf(item.startWarehouseName) === -1){
return false return false
} }
if(this.queryParams.destWarehouseIds?.length && this.queryParams.destWarehouseIds.indexOf(item.destWarehouseName) === -1){ if(this.queryParams.destWarehouseIds?.length && this.queryParams.destWarehouseIds.indexOf(item.destWarehouseName) === -1){
return false return false
} }
if(this.queryParams.status && this.queryParams.status != item.status){
return false
}
return true return true
}) })
}, },
......
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