String.prototype.replaceAll = function (FindText, RepText) {
regExp = new RegExp(FindText, "g");
return this.replace(regExp, RepText);
}
new Vue({
el: "#app",
data: {
sug: data.suggest.replaceAll('
','\n'),
assess: data.report.replaceAll('
','\n'),
isSubmit:data.isSubmit
},
mounted: function(){
},
methods: {
submitReport:function(){
$.ajax({//后台也校验是否表格全部完成 并且更新任务表完成量 /**/
type : 'put',
async :false,
url : "/spvs/mobile/scheduleAssess/submitReport?scheduleId="+scheduleId+"&report="+this.sug.replace(/\n/g,'
')+"&suggest="+this.assess.replace(/\n/g,'
')+"&access_token=" + localStorage.getItem("access_token"),
success: function(json){
if(json.code=="01"){
alert(json.message);
}
},
error: function(){
}
});
}
},
});
手机扫一扫
移动阅读更方便
你可能感兴趣的文章