diff --git a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml index 51ff2d4..7539c01 100644 --- a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml +++ b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml @@ -1323,6 +1323,45 @@ } //#endregion + //#region 刪除檔案 + $('#record_files_div').on("click", "a.del-operation-record-file-btn", function () { + + var selectedFileId = $(this).attr("data-id"); + + var div = $(this).parents(".col-auto"); + + Swal.fire({ + title: "刪除", + text: "你確定是否刪除此筆資料?", + type: "warning", + icon: 'warning', + showCancelButton: true, + confirmButtonText: "是", + cancelButtonText: "否" + }).then(function (result) { + if (result.value) { + + var url = "/Operation/DeleteOperationRecordFile"; + + var send_data = { + ReocdeId: selected_id, + SelectedId: selectedFileId + } + + $.post(url, send_data, function (rel) { + if (rel.code != "0000") { + toast_error(rel.msg); + return; + } + operationRecordTable.ajax.reload(); + toast_ok(rel.msg); + div.remove(); + }, 'json'); + } + }); + }); + //#endregion + //#region 異常 //#region 改變日期(異常)