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

订单拆单和装柜拆单bug

parent ae4f6780
...@@ -281,7 +281,11 @@ ...@@ -281,7 +281,11 @@
<el-table-column :label="$t('快递单号')" prop="expressNo"></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 }">
{{row.orderLocationList}} <warehouse-area-select
v-model="row.orderLocationBackVOList"
readonly
:warehouse-id="currentWarehouseId"
></warehouse-area-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')"> <el-table-column :label="$t('操作')">
...@@ -627,7 +631,14 @@ export default { ...@@ -627,7 +631,14 @@ export default {
// 获取入仓记录的剩余数据 // 获取入仓记录的剩余数据
getWarehouseLeftData(){ getWarehouseLeftData(){
return (warehouseRecord, field) => { 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 => { this.getWarehouseInspecsRecordVOList(warehouseRecord.id).forEach(item => {
total = total.minus(new Decimal(item[field] || 0)) total = total.minus(new Decimal(item[field] || 0))
}) })
...@@ -935,6 +946,7 @@ export default { ...@@ -935,6 +946,7 @@ export default {
const rate = this.putin.num / orderItem.warehouseInInfoVO.cartonsNum const rate = this.putin.num / orderItem.warehouseInInfoVO.cartonsNum
this.$set(this.shopForm, 'chargeVolume', (orderItem.chargeVolume*rate).toFixed(2)) this.$set(this.shopForm, 'chargeVolume', (orderItem.chargeVolume*rate).toFixed(2))
this.$set(this.shopForm, 'chargeWeight', (orderItem.chargeWeight*rate).toFixed(2)) this.$set(this.shopForm, 'chargeWeight', (orderItem.chargeWeight*rate).toFixed(2))
this.$set(this.shopForm, 'worth', (orderItem.worth*rate).toFixed(2))
}, },
// 清空放入记录 // 清空放入记录
clearAll(){ clearAll(){
......
...@@ -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>
......
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
<el-form-item label-width="0" <el-form-item label-width="0"
:prop="`list.${$index}.volume`" :prop="`list.${$index}.volume`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> :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> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<el-form-item label-width="0" <el-form-item label-width="0"
:prop="`list.${$index}.weight`" :prop="`list.${$index}.weight`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> :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> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -289,17 +289,21 @@ export default { ...@@ -289,17 +289,21 @@ export default {
methods:{ methods:{
// 添加一行 // 添加一行
addRow(){ 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 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 = { let row = {
warehouseInId: this.warehouseRecord.id, warehouseInId: this.warehouseRecord.id,
specificationType, boxGauge1, boxGauge2, boxGauge3, expressNo, specificationType, boxGauge1, boxGauge2, boxGauge3, expressNo,unit,
volume: 0,// this.leftData('volume', true), volume: 0,
weight: 0, //this.leftData('weight', true), weight: 0,
num: num, num: num,
quantity: 0, //this.leftData('quantity', true), quantity: 0,
orderLocationList: this.warehouseRecord.orderLocationBackVOList orderLocationList
} }
// 按照比例计算重量体积和数量 // 按照比例计算重量体积和数量
this.calc(row) this.calc(row)
......
...@@ -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(){
......
...@@ -445,7 +445,11 @@ ...@@ -445,7 +445,11 @@
</span> </span>
</el-dialog> </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 <put-in
v-if="currentPutIn" v-if="currentPutIn"
:warehouse-record="currentPutIn" :warehouse-record="currentPutIn"
...@@ -716,7 +720,7 @@ export default { ...@@ -716,7 +720,7 @@ export default {
// 这里是全部已放入的 // 这里是全部已放入的
this.splitData.forEach(split => { this.splitData.forEach(split => {
split.orderSplitItemBackVOList.forEach(splitItem => { split.orderSplitItemBackVOList.forEach(splitItem => {
splitItem.specsRecordVOList.forEach(specs => { splitItem.specsRecordVOList && splitItem.specsRecordVOList.forEach(specs => {
if(specs.warehouseInId === warehouseInId){ if(specs.warehouseInId === warehouseInId){
specsRecordVOList.push(specs) specsRecordVOList.push(specs)
} }
...@@ -971,12 +975,29 @@ export default { ...@@ -971,12 +975,29 @@ 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 || 0, worth: this.shopForm.worth || 0,
specsRecordVOList:this.shopForm.specsRecordVOList 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){ /*if(this.quantityshow){
params.quantity = this.shopForm.quantity 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