Commit 3413c7fa authored by 邓春圆's avatar 邓春圆

Merge remote-tracking branch 'origin/release' into release

parents 51416852 a45f0db6
......@@ -50,7 +50,12 @@ export default {
padding: 50px;
text-align: center;
}
$sizes: 0, 10,20,30,50,100,150,200,300,500,800,1000;
/*给el-input-number一个紧凑的样式*/
.el-input-number.is-controls-right.tight .el-input__inner{
padding-right: 30px;
padding-left: 5px;
}
$sizes: 0, 10,20,30,50,75,100,150,200,300,500,800,1000;
@for $i from 1 through length($sizes){
$item: nth($sizes, $i);
.ml-#{$item}{
......
......@@ -5,7 +5,7 @@ export function listOperateLog(query) {
return request({
url: '/system/operate-log/page',
method: 'get',
timeout: 5*6000,
timeout: 5*60000,
params: query
})
}
......@@ -16,7 +16,7 @@ export function exportOperateLog(query) {
url: '/system/operate-log/export',
method: 'get',
params: query,
timeout: 5*6000,
timeout: 5*60000,
responseType: 'blob'
})
}
......@@ -201,7 +201,7 @@ export default {
/* doc.save("a4.pdf");
return Promise.reject() */
let form = new FormData()
let file = this.currRow.orderNo + '-' + orderData.marks + '.pdf' //this.selfNo + '-' + this.currRow.tidanNo + '.pdf'
let file = this.selfNo + "-" + this.currRow.tidanNo + ' ' + orderData.marks + '.pdf' //this.selfNo + '-' + this.currRow.tidanNo + '.pdf'
form.append('file', new File([doc.output('arraybuffer')], file, {type: 'application/pdf'}))
form.append('path', `admin/shipment/${this.selfNo}/pdf/${file}`) // 最前面不能有/,否则返回的url会有两个/
......
......@@ -141,42 +141,47 @@
</el-table-column>
<el-table-column :label="$t('入仓体积')" align="center" >
<template slot-scope="scope">
<el-input v-model="scope.row.volume" @change="updateField(scope.row, 'volume')" size="mini" :disabled="index === 0">
<el-input v-model="scope.row.volume" @change="updateField(scope.row, 'volume')" size="mini" disabled>
<span slot="append"></span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('收费体积')" align="center" >
<template slot-scope="scope">
<el-input v-model="scope.row.chargeVolume" @change="updateField(scope.row, 'chargeVolume')" size="mini" :disabled="index === 0">
<el-input v-model="scope.row.chargeVolume" @change="updateField(scope.row, 'chargeVolume')" size="mini" disabled>
<span slot="append"></span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('入仓重量')" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.weight" @change="updateField(scope.row, 'weight')" size="mini" :disabled="index === 0">
<el-input v-model="scope.row.weight" @change="updateField(scope.row, 'weight')" size="mini" disabled>
<span slot="append">kg</span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('收费重量')" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.chargeWeight" @change="updateField(scope.row, 'chargeWeight')" size="mini" :disabled="index === 0">
<el-input v-model="scope.row.chargeWeight" @change="updateField(scope.row, 'chargeWeight')" size="mini" disabled>
<span slot="append">kg</span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('货值')" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.worth" @change="updateField(scope.row, 'worth')" size="mini" :disabled="index === 0">
<el-input v-model="scope.row.worth" @change="updateField(scope.row, 'worth')" size="mini">
<span slot="append">{{ $t('美元') }}</span>
</el-input>
</template>
</el-table-column>
<el-table-column :label="$t('箱数')" align="center">
<template slot-scope="scope">
<span>{{scope.row.num}}</span>
<el-button type="text" @click="showWarehouse(scope.row)">{{scope.row.num}}</el-button>
</template>
</el-table-column>
<el-table-column :label="`${$t('数量')}($t('个')`" align="center">
<template slot-scope="scope">
<span>{{scope.row.quantity}}</span>
</template>
</el-table-column>
......@@ -205,80 +210,217 @@
</div>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="$t('放入品名')" :visible.sync="shopOpen" width="500px" append-to-body>
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="150px">
<el-row>
<el-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-item :label="$t('中文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择中文品名')" @change="onProdChange">
<el-option v-for="item in orderItems" :label="item.prodTitleZh" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item :label="$t('英文品名')+':'" prop="orderItemId">
<el-select v-model="shopForm.orderItemId" :placeholder="$t('请选择英文品名')" @change="onProdChange">
<el-option v-for="item in orderItems" :label="item.prodTitleEn" :value="item.orderItemId" :key="item.id" :disabled="itemDisabled(item)"></el-option>
</el-select>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item :label="$t('剩余箱数')+':'">
{{shopForm.leftNum||0}}
</el-form-item>
</el-col>
<!--剩余数量计算不出来,显示没意义-->
<!--<el-col :span="12" v-show="isQuantity">
<el-form-item :label="$t('剩余数量(个)')+':'">
{{shopForm.leftQuantity||0}}
</el-form-item>
</el-col>-->
</el-row>
<el-form-item :label="$t('放入箱数')+':'">
<el-input-number v-model="shopForm.num" controls-position="right" :min="0" :max="+shopForm.leftNum" @change="calcAverg"></el-input-number>
</el-form-item>
<el-form-item v-if="mainOrderItem.orderItemId" label-width="0">
{{ $t('剩余入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³,
{{$t('剩余收费方数')}}:{{ mainOrderItem.chargeVolume || 0 }}m³
</el-form-item>
<el-form-item :label="$t('入仓体积')">
<el-input-number v-model="shopForm.volume" controls-position="right" :min="0" :max="mainOrderItem.volume"></el-input-number>
</el-form-item>
<el-form-item :label="$t('收费体积')">
<el-input-number v-model="shopForm.chargeVolume" controls-position="right" :min="0" :max="mainOrderItem.chargeVolume"></el-input-number>
</el-form-item>
<el-form-item v-if="mainOrderItem.orderItemId" label-width="0">
{{ $t('剩余入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg,
{{$t('剩余收费重量')}}:{{ mainOrderItem.chargeWeight || 0 }}kg
<el-form-item :label="$t('剩余数据')">
<div>{{$t('剩余箱数')}}{{ shopForm.sum || 0 }}</div>
<div>
{{ $t('入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³
{{ $t('收费方数') }}:{{ mainOrderItem.chargeVolume || 0 }}m³
</div>
<div>
{{ $t('入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg
{{ $t('收费重量') }}:{{ mainOrderItem.chargeWeight || 0 }}kg
</div>
<div>
{{ $t('数量(个)') }}:{{ mainOrderItem.quantity || 0 }}
{{ $t('剩余货值') }}:{{ mainOrderItem.worth || 0 }}{{ $t('美元') }}
</div>
</el-form-item>
<el-form-item :label="$t('入仓重量')">
<el-input-number v-model="shopForm.weight" controls-position="right" :min="0" :max="mainOrderItem.weight"></el-input-number>
</el-form-item>
<el-form-item :label="$t('收费重量')">
<el-input-number v-model="shopForm.chargeWeight" controls-position="right" :min="0" :max="mainOrderItem.chargeWeight"></el-input-number>
</el-form-item>
<el-form-item v-if="mainOrderItem.orderItemId" label-width="0">
{{ $t('剩余货值') }}:{{ mainOrderItem.worth || 0 }}{{ $t('美元') }}
<el-card class="box-card" v-if="shopForm.specsRecordVOList">
<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="shopForm.specsRecordVOList.length <= 1"></el-button>
<el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="addRow" :disabled="!shopForm.orderItemId"></el-button>
</div>
<el-table
:data="shopForm.specsRecordVOList"
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="`specsRecordVOList.${$index}.num`"
: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>
</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="`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: 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('放入货值')">
<el-input-number v-model="shopForm.worth" controls-position="right" :min="0" :max="mainOrderItem.worth"></el-input-number>
</el-form-item>
<!--按照原型这里需要显示剩余数量,但是事实无法计算剩余数量,因为已装数量是未知的-->
<el-form-item :label="$t('放入数量(个)')+':'" prop="quantity" v-if="isQuantity">
<!--<el-form-item :label="$t('放入数量(个)')+':'" prop="quantity" v-if="isQuantity">
<el-input-number v-model="shopForm.quantity" controls-position="right" :min="0" :max="mainOrderItem.quantity || undefined"></el-input-number>
</el-form-item>
</el-form-item>-->
<el-form-item :label="$t('备注信息')+':'">
<el-input v-model="shopForm.remarks"></el-input>
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="shopAdd">{{$t('确定')}}</el-button>
<el-button @click="shopCancel">{{$t('取消')}}</el-button>
</div>
</el-dialog>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body></warehouse-record>
</div>
</template>
......@@ -296,11 +438,17 @@ import {getOrder, splitItemUpdate} from "@/api/ecw/order";
import { serviceMsg, toReviewDetail } from "../../utils";
import { createApproval, approvalCancel, splitList } from "@/api/ecw/boxSea";
import Decimal from "decimal.js";
import Warehouse from "@/views/ecw/order/warehousing/components/Warehouse";
import WarehouseRecord from "@/views/ecw/order/splitApply/components/WarehouseRecord";
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect";
export default {
name: "splitOrder",
inheritAttrs: false,
components: {
WarehouseAreaSelect,
WarehouseRecord,
Warehouse,
WorkFlow
},
props: {
......@@ -343,7 +491,9 @@ export default {
isQuantity: false,
// 主单数据
mainOrder: {orderSplitItemBackVOList: {}}
mainOrder: {orderSplitItemBackVOList: {}},
// 当前查看的入仓记录
currentWarehouseRecord: null
};
},
created() {
......@@ -395,6 +545,33 @@ export default {
mainOrderItem(){
if(!this.shopForm.orderItemId || !this.mainOrder.orderSplitItemBackVOList.length) return {}
return this.mainOrder.orderSplitItemBackVOList.find(item => item.orderItemId == this.shopForm.orderItemId) || {}
},
// 放入数据
putin(){
let data = {
num: new Decimal(0),
volume: new Decimal(0),
chargeVolume: new Decimal(0),
weight: new Decimal(0),
chargeWeight: new Decimal(0),
quantity: new Decimal(0)
}
this.shopForm.specsRecordVOList && this.shopForm.specsRecordVOList.forEach(item => {
data.num = data.num.plus(new Decimal(item.num || 0))
data.volume = data.volume.plus(new Decimal(item.volume || 0))
data.chargeVolume = data.chargeVolume.plus(new Decimal(item.chargeVolume || 0))
data.weight = data.weight.plus(new Decimal(item.weight || 0))
data.chargeWeight = data.chargeWeight.plus(new Decimal(item.chargeWeight || 0))
data.quantity = data.quantity.plus(new Decimal(item.quantity || 0))
})
return {
num: data.num.toNumber(),
volume: data.volume.toNumber(),
chargeVolume: data.chargeVolume.toNumber(),
weight: data.weight.toNumber(),
chargeWeight: data.chargeWeight.toNumber(),
quantity: data.quantity.toNumber()
}
}
},
methods: {
......@@ -551,11 +728,16 @@ export default {
// 如果主单商品项的入仓箱数小于可装箱数,则取商品项数据
leftNum = Math.min(leftNum, this.mainOrderItem.num)
// 放入箱数
this.$set(this.shopForm, 'num', leftNum)
this.calcAverg()
// this.$set(this.shopForm, 'num', leftNum)
// 默认给一个入仓记录
if(!this.shopForm.specsRecordVOList || !this.shopForm.specsRecordVOList.length){
this.addRow()
}
// this.calcAverg()
},
// 按比例计算体积重量的默认值
calcAverg(){
/*calcAverg(){
// 装箱比例
const rate = this.shopForm.num / this.mainOrderItem.num
......@@ -567,7 +749,7 @@ export default {
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) {
......@@ -588,43 +770,33 @@ export default {
shopAdd() {
this.$refs["shopForm"].validate((valid) => {
if (valid) {
// 放入箱数自动计算出来的,所以不需要在做判断了
/*
// 输入箱数大于实装箱数
const total = this.totalSplitNum();
const canSplitNum = Decimal.sub(
this.currRow.num,
this.currRow.installNum
).toNumber();
const remain = Decimal.sub(canSplitNum, total).toNumber();
if (this.shopForm.num > remain) {
this.$message.error(this.$t("放入箱数不能大于总箱数"));
return;
}*/
if (this.shopForm.num === 0) {
if (this.putin.num === 0) {
this.$message.error(this.$t("放入箱数不能为0"));
return;
}
if (this.shopForm.quantity === 0 && this.isQuantity) {
if (this.putin.quantity === 0 && this.isQuantity) {
this.$message.error(this.$t("放入数量(个)不能为0"));
return;
}
this.shopForm.specsRecordVOList.forEach(item => {
item.boxGauge = `${item.boxGauge1}*${item.boxGauge2}*${item.boxGauge3}`
})
let params = {
num: this.shopForm.num,
num: this.putin.num,
// quantity: this.shopForm.quantity,
orderItemId: this.shopForm.orderItemId,
orderSplitId: this.splitData.id,
remarks: this.shopForm.remarks,
volume: this.shopForm.volume,
weight: this.shopForm.weight,
chargeWeight: this.shopForm.chargeWeight,
chargeVolume: this.shopForm.chargeVolume,
worth: this.shopForm.worth
volume: this.putin.volume,
weight: this.putin.weight,
chargeWeight: this.putin.chargeWeight,
chargeVolume: this.putin.chargeVolume,
worth: this.shopForm.worth || 0,
specsRecordVOList:this.shopForm.specsRecordVOList
};
// 按数量计费的才需要传递数量
if(this.isQuantity){
params.quantity = this.shopForm.quantity
params.quantity = this.putin.quantity
}
createSplitItem(params).then((res) => {
this.$message.success(this.$t("放入成功"));
......@@ -667,6 +839,42 @@ export default {
toReviewDetail.apply(this, [cabinetSplitInfo.bpmProcessId]);
this.$emit("closeDialog2", "close");
},
// 添加一行
addRow(){
if(!this.shopForm.specsRecordVOList){
this.$set(this.shopForm,'specsRecordVOList',[])
}
this.shopForm.specsRecordVOList.push({
orderLocationList: []
})
},
// 删除一行,可选参数index表上行号,参数不是数字则删除最后一行
deleteRow(index){
const spliceIndex = typeof index !== 'number' ? this.shopForm.specsRecordVOList.length - 1 : index
this.shopForm.specsRecordVOList.splice(spliceIndex, 1)
},
// 计算体积
calcVolume(row){
let volume = Decimal(row.boxGauge1 || 0)
.times(Decimal(row.boxGauge2 || 0))
.times(Decimal(row.boxGauge3 || 0)).div(1000000)
// 如果是箱的单位要乘以箱数
if(row.specificationType === 1) {
row.volume = volume.times(Decimal(row.num || 0))
}
// 最低0.01
volume = Math.max(0.01, volume.toNumber().toFixed(2))
this.$set(row, 'volume', volume)
this.$set(row, 'chargeVolume', volume)
},
// 显示入库记录
showWarehouse(row){
if(!row.specsRecordVOList){
return this.$message.info(this.$t('暂无入仓记录'))
}
this.currentWarehouseRecord = row.specsRecordVOList
}
},
};
</script>
......
......@@ -785,7 +785,7 @@ export default {
},
/* 获取参数 */
getParams() {
const { rucangtime = [] } = this.queryParams;
let rucangtime = this.queryParams.rucangtime?this.queryParams.rucangtime:[]
return {
...this.queryParams,
...this.$attrs.params,
......
......@@ -376,7 +376,7 @@
<template slot-scope="scope">
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span>
<div v-else>
<div v-for="itemAmount in scope.row.collectionAmount">{{$i18n.locale=='zh_CN'?(itemAmount?itemAmount.currencyNameZh:''):(itemAmount?itemAmount.currencyNameEn:'')}}: {{ itemAmount.amount||''}}</div>
<div v-for="itemAmount in scope.row.collectionAmount">{{$i18n.locale=='zh_CN'?(itemAmount?itemAmount.currencyNameZh:''):(itemAmount?itemAmount.currencyNameEn:'')}}: {{ itemAmount?itemAmount.amount:''}}</div>
<!-- <div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1].toFixed(6) }}</div>
<div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2].toFixed(6) }}</div>
<div v-if="scope.row.collectionAmount[3]">{{ $t('西非法郎') }}: {{ scope.row.collectionAmount[3].toFixed(6) }}</div> -->
......@@ -746,8 +746,16 @@ export default {
};
},
activated(){
console.log(11)
// this.getList();
if (this.$route.query.id) {
this.flag = true
this.id = this.$route.query.id;
this.getReceivableData()
}
console.log(this.$route.query.receiptId)
if (this.$route.query.receiptId && this.$route.query.receiptId !== '0') {
this.receiptId = this.$route.query.receiptId;
this.getReceivableInfo()
}
},
async created() {
getUserProfile().then(res => {
......@@ -775,69 +783,11 @@ export default {
if (that.$route.query.id) {
this.flag = true
this.id = this.$route.query.id;
console.log(this.id)
getReceiptInfoByIds({ id: this.id }).then(res => {
if(res.data.rateValidateDate) res.data.rateValidateDate = dayjs(res.data.rateValidateDate).format('YYYY-MM-DD HH:mm:ss')
this.form = Object.assign({}, this.form, res.data)
})
await getInvoicingItem({ id: this.id }).then(res => {
this.list = [...res.data]
this.list.map(v=>{
if(!v.taxPoint){
v.taxAmount = v.totalAmount
}
})
})
getReceiptAccountList({ id: this.id }).then(res => {
if (res.data.length > 0) {
// totalAmount
res.data = [...res.data, {
type: 'total',
writeOffAmount: res.data.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0),
collectionAmount: []
}]
}
this.$set(this.form, 'receiptAccountList', [...res.data])
this.$nextTick(() => {
// const dollarList = this.list.filter(v => v.currencyId === 1)
// const discountDollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const d = this.form.receiptAccountList.find(v => v.currencyId == 1)
// d && (d.discountTotal = discountDollar)
// const rmbList = this.list.filter(v => v.currencyId === 2)
// const discountRmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const r = this.form.receiptAccountList.find(v => v.currencyId == 2)
// r && (r.discountTotal = discountRmb)
// const nairaList = this.list.filter(v => v.currencyId === 3)
// const discountNaira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const n = this.form.receiptAccountList.find(v => v.currencyId == 3)
// n && (n.discountTotal = discountNaira)
this.form.receiptAccountList.forEach((item, index) => {
this.rateChange(item, index)
});
this.calculation()
})
})
this.getReceivableData()
}
if (that.$route.query.receiptId && that.$route.query.receiptId !== '0') {
this.receiptId = this.$route.query.receiptId;
getReceivableInfoByIds({ id: this.receiptId }).then(res => {
this.list = [{...res.data}]
this.list.map(v=>{
if(!v.taxPoint){
v.taxAmount = v.totalAmount
}
})
this.calculation()
getOrder(res.data.orderId).then(response => {
// console.log(response.data)
if(response.data.customerId) this.$set(this.form,'customerId',response.data.customerId)
})
})
this.getReceivableInfo()
}
// this.getList();
......@@ -904,6 +854,69 @@ export default {
}
},
methods: {
getReceivableData(){
getReceiptInfoByIds({ id: this.id }).then(res => {
if(res.data.rateValidateDate) res.data.rateValidateDate = dayjs(res.data.rateValidateDate).format('YYYY-MM-DD HH:mm:ss')
this.form = Object.assign({}, this.form, res.data)
})
getInvoicingItem({ id: this.id }).then(res => {
this.list = [...res.data]
this.list.map(v=>{
if(!v.taxPoint){
v.taxAmount = v.totalAmount
}
})
})
getReceiptAccountList({ id: this.id }).then(res => {
if (res.data.length > 0) {
// totalAmount
res.data = [...res.data, {
type: 'total',
writeOffAmount: res.data.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0),
collectionAmount: []
}]
}
this.$set(this.form, 'receiptAccountList', [...res.data])
this.$nextTick(() => {
// const dollarList = this.list.filter(v => v.currencyId === 1)
// const discountDollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const d = this.form.receiptAccountList.find(v => v.currencyId == 1)
// d && (d.discountTotal = discountDollar)
// const rmbList = this.list.filter(v => v.currencyId === 2)
// const discountRmb = rmbList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const r = this.form.receiptAccountList.find(v => v.currencyId == 2)
// r && (r.discountTotal = discountRmb)
// const nairaList = this.list.filter(v => v.currencyId === 3)
// const discountNaira = nairaList.reduce((total, currentValue) => NP.plus(total, currentValue.discountTotal || 0), 0)
// const n = this.form.receiptAccountList.find(v => v.currencyId == 3)
// n && (n.discountTotal = discountNaira)
this.form.receiptAccountList.forEach((item, index) => {
this.rateChange(item, index)
});
this.calculation()
})
})
},
getReceivableInfo(){
getReceivableInfoByIds({ id: this.receiptId }).then(res => {
this.list = [{...res.data}]
this.list.map(v=>{
if(!v.taxPoint){
v.taxAmount = v.totalAmount
}
})
this.calculation()
getOrder(res.data.orderId).then(response => {
// console.log(response.data)
if(response.data.customerId) this.$set(this.form,'customerId',response.data.customerId)
})
})
},
getCurrencyLabel(id){
var label = this.currencyList.filter(item=>item.id == id)
if(label.length>0) return this.$i18n.locale=='zh_CN'?label[0].titleZh:label[0].titleEn
......@@ -1414,6 +1427,7 @@ export default {
const list = [...this.list]
delete list[index]
this.list = list.filter(v => v)
this.calculation()
},
/** 搜索按钮操作 */
handleQuery() {
......
......@@ -679,8 +679,10 @@ export default {
}
// total = NP.plus(total, item.writeOffAmount)
})
console.log(total);
let portion = NP.divide(total,amountTotal)
console.log(portion);
if(!portion) return 0
return (portion*100).toFixed(2)
}
},
......
......@@ -46,35 +46,48 @@
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="row.brandType" />
</template>
</el-table-column>
<el-table-column :label="$t('体积')">
<el-table-column :label="$t('入仓体积')">
<template slot-scope="{row}">{{row.volume}}</template>
</el-table-column>
<el-table-column :label="$t('重量')">
<el-table-column :label="$t('收费体积')">
<template slot-scope="{row}">{{row.chargeVolume}}</template>
</el-table-column>
<el-table-column :label="$t('入仓重量')">
<template slot-scope="{row}">{{row.weight}}kg</template>
</el-table-column>
<el-table-column :label="$t('收费重量')">
<template slot-scope="{row}">{{row.chargeWeight}}kg</template>
</el-table-column>
<el-table-column :label="$t('箱数')">
<template slot-scope="{row}">{{row.num}}</template>
<template slot-scope="{row}">
<el-button type="text" @click="showWarehouseRecord(row)">{{row.num}}</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('数量')">
<template slot-scope="{row}">{{row.quantity}}</template>
</el-table-column>
</el-table>
</template>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body></warehouse-record>
</div>
</template>
<script>
import {getOrder} from '@/api/ecw/order'
import {getBoxApproval} from '@/api/ecw/box'
import {getChannel} from '@/api/ecw/channel'
import WarehouseRecord from "@/views/ecw/order/splitApply/components/WarehouseRecord";
export default {
props:{
components: {WarehouseRecord},
props:{
id: [String, Number]
},
data(){
return {
detail: null,
order: null,
channel: null
channel: null,
// 查看入仓记录的条目
currentWarehouseRecord: null
}
},
watch:{
......@@ -110,6 +123,12 @@ export default {
getChannel(this.order.channelId).then(res => {
this.channel = res.data
})
},
showWarehouseRecord(row){
if(!row.specsRecordVOList){
return this.$message.info(this.$t('暂无入仓记录'))
}
this.currentWarehouseRecord = row.specsRecordVOList
}
}
}
......@@ -122,4 +141,4 @@ export default {
font-weight: bold;
}
}
</style>
\ No newline at end of file
</style>
......@@ -46,31 +46,42 @@
<dict-tag v-else :type="DICT_TYPE.ECW_IS_BRAND" :value="row.feeType" />
</template>
</el-table-column>
<el-table-column :label="$t('体积')">
<template slot-scope="{row}">{{row.volume}}</template>
</el-table-column>
<el-table-column :label="$t('重量')">
<template slot-scope="{row}">{{row.weight}}kg</template>
</el-table-column>
<el-table-column :label="$t('箱数')">
<template slot-scope="{row}">{{row.num}}</template>
</el-table-column>
<el-table-column :label="$t('入仓体积')">
<template slot-scope="{row}">{{row.volume}}</template>
</el-table-column>
<el-table-column :label="$t('收费体积')">
<template slot-scope="{row}">{{row.chargeVolume}}</template>
</el-table-column>
<el-table-column :label="$t('入仓重量')">
<template slot-scope="{row}">{{row.weight}}kg</template>
</el-table-column>
<el-table-column :label="$t('收费重量')">
<template slot-scope="{row}">{{row.chargeWeight}}kg</template>
</el-table-column>
<el-table-column :label="$t('箱数')">
<template slot-scope="{row}">
<el-button type="text" @click="showWarehouseRecord(row)">{{row.num}}</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('数量')">
<template slot-scope="{row}">{{row.quantity}}</template>
</el-table-column>
</el-table-column>
<el-table-column :label="$t('备注')">
<template slot-scope="{row}">{{row.remark}}</template>
</el-table-column>
</el-table-column>
</el-table>
</template>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" append-to-body></warehouse-record>
</div>
</template>
<script>
import {getApproval, getOrder} from '@/api/ecw/order'
import {getChannel} from '@/api/ecw/channel'
import {getSplitList} from '@/api/ecw/orderHandle'
import WarehouseRecord from "@/views/ecw/order/splitApply/components/WarehouseRecord";
export default {
props:{
components: {WarehouseRecord},
props:{
id: [String, Number]
},
data(){
......@@ -78,7 +89,9 @@ export default {
detail: null,
order: null,
channel: null,
orderSplitBackVOList: []
orderSplitBackVOList: [],
// 查看入仓记录的条目
currentWarehouseRecord: null
}
},
watch:{
......@@ -121,7 +134,13 @@ export default {
getChannel(this.order.channelId).then(res => {
this.channel = res.data
})
},
showWarehouseRecord(row){
if(!row.specsRecordVOList){
return this.$message.info(this.$t('暂无入仓记录'))
}
this.currentWarehouseRecord = row.specsRecordVOList
}
}
}
</script>
......@@ -133,4 +152,4 @@ export default {
font-weight: bold;
}
}
</style>
\ No newline at end of file
</style>
<template>
<!-- 拆单入仓记录 -->
<el-dialog :title="$t('入仓记录')" :visible="show" :before-close="closeDialog" :close-on-click-modal="false" width="1000px" :append-to-body="appendToBody">
<el-table :data="list">
<el-table-column type="index" :label="$t('序号')" />
<el-table-column :label="$t('箱数')" prop="num" />
<el-table-column :label="$t('入仓类型')" prop="specificationType">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" :value="row.specificationType" />
</template>
</el-table-column>
<el-table-column :label="$t('包装类型')" prop="unit">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" :value="row.unit" />
</template>
</el-table-column>
<el-table-column :label="$t('长')" prop="boxGauge">
<template slot-scope="{row}">
{{row.boxGauge.split('*')[0]}}
</template>
</el-table-column>
<el-table-column :label="$t('宽')" prop="boxGauge" >
<template slot-scope="{row}">
{{row.boxGauge.split('*')[1]}}
</template>
</el-table-column>
<el-table-column :label="$t('高')" prop="boxGauge" >
<template slot-scope="{row}">
{{row.boxGauge.split('*')[2]}}
</template>
</el-table-column>
<el-table-column :label="$t('体积') + '(m³)'" prop="volume" />
<el-table-column :label="$t('重量') + '(kg)'" prop="weight" />
<el-table-column :label="$t('数量(个)')" prop="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>
</el-dialog>
</template>
<script>
export default {
name: "WarehouseRecord",
props:{
list:{
type: Array,
default: []
},
appendToBody: Boolean
},
data(){
return {
show: false
}
},
mounted() {
this.show = true
},
methods:{
// 获取储位名称
getLocationName(locationArr){
if(!locationArr || !locationArr.length) return ''
let arr = []
locationArr.forEach(item => {
arr.push(`${item.areaName}${item.locationName || ''}`)
})
return Array.from(new Set(arr)).join(",")
},
closeDialog(){
this.show = false
this.$emit('close');
},
}
}
</script>
<style scoped>
</style>
......@@ -162,6 +162,7 @@
<dict-tag v-else :type="DICT_TYPE.ECW_IS_BRAND" :value="scope.row.feeType" />
</template>
</el-table-column>
<el-table-column :label="$t('入仓体积')" align="center" >
<template slot-scope="scope">
<el-input v-model="scope.row.volume" @change="updateField(scope.row, 'volume')" size="mini" :disabled="index === 0">
......@@ -198,9 +199,9 @@
</template>
</el-table-column>
<el-table-column :label="$t('箱数')" align="center">
<template slot-scope="scope">
<span>{{scope.row.num}}</span>
</template>
<template slot-scope="scope">
<el-button type="text" @click="showWarehouse(scope.row)">{{scope.row.num}}</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('操作')" align="center">
<template slot-scope="scope">
......@@ -244,58 +245,206 @@
</div>
</el-dialog>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="$t('放入品名')" :visible.sync="shopOpen" width="500px" append-to-body>
<el-form ref="shopForm" :model="shopForm" :rules="shopRules" label-width="120px">
<el-form-item :label="$t('中文品名')" v-if="splitData.length>0">
<el-select v-model="shopForm.pordid" :placeholder="$t('请选择中文品名')" @change="changeProdTitleZh" clearable>
<el-option v-for="item in splitData[0].orderSplitItemBackVOList" :label="item.prodTitleZh" :value="item.id" :key="item.prodTitleZh" ></el-option>
<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-item :label="$t('中文品名')" v-if="splitData.length>0">
<el-select v-model="shopForm.pordid" :placeholder="$t('请选择中文品名')" @change="changeProdTitleZh" clearable>
<el-option v-for="item in splitData[0].orderSplitItemBackVOList" :label="item.prodTitleZh" :value="item.id" :key="item.prodTitleZh" ></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('英文品名')" v-if="splitData.length>0">
<el-select v-model="shopForm.pordid" :placeholder="$t('请选择英文品名')" @change="changeProdTitleZh" clearable>
<el-option v-for="item in splitData[0].orderSplitItemBackVOList" :label="item.prodTitleEn" :value="item.id" :key="item.prodTitleEn" ></el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('英文品名')" v-if="splitData.length>0">
<el-select v-model="shopForm.pordid" :placeholder="$t('请选择英文品名')" @change="changeProdTitleZh" clearable>
<el-option v-for="item in splitData[0].orderSplitItemBackVOList" :label="item.prodTitleEn" :value="item.id" :key="item.prodTitleEn" ></el-option>
</el-select>
</el-form-item>
<el-form-item :label2="$t('剩余箱数')" v-if="mainOrderItem.orderItemId">
{{$t('剩余箱数')}}{{ shopForm.sum || 0 }}<!--,可放入箱数:{{ mainOrderItem.num - 1 }}-->
</el-form-item>
<el-form-item :label="$t('放入箱数')">
<el-input-number v-model="shopForm.num" @change="numChange" controls-position="right" :min="1" :max="mainOrderItem.num"></el-input-number>
</el-form-item>
<el-form-item v-if="quantityshow" :label="$t('放入数量')+'('+$t('个')+')'">
<el-input-number v-model="shopForm.quantity" controls-position="right" :min="1" :max="mainOrderItem.quantity-1" :placeholder="$t('最多可放入{quantity}', {
quantity: mainOrderItem.quantity-1
})"></el-input-number>
</el-form-item>
<el-form-item v-if="mainOrderItem.orderItemId">
<div>{{ $t('剩余入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³<!--,{{$t('可放入仓方数')}}:{{ (mainOrderItem.volume - 0.01).toFixed(2) }}m³--></div>
<div>{{$t('剩余收费方数')}}:{{ mainOrderItem.chargeVolume || 0 }}m³<!--,{{$t('可放入收费方数')}}:{{ (mainOrderItem.chargeVolume - 0.01).toFixed(2) }}m³--></div>
</el-form-item>
<el-form-item :label="$t('入仓方数')">
<el-input-number v-model="shopForm.volume" controls-position="right" :min="0" :max="mainOrderItem.volume"></el-input-number>
</el-form-item>
<el-form-item :label="$t('收费方数')">
<el-input-number v-model="shopForm.chargeVolume" controls-position="right" :min="0" :max="mainOrderItem.chargeVolume"></el-input-number>
</el-form-item>
<el-form-item v-if="mainOrderItem.orderItemId">
<div>{{$t('剩余入仓重量')}}:{{ mainOrderItem.weight || 0 }}kg<!--,{{$t('可放入重量')}}:{{ mainOrderItem.weight }}kg--></div>
<div>{{$t('剩余收费重量')}}:{{ mainOrderItem.chargeWeight || 0 }}kg<!--,{{$t('可放入收费重量')}}:{{ mainOrderItem.chargeWeight }}kg--></div>
</el-form-item>
<el-form-item :label="$t('入仓重量')">
<el-input-number v-model="shopForm.weight" controls-position="right" :min="0" :max="mainOrderItem.weight"></el-input-number>
</el-form-item>
<el-form-item :label="$t('收费重量')">
<el-input-number v-model="shopForm.chargeWeight" controls-position="right" :min="0" :max="mainOrderItem.chargeWeight"></el-input-number>
</el-form-item>
<el-form-item v-if="mainOrderItem.orderItemId">
<div>{{$t('剩余货值')}}:{{ mainOrderItem.worth || 0 }}{{ $t('美元') }}</div>
</el-form-item>
<el-form-item :label="$t('剩余数据')">
<div>{{$t('剩余箱数')}}{{ shopForm.sum || 0 }}</div>
<div>
{{ $t('入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³
{{ $t('收费方数') }}:{{ mainOrderItem.chargeVolume || 0 }}m³
</div>
<div>
{{ $t('入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg
{{ $t('收费重量') }}:{{ mainOrderItem.chargeWeight || 0 }}kg
</div>
<div>
{{ $t('数量(个)') }}:{{ mainOrderItem.quantity || 0 }}
{{ $t('剩余货值') }}:{{ mainOrderItem.worth || 0 }}{{ $t('美元') }}
</div>
</el-form-item>
<el-card class="box-card" v-if="shopForm.specsRecordVOList">
<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="shopForm.specsRecordVOList.length <= 1"></el-button>
<el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="addRow" :disabled="!shopForm.orderItemId"></el-button>
</div>
<!--<el-form ref="tableForm" :model="shopForm" size="mini">-->
<el-table
:data="shopForm.specsRecordVOList"
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="`specsRecordVOList.${$index}.num`"
: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>
</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="`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}">
<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[splitItemIndex].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-form>-->
</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('放入货值')">
<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-form-item :label="$t('备注信息')">
<el-input v-model="shopForm.remark"></el-input>
</el-form-item>
</el-form>
......@@ -319,6 +468,24 @@
<el-button type="primary" @click="cancelSplit">{{$t('确定')}}</el-button>
</span>
</el-dialog>
<el-dialog
:title="$t('提示')"
:visible.sync="dialogVisible"
width="30%">
<span class="cancel_notice">{{$t('拆单申请正在审核中,你确定取消拆单申请吗?')}}</span>
<div class="cancel_content">
<span>{{$t('取消原因:')}}</span>
<el-input v-model="reason" :placeholder="$t('请输入取消原因')"></el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">{{$t('取消')}}</el-button>
<el-button type="primary" @click="cancelSplit">{{$t('确定')}}</el-button>
</span>
</el-dialog>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord"></warehouse-record>
</div>
</template>
......@@ -339,12 +506,16 @@ import {getChannelList} from '@/api/ecw/channel'
import WorkFlow from '@/components/WorkFlow'
import {getOrder, splitItemUpdate} from '@/api/ecw/order'
import Decimal from 'decimal.js'
import Template from "@/views/cms/template";
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect";
import WarehouseDetail from "@/views/ecw/order/components/WarehouseDetail";
import WarehouseRecord from "@/views/ecw/order/splitApply/components/WarehouseRecord";
export default {
name: "SplitApply",
components: {
Template,
WarehouseRecord,
WarehouseDetail,
WarehouseAreaSelect,
WorkFlow
},
data() {
......@@ -368,7 +539,9 @@ export default {
selectedUsers:[],
shopOpen:false,
quantityshow:false,
shopForm:{},
shopForm:{
specsRecordVOList: []
},
// 表单校验
rules: {
transportId: [{ required: true, message: this.$t("请选择运输方式"), trigger: "change" }],
......@@ -389,7 +562,9 @@ export default {
rows:20
},
splitItemIndex:0,
quantitySum:0
quantitySum:0,
// 当前查看的入仓记录
currentWarehouseRecord: null
};
},
async created() {
......@@ -405,9 +580,10 @@ export default {
console.log("拆单数据", this.splitData, this.splitData.length)
if(this.orderData.inWarehouseState != 207 && this.splitData.length){
// 2023-05-20确认不需要询问,直接重置
deleteAllSplit(this.queryParams.orderId).then(res => {
// TODO 20230610 方便调试不删除,改完之后要取消注释
/*deleteAllSplit(this.queryParams.orderId).then(res => {
this.getList()
})
})*/
/*this.$confirm(this.$t('已有拆单数据,是否要重置?')).then(res => {
return deleteAllSplit(this.queryParams.orderId)
}).then(res => {
......@@ -461,6 +637,33 @@ export default {
mainOrderItem(){
if(!this.orderItem.orderItemId || !this.splitData.length || !this.splitData[0].orderSplitItemBackVOList) return {}
return this.splitData[0].orderSplitItemBackVOList.find(item => item.orderItemId == this.orderItem.orderItemId) || {}
},
// 放入数据
putin(){
let data = {
num: new Decimal(0),
volume: new Decimal(0),
chargeVolume: new Decimal(0),
weight: new Decimal(0),
chargeWeight: new Decimal(0),
quantity: new Decimal(0)
}
this.shopForm.specsRecordVOList && this.shopForm.specsRecordVOList.forEach(item => {
data.num = data.num.plus(new Decimal(item.num || 0))
data.volume = data.volume.plus(new Decimal(item.volume || 0))
data.chargeVolume = data.chargeVolume.plus(new Decimal(item.chargeVolume || 0))
data.weight = data.weight.plus(new Decimal(item.weight || 0))
data.chargeWeight = data.chargeWeight.plus(new Decimal(item.chargeWeight || 0))
data.quantity = data.quantity.plus(new Decimal(item.quantity || 0))
})
return {
num: data.num.toNumber(),
volume: data.volume.toNumber(),
chargeVolume: data.chargeVolume.toNumber(),
weight: data.weight.toNumber(),
chargeWeight: data.chargeWeight.toNumber(),
quantity: data.quantity.toNumber()
}
}
},
methods: {
......@@ -510,8 +713,6 @@ export default {
this.splitData = response.data.orderSplitBackVOList
this.orderApprovalBackVO = response.data
this.loading = false;
});
},
......@@ -639,12 +840,11 @@ export default {
this.shopForm.orderItemId = list[0].orderItemId
this.shopForm.prodTitleEn = list[0].prodTitleEn
this.shopForm.prodTitleZh = list[0].prodTitleZh
var orderItemData = this.orderData.orderItemVOList.find(item=>item.orderItemId==this.shopForm.orderItemId)
/*var params = {
'seaFreightVolume':orderItemData.seaFreightVolume,
'clearanceFreightVolume':orderItemData.clearanceFreightVolume
// 默认给一个
if(!this.shopForm.specsRecordVOList || !this.shopForm.specsRecordVOList.length){
this.addRow()
}
console.log(orderItemData)*/
this.numcheck()
},
numcheck(){
......@@ -705,27 +905,31 @@ export default {
if (!valid) {
return;
}
this.shopForm.specsRecordVOList.forEach(item => {
item.boxGauge = `${item.boxGauge1}*${item.boxGauge2}*${item.boxGauge3}`
})
var params = {
num:this.putin.num,
orderItemId:this.shopForm.orderItemId,
orderSplitId:this.splitData[this.splitItemIndex].id,
remark:this.shopForm.remark,
volume: this.putin.volume,
chargeVolume: this.putin.chargeVolume,
weight: this.putin.weight,
chargeWeight: this.putin.chargeWeight,
worth: this.shopForm.worth,
specsRecordVOList:this.shopForm.specsRecordVOList
}
if(this.quantityshow){
params.quantity = this.shopForm.quantity
}
createSplitItem(params).then(async res=>{
this.$message.success(this.$t("放入成功"));
await this.getList()
this.shopForm = {}
this.shopOpen = false
})
})
var params = {
num:this.shopForm.num,
orderItemId:this.shopForm.orderItemId,
orderSplitId:this.splitData[this.splitItemIndex].id,
remark:this.shopForm.remark,
volume: this.shopForm.volume,
chargeVolume: this.shopForm.chargeVolume,
weight: this.shopForm.weight,
chargeWeight: this.shopForm.chargeWeight,
worth: this.shopForm.worth
}
if(this.quantityshow){
params.quantity = this.shopForm.quantity
}
createSplitItem(params).then(res=>{
this.$message.success(this.$t("放入成功"));
this.getList()
this.shopForm = {}
})
this.shopOpen = false
},
removeShop(id){
let that = this
......@@ -761,6 +965,42 @@ export default {
})
})
},
// 添加一行
addRow(){
if(!this.shopForm.specsRecordVOList){
this.$set(this.shopForm,'specsRecordVOList',[])
}
this.shopForm.specsRecordVOList.push({
orderLocationList: []
})
},
// 删除一行,可选参数index表上行号,参数不是数字则删除最后一行
deleteRow(index){
const spliceIndex = typeof index !== 'number' ? this.shopForm.specsRecordVOList.length - 1 : index
this.shopForm.specsRecordVOList.splice(spliceIndex, 1)
},
// 计算体积
calcVolume(row){
let volume = Decimal(row.boxGauge1 || 0)
.times(Decimal(row.boxGauge2 || 0))
.times(Decimal(row.boxGauge3 || 0)).div(1000000)
// 如果是箱的单位要乘以箱数
if(row.specificationType === 1) {
row.volume = volume.times(Decimal(row.num || 0))
}
// 最低0.01
volume = Math.max(0.01, volume.toNumber().toFixed(2))
this.$set(row, 'volume', volume)
this.$set(row, 'chargeVolume', volume)
},
// 显示入库记录
showWarehouse(row){
if(!row.specsRecordVOList){
return this.$message.info(this.$t('暂无入仓记录'))
}
this.currentWarehouseRecord = row.specsRecordVOList
}
}
}
</script>
......@@ -802,4 +1042,8 @@ export default {
.cancel_content span{
width: 100px;
}
::v-deep .el-form-item--mini.is-error{
margin-bottom: 18px;
}
</style>
......@@ -943,10 +943,11 @@ export default {
const form = val === 1 ? this.form1 : this.form
const formLength = form.table.length
let orderLocationBackVOList = []
/* // 不默认使用上一条记录的储位 https://zentao.test.jdshangmen.com/bug-view-3344.html
// 不默认使用上一条记录的储位 https://zentao.test.jdshangmen.com/bug-view-3344.html
// 上面弄错了,默认使用上一条记录的储位 https://zentao.test.jdshangmen.com/bug-view-3484.html
if (formLength > 0) {
orderLocationBackVOList = JSON.parse(JSON.stringify(form.table[formLength - 1].orderLocationBackVOList))
}*/
}
form.table.push({
"boxGauge1": this.isJiyun ? 0 : '',
"boxGauge2": this.isJiyun ? 0 : '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment