Commit 597bdee1 authored by dragondean@qq.com's avatar dragondean@qq.com

拆单的bug

parent 67020429
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
style="width: 100%"> style="width: 100%">
<el-table-column :label="$t('箱数')"> <el-table-column :label="$t('箱数')">
<template v-slot="{row,$index}"> <template v-slot="{row,$index}">
{{Math.min(getWarehouseLeftData(row, 'num'), maxNum)}} {{Math.min(getWarehouseLeftData(row, 'num'), leftSplitNum)}}
<dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType"></dict-tag> <dict-tag :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType"></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
<el-table-column :label="$t('操作')"> <el-table-column :label="$t('操作')">
<template v-slot="{ row, column, $index}"> <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-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> <el-button v-else size="mini" type="primary" @click="putInRecord(row)" :disabled="leftSplitNum <= 0">放入</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -385,7 +385,7 @@ ...@@ -385,7 +385,7 @@
@close="currentPutIn=null" @close="currentPutIn=null"
@submit="handlePutin" @submit="handlePutin"
:warehouse-id="currentWarehouseId" :warehouse-id="currentWarehouseId"
:maxNum="maxNum" :maxNum="leftSplitNum"
append-to-body append-to-body
></put-in> ></put-in>
</div> </div>
...@@ -637,6 +637,14 @@ export default { ...@@ -637,6 +637,14 @@ export default {
// 最大可装箱数 原单箱数 - 已装箱数 // 最大可装箱数 原单箱数 - 已装箱数
maxNum(){ maxNum(){
return this.currRow.num - this.currRow.installNum 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: {
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> :rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<!--需求方要求输入后马上计算其他数据,el组件无法绑定keyup事件,所以用原生的input--> <!--需求方要求输入后马上计算其他数据,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>--> <!--<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)" :min="0" :max="maxSplitNum"></input> <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> <dict-selector class="w-75" :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="row.specificationType" defaultable></dict-selector>
</el-form-item> </el-form-item>
</template> </template>
...@@ -290,16 +290,20 @@ export default { ...@@ -290,16 +290,20 @@ export default {
// 添加一行 // 添加一行
addRow(){ addRow(){
let { specificationType, boxGauge1, boxGauge2, boxGauge3, volume, weight, expressNo } = this.warehouseRecord let { specificationType, boxGauge1, boxGauge2, boxGauge3, volume, weight, expressNo } = this.warehouseRecord
let num = Math.min(this.leftData('num', true), this.maxSplitNum)
// 根据入仓记录添加一行 // 根据入仓记录添加一行
this.form.list.push({ let row = {
warehouseInId: this.warehouseRecord.id, warehouseInId: this.warehouseRecord.id,
specificationType, boxGauge1, boxGauge2, boxGauge3, expressNo, specificationType, boxGauge1, boxGauge2, boxGauge3, expressNo,
volume: this.leftData('volume', true), volume: 0,// this.leftData('volume', true),
weight: this.leftData('weight', true), weight: 0, //this.leftData('weight', true),
num: Math.min(this.leftData('num', true), this.maxSplitNum), num: num,
quantity: this.leftData('quantity', true), quantity: 0, //this.leftData('quantity', true),
orderLocationList: this.warehouseRecord.orderLocationBackVOList orderLocationList: this.warehouseRecord.orderLocationBackVOList
}) }
// 按照比例计算重量体积和数量
this.calc(row)
this.form.list.push(row)
}, },
// 删除一行,可选参数index表上行号,参数不是数字则删除最后一行 // 删除一行,可选参数index表上行号,参数不是数字则删除最后一行
deleteRow(index){ deleteRow(index){
......
...@@ -973,7 +973,7 @@ export default { ...@@ -973,7 +973,7 @@ export default {
chargeVolume: this.putin.chargeVolume, chargeVolume: this.putin.chargeVolume,
weight: this.putin.weight, weight: this.putin.weight,
chargeWeight: this.putin.chargeWeight, chargeWeight: this.putin.chargeWeight,
worth: this.shopForm.worth, worth: this.shopForm.worth || 0,
specsRecordVOList:this.shopForm.specsRecordVOList specsRecordVOList:this.shopForm.specsRecordVOList
} }
/*if(this.quantityshow){ /*if(this.quantityshow){
...@@ -1096,6 +1096,7 @@ export default { ...@@ -1096,6 +1096,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(){
......
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