Commit 396aafdf authored by dragondean@qq.com's avatar dragondean@qq.com

拆单的bug

parent 74cd1ba9
...@@ -225,7 +225,7 @@ ...@@ -225,7 +225,7 @@
<div class="page-title">{{$t('品名可拆数据')}}</div> <div class="page-title">{{$t('品名可拆数据')}}</div>
<div class="pl-20"> <div class="pl-20">
<span class="mr-10">{{$t('箱数')}}:{{ mainOrderItem.num || 0 }}</span> <span class="mr-10">{{$t('箱数')}}:{{ Math.min(mainOrderItem.num, maxNum) || 0 }}</span>
<span class="mr-10">{{ $t('入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³</span> <span class="mr-10">{{ $t('入仓方数') }}:{{ mainOrderItem.volume || 0 }}m³</span>
<span class="mr-10">{{ $t('收费方数') }}:{{ mainOrderItem.chargeVolume || 0 }}m³</span> <span class="mr-10">{{ $t('收费方数') }}:{{ mainOrderItem.chargeVolume || 0 }}m³</span>
<span class="mr-10">{{ $t('入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg</span> <span class="mr-10">{{ $t('入仓重量') }}:{{ mainOrderItem.weight || 0 }}kg</span>
...@@ -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}">
{{getWarehouseLeftData(row, 'num')}} {{Math.min(getWarehouseLeftData(row, 'num'), maxNum)}}
<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>
...@@ -385,6 +385,7 @@ ...@@ -385,6 +385,7 @@
@close="currentPutIn=null" @close="currentPutIn=null"
@submit="handlePutin" @submit="handlePutin"
:warehouse-id="currentWarehouseId" :warehouse-id="currentWarehouseId"
:maxNum="maxNum"
append-to-body append-to-body
></put-in> ></put-in>
</div> </div>
...@@ -632,6 +633,10 @@ export default { ...@@ -632,6 +633,10 @@ export default {
}) })
return total.toNumber() return total.toNumber()
} }
},
// 最大可装箱数 原单箱数 - 已装箱数
maxNum(){
return this.currRow.num - this.currRow.installNum
} }
}, },
methods: { methods: {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div slot="header">{{$t('可拆出入仓记录')}}</div> <div slot="header">{{$t('可拆出入仓记录')}}</div>
<el-table :data="[warehouseRecord]"> <el-table :data="[warehouseRecord]">
<el-table-column :label="$t('箱数')" prop="cartonsNum"> <el-table-column :label="$t('箱数')" prop="cartonsNum">
<template slot-scope="{row}">{{row.cartonsNum}}</template> <template slot-scope="{row}">{{Math.min(row.cartonsNum, maxNum)}}</template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('入仓类型')" prop="specificationType"> <el-table-column :label="$t('入仓类型')" prop="specificationType">
<template slot-scope="{row}"> <template slot-scope="{row}">
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div> <div>
{{$t('剩余')}}: {{$t('可拆')}}:
{{leftData('num')}}{{$t('箱')}}, {{maxSplitNum}}{{$t('箱')}},
{{$t('体积')}}:{{leftData('volume')}}{{$t('m³')}}, {{$t('体积')}}:{{leftData('volume')}}{{$t('m³')}},
{{$t('重量')}}:{{leftData('weight')}}{{$t('kg')}}, {{$t('重量')}}:{{leftData('weight')}}{{$t('kg')}},
{{$t('数量')}}:{{leftData('quantity')}}{{$t('个')}} {{$t('数量')}}:{{leftData('quantity')}}{{$t('个')}}
...@@ -71,7 +71,9 @@ ...@@ -71,7 +71,9 @@
<el-form-item class="flex" label-width="0" <el-form-item class="flex" label-width="0"
:prop="`list.${$index}.num`" :prop="`list.${$index}.num`"
:rules="{required: true, message: $t('不能为空'), trigger: 'blur'}"> :rules="{required: true, message: $t('不能为空'), trigger: 'blur'}">
<el-input-number controls-position="right" :min="0" class="w-75 tight" v-model="row.num" :max="warehouseRecord.cartonsNum" @change="calc(row)"></el-input-number> <!--需求方要求输入后马上计算其他数据,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)" :min="0" :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>
...@@ -217,7 +219,7 @@ import {parseTime} from '@/utils/ruoyi' ...@@ -217,7 +219,7 @@ import {parseTime} from '@/utils/ruoyi'
import Decimal from 'decimal.js' import Decimal from 'decimal.js'
import Template from "@/views/cms/template/index.vue"; import Template from "@/views/cms/template/index.vue";
export default { export default {
name: "WarehouseRecord", name: "Putin",
filters:{parseTime}, filters:{parseTime},
components: {Template, WarehouseAreaSelect}, components: {Template, WarehouseAreaSelect},
props:{ props:{
...@@ -226,7 +228,9 @@ export default { ...@@ -226,7 +228,9 @@ export default {
// 仓库ID,选择储位要用到 // 仓库ID,选择储位要用到
warehouseId: Number, warehouseId: Number,
// 数量是否必须 // 数量是否必须
quantityshow: Boolean quantityshow: Boolean,
// 最大可拆箱数,装柜拆单用
maxNum: Number
}, },
data(){ data(){
return { return {
...@@ -272,6 +276,10 @@ export default { ...@@ -272,6 +276,10 @@ export default {
return left.toNumber() return left.toNumber()
} }
},
// 可拆箱数
maxSplitNum(){
return Math.min(this.maxNum, this.leftData('num'))
} }
}, },
mounted() { mounted() {
...@@ -282,14 +290,13 @@ export default { ...@@ -282,14 +290,13 @@ 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 = this.warehouseRecord.cartonsNum
// 根据入仓记录添加一行 // 根据入仓记录添加一行
this.form.list.push({ this.form.list.push({
warehouseInId: this.warehouseRecord.id, warehouseInId: this.warehouseRecord.id,
specificationType, boxGauge1, boxGauge2, boxGauge3, expressNo, specificationType, boxGauge1, boxGauge2, boxGauge3, expressNo,
volume: this.leftData('volume', true), volume: this.leftData('volume', true),
weight: this.leftData('weight', true), weight: this.leftData('weight', true),
num: this.leftData('num', true), num: Math.min(this.leftData('num', true), this.maxSplitNum),
quantity: this.leftData('quantity', true), quantity: this.leftData('quantity', true),
orderLocationList: this.warehouseRecord.orderLocationBackVOList orderLocationList: this.warehouseRecord.orderLocationBackVOList
}) })
...@@ -327,7 +334,7 @@ export default { ...@@ -327,7 +334,7 @@ export default {
const rate = row.num / this.warehouseRecord.cartonsNum const rate = row.num / this.warehouseRecord.cartonsNum
row.volume = (this.warehouseRecord.volume * rate).toFixed(2) row.volume = (this.warehouseRecord.volume * rate).toFixed(2)
row.weight = (this.warehouseRecord.weight * rate).toFixed(2) row.weight = (this.warehouseRecord.weight * rate).toFixed(2)
row.quantity = (this.warehouseRecord.quantityAll * rate).toFixed(2) row.quantity = (this.warehouseRecord.quantityAll * rate).toFixed(0)
}, },
closeDialog(){ closeDialog(){
this.show = false this.show = false
...@@ -339,8 +346,8 @@ export default { ...@@ -339,8 +346,8 @@ export default {
return false return false
} }
if(this.splitTotal('num') > this.leftData('num')){ if(this.splitTotal('num') > this.maxSplitNum){
return this.$message.error("拆出箱数不能大于剩余箱数") return this.$message.error("拆出箱数不能大于可拆箱数")
} }
if(this.splitTotal('volume') > this.leftData('volume')){ if(this.splitTotal('volume') > this.leftData('volume')){
return this.$message.error("拆出体积不能大于剩余体积") return this.$message.error("拆出体积不能大于剩余体积")
...@@ -366,5 +373,11 @@ export default { ...@@ -366,5 +373,11 @@ export default {
</script> </script>
<style scoped> <style scoped>
.input{
border: 1px solid #DCDFE6;
padding: 5px 6px;
border-radius: 5px;
}
</style> </style>
...@@ -163,35 +163,35 @@ ...@@ -163,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>
...@@ -211,11 +211,16 @@ ...@@ -211,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>
...@@ -440,13 +445,14 @@ ...@@ -440,13 +445,14 @@
</span> </span>
</el-dialog> </el-dialog>
<warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord"></warehouse-record> <warehouse-record v-if="currentWarehouseRecord" :list="currentWarehouseRecord" @close="currentWarehouseRecord=null"></warehouse-record>
<put-in <put-in
v-if="currentPutIn" v-if="currentPutIn"
:warehouse-record="currentPutIn" :warehouse-record="currentPutIn"
@close="currentPutIn=null" @close="currentPutIn=null"
@submit="handlePutin" @submit="handlePutin"
:warehouse-id="currentWarehouseId" :warehouse-id="currentWarehouseId"
:max-num="orderData.sumNum"
></put-in> ></put-in>
</div> </div>
</template> </template>
...@@ -472,10 +478,12 @@ import WarehouseAreaSelect from "@/components/WarehouseAreaSelect"; ...@@ -472,10 +478,12 @@ 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 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,
...@@ -549,16 +557,7 @@ export default { ...@@ -549,16 +557,7 @@ 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()
/*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("重置成功")
})*/
} }
}) })
// 获取入仓记录 // 获取入仓记录
...@@ -855,47 +854,6 @@ export default { ...@@ -855,47 +854,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
...@@ -1144,6 +1102,12 @@ export default { ...@@ -1144,6 +1102,12 @@ export default {
this.$confirm(this.$t("确定要清空放入数据么?")).then(res => { this.$confirm(this.$t("确定要清空放入数据么?")).then(res => {
this.shopForm.specsRecordVOList = [] this.shopForm.specsRecordVOList = []
}) })
},
// 重置
reset(){
deleteAllSplit(this.queryParams.orderId).then(res => {
this.getList()
})
} }
} }
} }
......
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