|
@@ -113,6 +113,14 @@
|
|
|
addDiscl() {
|
|
|
this.$refs.form.validate((valid)=> {
|
|
|
if (valid) {
|
|
|
+ // 过滤空格
|
|
|
+ if(!this.form.title.trim()|| !this.form.description.trim()){
|
|
|
+ this.$message({
|
|
|
+ message: "必填项不能为空",
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
// 有id是修改,没有id是添加
|
|
|
if(this.id){
|
|
|
let code = this.form.disclaimerCode;
|
|
@@ -126,8 +134,8 @@
|
|
|
}
|
|
|
let param = {
|
|
|
id:this.id,
|
|
|
- title:this.form.title,
|
|
|
- description:this.form.description,
|
|
|
+ title:this.form.title.trim(),
|
|
|
+ description:this.form.description.trim(),
|
|
|
disclaimerCode:code
|
|
|
}
|
|
|
api.modifDiscInformation(param).then((res) => {
|
|
@@ -149,7 +157,12 @@
|
|
|
});
|
|
|
})
|
|
|
}else{
|
|
|
- api.addDiscInformation(this.form).then((res) => {
|
|
|
+ let param = {
|
|
|
+ title:this.form.title.trim(),
|
|
|
+ description:this.form.description.trim(),
|
|
|
+ disclaimerCode:this.form.disclaimerCode
|
|
|
+ }
|
|
|
+ api.addDiscInformation(param).then((res) => {
|
|
|
if (res.data.code == '0') {
|
|
|
this.$message({showClose: true,message: this.toast, type: 'success'});
|
|
|
this.$router.push({path: 'LT-YXSJWH-MZSMWH'});
|