Elements-SY

【航班信息维护】添加航班信息原始重量输入校验

...@@ -180,8 +180,8 @@ ...@@ -180,8 +180,8 @@
180 </el-col> 180 </el-col>
181 <el-col :span="12"> 181 <el-col :span="12">
182 <el-form-item label="原始重量(KG)" prop="originalWeight"> 182 <el-form-item label="原始重量(KG)" prop="originalWeight">
183 - <el-input-number class="wid80" @change="LowHighAvailable" :precision="0" placeholder="请输入原始重量(KG)" 183 + <el-input-number class="wid80" @change="LowHighAvailable" :min="0" :precision="0" placeholder="请输入原始重量(KG)"
184 - v-model="form.originalWeight"></el-input-number> 184 + v-model="form.originalWeight" v-input-filter></el-input-number>
185 </el-form-item> 185 </el-form-item>
186 </el-col> 186 </el-col>
187 </el-row> 187 </el-row>
...@@ -482,6 +482,30 @@ export default { ...@@ -482,6 +482,30 @@ export default {
482 shiftKey: false, 482 shiftKey: false,
483 }; 483 };
484 }, 484 },
485 + directives: {
486 + // 处理加减天数
487 + "input-filter": {
488 + bind: function (el, binding) {
489 + el.handler = function (event) {
490 + if (event.data == "E" || event.data == "e") {
491 + // 无理数时
492 + event.target.value = "";
493 + }
494 + if (event.target.value) {
495 + if (Number(event.target.value) < 0) {
496 + event.target.value = "";
497 + this.msgError("加减天数最小不能低于7天");
498 + }
499 + event.target.dispatchEvent(new Event("input"));
500 + }
501 + };
502 + el.addEventListener("input", el.handler);
503 + },
504 + unbind: function (el) {
505 + el.removeEventListener("input", el.handler);
506 + },
507 + },
508 + },
485 created() { 509 created() {
486 //查询条件数据源 510 //查询条件数据源
487 this.queryParams.fltDateStart = this.nowDate() 511 this.queryParams.fltDateStart = this.nowDate()
......