1. bug fix
This commit is contained in:
parent
7b1bb0d3e0
commit
ee0c004ea9
@ -15,7 +15,7 @@ namespace SolarPower.Controllers
|
||||
public class OperationController : MyBaseController<OperationController>
|
||||
{
|
||||
private readonly IOperationRepository operationRepository;
|
||||
private string operationRecordFilePath = "/upload/operation_recode/";
|
||||
private string operationRecordFilePath = "/upload/operation_record/";
|
||||
private string operationRecordSaveAsPath = "";
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ namespace SolarPower.Controllers
|
||||
{
|
||||
this.operationRepository = operationRepository;
|
||||
|
||||
operationRecordSaveAsPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "operation_recode");
|
||||
operationRecordSaveAsPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "upload", "operation_record");
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
@ -477,9 +477,9 @@ namespace SolarPower.Controllers
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
foreach (var recodeFile in operationRecord.RecordFiles)
|
||||
foreach (var recordFile in operationRecord.RecordFiles)
|
||||
{
|
||||
recodeFile.FileName = Path.Combine(operationRecordFilePath, operationRecord.Id.ToString()) + "/" + recodeFile.FileName;
|
||||
recordFile.FileName = Path.Combine(operationRecordFilePath, operationRecord.Id.ToString()) + "/" + recordFile.FileName;
|
||||
}
|
||||
|
||||
apiResult.Code = "0000";
|
||||
|
||||
@ -2164,6 +2164,8 @@ ALTER TABLE `operation_record`
|
||||
ADD COLUMN `FixFirm` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '負責廠商' AFTER `FixDo`;
|
||||
|
||||
|
||||
|
||||
|
||||
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
|
||||
@ -101,7 +101,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="recode-form-exc">
|
||||
<form id="record-form-exc">
|
||||
<div class="row mb-3">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
@ -183,14 +183,14 @@
|
||||
<div class="col-2">
|
||||
<p>檔案上傳</p>
|
||||
</div>
|
||||
<div id="recode_files_div_exc" class="col-10">
|
||||
<div id="record_files_div_exc" class="col-10">
|
||||
<div class="row px-3 mb-3 d-flex justify-content-start align-items-center img-zoom-div">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row px-3">
|
||||
<form id="recode-file-form_exc" class="dropzone needsclick dz-clickable col-12" style="min-height: 7rem;">
|
||||
<form id="record-file-form_exc" class="dropzone needsclick dz-clickable col-12" style="min-height: 7rem;">
|
||||
<div class="fallback">
|
||||
<input type="file" multiple />
|
||||
</div>
|
||||
@ -205,7 +205,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-primary" id="save-recode-btn" onclick="SaveException()">確定</button>
|
||||
<button type="button" class="btn btn-primary" id="save-record-btn" onclick="SaveException()">確定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -226,9 +226,9 @@
|
||||
var errortoID;
|
||||
var selected_id;
|
||||
var powerStationData_name;
|
||||
var recode;
|
||||
var record;
|
||||
var psids;
|
||||
var countOperationRecodeFile = 0;
|
||||
var countOperationRecordFile = 0;
|
||||
|
||||
//#region Array.Remove
|
||||
Array.prototype.remove = function (val) {
|
||||
@ -305,7 +305,7 @@
|
||||
Allpowerids.push(String(val.id));
|
||||
});
|
||||
datatable();
|
||||
//operationRecodeTable.ajax.reload();
|
||||
//operationRecordTable.ajax.reload();
|
||||
})
|
||||
})
|
||||
//#endregion
|
||||
@ -555,7 +555,7 @@
|
||||
powerStationData_name = $(this).parents('tr').attr('data-name');
|
||||
$("#exception-form-modal .modal-title .main-title").html("維修單 - ");
|
||||
$("#exception-form-modal .modal-title .sub-title").html(powerStationData_name);
|
||||
$("#recode-form-exc").trigger("reset");
|
||||
$("#record-form-exc").trigger("reset");
|
||||
$("#power_station_select_modal_exc").val(powerStationData_name);
|
||||
$("#power_station_select_modal_exc").attr("disabled", true);
|
||||
selected_id = $(this).parents('tr').attr('data-id');
|
||||
@ -582,8 +582,8 @@
|
||||
$("#work_person_select_modal_exc").append($("<option />").val(val.value).text(val.text));
|
||||
});
|
||||
|
||||
if (recode != null || recode != undefined) {
|
||||
$("#work_person_select_modal_exc").val(recode.workPersonId);
|
||||
if (record != null || record != undefined) {
|
||||
$("#work_person_select_modal_exc").val(record.workPersonId);
|
||||
}
|
||||
}
|
||||
$("#exception-form-modal").modal();
|
||||
@ -602,7 +602,7 @@
|
||||
powerStationData_name = $(this).parents('tr').attr('data-name');
|
||||
errortoID = $(this).parents('tr').attr('data-error');
|
||||
//取得單一記錄表單
|
||||
var url = "/Operation/GetOneOperationRecode/";
|
||||
var url = "/Operation/GetOneOperationRecord/";
|
||||
|
||||
var send_data = {
|
||||
id: errortoID
|
||||
@ -614,36 +614,36 @@
|
||||
return;
|
||||
}
|
||||
|
||||
recode = rel.data;
|
||||
record = rel.data;
|
||||
|
||||
countOperationRecodeFile = recode.recodeFiles.length;
|
||||
countOperationRecordFile = record.recordFiles.length;
|
||||
|
||||
$("#exception-form-modal .modal-title .sub-title").html(powerStationData_name);
|
||||
$("#power_station_select_modal_exc").val(powerStationData_name);
|
||||
$("#power_station_select_modal_exc").attr("disabled", true);
|
||||
|
||||
$("#work_time_modal").val(recode.workTime);
|
||||
$("#work_time_modal").val(record.workTime);
|
||||
var status = -1;
|
||||
if (recode.status == 0 || recode.status == 2) {
|
||||
if (record.status == 0 || record.status == 2) {
|
||||
status = 0;
|
||||
} else if (recode.status == 1 || recode.status == 3) {
|
||||
} else if (record.status == 1 || record.status == 3) {
|
||||
status = 1;
|
||||
}
|
||||
$("input[name=status_modal][value='" + status + "']").prop('checked', true); //狀態
|
||||
$('#work_person_select_modal_exc').val(recode.workPersonId);
|
||||
$('#work_person_select_modal_exc').val(record.workPersonId);
|
||||
$(".fix-div").show();
|
||||
$("#error_code_modal_exc").val(recode.errorCode);
|
||||
$("#error_code_modal_exc").val(record.errorCode);
|
||||
$("#error_code_modal_exc").attr("disabled", true);
|
||||
$("#fix_do_modal_exc").val(recode.fixDo);
|
||||
$("#notice_textarea_modal_exc").val(recode.notice);
|
||||
$("#description_textarea_modal_exc").val(recode.description);
|
||||
$("#fix_do_modal_exc").val(record.fixDo);
|
||||
$("#notice_textarea_modal_exc").val(record.notice);
|
||||
$("#description_textarea_modal_exc").val(record.description);
|
||||
|
||||
var str = "";
|
||||
|
||||
RecodeFileBox = $("#recode_files_div_exc > .row");
|
||||
RecodeFileBox.empty();
|
||||
recode.recodeFiles.forEach(function (value, index) {
|
||||
CreateRecodeFileBox(RecodeFileBox, value, true);
|
||||
RecordFileBox = $("#record_files_div_exc > .row");
|
||||
RecordFileBox.empty();
|
||||
record.recordFiles.forEach(function (value, index) {
|
||||
CreateRecordFileBox(RecordFileBox, value, true);
|
||||
});
|
||||
//#region 維修單運維人員(異常紀錄)
|
||||
var url_power_station_operation_personnel = "/PowerStation/GetOperationPersonnelSelectOptionList";
|
||||
@ -663,8 +663,8 @@
|
||||
$("#work_person_select_modal_exc").append($("<option />").val(val.value).text(val.text));
|
||||
});
|
||||
|
||||
if (recode != null || recode != undefined) {
|
||||
$("#work_person_select_modal_exc").val(recode.workPersonId);
|
||||
if (record != null || record != undefined) {
|
||||
$("#work_person_select_modal_exc").val(record.workPersonId);
|
||||
}
|
||||
}
|
||||
$("#exception-form-modal").modal();
|
||||
@ -678,8 +678,8 @@
|
||||
//#region 儲存表單資料(異常)
|
||||
function SaveException() {
|
||||
|
||||
if ($("#recode-form-exc").valid()) {
|
||||
var url = "/Operation/SaveOperationRecode";
|
||||
if ($("#record-form-exc").valid()) {
|
||||
var url = "/Operation/SaveOperationRecord";
|
||||
|
||||
var formData = new FormData();
|
||||
|
||||
@ -707,7 +707,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var myDropzone = Dropzone.forElement("#recode-file-form_exc");
|
||||
var myDropzone = Dropzone.forElement("#record-file-form_exc");
|
||||
|
||||
if (myDropzone.files.length > 0) {
|
||||
selected_id = rel.data;
|
||||
@ -721,7 +721,7 @@
|
||||
|
||||
toast_ok(rel.msg);
|
||||
$('#exception-form-modal').modal('hide');
|
||||
recodeFileDropzone.removeAllFiles();
|
||||
recordFileDropzone.removeAllFiles();
|
||||
|
||||
ExceptionTable.ajax.reload();
|
||||
});
|
||||
@ -739,8 +739,8 @@
|
||||
|
||||
//#region 表單檔案資料(異常)
|
||||
Dropzone.autoDiscover = false;
|
||||
recodeFileDropzone = new Dropzone("#recode-file-form_exc", {
|
||||
url: "/Operation/SaveOperationRecodeFile",
|
||||
recordFileDropzone = new Dropzone("#record-file-form_exc", {
|
||||
url: "/Operation/SaveOperationRecordFile",
|
||||
acceptedFiles: "image/*, application/pdf,.doc,.docx,.xls,.xlsx",
|
||||
autoProcessQueue: false,
|
||||
parallelUploads: 5,
|
||||
@ -753,14 +753,14 @@
|
||||
var myDropzone = this;
|
||||
|
||||
myDropzone.on("sending", function (file, xhr, data) {
|
||||
if ((countOperationRecodeFile + myDropzone.files.length) > 5) {
|
||||
if ((countOperationRecordFile + myDropzone.files.length) > 5) {
|
||||
toast_warning("檔案總數量不可超過 5 張");
|
||||
myDropzone.removeFile(file);
|
||||
return;
|
||||
} else {
|
||||
|
||||
data.append("Id", selected_id);
|
||||
data.append("RecodeFiles", file);
|
||||
data.append("RecordFiles", file);
|
||||
|
||||
}
|
||||
});
|
||||
@ -770,7 +770,7 @@
|
||||
//#endregion
|
||||
|
||||
//#region 產生檔案html
|
||||
function CreateRecodeFileBox(dom, value, show_del_btn) {
|
||||
function CreateRecordFileBox(dom, value, show_del_btn) {
|
||||
var str = "";
|
||||
str += '<div class="col-auto px-0 py-2 mx-2">';
|
||||
var split = value.fileName.split(".");
|
||||
@ -787,7 +787,7 @@
|
||||
}
|
||||
|
||||
if (show_del_btn) {
|
||||
str += '<a href="javascript:;" class="del-operation-recode-file-btn" data-id="' + value.id + '">';
|
||||
str += '<a href="javascript:;" class="del-operation-record-file-btn" data-id="' + value.id + '">';
|
||||
str += '<span class="badge border border-light rounded-pill bg-danger-500 position-absolute pos-top pos-right"><i class="fal fa-times"></i></span>';
|
||||
str += '</a>';
|
||||
}
|
||||
|
||||
@ -160,14 +160,14 @@
|
||||
var errortoID;
|
||||
var powerStationData;
|
||||
var stationOverview;
|
||||
var recode;
|
||||
var record;
|
||||
var selected_work_type = -1;
|
||||
var err_status = 1;//異常紀錄,1:未解決 0:已解決
|
||||
var groupType = 0; //0:日 1:月 2:年 3:歷年
|
||||
var historyRange = "";
|
||||
var selectInverterkwhBarType = 0;
|
||||
var HeapMapXAxis = [];
|
||||
var countOperationRecodeFile = 0;
|
||||
var countOperationRecordFile = 0;
|
||||
|
||||
$(function () {
|
||||
|
||||
@ -818,7 +818,7 @@
|
||||
|
||||
//#region 運維作業記錄 DataTable
|
||||
powerids.push(stationId);
|
||||
operationRecodeTable = $("#operation_recode_table").DataTable({
|
||||
operationRecordTable = $("#operation_record_table").DataTable({
|
||||
"pageLength": 20,
|
||||
"paging": true,
|
||||
"lengthChange": false,
|
||||
@ -843,7 +843,7 @@
|
||||
}, {
|
||||
"data": "operationPredict"
|
||||
}, {
|
||||
"data": "recodeFiles"
|
||||
"data": "recordFiles"
|
||||
}, {
|
||||
"data": "finishTime"
|
||||
}, {
|
||||
@ -860,7 +860,7 @@
|
||||
|
||||
if (cellData != null) {
|
||||
cellData.forEach(function (value, index) {
|
||||
CreateRecodeFileBox($(td).children(".row"), value, false);
|
||||
CreateRecordFileBox($(td).children(".row"), value, false);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -892,7 +892,7 @@
|
||||
$(row).attr('data-work-type', data.workType);
|
||||
},
|
||||
"ajax": {
|
||||
"url": "/Operation/OperationRecodeList",
|
||||
"url": "/Operation/OperationRecordList",
|
||||
"type": "POST",
|
||||
"data": function (d) {
|
||||
d.PowerStationIds = powerids;
|
||||
@ -944,8 +944,8 @@
|
||||
$("#work_person_select_modal").append($("<option />").val(val.value).text(val.text));
|
||||
});
|
||||
|
||||
if (recode != null || recode != undefined) {
|
||||
$("#work_person_select_modal").val(recode.workPersonId);
|
||||
if (record != null || record != undefined) {
|
||||
$("#work_person_select_modal").val(record.workPersonId);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1005,8 +1005,8 @@
|
||||
$("#work_person_select_modal_exc").append($("<option />").val(val.value).text(val.text));
|
||||
});
|
||||
|
||||
if (recode != null || recode != undefined) {
|
||||
$("#work_person_select_modal_exc").val(recode.workPersonId);
|
||||
if (record != null || record != undefined) {
|
||||
$("#work_person_select_modal_exc").val(record.workPersonId);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1180,7 +1180,7 @@
|
||||
|
||||
|
||||
//#region 產生檔案html
|
||||
function CreateRecodeFileBox(dom, value, show_del_btn) {
|
||||
function CreateRecordFileBox(dom, value, show_del_btn) {
|
||||
var str = "";
|
||||
str += '<div class="col-auto px-0 py-2 mx-2">';
|
||||
var split = value.fileName.split(".");
|
||||
@ -1197,7 +1197,7 @@
|
||||
}
|
||||
|
||||
if (show_del_btn) {
|
||||
str += '<a href="javascript:;" class="del-operation-recode-file-btn" data-id="' + value.id + '">';
|
||||
str += '<a href="javascript:;" class="del-operation-record-file-btn" data-id="' + value.id + '">';
|
||||
str += '<span class="badge border border-light rounded-pill bg-danger-500 position-absolute pos-top pos-right"><i class="fal fa-times"></i></span>';
|
||||
str += '</a>';
|
||||
}
|
||||
@ -1261,7 +1261,7 @@
|
||||
selected_id = $(this).parents('tr').attr('data-id');
|
||||
errortoID = $(this).parents('tr').attr('data-error');
|
||||
//取得單一記錄表單
|
||||
var url = "/Operation/GetOneOperationRecode/";
|
||||
var url = "/Operation/GetOneOperationRecord/";
|
||||
|
||||
var send_data = {
|
||||
id: errortoID
|
||||
@ -1273,36 +1273,36 @@
|
||||
return;
|
||||
}
|
||||
|
||||
recode = rel.data;
|
||||
record = rel.data;
|
||||
|
||||
countOperationRecodeFile = recode.recodeFiles.length;
|
||||
countOperationRecordFile = record.recordFiles.length;
|
||||
|
||||
$("#exception-form-modal .modal-title .sub-title").html(powerStationData.name);
|
||||
$("#power_station_select_modal_exc").val(powerStationData.name);
|
||||
$("#power_station_select_modal_exc").attr("disabled", true);
|
||||
|
||||
$("#work_time_modal").val(recode.workTime);
|
||||
$("#work_time_modal").val(record.workTime);
|
||||
var status = -1;
|
||||
if (recode.status == 0 || recode.status == 2) {
|
||||
if (record.status == 0 || record.status == 2) {
|
||||
status = 0;
|
||||
} else if (recode.status == 1 || recode.status == 3) {
|
||||
} else if (record.status == 1 || record.status == 3) {
|
||||
status = 1;
|
||||
}
|
||||
$("input[name=status_modal][value='" + status + "']").prop('checked', true); //狀態
|
||||
$('#work_person_select_modal_exc').val(recode.workPersonId);
|
||||
$('#work_person_select_modal_exc').val(record.workPersonId);
|
||||
$(".fix-div").show();
|
||||
$("#error_code_modal_exc").val(recode.errorCode);
|
||||
$("#error_code_modal_exc").val(record.errorCode);
|
||||
$("#error_code_modal_exc").attr("disabled", true);
|
||||
$("#fix_do_modal_exc").val(recode.fixDo);
|
||||
$("#notice_textarea_modal_exc").val(recode.notice);
|
||||
$("#description_textarea_modal_exc").val(recode.description);
|
||||
$("#fix_do_modal_exc").val(record.fixDo);
|
||||
$("#notice_textarea_modal_exc").val(record.notice);
|
||||
$("#description_textarea_modal_exc").val(record.description);
|
||||
|
||||
var str = "";
|
||||
|
||||
RecodeFileBox = $("#recode_files_div_exc > .row");
|
||||
RecodeFileBox.empty();
|
||||
recode.recodeFiles.forEach(function (value, index) {
|
||||
CreateRecodeFileBox(RecodeFileBox, value, true);
|
||||
RecordFileBox = $("#record_files_div_exc > .row");
|
||||
RecordFileBox.empty();
|
||||
record.recordFiles.forEach(function (value, index) {
|
||||
CreateRecordFileBox(RecordFileBox, value, true);
|
||||
});
|
||||
|
||||
$("#exception-form-modal").modal();
|
||||
@ -1314,7 +1314,7 @@
|
||||
$('#Exception_Table').on("click", "a.add-btn", function () {
|
||||
$("#exception-form-modal .modal-title .main-title").html("維修單 - ");
|
||||
$("#exception-form-modal .modal-title .sub-title").html(powerStationData.name);
|
||||
$("#recode-form-exc").trigger("reset");
|
||||
$("#record-form-exc").trigger("reset");
|
||||
$("#power_station_select_modal_exc").val(powerStationData.name);
|
||||
$("#power_station_select_modal_exc").attr("disabled", true);
|
||||
selected_id = $(this).parents('tr').attr('data-id');
|
||||
@ -1345,8 +1345,8 @@
|
||||
//#region 儲存表單資料(異常)
|
||||
function SaveException() {
|
||||
|
||||
if ($("#recode-form-exc").valid()) {
|
||||
var url = "/Operation/SaveOperationRecode";
|
||||
if ($("#record-form-exc").valid()) {
|
||||
var url = "/Operation/SaveOperationRecord";
|
||||
|
||||
var formData = new FormData();
|
||||
|
||||
@ -1374,7 +1374,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var myDropzone = Dropzone.forElement("#recode-file-form_exc");
|
||||
var myDropzone = Dropzone.forElement("#record-file-form_exc");
|
||||
|
||||
if (myDropzone.files.length > 0) {
|
||||
selected_id = rel.data;
|
||||
@ -1388,7 +1388,7 @@
|
||||
|
||||
toast_ok(rel.msg);
|
||||
$('#exception-form-modal').modal('hide');
|
||||
recodeFileDropzone.removeAllFiles();
|
||||
recordFileDropzone.removeAllFiles();
|
||||
|
||||
ExceptionTable.ajax.reload();
|
||||
});
|
||||
@ -1406,8 +1406,8 @@
|
||||
|
||||
//#region 表單檔案資料(異常)
|
||||
Dropzone.autoDiscover = false;
|
||||
recodeFileDropzone = new Dropzone("#recode-file-form_exc", {
|
||||
url: "/Operation/SaveOperationRecodeFile",
|
||||
recordFileDropzone = new Dropzone("#record-file-form_exc", {
|
||||
url: "/Operation/SaveOperationRecordFile",
|
||||
acceptedFiles: "image/*, application/pdf,.doc,.docx,.xls,.xlsx",
|
||||
autoProcessQueue: false,
|
||||
parallelUploads: 5,
|
||||
@ -1420,14 +1420,14 @@
|
||||
var myDropzone = this;
|
||||
|
||||
myDropzone.on("sending", function (file, xhr, data) {
|
||||
if ((countOperationRecodeFile + myDropzone.files.length) > 5) {
|
||||
if ((countOperationRecordFile + myDropzone.files.length) > 5) {
|
||||
toast_warning("檔案總數量不可超過 5 張");
|
||||
myDropzone.removeFile(file);
|
||||
return;
|
||||
} else {
|
||||
|
||||
data.append("Id", selected_id);
|
||||
data.append("RecodeFiles", file);
|
||||
data.append("RecordFiles", file);
|
||||
|
||||
}
|
||||
});
|
||||
@ -1459,22 +1459,22 @@
|
||||
//#region 運維
|
||||
|
||||
//#region 編輯表單內容(運維)
|
||||
$('#operation_recode_table').on("click", "a.edit-btn", function () {
|
||||
$('#operation_record_table').on("click", "a.edit-btn", function () {
|
||||
|
||||
work_type = $(this).parents('tr').attr('data-work-type');
|
||||
|
||||
if (work_type == 0) {
|
||||
$("#recode-form-modal .modal-title .main-title").html("清洗單 - ");
|
||||
$("#record-form-modal .modal-title .main-title").html("清洗單 - ");
|
||||
} else if (work_type == 1) {
|
||||
$("#recode-form-modal .modal-title .main-title").html("巡檢單 - ");
|
||||
$("#record-form-modal .modal-title .main-title").html("巡檢單 - ");
|
||||
} else {
|
||||
$("#recode-form-modal .modal-title .main-title").html("維修單 - ");
|
||||
$("#record-form-modal .modal-title .main-title").html("維修單 - ");
|
||||
}
|
||||
|
||||
selected_id = $(this).parents('tr').attr('data-id');
|
||||
|
||||
//取得單一記錄表單
|
||||
var url = "/Operation/GetOneOperationRecode/";
|
||||
var url = "/Operation/GetOneOperationRecord/";
|
||||
|
||||
var send_data = {
|
||||
id: selected_id
|
||||
@ -1486,51 +1486,51 @@
|
||||
return;
|
||||
}
|
||||
|
||||
recode = rel.data;
|
||||
record = rel.data;
|
||||
|
||||
countOperationRecodeFile = recode.recodeFiles.length;
|
||||
countOperationRecordFile = record.recordFiles.length;
|
||||
|
||||
$("#recode-form-modal .modal-title .sub-title").html(recode.powerStationName);
|
||||
$("#record-form-modal .modal-title .sub-title").html(record.powerStationName);
|
||||
|
||||
$("#power_station_select_modal").val(recode.powerStationId);
|
||||
$("#power_station_select_modal").val(record.powerStationId);
|
||||
$("#power_station_select_modal").attr("disabled", true);
|
||||
|
||||
$("#work_time_modal").val(recode.workTime);
|
||||
$("#work_time_modal").val(record.workTime);
|
||||
var status = -1;
|
||||
if (recode.status == 0 || recode.status == 2) {
|
||||
if (record.status == 0 || record.status == 2) {
|
||||
status = 0;
|
||||
} else if (recode.status == 1 || recode.status == 3) {
|
||||
} else if (record.status == 1 || record.status == 3) {
|
||||
status = 1;
|
||||
}
|
||||
$("input[name=status_modal_opRecord][value='" + status + "']").prop('checked', true); //狀態
|
||||
$('#work_person_select_modal').val(recode.workPersonId);
|
||||
$('#work_person_select_modal').val(record.workPersonId);
|
||||
if (work_type != 2) {
|
||||
$(".fix-div").hide();
|
||||
} else {
|
||||
$(".fix-div").show();
|
||||
$("#error_code_modal").val(recode.errorCode);
|
||||
$("#fix_do_modal").val(recode.fixDo);
|
||||
$("#error_code_modal").val(record.errorCode);
|
||||
$("#fix_do_modal").val(record.fixDo);
|
||||
}
|
||||
$("#notice_textarea_modal").val(recode.notice);
|
||||
$("#description_textarea_modal").val(recode.description);
|
||||
$("#notice_textarea_modal").val(record.notice);
|
||||
$("#description_textarea_modal").val(record.description);
|
||||
|
||||
var str = "";
|
||||
|
||||
RecodeFileBox = $("#recode_files_div > .row");
|
||||
RecodeFileBox.empty();
|
||||
recode.recodeFiles.forEach(function (value, index) {
|
||||
CreateRecodeFileBox(RecodeFileBox, value, true);
|
||||
RecordFileBox = $("#record_files_div > .row");
|
||||
RecordFileBox.empty();
|
||||
record.recordFiles.forEach(function (value, index) {
|
||||
CreateRecordFileBox(RecordFileBox, value, true);
|
||||
});
|
||||
|
||||
$("#recode-form-modal").modal();
|
||||
$("#record-form-modal").modal();
|
||||
}, 'json');
|
||||
});
|
||||
//#endregion
|
||||
|
||||
//#region 表單檔案資料(運維)
|
||||
Dropzone.autoDiscover = false;
|
||||
recodeFileDropzone = new Dropzone("#recode-file-form", {
|
||||
url: "/Operation/SaveOperationRecodeFile",
|
||||
recordFileDropzone = new Dropzone("#record-file-form", {
|
||||
url: "/Operation/SaveOperationRecordFile",
|
||||
acceptedFiles: "image/*, application/pdf,.doc,.docx,.xls,.xlsx",
|
||||
autoProcessQueue: false,
|
||||
parallelUploads: 5,
|
||||
@ -1543,14 +1543,14 @@
|
||||
var myDropzone = this;
|
||||
|
||||
myDropzone.on("sending", function (file, xhr, data) {
|
||||
if ((countOperationRecodeFile + myDropzone.files.length) > 5) {
|
||||
if ((countOperationRecordFile + myDropzone.files.length) > 5) {
|
||||
toast_warning("檔案總數量不可超過 5 張");
|
||||
myDropzone.removeFile(file);
|
||||
return;
|
||||
} else {
|
||||
|
||||
data.append("Id", selected_id);
|
||||
data.append("RecodeFiles", file);
|
||||
data.append("RecordFiles", file);
|
||||
|
||||
}
|
||||
});
|
||||
@ -1576,10 +1576,10 @@
|
||||
//#endregion
|
||||
|
||||
//#region 儲存表單資料(運維)
|
||||
function SaveRecode() {
|
||||
function SaveRecord() {
|
||||
|
||||
if ($("#recode-form").valid()) {
|
||||
var url = "/Operation/SaveOperationRecode";
|
||||
if ($("#record-form").valid()) {
|
||||
var url = "/Operation/SaveOperationRecord";
|
||||
|
||||
var formData = new FormData();
|
||||
|
||||
@ -1607,7 +1607,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var myDropzone = Dropzone.forElement("#recode-file-form");
|
||||
var myDropzone = Dropzone.forElement("#record-file-form");
|
||||
|
||||
if (myDropzone.files.length > 0) {
|
||||
selected_id = rel.data;
|
||||
@ -1620,16 +1620,16 @@
|
||||
}
|
||||
|
||||
toast_ok(rel.msg);
|
||||
$('#recode-form-modal').modal('hide');
|
||||
recodeFileDropzone.removeAllFiles();
|
||||
$('#record-form-modal').modal('hide');
|
||||
recordFileDropzone.removeAllFiles();
|
||||
|
||||
operationRecodeTable.ajax.reload();
|
||||
operationRecordTable.ajax.reload();
|
||||
});
|
||||
} else {
|
||||
$('#recode-form-modal').modal('hide');
|
||||
$('#record-form-modal').modal('hide');
|
||||
myDropzone.removeAllFiles();
|
||||
|
||||
operationRecodeTable.ajax.reload();
|
||||
operationRecordTable.ajax.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1638,7 +1638,7 @@
|
||||
//#endregion
|
||||
|
||||
//#region 點擊圖片放大(運維)
|
||||
$('#operation_recode_table').on("click", "img.img-zoom", function () {
|
||||
$('#operation_record_table').on("click", "img.img-zoom", function () {
|
||||
var _this = $(this);//將當前的pimg元素作為_this傳入函式
|
||||
imgShow("#img-zoom-outer-div", "#innerdiv", "#bigimg", _this);
|
||||
});
|
||||
@ -1646,7 +1646,7 @@
|
||||
|
||||
//#region 匯出excel(運維)
|
||||
function ExportExcel() {
|
||||
var url = "/Operation/ExportOperationRecodeExcel";
|
||||
var url = "/Operation/ExportOperationRecordExcel";
|
||||
var send_data = {
|
||||
CityIds: [3],
|
||||
PowerStationIds: powerids
|
||||
@ -1705,7 +1705,7 @@
|
||||
|
||||
//#region 改變日期(運維)
|
||||
$('#date-range-record').on('change', function () {
|
||||
operationRecodeTable.ajax.reload();
|
||||
operationRecordTable.ajax.reload();
|
||||
});
|
||||
//#endregion
|
||||
|
||||
@ -1717,7 +1717,7 @@
|
||||
document.getElementById(name).setAttribute("class", "btn btn-secondary waves-effect waves-themed");
|
||||
}
|
||||
document.getElementById("button" + type).setAttribute("class", "btn btn-success waves-effect waves-themed");
|
||||
operationRecodeTable.ajax.reload();
|
||||
operationRecordTable.ajax.reload();
|
||||
|
||||
}
|
||||
//#endregion
|
||||
|
||||
@ -68,7 +68,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="recode-form-exc">
|
||||
<form id="record-form-exc">
|
||||
<div class="row mb-3">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
@ -150,14 +150,14 @@
|
||||
<div class="col-2">
|
||||
<p>檔案上傳</p>
|
||||
</div>
|
||||
<div id="recode_files_div_exc" class="col-10">
|
||||
<div id="record_files_div_exc" class="col-10">
|
||||
<div class="row px-3 mb-3 d-flex justify-content-start align-items-center img-zoom-div">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row px-3">
|
||||
<form id="recode-file-form_exc" class="dropzone needsclick dz-clickable col-12" style="min-height: 7rem;">
|
||||
<form id="record-file-form_exc" class="dropzone needsclick dz-clickable col-12" style="min-height: 7rem;">
|
||||
<div class="fallback">
|
||||
<input type="file" multiple />
|
||||
</div>
|
||||
@ -172,7 +172,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-primary" id="save-recode-btn" onclick="SaveException()">確定</button>
|
||||
<button type="button" class="btn btn-primary" id="save-record-btn" onclick="SaveException()">確定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="row mb-5">
|
||||
<div class="w-100">
|
||||
<table class="table table-bordered table-hover m-0 text-center" id="operation_recode_table">
|
||||
<table class="table table-bordered table-hover m-0 text-center" id="operation_record_table">
|
||||
<thead class="thead-themed">
|
||||
<tr>
|
||||
<th>電廠</th>
|
||||
@ -63,7 +63,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade" id="recode-form-modal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false">
|
||||
<div class="modal fade" id="record-form-modal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false">
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@ -75,7 +75,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="recode-form">
|
||||
<form id="record-form">
|
||||
<div class="row mb-3">
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
@ -157,14 +157,14 @@
|
||||
<div class="col-2">
|
||||
<p>檔案上傳</p>
|
||||
</div>
|
||||
<div id="recode_files_div" class="col-10">
|
||||
<div id="record_files_div" class="col-10">
|
||||
<div class="row px-3 mb-3 d-flex justify-content-start align-items-center img-zoom-div">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row px-3">
|
||||
<form id="recode-file-form" class="dropzone needsclick dz-clickable col-12" style="min-height: 7rem;">
|
||||
<form id="record-file-form" class="dropzone needsclick dz-clickable col-12" style="min-height: 7rem;">
|
||||
@*<div class="fallback">
|
||||
<input type="file" multiple />
|
||||
</div>*@
|
||||
@ -179,7 +179,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-primary" id="save-recode-btn" onclick="SaveRecode()">確定</button>
|
||||
<button type="button" class="btn btn-primary" id="save-record-btn" onclick="SaveRecord()">確定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -21,7 +21,7 @@ label.error {
|
||||
|
||||
#power-station-images-form .dz-preview .dz-progress,
|
||||
#power-station-single-line-form .dz-preview .dz-progress,
|
||||
#recode-file-div .dz-preview .dz-progress
|
||||
#record-file-div .dz-preview .dz-progress
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user