下面js导出,加参数控件校验的话,怎么校验

var a= this.options.form.getWidgetByName("jg").getValue();

var b= this.options.form.getWidgetByName("vip").getValue();

var c= this.options.form.getWidgetByName("vipnd").getValue();

var d= this.options.form.getWidgetByName("ry").getValue();

var e= this.options.form.getWidgetByName("kh").getValue();

var f= this.options.form.getWidgetByName("xm").getValue();

var g= this.options.form.getWidgetByName("yx").getValue();

var h= this.options.form.getWidgetByName("jz").getValue();

var i= this.options.form.getWidgetByName("sx").getValue();

var url='${servletURL}?viewlet=VIPkhfwyxwxqd.cpt&jg=' + a + '&vip=' + b + '&vipnd=' + c + '&ry=' + d + '&kh=' + e + '&xm=' + f + '&yx=' + g + '&jz=' + h +'&sx='+ i + '&format=excel&extype=simple';

var exportName='VIP客户服务应选未选清单';

FR.Msg.alert("提示","正在导出,此过程大概需要1分钟到数分钟!"); 

$("#popup_container .fr-core-btn.ui-state-enabled.fr-core-btn-style-blue").hide();//隐藏确定 

$("#popup_close").hide();//隐藏X

//console.log(url);

//window.location=(FR.cjkEncode(url));

//window.location=(encodeURI(url));

let xhr = new XMLHttpRequest()

xhr.open('GET', encodeURI(url),true)

// 这部至关重要,命令xhr返回给你的时blob(二进制大对象)类型的数据

xhr.responseType = 'blob'

xhr.send()

xhr.onreadystatechange = function () {

  if (xhr.readyState === 4 && xhr.status === 200) {

    const aTag = document.createElement('a');

    aTag.href = URL.createObjectURL(this.response);

    aTag.download = exportName+'.xlsx';

    aTag.click();

    FR.Msg.alert("提示","导出完成!");

  }

  else {

     FR.Msg.alert("提示","导出失败!");

  }

}

FineReport feverdream 发布于 2021-9-2 17:23 (编辑于 2021-9-2 17:59)
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
0
feverdreamLv5见习互助
发布于2021-9-3 10:59

..

  • 1关注人数
  • 286浏览人数
  • 最后回答于:2021-9-3 10:59
    请选择关闭问题的原因
    确定 取消
    返回顶部