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

Merge branch 'release' into dev

# Conflicts:
#	src/App.vue
#	src/i18n/languages/en_US.json
#	src/views/ecw/box/shippingSea/nodePage/cabinet/splitOrder.vue
#	src/views/ecw/financial/creatCollection.vue
#	src/views/ecw/order/edit.vue
#	src/views/ecw/order/prepayDeal.vue
#	src/views/ecw/order/splitApply.vue
parents a3cb13b0 da68387c
......@@ -49,11 +49,20 @@ export default {
.items-center{
align-items: center;
}
.flex-between{
display: flex;
justify-content: space-between;
}
.empty-placeholder{
padding: 50px;
text-align: center;
}
$sizes: 0, 10,20,30,50,100,150,200,300,500,800,1000;
/*给el-input-number一个紧凑的样式*/
.el-input-number.is-controls-right.tight .el-input__inner{
padding-right: 30px;
padding-left: 5px;
}
$sizes: 0, 10,20,30,50,75,100,150,200,300,500,800,1000;
@for $i from 1 through length($sizes){
$item: nth($sizes, $i);
.ml-#{$item}{
......
......@@ -48,7 +48,9 @@ export function getCustomerPage(query) {
return request({
url: '/ecw/customer/page',
method: 'get',
params: query
params: query,
timeout: 60000
})
}
/**
......
......@@ -25,7 +25,8 @@ export function getCustomerPage(query) {
return request({
url: '/ecw/indirect-customer/page',
method: 'get',
params: query
params: query,
timeout: 30000
})
}
......@@ -53,4 +54,4 @@ export function deleteIndirectCustomer(id) {
url: '/ecw/indirect-customer/delete?id=' + id,
method: 'delete'
})
}
\ No newline at end of file
}
......@@ -5,7 +5,9 @@ export function getApiAccessLogPage(query) {
return request({
url: '/infra/api-access-log/page',
method: 'get',
timeout: 1000*60*3,
params: query
})
}
......
......@@ -13,6 +13,7 @@ export function getApiErrorLogPage(query) {
return request({
url: '/infra/api-error-log/page',
method: 'get',
timeout: 1000*60*3,
params: query
})
}
......
......@@ -5,7 +5,7 @@ export function listOperateLog(query) {
return request({
url: '/system/operate-log/page',
method: 'get',
timeout: 5*6000,
timeout: 5*60000,
params: query
})
}
......@@ -16,7 +16,7 @@ export function exportOperateLog(query) {
url: '/system/operate-log/export',
method: 'get',
params: query,
timeout: 5*6000,
timeout: 5*60000,
responseType: 'blob'
})
}
......@@ -52,6 +52,8 @@ export default {
this.list.unshift(res.data)
this.index = 0
})
}else{
this.index = index
}
},
remoteMethod(keyword){
......@@ -61,6 +63,9 @@ export default {
getCustomerSelect(params)
.then(res => this.list = res.data.list)
.finally(() => this.loading = false)
},
reset(){
this.index=null
}
}
}
......
......@@ -142,7 +142,8 @@ export default {
if (f.selected) result.push({
orderId: this.orderId,
wareId: f.pid,
areaId: f.id
areaId: f.id,
locationName: f.code
})
else {
f.positionList?.forEach(g => {
......@@ -151,7 +152,8 @@ export default {
orderId: this.orderId,
wareId: g.domainId,
areaId: g.areaId,
locationId: g.id
locationId: g.id,
locationName: f.code + g.code
})
else g.children?.forEach(k => {
// 子位置
......@@ -159,7 +161,8 @@ export default {
orderId: this.orderId,
wareId: k.domainId,
areaId: k.areaId,
locationId: k.id
locationId: k.id,
locationName: f.code + k.code
})
})
})
......
......@@ -94,10 +94,14 @@ export default {
}
},
created() {
// 未避免频繁内存溢出,减少请求记录感染,开发的时候不轮询消息
if(process.env.NODE_ENV != 'development'){
setInterval(() => {
this.updateMessage()
}, 10000)
}
this.updateMessage()
setInterval(() => {
this.updateMessage()
}, 10000)
},
components: {
Breadcrumb,
......
......@@ -16,7 +16,7 @@ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: (localStorage.VUE_APP_BASE_API || process.env.VUE_APP_BASE_API) + '/admin-api/', // 此处的 /admin-api/ 地址,原因是后端的基础路径为 /admin-api/
// 超时
timeout: 10000
timeout: 1000 * 30
})
// request拦截器
service.interceptors.request.use(config => {
......
......@@ -281,6 +281,11 @@ export default {
component: "BoxSplitDetail",
id: this.processInstance.businessKey,
},
// 退场拆单,跟出货装柜拆单一样
exit_split: {
component: "BoxSplitDetail",
id: this.processInstance.businessKey,
},
merge_detail: {
component: "MergeDetail",
id: this.processInstance.businessKey,
......
......@@ -2,13 +2,13 @@
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('流程编号')" prop="processId">
<el-form-item :label="$t('流程编号')" prop="instanceId">
<el-input v-model="queryParams.instanceId" :placeholder="$t('请输入流程编号')" clearable/>
</el-form-item>
<el-form-item :label="$t('流程名称')" prop="processName">
<el-input v-model="queryParams.processName" :placeholder="$t('请输入任务名称')" clearable/>
</el-form-item>
<el-form-item :label="$t('流程分类')" prop="processName">
<el-form-item :label="$t('流程分类')" prop="categoryId">
<el-select v-model="queryParams.categoryId" :placeholder="$t('请选择流程分类')" clearable>
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.BPM_MODEL_CATEGORY)"
:key="dict.value" :label="$l(dict, 'label')" :value="dict.value"/>
......
......@@ -141,42 +141,47 @@
</el-table-column>
<el-table-column :label="$t('入仓体积')" align="center" >
<template slot-scope="scope">
<el-input v-model="scope.row.volume" @change="updateField(scope.row, 'volume')" size="mini" :disabled="index === 0">
<el-input v-model="scope.row.volume" @change="updateField(scope.row, 'volume')" size="mini" disabled>
<span slot="append"></span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('收费体积')" align="center" >
<template slot-scope="scope">
<el-input v-model="scope.row.chargeVolume" @change="updateField(scope.row, 'chargeVolume')" size="mini" :disabled="index === 0">
<el-input v-model="scope.row.chargeVolume" @change="updateField(scope.row, 'chargeVolume')" size="mini" disabled>
<span slot="append"></span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('入仓重量')" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.weight" @change="updateField(scope.row, 'weight')" size="mini" :disabled="index === 0">
<el-input v-model="scope.row.weight" @change="updateField(scope.row, 'weight')" size="mini" disabled>
<span slot="append">kg</span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('收费重量')" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.chargeWeight" @change="updateField(scope.row, 'chargeWeight')" size="mini" :disabled="index === 0">
<el-input v-model="scope.row.chargeWeight" @change="updateField(scope.row, 'chargeWeight')" size="mini" disabled>
<span slot="append">kg</span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('货值')" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.worth" @change="updateField(scope.row, 'worth')" size="mini" :disabled="index === 0">
<span slot="append">{{ $t('') }}</span>
<el-input v-model="scope.row.worth" @change="updateField(scope.row, 'worth')" size="mini">
<span slot="append">{{ $t('') }}</span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('箱数')" align="center">
<template slot-scope="scope">
<span>{{scope.row.num}}</span>
<el-button type="text" @click="showWarehouse(scope.row)">{{scope.row.num}}</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('数量(个)')" align="center">
<template slot-scope="scope">
<span>{{scope.row.quantity}}</span>
</template>
</el-table-column>
......@@ -205,80 +210,188 @@
</div>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="$t('放入品名')" :visible.sync="shopOpen" width="500px" append-to-body>
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="150px">
<el-row>
<el-form-item :label="$t('中文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择中文品名')" @change="onProdChange">
<el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item :label="$t('英文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择英文品名')" @change="onProdChange">
<el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('剩余箱数')+':'">
{{shopForm.leftNum||0}}
</el-form-item>
</el-col>
<!--剩余数量计算不出来,显示没意义-->
<!--<el-col :span="12" v-show="isQuantity">
<el-form-item :label="$t('剩余数量(个)')+':'">
{{shopForm.leftQuantity||0}}
</el-form-item>
</el-col>-->
</el-row>
<el-form-item :label="$t('放入箱数')+':'">
<el-input-number v-model="shopForm.num" controls-position="right" :min="0" :max="+shopForm.leftNum" @change="calcAverg"></el-input-number>
</el-form-item>
<el-dialog :title="$t('放入品名')" :visible.sync="shopOpen" width="1500px" append-to-body>
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="150px" inline>
<el-form-item :label="$t('中文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择中文品名')">
<el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.orderItemId" :key="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('英文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择英文品名')">
<el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.orderItemId" :key="item.id"></el-option>
</el-select>
</el-form-item>
<div class="page-title">{{$t('品名可拆数据')}}</div>
<div class="pl-20">
<span class="mr-10">{{$t('箱数')}}:{{ Math.min(mainOrderItem.num, maxNum) || 0 }}</span>
<span class="mr-10">{{ $t('入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³</span>
<span class="mr-10">{{ $t('收费方数') }}:{{ mainOrderItem.chargeVolume || 0 }}m³</span>
<span class="mr-10">{{ $t('入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg</span>
<span class="mr-10">{{ $t('收费重量') }}:{{ mainOrderItem.chargeWeight || 0 }}kg</span>
<span class="mr-10">{{ $t('数量(个)') }}:{{ mainOrderItem.quantity || 0 }}</span>
<span class="mr-10">{{ $t('剩余货值') }}:{{ mainOrderItem.worth || 0 }}{{ $t('元') }}</span>
</div>
<div class="page-title">{{$t('可拆入仓记录')}}</div>
<el-table
:data="getOrderItemWarehouseIn(shopForm.orderItemId)"
style="width: 100%">
<el-table-column :label="$t('箱数')">
<template v-slot="{row,$index}">
{{Math.min(getWarehouseLeftData(row, 'num'), leftSplitNum)}}
<dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('包装类型')">
<template v-slot="{row,$index}">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="row.unit"></dict-tag>
</template>
</el-table-column>
<el-table-column label="长(cm)">
<template v-slot="{row,$index}">
{{row.boxGauge1}}
</template>
</el-table-column>
<el-table-column label="宽(cm)">
<template v-slot="{row,$index}">
{{ row.boxGauge2 }}
</template>
</el-table-column>
<el-table-column label="高(cm)">
<template v-slot="{row,$index}">
{{ row.boxGauge3 }}
</template>
</el-table-column>
<el-table-column label="入仓体积(m³)">
<template v-slot="{row,$index}">
{{getWarehouseLeftData(row, 'volume')}}
</template>
</el-table-column>
<el-table-column label="入仓重量(Kg)" prop="weight">
<template v-slot="{row,$index}">
{{getWarehouseLeftData(row, 'weight')}}
</template>
</el-table-column>
<el-table-column :label="$t('数量')" prop="quantity">
<template v-slot="{row,$index}">
{{getWarehouseLeftData(row, 'quantity')}}
</template>
</el-table-column>
<el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template v-slot="{ row, column, $index }">
<warehouse-area-select
v-model="row.orderLocationBackVOList"
readonly
:warehouse-id="currentWarehouseId"
></warehouse-area-select>
</template>
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}">
<el-tag v-if="getWarehouseInSplitData(row.id,'num') >= row.cartonsNum" disabled size="mini" type="primary" >{{$t('已拆完')}}</el-tag>
<el-button v-else size="mini" type="primary" @click="putInRecord(row)" :disabled="leftSplitNum <= 0">放入</el-button>
</template>
</el-table-column>
</el-table>
<div class="flex-between mt-20 mb-10">
<div class="page-title" style="margin: 0">
{{$t('已放入入仓记录')}}
</div>
<el-button type="danger" size="mini" @click="clearAll">清空放入数据</el-button>
</div>
<el-table
:data="shopForm.specsRecordVOList"
style="width: 100%">
<el-table-column :label="$t('箱数')" width="200px">
<template v-slot="{row,$index}">
{{row.num}}
<dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('包装类型')" width="100px">
<template v-slot="{row,$index}">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="row.unit"></dict-tag>
</template>
</el-table-column>
<el-table-column label="长(cm)">
<template v-slot="{row,$index}">
{{row.boxGauge1}}
</template>
</el-table-column>
<el-table-column label="宽(cm)">
<template v-slot="{row,$index}">
{{ row.boxGauge2 }}
</template>
</el-table-column>
<el-table-column label="高(cm)">
<template v-slot="{row,$index}">
{{ row.boxGauge3 }}
</template>
</el-table-column>
<el-table-column label="入仓体积(m³)">
<template v-slot="{row,$index}">
{{row.volume}}
</template>
</el-table-column>
<!--<el-table-column label="收费体积(m³)" prop="chargeVolume"></el-table-column>-->
<el-table-column label="入仓重量(Kg)" prop="weight"></el-table-column>
<!--<el-table-column label="收费重量(Kg)" prop="chargeWeight"></el-table-column>-->
<el-table-column :label="$t('数量')" width="130px" prop="quantity"></el-table-column>
<el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template v-slot="{ row, column, $index }">
{{getLocationName(row.orderLocationList)}}
</template>
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}">
<el-button size="mini" type="primary" @click="deleteRow($index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-form-item v-if="mainOrderItem.orderItemId" label-width="0">
{{ $t('剩余入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³,
{{$t('剩余收费方数')}}:{{ mainOrderItem.chargeVolume || 0 }}m³
</el-form-item>
<div class="page-title">放入数据</div>
<div class="pl-20 mb-10">
<span class="mr-10">{{$t('箱数')}}:{{ putin.num || 0 }},</span>
<span class="mr-10">{{ $t('数量(个)') }}:{{ putin.quantity || 0 }},</span>
<span class="mr-10">{{ $t('入仓方数') }}:{{ putin.volume || 0 }}m³, </span>
<span class="mr-10">{{ $t('入仓重量') }}:{{ putin.weight || 0 }}kg</span>
</div>
<el-form-item :label="$t('收费方数')" prop="chargeVolume">
<el-input-number v-model="shopForm.chargeVolume" controls-position="right"></el-input-number>
</el-form-item>
<el-form-item :label="$t('收费重量')" prop="chargeWeight">
<el-input-number v-model="shopForm.chargeWeight" controls-position="right"></el-input-number>kg
</el-form-item>
<el-form-item :label="$t('入仓体积')">
<el-input-number v-model="shopForm.volume" controls-position="right" :min="0" :max="mainOrderItem.volume"></el-input-number>
</el-form-item>
<el-form-item :label="$t('收费体积')">
<el-input-number v-model="shopForm.chargeVolume" controls-position="right" :min="0" :max="mainOrderItem.chargeVolume"></el-input-number>
</el-form-item>
<el-form-item v-if="mainOrderItem.orderItemId" label-width="0">
{{ $t('剩余入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg,
{{$t('剩余收费重量')}}:{{ mainOrderItem.chargeWeight || 0 }}kg
</el-form-item>
<el-form-item :label="$t('入仓重量')">
<el-input-number v-model="shopForm.weight" controls-position="right" :min="0" :max="mainOrderItem.weight"></el-input-number>
</el-form-item>
<el-form-item :label="$t('收费重量')">
<el-input-number v-model="shopForm.chargeWeight" controls-position="right" :min="0" :max="mainOrderItem.chargeWeight"></el-input-number>
</el-form-item>
<el-form-item v-if="mainOrderItem.orderItemId" label-width="0">
{{ $t('剩余货值') }}:{{ mainOrderItem.worth || 0 }}{{ $t('美元') }}
</el-form-item>
<el-form-item :label="$t('放入货值')">
<el-input-number v-model="shopForm.worth" controls-position="right" :min="0" :max="mainOrderItem.worth"></el-input-number>
</el-form-item>
<!--按照原型这里需要显示剩余数量,但是事实无法计算剩余数量,因为已装数量是未知的-->
<el-form-item :label="$t('放入数量(个)')+':'" prop="quantity" v-if="isQuantity">
<el-input-number v-model="shopForm.quantity" controls-position="right" :min="0" :max="mainOrderItem.quantity || undefined"></el-input-number>
</el-form-item>
<el-form-item :label="$t('备注信息')+':'">
<el-input v-model="shopForm.remarks"></el-input>
</el-form-item>
</el-row>
<el-form-item :label="$t('放入货值')">
<el-input-number v-model="shopForm.worth" controls-position="right" :min="0" :max="mainOrderItem.worth">
<template slot="append">{{ $t('') }}</template>
</el-input-number>
</el-form-item>
<el-form-item :label="$t('备注信息')">
<el-input v-model="shopForm.remark"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="shopAdd">{{$t('确定')}}</el-button>
<el-button @click="shopCancel">{{$t('取消')}}</el-button>
</div>
</el-dialog>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body></warehouse-record>
<put-in
v-if="currentPutIn"
:warehouse-record="currentPutIn"
@close="currentPutIn=null"
@submit="handlePutin"
:warehouse-id="currentWarehouseId"
:maxNum="leftSplitNum"
append-to-body
></put-in>
</div>
</template>
......@@ -292,15 +405,23 @@ import {
import {quantityRequired} from "@/api/ecw/warehouse";
import { getTradeCityList } from "@/api/ecw/region";
import WorkFlow from "@/components/WorkFlow";
import {getOrder, splitItemUpdate} from "@/api/ecw/order";
import {getOrder, getOrderWarehouseIn, splitItemUpdate} from "@/api/ecw/order";
import { serviceMsg, toReviewDetail } from "../../utils";
import { createApproval, approvalCancel, splitList } from "@/api/ecw/boxSea";
import Decimal from "decimal.js";
import Warehouse from "@/views/ecw/order/warehousing/components/Warehouse";
import WarehouseRecord from "@/views/ecw/order/splitApply/components/WarehouseRecord";
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect";
import PutIn from "@/views/ecw/order/splitApply/components/PutIn.vue";
export default {
name: "splitOrder",
inheritAttrs: false,
components: {
PutIn,
WarehouseAreaSelect,
WarehouseRecord,
Warehouse,
WorkFlow
},
props: {
......@@ -343,7 +464,15 @@ export default {
isQuantity: false,
// 主单数据
mainOrder: {orderSplitItemBackVOList: {}}
mainOrder: {orderSplitItemBackVOList: {}},
// 当前查看的入仓记录
currentWarehouseRecord: null,
// 订单入仓记录
warehouseInList: [],
// 当前选择的入仓记录ID
selectedWarehouseInId: null,
// 当前正在放入的入仓记录
currentPutIn: null
};
},
created() {
......@@ -353,6 +482,15 @@ export default {
this.queryParams.orderId = this.currRow.orderId;
this.getOrderDetail();
this.getSplit();
// 获取入仓记录
getOrderWarehouseIn(this.queryParams.orderId).then(res => {
this.warehouseInList = res.data
})
this.$nextTick(() => {
window.$vm = this
})
},
watch: {
//监听table这个对象
......@@ -373,6 +511,16 @@ export default {
});
},
},
// 切换放入品名
'shopForm.orderItemId'(){
// 默认取以前放入的品名
this.shopForm.specsRecordVOList = []
let specsRecordVOList = this.splitData.orderSplitItemBackVOList.find(item => item.orderItemId == this.shopForm.orderItemId)?.specsRecordVOList || []
specsRecordVOList.forEach(item => {
const [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*')
this.shopForm.specsRecordVOList.push({...item, boxGauge1, boxGauge2, boxGauge3})
})
}
},
computed: {
isAudit() {
......@@ -395,6 +543,125 @@ export default {
mainOrderItem(){
if(!this.shopForm.orderItemId || !this.mainOrder.orderSplitItemBackVOList.length) return {}
return this.mainOrder.orderSplitItemBackVOList.find(item => item.orderItemId == this.shopForm.orderItemId) || {}
},
// 放入数据
putin(){
let data = {
num: new Decimal(0),
volume: new Decimal(0),
chargeVolume: new Decimal(0),
weight: new Decimal(0),
chargeWeight: new Decimal(0),
quantity: new Decimal(0)
}
this.shopForm.specsRecordVOList && this.shopForm.specsRecordVOList.forEach(item => {
data.num = data.num.plus(new Decimal(item.num || 0))
data.volume = data.volume.plus(new Decimal(item.volume || 0))
data.chargeVolume = data.chargeVolume.plus(new Decimal(item.chargeVolume || 0))
data.weight = data.weight.plus(new Decimal(item.weight || 0))
data.chargeWeight = data.chargeWeight.plus(new Decimal(item.chargeWeight || 0))
data.quantity = data.quantity.plus(new Decimal(item.quantity || 0))
})
return {
num: data.num.toNumber(),
volume: data.volume.toNumber(),
chargeVolume: data.chargeVolume.toNumber(),
weight: data.weight.toNumber(),
chargeWeight: data.chargeWeight.toNumber(),
quantity: data.quantity.toNumber()
}
},
// 当前仓库ID
currentWarehouseId(){
return this.orderData.adjustToDestWarehouseId || this.orderData.logisticsInfoDto.startWarehouseId
},
// 当前选择的入仓记录
/*currentWarehouseItem(){
return this.getOrderItemWarehouseIn(this.shopForm.orderItemId).find(item => item.id === this.selectedWarehouseInId)
},*/
// 根据orderItemId获取入仓记录
getOrderItemWarehouseIn() {
return orderItemId => {
const list = this.warehouseInList.find(item => item.orderItemId == orderItemId)?.orderWarehouseInBackItemDoList || []
return list.map(item => {
let [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*')
let labelArr = [
this.$t('{num}箱', {num: item.cartonsNum}),
this.$l(this.getDictDatas(this.DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE).find(dict => dict.value == item.specificationType), 'label'),
this.$t('长{boxGauge1}cm', {boxGauge1}),
this.$t('宽{boxGauge2}cm', {boxGauge2}),
this.$t('高{boxGauge3}cm', {boxGauge3}),
this.$t('方数{volume}m³', {volume: item.volume}),
this.$t('重量{weight}kg', {weight: item.weight})
]
if (item.quantityAll) {
labelArr.push(this.$t('数量{n}', {n: item.quantityAll}))
}
if (item.expressNo) {
labelArr.push(this.$t('快递{expressNo}', {expressNo: item.expressNo}))
}
if (item.orderLocationBackVOList && item.orderLocationBackVOList.length) {
labelArr.push(this.$t('储位{location}', {
location: item.orderLocationBackVOList.map(v => v.code || v.areaName + (v.locationName || '')).join(',')
}))
}
item.boxGauge1 = boxGauge1
item.boxGauge2 = boxGauge2
item.boxGauge3 = boxGauge3
item.text = labelArr.join(',')
return item
})
}
},
// 根据入仓记录ID筛选出他的全部拆出记录(不含主单的)
getWarehouseInspecsRecordVOList(){
return warehouseInId => {
let specsRecordVOList = []
// 这里是正在操作放入,但是还没确定提交的
this.shopForm.specsRecordVOList.forEach(item => {
if(item.warehouseInId == warehouseInId)specsRecordVOList.push(item)
})
return specsRecordVOList
}
},
// 根据入仓ID获取拆出数据
getWarehouseInSplitData(){
return (warehouseInId, field) => {
let total = new Decimal(0)
this.getWarehouseInspecsRecordVOList(warehouseInId).forEach(item => {
total = total.plus(new Decimal(item[field] || 0))
})
return total.toNumber()
}
},
// 获取入仓记录的剩余数据
getWarehouseLeftData(){
return (warehouseRecord, field) => {
let warehouseField = field
if(field === 'num'){
warehouseField = 'cartonsNum'
}
if(field === 'quantity'){
warehouseField = 'quantityAll'
}
let total = new Decimal(warehouseRecord[ warehouseField ] || 0)
this.getWarehouseInspecsRecordVOList(warehouseRecord.id).forEach(item => {
total = total.minus(new Decimal(item[field] || 0))
})
return total.toNumber()
}
},
// 最大可装箱数 原单箱数 - 已装箱数
maxNum(){
return this.currRow.num - this.currRow.installNum
},
// 剩余可拆箱数
leftSplitNum(){
let num = this.maxNum - this.putin.num
/*this.splitData.orderSplitItemBackVOList.forEach(item =>{
num -= item.num
})*/
return num
}
},
methods: {
......@@ -435,13 +702,13 @@ export default {
this.mainOrder = data.find(item => item.isMaster)
});
},
itemDisabled(data) {
/*itemDisabled(data) {
const { orderSplitItemBackVOList = [] } = this.splitData;
const isExist = orderSplitItemBackVOList.find(
(item) => item.orderItemId === data.orderItemId
);
return isExist ? true : false;
},
},*/
/* 查询拆单项 */
querySplitGoods() {
getSplitList({
......@@ -536,102 +803,47 @@ export default {
this.shopForm = {};
this.shopOpen = true;
this.isQuantity = false;
// 重置表单数据
this.shopForm = {specsRecordVOList:[]}
},
// 更改放入品名后触发,计算重量体积等默认值
onProdChange(){
// 根据键值(中文名或者英文名)来获取对应商品的信息,注:这里应该可以采用orderItemId来获取更优,而不是商品名称,同名可能导致异常
let orderItem = this.orderData.orderItemVOList.find(item => item.orderItemId == this.shopForm.orderItemId)
console.log({orderItem})
// 剩余可装箱数,订单入仓箱数 - 订单已装箱数 - 已拆箱数
let leftNum = Decimal(this.currRow.num).minus(this.currRow.installNum).minus(this.totalSplit('num'))
// 剩余箱数
this.$set(this.shopForm, 'leftNum', leftNum)
// 如果主单商品项的入仓箱数小于可装箱数,则取商品项数据
leftNum = Math.min(leftNum, this.mainOrderItem.num)
// 放入箱数
this.$set(this.shopForm, 'num', leftNum)
this.calcAverg()
},
// 按比例计算体积重量的默认值
calcAverg(){
// 装箱比例
const rate = this.shopForm.num / this.mainOrderItem.num
// 放入个数,剩余个数是算不出来的,因为不知道已装数量,所以放入数量只能按照总数的比例计算
this.$set(this.shopForm, 'quantity', Math.ceil(this.mainOrderItem.quantity*rate|| 0 * rate))
// 数量,体积,重量等按照比例给默认值
this.$set(this.shopForm, 'volume', (this.mainOrderItem.volume * rate).toFixed(2))
this.$set(this.shopForm, 'chargeVolume', (this.mainOrderItem.chargeVolume * rate).toFixed(2))
this.$set(this.shopForm, 'weight', (this.mainOrderItem.weight * rate).toFixed(2))
this.$set(this.shopForm, 'chargeWeight', (this.mainOrderItem.chargeWeight * rate).toFixed(2))
this.$set(this.shopForm, 'worth', (this.mainOrderItem.worth * rate).toFixed(2))
},
/*async getSelectData(item) {
await quantityRequired(this.orderData.lineId).then((res) => {
if (res.data) {
this.isQuantity = true;
this.shopRules.putQuantity = [
{
required: true,
message: this.$t("请输入数量(个)"),
trigger: "change",
},
];
} else {
this.isQuantity = false;
delete this.shopRules.putQuantity;
}
});
},*/
shopAdd() {
this.$refs["shopForm"].validate((valid) => {
if (valid) {
// 放入箱数自动计算出来的,所以不需要在做判断了
/*
// 输入箱数大于实装箱数
const total = this.totalSplitNum();
const canSplitNum = Decimal.sub(
this.currRow.num,
this.currRow.installNum
).toNumber();
const remain = Decimal.sub(canSplitNum, total).toNumber();
if (this.shopForm.num > remain) {
this.$message.error(this.$t("放入箱数不能大于总箱数"));
return;
}*/
if (this.shopForm.num === 0) {
if (this.putin.num === 0) {
this.$message.error(this.$t("放入箱数不能为0"));
return;
}
if (this.shopForm.quantity === 0 && this.isQuantity) {
if (this.putin.quantity === 0 && this.isQuantity) {
this.$message.error(this.$t("放入数量(个)不能为0"));
return;
}
this.shopForm.specsRecordVOList.forEach(item => {
item.boxGauge = `${item.boxGauge1}*${item.boxGauge2}*${item.boxGauge3}`
})
let params = {
num: this.shopForm.num,
num: this.putin.num,
// quantity: this.shopForm.quantity,
orderItemId: this.shopForm.orderItemId,
orderSplitId: this.splitData.id,
remarks: this.shopForm.remarks,
volume: this.shopForm.volume,
weight: this.shopForm.weight,
chargeWeight: this.shopForm.chargeWeight,
chargeVolume: this.shopForm.chargeVolume,
worth: this.shopForm.worth
volume: this.putin.volume,
weight: this.putin.weight,
chargeWeight: this.putin.chargeWeight,
chargeVolume: this.putin.chargeVolume,
worth: this.shopForm.worth || 0,
specsRecordVOList:this.shopForm.specsRecordVOList,
shipmentSplit: true
};
// 按数量计费的才需要传递数量
if(this.isQuantity){
params.quantity = this.shopForm.quantity
params.quantity = this.putin.quantity
}
createSplitItem(params).then((res) => {
this.$message.success(this.$t("放入成功"));
this.querySplitGoods();
this.$refs["shopForm"].resetFields();
this.shopOpen = false;
});
this.shopOpen = false;
}
});
},
......@@ -667,6 +879,87 @@ export default {
toReviewDetail.apply(this, [cabinetSplitInfo.bpmProcessId]);
this.$emit("closeDialog2", "close");
},
// 添加一行
addRow(){
if(!this.shopForm.specsRecordVOList){
this.$set(this.shopForm,'specsRecordVOList',[])
}
if(!this.currentWarehouseItem){
return this.$message.info(this.$t("请选择入仓记录"))
}
let { specificationType, boxGauge1, boxGauge2, boxGauge3, volume, weight } = this.currentWarehouseItem
let num = this.currentWarehouseItem.cartonsNum
// 根据入仓记录添加一行
this.shopForm.specsRecordVOList.push({
specificationType, boxGauge1, boxGauge2, boxGauge3, volume, weight,num,
orderLocationList: this.currentWarehouseItem.orderLocationBackVOList
})
},
// 删除一行,可选参数index表上行号,参数不是数字则删除最后一行
deleteRow(index){
const spliceIndex = typeof index !== 'number' ? this.shopForm.specsRecordVOList.length - 1 : index
this.shopForm.specsRecordVOList.splice(spliceIndex, 1)
},
// 计算体积
calcVolume(row){
let volume = Decimal(row.boxGauge1 || 0)
.times(Decimal(row.boxGauge2 || 0))
.times(Decimal(row.boxGauge3 || 0)).div(1000000)
// 如果是箱的单位要乘以箱数
if(row.specificationType === 1) {
row.volume = volume.times(Decimal(row.num || 0))
}
// 最低0.01
volume = Math.max(0.01, volume.toNumber().toFixed(2))
this.$set(row, 'volume', volume)
this.$set(row, 'chargeVolume', volume)
},
// 显示入库记录
showWarehouse(row){
if(!row.specsRecordVOList){
return this.$message.info(this.$t('暂无入仓记录'))
}
this.currentWarehouseRecord = row.specsRecordVOList
},
// 获取储位名称
getLocationName(locationArr){
if(!locationArr || !locationArr.length) return ''
let arr = []
locationArr.forEach(item => {
arr.push(`${item.areaName || ''}${item.locationName || ''}`)
})
return Array.from(new Set(arr)).join(",")
},
// 根据入仓记录打开放入弹层
putInRecord(row){
this.currentPutIn = row
// 此条入仓记录已拆出的入仓记录,这样在放入的时候可以确保不超过此入仓记录的数量
this.currentPutIn.specsRecordVOList = this.getWarehouseInspecsRecordVOList(row.id)
},
// 放入回调
handlePutin(list){
if(!list.length){
return this.$message.error(this.$t("请至少放入一条数据"))
}
list.forEach(item => {
this.shopForm.specsRecordVOList.push({...item})
})
this.currentPutIn = null
// 根据比例计算默认的收费方数和收费重量
const orderItem = this.orderData.orderItemVOList.find(item => item.orderItemId == this.shopForm.orderItemId)
const rate = this.putin.num / orderItem.warehouseInInfoVO.cartonsNum
this.$set(this.shopForm, 'chargeVolume', (orderItem.chargeVolume*rate).toFixed(2))
this.$set(this.shopForm, 'chargeWeight', (orderItem.chargeWeight*rate).toFixed(2))
this.$set(this.shopForm, 'worth', (orderItem.worth*rate).toFixed(2))
},
// 清空放入记录
clearAll(){
this.$confirm(this.$t("确定要清空放入数据么?")).then(res => {
this.shopForm.specsRecordVOList = []
})
}
},
};
</script>
......
......@@ -279,6 +279,7 @@ export default {
secId: this.partData.id,
shipmentId: this.$attrs.shipmentObj.id,
orderId: item.orderId,
isCover: 1
};
if (type === "all") {
params.orderItemIdList = item.boxOrderItemList.map(
......
......@@ -563,14 +563,24 @@ export default {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (column.property === "brandType") {
if (column.property === "feeType") {
sums[index] = this.$t("合计");
return;
}
if (column.property === "num") {
sums[index] = new Decimal(
this.calcSum(column.property, data)
).toNumber();
if (column.property === "warehouseInInfoVO.cartonsNum") {
var num = 0
let values = data?.map((item) => Number(item.warehouseInInfoVO.cartonsNum)) ?? [];
if (!values.every((value) => isNaN(value))) {
num = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
}
sums[index] = num
}
if (column.property === "volumeWeight") {
let volume = this.calcSum("volume", data);
......@@ -653,6 +663,7 @@ export default {
orderItemIdList: item.boxOrderItemList.map(
(data) => data.orderItemId
),
isCover: 0
};
createGoods(params)
......@@ -785,7 +796,7 @@ export default {
},
/* 获取参数 */
getParams() {
const { rucangtime = [] } = this.queryParams;
let rucangtime = this.queryParams.rucangtime?this.queryParams.rucangtime:[]
return {
...this.queryParams,
...this.$attrs.params,
......
......@@ -1209,11 +1209,11 @@ const constantDict = {
billingMethod: [
{
value: "1",
label: i18n.$t("电放"),
label: i18n.$t("正本"),
},
{
value: "2",
label: i18n.$t("正本"),
label: i18n.$t("电放"),
},
],
// 是否有文件
......
......@@ -72,10 +72,7 @@
<dict-tag :type="DICT_TYPE.CUSTOMER_OPERATE_TYPE" :value="row.operateType"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('操作人')" prop="operator">
<template v-slot="{row}">
{{operatorFn(row.operator)}}
</template>
<el-table-column :label="$t('操作人')" prop="operatorName">
</el-table-column>
<el-table-column :label="$t('操作时间')" prop="operator">
<template v-slot="{row}">
......@@ -119,7 +116,7 @@
<dict-tag :type="DICT_TYPE.CUSTOMER_OPERATE_TYPE" :value="dataLog.operateType"></dict-tag>
</el-form-item>
<el-form-item :label="$t('操作人')+':'">
{{operatorFn(dataLog.operator)}}
{{dataLog.operatorName}}
</el-form-item>
<el-form-item :label="$t('操作时间')+':'">
{{parseTime(dataLog.createTime)}}
......
......@@ -19,6 +19,7 @@
>
<span style="margin-right:20px"><span style="color: #ff4949;">*</span>{{$t('客户')}}</span>
<customer-selector
ref="customer"
v-model="form.customerId"
@change="customerChange"
/>
......@@ -767,8 +768,17 @@ export default {
};
},
activated(){
console.log(11)
// this.getList();
if (this.$route.query.id) {
this.flag = true
this.id = this.$route.query.id;
this.getReceivableData()
}
if (this.$route.query.receiptId && this.$route.query.receiptId != 0) {
this.receiptId = this.$route.query.receiptId;
this.getReceivableInfo()
}else{
this.removeData()
}
},
directives: {
'el-select-loadmore': {
......@@ -812,69 +822,11 @@ export default {
if (that.$route.query.id) {
this.flag = true
this.id = this.$route.query.id;
console.log(this.id)
getReceiptInfoByIds({ id: this.id }).then(res => {
if(res.data.rateValidateDate) res.data.rateValidateDate = dayjs(res.data.rateValidateDate).format('YYYY-MM-DD HH:mm:ss')
this.form = Object.assign({}, this.form, res.data)
})
await getInvoicingItem({ id: this.id }).then(res => {
this.list = [...res.data]
this.list.map(v=>{
if(!v.taxPoint){
v.taxAmount = v.totalAmount
}
})
})
getReceiptAccountList({ id: this.id }).then(res => {
if (res.data.length > 0) {
// totalAmount
res.data = [...res.data, {
type: 'total',
writeOffAmount: res.data.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0),
collectionAmount: []
}]
}
this.$set(this.form, 'receiptAccountList', [...res.data])
this.$nextTick(() => {
// const dollarList = this.list.filter(v => v.currencyId === 1)
// const discountDollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const d = this.form.receiptAccountList.find(v => v.currencyId == 1)
// d && (d.discountTotal = discountDollar)
// const rmbList = this.list.filter(v => v.currencyId === 2)
// const discountRmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const r = this.form.receiptAccountList.find(v => v.currencyId == 2)
// r && (r.discountTotal = discountRmb)
// const nairaList = this.list.filter(v => v.currencyId === 3)
// const discountNaira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const n = this.form.receiptAccountList.find(v => v.currencyId == 3)
// n && (n.discountTotal = discountNaira)
this.form.receiptAccountList.forEach((item, index) => {
this.rateChange(item, index)
});
this.calculation()
})
})
this.getReceivableData()
}
if (that.$route.query.receiptId && that.$route.query.receiptId !== '0') {
this.receiptId = this.$route.query.receiptId;
getReceivableInfoByIds({ id: this.receiptId }).then(res => {
this.list = [{...res.data}]
this.list.map(v=>{
if(!v.taxPoint){
v.taxAmount = v.totalAmount
}
})
this.calculation()
getOrder(res.data.orderId).then(response => {
// console.log(response.data)
if(response.data.customerId) this.$set(this.form,'customerId',response.data.customerId)
})
})
this.getReceivableInfo()
}
// this.getList();
......@@ -961,6 +913,69 @@ export default {
this.pages = (res.data.total/this.codePage.pageSize)+1
})
}, 200)
},
getReceivableData(){
getReceiptInfoByIds({ id: this.id }).then(res => {
if(res.data.rateValidateDate) res.data.rateValidateDate = dayjs(res.data.rateValidateDate).format('YYYY-MM-DD HH:mm:ss')
this.form = Object.assign({}, this.form, res.data)
})
getInvoicingItem({ id: this.id }).then(res => {
this.list = [...res.data]
this.list.map(v=>{
if(!v.taxPoint){
v.taxAmount = v.totalAmount
}
})
})
getReceiptAccountList({ id: this.id }).then(res => {
if (res.data.length > 0) {
// totalAmount
res.data = [...res.data, {
type: 'total',
writeOffAmount: res.data.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0),
collectionAmount: []
}]
}
this.$set(this.form, 'receiptAccountList', [...res.data])
this.$nextTick(() => {
// const dollarList = this.list.filter(v => v.currencyId === 1)
// const discountDollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const d = this.form.receiptAccountList.find(v => v.currencyId == 1)
// d && (d.discountTotal = discountDollar)
// const rmbList = this.list.filter(v => v.currencyId === 2)
// const discountRmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const r = this.form.receiptAccountList.find(v => v.currencyId == 2)
// r && (r.discountTotal = discountRmb)
// const nairaList = this.list.filter(v => v.currencyId === 3)
// const discountNaira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const n = this.form.receiptAccountList.find(v => v.currencyId == 3)
// n && (n.discountTotal = discountNaira)
this.form.receiptAccountList.forEach((item, index) => {
this.rateChange(item, index)
});
this.calculation()
})
})
},
getReceivableInfo(){
getReceivableInfoByIds({ id: this.receiptId }).then(res => {
this.list = [{...res.data}]
this.list.map(v=>{
if(!v.taxPoint){
v.taxAmount = v.totalAmount
}
})
this.calculation()
getOrder(res.data.orderId).then(response => {
// console.log(response.data)
if(response.data.customerId) this.$set(this.form,'customerId',response.data.customerId)
})
})
},
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
......@@ -1210,7 +1225,7 @@ export default {
return NP.divide(this.currencyList.find(v => v.titleEn === 'NGN').huilv, 100).toFixed(6)
},
customerChange(value) {
if (this.flag) {
if (this.flag||!value) {
this.flag = false
return
}
......@@ -1472,12 +1487,26 @@ export default {
const list = [...this.list]
delete list[index]
this.list = list.filter(v => v)
this.calculation()
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.page = 1;
this.getList()
},
//清空数据
removeData(){
console.log(this.form)
this.$refs.customer.reset()
this.list = []
for(var i in this.form){
if(i=='receiptAccountList'){
this.$set(this.form,i,[])
}else{
this.$set(this.form,i,'')
}
}
}
},
};
</script>
......
......@@ -679,8 +679,10 @@ export default {
}
// total = NP.plus(total, item.writeOffAmount)
})
console.log(total);
let portion = NP.divide(total,amountTotal)
console.log(portion);
if(!portion) return 0
return (portion*100).toFixed(2)
}
},
......
......@@ -6,7 +6,7 @@
<div class="offer-header">
<span style="font-size: 15px;">{{$t('报价单号')}}{{list.number}}</span>
<div class="btns">
<el-button v-hasPermi="['ecw:offer:update']" size="mini" type="primary" v-if="list.status!=5" @click="$router.push('edit?id=' + offerId)">{{$t('编辑')}}</el-button>
<el-button v-hasPermi="['ecw:offer:update']" size="mini" type="primary" v-if="[4,5,6].indexOf(list.status) == -1" @click="$router.push('edit?id=' + offerId)">{{$t('编辑')}}</el-button>
<el-button v-hasPermi="['ecw:offer:loglist']" type="primary" v-if="[1,3,7].indexOf(list.status) > -1" size="mini" @click="handleAdd">{{$t('跟进')}}</el-button>
<el-button v-hasPermi="['ecw:offer:result']" type="primary" v-if="[3,7].indexOf(list.status) > -1" size="mini" @click="toResult">{{$t('结果')}}</el-button>
<el-button v-hasPermi="['ecw:offer:discount','ecw:offer:commission']" size="mini" v-if="[1,3,7].indexOf(list.status) > -1" type="primary" @click.native="$router.push('/offer/special?offerId=' + offerId)" >{{$t('特价')}}</el-button>
......
......@@ -91,7 +91,7 @@
<el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table-column :label="$t('箱数')" align="center" prop="sumNum" >
<template v-slot="{row}">
{{row.inWarehouseState > 1 ? row.sumNum : row.totalNum}}
{{row.sumNum > 0 ? row.sumNum : row.totalNum}}
</template>
</el-table-column>
<el-table-column :label="$t('已放箱数')" align="center" prop="sumWeight">
......
......@@ -46,35 +46,51 @@
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="row.brandType" />
</template>
</el-table-column>
<el-table-column :label="$t('体积')">
<el-table-column :label="$t('入仓体积')">
<template slot-scope="{row}">{{row.volume}}</template>
</el-table-column>
<el-table-column :label="$t('重量')">
<el-table-column :label="$t('收费体积')">
<template slot-scope="{row}">{{row.chargeVolume}}</template>
</el-table-column>
<el-table-column :label="$t('入仓重量')">
<template slot-scope="{row}">{{row.weight}}kg</template>
</el-table-column>
<el-table-column :label="$t('收费重量')">
<template slot-scope="{row}">{{row.chargeWeight}}kg</template>
</el-table-column>
<el-table-column :label="$t('箱数')">
<template slot-scope="{row}">{{row.num}}</template>
<template slot-scope="{row}">
<el-button type="text" @click="showWarehouseRecord(row)">{{row.num}}</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('数量')">
<template slot-scope="{row}">{{row.quantity}}</template>
</el-table-column>
<el-table-column :label="$t('货值')">
<template slot-scope="{row}">{{row.worth}}{{$t('')}}</template>
</el-table-column>
</el-table>
</template>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body @close="currentWarehouseRecord=null"></warehouse-record>
</div>
</template>
<script>
import {getOrder} from '@/api/ecw/order'
import {getBoxApproval} from '@/api/ecw/box'
import {getChannel} from '@/api/ecw/channel'
import WarehouseRecord from "@/views/ecw/order/splitApply/components/WarehouseRecord";
export default {
props:{
components: {WarehouseRecord},
props:{
id: [String, Number]
},
data(){
return {
detail: null,
order: null,
channel: null
channel: null,
// 查看入仓记录的条目
currentWarehouseRecord: null
}
},
watch:{
......@@ -110,6 +126,12 @@ export default {
getChannel(this.order.channelId).then(res => {
this.channel = res.data
})
},
showWarehouseRecord(row){
if(!row.specsRecordVOList){
return this.$message.info(this.$t('暂无入仓记录'))
}
this.currentWarehouseRecord = row.specsRecordVOList
}
}
}
......@@ -122,4 +144,4 @@ export default {
font-weight: bold;
}
}
</style>
\ No newline at end of file
</style>
......@@ -37,7 +37,8 @@
{{detail.marks}}
</td>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;">
{{item.prodTitleZh}}<br/>{{item.prodTitleEn}}
<div style="white-space: nowrap">{{item.prodTitleZh}}</div>
<div style="white-space: nowrap">{{item.prodTitleEn}}</div>
</td>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;">
{{item.cartonsNum}}
......
......@@ -46,31 +46,45 @@
<dict-tag v-else :type="DICT_TYPE.ECW_IS_BRAND" :value="row.feeType" />
</template>
</el-table-column>
<el-table-column :label="$t('体积')">
<template slot-scope="{row}">{{row.volume}}</template>
</el-table-column>
<el-table-column :label="$t('重量')">
<template slot-scope="{row}">{{row.weight}}kg</template>
</el-table-column>
<el-table-column :label="$t('箱数')">
<template slot-scope="{row}">{{row.num}}</template>
</el-table-column>
<el-table-column :label="$t('数量')">
<template slot-scope="{row}">{{row.quantity}}</template>
</el-table-column>
<el-table-column :label="$t('备注')">
<template slot-scope="{row}">{{row.remark}}</template>
</el-table-column>
<el-table-column :label="$t('入仓体积')">
<template slot-scope="{row}">{{row.volume}}</template>
</el-table-column>
<el-table-column :label="$t('收费体积')">
<template slot-scope="{row}">{{row.chargeVolume}}</template>
</el-table-column>
<el-table-column :label="$t('入仓重量')">
<template slot-scope="{row}">{{row.weight}}kg</template>
</el-table-column>
<el-table-column :label="$t('收费重量')">
<template slot-scope="{row}">{{row.chargeWeight}}kg</template>
</el-table-column>
<el-table-column :label="$t('箱数')">
<template slot-scope="{row}">
<el-button type="text" @click="showWarehouseRecord(row)">{{row.num}}</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('数量')">
<template slot-scope="{row}">{{row.quantity}}</template>
</el-table-column>
<el-table-column :label="$t('货值')">
<template slot-scope="{row}">{{row.worth}}{{$t('')}}</template>
</el-table-column>
<el-table-column :label="$t('备注')">
<template slot-scope="{row}">{{row.remark}}</template>
</el-table-column>
</el-table>
</template>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body @close="currentWarehouseRecord=null"></warehouse-record>
</div>
</template>
<script>
import {getApproval, getOrder} from '@/api/ecw/order'
import {getChannel} from '@/api/ecw/channel'
import {getSplitList} from '@/api/ecw/orderHandle'
import WarehouseRecord from "@/views/ecw/order/splitApply/components/WarehouseRecord";
export default {
props:{
components: {WarehouseRecord},
props:{
id: [String, Number]
},
data(){
......@@ -78,7 +92,9 @@ export default {
detail: null,
order: null,
channel: null,
orderSplitBackVOList: []
// orderSplitBackVOList: [],
// 查看入仓记录的条目
currentWarehouseRecord: null
}
},
watch:{
......@@ -86,7 +102,7 @@ export default {
this.getData()
},
detail(){
this.getSplit()
// this.getSplit()
this.getOrder()
},
order(){
......@@ -95,6 +111,11 @@ export default {
}
}
},
computed:{
orderSplitBackVOList(){
return this.detail ? this.detail.orderSplitBackVOList : []
}
},
created(){
if(this.id){
this.getData()
......@@ -106,12 +127,12 @@ export default {
this.detail = JSON.parse(res.data.details)
})
},
getSplit(){
/*getSplit(){
getSplitList({orderId: this.detail.orderId, lang: this.$i18n.locale.toLowerCase().indexOf('zh') > -1 ? 0 : 1 }).then(res => {
console.log('getSplitList', res)
this.orderSplitBackVOList = res.data.orderSplitBackVOList
})
},
},*/
getOrder(){
getOrder(this.detail.orderId).then(res => {
this.order = res.data
......@@ -121,7 +142,13 @@ export default {
getChannel(this.order.channelId).then(res => {
this.channel = res.data
})
},
showWarehouseRecord(row){
if(!row.specsRecordVOList){
return this.$message.info(this.$t('暂无入仓记录'))
}
this.currentWarehouseRecord = row.specsRecordVOList
}
}
}
</script>
......@@ -133,4 +160,4 @@ export default {
font-weight: bold;
}
}
</style>
\ No newline at end of file
</style>
......@@ -138,7 +138,8 @@ export default {
getReleaseInfo(this.orderId).then(res => this.detail = res.data)
seasoningCondimentsSelect({orderId: this.orderId}).then(res => {
res.data.forEach(item => {
item.releaseNum = item.sumNum - item.releaseNum
item.release = item.releaseNum
item.releaseNum = item.sumNum - item.release
})
this.orders = res.data
})
......@@ -155,7 +156,7 @@ export default {
// 放货箱数不能大于可放货箱数
let errNos = []
this.selectedOrders.forEach(item => {
if(item.releaseNum > item.sumNum - item.releaseNum){
if(item.releaseNum > item.sumNum - item.release){
errNos.push(item.orderNo)
}
})
......@@ -172,7 +173,7 @@ export default {
this.$emit('success')
})
})
}
}
......@@ -192,4 +193,4 @@ export default {
margin-right:10px;
}
}
</style>
\ No newline at end of file
</style>
......@@ -497,7 +497,7 @@
<work-flow xmlkey="order_modify" v-model="ccIdArr" />
</el-card>
<el-form label="" style="margin: 30px 0">
<el-form-item label="" style="margin: 30px 0">
<template v-if="form.applyStatus == 1">
<el-button type="primary" @click="$router.push('/bpm/process-instance/detail?id=' + form.formId)">{{$t('审核中')}}</el-button>
</template>
......
......@@ -326,7 +326,6 @@
</el-form-item>
</el-col>
</el-row>
<el-row :span="12" v-if="orderExceptionData.orderExceptionType=='order_doc_exception'">
<el-form-item v-if="orderExceptionData.orderExceptionStatus!=2" :label="$t('报关资料')+':'" size="medium" :require="true">
<file-upload v-model="handlerParams.fileList" :value="orderExceptionData.orderExceptionAttr" ></file-upload>
......@@ -873,6 +872,7 @@
this.selectLine = this.routerList.find(item => item.id == this.handlerParams.lineId)
},
// getDictData,
getDictData,
onTableMounted(e){
// console.warn('onTableMounted', e)
},
......
<template>
<!-- 放入弹层 -->
<el-dialog :title="$t('入仓记录放入确认')" :visible="show" :before-close="closeDialog" :close-on-click-modal="false" width="1500px" :append-to-body="appendToBody">
<el-card>
<div slot="header">{{$t('可拆出入仓记录')}}</div>
<el-table :data="[warehouseRecord]">
<el-table-column :label="$t('箱数')" prop="cartonsNum">
<template slot-scope="{row}">{{Math.min(row.cartonsNum, maxNum)}}</template>
</el-table-column>
<el-table-column :label="$t('入仓类型')" prop="specificationType">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" :value="row.specificationType" />
</template>
</el-table-column>
<el-table-column :label="$t('包装类型')" prop="unit">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" :value="row.unit" />
</template>
</el-table-column>
<el-table-column :label="$t('长')" prop="boxGauge">
<template slot-scope="{row}">
{{row.boxGauge.split('*')[0]}}
</template>
</el-table-column>
<el-table-column :label="$t('宽')" prop="boxGauge" >
<template slot-scope="{row}">
{{row.boxGauge.split('*')[1]}}
</template>
</el-table-column>
<el-table-column :label="$t('高')" prop="boxGauge" >
<template slot-scope="{row}">
{{row.boxGauge.split('*')[2]}}
</template>
</el-table-column>
<el-table-column :label="$t('体积') + '(m³)'" prop="volume" />
<el-table-column :label="$t('重量') + '(kg)'" prop="weight" />
<el-table-column :label="$t('数量(个)')" prop="quantityAll" />
<el-table-column :label="$t('入仓快递单号')" prop="expressNo" />
<el-table-column :label="$t('首次入仓时间')" prop="inTime" >
<template slot-scope="{row}">{{row.inTime|parseTime}}</template>
</el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList" >
<template slot-scope="{row}">
{{getLocationName(row.orderLocationBackVOList)}}
</template>
</el-table-column>
</el-table>
<div>
{{$t('可拆')}}:
{{maxSplitNum}}{{$t('箱')}},
{{$t('体积')}}:{{leftData('volume')}}{{$t('m³')}},
{{$t('重量')}}:{{leftData('weight')}}{{$t('kg')}},
{{$t('数量')}}:{{leftData('quantity')}}{{$t('个')}}
</div>
</el-card>
<el-card class="box-card mt-10">
<div slot="header" class="clearfix">
<span>{{ $t('新入仓记录') }}</span>
<el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="deleteRow" :disabled="form.list.length <= 1"></el-button>
<el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="addRow"></el-button>
</div>
<el-form ref="form" :model="form" label-width="100px" size="mini">
<el-table
:data="form.list"
style="width: 100%">
<el-table-column :label="$t('箱数')" width="200px">
<template v-slot:header>
<span style="color: red">*</span>{{ $t('箱数') }}
</template>
<template v-slot="{row,$index}">
<el-form-item class="flex" label-width="0"
:prop="`list.${$index}.num`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<!--需求方要求输入后马上计算其他数据,el组件无法绑定keyup事件,所以用原生的input-->
<!--<el-input-number controls-position="right" :min="0" class="w-75 tight" v-model="row.num" :max="warehouseRecord.cartonsNum" @keyup.native="calc(row)"></el-input-number>-->
<input class="input" v-model="row.num" type="number" @keyup="calc(row)" @change="calc(row)" :min="1" :max="maxSplitNum"></input>
<dict-selector class="w-75" :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType" defaultable></dict-selector>
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('包装类型')" width="100px">
<template v-slot:header>
<span style="color: red">*</span>{{ $t('包装类型') }}
</template>
<template v-slot="{row,$index}">
<el-form-item label-width="0">
<dict-selector :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="row.unit" defaultable></dict-selector>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="长(cm)">
<template v-slot:header>
<span>{{ $t('') }}</span>(cm)
</template>
<template v-slot="{row,$index}">
<el-form-item label-width="0">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge1" @blur="calcVolume(row)"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="宽(cm)">
<template v-slot:header>
<span>{{ $t('') }}</span>(cm)
</template>
<template v-slot="{row,$index}">
<el-form-item label-width="0">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge2" @blur="calcVolume(row)" />
</el-form-item>
</template>
</el-table-column>
<el-table-column label="高(cm)">
<template v-slot:header>
<span>{{ $t('') }}</span>(cm)
</template>
<template v-slot="{row,$index}">
<el-form-item label-width="0">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge3" @blur="calcVolume(row)"/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="入仓体积(m³)">
<template v-slot:header>
<span style="color: red">*</span> <span>{{ $t('体积') }}</span>(m³)
</template>
<template v-slot="{row,$index}">
<el-form-item label-width="0"
:prop="`list.${$index}.volume`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0.01" :max="warehouseRecord.volume" class="w-100 tight" v-model="row.volume"/>
</el-form-item>
</template>
</el-table-column>
<!--<el-table-column label="收费体积(m³)">
<template v-slot:header>
<span style="color: red">*</span> <span>{{ $t('收费体积') }}</span>(m³)
</template>
<template v-slot="{row,$index}">
<el-form-item label-width="0"
:prop="`list.${$index}.chargeVolume`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.chargeVolume"/>
</el-form-item>
</template>
</el-table-column>-->
<el-table-column label="入仓重量(Kg)">
<template v-slot:header>
<span style="color: red">*</span> <span>{{ $t('入仓重量') }}</span>(Kg)
</template>
<template v-slot="{row,$index}">
<el-form-item label-width="0"
:prop="`list.${$index}.weight`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0.01" :max="warehouseRecord.weight" class="w-75 tight" v-model="row.weight"/>
</el-form-item>
</template>
</el-table-column>
<!--<el-table-column label="收费重量(Kg)">
<template v-slot:header>
<span style="color: red">*</span> <span>{{ $t('收费重量') }}</span>(Kg)
</template>
<template v-slot="{row,$index}">
<el-form-item label-width="0"
:prop="`list.${$index}.chargeWeight`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-75 tight" v-model="row.chargeWeight" type="number"/>
</el-form-item>
</template>
</el-table-column>-->
<el-table-column :label="$t('数量')" width="130px">
<template v-slot="{row,$index}">
<el-form-item label-width="0"
:prop="`list.${$index}.quantity`"
:rules="{required: false, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" :max="warehouseRecord.quantityAll > 0 ? warehouseRecord.quantityAll : null" class="w-75 tight" v-model.number="row.quantity" />{{ $t('') }}
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('快递单号')">
<template v-slot="{row,$index}">
<el-form-item label-width="0">
<el-input v-model="row.expressNo"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template v-slot="{ row, column, $index }">
<!--<el-button type="primary" size="mini" @click="showLocation(row, $index)">{{ $t('选择储位') }}</el-button>-->
<warehouse-area-select
v-model="row.orderLocationList"
:warehouse-id="warehouseId"
></warehouse-area-select>
</template>
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}">
<el-popconfirm
v-if="$index > 0"
:title="$t('确定要删除该行入仓记录吗?')"
@confirm="deleteRow($index)"
>
<template v-slot:reference>
<el-button size="mini" type="danger">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
</el-form>
</el-card>
<div slot="footer">
<el-button type="primary" @click="submit">{{ $t('确定') }}</el-button>
</div>
</el-dialog>
</template>
<script>
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect/index.vue";
import {parseTime} from '@/utils/ruoyi'
import Decimal from 'decimal.js'
import Template from "@/views/cms/template/index.vue";
export default {
name: "Putin",
filters:{parseTime},
components: {Template, WarehouseAreaSelect},
props:{
warehouseRecord:Object,
appendToBody: Boolean,
// 仓库ID,选择储位要用到
warehouseId: Number,
// 数量是否必须
quantityshow: Boolean,
// 最大可拆箱数,装柜拆单用
maxNum: Number,
},
data(){
return {
show: false,
// 拆出的入仓记录
form:{
list:[]
}
}
},
computed:{
// 计算当前添加的多条入仓记录总拆出数据
splitTotal(){
return field => {
let total = new Decimal(0)
this.form.list.forEach(item => {
total = total.plus(new Decimal(item[field] || 0))
})
return total.toNumber()
}
},
// 计算此入仓记录全部拆出的数量,包含其他拆单订单的
totalSplitSum(){
return field => {
let total = new Decimal(0)
if(this.warehouseRecord.specsRecordVOList && this.warehouseRecord.specsRecordVOList.length){
this.warehouseRecord.specsRecordVOList.forEach(item => {
total = total.plus(new Decimal(item[field] || 0))
})
}
return total.plus(new Decimal(this.splitTotal('num'))).toNumber()
}
},
// 剩余数据
leftData(){
return (field, containNew = false) => {
// 入仓记录跟拆单记录的箱数字段不同,要做特殊处理
let warehouseField = field
if(field == 'num') warehouseField = 'cartonsNum'
if(field == 'quantity') warehouseField = 'quantityAll'
let left = new Decimal(this.warehouseRecord[warehouseField] || 0)
// 累减已拆记录
if(this.warehouseRecord.specsRecordVOList && this.warehouseRecord.specsRecordVOList.length){
this.warehouseRecord.specsRecordVOList.forEach(item => {
left = left.minus(new Decimal(item[field] || 0))
})
}
// 如果是包含新数据(本次放入数据)
if(containNew){
// 累减本页添加的入仓记录
this.form.list.forEach(item => {
left = left.minus(new Decimal(item[field] || 0))
})
}
return left.toNumber()
}
},
// 可拆箱数
maxSplitNum(){
return Math.min(this.maxNum, this.leftData('num'))
}
},
mounted() {
this.show = true
this.$nextTick(this.addRow)
},
methods:{
// 添加一行
addRow(){
let { specificationType, boxGauge1, boxGauge2, boxGauge3, expressNo, unit } = this.warehouseRecord
let num = Math.min(this.leftData('num', true), this.maxSplitNum)
let orderLocationList = this.warehouseRecord.orderLocationBackVOList
if(this.form.list.length){
orderLocationList = this.form.list[this.form.list.length - 1].orderLocationList
}
// 根据入仓记录添加一行
let row = {
warehouseInId: this.warehouseRecord.id,
specificationType, boxGauge1, boxGauge2, boxGauge3, expressNo,unit,
volume: 0,
weight: 0,
num: num,
quantity: 0,
orderLocationList
}
// 如果拆完了则剩下的全部放入,否则按照比例计算
this.$nextTick(() =>{
if(this.leftData('num', true) <= 0 ) {
row.volume = this.leftData('volume', true)
row.weight = this.leftData('weight', true)
row.quantity = this.leftData('quantity', true)
}else{
// 按照比例计算重量体积和数量
this.calc(row)
}
})
this.form.list.push(row)
},
// 删除一行,可选参数index表上行号,参数不是数字则删除最后一行
deleteRow(index){
const spliceIndex = typeof index !== 'number' ? this.list - 1 : index
this.form.list.splice(spliceIndex, 1)
},
// 计算体积
calcVolume(row){
let volume = Decimal(row.boxGauge1 || 0)
.times(Decimal(row.boxGauge2 || 0))
.times(Decimal(row.boxGauge3 || 0)).div(1000000)
// 如果是箱的单位要乘以箱数
if(row.specificationType === 1) {
row.volume = volume.times(Decimal(row.num || 0))
}
// 最低0.01
volume = Math.max(0.01, volume.toNumber().toFixed(2))
this.$set(row, 'volume', volume)
},
// 获取储位名称
getLocationName(locationArr){
if(!locationArr || !locationArr.length) return ''
let arr = []
locationArr.forEach(item => {
arr.push(`${item.areaName}${item.locationName || ''}`)
})
return Array.from(new Set(arr)).join(",")
},
// 根据箱数计算体积,重量,数量
calc(row){
const rate = row.num / this.warehouseRecord.cartonsNum
row.volume = (this.warehouseRecord.volume * rate).toFixed(2)
row.weight = (this.warehouseRecord.weight * rate).toFixed(2)
row.quantity = (this.warehouseRecord.quantityAll * rate).toFixed(0)
},
closeDialog(){
this.show = false
this.$emit('close');
},
submit(){
this.$refs.form.validate(valid => {
if(!valid){
return false
}
if(this.splitTotal('num') > this.maxSplitNum){
return this.$message.error("拆出箱数不能大于可拆箱数")
}
if(this.splitTotal('volume') > this.leftData('volume')){
return this.$message.error("拆出体积不能大于剩余体积")
}
if(this.splitTotal('weight') > this.leftData('weight')){
return this.$message.error("拆出重量不能大于剩余重量")
}
// 如果全拆(拆出箱数 == 原入仓箱数),则体积重量也需要全拆
if(this.splitTotal('num') === this.warehouseRecord.cartonsNum){
if(this.splitTotal('volume') !== this.warehouseRecord.volume){
return this.$message.error("全拆拆出体积必须等于原入仓体积")
}
if(this.splitTotal('weight') !== this.warehouseRecord.weight){
return this.$message.error("全拆拆出重量必须等于原入仓体积")
}
}
this.$emit('submit', this.form.list)
})
}
}
}
</script>
<style scoped>
.input{
border: 1px solid #DCDFE6;
padding: 5px 6px;
border-radius: 5px;
}
</style>
<template>
<!-- 拆单入仓记录 -->
<el-dialog :title="$t('入仓记录')" :visible="show" :before-close="closeDialog" :close-on-click-modal="false" width="1000px" :append-to-body="appendToBody">
<el-table :data="list">
<el-table-column type="index" :label="$t('序号')" />
<el-table-column :label="$t('箱数')" prop="num" />
<el-table-column :label="$t('入仓类型')" prop="specificationType">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" :value="row.specificationType" />
</template>
</el-table-column>
<el-table-column :label="$t('包装类型')" prop="unit">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" :value="row.unit" />
</template>
</el-table-column>
<el-table-column :label="$t('长')" prop="boxGauge">
<template slot-scope="{row}">
{{row.boxGauge.split('*')[0]}}
</template>
</el-table-column>
<el-table-column :label="$t('宽')" prop="boxGauge" >
<template slot-scope="{row}">
{{row.boxGauge.split('*')[1]}}
</template>
</el-table-column>
<el-table-column :label="$t('高')" prop="boxGauge" >
<template slot-scope="{row}">
{{row.boxGauge.split('*')[2]}}
</template>
</el-table-column>
<el-table-column :label="$t('体积') + '(m³)'" prop="volume" />
<el-table-column :label="$t('重量') + '(kg)'" prop="weight" />
<el-table-column :label="$t('数量(个)')" prop="quantity" />
<el-table-column :label="$t('入仓快递单号')" prop="expressNo" />
<!--<el-table-column :label="$t('首次入仓时间')" prop="inTime" >
<template slot-scope="{row}">{{row.inTime|parseTime}}</template>
</el-table-column>-->
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList" >
<template slot-scope="{row}">
<!--{{getLocationName(row.orderLocationList)}}-->
<warehouse-area-select
v-model="row.orderLocationList"
readonly
:warehouse-id="warehouseId"
></warehouse-area-select>
</template>
</el-table-column>
</el-table>
</el-dialog>
</template>
<script>
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect/index.vue";
export default {
name: "WarehouseRecord",
components: {WarehouseAreaSelect},
props:{
list:{
type: Array,
default: []
},
warehouseId: Number,
appendToBody: Boolean
},
data(){
return {
show: false
}
},
mounted() {
this.show = true
},
methods:{
// 获取储位名称
getLocationName(locationArr){
if(!locationArr || !locationArr.length) return ''
let arr = []
locationArr.forEach(item => {
arr.push(`${item.areaName}${item.locationName || ''}`)
})
return Array.from(new Set(arr)).join(",")
},
closeDialog(){
this.show = false
this.$emit('close');
},
}
}
</script>
<style scoped>
</style>
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-card>
<div slot="header" class="card-title">{{$t('拆单申请')}}-{{orderData.orderNo||''}}</div>
<div class="btn-header">
<span class="card-title">{{$t('原单信息')}}</span>
</div>
<el-descriptions :column="4">
<el-descriptions-item :label="$t('唛头')">
{{orderData.marks?orderData.marks:$t('')}}
</el-descriptions-item>
<el-descriptions-item :label="$t('已到箱数/总箱数')">
<span>{{orderData.sumNum||0}}/{{orderData.costVO?orderData.costVO.totalNum:0}}</span>
</el-descriptions-item>
<el-descriptions-item :label="$t('订单状态')">
<!-- <dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="orderData.status" /> -->
{{orderData.abnormalState!=0?$t('异常'):$t('正常')}}
</el-descriptions-item>
<el-descriptions-item :label="$t('送货日期')">
{{orderData.deliveryDate||$t('')}}
</el-descriptions-item>
<el-descriptions-item :label="$t('运输方式')">
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="orderData.transportId" />
</el-descriptions-item>
<el-descriptions-item :label="$t('始发地')" >
<template v-if="orderData.logisticsInfoDto">
{{$l(orderData.logisticsInfoDto, 'startTitle')}}
</template>
<template v-else>{{$t('')}}</template>
</el-descriptions-item>
<el-descriptions-item :label="$t('目的地')" :span="2">
<template v-if="orderData.logisticsInfoDto">
{{$l(orderData.logisticsInfoDto, 'destTitle')}}
</template>
<template v-else>{{$t('')}}</template>
</el-descriptions-item>
<el-descriptions-item :label="$t('发货人姓名')">
{{orderData.consignorVO?orderData.consignorVO.name||$t('无'):$t('无')}}
</el-descriptions-item>
<el-descriptions-item :label="$t('发货公司')">
{{orderData.consignorVO?orderData.consignorVO.company||$t('无'):$t('无')}}
</el-descriptions-item>
<el-descriptions-item :label="$t('发货电话')">
{{!orderData.consignorVO?$t('无'):!orderData.consignorVO.phone?$t('无'):(checkCode(orderData.consignorVO.countryCode)+orderData.consignorVO.phone)}}
</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="4">
<el-descriptions-item :label="$t('收货人姓名')">
{{orderData.consigneeVO?orderData.consigneeVO.name||$t('无'):$t('无')}}
</el-descriptions-item>
<el-descriptions-item :label="$t('收货公司')">
{{orderData.consigneeVO?orderData.consigneeVO.company||$t('无'):$t('无')}}
</el-descriptions-item>
<el-descriptions-item :label="$t('收货电话')">
{{!orderData.consigneeVO?$t('无'):!orderData.consigneeVO.phone?$t('无'):(checkCode(orderData.consigneeVO.countryCode)+orderData.consigneeVO.phone)}}
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="card">
<!-- 列表 -->
<div slot="header" class="card-title">{{$t('货物信息')}}</div>
<el-table id='table' v-loading="loading" border :data="orderData.orderItemVOList" :summary-method="getSummaries" show-summary>
<el-table-column :label="$t('序号')" align="center" prop="id" type="index" width="60">
<template slot-scope="scope" >
<span>{{scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column :label="$t('品名')" align="center">
<template slot-scope="scope">
<el-row>{{scope.row.prodTitleEn}}</el-row>
<el-row>{{scope.row.prodTitleZh}}</el-row>
</template>
</el-table-column>
<el-table-column :label="$t('填单货物属性')" align="center" width="200">
<template slot-scope="scope">
<el-row>
<span>{{$t('品牌')}}
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.brandType" />
</span>
</el-row>
<el-row>
<span>{{$t('箱数')}}{{scope.row.num||$t('未填')}}</span>
</el-row>
<el-row>
<span>{{$t('体积')}}{{scope.row.volume||$t('未填')}}</span>
</el-row>
<el-row>
<span>{{$t('重量')}}{{scope.row.weight||$t('未填')}}kg</span>
</el-row>
</template>
</el-table-column>
<el-table-column :label="$t('入库货物属性')" align="center" width="400">
<template slot-scope="scope">
<el-row v-if="scope.row.warehouseInInfoVO">
<span>{{$t('规格')}}{{scope.row.warehouseInInfoVO?scope.row.warehouseInInfoVO.boxGauge:0}}</span>
</el-row>
<el-row v-if="scope.row.warehouseInInfoVO">
<span>{{$t('品牌')}}
<template v-if="scope.row.brandName">{{scope.row.brandName}}</template>
<dict-tag v-else :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.feeType" />
</span>
<span style="margin-left: 10px;">{{$t('箱数')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.cartonsNum}}</span>
<span style="margin-left: 10px;">{{$t('体积')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.volume}}m³</span>
<span style="margin-left: 10px;">{{$t('重量')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.weight}}kg</span>
<span style="margin-left: 10px;">{{$t('数量(个)')}}:{{!scope.row.warehouseInInfoVO?0:scope.row.warehouseInInfoVO.quantityAll}}</span>
</el-row>
<el-row v-if="!scope.row.warehouseInInfoVO">
<span>{{$t('暂时没有入仓信息')}}</span>
</el-row>
</template>
</el-table-column>
<el-table-column :label="$t('最后操作时间')" align="center">
<template slot-scope="scope">
<span>{{parseTime(scope.row.updateTime)}}</span>
</template>
</el-table-column>
<el-table-column :label="$t('状态')" align="center">
<template slot-scope="scope">
<!-- {{orderData.abnormalState!=0?$t('异常'):$t('正常')}} -->
<dict-tag :type="DICT_TYPE.ORDER_ITEM_STATUS" :value="scope.row.itemStatus" />
</template>
</el-table-column>
</el-table>
</el-card>
<el-card class="card">
<!-- 列表 -->
<div slot="header" class="card-title flex">
<div style="flex: 1; display: flex; align-items: center">{{$t('拆单信息')}}</div>
<div>
<span v-if="orderData.abnormalState!=0" class="red">{{$t('异常无法拆单')}}</span>
<el-button v-else type="primary" @click="addSplit" :disabled="orderData.inWarehouseState==207">{{$t('新建拆单')}} </el-button>
</div>
</div>
<template v-if="splitData.length>0">
<div v-for="(item, index) in splitData" :key="index">
<div class="btn-header">
<div>
<p class="card-info">
<span class="card-title">
{{item.orderNo}}
</span>
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="item.transportId" />
<span>{{$t('发往')}}{{importCityName(item.dstWarehouseId)}}</span>
</p>
</div>
<div>
<el-button type="primary" @click="addShop(index)">{{$t('放入')}}</el-button>
<el-button :disabled="index < splitData.length - 1" type="primary" plain @click="deleteSplit(item.id)">{{$t('删除')}}</el-button>
</div>
</div>
<el-table v-if="item.orderSplitItemBackVOList" border :data="item.orderSplitItemBackVOList">
<el-table-column :label="$t('序号')" align="center" prop="id" type="index">
<template slot-scope="scope">
<span>{{scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column :label="$t('中文名')" align="center" prop="prodTitleZh" />
<el-table-column :label="$t('英文名')" align="center" prop="prodTitleEn" />
<el-table-column :label="$t('品牌')" align="center">
<template slot-scope="scope">
<template v-if="scope.row.brandName">{{scope.row.brandName}}</template>
<dict-tag v-else :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.feeType" />
</template>
</el-table-column>
<el-table-column :label="$t('入仓体积')" align="center" >
<template slot-scope="scope">
{{scope.row.volume}}
</template>
</el-table-column>
<el-table-column :label="$t('收费体积')" align="center" >
<template slot-scope="scope">
<el-input v-model="scope.row.chargeVolume" @change="updateField(scope.row, 'chargeVolume')" size="mini" disabled>
<span slot="append"></span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('入仓重量')" align="center">
<template slot-scope="scope">
{{scope.row.weight}}kg
</template>
</el-table-column>
<el-table-column :label="$t('收费重量')" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.chargeWeight" @change="updateField(scope.row, 'chargeWeight')" size="mini" disabled>
<span slot="append">kg</span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('货值')" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.worth" @change="updateField(scope.row, 'worth')" size="mini" disabled>
<span slot="append">{{ $t('') }}</span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="num">
<template slot-scope="scope">
<el-button type="text" @click="currentWarehouseRecord=scope.row.specsRecordVOList">
{{ scope.row.num }}
</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('数量(个)')" align="center" prop="quantity"></el-table-column>
<el-table-column :label="$t('操作')" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-delete" @click="removeShop(scope.row.id)">{{$t('移出')}}</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<el-empty v-else></el-empty>
</el-card>
<work-flow xmlkey="split_order" v-model="selectedUsers"></work-flow>
<div slot="footer" class="card footer_btn" v-if="orderData.abnormalState==0">
<template v-if="orderData.inWarehouseState!=207">
<el-button type="primary" @click="submitForm">{{$t('提交申请')}}</el-button>
<el-button plain type="primary" @click="cancel">{{$t('取消')}}</el-button>
<el-button type="primary" @click="reset">{{$t('重置')}}</el-button>
</template>
<template v-else>
<el-button type="primary" @click="$router.push(`/bpm/process-instance/detail?id=`+orderApprovalBackVO.applyingFormId)">{{$t('审核中')}}</el-button>
<el-button plain type="primary" @click="dialogVisible = true">{{$t('取消审核')}}</el-button>
<el-button plain type="primary" @click="$store.dispatch('tagsView/delCurrentView')">{{$t('返回')}}</el-button>
</template>
</div>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="$t('新建拆单')" :visible.sync="open" width="400px" append-to-body>
<el-form ref="formSplit" :model="form" :rules="rules" label-width="80px">
<el-form-item :label="$t('运输方式')">
<dict-selector :clearable="true" :type="DICT_TYPE.ECW_TRANSPORT_TYPE" @change="changeTransport" v-model="form.transportId" />
</el-form-item>
<el-form-item :label="$t('出货渠道')" v-if="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass == 'channel'">
<el-select v-model="form.channelId" :placeholder="$t('请选择出货渠道')" :clearable="true">
<el-option :disabled="getDictData(DICT_TYPE.ECW_TRANSPORT_TYPE, form.transportId).cssClass != 'channel'" v-for="item in channelData" :key="item.channelId" :label="$l(item, 'name')" :value="item.channelId"/>
</el-select>
</el-form-item>
<el-form-item :label="$t('目的仓库')" >
<el-select v-model="form.destWarehouseId" @change="changeDeatWarehouseId" :placeholder="$t('请选择目的仓库')" :clearable="true">
<el-option v-for="items in importCityList" :label="$l(items, 'title')" :value="items.id" :key="items.id" ></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="haddleAdd">{{$t('确定')}}</el-button>
<el-button @click="cancel">{{$t('取消')}}</el-button>
</div>
</el-dialog>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="$t('放入品名')" :visible.sync="shopOpen" width="1500px" append-to-body>
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="120px" inline>
<el-form-item :label="$t('中文品名')">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择中文品名')">
<el-option v-for="item in orderData.orderItemVOList" :label="item.prodTitleZh" :value="item.orderItemId" :key="item.prodTitleZh" ></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('英文品名')">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择英文品名')">
<el-option v-for="item in orderData.orderItemVOList" :label="item.prodTitleEn" :value="item.orderItemId" :key="item.prodTitleEn" ></el-option>
</el-select>
</el-form-item>
<el-card>
<div slot="header" class="page-title">{{$t('品名可拆数据')}}</div>
<div class="pl-20">
<span class="mr-10">{{$t('箱数')}}:{{ leftData.num || 0 }}</span>
<span class="mr-10">{{ $t('入仓方数') }}:{{ leftData.volume || 0 }}m³</span>
<span class="mr-10">{{ $t('收费方数') }}:{{ leftData.chargeVolume || 0 }}m³</span>
<span class="mr-10">{{ $t('入仓重量') }}:{{ leftData.weight || 0 }}kg</span>
<span class="mr-10">{{ $t('收费重量') }}:{{ leftData.chargeWeight || 0 }}kg</span>
<span class="mr-10">{{ $t('数量(个)') }}:{{ leftData.quantity || 0 }}</span>
<span class="mr-10">{{ $t('剩余货值') }}:{{ leftData.worth || 0 }}{{ $t('元') }}</span>
</div>
</el-card>
<el-card class="mt-10">
<div slot="header" class="page-title">{{$t('可拆入仓记录')}}</div>
<el-table
:data="getOrderItemWarehouseIn(shopForm.orderItemId)"
style="width: 100%">
<el-table-column :label="$t('箱数')">
<template v-slot="{row,$index}">
<!--{{row.cartonsNum}}-->
{{getWarehouseLeftData(row, 'num')}}
<dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('包装类型')">
<template v-slot="{row,$index}">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="row.unit"></dict-tag>
</template>
</el-table-column>
<el-table-column label="长(cm)">
<template v-slot="{row,$index}">
{{row.boxGauge1}}
</template>
</el-table-column>
<el-table-column label="宽(cm)">
<template v-slot="{row,$index}">
{{ row.boxGauge2 }}
</template>
</el-table-column>
<el-table-column label="高(cm)">
<template v-slot="{row,$index}">
{{ row.boxGauge3 }}
</template>
</el-table-column>
<el-table-column label="入仓体积(m³)">
<template v-slot="{row,$index}">
{{getWarehouseLeftData(row, 'volume')}}
</template>
</el-table-column>
<el-table-column label="入仓重量(Kg)" prop="weight">
<template v-slot="{row,$index}">
{{getWarehouseLeftData(row, 'weight')}}
</template>
</el-table-column>
<el-table-column :label="$t('数量')" prop="quantity">
<template v-slot="{row,$index}">
{{getWarehouseLeftData(row, 'quantity')}}
</template>
</el-table-column>
<el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template v-slot="{ row, column, $index }">
{{getLocationName(row.orderLocationBackVOList)}}
</template>
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}">
<el-tag v-if="getWarehouseInSplitData(row.id,'num') >= row.cartonsNum" disabled size="mini" type="primary" >{{$t('已拆完')}}</el-tag>
<el-button v-else size="mini" type="primary" @click="putInRecord(row)">放入</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card class="mt-10">
<div slot="header" class="flex-between mt-20 mb-10">
<div class="page-title" style="margin: 0">
{{$t('已放入入仓记录')}}
</div>
<el-button type="danger" size="mini" @click="clearAll">清空放入数据</el-button>
</div>
<el-table
:data="shopForm.specsRecordVOList"
style="width: 100%">
<el-table-column :label="$t('箱数')" width="200px">
<template v-slot="{row,$index}">
{{row.num}}
<dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('包装类型')" width="100px">
<template v-slot="{row,$index}">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="row.unit"></dict-tag>
</template>
</el-table-column>
<el-table-column label="长(cm)">
<template v-slot="{row,$index}">
{{row.boxGauge1}}
</template>
</el-table-column>
<el-table-column label="宽(cm)">
<template v-slot="{row,$index}">
{{ row.boxGauge2 }}
</template>
</el-table-column>
<el-table-column label="高(cm)">
<template v-slot="{row,$index}">
{{ row.boxGauge3 }}
</template>
</el-table-column>
<el-table-column label="入仓体积(m³)">
<template v-slot="{row,$index}">
{{row.volume}}
</template>
</el-table-column>
<!--<el-table-column label="收费体积(m³)" prop="chargeVolume"></el-table-column>-->
<el-table-column label="入仓重量(Kg)" prop="weight"></el-table-column>
<!--<el-table-column label="收费重量(Kg)" prop="chargeWeight"></el-table-column>-->
<el-table-column :label="$t('数量')" width="130px" prop="quantity"></el-table-column>
<el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template v-slot="{ row, column, $index }">
{{getLocationName(row.orderLocationList)}}
</template>
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}">
<el-button size="mini" type="primary" @click="deleteRow($index)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card class="mt-10">
<div slot="header" class="page-title">放入数据</div>
<div>
<div class="pl-20 mb-10">
<span class="mr-10">{{$t('箱数')}}:{{ putin.num || 0 }},</span>
<span class="mr-10">{{ $t('数量(个)') }}:{{ putin.quantity || 0 }},</span>
<span class="mr-10">{{ $t('入仓方数') }}:{{ putin.volume || 0 }}m³, </span>
<span class="mr-10">{{ $t('入仓重量') }}:{{ putin.weight || 0 }}kg</span>
</div>
<el-form-item :label="$t('收费方数')" prop="chargeVolume">
<el-input-number v-model="shopForm.chargeVolume" controls-position="right"></el-input-number>
</el-form-item>
<el-form-item :label="$t('收费重量')" prop="chargeWeight">
<el-input-number v-model="shopForm.chargeWeight" controls-position="right"></el-input-number>kg
</el-form-item>
<el-form-item :label="$t('放入货值')">
<el-input-number v-model="shopForm.worth" controls-position="right" :min="0" :max="mainOrderItem.worth">
<template slot="append">{{ $t('') }}</template>
</el-input-number>
</el-form-item>
<el-form-item :label="$t('备注信息')">
<el-input v-model="shopForm.remark"></el-input>
</el-form-item>
</div>
</el-card>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="shopAdd" :disabled="!shopForm.specsRecordVOList || !shopForm.specsRecordVOList.length">{{$t('确定')}}</el-button>
<el-button @click="shopCancel">{{$t('取消')}}</el-button>
</div>
</el-dialog>
<el-dialog
:title="$t('提示')"
:visible.sync="dialogVisible"
width="30%">
<span class="cancel_notice">{{$t('拆单申请正在审核中,你确定取消拆单申请吗?')}}</span>
<div class="cancel_content">
<span>{{$t('取消原因:')}}</span>
<el-input v-model="reason" :placeholder="$t('请输入取消原因')"></el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">{{$t('取消')}}</el-button>
<el-button type="primary" @click="cancelSplit">{{$t('确定')}}</el-button>
</span>
</el-dialog>
<el-dialog
:title="$t('提示')"
:visible.sync="dialogVisible"
width="30%">
<span class="cancel_notice">{{$t('拆单申请正在审核中,你确定取消拆单申请吗?')}}</span>
<div class="cancel_content">
<span>{{$t('取消原因:')}}</span>
<el-input v-model="reason" :placeholder="$t('请输入取消原因')"></el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">{{$t('取消')}}</el-button>
<el-button type="primary" @click="cancelSplit">{{$t('确定')}}</el-button>
</span>
</el-dialog>
<warehouse-record
v-if="currentWarehouseRecord"
:list="currentWarehouseRecord"
:warehouseId="currentWarehouseId"
@close="currentWarehouseRecord=null"></warehouse-record>
<put-in
v-if="currentPutIn"
:warehouse-record="currentPutIn"
@close="currentPutIn=null"
@submit="handlePutin"
:warehouse-id="currentWarehouseId"
:max-num="orderData.sumNum"
></put-in>
</div>
</template>
<script>
import {getDictData, getDictDatas,DICT_TYPE} from '@/utils/dict'
import {
getSplitList,
splitApply,
createSplit,
cancelApply,
createSplitItem,
deleteSplitItem,
deleteSplit,
deleteAllSplit
} from "@/api/ecw/orderHandle"
import {getWarehouseList, quantityRequired} from '@/api/ecw/warehouse'
import {getChannelList} from '@/api/ecw/channel'
import WorkFlow from '@/components/WorkFlow'
import {getOrder, getOrderWarehouseIn, splitItemUpdate} from '@/api/ecw/order'
import Decimal from 'decimal.js'
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect";
import WarehouseDetail from "@/views/ecw/order/components/WarehouseDetail";
import WarehouseRecord from "@/views/ecw/order/splitApply/components/WarehouseRecord";
import PutIn from "@/views/ecw/order/splitApply/components/PutIn.vue";
import Template from "@/views/cms/template/index.vue";
export default {
name: "SplitApply",
components: {
Template,
WarehouseRecord,
WarehouseDetail,
WarehouseAreaSelect,
WorkFlow,
PutIn
},
data() {
return {
checked:false,
reason:'',
dialogVisible:false,
orderData:{},
splitData:[],
orderApprovalBackVO:{},
splitIndex:0,
channelData:[],
tradeCityList:[],
multipleSelection:[],
loading:false,
open:false,
form:{
},
importCityList:[],
selectedUsers:[],
shopOpen:false,
quantityshow:false,
shopForm:{
specsRecordVOList: []
},
// 表单校验
rules: {
transportId: [{ required: true, message: this.$t("请选择运输方式"), trigger: "change" }],
warehouseIds: [{ required: true, message: this.$t("请选择目的仓库"), trigger: "change" }],
channelId: [{ required: true, message: this.$t("请选择出货渠道"), trigger: "change" }],
},
// 表单校验
shopRules: {
chargeVolume: [{ required: true, message: this.$t("请填写收费方数"), trigger: "blur" }],
chargeWeight: [{ required: true, message: this.$t("请填写收费重量"), trigger: "blur" }],
},
queryParams:{
orderId: null,
lang:0
},
query:{
page:1,
rows:20
},
// splitItemIndex:0,
quantitySum:0,
// 当前查看的入仓记录
currentWarehouseRecord: null,
// 订单入仓记录
warehouseInList: [],
// 当前选择的入仓记录ID
// selectedWarehouseInId: null,
// 当前正在放入的入仓记录
currentPutIn: null
};
},
async created() {
this.getChannel()
getWarehouseList().then(res => {
this.tradeCityList = res.data
this.importCityList = this.tradeCityList.filter(item => item.type == 1)
})
if (this.$route.query.orderId) {
this.queryParams.orderId = this.$route.query.orderId
}
Promise.all([this.getList(), this.getOrder()]).then(res => {
console.log("拆单数据", this.splitData, this.splitData.length)
if(this.orderData.inWarehouseState != 207 && this.splitData.length){
this.reset()
}
})
// 获取入仓记录
getOrderWarehouseIn(this.queryParams.orderId).then(res => {
this.warehouseInList = res.data
})
},
watch: {
//监听table这个对象
tableData: {
// 立即监听
immediate: true,
handler() {
this.$nextTick(() => {
const tds = document.querySelectorAll(
"#table .el-table__footer-wrapper tr>td"
);
// colSpan合并列
tds[1].colSpan = 5;
tds[1].style.textAlign = "left";
tds[2].style.display = "none";
tds[3].style.display = "none";
tds[4].style.display = "none";
tds[5].style.display = "none";
});
},
},
// 关闭放入弹层的时候清理弹层表单内容
shopOpen(show){
if(!show){
this.shopForm = {}
}
},
// 切换品名需要重置已放入的记录
'shopForm.orderItemId'(){
// 默认取以前放入的品名
let split = this.splitData.find(item => item.id == this.splitData[this.splitIndex].id)
this.shopForm.specsRecordVOList = []
if(split) {
let specsRecordVOList = split.orderSplitItemBackVOList.find(item => item.orderItemId == this.shopForm.orderItemId)?.specsRecordVOList || []
specsRecordVOList.forEach(item => {
const [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*')
this.shopForm.specsRecordVOList.push({...item, boxGauge1, boxGauge2, boxGauge3})
})
}
}
},
computed:{
getDictData(){
return (type, value) => getDictData(type, value) || {}
},
getDictDatas(){
return getDictDatas
},
// 放入品名试选择的商品项
orderItem(){
if(!this.orderData || !this.shopForm.orderItemId) return {}
return this.orderData.orderItemVOList.find(item => item.orderItemId == this.shopForm.orderItemId) || {}
},
// 主单数据,也就是拆分剩余的数据,可用来限制拆单放入的最大值
mainOrderItem(){
if(!this.shopForm.orderItemId) return {}
return this.orderData.orderItemVOList.find(item => item.orderItemId === this.shopForm.orderItemId)
},
// 剩余可拆数据,父订单的入仓数据 - 全部拆单的品名数据
leftData(){
if(!this.shopForm.orderItemId) return {}
let data = {
num: new Decimal(this.orderItem.warehouseInInfoVO?.cartonsNum || 0),
volume: new Decimal(this.orderItem.warehouseInInfoVO?.volume || 0),
weight: new Decimal(this.orderItem.warehouseInInfoVO?.weight || 0),
quantity: new Decimal(this.orderItem.warehouseInInfoVO?.quantityAll || 0),
chargeVolume: new Decimal(this.orderItem.chargeVolume || 0),
chargeWeight: new Decimal(this.orderItem.chargeWeight || 0),
worth: new Decimal(this.orderItem.worth || 0),
}
// 全部拆单的放入数据累减
this.splitData.forEach(split => {
split.orderSplitItemBackVOList.forEach(splitItem => {
// 正在拆的要排除,不然会重复计算
if(splitItem.orderItemId == this.shopForm.orderItemId && split.id == this.splitData[this.splitIndex].id){
return
}
// 每个品名的入仓记录挨个累减其他数据
if(splitItem.orderItemId == this.shopForm.orderItemId){
// 每个品名都要累减收费数据
data.chargeVolume = data.chargeVolume.minus(new Decimal(splitItem.chargeVolume || 0))
data.chargeWeight = data.chargeWeight.minus(new Decimal(splitItem.chargeWeight || 0))
data.worth = data.worth.minus(new Decimal(splitItem.worth || 0))
data.num = data.num.minus(new Decimal(splitItem.num || 0))
data.volume = data.volume.minus(new Decimal(splitItem.volume || 0))
data.weight = data.weight.minus(new Decimal(splitItem.weight || 0))
data.quantity = data.quantity.minus(new Decimal(splitItem.quantity || 0))
}
})
})
return data
},
// 放入数据
putin(){
let data = {
num: new Decimal(0),
volume: new Decimal(0),
weight: new Decimal(0),
quantity: new Decimal(0)
}
this.shopForm.specsRecordVOList && this.shopForm.specsRecordVOList.forEach(item => {
data.num = data.num.plus(new Decimal(item.num || 0))
data.volume = data.volume.plus(new Decimal(item.volume || 0))
data.weight = data.weight.plus(new Decimal(item.weight || 0))
data.quantity = data.quantity.plus(new Decimal(item.quantity || 0))
})
return {
num: data.num.toNumber(),
volume: data.volume.toNumber(),
weight: data.weight.toNumber(),
quantity: data.quantity.toNumber()
}
},
// 当前仓库ID,选择储位的时候需要用到
currentWarehouseId(){
return this.orderData.adjustToDestWarehouseId || this.orderData.logisticsInfoDto.startWarehouseId
},
// 当前选择的入仓记录
/*currentWarehouseItem(){
return this.getOrderItemWarehouseIn(this.shopForm.orderItemId).find(item => item.id === this.selectedWarehouseInId)
},*/
// 根据orderItemId获取入仓记录
getOrderItemWarehouseIn() {
return orderItemId => {
const list = this.warehouseInList.find(item => item.orderItemId == orderItemId)?.orderWarehouseInBackItemDoList || []
return list.map(item => {
let [boxGauge1, boxGauge2, boxGauge3] = item.boxGauge.split('*')
let labelArr = [
this.$t('{num}箱', {num: item.cartonsNum}),
this.$l(this.getDictDatas(this.DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE).find(dict => dict.value == item.specificationType), 'label'),
this.$t('长{boxGauge1}cm', {boxGauge1}),
this.$t('宽{boxGauge2}cm', {boxGauge2}),
this.$t('高{boxGauge3}cm', {boxGauge3}),
this.$t('方数{volume}m³', {volume: item.volume}),
this.$t('重量{weight}kg', {weight: item.weight})
]
if (item.quantityAll) {
labelArr.push(this.$t('数量{n}', {n: item.quantityAll}))
}
if (item.expressNo) {
labelArr.push(this.$t('快递{expressNo}', {expressNo: item.expressNo}))
}
if (item.orderLocationBackVOList && item.orderLocationBackVOList.length) {
labelArr.push(this.$t('储位{location}', {
location: item.orderLocationBackVOList.map(v => v.code || v.areaName + (v.locationName || '')).join(',')
}))
}
item.boxGauge1 = boxGauge1
item.boxGauge2 = boxGauge2
item.boxGauge3 = boxGauge3
item.text = labelArr.join(',')
return item
})
}
},
// 根据入仓记录ID筛选出他的全部拆出记录
getWarehouseInspecsRecordVOList(){
return warehouseInId => {
let specsRecordVOList = []
// 这里是全部已放入的
this.splitData.forEach((split, splitIndex) => {
split.orderSplitItemBackVOList.forEach(splitItem => {
// 当前正在拆的品名不包含,因为后面shopForm.specsRecordVOList会包含
if(splitIndex == this.splitIndex && splitItem.orderItemId == this.shopForm.orderItemId){
return
}
splitItem.specsRecordVOList && splitItem.specsRecordVOList.forEach(specs => {
if(specs.warehouseInId === warehouseInId){
specsRecordVOList.push(specs)
}
})
})
})
// 这里是全部正在操作放入,但是还没确定提交的
this.shopForm.specsRecordVOList.forEach(item => {
if(item.warehouseInId == warehouseInId)specsRecordVOList.push(item)
})
return specsRecordVOList
}
},
// 根据入仓ID获取拆出数据
getWarehouseInSplitData(){
return (warehouseInId, field) => {
let total = new Decimal(0)
this.getWarehouseInspecsRecordVOList(warehouseInId).forEach(item => {
total = total.plus(new Decimal(item[field] || 0))
})
return total.toNumber()
}
},
// 获取入仓记录的剩余数据
getWarehouseLeftData(){
return (warehouseRecord, field) => {
let warehouseField = field
if(field == 'num') warehouseField = 'cartonsNum'
if(field == 'quantity') warehouseField = 'quantityAll'
let total = new Decimal(warehouseRecord[ warehouseField ] || 0)
this.getWarehouseInspecsRecordVOList(warehouseRecord.id).forEach(item => {
total = total.minus(new Decimal(item[field] || 0))
})
return total.toNumber()
}
}
},
methods: {
/*检查并提交字段(体积,重量)修改*/
updateField(row, field){
let val = parseFloat(row[field])
if(!val || val < 0){
this.$message.error(this.$t('数据无效'))
return this.getList()
}
splitItemUpdate(row).then(() => {
this.$message.success(this.$t('修改成功'))
}).finally(() => {
this.getList()
})
},
checkCode(data){
if(data.indexOf('+')==-1){
return '+'+data
}
return data
},
changeTransport(e){
this.$set(this.form,'transportId',e)
console.log(this.form.transportId)
this.$forceUpdate()
},
changeDeatWarehouseId(e){
this.$forceUpdate()
this.$set(this.form,'destWarehouseId',e)
console.log(this.form.destWarehouseId)
},
getOrder(){
this.loading = true;
return getOrder(this.queryParams.orderId).then(response => {
this.orderData = response.data
this.query.destWarehouseId = response.data.logisticsInfoDto.startWarehouseId
this.loading = false
});
},
/** 查询列表 */
getList() {
this.loading = true;
// 执行查询
return getSplitList(this.queryParams).then(response => {
this.splitData = response.data.orderSplitBackVOList
this.orderApprovalBackVO = response.data
this.loading = false;
});
},
getChannel(){
getChannelList().then(res=>this.channelData = res.data)
},
changeDest(){
this.query.warehouseIds = this.form.destWarehouseId
},
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
if (rowIndex==this.orderData.orderItemVOList.length) {
if (columnIndex === 1) {
return [2, 3];
} else if (columnIndex > 1) {
return [0, 0];
}
}
},
getSummaries(){
const sums = [];
sums[0] = this.$t('小计')
if(!this.orderData || !this.orderData.orderItemVOList ||this.orderData.length==0){
return sums
}
var orderSum = 0
var orderV = 0
var orderW = 0
var leviteSum = 0
var leviteV = 0
var leviteW = 0
this.orderData.orderItemVOList.forEach((column, index) => {
orderSum += column.num
orderV += column.volume
orderW += column.weight
leviteSum += column.warehouseInInfoVO?column.warehouseInInfoVO.cartonsNum:0
leviteV += column.warehouseInInfoVO?column.warehouseInInfoVO.volume:0
leviteW += column.warehouseInInfoVO?column.warehouseInInfoVO.weight:0
});
sums[1] = this.$t('下单统计')+' '+ orderSum+' '+this.$t('')+' '+ orderV.toFixed(2) +'' + orderW + ' kg ' + ' '+this.$t('入仓统计:')+ leviteSum+' '+this.$t('')+' '+ leviteV.toFixed(2) +'' + leviteW + ' kg'
return sums;
},
importCityName(id){
var arr = this.tradeCityList.filter(item => item.id == id)
return arr.length>0?arr[0].titleZh:this.$t('')
},
submitForm(){
if(this.splitData.length==0){
this.$modal.msgError(this.$t("请先新建拆单"))
return
}
var params = {
orderId:this.queryParams.orderId,
copyUserId:this.selectedUsers
}
splitApply(params).then(res=>{
this.$modal.msgSuccess(this.$t("申请成功"));
this.$store.dispatch('tagsView/delCurrentView')
})
},
addShop(index){
this.splitIndex = index
this.shopOpen = true
// 重置表单数据
this.shopForm = {specsRecordVOList:[]}
},
addSplit(){
this.form.transportId = this.orderData.transportId
this.form.destWarehouseId = this.orderData.destWarehouseId
if(this.orderData.logisticsInfoDto&&this.orderData.logisticsInfoDto.destTitleZh){
this.form.destWarehouseId = this.importCityList.find(item=>item.titleZh==this.orderData.logisticsInfoDto.destTitleZh).id
if(this.orderData.logisticsInfoDto&&this.orderData.logisticsInfoDto.channelId){
this.form.channelId = this.orderData.logisticsInfoDto.channelId
}
}
this.open = true
},
/*changeProdTitleZh(val){
var list = []
list = this.splitData[0].orderSplitItemBackVOList.filter(item=>item.id == val)
this.shopForm.sum = list[0].num
this.quantitySum = list[0].quantity
this.shopForm.orderItemId = list[0].orderItemId
this.shopForm.prodTitleEn = list[0].prodTitleEn
this.shopForm.prodTitleZh = list[0].prodTitleZh
// 默认给一个
if(!this.shopForm.specsRecordVOList || !this.shopForm.specsRecordVOList.length){
this.addRow()
}
this.numcheck()
},*/
// 查询数量是否必填
numcheck(){
quantityRequired(this.orderData.lineId).then(res=>{
this.quantityshow = res.data
})
},
// 输入方数箱数后,按照平均值计算数量和体积重量数据
numChange(){
/*var sum = parseInt(this.quantitySum/this.shopForm.num)
this.$set(this.shopForm,'quantity',sum)*/
let rate = this.shopForm.num/this.mainOrderItem.num
this.$set(this.shopForm, 'quantity', Math.ceil(this.mainOrderItem.quantity * rate))
this.$set(this.shopForm, 'volume', (this.mainOrderItem.volume * rate).toFixed(2))
this.$set(this.shopForm, 'chargeVolume', (this.mainOrderItem.chargeVolume * rate).toFixed(2))
this.$set(this.shopForm, 'weight', (this.mainOrderItem.weight * rate).toFixed(2))
this.$set(this.shopForm, 'chargeWeight', (this.mainOrderItem.chargeWeight * rate).toFixed(2))
this.$set(this.shopForm, 'worth', (this.mainOrderItem.worth * rate).toFixed(2))
},
/*changeProdTitleEn(){
var list = []
list = this.splitData[0].orderSplitItemBackVOList.filter(item=>item.prodTitleEn == this.shopForm.prodTitleEn)
this.shopForm.sum = list[0].num
this.quantitySum = list[0].quantity
this.shopForm.prodTitleZh = list[0].prodTitleZh
},*/
haddleAdd(){
let that = this
if(!that.form.transportId){
that.$message.error(this.$t("请选择运输方式"));
return
}
if(!that.form.destWarehouseId){
that.$message.error(this.$t("请选择目的仓库"));
return
}
// if(!this.form.channelId){
// this.$modal.msgError("请选择出货渠道");
// }
var params = {
dstWarehouseId: that.form.destWarehouseId,
parentOrderId: that.orderData.orderId,
parentOrderNo: that.orderData.orderNo,
transportId: that.form.transportId,
channelId:that.form.channelId
}
createSplit(params).then(res=>{
that.getList()
})
that.open = false
},
/*cancel(){
this.open = false
this.form = {}
},*/
shopAdd(){
this.$refs["shopForm"].validate(valid => {
if (!valid) {
return;
}
if(!this.shopForm.specsRecordVOList.length){
return this.$message.error(this.$t("请放入品名"));
}
// 放入数据不能大于可拆数据
if(this.putin.num > this.leftData.num){
return this.$message.error(this.$t("放入箱数不能大于可拆箱数"));
}
this.shopForm.specsRecordVOList.forEach(item => {
item.boxGauge = `${item.boxGauge1}*${item.boxGauge2}*${item.boxGauge3}`
})
var params = {
num:this.putin.num,
orderItemId:this.shopForm.orderItemId,
orderSplitId:this.splitData[this.splitIndex].id,
remark:this.shopForm.remark,
volume: this.putin.volume,
chargeVolume: this.shopForm.chargeVolume,
weight: this.putin.weight,
chargeWeight: this.shopForm.chargeWeight,
worth: this.shopForm.worth || 0,
specsRecordVOList:this.shopForm.specsRecordVOList
}
// 体积重量不能为0
const fields = {
'volume': this.$t('体积'),
'weight': this.$t('重量'),
'chargeVolume': this.$t('收费体积'),
'chargeWeight': this.$t('收费重量'),
}
let errFields = []
Object.keys(fields).forEach(field => {
if(params[field] < 0.01){
errFields.push(fields[field])
}
})
if(errFields.length){
return this.$message.error(this.$t("{field}最少为0.01", {field: errFields.join(",")}))
}
/*if(this.quantityshow){
params.quantity = this.shopForm.quantity
}*/
createSplitItem(params).then(async res=>{
this.$message.success(this.$t("放入成功"));
await this.getList()
this.shopForm = {}
this.shopOpen = false
})
})
},
removeShop(id){
let that = this
that.$confirm(that.$t('是否移除货物吗?')).then(function () {
deleteSplitItem(id).then(res=>{
that.$message.success(that.$t("移除成功"));
that.getList()
})
})
},
cancelSplit(){
let that = this
if(!that.reason){
that.$message.error(that.$t("请输入取消原因"));
return
}
cancelApply({orderId:that.queryParams.orderId,reason:that.reason}).then(res=>{
that.$message.success(that.$t("取消成功"));
that.$store.dispatch('tagsView/delCurrentView')
})
},
shopCancel(){
this.shopOpen = false
this.shopForm = {}
},
/** 删除按钮操作 */
deleteSplit(id) {
let that = this
that.$confirm(that.$t('是否确认删除新拆的订单吗?')).then(function () {
deleteSplit(id).then(res=>{
that.$message.success(that.$t("删除成功"));
that.getList()
})
})
},
// 添加一行
/*addRow(){
if(!this.shopForm.specsRecordVOList){
this.$set(this.shopForm,'specsRecordVOList',[])
}
if(!this.currentWarehouseItem){
return this.$message.info(this.$t("请选择入仓记录"))
}
let { specificationType, boxGauge1, boxGauge2, boxGauge3, volume, weight } = this.currentWarehouseItem
let num = this.currentWarehouseItem.cartonsNum
// 根据入仓记录添加一行
this.shopForm.specsRecordVOList.push({
specificationType, boxGauge1, boxGauge2, boxGauge3, volume, weight,num,
orderLocationList: this.currentWarehouseItem.orderLocationBackVOList
})
},*/
// 删除一行,可选参数index表上行号,参数不是数字则删除最后一行
deleteRow(index){
const spliceIndex = typeof index !== 'number' ? this.shopForm.specsRecordVOList.length - 1 : index
this.shopForm.specsRecordVOList.splice(spliceIndex, 1)
},
// 计算体积
calcVolume(row){
let volume = Decimal(row.boxGauge1 || 0)
.times(Decimal(row.boxGauge2 || 0))
.times(Decimal(row.boxGauge3 || 0)).div(1000000)
// 如果是箱的单位要乘以箱数
if(row.specificationType === 1) {
row.volume = volume.times(Decimal(row.num || 0))
}
// 最低0.01
volume = Math.max(0.01, volume.toNumber().toFixed(2))
this.$set(row, 'volume', volume)
this.$set(row, 'chargeVolume', volume)
},
// 显示入库记录
showWarehouse(row){
if(!row.specsRecordVOList){
return this.$message.info(this.$t('暂无入仓记录'))
}
this.currentWarehouseRecord = row.specsRecordVOList
},
// 获取储位名称
getLocationName(locationArr){
if(!locationArr || !locationArr.length) return ''
let arr = []
locationArr.forEach(item => {
arr.push(`${item.areaName || ''}${item.locationName || ''}`)
})
return Array.from(new Set(arr)).join(",")
},
// 根据入仓记录打开放入弹层
putInRecord(row){
this.currentPutIn = row
// 此条入仓记录已拆出的入仓记录,这样在放入的时候可以确保不超过此入仓记录的数量
let specsRecordVOList = this.getWarehouseInspecsRecordVOList(row.id)
this.currentPutIn.specsRecordVOList = specsRecordVOList
},
// 放入回调
handlePutin(list){
if(!list.length){
return this.$message.error(this.$t("请至少放入一条数据"))
}
list.forEach(item => {
this.shopForm.specsRecordVOList.push({...item})
})
this.currentPutIn = null
// 根据比例计算默认的收费方数和收费重量
const orderItem = this.orderData.orderItemVOList.find(item => item.orderItemId == this.shopForm.orderItemId)
const rate = this.putin.num / orderItem.warehouseInInfoVO.cartonsNum
this.$set(this.shopForm, 'chargeVolume', (orderItem.chargeVolume*rate).toFixed(2))
this.$set(this.shopForm, 'chargeWeight', (orderItem.chargeWeight*rate).toFixed(2))
this.$set(this.shopForm, 'worth', (orderItem.worth*rate).toFixed(2))
},
// 清空放入记录
clearAll(){
this.$confirm(this.$t("确定要清空放入数据么?")).then(res => {
this.shopForm.specsRecordVOList = []
})
},
// 重置
reset(){
return deleteAllSplit(this.queryParams.orderId).then(res => {
this.getList()
})
},
// 取消
async cancel(){
await this.reset()
this.$store.dispatch('tagsView/delCurrentView')
}
}
}
</script>
<style scoped>
.page-title{
margin: 0;
}
.card-title{
font-size: 18px;
font-weight: bold;
margin-top: 10px;
}
.card-info{
font-size: 16px;
}
.card{
margin-top: 20px;
}
.btn-header{
width: 90%;
display: flex;
align-items: center;
justify-content: space-between;
margin: 20px 0;
}
.red{
color:#ff3430;
font-size: 15px;
}
.footer_btn{
padding-bottom: 60px;
}
.cancel_notice{
font-size: 16px;
font-weight: 600;
}
.cancel_content{
display: flex;
align-items: center;
padding-top: 20px;
}
.cancel_content span{
width: 100px;
}
::v-deep .el-form-item--mini.is-error{
margin-bottom: 18px;
}
</style>
......@@ -967,10 +967,11 @@ export default {
const form = val === 1 ? this.form1 : this.form
const formLength = form.table.length
let orderLocationBackVOList = []
/* // 不默认使用上一条记录的储位 https://zentao.test.jdshangmen.com/bug-view-3344.html
// 不默认使用上一条记录的储位 https://zentao.test.jdshangmen.com/bug-view-3344.html
// 上面弄错了,默认使用上一条记录的储位 https://zentao.test.jdshangmen.com/bug-view-3484.html
if (formLength > 0) {
orderLocationBackVOList = JSON.parse(JSON.stringify(form.table[formLength - 1].orderLocationBackVOList))
}*/
}
form.table.push({
"boxGauge1": this.isJiyun ? 0 : '',
"boxGauge2": this.isJiyun ? 0 : '',
......
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