作者 朱兆平

update:

1. 电子运单界面优化
... ... @@ -346,9 +346,7 @@
<el-row>
<el-col style="width: 95%">
<el-form-item>
<el-input minlength="3" maxlength="3" onkeyup="this.value=this.value.toUpperCase()"
@keyup.native="form.rtg.destinationAirport.replace(/[^A-Za-z]/g,'')"
@input.native="value => form.rtg.destinationAirport.replace(/[^A-Za-z]/g,'').toUpperCase()"
<el-input minlength="3" maxlength="3" onkeyup="this.value=this.value.replace(/[^A-Za-z]/g,'').toUpperCase()"
v-model="form.rtg.destinationAirport" auto-complete="off" placeholder="到达站" size="mini"></el-input>
</el-form-item>
</el-col>
... ... @@ -511,7 +509,13 @@ Handling Information
<el-row style="margin-bottom: -2px">
<el-col style="width: 100%">
<el-form-item>
<el-input type="textarea" :autosize="{ minRows: 2, maxRows: 4}"
<!-- 每行65个字符-->
<el-input
v-model="ssr_content"
show-word-limit
maxlength="195"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
auto-complete="off" placeholder="被通知人信息" size="mini"></el-input>
</el-form-item>
</el-col>
... ... @@ -1437,7 +1441,9 @@ Handling Information
<el-row style="margin-bottom: -2px">
<el-col style="width: 100%">
<el-form-item>
<el-input disabled type="textarea" :autosize="{ minRows: 2, maxRows: 4}"
<el-input disabled
maxlength="195"
type="textarea" :autosize="{ minRows: 2, maxRows: 4}"
auto-complete="off" placeholder="处理信息" size="mini"></el-input>
</el-form-item>
</el-col>
... ... @@ -2101,6 +2107,7 @@ Handling Information
cer_signature:''
}
},
ssr_content:"",
cne_contact:{
contact_id:'TE',
contact_number:'',
... ... @@ -2500,7 +2507,6 @@ Handling Information
//新增主运单
addFwb() {
this.form.rtg.destinationCarrier=this.form.flt.cariier;
alert(this.form.rtd.dimensions)
// this.form.rtg.destinationAirport=this.form.bill.destinationAirport;
this.form.rtd.rtd_gross_weight=this.form.bill.quantity_weight;
this.form.rtd.rtd_number_pieces=this.form.bill.quantity_picecs;
... ... @@ -2737,6 +2743,42 @@ Handling Information
this.getAWBH();
}
}
},
computed:{
formattedSsrContent: {
get() {
return this.ssr_content;
},
set(value) {
// 过滤掉所有非字母数字和中文字符以及换行符
const filteredValue = value.replace(/[^A-Z1-9\n ]/g, '');
const lines = value.split('\n');
if (lines.length > 3) {
this.$message.error('最多只能输入三行文本!');
return;
}
for (let line of lines) {
if (line.length > 65) {
this.$message.error('每行不能超过65个字符!');
return;
}
}
// 如果所有校验都通过了,更新 form.ssr.ssr_request_content
this.form.ssr.ssr_request_content = lines;
this.ssr_content = value; // 更新视图中的数据
}
}
},
watch:{
ssr_content: {
handler(newVal) {
this.formattedSsrContent = newVal; // 触发计算属性的setter
},
immediate: true // 立即执行监听器
}
}
}
</script>
... ...