Commit 7fa3af8b authored by zhoutong's avatar zhoutong

封箱长宽高单位修改

parent a77a9b19
......@@ -63,25 +63,43 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.rows" @pagination="getList" />
</el-row>
<!-- 封箱 -->
<el-dialog :title="$t('封箱确认')" :visible.sync="sealBoxdialogVisible" width="700px" :modal-append-to-body="false" append-to-body>
<el-dialog :title="$t('封箱确认')" :visible.sync="sealBoxdialogVisible" width="800px" :modal-append-to-body="false" append-to-body>
<el-form ref="sealBoxForm" :model="sealBoxForm" label-width="100px">
<el-form-item :label="$t('箱号')" prop="pkgNum">
{{ pkgData.pkgNum }}
</el-form-item>
<el-row>
<el-col :span="8">
<el-form-item :label="$t('长')" prop="pkgLength">
<el-input-number v-model="sealBoxForm.pkgLength" :controls="false" :precision="2" style="width: 100px" @change="culSumVolume" />
<el-form-item :label="$t('长')" prop="pkgLength" :rules="[
{ pattern: /^((0{1}\.\d{1,2})|([1-9]\d*\.{1}\d{1,2})|([1-9]+\d*))$/, message: $t('长度保留两位小数')}
]">
<el-input v-model="sealBoxForm.pkgLength" style="width: 150px" @change="culSumVolume">
<template slot="append">
{{ $t('cm') }}
</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('宽')" prop="pkgWidth">
<el-input-number v-model="sealBoxForm.pkgWidth" :controls="false" :precision="2" style="width: 100px" @change="culSumVolume" />
<el-form-item :label="$t('宽')" prop="pkgWidth" :rules="[
{ pattern: /^((0{1}\.\d{1,2})|([1-9]\d*\.{1}\d{1,2})|([1-9]+\d*))$/, message: $t('宽度保留两位小数')}
]">
<el-input v-model="sealBoxForm.pkgWidth" style="width: 150px" @change="culSumVolume">
<template slot="append">
{{ $t('cm') }}
</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="$t('高')" prop="pkgHight">
<el-input-number v-model="sealBoxForm.pkgHight" :controls="false" :precision="2" style="width: 100px" @change="culSumVolume" />
<el-form-item :label="$t('高')" prop="pkgHight" :rules="[
{ pattern: /^((0{1}\.\d{1,2})|([1-9]\d*\.{1}\d{1,2})|([1-9]+\d*))$/, message: $t('高度保留两位小数')}
]">
<el-input v-model="sealBoxForm.pkgHight" style="width: 150px" @change="culSumVolume">
<template slot="append">
{{ $t('cm') }}
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
......@@ -190,8 +208,11 @@ export default {
},
//计算封箱体积
culSumVolume() {
let temp = this.accMul(this.sealBoxForm.pkgLength, this.sealBoxForm.pkgWidth)
let sumVolume = this.accMul(temp, this.sealBoxForm.pkgHight)
let temp = this.sealBoxForm.pkgLength*this.sealBoxForm.pkgWidth*0.01*0.01
let sumVolume = this.accMul(temp, this.sealBoxForm.pkgHight*0.01)
if(sumVolume <= 0){
sumVolume = 0.01
}
this.$set(this.sealBoxForm, 'sumVolume', sumVolume)
},
accMul(arg1,arg2)
......
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