Showing
2 changed files
with
15 additions
and
5 deletions
| ... | @@ -5,10 +5,12 @@ | ... | @@ -5,10 +5,12 @@ |
| 5 | <el-form class="form-header" :model="formData" size="small" ref="addForm" label-width="auto" | 5 | <el-form class="form-header" :model="formData" size="small" ref="addForm" label-width="auto" |
| 6 | label-position="left" style="margin-bottom:10px" :rules="rules" @submit.native.prevent> | 6 | label-position="left" style="margin-bottom:10px" :rules="rules" @submit.native.prevent> |
| 7 | <el-form-item label="货站名称" prop="goodsStation"> | 7 | <el-form-item label="货站名称" prop="goodsStation"> |
| 8 | - <el-input type="text" v-model="formData.goodsStation" placeholder="请输入货站名称"></el-input> | 8 | + <el-input type="text" v-model="formData.goodsStation" maxlength="50" placeholder="请输入货站名称"> |
| 9 | + </el-input> | ||
| 9 | </el-form-item> | 10 | </el-form-item> |
| 10 | <el-form-item label="品名" prop="goodsList"> | 11 | <el-form-item label="品名" prop="goodsList"> |
| 11 | - <el-input type="textarea" v-model="formData.goodsList" rows="4" placeholder="请输入品名,多个用“;”隔开"> | 12 | + <el-input type="textarea" v-model="formData.goodsList" rows="4" maxlength="254" |
| 13 | + placeholder="请输入品名,多个用“;”隔开"> | ||
| 12 | </el-input> | 14 | </el-input> |
| 13 | </el-form-item> | 15 | </el-form-item> |
| 14 | </el-form> | 16 | </el-form> |
| ... | @@ -63,6 +65,7 @@ export default { | ... | @@ -63,6 +65,7 @@ export default { |
| 63 | submit() { | 65 | submit() { |
| 64 | let obj = {} | 66 | let obj = {} |
| 65 | obj.goodsStation = this.formData.goodsStation | 67 | obj.goodsStation = this.formData.goodsStation |
| 68 | + this.formData.goodsList = this.formData.goodsList.replace(/;/g, ";") | ||
| 66 | if (this.formData.goodsList != null && this.formData.goodsList != '') { | 69 | if (this.formData.goodsList != null && this.formData.goodsList != '') { |
| 67 | obj.goodsList = this.formData.goodsList.split(';') | 70 | obj.goodsList = this.formData.goodsList.split(';') |
| 68 | } | 71 | } | ... | ... |
| ... | @@ -5,10 +5,12 @@ | ... | @@ -5,10 +5,12 @@ |
| 5 | <el-form class="form-header" :model="formData" size="small" ref="addForm" label-width="auto" | 5 | <el-form class="form-header" :model="formData" size="small" ref="addForm" label-width="auto" |
| 6 | label-position="left" style="margin-bottom:10px" :rules="rules" @submit.native.prevent> | 6 | label-position="left" style="margin-bottom:10px" :rules="rules" @submit.native.prevent> |
| 7 | <el-form-item label="货站名称" prop="goodsStation"> | 7 | <el-form-item label="货站名称" prop="goodsStation"> |
| 8 | - <el-input type="text" v-model="formData.goodsStation" placeholder="请输入货站名称"></el-input> | 8 | + <el-input type="text" v-model="formData.goodsStation" maxlength="50" placeholder="请输入货站名称"> |
| 9 | + </el-input> | ||
| 9 | </el-form-item> | 10 | </el-form-item> |
| 10 | <el-form-item label="航班" prop="flightList"> | 11 | <el-form-item label="航班" prop="flightList"> |
| 11 | - <el-input type="textarea" v-model="formData.flightList" rows="4" placeholder="请输入航班,多个用“;”隔开"> | 12 | + <el-input type="textarea" v-model="formData.flightList" rows="4" maxlength="254" |
| 13 | + placeholder="请输入航班,多个用“;”隔开" oninput="value=value.replace(/[^A-Za-z0-9\;]/g, '')"> | ||
| 12 | </el-input> | 14 | </el-input> |
| 13 | </el-form-item> | 15 | </el-form-item> |
| 14 | </el-form> | 16 | </el-form> |
| ... | @@ -62,8 +64,9 @@ export default { | ... | @@ -62,8 +64,9 @@ export default { |
| 62 | //提交 | 64 | //提交 |
| 63 | submit() { | 65 | submit() { |
| 64 | let obj = {} | 66 | let obj = {} |
| 65 | - obj.goodsStation = this.formData.goodsStation | 67 | + obj.goodsStation = this.formData.goodsStationt |
| 66 | if (this.formData.flightList != null && this.formData.flightList != '') { | 68 | if (this.formData.flightList != null && this.formData.flightList != '') { |
| 69 | + this.formData.flightList = this.formData.flightList.toUpperCase() | ||
| 67 | obj.flightList = this.formData.flightList.split(';') | 70 | obj.flightList = this.formData.flightList.split(';') |
| 68 | } | 71 | } |
| 69 | this.$refs['addForm'].validate(val => { | 72 | this.$refs['addForm'].validate(val => { |
| ... | @@ -86,6 +89,10 @@ export default { | ... | @@ -86,6 +89,10 @@ export default { |
| 86 | }, | 89 | }, |
| 87 | //取消 | 90 | //取消 |
| 88 | close() { | 91 | close() { |
| 92 | + this.formData = { | ||
| 93 | + goodsStation: null, | ||
| 94 | + flightList: null | ||
| 95 | + } | ||
| 89 | this.$refs["addForm"].clearValidate(); | 96 | this.$refs["addForm"].clearValidate(); |
| 90 | this.$emit('close') | 97 | this.$emit('close') |
| 91 | } | 98 | } | ... | ... |
-
Please register or login to post a comment