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

订单拆单和装柜拆单bug

parent ae4f6780
......@@ -281,7 +281,11 @@
<el-table-column :label="$t('快递单号')" prop="expressNo"></el-table-column>
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList">
<template v-slot="{ row, column, $index }">
{{row.orderLocationList}}
<warehouse-area-select
v-model="row.orderLocationBackVOList"
readonly
:warehouse-id="currentWarehouseId"
></warehouse-area-select>
</template>
</el-table-column>
<el-table-column :label="$t('操作')">
......@@ -627,7 +631,14 @@ export default {
// 获取入仓记录的剩余数据
getWarehouseLeftData(){
return (warehouseRecord, field) => {
let total = new Decimal(warehouseRecord[ field == 'num' ? 'cartonsNum' : field ] || 0)
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))
})
......@@ -935,6 +946,7 @@ export default {
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(){
......
......@@ -68,7 +68,7 @@
</el-table-column>
</el-table>
</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>
</template>
<script>
......
......@@ -126,7 +126,7 @@
<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" :max="warehouseRecord.volume" class="w-100 tight" v-model="row.volume"/>
<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>
......@@ -150,7 +150,7 @@
<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" :max="warehouseRecord.weight" class="w-75 tight" v-model="row.weight"/>
<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>
......@@ -289,17 +289,21 @@ export default {
methods:{
// 添加一行
addRow(){
let { specificationType, boxGauge1, boxGauge2, boxGauge3, volume, weight, expressNo } = this.warehouseRecord
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,
volume: 0,// this.leftData('volume', true),
weight: 0, //this.leftData('weight', true),
specificationType, boxGauge1, boxGauge2, boxGauge3, expressNo,unit,
volume: 0,
weight: 0,
num: num,
quantity: 0, //this.leftData('quantity', true),
orderLocationList: this.warehouseRecord.orderLocationBackVOList
quantity: 0,
orderLocationList
}
// 按照比例计算重量体积和数量
this.calc(row)
......
......@@ -31,14 +31,19 @@
</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="quantity" />
<!--<el-table-column :label="$t('入仓快递单号')" prop="expressNo" />-->
<!--<el-table-column :label="$t('首次入仓时间')" prop="inTime" >
<template slot-scope="{row}">{{row.inTime|parseTime}}</template>
</el-table-column>-->
<el-table-column :label="$t('储位')" prop="orderLocationBackVOList" >
<template slot-scope="{row}">
{{getLocationName(row.orderLocationBackVOList)}}
<!--{{getLocationName(row.orderLocationList)}}-->
<warehouse-area-select
v-model="row.orderLocationList"
readonly
:warehouse-id="warehouseId"
></warehouse-area-select>
</template>
</el-table-column>
</el-table>
......@@ -46,13 +51,17 @@
</template>
<script>
import WarehouseAreaSelect from "@/components/WarehouseAreaSelect/index.vue";
export default {
name: "WarehouseRecord",
components: {WarehouseAreaSelect},
props:{
list:{
type: Array,
default: []
},
warehouseId: Number,
appendToBody: Boolean
},
data(){
......
......@@ -445,7 +445,11 @@
</span>
</el-dialog>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" @close="currentWarehouseRecord=null"></warehouse-record>
<warehouse-record
v-if="currentWarehouseRecord"
:list="currentWarehouseRecord"
:warehouseId="currentWarehouseId"
@close="currentWarehouseRecord=null"></warehouse-record>
<put-in
v-if="currentPutIn"
:warehouse-record="currentPutIn"
......@@ -716,7 +720,7 @@ export default {
// 这里是全部已放入的
this.splitData.forEach(split => {
split.orderSplitItemBackVOList.forEach(splitItem => {
splitItem.specsRecordVOList.forEach(specs => {
splitItem.specsRecordVOList && splitItem.specsRecordVOList.forEach(specs => {
if(specs.warehouseInId === warehouseInId){
specsRecordVOList.push(specs)
}
......@@ -971,12 +975,29 @@ export default {
orderSplitId:this.splitData[this.splitItemIndex].id,
remark:this.shopForm.remark,
volume: this.putin.volume,
chargeVolume: this.putin.chargeVolume,
chargeVolume: this.shopForm.chargeVolume,
weight: this.putin.weight,
chargeWeight: this.putin.chargeWeight,
chargeWeight: this.shopForm.chargeWeight,
worth: this.shopForm.worth || 0,
specsRecordVOList:this.shopForm.specsRecordVOList
}
// 体积重量不能为0
const fields = {
'volume': this.$t('体积'),
'weight': this.$t('重量'),
'chargeVolume': this.$t('收费体积'),
'chargeWeight': this.$t('收费重量'),
}
let errFields = []
Object.keys(fields).forEach(field => {
if(params[field] < 0.01){
errFields.push(fields[field])
}
})
if(errFields.length){
return this.$message.error(this.$t("{field}最少为0.01", {field: errFields.join(",")}))
}
/*if(this.quantityshow){
params.quantity = this.shopForm.quantity
}*/
......
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