Commit 6eeba1a0 authored by 我在何方's avatar 我在何方

Merge branch 'release' of http://gitlab.jdshangmen.com/jiedao-app/jiedao-app-operator into release

parents da6698b3 fb01fe3b
...@@ -46,6 +46,10 @@ export default { ...@@ -46,6 +46,10 @@ export default {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.flex-between{
display: flex;
justify-content: space-between;
}
.empty-placeholder{ .empty-placeholder{
padding: 50px; padding: 50px;
text-align: center; text-align: center;
......
...@@ -48,7 +48,9 @@ export function getCustomerPage(query) { ...@@ -48,7 +48,9 @@ export function getCustomerPage(query) {
return request({ return request({
url: '/ecw/customer/page', url: '/ecw/customer/page',
method: 'get', method: 'get',
params: query params: query,
timeout: 60000
}) })
} }
/** /**
......
...@@ -25,7 +25,8 @@ export function getCustomerPage(query) { ...@@ -25,7 +25,8 @@ export function getCustomerPage(query) {
return request({ return request({
url: '/ecw/indirect-customer/page', url: '/ecw/indirect-customer/page',
method: 'get', method: 'get',
params: query params: query,
timeout: 30000
}) })
} }
...@@ -53,4 +54,4 @@ export function deleteIndirectCustomer(id) { ...@@ -53,4 +54,4 @@ export function deleteIndirectCustomer(id) {
url: '/ecw/indirect-customer/delete?id=' + id, url: '/ecw/indirect-customer/delete?id=' + id,
method: 'delete' method: 'delete'
}) })
} }
\ No newline at end of file
...@@ -79,7 +79,9 @@ export default { ...@@ -79,7 +79,9 @@ export default {
if(index < 0){ if(index < 0){
getProduct(this.value).then(res => { getProduct(this.value).then(res => {
this.list.unshift(res.data) this.list.unshift(res.data)
this.index = 0 this.$nextTick(() => {
this.index = 0
})
}) })
}else this.index = index }else this.index = index
}, },
......
...@@ -142,7 +142,8 @@ export default { ...@@ -142,7 +142,8 @@ export default {
if (f.selected) result.push({ if (f.selected) result.push({
orderId: this.orderId, orderId: this.orderId,
wareId: f.pid, wareId: f.pid,
areaId: f.id areaId: f.id,
locationName: f.code
}) })
else { else {
f.positionList?.forEach(g => { f.positionList?.forEach(g => {
...@@ -151,7 +152,8 @@ export default { ...@@ -151,7 +152,8 @@ export default {
orderId: this.orderId, orderId: this.orderId,
wareId: g.domainId, wareId: g.domainId,
areaId: g.areaId, areaId: g.areaId,
locationId: g.id locationId: g.id,
locationName: f.code + g.code
}) })
else g.children?.forEach(k => { else g.children?.forEach(k => {
// 子位置 // 子位置
...@@ -159,7 +161,8 @@ export default { ...@@ -159,7 +161,8 @@ export default {
orderId: this.orderId, orderId: this.orderId,
wareId: k.domainId, wareId: k.domainId,
areaId: k.areaId, areaId: k.areaId,
locationId: k.id locationId: k.id,
locationName: f.code + k.code
}) })
}) })
}) })
......
...@@ -281,6 +281,11 @@ export default { ...@@ -281,6 +281,11 @@ export default {
component: "BoxSplitDetail", component: "BoxSplitDetail",
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
}, },
// 退场拆单,跟出货装柜拆单一样
customs_exit_part_split: {
component: "BoxSplitDetail",
id: this.processInstance.businessKey,
},
merge_detail: { merge_detail: {
component: "MergeDetail", component: "MergeDetail",
id: this.processInstance.businessKey, id: this.processInstance.businessKey,
......
...@@ -211,208 +211,170 @@ ...@@ -211,208 +211,170 @@
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="$t('放入品名')" :visible.sync="shopOpen" width="1500px" append-to-body> <el-dialog :title="$t('放入品名')" :visible.sync="shopOpen" width="1500px" append-to-body>
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="150px" size="mini"> <el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="150px" inline>
<el-form-item :label="$t('中文品名')+':'" prop="orderItemId"> <el-form-item :label="$t('中文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择中文品名')" @change="onProdChange"> <el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择中文品名')">
<el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option> <el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('英文品名')+':'" prop="orderItemId"> <el-form-item :label="$t('英文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择英文品名')" @change="onProdChange"> <el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择英文品名')">
<el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option> <el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('剩余数据')"> <div class="page-title">{{$t('品名可拆数据')}}</div>
<div>{{$t('剩余箱数')}}{{ shopForm.sum || 0 }}</div> <div class="pl-20">
<div> <span class="mr-10">{{$t('箱数')}}:{{ Math.min(mainOrderItem.num, maxNum) || 0 }}</span>
{{ $t('入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³ <span class="mr-10">{{ $t('入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³</span>
{{ $t('收费方数') }}:{{ mainOrderItem.chargeVolume || 0 }}m³ <span class="mr-10">{{ $t('收费方数') }}:{{ mainOrderItem.chargeVolume || 0 }}m³</span>
</div> <span class="mr-10">{{ $t('入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg</span>
<div> <span class="mr-10">{{ $t('收费重量') }}:{{ mainOrderItem.chargeWeight || 0 }}kg</span>
{{ $t('入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg <span class="mr-10">{{ $t('数量(个)') }}:{{ mainOrderItem.quantity || 0 }}</span>
{{ $t('收费重量') }}:{{ mainOrderItem.chargeWeight || 0 }}kg <span class="mr-10">{{ $t('剩余货值') }}:{{ mainOrderItem.worth || 0 }}{{ $t('元') }}</span>
</div> </div>
<div> <div class="page-title">{{$t('可拆入仓记录')}}</div>
{{ $t('数量(个)') }}:{{ mainOrderItem.quantity || 0 }} <el-table
{{ $t('剩余货值') }}:{{ mainOrderItem.worth || 0 }}{{ $t('元') }} :data="getOrderItemWarehouseIn(shopForm.orderItemId)"
</div> style="width: 100%">
</el-form-item> <el-table-column :label="$t('箱数')">
<el-card class="box-card" v-if="shopForm.specsRecordVOList"> <template v-slot="{row,$index}">
<div slot="header" class="clearfix"> {{Math.min(getWarehouseLeftData(row, 'num'), leftSplitNum)}}
<span>{{ $t('入仓记录') }}</span> <dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType"></dict-tag>
<el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="deleteRow" :disabled="shopForm.specsRecordVOList.length <= 1"></el-button> </template>
<el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="addRow" :disabled="!shopForm.orderItemId"></el-button> </el-table-column>
</div> <el-table-column :label="$t('包装类型')">
<el-table <template v-slot="{row,$index}">
:data="shopForm.specsRecordVOList" <dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="row.unit"></dict-tag>
style="width: 100%"> </template>
<el-table-column :label="$t('箱数')" width="200px"> </el-table-column>
<template v-slot:header> <el-table-column label="长(cm)">
<span style="color: red">*</span>{{ $t('箱数') }} <template v-slot="{row,$index}">
</template> {{row.boxGauge1}}
<template v-slot="{row,$index}"> </template>
<el-form-item class="flex" label-width="0" </el-table-column>
:prop="`specsRecordVOList.${$index}.num`" <el-table-column label="宽(cm)">
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> <template v-slot="{row,$index}">
<el-input-number controls-position="right" :min="0" class="w-75 tight" v-model="row.num" type="number"></el-input-number> {{ row.boxGauge2 }}
<dict-selector class="w-75" :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType" defaultable></dict-selector> </template>
</el-form-item> </el-table-column>
</template> <el-table-column label="高(cm)">
</el-table-column> <template v-slot="{row,$index}">
<el-table-column :label="$t('包装类型')" width="100px"> {{ row.boxGauge3 }}
<template v-slot:header> </template>
<span style="color: red">*</span>{{ $t('包装类型') }} </el-table-column>
</template> <el-table-column label="入仓体积(m³)">
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
<el-form-item label-width="0"> {{getWarehouseLeftData(row, 'volume')}}
<dict-selector :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="row.unit" defaultable></dict-selector> </template>
</el-form-item> </el-table-column>
</template> <el-table-column label="入仓重量(Kg)" prop="weight">
</el-table-column> <template v-slot="{row,$index}">
<el-table-column label="长(cm)"> {{getWarehouseLeftData(row, 'weight')}}
<template v-slot:header> </template>
<span>{{ $t('') }}</span>(cm) </el-table-column>
</template> <el-table-column :label="$t('数量')" prop="quantity">
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
<el-form-item label-width="0"> {{getWarehouseLeftData(row, 'quantity')}}
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge1" @blur="calcVolume(row)"/> </template>
</el-form-item> </el-table-column>
</template> <el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column>
</el-table-column> <el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<el-table-column label="宽(cm)"> <template v-slot="{ row, column, $index }">
<template v-slot:header> <warehouse-area-select
<span>{{ $t('') }}</span>(cm) v-model="row.orderLocationBackVOList"
</template> readonly
<template v-slot="{row,$index}"> :warehouse-id="currentWarehouseId"
<el-form-item label-width="0"> ></warehouse-area-select>
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge2" @blur="calcVolume(row)" /> </template>
</el-form-item> </el-table-column>
</template> <el-table-column :label="$t('操作')">
</el-table-column> <template v-slot="{ row, column, $index}">
<el-table-column label="高(cm)"> <el-tag v-if="getWarehouseInSplitData(row.id,'num') >= row.cartonsNum" disabled size="mini" type="primary" >{{$t('已拆完')}}</el-tag>
<template v-slot:header> <el-button v-else size="mini" type="primary" @click="putInRecord(row)" :disabled="leftSplitNum <= 0">放入</el-button>
<span>{{ $t('') }}</span>(cm) </template>
</template> </el-table-column>
<template v-slot="{row,$index}"> </el-table>
<el-form-item label-width="0"> <div class="flex-between mt-20 mb-10">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge3" @blur="calcVolume(row)"/> <div class="page-title" style="margin: 0">
</el-form-item> {{$t('已放入入仓记录')}}
</template> </div>
</el-table-column> <el-button type="danger" size="mini" @click="clearAll">清空放入数据</el-button>
<el-table-column label="入仓体积(m³)"> </div>
<template v-slot:header>
<span style="color: red">*</span> <span>{{ $t('体积') }}</span>(m³) <el-table
</template> :data="shopForm.specsRecordVOList"
<template v-slot="{row,$index}"> style="width: 100%">
<el-form-item label-width="0" <el-table-column :label="$t('箱数')" width="200px">
:prop="`specsRecordVOList.${$index}.volume`" <template v-slot="{row,$index}">
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> {{row.num}}
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.volume"/> <dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType"></dict-tag>
</el-form-item> </template>
</template> </el-table-column>
</el-table-column> <el-table-column :label="$t('包装类型')" width="100px">
<el-table-column label="收费体积(m³)"> <template v-slot="{row,$index}">
<template v-slot:header> <dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="row.unit"></dict-tag>
<span style="color: red">*</span> <span>{{ $t('收费体积') }}</span>(m³) </template>
</template> </el-table-column>
<template v-slot="{row,$index}"> <el-table-column label="长(cm)">
<el-form-item label-width="0" <template v-slot="{row,$index}">
:prop="`specsRecordVOList.${$index}.chargeVolume`" {{row.boxGauge1}}
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> </template>
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.chargeVolume"/> </el-table-column>
</el-form-item> <el-table-column label="宽(cm)">
</template> <template v-slot="{row,$index}">
</el-table-column> {{ row.boxGauge2 }}
<el-table-column label="入仓重量(Kg)"> </template>
<template v-slot:header> </el-table-column>
<span style="color: red">*</span> <span>{{ $t('入仓重量') }}</span>(Kg) <el-table-column label="高(cm)">
</template> <template v-slot="{row,$index}">
<template v-slot="{row,$index}"> {{ row.boxGauge3 }}
<el-form-item label-width="0" </template>
:prop="`specsRecordVOList.${$index}.weight`" </el-table-column>
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> <el-table-column label="入仓体积(m³)">
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.weight"/> <template v-slot="{row,$index}">
</el-form-item> {{row.volume}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="收费重量(Kg)"> <!--<el-table-column label="收费体积(m³)" prop="chargeVolume"></el-table-column>-->
<template v-slot:header> <el-table-column label="入仓重量(Kg)" prop="weight"></el-table-column>
<span style="color: red">*</span> <span>{{ $t('收费重量') }}</span>(Kg) <!--<el-table-column label="收费重量(Kg)" prop="chargeWeight"></el-table-column>-->
</template> <el-table-column :label="$t('数量')" width="130px" prop="quantity"></el-table-column>
<template v-slot="{row,$index}"> <el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column>
<el-form-item label-width="0" <el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
:prop="`specsRecordVOList.${$index}.chargeWeight`" <template v-slot="{ row, column, $index }">
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> {{getLocationName(row.orderLocationList)}}
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.chargeWeight" type="number"/> </template>
</el-form-item> </el-table-column>
</template> <el-table-column :label="$t('操作')">
</el-table-column> <template v-slot="{ row, column, $index}">
<el-table-column :label="$t('数量')" width="130px"> <el-button size="mini" type="primary" @click="deleteRow($index)">删除</el-button>
<template v-slot="{row,$index}"> </template>
<el-form-item label-width="0" </el-table-column>
:prop="`specsRecordVOList.${$index}.quantity`" </el-table>
:rules="{required: isQuantity, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" 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="splitData.dstWarehouseId"
></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-card>
<el-form-item :label="$t('放入数据')">
<div>{{$t('箱数')}}{{ putin.num || 0 }}</div>
<div>
{{ $t('入仓方数') }}:{{ putin.volume || 0 }}m³
{{ $t('收费方数') }}:{{ putin.chargeVolume || 0 }}m³
</div>
<div>
{{ $t('入仓重量') }}:{{ putin.weight || 0 }}kg
{{ $t('收费重量') }}:{{ putin.chargeWeight || 0 }}kg
</div>
<div>
{{ $t('数量(个)') }}:{{ putin.quantity || 0 }}
</div>
</el-form-item>
<el-form-item :label="$t('放入货值')"> <div class="page-title">放入数据</div>
<el-input-number v-model="shopForm.worth" controls-position="right" :min="0" :max="mainOrderItem.worth"></el-input-number> <div class="pl-20 mb-10">
</el-form-item> <span class="mr-10">{{$t('箱数')}}:{{ putin.num || 0 }},</span>
<!--按照原型这里需要显示剩余数量,但是事实无法计算剩余数量,因为已装数量是未知的--> <span class="mr-10">{{ $t('数量(个)') }}:{{ putin.quantity || 0 }},</span>
<!--<el-form-item :label="$t('放入数量(个)')+':'" prop="quantity" v-if="isQuantity"> <span class="mr-10">{{ $t('入仓方数') }}:{{ putin.volume || 0 }}m³, </span>
<el-input-number v-model="shopForm.quantity" controls-position="right" :min="0" :max="mainOrderItem.quantity || undefined"></el-input-number> <span class="mr-10">{{ $t('入仓重量') }}:{{ putin.weight || 0 }}kg</span>
</el-form-item>--> </div>
<el-form-item :label="$t('备注信息')+':'"> <el-form-item :label="$t('收费方数')" prop="chargeVolume">
<el-input v-model="shopForm.remarks"></el-input> <el-input-number v-model="shopForm.chargeVolume" controls-position="right"></el-input-number>
</el-form-item> </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>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="shopAdd">{{$t('确定')}}</el-button> <el-button type="primary" @click="shopAdd">{{$t('确定')}}</el-button>
...@@ -421,6 +383,15 @@ ...@@ -421,6 +383,15 @@
</el-dialog> </el-dialog>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body></warehouse-record> <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> </div>
</template> </template>
...@@ -434,18 +405,20 @@ import { ...@@ -434,18 +405,20 @@ import {
import {quantityRequired} from "@/api/ecw/warehouse"; import {quantityRequired} from "@/api/ecw/warehouse";
import { getTradeCityList } from "@/api/ecw/region"; import { getTradeCityList } from "@/api/ecw/region";
import WorkFlow from "@/components/WorkFlow"; 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 { serviceMsg, toReviewDetail } from "../../utils";
import { createApproval, approvalCancel, splitList } from "@/api/ecw/boxSea"; import { createApproval, approvalCancel, splitList } from "@/api/ecw/boxSea";
import Decimal from "decimal.js"; import Decimal from "decimal.js";
import Warehouse from "@/views/ecw/order/warehousing/components/Warehouse"; import Warehouse from "@/views/ecw/order/warehousing/components/Warehouse";
import WarehouseRecord from "@/views/ecw/order/splitApply/components/WarehouseRecord"; import WarehouseRecord from "@/views/ecw/order/splitApply/components/WarehouseRecord";
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect"; import WarehouseAreaSelect from "@/components/WarehouseAreaSelect";
import PutIn from "@/views/ecw/order/splitApply/components/PutIn.vue";
export default { export default {
name: "splitOrder", name: "splitOrder",
inheritAttrs: false, inheritAttrs: false,
components: { components: {
PutIn,
WarehouseAreaSelect, WarehouseAreaSelect,
WarehouseRecord, WarehouseRecord,
Warehouse, Warehouse,
...@@ -493,7 +466,13 @@ export default { ...@@ -493,7 +466,13 @@ export default {
// 主单数据 // 主单数据
mainOrder: {orderSplitItemBackVOList: {}}, mainOrder: {orderSplitItemBackVOList: {}},
// 当前查看的入仓记录 // 当前查看的入仓记录
currentWarehouseRecord: null currentWarehouseRecord: null,
// 订单入仓记录
warehouseInList: [],
// 当前选择的入仓记录ID
selectedWarehouseInId: null,
// 当前正在放入的入仓记录
currentPutIn: null
}; };
}, },
created() { created() {
...@@ -503,6 +482,11 @@ export default { ...@@ -503,6 +482,11 @@ export default {
this.queryParams.orderId = this.currRow.orderId; this.queryParams.orderId = this.currRow.orderId;
this.getOrderDetail(); this.getOrderDetail();
this.getSplit(); this.getSplit();
// 获取入仓记录
getOrderWarehouseIn(this.queryParams.orderId).then(res => {
this.warehouseInList = res.data
})
}, },
watch: { watch: {
//监听table这个对象 //监听table这个对象
...@@ -572,6 +556,106 @@ export default { ...@@ -572,6 +556,106 @@ export default {
chargeWeight: data.chargeWeight.toNumber(), chargeWeight: data.chargeWeight.toNumber(),
quantity: data.quantity.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.orderSplitItemBackVOList.forEach(splitItem => {
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()
}
},
// 最大可装箱数 原单箱数 - 已装箱数
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: { methods: {
...@@ -713,60 +797,9 @@ export default { ...@@ -713,60 +797,9 @@ export default {
this.shopForm = {}; this.shopForm = {};
this.shopOpen = true; this.shopOpen = true;
this.isQuantity = false; 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)
// 默认给一个入仓记录
if(!this.shopForm.specsRecordVOList || !this.shopForm.specsRecordVOList.length){
this.addRow()
}
// 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() { shopAdd() {
this.$refs["shopForm"].validate((valid) => { this.$refs["shopForm"].validate((valid) => {
if (valid) { if (valid) {
...@@ -792,7 +825,8 @@ export default { ...@@ -792,7 +825,8 @@ export default {
chargeWeight: this.putin.chargeWeight, chargeWeight: this.putin.chargeWeight,
chargeVolume: this.putin.chargeVolume, chargeVolume: this.putin.chargeVolume,
worth: this.shopForm.worth || 0, worth: this.shopForm.worth || 0,
specsRecordVOList:this.shopForm.specsRecordVOList specsRecordVOList:this.shopForm.specsRecordVOList,
shipmentSplit: true
}; };
// 按数量计费的才需要传递数量 // 按数量计费的才需要传递数量
if(this.isQuantity){ if(this.isQuantity){
...@@ -802,8 +836,8 @@ export default { ...@@ -802,8 +836,8 @@ export default {
this.$message.success(this.$t("放入成功")); this.$message.success(this.$t("放入成功"));
this.querySplitGoods(); this.querySplitGoods();
this.$refs["shopForm"].resetFields(); this.$refs["shopForm"].resetFields();
this.shopOpen = false;
}); });
this.shopOpen = false;
} }
}); });
}, },
...@@ -844,8 +878,15 @@ export default { ...@@ -844,8 +878,15 @@ export default {
if(!this.shopForm.specsRecordVOList){ if(!this.shopForm.specsRecordVOList){
this.$set(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({ this.shopForm.specsRecordVOList.push({
orderLocationList: [] specificationType, boxGauge1, boxGauge2, boxGauge3, volume, weight,num,
orderLocationList: this.currentWarehouseItem.orderLocationBackVOList
}) })
}, },
// 删除一行,可选参数index表上行号,参数不是数字则删除最后一行 // 删除一行,可选参数index表上行号,参数不是数字则删除最后一行
...@@ -874,6 +915,44 @@ export default { ...@@ -874,6 +915,44 @@ export default {
return this.$message.info(this.$t('暂无入仓记录')) return this.$message.info(this.$t('暂无入仓记录'))
} }
this.currentWarehouseRecord = row.specsRecordVOList 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 = []
})
} }
}, },
}; };
......
...@@ -279,6 +279,7 @@ export default { ...@@ -279,6 +279,7 @@ export default {
secId: this.partData.id, secId: this.partData.id,
shipmentId: this.$attrs.shipmentObj.id, shipmentId: this.$attrs.shipmentObj.id,
orderId: item.orderId, orderId: item.orderId,
isCover: 1
}; };
if (type === "all") { if (type === "all") {
params.orderItemIdList = item.boxOrderItemList.map( params.orderItemIdList = item.boxOrderItemList.map(
......
...@@ -563,14 +563,24 @@ export default { ...@@ -563,14 +563,24 @@ export default {
const { columns, data } = param; const { columns, data } = param;
const sums = []; const sums = [];
columns.forEach((column, index) => { columns.forEach((column, index) => {
if (column.property === "brandType") { if (column.property === "feeType") {
sums[index] = this.$t("合计"); sums[index] = this.$t("合计");
return; return;
} }
if (column.property === "num") { if (column.property === "warehouseInInfoVO.cartonsNum") {
sums[index] = new Decimal( var num = 0
this.calcSum(column.property, data) let values = data?.map((item) => Number(item.warehouseInInfoVO.cartonsNum)) ?? [];
).toNumber(); 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") { if (column.property === "volumeWeight") {
let volume = this.calcSum("volume", data); let volume = this.calcSum("volume", data);
...@@ -653,6 +663,7 @@ export default { ...@@ -653,6 +663,7 @@ export default {
orderItemIdList: item.boxOrderItemList.map( orderItemIdList: item.boxOrderItemList.map(
(data) => data.orderItemId (data) => data.orderItemId
), ),
isCover: 0
}; };
createGoods(params) createGoods(params)
......
...@@ -72,10 +72,7 @@ ...@@ -72,10 +72,7 @@
<dict-tag :type="DICT_TYPE.CUSTOMER_OPERATE_TYPE" :value="row.operateType"></dict-tag> <dict-tag :type="DICT_TYPE.CUSTOMER_OPERATE_TYPE" :value="row.operateType"></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作人')" prop="operator"> <el-table-column :label="$t('操作人')" prop="operatorName">
<template v-slot="{row}">
{{operatorFn(row.operator)}}
</template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作时间')" prop="operator"> <el-table-column :label="$t('操作时间')" prop="operator">
<template v-slot="{row}"> <template v-slot="{row}">
...@@ -119,7 +116,7 @@ ...@@ -119,7 +116,7 @@
<dict-tag :type="DICT_TYPE.CUSTOMER_OPERATE_TYPE" :value="dataLog.operateType"></dict-tag> <dict-tag :type="DICT_TYPE.CUSTOMER_OPERATE_TYPE" :value="dataLog.operateType"></dict-tag>
</el-form-item> </el-form-item>
<el-form-item :label="$t('操作人')+':'"> <el-form-item :label="$t('操作人')+':'">
{{operatorFn(dataLog.operator)}} {{dataLog.operatorName}}
</el-form-item> </el-form-item>
<el-form-item :label="$t('操作时间')+':'"> <el-form-item :label="$t('操作时间')+':'">
{{parseTime(dataLog.createTime)}} {{parseTime(dataLog.createTime)}}
......
...@@ -948,7 +948,7 @@ export default { ...@@ -948,7 +948,7 @@ export default {
getCustomer(id) { getCustomer(id) {
return getCustomer(id).then(response => { return getCustomer(id).then(response => {
console.log(response,'response') console.log(response,'response')
this.form = { ...this.form, ...response.data, id: this.customerId,transportType: response.data.transportType.split(','),customerBanks:response.data.customerBankBackVOList }; this.form = { ...this.form, ...response.data, id: this.customerId,transportType: response.data.transportType && response.data.transportType !== '' ? response.data.transportType.split(',') : [],customerBanks:response.data.customerBankBackVOList };
this.open = true; this.open = true;
this.title = this.$t('修改客户'); this.title = this.$t('修改客户');
this.getZhongPao() this.getZhongPao()
......
...@@ -105,7 +105,8 @@ ...@@ -105,7 +105,8 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户名称')" align="center" prop="name"> <el-table-column :label="$t('客户名称')" align="center" prop="name">
<template slot-scope="{row}"> <template slot-scope="{row}">
{{$l(row, 'name')}} <el-tag v-if="row.isInOpenSea" size="mini">{{ $t('') }}</el-tag> <p style="display:inline-block;white-space:pre-wrap;">{{$l(row, 'name')}}</p>
<el-tag v-if="row.isInOpenSea" size="mini">{{ $t('') }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<el-card style="margin-top: 15px;"> <el-card style="margin-top: 15px;">
<el-descriptions :column="4" border> <el-descriptions :column="4" border>
<el-descriptions-item :label="$t('客户编号')">{{ customer.number }}</el-descriptions-item> <el-descriptions-item :label="$t('客户编号')">{{ customer.number }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户名称')">{{ customer.name}}</el-descriptions-item> <el-descriptions-item :label="$t('客户名称')"><span style="white-space: pre-wrap;">{{ customer.name}}</span></el-descriptions-item>
<el-descriptions-item :label="$t('客户英文名称')">{{customer.nameEn }}</el-descriptions-item> <el-descriptions-item :label="$t('客户英文名称')">{{customer.nameEn }}</el-descriptions-item>
<el-descriptions-item :label="$t('结算方式')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_BALANCE, customer.balance) }}</el-descriptions-item> <el-descriptions-item :label="$t('结算方式')">{{ getDictDataLabel(DICT_TYPE.CUSTOMER_BALANCE, customer.balance) }}</el-descriptions-item>
<el-descriptions-item :label="$t('客户生日')">{{ parseTime(customer.birthday, '{y}-{m}-{d}') }}</el-descriptions-item> <el-descriptions-item :label="$t('客户生日')">{{ parseTime(customer.birthday, '{y}-{m}-{d}') }}</el-descriptions-item>
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户名称')" align="center" prop="name" > <el-table-column :label="$t('客户名称')" align="center" prop="name" >
<template v-slot="{row}"> <template v-slot="{row}">
{{$l(row, 'name')}} <p style="display:inline-block;white-space: pre-wrap;">{{$l(row, 'name')}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户等级')" align="center" prop="vipLevelNameZh"> <el-table-column :label="$t('客户等级')" align="center" prop="vipLevelNameZh">
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户名称')" align="center" prop="name" > <el-table-column :label="$t('客户名称')" align="center" prop="name" >
<template v-slot="{row}"> <template v-slot="{row}">
{{$l(row, 'name')}} <p style="display:inline-block;white-space: pre-wrap;">{{$l(row, 'name')}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户等级')" align="center" prop="vipLevelNameZh"> <el-table-column :label="$t('客户等级')" align="center" prop="vipLevelNameZh">
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户名称')" align="center" prop="name" > <el-table-column :label="$t('客户名称')" align="center" prop="name" >
<template v-slot="{row}"> <template v-slot="{row}">
{{$l(row, 'name')}} <p style="display:inline-block;white-space: pre-wrap;">{{$l(row, 'name')}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户等级')" align="center" prop="vipLevelNameZh"> <el-table-column :label="$t('客户等级')" align="center" prop="vipLevelNameZh">
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户名称')" align="center" prop="name" > <el-table-column :label="$t('客户名称')" align="center" prop="name" >
<template v-slot="{row}"> <template v-slot="{row}">
{{$l(row, 'name')}} <p style="display:inline-block;white-space: pre-wrap;">{{$l(row, 'name')}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('客户等级')" align="center" prop="vipLevelNameZh"> <el-table-column :label="$t('客户等级')" align="center" prop="vipLevelNameZh">
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="offer-header"> <div class="offer-header">
<span style="font-size: 15px;">{{$t('报价单号')}}{{list.number}}</span> <span style="font-size: 15px;">{{$t('报价单号')}}{{list.number}}</span>
<div class="btns"> <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: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: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> <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 @@ ...@@ -91,7 +91,7 @@
<el-table-column :label="$t('唛头')" align="center" prop="marks" /> <el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table-column :label="$t('箱数')" align="center" prop="sumNum" > <el-table-column :label="$t('箱数')" align="center" prop="sumNum" >
<template v-slot="{row}"> <template v-slot="{row}">
{{row.inWarehouseState > 1 ? row.sumNum : row.totalNum}} {{row.sumNum > 0 ? row.sumNum : row.totalNum}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('已放箱数')" align="center" prop="sumWeight"> <el-table-column :label="$t('已放箱数')" align="center" prop="sumWeight">
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</template> </template>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body></warehouse-record> <warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body @close="currentWarehouseRecord=null"></warehouse-record>
</div> </div>
</template> </template>
<script> <script>
......
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
{{detail.marks}} {{detail.marks}}
</td> </td>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;"> <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>
<td style="text-align:center;padding:0 0px;border:1px dashed #ccc;"> <td style="text-align:center;padding:0 0px;border:1px dashed #ccc;">
{{item.cartonsNum}} {{item.cartonsNum}}
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<send-sms-code :order-id="detail.orderId" scene="5" /> <send-sms-code :order-id="detail.orderId" scene="5" />
</el-form-item> </el-form-item>
<el-form-item label="" style="margin-top:20px"> <el-form-item label="" style="margin-top:20px">
<el-button type="success" @click="submit">{{$t('确认货')}}</el-button> <el-button type="success" @click="submit">{{$t('确认货')}}</el-button>
<el-button type="default" @click="closeDialog">{{$t('关闭')}}</el-button> <el-button type="default" @click="closeDialog">{{$t('关闭')}}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
......
...@@ -138,7 +138,8 @@ export default { ...@@ -138,7 +138,8 @@ export default {
getReleaseInfo(this.orderId).then(res => this.detail = res.data) getReleaseInfo(this.orderId).then(res => this.detail = res.data)
seasoningCondimentsSelect({orderId: this.orderId}).then(res => { seasoningCondimentsSelect({orderId: this.orderId}).then(res => {
res.data.forEach(item => { res.data.forEach(item => {
item.releaseNum = item.sumNum - item.releaseNum item.release = item.releaseNum
item.releaseNum = item.sumNum - item.release
}) })
this.orders = res.data this.orders = res.data
}) })
...@@ -155,7 +156,7 @@ export default { ...@@ -155,7 +156,7 @@ export default {
// 放货箱数不能大于可放货箱数 // 放货箱数不能大于可放货箱数
let errNos = [] let errNos = []
this.selectedOrders.forEach(item => { this.selectedOrders.forEach(item => {
if(item.releaseNum > item.sumNum - item.releaseNum){ if(item.releaseNum > item.sumNum - item.release){
errNos.push(item.orderNo) errNos.push(item.orderNo)
} }
}) })
...@@ -172,7 +173,7 @@ export default { ...@@ -172,7 +173,7 @@ export default {
this.$emit('success') this.$emit('success')
}) })
}) })
} }
} }
...@@ -192,4 +193,4 @@ export default { ...@@ -192,4 +193,4 @@ export default {
margin-right:10px; margin-right:10px;
} }
} }
</style> </style>
\ No newline at end of file
<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()
}
},
// 剩余数据
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.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>
...@@ -31,14 +31,19 @@ ...@@ -31,14 +31,19 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('体积') + '(m³)'" prop="volume" /> <el-table-column :label="$t('体积') + '(m³)'" prop="volume" />
<el-table-column :label="$t('重量') + '(kg)'" prop="weight" /> <el-table-column :label="$t('重量') + '(kg)'" prop="weight" />
<el-table-column :label="$t('数量(个)')" prop="quantityAll" /> <el-table-column :label="$t('数量(个)')" prop="quantity" />
<!--<el-table-column :label="$t('入仓快递单号')" prop="expressNo" />--> <!--<el-table-column :label="$t('入仓快递单号')" prop="expressNo" />-->
<!--<el-table-column :label="$t('首次入仓时间')" prop="inTime" > <!--<el-table-column :label="$t('首次入仓时间')" prop="inTime" >
<template slot-scope="{row}">{{row.inTime|parseTime}}</template> <template slot-scope="{row}">{{row.inTime|parseTime}}</template>
</el-table-column>--> </el-table-column>-->
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList" > <el-table-column :label="$t('储位')" prop="orderLocationBackVOList" >
<template slot-scope="{row}"> <template slot-scope="{row}">
{{getLocationName(row.orderLocationBackVOList)}} <!--{{getLocationName(row.orderLocationList)}}-->
<warehouse-area-select
v-model="row.orderLocationList"
readonly
:warehouse-id="warehouseId"
></warehouse-area-select>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -46,13 +51,17 @@ ...@@ -46,13 +51,17 @@
</template> </template>
<script> <script>
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect/index.vue";
export default { export default {
name: "WarehouseRecord", name: "WarehouseRecord",
components: {WarehouseAreaSelect},
props:{ props:{
list:{ list:{
type: Array, type: Array,
default: [] default: []
}, },
warehouseId: Number,
appendToBody: Boolean appendToBody: Boolean
}, },
data(){ data(){
......
...@@ -142,10 +142,8 @@ ...@@ -142,10 +142,8 @@
</p> </p>
</div> </div>
<div> <div>
<el-button v-if="index==0" disabled type="primary" @click="addShop(index)">{{$t('放入')}}</el-button> <el-button type="primary" @click="addShop(index)">{{$t('放入')}}</el-button>
<el-button v-if="index!=0" 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>
<!--<el-button v-if="index==0" disabled type="primary" plain @click="deleteSplit(item.id)">{{$t('删除')}}</el-button>-->
<el-button :disabled="index < splitData.length - 1" type="primary" plain @click="deleteSplit(item.id)">{{$t('删除')}}</el-button>
</div> </div>
</div> </div>
<el-table v-if="item.orderSplitItemBackVOList" border :data="item.orderSplitItemBackVOList"> <el-table v-if="item.orderSplitItemBackVOList" border :data="item.orderSplitItemBackVOList">
...@@ -165,35 +163,35 @@ ...@@ -165,35 +163,35 @@
<el-table-column :label="$t('入仓体积')" align="center" > <el-table-column :label="$t('入仓体积')" align="center" >
<template slot-scope="scope"> <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> <span slot="append"></span>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('收费体积')" align="center" > <el-table-column :label="$t('收费体积')" align="center" >
<template slot-scope="scope"> <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> <span slot="append"></span>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('入仓重量')" align="center"> <el-table-column :label="$t('入仓重量')" align="center">
<template slot-scope="scope"> <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> <span slot="append">kg</span>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('收费重量')" align="center"> <el-table-column :label="$t('收费重量')" align="center">
<template slot-scope="scope"> <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> <span slot="append">kg</span>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('货值')" align="center"> <el-table-column :label="$t('货值')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.worth" @change="updateField(scope.row, 'worth')" size="mini" :disabled="index === 0"> <el-input v-model="scope.row.worth" @change="updateField(scope.row, 'worth')" size="mini" disabled>
<span slot="append">{{ $t('') }}</span> <span slot="append">{{ $t('') }}</span>
</el-input> </el-input>
</template> </template>
...@@ -205,8 +203,7 @@ ...@@ -205,8 +203,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')" align="center"> <el-table-column :label="$t('操作')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="index==0" disabled size="mini" type="text" icon="el-icon-delete" @click="removeShop(scope.row.id)">{{$t('移出')}}</el-button> <el-button size="mini" type="text" icon="el-icon-delete" @click="removeShop(scope.row.id)">{{$t('移出')}}</el-button>
<el-button v-else size="mini" type="text" icon="el-icon-delete" @click="removeShop(scope.row.id)">{{$t('移出')}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -214,11 +211,16 @@ ...@@ -214,11 +211,16 @@
</el-card> </el-card>
<work-flow xmlkey="split_order" v-model="selectedUsers"></work-flow> <work-flow xmlkey="split_order" v-model="selectedUsers"></work-flow>
<div slot="footer" class="card footer_btn" v-if="orderData.abnormalState==0"> <div slot="footer" class="card footer_btn" v-if="orderData.abnormalState==0">
<el-button v-if="orderData.inWarehouseState!=207" type="primary" @click="submitForm">{{$t('提交申请')}}</el-button> <template v-if="orderData.inWarehouseState!=207">
<el-button v-if="orderData.inWarehouseState!=207" plain type="primary" @click="$store.dispatch('tagsView/delCurrentView')">{{$t('取消')}}</el-button> <el-button type="primary" @click="submitForm">{{$t('提交申请')}}</el-button>
<el-button v-if="orderData.inWarehouseState==207" type="primary" @click="$router.push(`/bpm/process-instance/detail?id=`+orderApprovalBackVO.applyingFormId)">{{$t('审核中')}}</el-button> <el-button plain type="primary" @click="$store.dispatch('tagsView/delCurrentView')">{{$t('取消')}}</el-button>
<el-button v-if="orderData.inWarehouseState==207" plain type="primary" @click="dialogVisible = true">{{$t('取消审核')}}</el-button> <el-button type="primary" @click="reset">{{$t('重置')}}</el-button>
<el-button v-if="orderData.inWarehouseState==207" plain type="primary" @click="$store.dispatch('tagsView/delCurrentView')">{{$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> </div>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="$t('新建拆单')" :visible.sync="open" width="400px" append-to-body> <el-dialog :title="$t('新建拆单')" :visible.sync="open" width="400px" append-to-body>
...@@ -246,197 +248,155 @@ ...@@ -246,197 +248,155 @@
</el-dialog> </el-dialog>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog :title="$t('放入品名')" :visible.sync="shopOpen" width="1500px" append-to-body> <el-dialog :title="$t('放入品名')" :visible.sync="shopOpen" width="1500px" append-to-body>
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="120px" size="mini"> <el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="120px" inline>
<el-form-item :label="$t('中文品名')" v-if="splitData.length>0"> <el-form-item :label="$t('中文品名')">
<el-select v-model="shopForm.pordid" :placeholder="$t('请选择中文品名')" @change="changeProdTitleZh" clearable> <el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择中文品名')">
<el-option v-for="item in splitData[0].orderSplitItemBackVOList" :label="item.prodTitleZh" :value="item.id" :key="item.prodTitleZh" ></el-option> <el-option v-for="item in orderData.orderItemVOList" :label="item.prodTitleZh" :value="item.orderItemId" :key="item.prodTitleZh" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('英文品名')" v-if="splitData.length>0"> <el-form-item :label="$t('英文品名')">
<el-select v-model="shopForm.pordid" :placeholder="$t('请选择英文品名')" @change="changeProdTitleZh" clearable> <el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择英文品名')">
<el-option v-for="item in splitData[0].orderSplitItemBackVOList" :label="item.prodTitleEn" :value="item.id" :key="item.prodTitleEn" ></el-option> <el-option v-for="item in orderData.orderItemVOList" :label="item.prodTitleEn" :value="item.orderItemId" :key="item.prodTitleEn" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('剩余数据')"> <div class="page-title">{{$t('品名可拆数据')}}</div>
<div>{{$t('剩余箱数')}}{{ shopForm.sum || 0 }}</div> <div class="pl-20">
<div> <span class="mr-10">{{$t('箱数')}}:{{ leftData.num || 0 }}</span>
{{ $t('入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³ <span class="mr-10">{{ $t('入仓方数') }}:{{ leftData.volume || 0 }}m³</span>
{{ $t('收费方数') }}:{{ mainOrderItem.chargeVolume || 0 }}m³ <span class="mr-10">{{ $t('收费方数') }}:{{ leftData.chargeVolume || 0 }}m³</span>
</div> <span class="mr-10">{{ $t('入仓重量') }}:{{ leftData.weight || 0 }}kg</span>
<div> <span class="mr-10">{{ $t('收费重量') }}:{{ leftData.chargeWeight || 0 }}kg</span>
{{ $t('入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg <span class="mr-10">{{ $t('数量(个)') }}:{{ leftData.quantity || 0 }}</span>
{{ $t('收费重量') }}:{{ mainOrderItem.chargeWeight || 0 }}kg <span class="mr-10">{{ $t('剩余货值') }}:{{ leftData.worth || 0 }}{{ $t('元') }}</span>
</div> </div>
<div> <div class="page-title">{{$t('可拆入仓记录')}}</div>
{{ $t('数量(个)') }}:{{ mainOrderItem.quantity || 0 }} <el-table
{{ $t('剩余货值') }}:{{ mainOrderItem.worth || 0 }}{{ $t('元') }} :data="getOrderItemWarehouseIn(shopForm.orderItemId)"
</div> style="width: 100%">
</el-form-item> <el-table-column :label="$t('箱数')">
<el-card class="box-card" v-if="shopForm.specsRecordVOList"> <template v-slot="{row,$index}">
<div slot="header" class="clearfix"> <!--{{row.cartonsNum}}-->
<span>{{ $t('入仓记录') }}</span> {{getWarehouseLeftData(row, 'num')}}
<el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="deleteRow" :disabled="shopForm.specsRecordVOList.length <= 1"></el-button> <dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType"></dict-tag>
<el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="addRow" :disabled="!shopForm.orderItemId"></el-button> </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>
<div class="flex-between mt-20 mb-10">
<div class="page-title" style="margin: 0">
{{$t('已放入入仓记录')}}
</div> </div>
<!--<el-form ref="tableForm" :model="shopForm" size="mini">--> <el-button type="danger" size="mini" @click="clearAll">清空放入数据</el-button>
<el-table </div>
<el-table
:data="shopForm.specsRecordVOList" :data="shopForm.specsRecordVOList"
style="width: 100%"> style="width: 100%">
<el-table-column :label="$t('箱数')" width="200px"> <el-table-column :label="$t('箱数')" width="200px">
<template v-slot:header>
<span style="color: red">*</span>{{ $t('箱数') }}
</template>
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
<el-form-item class="flex" label-width="0" {{row.num}}
:prop="`specsRecordVOList.${$index}.num`" <dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType"></dict-tag>
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-75 tight" v-model="row.num" type="number"></el-input-number>
<dict-selector class="w-75" :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType" defaultable></dict-selector>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('包装类型')" width="100px"> <el-table-column :label="$t('包装类型')" width="100px">
<template v-slot:header>
<span style="color: red">*</span>{{ $t('包装类型') }}
</template>
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
<el-form-item label-width="0"> <dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="row.unit"></dict-tag>
<dict-selector :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="row.unit" defaultable></dict-selector>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="长(cm)"> <el-table-column label="长(cm)">
<template v-slot:header>
<span>{{ $t('') }}</span>(cm)
</template>
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
<el-form-item label-width="0"> {{row.boxGauge1}}
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge1" @blur="calcVolume(row)"/>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="宽(cm)"> <el-table-column label="宽(cm)">
<template v-slot:header>
<span>{{ $t('') }}</span>(cm)
</template>
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
<el-form-item label-width="0"> {{ row.boxGauge2 }}
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge2" @blur="calcVolume(row)" />
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="高(cm)"> <el-table-column label="高(cm)">
<template v-slot:header>
<span>{{ $t('') }}</span>(cm)
</template>
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
<el-form-item label-width="0"> {{ row.boxGauge3 }}
<el-input-number controls-position="right" :min="0" class="w-100 tight" v-model="row.boxGauge3" @blur="calcVolume(row)"/>
</el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="入仓体积(m³)"> <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="`specsRecordVOList.${$index}.volume`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" 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="`specsRecordVOList.${$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="`specsRecordVOList.${$index}.weight`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-100 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="`specsRecordVOList.${$index}.chargeWeight`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-100 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="`specsRecordVOList.${$index}.quantity`"
:rules="{required: quantityshow, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" 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}"> <template v-slot="{row,$index}">
<el-form-item label-width="0"> {{row.volume}}
<el-input v-model="row.expressNo"></el-input>
</el-form-item>
</template> </template>
</el-table-column> </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"> <el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template v-slot="{ row, column, $index }"> <template v-slot="{ row, column, $index }">
<!--<el-button type="primary" size="mini" @click="showLocation(row, $index)">{{ $t('选择储位') }}</el-button>--> {{getLocationName(row.orderLocationList)}}
<warehouse-area-select
v-model="row.orderLocationList"
:warehouse-id="splitData[splitItemIndex].dstWarehouseId"
></warehouse-area-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')"> <el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}"> <template v-slot="{ row, column, $index}">
<el-popconfirm <el-button size="mini" type="primary" @click="deleteRow($index)">删除</el-button>
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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!--</el-form>-->
</el-card> <div class="page-title">放入数据</div>
<el-form-item :label="$t('放入数据')"> <div class="pl-20 mb-10">
<div>{{$t('箱数')}}{{ putin.num || 0 }}</div> <span class="mr-10">{{$t('箱数')}}:{{ putin.num || 0 }},</span>
<div> <span class="mr-10">{{ $t('数量(个)') }}:{{ putin.quantity || 0 }},</span>
{{ $t('入仓方数') }}:{{ putin.volume || 0 }}m³ <span class="mr-10">{{ $t('入仓方数') }}:{{ putin.volume || 0 }}m³, </span>
{{ $t('收费方数') }}:{{ putin.chargeVolume || 0 }}m³ <span class="mr-10">{{ $t('入仓重量') }}:{{ putin.weight || 0 }}kg</span>
</div> </div>
<div> <el-form-item :label="$t('收费方数')" prop="chargeVolume">
{{ $t('入仓重量') }}:{{ putin.weight || 0 }}kg <el-input-number v-model="shopForm.chargeVolume" controls-position="right"></el-input-number>
{{ $t('收费重量') }}:{{ putin.chargeWeight || 0 }}kg </el-form-item>
</div> <el-form-item :label="$t('收费重量')" prop="chargeWeight">
<div> <el-input-number v-model="shopForm.chargeWeight" controls-position="right"></el-input-number>kg
{{ $t('数量(个)') }}:{{ putin.quantity || 0 }}
</div>
</el-form-item> </el-form-item>
<el-form-item :label="$t('放入货值')"> <el-form-item :label="$t('放入货值')">
...@@ -449,7 +409,7 @@ ...@@ -449,7 +409,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="shopAdd">{{$t('确定')}}</el-button> <el-button type="primary" @click="shopAdd" :disabled="!shopForm.specsRecordVOList || !shopForm.specsRecordVOList.length">{{$t('确定')}}</el-button>
<el-button @click="shopCancel">{{$t('取消')}}</el-button> <el-button @click="shopCancel">{{$t('取消')}}</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -485,7 +445,19 @@ ...@@ -485,7 +445,19 @@
</span> </span>
</el-dialog> </el-dialog>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord"></warehouse-record> <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> </div>
</template> </template>
...@@ -504,19 +476,23 @@ import { ...@@ -504,19 +476,23 @@ import {
import {getWarehouseList, quantityRequired} from '@/api/ecw/warehouse' import {getWarehouseList, quantityRequired} from '@/api/ecw/warehouse'
import {getChannelList} from '@/api/ecw/channel' import {getChannelList} from '@/api/ecw/channel'
import WorkFlow from '@/components/WorkFlow' import WorkFlow from '@/components/WorkFlow'
import {getOrder, splitItemUpdate} from '@/api/ecw/order' import {getOrder, getOrderWarehouseIn, splitItemUpdate} from '@/api/ecw/order'
import Decimal from 'decimal.js' import Decimal from 'decimal.js'
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect"; import WarehouseAreaSelect from "@/components/WarehouseAreaSelect";
import WarehouseDetail from "@/views/ecw/order/components/WarehouseDetail"; import WarehouseDetail from "@/views/ecw/order/components/WarehouseDetail";
import WarehouseRecord from "@/views/ecw/order/splitApply/components/WarehouseRecord"; 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 { export default {
name: "SplitApply", name: "SplitApply",
components: { components: {
Template,
WarehouseRecord, WarehouseRecord,
WarehouseDetail, WarehouseDetail,
WarehouseAreaSelect, WarehouseAreaSelect,
WorkFlow WorkFlow,
PutIn
}, },
data() { data() {
return { return {
...@@ -550,11 +526,11 @@ export default { ...@@ -550,11 +526,11 @@ export default {
}, },
// 表单校验 // 表单校验
shopRules: { shopRules: {
prodTitleZh: [{ required: true, message: this.$t("请选择中文品名"), trigger: "change" }], chargeVolume: [{ required: true, message: this.$t("请填写收费方数"), trigger: "blur" }],
prodTitleEn: [{ required: true, message: this.$t("请选择英文品名"), trigger: "change" }], chargeWeight: [{ required: true, message: this.$t("请填写收费重量"), trigger: "blur" }],
}, },
queryParams:{ queryParams:{
orderId:7, orderId: null,
lang:0 lang:0
}, },
query:{ query:{
...@@ -564,7 +540,13 @@ export default { ...@@ -564,7 +540,13 @@ export default {
splitItemIndex:0, splitItemIndex:0,
quantitySum:0, quantitySum:0,
// 当前查看的入仓记录 // 当前查看的入仓记录
currentWarehouseRecord: null currentWarehouseRecord: null,
// 订单入仓记录
warehouseInList: [],
// 当前选择的入仓记录ID
// selectedWarehouseInId: null,
// 当前正在放入的入仓记录
currentPutIn: null
}; };
}, },
async created() { async created() {
...@@ -579,48 +561,45 @@ export default { ...@@ -579,48 +561,45 @@ export default {
Promise.all([this.getList(), this.getOrder()]).then(res => { Promise.all([this.getList(), this.getOrder()]).then(res => {
console.log("拆单数据", this.splitData, this.splitData.length) console.log("拆单数据", this.splitData, this.splitData.length)
if(this.orderData.inWarehouseState != 207 && this.splitData.length){ if(this.orderData.inWarehouseState != 207 && this.splitData.length){
// 2023-05-20确认不需要询问,直接重置 this.reset()
// TODO 20230610 方便调试不删除,改完之后要取消注释
/*deleteAllSplit(this.queryParams.orderId).then(res => {
this.getList()
})*/
/*this.$confirm(this.$t('已有拆单数据,是否要重置?')).then(res => {
return deleteAllSplit(this.queryParams.orderId)
}).then(res => {
this.getList()
this.$message.success("重置成功")
})*/
} }
}) })
// 获取入仓记录
getOrderWarehouseIn(this.queryParams.orderId).then(res => {
this.warehouseInList = res.data
})
}, },
watch: { watch: {
//监听table这个对象 //监听table这个对象
tableData: { tableData: {
// 立即监听 // 立即监听
immediate: true, immediate: true,
handler() { handler() {
this.$nextTick(() => { this.$nextTick(() => {
const tds = document.querySelectorAll( const tds = document.querySelectorAll(
"#table .el-table__footer-wrapper tr>td" "#table .el-table__footer-wrapper tr>td"
); );
// colSpan合并列 // colSpan合并列
tds[1].colSpan = 5; tds[1].colSpan = 5;
tds[1].style.textAlign = "left"; tds[1].style.textAlign = "left";
tds[2].style.display = "none"; tds[2].style.display = "none";
tds[3].style.display = "none"; tds[3].style.display = "none";
tds[4].style.display = "none"; tds[4].style.display = "none";
tds[5].style.display = "none"; tds[5].style.display = "none";
}); });
},
}, },
// 关闭放入弹层的时候清理弹层表单内容
shopOpen(show){
if(!show){
this.shopForm = {}
}
}
}, },
// 关闭放入弹层的时候清理弹层表单内容
shopOpen(show){
if(!show){
this.shopForm = {}
}
},
// 切换品名需要重置已放入的记录
'shopForm.orderItemId'(){
this.shopForm.specsRecordVOList = []
}
},
computed:{ computed:{
getDictData(){ getDictData(){
return (type, value) => getDictData(type, value) || {} return (type, value) => getDictData(type, value) || {}
...@@ -638,32 +617,145 @@ export default { ...@@ -638,32 +617,145 @@ export default {
if(!this.orderItem.orderItemId || !this.splitData.length || !this.splitData[0].orderSplitItemBackVOList) return {} if(!this.orderItem.orderItemId || !this.splitData.length || !this.splitData[0].orderSplitItemBackVOList) return {}
return this.splitData[0].orderSplitItemBackVOList.find(item => item.orderItemId == this.orderItem.orderItemId) || {} return this.splitData[0].orderSplitItemBackVOList.find(item => item.orderItemId == this.orderItem.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){
// 每个品名都要累减收费数据
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(){ putin(){
let data = { let data = {
num: new Decimal(0), num: new Decimal(0),
volume: new Decimal(0), volume: new Decimal(0),
chargeVolume: new Decimal(0),
weight: new Decimal(0), weight: new Decimal(0),
chargeWeight: new Decimal(0),
quantity: new Decimal(0) quantity: new Decimal(0)
} }
this.shopForm.specsRecordVOList && this.shopForm.specsRecordVOList.forEach(item => { this.shopForm.specsRecordVOList && this.shopForm.specsRecordVOList.forEach(item => {
data.num = data.num.plus(new Decimal(item.num || 0)) data.num = data.num.plus(new Decimal(item.num || 0))
data.volume = data.volume.plus(new Decimal(item.volume || 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.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)) data.quantity = data.quantity.plus(new Decimal(item.quantity || 0))
}) })
return { return {
num: data.num.toNumber(), num: data.num.toNumber(),
volume: data.volume.toNumber(), volume: data.volume.toNumber(),
chargeVolume: data.chargeVolume.toNumber(),
weight: data.weight.toNumber(), weight: data.weight.toNumber(),
chargeWeight: data.chargeWeight.toNumber(),
quantity: data.quantity.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 => {
split.orderSplitItemBackVOList.forEach(splitItem => {
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: { methods: {
...@@ -767,47 +859,6 @@ export default { ...@@ -767,47 +859,6 @@ export default {
return return
} }
// 判断体积和重量,子单和必须等于父单
// 1.将拆单中的商品项数据汇总保存到orderItem
this.splitData.forEach(item => {
item.orderSplitItemBackVOList.forEach(splitItem => {
let orderItem = this.orderData.orderItemVOList.find(orderItem => orderItem.orderItemId == splitItem.orderItemId)
if(!orderItem.splitSum){
orderItem.splitSum = {
volume: new Decimal(splitItem.volume || 0),
weight: new Decimal(splitItem.weight|| 0)
}
}else{
orderItem.splitSum.volume = orderItem.splitSum.volume.plus(splitItem.volume || 0)
orderItem.splitSum.weight = orderItem.splitSum.weight.plus(splitItem.weight || 0)
}
})
})
// 2. 遍历商品项 对比数据是否符合
let prods = [] // 数据不符合要求的商品
// 挂在到window测试
window.orderData = this.orderData
this.orderData.orderItemVOList.forEach(item => {
// 未入仓的不检查
if(!item.warehouseInInfoVO){
return
}
// 没拆单的不检查
if(!item.splitSum){
// prods.push(this.$l(item, 'prodTitle'))
return
}
if(item.splitSum.volume.toNumber() != item.warehouseInInfoVO.volume || item.splitSum.weight.toNumber() != item.warehouseInInfoVO.weight){
prods.push(this.$l(item, 'prodTitle'))
}
})
if(prods.length){
return this.$alert( this.$t("{prods}等商品拆单总数据跟主单不匹配", {prods: prods.join(',')}))
}
// if(this.selectedUsers.length==0){
// this.$modal.msgError("请选择抄送人")
// return
// }
var params = { var params = {
orderId:this.queryParams.orderId, orderId:this.queryParams.orderId,
copyUserId:this.selectedUsers copyUserId:this.selectedUsers
...@@ -820,6 +871,8 @@ export default { ...@@ -820,6 +871,8 @@ export default {
addShop(index){ addShop(index){
this.splitItemIndex = index this.splitItemIndex = index
this.shopOpen = true this.shopOpen = true
// 重置表单数据
this.shopForm = {specsRecordVOList:[]}
}, },
addSplit(){ addSplit(){
this.form.transportId = this.orderData.transportId this.form.transportId = this.orderData.transportId
...@@ -832,7 +885,7 @@ export default { ...@@ -832,7 +885,7 @@ export default {
} }
this.open = true this.open = true
}, },
changeProdTitleZh(val){ /*changeProdTitleZh(val){
var list = [] var list = []
list = this.splitData[0].orderSplitItemBackVOList.filter(item=>item.id == val) list = this.splitData[0].orderSplitItemBackVOList.filter(item=>item.id == val)
this.shopForm.sum = list[0].num this.shopForm.sum = list[0].num
...@@ -846,7 +899,8 @@ export default { ...@@ -846,7 +899,8 @@ export default {
} }
this.numcheck() this.numcheck()
}, },*/
// 查询数量是否必填
numcheck(){ numcheck(){
quantityRequired(this.orderData.lineId).then(res=>{ quantityRequired(this.orderData.lineId).then(res=>{
this.quantityshow = res.data this.quantityshow = res.data
...@@ -905,6 +959,13 @@ export default { ...@@ -905,6 +959,13 @@ export default {
if (!valid) { if (!valid) {
return; 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 => { this.shopForm.specsRecordVOList.forEach(item => {
item.boxGauge = `${item.boxGauge1}*${item.boxGauge2}*${item.boxGauge3}` item.boxGauge = `${item.boxGauge1}*${item.boxGauge2}*${item.boxGauge3}`
}) })
...@@ -914,15 +975,33 @@ export default { ...@@ -914,15 +975,33 @@ export default {
orderSplitId:this.splitData[this.splitItemIndex].id, orderSplitId:this.splitData[this.splitItemIndex].id,
remark:this.shopForm.remark, remark:this.shopForm.remark,
volume: this.putin.volume, volume: this.putin.volume,
chargeVolume: this.putin.chargeVolume, chargeVolume: this.shopForm.chargeVolume,
weight: this.putin.weight, weight: this.putin.weight,
chargeWeight: this.putin.chargeWeight, chargeWeight: this.shopForm.chargeWeight,
worth: this.shopForm.worth, worth: this.shopForm.worth || 0,
specsRecordVOList:this.shopForm.specsRecordVOList specsRecordVOList:this.shopForm.specsRecordVOList
} }
if(this.quantityshow){
params.quantity = this.shopForm.quantity // 体积重量不能为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=>{ createSplitItem(params).then(async res=>{
this.$message.success(this.$t("放入成功")); this.$message.success(this.$t("放入成功"));
await this.getList() await this.getList()
...@@ -966,14 +1045,21 @@ export default { ...@@ -966,14 +1045,21 @@ export default {
}) })
}, },
// 添加一行 // 添加一行
addRow(){ /*addRow(){
if(!this.shopForm.specsRecordVOList){ if(!this.shopForm.specsRecordVOList){
this.$set(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({ this.shopForm.specsRecordVOList.push({
orderLocationList: [] specificationType, boxGauge1, boxGauge2, boxGauge3, volume, weight,num,
orderLocationList: this.currentWarehouseItem.orderLocationBackVOList
}) })
}, },*/
// 删除一行,可选参数index表上行号,参数不是数字则删除最后一行 // 删除一行,可选参数index表上行号,参数不是数字则删除最后一行
deleteRow(index){ deleteRow(index){
const spliceIndex = typeof index !== 'number' ? this.shopForm.specsRecordVOList.length - 1 : index const spliceIndex = typeof index !== 'number' ? this.shopForm.specsRecordVOList.length - 1 : index
...@@ -1000,6 +1086,51 @@ export default { ...@@ -1000,6 +1086,51 @@ export default {
return this.$message.info(this.$t('暂无入仓记录')) return this.$message.info(this.$t('暂无入仓记录'))
} }
this.currentWarehouseRecord = row.specsRecordVOList 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(){
deleteAllSplit(this.queryParams.orderId).then(res => {
this.getList()
})
} }
} }
} }
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('创建人')" align="center" prop="creator" width="180"> <el-table-column :label="$t('创建人')" align="center" prop="creator" width="180">
<template v-slot="{row}"> <template v-slot="{row}">
{{(row.creator && allSimplList.length) && allSimplList.find(i => i.id == row.creator).nickname}} {{(row.creator && allSimplList.length) && allSimplList.find(i => i.id == row.creator) && allSimplList.find(i => i.id == row.creator).nickname}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180"> <el-table-column :label="$t('创建时间')" align="center" prop="createTime" width="180">
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('修改人')" align="center" prop="updater" width="180"> <el-table-column :label="$t('修改人')" align="center" prop="updater" width="180">
<template v-slot="{row}"> <template v-slot="{row}">
{{ (row.updater && allSimplList.length) && allSimplList.find(i => i.id == row.updater).nickname}} {{ (row.updater && allSimplList.length) && allSimplList.find(i => i.id == row.updater) && allSimplList.find(i => i.id == row.updater).nickname}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('修改时间')" align="center" prop="createTime" width="180"> <el-table-column :label="$t('修改时间')" align="center" prop="createTime" width="180">
......
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