软通动力2022年度环境、社会及治理(ESG)报告
`))) {
// myAlert('您的请求中有违反安全规则的元素');
// return;
// }
if (!vcode) {
myAlert('请填写验证码');
return;
}
let res = myverifyCode.validate(vcode);
if (!res) {
myAlert('验证码错误');
return;
}
if (substatus == 0) {
substatus = -1;
$(this).text('正在提交').css({ background: '#ccc', cursor: 'default' }).off('click');
const self = this
$.ajax({
type: 'post',
url: `/${r}/addMessage`,
data: $('#form').serialize(),
success: function (resq) {
const res = resq;
if (res.state == '200') {
myAlert(res.info);
downloadFile(`/${r}/transFile`, $('.esg-download').attr('id'))
myverifyCode.refresh();
substatus = 0;
$(self).text('提交并下载').css({ background: '#fff', cursor: 'pointer' }).on('click', submitClick)
} else {
substatus = 0;
myverifyCode.refresh();
myAlert(res.info);
$(self).text('提交并下载').css({ background: '#fff', cursor: 'pointer' }).on('click', submitClick)
}
},
error: function (res) {
substatus = 0;
myverifyCode.refresh();
myAlert('未知异常!状态码:' + res.state);
$(self).text('提交并下载').css({ background: '#fff', cursor: 'pointer' }).on('click', submitClick)
},
});
} else {
myAlert('请不要重复提交表单');
myverifyCode.refresh();
}
} else {
for (const key in validateObj) {
const value = validateObj[key];
if (value == '') {
$(`.esg .req-inp[name="${key}"]`).parent().css({ border: '1px solid #e90000' })
}
}
myAlert('必填项不能为空');
myverifyCode.refresh();
}
});
});