feat:; マスタメンテ修正

This commit is contained in:
shimoda.m@nds-tyo.co.jp 2023-07-28 17:14:08 +09:00
parent c47b0cb7c2
commit 175b4c41af
6 changed files with 47 additions and 49 deletions

View File

@ -1,28 +1,28 @@
from pydantic import BaseModel
from typing import Optional
from src.util.string_util import is_not_empty
class InstEmpCsvDownloadViewModel(BaseModel):
subtitle: str = '施設担当者データCSVダウンロード'
is_search: Optional[bool] = False
ta_cd: Optional[str] = ''
inst_cd: Optional[str] = ''
emp_cd: Optional[str] = ''
apply_date_from: Optional[str] = ''
start_date_from: Optional[str] = ''
start_date_to: Optional[str] = ''
end_date_from: Optional[str] = ''
end_date_to: Optional[str] = ''
create_date_from: Optional[str] = ''
create_date_to: Optional[str] = ''
update_date_from: Optional[str] = ''
update_date_to: Optional[str] = ''
select_table: Optional[str] = ''
data_count: Optional[int] = 0
result_msg: Optional[str] = ''
download_file_url: Optional[str] = ''
file_name: Optional[str] = ''
is_search: bool = False
ta_cd: str = ''
inst_cd: str = ''
emp_cd: str = ''
apply_date_from: str = ''
start_date_from: str = ''
start_date_to: str = ''
end_date_from: str = ''
end_date_to: str = ''
create_date_from: str = ''
create_date_to: str = ''
update_date_from: str = ''
update_date_to: str = ''
select_table: str = ''
data_count: int = 0
result_msg: str = ''
download_file_url: str = ''
file_name: str = ''
def is_select_table_empty(self):
return not is_not_empty(self.select_table)

View File

@ -1,21 +1,20 @@
from typing import Optional
from pydantic import BaseModel
from src.system_var import constants
class InstEmpCsvUploadViewModel(BaseModel):
subtitle: str = '施設担当者データCSVアップロード'
is_verified: Optional[bool]
is_insert: Optional[bool]
error_message_list: Optional[list[str]]
select_function: Optional[str]
select_table: Optional[str]
csv_file_name: Optional[str]
csv_upload_list: Optional[list[dict]]
json_upload_data: Optional[str]
result_message_list: Optional[list[str]]
select_function_message: Optional[str]
is_verified: bool = False
is_insert: bool = False
error_message_list: list[str] = None
select_function: str = None
select_table: str = None
csv_file_name: str = None
csv_upload_list: list[dict] = None
json_upload_data: str = None
result_message_list: list[str] = None
select_function_message: str = None
def select_table_message(self):
return self.__dummy_table() if self.select_table == 'dummy' else self.__real_table()

View File

@ -1,8 +1,7 @@
from pydantic import BaseModel
from typing import Optional
class TableOverrideViewModel(BaseModel):
subtitle: str = 'テーブル上書きコピー'
is_override: Optional[bool] = False
is_override: bool = False

View File

@ -13,18 +13,18 @@
formBtDisabled();
// DatePickerを有効化
enableDatePicker();
{% if mainte_csv_dl.is_search and mainte_csv_dl.data_count > 0 and mainte_csv_dl.is_download_file_url_empty() is false %}
// {% if mainte_csv_dl.is_search and mainte_csv_dl.data_count > 0 and mainte_csv_dl.is_download_file_url_empty() is false %}
// CSV自動ダウンロード処理
var link_tag = document.createElement("a");
const link_tag = document.createElement("a");
link_tag.Target="_blank";
link_tag.id = "download_url_link";
link_tag.style.display = 'none';
link_tag.style.display = 'none';
link_tag.setAttribute("href", "{{mainte_csv_dl.download_file_url | safe}}");
link_tag.setAttribute("download", "{{mainte_csv_dl.file_name}}");
document.getElementById("notification").appendChild(link_tag);
document.getElementById("download_url_link").click();
document.getElementById("download_url_link").remove();
{% endif %}
// {% endif %}
};
function Form_Submit_Disp_Dialog(){
var msg = 'CSVファイルを出力しますか';
@ -33,8 +33,8 @@
document.getElementById("csvOutputMsg").style.display = "none";
} else {
return false;
}
}
}
}
</script>
</head>
@ -98,7 +98,7 @@
oninput="formBtDisabled()"
>
<input class="searchDateTextbox date_picker" type="text" name="ctrl_start_date_to" value="{{mainte_csv_dl.start_date_to | safe}}" maxlength='10'
<input class="searchDateTextbox date_picker" type="text" name="ctrl_start_date_to" value="{{mainte_csv_dl.start_date_to | safe}}" maxlength='10'
onchange="formBtDisabled()"
oninput="formBtDisabled()"
>
@ -111,7 +111,7 @@
oninput="formBtDisabled()"
>
<input class="searchDateTextbox date_picker" type="text" name="ctrl_end_date_to" value="{{mainte_csv_dl.end_date_to | safe}}" maxlength='10'
<input class="searchDateTextbox date_picker" type="text" name="ctrl_end_date_to" value="{{mainte_csv_dl.end_date_to | safe}}" maxlength='10'
onchange="formBtDisabled()"
oninput="formBtDisabled()"
>
@ -122,13 +122,13 @@
<!-- 対象テーブル -->
<td class="searchLabelTd">対象テーブル:</td>
<td class="searchInputTd">
<label>
<label>
<input type="radio" name="radio_select_table" value="dummy"
{{ "checked " if mainte_csv_dl.select_table == 'dummy' or mainte_csv_dl.is_select_table_empty() }}
>ダミーテーブル
</label>
<label>
<input type="radio" name="radio_select_table" value="real"
<input type="radio" name="radio_select_table" value="real"
{{ "checked " if mainte_csv_dl.select_table == 'real' }}
>本番テーブル
</label>

View File

@ -8,9 +8,9 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript">
window.onload = function(){
{% if mainte_csv_up.is_insert %}
// {% if mainte_csv_up.is_insert %}
sessionStorage.clear();
{% else %}
// {% else %}
if (sessionStorage["ctrl_select_function"]) {
var element = document.getElementById("upload_form");
if (sessionStorage["ctrl_select_function"] === "new") {
@ -29,7 +29,7 @@
element.real_table.checked = true;
}
}
{% endif %}
// {% endif %}
}
function Form_Submit(){
sessionStorage.clear();

View File

@ -4,7 +4,7 @@
{% with subtitle = table_override.subtitle %}
{% include '_header.html' %}
{% endwith %}
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link href="/static/css/masterMainte.css" rel="stylesheet" />
<script type="text/javascript">
@ -51,8 +51,8 @@
{% if table_override.is_override %}
<p>
<div id="overRided" class="csvOutputMessage">ダミー従業員担当施設マスタのデータを本番従業員担当施設マスタのデータで上書きしました</div>
</p>
{% endif %}
</p>
{% endif %}
<div id="loading" class="csvOutputMessage" style="display:none;">
<p>データ上書き中...<br>しばらくお待ち下さい。</p>
</div>