list.js 791 Bytes
/**
 * A3 报告列表页脚本:仅提供级联删除能力。
 */
function deleteReport(id) {
    if (!id) {
        return;
    }
    if (!window.confirm('确定要删除该 A3 报告及其所有子表数据吗?')) {
        return;
    }
    fetch('/a3Report/delete/' + encodeURIComponent(id), {
        method: 'POST',
        headers: {'Content-Type': 'application/json'}
    }).then(function (resp) {
        return resp.json();
    }).then(function (json) {
        if (json && (json.success === true || json.success === 'true')) {
            window.location.reload();
        } else {
            alert('删除失败:' + ((json && (json.message || json.msg)) || '未知错误'));
        }
    }).catch(function (err) {
        alert('删除请求异常:' + err);
    });
}