Merge branch 'master' of https://github.com/shanghohui-Company/SolarPower
This commit is contained in:
commit
2ab5c096ee
@ -643,7 +643,7 @@ namespace SolarPower.Controllers
|
|||||||
OperationRecordPersonnel operationRecordPersonnel = new OperationRecordPersonnel();
|
OperationRecordPersonnel operationRecordPersonnel = new OperationRecordPersonnel();
|
||||||
operationRecordPersonnel.OperationRecordId = id;
|
operationRecordPersonnel.OperationRecordId = id;
|
||||||
operationRecordPersonnel.UserId = op;
|
operationRecordPersonnel.UserId = op;
|
||||||
|
operationRecordPersonnel.CreatedBy = myUser.Id;
|
||||||
insertOperationRecordPersonnels.Add(operationRecordPersonnel);
|
insertOperationRecordPersonnels.Add(operationRecordPersonnel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -651,6 +651,7 @@ namespace SolarPower.Controllers
|
|||||||
{
|
{
|
||||||
"OperationRecordId",
|
"OperationRecordId",
|
||||||
"UserId",
|
"UserId",
|
||||||
|
"CreatedBy"
|
||||||
};
|
};
|
||||||
|
|
||||||
await operationRepository.AddOperationRecordPersonnelAsync(insertOperationRecordPersonnels, operationRecordPersonnelProperties);
|
await operationRepository.AddOperationRecordPersonnelAsync(insertOperationRecordPersonnels, operationRecordPersonnelProperties);
|
||||||
@ -658,6 +659,8 @@ namespace SolarPower.Controllers
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(post.Emailcheck == 1)
|
||||||
|
{
|
||||||
if (post.WorkPersonIds != null)
|
if (post.WorkPersonIds != null)
|
||||||
{
|
{
|
||||||
var powerstations = await powerStationRepository.GetOneAsync(post.PowerStationId);
|
var powerstations = await powerStationRepository.GetOneAsync(post.PowerStationId);
|
||||||
@ -732,8 +735,7 @@ namespace SolarPower.Controllers
|
|||||||
};
|
};
|
||||||
await noticeScheduleRepository.AddAnyThing<NoticeSchedule>(schedule, properties, "notice_schedule");
|
await noticeScheduleRepository.AddAnyThing<NoticeSchedule>(schedule, properties, "notice_schedule");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Suppress))
|
//using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Suppress))
|
||||||
//{
|
//{
|
||||||
|
|
||||||
@ -879,7 +881,8 @@ namespace SolarPower.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
if (post.Emailcheck == 1)
|
||||||
|
{
|
||||||
if (post.WorkPersonIds != null)
|
if (post.WorkPersonIds != null)
|
||||||
{
|
{
|
||||||
var powerstations = await powerStationRepository.GetOneAsync(post.PowerStationId);
|
var powerstations = await powerStationRepository.GetOneAsync(post.PowerStationId);
|
||||||
@ -956,6 +959,11 @@ namespace SolarPower.Controllers
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -293,6 +293,7 @@ namespace SolarPower.Models
|
|||||||
public string Notice { get; set; }
|
public string Notice { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public IFormFile[] RecordFiles { get; set; }
|
public IFormFile[] RecordFiles { get; set; }
|
||||||
|
public byte Emailcheck { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UpdateOperationRecord : Updated
|
public class UpdateOperationRecord : Updated
|
||||||
|
|||||||
@ -122,7 +122,7 @@ namespace SolarPower.Repository.Implement
|
|||||||
|
|
||||||
var sql = @$"SELECT aa.StartAt,aa.EndAt,aa.Kwh actualkwh,aa.Money actualMoney,SUM(pd.TODAYKWH) realKWH,SUM(pd.MONEY) realMoney,ps.Estimate_kwh CBAkwh,ps.EstimateEfficacy CBAeff ,ps.GeneratingCapacity capacity ,ps.PowerRate rate
|
var sql = @$"SELECT aa.StartAt,aa.EndAt,aa.Kwh actualkwh,aa.Money actualMoney,SUM(pd.TODAYKWH) realKWH,SUM(pd.MONEY) realMoney,ps.Estimate_kwh CBAkwh,ps.EstimateEfficacy CBAeff ,ps.GeneratingCapacity capacity ,ps.PowerRate rate
|
||||||
FROM power_station_history_day pd
|
FROM power_station_history_day pd
|
||||||
LEFT JOIN ( SELECT er.* FROM electricity_sold_record er WHERE {sqlwhere} AND er.Deleted = 0 ) aa
|
LEFT JOIN ( SELECT er.* FROM electricity_sold_record er WHERE {sqlwhere} AND er.Deleted = 0 AND er.PowerstationId = {info.PowerstationId}) aa
|
||||||
ON aa.PowerstationId = pd.PowerStationId
|
ON aa.PowerstationId = pd.PowerStationId
|
||||||
LEFT JOIN power_station ps ON ps.Id = pd.PowerStationId
|
LEFT JOIN power_station ps ON ps.Id = pd.PowerStationId
|
||||||
WHERE pd.TIMESTAMP BETWEEN aa.StartAt AND aa.EndAt AND ps.Id = {info.PowerstationId} GROUP BY aa.Id";
|
WHERE pd.TIMESTAMP BETWEEN aa.StartAt AND aa.EndAt AND ps.Id = {info.PowerstationId} GROUP BY aa.Id";
|
||||||
|
|||||||
@ -625,7 +625,7 @@ namespace SolarPower.Repository.Implement
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var sql = @$"SELECT us.* FROM power_station_operation_personnel ps LEFT JOIN user us ON ps.UserId = us.Id WHERE PowerStationId = {PowerStationId}";
|
var sql = @$"SELECT us.* FROM power_station_operation_personnel ps LEFT JOIN user us ON ps.UserId = us.Id WHERE ps.PowerStationId = {PowerStationId} and ps.Deleted = 0 AND us.Deleted = 0";
|
||||||
result = (await conn.QueryAsync<MyUser>(sql)).ToList();
|
result = (await conn.QueryAsync<MyUser>(sql)).ToList();
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<p>即時總發電量</p>
|
<p>今日總發電量</p>
|
||||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_kwh">0.00</span></p>
|
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_kwh">0.00</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
@ -36,7 +36,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<p>即時日照度</p>
|
<p>今日日照度</p>
|
||||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_irradiance">0.00</span></p>
|
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_irradiance">0.00</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
@ -280,7 +280,7 @@
|
|||||||
'<div class="row">' +
|
'<div class="row">' +
|
||||||
'<div class="col-12">' +
|
'<div class="col-12">' +
|
||||||
'<div>今日發電量(kW h):' + item.today_kWh.toFixed(2) + '</div>'+
|
'<div>今日發電量(kW h):' + item.today_kWh.toFixed(2) + '</div>'+
|
||||||
'<div>即時日照度(k W/m<sup>2</sup>):' + item.today_irradiance + '</div>'+
|
'<div>今日日照度(k W/m<sup>2</sup>):' + item.today_irradiance + '</div>'+
|
||||||
'<div>有效日照時數(kwh/kwp):' + item.today_kwhkwp.toFixed(2) + '</div>' +
|
'<div>有效日照時數(kwh/kwp):' + item.today_kwhkwp.toFixed(2) + '</div>' +
|
||||||
'<div>裝置容量(kWp):' + item.generatingCapacity.toFixed(3) + '</div>' +
|
'<div>裝置容量(kWp):' + item.generatingCapacity.toFixed(3) + '</div>' +
|
||||||
'<div>掛錶日期:' + item.electricityMeterAt + '</div>' +
|
'<div>掛錶日期:' + item.electricityMeterAt + '</div>' +
|
||||||
|
|||||||
@ -211,8 +211,13 @@
|
|||||||
<select class="form-control" id="fix_firm_select_modal"></select>
|
<select class="form-control" id="fix_firm_select_modal"></select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-lg-6 mt-5">
|
||||||
|
<div class="custom-control custom-checkbox d-flex align-content-center">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="EmailcheckBox">
|
||||||
|
<label class="custom-control-label" for="EmailcheckBox">發送Email通知</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -707,7 +712,7 @@
|
|||||||
$("#work_time_modal-error").hide();
|
$("#work_time_modal-error").hide();
|
||||||
|
|
||||||
|
|
||||||
|
$("#EmailcheckBox").prop("checked", false);
|
||||||
$("#record-form-modal").modal();
|
$("#record-form-modal").modal();
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
@ -1038,7 +1043,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$("#EmailcheckBox").prop("checked", false);
|
||||||
$("#record-form-modal").modal();
|
$("#record-form-modal").modal();
|
||||||
}, 'json');
|
}, 'json');
|
||||||
});
|
});
|
||||||
@ -1057,18 +1062,8 @@
|
|||||||
//#region 儲存表單資料
|
//#region 儲存表單資料
|
||||||
function SaveRecord() {
|
function SaveRecord() {
|
||||||
if ($('#work_person_select_modal').val().length > 0 && $("#work_time_modal").val() != "") {
|
if ($('#work_person_select_modal').val().length > 0 && $("#work_time_modal").val() != "") {
|
||||||
Swal.fire(
|
if ($("#record-form").valid())
|
||||||
{
|
{
|
||||||
title: "儲存",
|
|
||||||
text: "你確定是否儲存此筆資料?\r\n 儲存成功後將會發送Email至負責人員及廠商",
|
|
||||||
type: "warning",
|
|
||||||
icon: 'warning',
|
|
||||||
showCancelButton: true,
|
|
||||||
confirmButtonText: "是",
|
|
||||||
cancelButtonText: "否"
|
|
||||||
}).then(function (result) {
|
|
||||||
if (result.value) {
|
|
||||||
if ($("#record-form").valid()) {
|
|
||||||
var url = "/Operation/SaveOperationRecord";
|
var url = "/Operation/SaveOperationRecord";
|
||||||
|
|
||||||
var formData = new FormData();
|
var formData = new FormData();
|
||||||
@ -1090,7 +1085,12 @@
|
|||||||
formData.append("WorkTime", $("#work_time_modal").val());
|
formData.append("WorkTime", $("#work_time_modal").val());
|
||||||
formData.append("Notice", $("#notice_textarea_modal").val());
|
formData.append("Notice", $("#notice_textarea_modal").val());
|
||||||
formData.append("Description", $("#description_textarea_modal").val());
|
formData.append("Description", $("#description_textarea_modal").val());
|
||||||
|
if (document.querySelector('[id=EmailcheckBox]:checked')) {
|
||||||
|
formData.append("Emailcheck", 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
formData.append("Emailcheck", 0);
|
||||||
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: url,
|
url: url,
|
||||||
@ -1144,8 +1144,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($('#work_person_select_modal').val().length == 0)
|
if ($('#work_person_select_modal').val().length == 0)
|
||||||
|
|||||||
@ -812,7 +812,12 @@
|
|||||||
powerStationSingleLineCard = $("#power-station-single-line-card > .row");
|
powerStationSingleLineCard = $("#power-station-single-line-card > .row");
|
||||||
powerStationSingleLineCard.empty();
|
powerStationSingleLineCard.empty();
|
||||||
rel.data.forEach(function (value, index) {
|
rel.data.forEach(function (value, index) {
|
||||||
|
var split = value.image.split(".");
|
||||||
|
if (split[split.length - 1].toLowerCase() == "pdf") {
|
||||||
|
CreatePowerStationSingleLineBoxPDF(powerStationSingleLineCard, value);
|
||||||
|
} else {
|
||||||
CreatePowerStationSingleLineBox(powerStationSingleLineCard, value);
|
CreatePowerStationSingleLineBox(powerStationSingleLineCard, value);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -2870,7 +2875,7 @@
|
|||||||
//#region 單線圖 Dropzone
|
//#region 單線圖 Dropzone
|
||||||
var powerStationSingleLineDropzone = new Dropzone("#power-station-single-line-form", {
|
var powerStationSingleLineDropzone = new Dropzone("#power-station-single-line-form", {
|
||||||
url: "/PowerStation/SavePowerStationSingleLine",
|
url: "/PowerStation/SavePowerStationSingleLine",
|
||||||
acceptedFiles: "image/*",
|
acceptedFiles: "image/*,application/pdf",
|
||||||
autoProcessQueue: false,
|
autoProcessQueue: false,
|
||||||
parallelUploads: 5,
|
parallelUploads: 5,
|
||||||
maxFiles: 5,
|
maxFiles: 5,
|
||||||
@ -2914,7 +2919,14 @@
|
|||||||
powerStationSingleLineCard = $("#power-station-single-line-card > .row");
|
powerStationSingleLineCard = $("#power-station-single-line-card > .row");
|
||||||
powerStationSingleLineCard.empty();
|
powerStationSingleLineCard.empty();
|
||||||
rel.data.forEach(function (value, index) {
|
rel.data.forEach(function (value, index) {
|
||||||
|
var split = value.image.split(".");
|
||||||
|
if (split[split.length - 1].toLowerCase() == "pdf") {
|
||||||
|
CreatePowerStationSingleLineBoxPDF(powerStationSingleLineCard, value);
|
||||||
|
} else {
|
||||||
CreatePowerStationSingleLineBox(powerStationSingleLineCard, value);
|
CreatePowerStationSingleLineBox(powerStationSingleLineCard, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -2937,6 +2949,24 @@
|
|||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
//#region 創建單線圖PDFbox
|
||||||
|
function CreatePowerStationSingleLineBoxPDF(dom, value) {
|
||||||
|
var str = '<div class="col-xl" style="max-width: 20%;">' +
|
||||||
|
'<div class="card border m-auto m-lg-0" style="padding: 9.5px;">' +
|
||||||
|
'<a href="' + value.image + '" download>' +
|
||||||
|
'<img src="/img/pdf.png" class="card-img-top " alt="...">' +
|
||||||
|
'</a>'+
|
||||||
|
'<a href="javascript:void(0);" class="btn btn-danger btn-lg btn-icon rounded-circle waves-effect waves-themed position-absolute pos-top pos-right del-power-station-single-line-btn" data-id="' + value.id + '">' +
|
||||||
|
'<i class="fal fa-times"></i>' +
|
||||||
|
'</a>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>';
|
||||||
|
|
||||||
|
dom.append(str);
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
|
||||||
|
|
||||||
//#region 刪除單線圖
|
//#region 刪除單線圖
|
||||||
$('#power-station-single-line-card').on("click", "a.del-power-station-single-line-btn", function () {
|
$('#power-station-single-line-card').on("click", "a.del-power-station-single-line-btn", function () {
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
<div class="card-title font-weight-bold">單線圖</div>
|
<div class="card-title font-weight-bold">單線圖</div>
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<a href="javascript:;" class="btn btn-sm btn-success ml-auto waves-effect waves-themed" id="upload-station-single-line">
|
<a href="javascript:;" class="btn btn-sm btn-success ml-auto waves-effect waves-themed" id="upload-station-single-line">
|
||||||
<span class="fal fa-plus mr-1"></span> 上傳圖片
|
<span class="fal fa-plus mr-1"></span> 上傳檔案
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -94,7 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
<p>即時日照度</p>
|
<p>今日日照度</p>
|
||||||
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_irradiance">0.00</span></p>
|
<p><span class="color-info-700 fs-xl font-weight-bold" id="today_irradiance">0.00</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
|
|||||||
@ -319,7 +319,7 @@
|
|||||||
labels: chartToday.labels,
|
labels: chartToday.labels,
|
||||||
datasets: [{
|
datasets: [{
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
label: '輸出功率',
|
label: '發電量',
|
||||||
yAxisID: 'A',
|
yAxisID: 'A',
|
||||||
backgroundColor: 'rgb(103, 180, 172)',
|
backgroundColor: 'rgb(103, 180, 172)',
|
||||||
order: 3,
|
order: 3,
|
||||||
@ -411,7 +411,7 @@
|
|||||||
labels: chart7day.labels,
|
labels: chart7day.labels,
|
||||||
datasets: [{
|
datasets: [{
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
label: '輸出功率',
|
label: '發電量',
|
||||||
yAxisID: 'A',
|
yAxisID: 'A',
|
||||||
backgroundColor: 'rgb(103, 180, 172)',
|
backgroundColor: 'rgb(103, 180, 172)',
|
||||||
order: 3,
|
order: 3,
|
||||||
@ -503,7 +503,7 @@
|
|||||||
labels: chartMonth.labels,
|
labels: chartMonth.labels,
|
||||||
datasets: [{
|
datasets: [{
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
label: '輸出功率',
|
label: '發電量',
|
||||||
yAxisID: 'A',
|
yAxisID: 'A',
|
||||||
backgroundColor: 'rgb(103, 180, 172)',
|
backgroundColor: 'rgb(103, 180, 172)',
|
||||||
order: 3,
|
order: 3,
|
||||||
@ -595,7 +595,7 @@
|
|||||||
labels: chartYear.labels,
|
labels: chartYear.labels,
|
||||||
datasets: [{
|
datasets: [{
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
label: '輸出功率',
|
label: '發電量',
|
||||||
yAxisID: 'A',
|
yAxisID: 'A',
|
||||||
backgroundColor: 'rgb(103, 180, 172)',
|
backgroundColor: 'rgb(103, 180, 172)',
|
||||||
order: 2,
|
order: 2,
|
||||||
@ -951,6 +951,32 @@
|
|||||||
$("#work_person_select_modal").val(record.workPersonId);
|
$("#work_person_select_modal").val(record.workPersonId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#work_person_select_modal").select2({ dropdownParent: $('#record-form-modal') });
|
||||||
|
});
|
||||||
|
|
||||||
|
//查詢該電站的廠商
|
||||||
|
var url_power_station_firm = "/PowerStation/GetFirmSelectOptionList";
|
||||||
|
|
||||||
|
$.post(url_power_station_firm, send_data, function (rel) {
|
||||||
|
if (rel.code != "0000") {
|
||||||
|
toast_error(rel.msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#fix_firm_select_modal").empty();
|
||||||
|
if (rel.data.length > 0) {
|
||||||
|
|
||||||
|
$.each(rel.data, function (index, val) {
|
||||||
|
$("#fix_firm_select_modal").append($("<option />").val(val.value).text(val.text));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#fix_firm_select_modal").val($("#fix_firm_select_modal option:first").val()).trigger('change');
|
||||||
|
|
||||||
|
if (record != undefined && record != null) {
|
||||||
|
$("#fix_firm_select_modal").val(record.fixFirm)
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
//#endregion
|
//#endregion
|
||||||
@ -1510,7 +1536,7 @@
|
|||||||
status = 1;
|
status = 1;
|
||||||
}
|
}
|
||||||
$("input[name=status_modal_opRecord][value='" + status + "']").prop('checked', true); //狀態
|
$("input[name=status_modal_opRecord][value='" + status + "']").prop('checked', true); //狀態
|
||||||
$('#work_person_select_modal').val(record.workPersonId);
|
$('#work_person_select_modal').val(record.workPersonId).trigger("change");;
|
||||||
if (work_type != 2) {
|
if (work_type != 2) {
|
||||||
$(".fix-div").hide();
|
$(".fix-div").hide();
|
||||||
} else {
|
} else {
|
||||||
@ -1518,6 +1544,7 @@
|
|||||||
$("#error_code_modal").val(record.errorCode);
|
$("#error_code_modal").val(record.errorCode);
|
||||||
$("#fix_do_modal").val(record.fixDo);
|
$("#fix_do_modal").val(record.fixDo);
|
||||||
}
|
}
|
||||||
|
$("#fix_firm_select_modal").val(record.fixFirm).trigger("change");
|
||||||
$("#notice_textarea_modal").val(record.notice);
|
$("#notice_textarea_modal").val(record.notice);
|
||||||
$("#description_textarea_modal").val(record.description);
|
$("#description_textarea_modal").val(record.description);
|
||||||
|
|
||||||
@ -1528,12 +1555,22 @@
|
|||||||
record.recordFiles.forEach(function (value, index) {
|
record.recordFiles.forEach(function (value, index) {
|
||||||
CreateRecordFileBox(RecordFileBox, value, true);
|
CreateRecordFileBox(RecordFileBox, value, true);
|
||||||
});
|
});
|
||||||
|
$("#EmailcheckBox").prop("checked", false);
|
||||||
$("#record-form-modal").modal();
|
$("#record-form-modal").modal();
|
||||||
}, 'json');
|
}, 'json');
|
||||||
});
|
});
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
//#region 表單驗證
|
||||||
|
$("#record-form").validate({
|
||||||
|
rules: {
|
||||||
|
work_time_modal: {
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
//#endregion
|
||||||
|
|
||||||
//#region 表單檔案資料(運維)
|
//#region 表單檔案資料(運維)
|
||||||
Dropzone.autoDiscover = false;
|
Dropzone.autoDiscover = false;
|
||||||
recordFileDropzone = new Dropzone("#record-file-form", {
|
recordFileDropzone = new Dropzone("#record-file-form", {
|
||||||
@ -1582,9 +1619,22 @@
|
|||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
$('#work_person_select_modal').change(function () {
|
||||||
|
if ($('#work_person_select_modal').val().length == 0) {
|
||||||
|
$('#work_person_select_modal-error').show();
|
||||||
|
} else {
|
||||||
|
$('#work_person_select_modal-error').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#work_time_modal').change(function () {
|
||||||
|
$("#work_time_modal-error").hide();
|
||||||
|
});
|
||||||
|
|
||||||
//#region 儲存表單資料(運維)
|
//#region 儲存表單資料(運維)
|
||||||
function SaveRecord() {
|
function SaveRecord() {
|
||||||
|
if ($('#work_person_select_modal').val().length > 0 && $("#work_time_modal").val() != "")
|
||||||
|
{
|
||||||
if ($("#record-form").valid()) {
|
if ($("#record-form").valid()) {
|
||||||
var url = "/Operation/SaveOperationRecord";
|
var url = "/Operation/SaveOperationRecord";
|
||||||
|
|
||||||
@ -1595,12 +1645,20 @@
|
|||||||
formData.append("WorkType", selected_work_type);
|
formData.append("WorkType", selected_work_type);
|
||||||
formData.append("ErrorCode", $("#error_code_modal").val());
|
formData.append("ErrorCode", $("#error_code_modal").val());
|
||||||
formData.append("FixDo", $("#fix_do_modal").val());
|
formData.append("FixDo", $("#fix_do_modal").val());
|
||||||
|
formData.append("FixFirm", $("#fix_firm_select_modal").val());
|
||||||
formData.append("Status", $("input[name=status_modal_opRecord]:checked").val());
|
formData.append("Status", $("input[name=status_modal_opRecord]:checked").val());
|
||||||
formData.append("WorkPersonId", $("#work_person_select_modal").val());
|
$("#work_person_select_modal").val().forEach(function (item) {
|
||||||
|
formData.append("WorkPersonIds", parseInt(item));
|
||||||
|
});
|
||||||
formData.append("WorkTime", $("#work_time_modal").val());
|
formData.append("WorkTime", $("#work_time_modal").val());
|
||||||
formData.append("Notice", $("#notice_textarea_modal").val());
|
formData.append("Notice", $("#notice_textarea_modal").val());
|
||||||
formData.append("Description", $("#description_textarea_modal").val());
|
formData.append("Description", $("#description_textarea_modal").val());
|
||||||
|
if (document.querySelector('[id=EmailcheckBox]:checked')) {
|
||||||
|
formData.append("Emailcheck", 1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
formData.append("Emailcheck", 0);
|
||||||
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: url,
|
url: url,
|
||||||
@ -1642,6 +1700,16 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if ($('#work_person_select_modal').val().length == 0) {
|
||||||
|
$('#work_person_select_modal-error').show();
|
||||||
|
}
|
||||||
|
if ($("#work_time_modal").val() == "") {
|
||||||
|
$("#work_time_modal-error").show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region 點擊圖片放大(運維)
|
//#region 點擊圖片放大(運維)
|
||||||
@ -2010,7 +2078,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
title: {
|
title: {
|
||||||
text: '逆變器單日kWhkWp'
|
text: '各逆變器當日有效日照時數'
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
categories: HeatMap.xAxis,
|
categories: HeatMap.xAxis,
|
||||||
|
|||||||
@ -131,7 +131,7 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="notice_textarea_modal_exc">巡檢注意事項</label>
|
<label class="form-label" for="notice_textarea_modal_exc">項目內容</label>
|
||||||
<textarea class="form-control" id="notice_textarea_modal_exc" rows="5"></textarea>
|
<textarea class="form-control" id="notice_textarea_modal_exc" rows="5"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -79,7 +79,7 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="power_station_select_modal">電站</label>
|
<label class="form-label" for="power_station_select_modal"><span class="text-danger">*</span>電站</label>
|
||||||
@*<input class="form-control" id="power_station_select_modal" type="text" name="power_station_select_modal" />*@
|
@*<input class="form-control" id="power_station_select_modal" type="text" name="power_station_select_modal" />*@
|
||||||
<select class="form-control" id="power_station_select_modal">
|
<select class="form-control" id="power_station_select_modal">
|
||||||
</select>
|
</select>
|
||||||
@ -87,8 +87,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="work_time_modal">作業日期</label>
|
<label class="form-label" for="work_time_modal"><span class="text-danger">*</span>作業日期</label>
|
||||||
<input class="form-control" id="work_time_modal" type="date" name="work_time_modal" />
|
<input class="form-control" id="work_time_modal" type="date" name="work_time_modal" />
|
||||||
|
<label id="work_time_modal-error" class="" style="z-index:1;color:red;display:none">此為必填欄位</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -96,7 +97,7 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="example-select">狀態</label>
|
<label class="form-label" for="example-select"><span class="text-danger">*</span>狀態</label>
|
||||||
<div>
|
<div>
|
||||||
<div class="custom-control custom-radio custom-control-inline">
|
<div class="custom-control custom-radio custom-control-inline">
|
||||||
<input type="radio" class="custom-control-input ml-auto" id="status_none_complete" name="status_modal_opRecord" value="0" />
|
<input type="radio" class="custom-control-input ml-auto" id="status_none_complete" name="status_modal_opRecord" value="0" />
|
||||||
@ -111,11 +112,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="work_person_select_modal">執行人員</label>
|
<label class="form-label" for="work_person_select_modal"><span class="text-danger">*</span>執行人員</label>
|
||||||
<select class="form-control" id="work_person_select_modal">
|
<select class="form-control" id="work_person_select_modal" multiple="multiple">
|
||||||
</select>
|
</select>
|
||||||
|
<label id="work_person_select_modal-error" class="" style="z-index:1;color:red;display:none">此為必填欄位</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3 fix-div">
|
<div class="row mb-3 fix-div">
|
||||||
@ -123,7 +126,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="error_code_modal">異常編號</label>
|
<label class="form-label" for="error_code_modal">異常編號</label>
|
||||||
<input class="form-control" id="error_code_modal" type="text" name="error_code_modal" />
|
<input class="form-control" id="error_code_modal" type="text" name="error_code_modal" disabled/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -135,10 +138,25 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label" for="fix_firm_modal">負責廠商</label>
|
||||||
|
<select class="form-control" id="fix_firm_select_modal"></select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-6 mt-5">
|
||||||
|
<div class="custom-control custom-checkbox d-flex align-content-center">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="EmailcheckBox">
|
||||||
|
<label class="custom-control-label" for="EmailcheckBox">發送Email通知</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label" for="notice_textarea_modal">巡檢注意事項</label>
|
<label class="form-label" for="notice_textarea_modal">項目內容</label>
|
||||||
<textarea class="form-control" id="notice_textarea_modal" rows="5"></textarea>
|
<textarea class="form-control" id="notice_textarea_modal" rows="5"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
BIN
SolarPower/wwwroot/img/pdf.png
Normal file
BIN
SolarPower/wwwroot/img/pdf.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
Loading…
Reference in New Issue
Block a user