Commit 79aa69fc authored by knight's avatar knight

集运线路服务费配置增加验证

parent 39890aec
...@@ -582,7 +582,7 @@ ...@@ -582,7 +582,7 @@
</div> </div>
<br /> <br />
<el-form ref="lineform" :model="lineform" :rules="lineform.rules" label-width="160px"> <el-form ref="lineform" :model="lineform" :rules="rules" label-width="160px">
<el-form-item :label="$t('始发港服务')"> <el-form-item :label="$t('始发港服务')">
<el-checkbox-group v-model="lineform.otherService"> <el-checkbox-group v-model="lineform.otherService">
<el-checkbox <el-checkbox
...@@ -652,9 +652,9 @@ ...@@ -652,9 +652,9 @@
<!-- 集运服务费设置 --> <!-- 集运服务费设置 -->
<template> <template>
<el-form-item :label="$t('集运服务费')"> <el-form-item :label="$t('集运服务费')" prop="consServiceFeeCurrency" >
<el-input-number v-model="lineform.consServiceFee" :controls="false" :precision="2" :step="0.1" @change="handleServiceFeeChange"></el-input-number> <el-input-number v-model="lineform.consServiceFee" :controls="false" :precision="2" :step="0.1" @change="handleServiceFeeChange"></el-input-number>
<el-select v-model="lineform.consServiceFeeCurrency" style="margin-left: 20px;" clearable :placeholder="$t('请选择币种')"> <el-select v-model="lineform.consServiceFeeCurrency" style="margin-left: 20px;" clearable :placeholder="$t('请选择币种')">
<el-option <el-option
v-for="item in currencyList" v-for="item in currencyList"
:disabled="item.status === 1" :disabled="item.status === 1"
...@@ -666,7 +666,7 @@ ...@@ -666,7 +666,7 @@
</template> </template>
<!-- 集运验货服务费设置 --> <!-- 集运验货服务费设置 -->
<template> <template>
<el-form-item :label="$t('集运验货服务费')"> <el-form-item :label="$t('集运验货服务费')" prop="consInspectionFeeCurrency">
<el-input-number v-model="lineform.consInspectionFee" :controls="false" :precision="2" :step="0.1" ></el-input-number> <el-input-number v-model="lineform.consInspectionFee" :controls="false" :precision="2" :step="0.1" ></el-input-number>
<el-select v-model="lineform.consInspectionFeeCurrency" style="margin-left: 20px;" clearable :placeholder="$t('请选择币种')"> <el-select v-model="lineform.consInspectionFeeCurrency" style="margin-left: 20px;" clearable :placeholder="$t('请选择币种')">
<el-option <el-option
...@@ -1094,20 +1094,6 @@ export default { ...@@ -1094,20 +1094,6 @@ export default {
consVolumeLimit: "", consVolumeLimit: "",
stockDurationLimit: "", stockDurationLimit: "",
rules:{
consServiceFeeCurrency: [
{
validator: (rule, value, callback) => {
if (this.lineform.consServiceFee != null && !value) {
callback(new Error(this.$t('集运服务费币种不能为空')));
} else {
callback();
}
},
trigger: ['blur', 'change']
}
],
}
}, },
startName: "", startName: "",
destName: "", destName: "",
...@@ -1207,6 +1193,32 @@ export default { ...@@ -1207,6 +1193,32 @@ export default {
}, },
], ],
consServiceFeeCurrency: [
{
validator: (rule, value, callback) => {
if (this.lineform.consServiceFee > 0 && !value) {
callback(new Error(this.$t('集运服务费币种不能为空')));
} else {
callback();
}
},
trigger: ['blur', 'change']
}
],
consInspectionFeeCurrency: [
{
validator: (rule, value, callback) => {
if (this.lineform.consInspectionFee > 0 && !value) {
callback(new Error(this.$t('集运验货服务费币种不能为空')));
} else {
callback();
}
},
trigger: ['blur', 'change']
}
],
}, },
nodeId: this.$route.query.nodeId, nodeId: this.$route.query.nodeId,
// 枚举 // 枚举
...@@ -1590,8 +1602,10 @@ export default { ...@@ -1590,8 +1602,10 @@ export default {
}, },
submitLineForm() { submitLineForm() {
this.$refs["lineform"].validate((valid,errors) => {
this.$refs["lineform"].validate((valid,errors) => {
if (valid) { if (valid) {
// 校验通过,执行保存逻辑 // 校验通过,执行保存逻辑
......
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