正在显示
1 个修改的文件
包含
35 行增加
和
2 行删除
@@ -765,9 +765,11 @@ Handling Information | @@ -765,9 +765,11 @@ Handling Information | ||
765 | <el-row style="margin-bottom: -5px"> | 765 | <el-row style="margin-bottom: -5px"> |
766 | <el-col style="width: 95%"> | 766 | <el-col style="width: 95%"> |
767 | <el-form-item> | 767 | <el-form-item> |
768 | - <el-input minlength="1" maxlength="20" onkeyup="this.value=this.value.toUpperCase()" | 768 | + <el-input type="textarea" |
769 | + :autosize="{ minRows: 2, maxRows: 4}" | ||
770 | + maxlength="80" onkeyup="this.value=this.value.toUpperCase()" | ||
769 | @keyup.native="form.rtd.rtd_goods_DES.replace(/[^A-Za-z0-9\s]/g,'')" | 771 | @keyup.native="form.rtd.rtd_goods_DES.replace(/[^A-Za-z0-9\s]/g,'')" |
770 | - v-model="form.rtd.rtd_goods_DES" auto-complete="off" placeholder="货物品名" size="mini"></el-input> | 772 | + v-model="form.rtd.rtd_goods_DES" auto-complete="off" placeholder="货物品名,一行一个支持4行.首行必须为货物描述信息" size="mini"></el-input> |
771 | </el-form-item> | 773 | </el-form-item> |
772 | </el-col> | 774 | </el-col> |
773 | </el-row> | 775 | </el-row> |
@@ -3200,6 +3202,33 @@ Handling Information | @@ -3200,6 +3202,33 @@ Handling Information | ||
3200 | this.ssr_content = value; // 更新视图中的数据 | 3202 | this.ssr_content = value; // 更新视图中的数据 |
3201 | } | 3203 | } |
3202 | }, | 3204 | }, |
3205 | + goodDesContent:{ | ||
3206 | + get() { | ||
3207 | + return this.form.rtd.rtd_goods_DES; | ||
3208 | + }, | ||
3209 | + set(value) { | ||
3210 | + // 过滤掉所有非字母数字和中文字符以及换行符 | ||
3211 | + const filteredValue = value.replace(/[^A-Z0-9\n ]/g, ' ').toUpperCase(); | ||
3212 | + | ||
3213 | + | ||
3214 | + const lines = value.split('\n'); | ||
3215 | + if (lines.length > 4) { | ||
3216 | + this.$message.error('最多只能输入四行文本!'); | ||
3217 | + return; | ||
3218 | + } | ||
3219 | + | ||
3220 | + for (let line of lines) { | ||
3221 | + if (line.length > 20) { | ||
3222 | + this.$message.error('每行不能超过20个字符!'+ line + "当前字符数:" + line.length); | ||
3223 | + return; | ||
3224 | + } | ||
3225 | + } | ||
3226 | + | ||
3227 | + // 如果所有校验都通过了,更新 form.ssr.ssr_request_content | ||
3228 | + this.form.rtd.rtd_goods_DES = filteredValue; | ||
3229 | + // this.ssr_content = value; // 更新视图中的数据 | ||
3230 | + } | ||
3231 | + }, | ||
3203 | flightNumber: { | 3232 | flightNumber: { |
3204 | get() { | 3233 | get() { |
3205 | // 返回拼接后的完整航班号 | 3234 | // 返回拼接后的完整航班号 |
@@ -3233,6 +3262,10 @@ Handling Information | @@ -3233,6 +3262,10 @@ Handling Information | ||
3233 | this.formattedSsrContent = newVal; // 触发计算属性的setter | 3262 | this.formattedSsrContent = newVal; // 触发计算属性的setter |
3234 | }, | 3263 | }, |
3235 | immediate: true // 立即执行监听器 | 3264 | immediate: true // 立即执行监听器 |
3265 | + }, | ||
3266 | + 'form.rtd.rtd_goods_DES': function(newVal, oldVal) { | ||
3267 | + // 这里可以处理变化时的逻辑 | ||
3268 | + this.goodDesContent = newVal; // 触发计算属性的setter | ||
3236 | } | 3269 | } |
3237 | } | 3270 | } |
3238 | } | 3271 | } |
-
请 注册 或 登录 后发表评论