代码如下:
$().ready(function () {
//WfForm.OPER_SAVE为保存操作,SUMBIT为提交操作,必须要有callback(); 否则将会中断操作
WfForm.registerCheckEvent(WfForm.OPER_SAVE, function (callback) {
var url = "http://www.baidu.com";
//设置往form表单中添的元素,name=value的方式,设置一个json数组对象
var params = {
"billid":WfForm.getFieldValue("field15631"),
"sqr": $('div[data-fieldmark="field15632"] .ant-select-selection__choice__content a').text(),
"fyftbm": $('div[data-fieldmark="field5994"] .ant-select-selection__choice__content a').text(),
"cxsj":WfForm.getFieldValue("field15633"),
"ccrs":WfForm.getFieldValue("field10980"),
"ckxm":WfForm.getFieldValue("field10981"),
"lxdh":WfForm.getFieldValue("field11378"),
"yclx":$('div[data-fieldmark="field5997"] .ant-select-selection-selected-value').text(),
"sfd":$('div[data-fieldmark="field11379"] .ant-select-selection-selected-value').text(),
"mdd":WfForm.getFieldValue("field5996"),
"yjycjssj":WfForm.getFieldValue("field15634"),
"sjxm":$('div[data-fieldmark="field6004"] .ant-select-selection__choice__content a').text(),
"sjdh":WfForm.getFieldValue("field10982"),
"cph":WfForm.getFieldValue("field6003")
}
$.ajax({
url: url, // 目标资源
cache: false, //true 如果当前请求有缓存的话,直接使用缓存。如果该属性设置为 false,则每次都会向服务器请求
async: false, //默认是true,即为异步方式
data: params,
dataType: "jsonp", // 服务器响应的数据类型
type: "POST", // 请求方式
success: function (data) {
console.log(data)
}
});
});
callback();
});