Commit 051d2e6b by Kim Eunchul

Merge branch 'feature/1.4.0' into 'feature/1.4.0_kim-ec'

# Conflicts:
#   app/index.html
#   app/script/check.js
parents c2657f11 5d0e71bd
...@@ -10250,7 +10250,8 @@ input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn- ...@@ -10250,7 +10250,8 @@ input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-
.navbar { .navbar {
position: relative; position: relative;
padding: .5rem 1rem padding: .5rem 1rem;
height: 50px;
} }
.navbar,.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl { .navbar,.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl {
...@@ -20191,7 +20192,7 @@ button { ...@@ -20191,7 +20192,7 @@ button {
text-align: -webkit-center; text-align: -webkit-center;
border-radius: 15px; border-radius: 15px;
z-index: 1032; z-index: 1032;
height: calc(50vh); height: auto;
width: 60%; width: 60%;
position: absolute; position: absolute;
top: calc(5vh); top: calc(5vh);
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<body onload="CHK_L.init();" style="position: relative; margin-top: 53px;"> <body onload="CHK_L.init();" style="position: relative; margin-top: 53px;">
<header style="position: fixed; width: 100%; top: 0px; left: 0; z-index: 999;"> <header style="position: fixed; width: 100%; top: 0px; left: 0; z-index: 999;">
<nav class="navbar navbar-dark bg-primary"> <nav class="navbar navbar-dark bg-primary">
<a class="navbar-brand category-btn lht-0" href="#" onclick="CHK.openCategory();" > <a class="navbar-brand category-btn lht-0 d-none" id="operationGroupMasterButton" href="javascript:CHK.setCategoryHeight();">
<i class="fa fa-folder fs-12 p-1" id="category-toggle-button"></i> <i class="fa fa-folder fs-12 p-1" id="category-toggle-button"></i>
<span class="d-none d-md-inline fs-10">カテゴリー</span> <span class="d-none d-md-inline fs-10">カテゴリー</span>
</a> </a>
......
...@@ -42,6 +42,8 @@ CHK.operationGroupMaster; //カテゴリーデータ ...@@ -42,6 +42,8 @@ CHK.operationGroupMaster; //カテゴリーデータ
CHK.operationGroupMasterRelation; //作業・カテゴリー関係データ CHK.operationGroupMasterRelation; //作業・カテゴリー関係データ
CHK.pushMessage; //コミュニケーションデータ CHK.pushMessage; //コミュニケーションデータ
var scanResultCode; //スキャンしたRFID,バーコード
var pageLang; // ページ設定言語 var pageLang; // ページ設定言語
var isSetCategory = true var isSetCategory = true
var CATEGORY_HEIGHT; //カテゴリー描画用固定値(高さ) var CATEGORY_HEIGHT; //カテゴリー描画用固定値(高さ)
...@@ -60,8 +62,7 @@ var msgMap = { // velocity? ...@@ -60,8 +62,7 @@ var msgMap = { // velocity?
completeUpload: {ja:"登録が完了しました。<br/>右上の閉じるボタンをクリックし、画面を閉じてください。", ko:"등록했습니다. <br/>오른쪽 위의 닫기버튼을 클릭해, 화면을 닫아주세요.", en:"Registered. <br/>Please click the close button in the upper right and close the screen."}, completeUpload: {ja:"登録が完了しました。<br/>右上の閉じるボタンをクリックし、画面を閉じてください。", ko:"등록했습니다. <br/>오른쪽 위의 닫기버튼을 클릭해, 화면을 닫아주세요.", en:"Registered. <br/>Please click the close button in the upper right and close the screen."},
Yes: {ja:"はい", ko:"Yes", en:"Yes"}, Yes: {ja:"はい", ko:"Yes", en:"Yes"},
No: {ja:"いいえ", ko:"No", en:"No"}, No: {ja:"いいえ", ko:"No", en:"No"},
onlyRfid:{ja:"RFID又はバーコードが設定されています。<br/>該当コードを読み込んでください。", ko:"RFID또는 바코드가 설정되어있습니다. <br/>해당코드를 스캔해주십시오.", en:"RFID or barcode is set. <br/>Please scan the code."}, onlyRfid:{ja:"RFID又はバーコードが設定されています。\n該当コードを読み込んでください。", ko:"RFID또는 바코드가 설정되어있습니다.\n해당코드를 스캔해주십시오.", en:"RFID or barcode is set.\nPlease scan the code."},
notExistCode:{ja:"読み込んだコードと一致しません。<br/>コードを確認してもう一度お願いします。<br/>", ko:"스캔된코드와 일치하는 작업이 존재하지않습니다. <br/>코드를 확인하고 한번도 시도해주세요. <br/>", en:"No action exists that matches the scanned code. <br/>Please check the code and try it once. <br/>"},
overwriteCheck: {ja:"未公開のバージョンの簡易帳票が存在します。<br/>上書きしますか?", ko:"미공개 버전의 간이 서류가 존재합니다. <br/>덮어 쓰시겠습니까?", en:"There is an unpublished version of the quick report. <br/>Do you want to overwrite?"}, overwriteCheck: {ja:"未公開のバージョンの簡易帳票が存在します。<br/>上書きしますか?", ko:"미공개 버전의 간이 서류가 존재합니다. <br/>덮어 쓰시겠습니까?", en:"There is an unpublished version of the quick report. <br/>Do you want to overwrite?"},
dateError: {ja:"検索日が不正です。", ko:"잘못된 검색일입니다.", en:"Please enter correct search date."}, dateError: {ja:"検索日が不正です。", ko:"잘못된 검색일입니다.", en:"Please enter correct search date."},
}; };
...@@ -84,9 +85,9 @@ function getLang() { ...@@ -84,9 +85,9 @@ function getLang() {
return pageLang; return pageLang;
} }
// メッセージを取得 // 言語コードをセット
function getMsg(key) { function setLangCode() {
lang = getLang(); lang = getLang();
if (lang.split("-")[0] == "ja") { if (lang.split("-")[0] == "ja") {
lang = "ja"; lang = "ja";
} else if (lang.split("-")[0] == "ko") { } else if (lang.split("-")[0] == "ko") {
...@@ -94,6 +95,12 @@ function getMsg(key) { ...@@ -94,6 +95,12 @@ function getMsg(key) {
} else { } else {
lang = "en"; lang = "en";
} }
}
// メッセージを取得
function getMsg(key) {
setLangCode();
var msg = msgMap[key]; var msg = msgMap[key];
if (!msg) { if (!msg) {
return ""; return "";
...@@ -281,6 +288,7 @@ CHK.initCommon = function() { ...@@ -281,6 +288,7 @@ CHK.initCommon = function() {
CHK.isAndroid = urlParam.app && urlParam.app == "android"; CHK.isAndroid = urlParam.app && urlParam.app == "android";
CHK.isIOS = urlParam.app && urlParam.app == "ios"; CHK.isIOS = urlParam.app && urlParam.app == "ios";
CHK.isRFIDBarcodeScan = urlParam.isRFIDBarcodeScan && urlParam.isRFIDBarcodeScan == "1"; CHK.isRFIDBarcodeScan = urlParam.isRFIDBarcodeScan && urlParam.isRFIDBarcodeScan == "1";
CHK.isOperationGroupMaster = urlParam.isOperationGroupMaster && urlParam.isOperationGroupMaster == "1";
CHK.sortIndex = urlParam.sortIndex; CHK.sortIndex = urlParam.sortIndex;
// ウェブの場合、作業一覧の表示広さを変更 // ウェブの場合、作業一覧の表示広さを変更
if (CHK.isWeb) { if (CHK.isWeb) {
...@@ -295,6 +303,9 @@ CHK.initCommon = function() { ...@@ -295,6 +303,9 @@ CHK.initCommon = function() {
if (CHK.isIOS && CHK.isRFIDBarcodeScan) { if (CHK.isIOS && CHK.isRFIDBarcodeScan) {
$("#rfidScanButton").removeClass("d-none"); $("#rfidScanButton").removeClass("d-none");
} }
if (CHK.isOperationGroupMaster) {
$("#operationGroupMasterButton").removeClass("d-none");
}
CHK.debug = urlParam.debug; CHK.debug = urlParam.debug;
CHK.isMobile = urlParam.mobile_flg && urlParam.mobile_flg == "1"; CHK.isMobile = urlParam.mobile_flg && urlParam.mobile_flg == "1";
...@@ -443,6 +454,20 @@ CHK.initReportApp = function (callback) { ...@@ -443,6 +454,20 @@ CHK.initReportApp = function (callback) {
} }
/** /**
* カテゴリー表示領域の高さ調整
*/
CHK.setCategoryHeight = function() {
//カテゴリー高さ固定
if(isSetCategory){
CATEGORY_HEIGHT = $('main').height();
console.log(CATEGORY_HEIGHT);
isSetCategory = false
}
$('#category-menu').height(CATEGORY_HEIGHT);
$('#overlayDiv').height(CATEGORY_HEIGHT);
}
/**
* 作業報告初期処理、Web * 作業報告初期処理、Web
* *
* @param callback コールバック * @param callback コールバック
...@@ -2848,10 +2873,41 @@ CHK.changeSortType = function(sortType) { ...@@ -2848,10 +2873,41 @@ CHK.changeSortType = function(sortType) {
* 作業一覧描画 * 作業一覧描画
*/ */
CHK.createOperationList = function(operationList, isSearched = false) { CHK.createOperationList = function(operationList, isSearched = false) {
var searchKeyword = $("#searchTaskName").val();
var searchStartDate = $("#searchStartDate").val();
var searchEndDate = $("#searchEndDate").val();
var operationGroupMasterId = CHK.operationGroupMasterId;
$('#operationTable').empty(); $('#operationTable').empty();
if (isSearched) { if (isSearched) {
operationList = CHK.operation.searchOperationList; operationList = CHK.operation.searchOperationList;
} }
operationList = operationList.filter(function(operation) {
var result = true;
if (searchKeyword.length) {
result = result * operation.operationName.includes(searchKeyword);
}
if (searchStartDate.length && !searchEndDate.length) {
result = result * (operation.operationStartDate >= searchStartDate);
}
if (searchEndDate.length && !searchStartDate.length) {
result = result * (operation.operationEndDate <= searchEndDate);
}
if (searchStartDate.length && searchEndDate.length) {
result = result * ((operation.operationStartDate <= searchEndDate) && (operation.operationEndDate >= searchStartDate));
}
if (operationGroupMasterId != 0) {
var operationGroupMasterIdList = CHK.operationGroupMasterRelation.operationGroupMasterRelationList.filter(function(operationGroupMasterRelation) {
return operationGroupMasterRelation.operationId == operation.operationId;
})
result = result * operationGroupMasterIdList.filter(function(operationGroupMaster){
return operationGroupMaster.operationGroupMasterId == operationGroupMasterId;
}).length;
}
return result;
})
if (operationList.length > 1) { if (operationList.length > 1) {
var sortType = $(".sort-type.active").data("sort"); var sortType = $(".sort-type.active").data("sort");
if (isSearched) { if (isSearched) {
...@@ -2941,6 +2997,9 @@ CHK.createOperationList = function(operationList, isSearched = false) { ...@@ -2941,6 +2997,9 @@ CHK.createOperationList = function(operationList, isSearched = false) {
operationTR.append(iconTd); operationTR.append(iconTd);
$(".table tbody").append(operationTR); $(".table tbody").append(operationTR);
if(CHK.isAndroid) {
android.hideLoading();
}
} }
}; };
...@@ -3048,6 +3107,12 @@ CHK.startScan = function() { ...@@ -3048,6 +3107,12 @@ CHK.startScan = function() {
} }
$(".scan-overlay").removeClass("d-none"); $(".scan-overlay").removeClass("d-none");
$(".scan-area").removeClass("d-none"); $(".scan-area").removeClass("d-none");
var positionY = $(document).scrollTop() + screen.height/8;
var height = screen.height/4;
$(".scan-area").css("top", positionY);
$(".scan-area").css("min-height", height);
$("body").css("overflow", "hidden");
} }
CHK.scanClose = function() { CHK.scanClose = function() {
...@@ -3062,9 +3127,18 @@ CHK.scanClose = function() { ...@@ -3062,9 +3127,18 @@ CHK.scanClose = function() {
} }
$(".scan-overlay").addClass("d-none"); $(".scan-overlay").addClass("d-none");
$(".scan-area").addClass("d-none"); $(".scan-area").addClass("d-none");
$("body").css("overflow", "visible");
} }
document.addEventListener('visibilitychange', () => {
// バックグラウンド遷移時
if (document.visibilityState === 'hidden') {
CHK.scanClose();
}
});
CHK.scanResult = function(scannedCode, scanType) { CHK.scanResult = function(scannedCode, scanType) {
scanResultCode = scannedCode;
if (scannedCode == null || !(scannedCode.length)) { if (scannedCode == null || !(scannedCode.length)) {
return; return;
} }
...@@ -3074,6 +3148,7 @@ CHK.scanResult = function(scannedCode, scanType) { ...@@ -3074,6 +3148,7 @@ CHK.scanResult = function(scannedCode, scanType) {
var resultCode = scannedCode; var resultCode = scannedCode;
if (scanType == 1) { if (scanType == 1) {
resultCode = scannedCode.substring(4); resultCode = scannedCode.substring(4);
scanResultCode = resultCode;
} }
return operation.permitCode == resultCode; return operation.permitCode == resultCode;
})[0]; })[0];
...@@ -3101,15 +3176,26 @@ CHK.alertClose = function() { ...@@ -3101,15 +3176,26 @@ CHK.alertClose = function() {
} }
CHK.displayAlert = function(msgCode) { CHK.displayAlert = function(msgCode) {
$("#alertMsg").html(getMsg(msgCode)); // RFID(バーコード)関連は通常のアラート表示
$(".alert-overlay").removeClass("d-none"); if (msgCode == "notExistCode") {
$(".alert-area").removeClass("d-none"); // scanResultCodeを代入するため別で処理
var positionY = $(document).scrollTop() + screen.height/8; setLangCode();
var height = screen.height/4; var notExistCodeMessage = {ja:"読み込んだコードと一致しません。\n\n読み込んだコード:" + scanResultCode + "\n\nコードを確認してもう一度お願いします。", ko:"스캔된코드와 일치하는 작업이 존재하지않습니다.\n\n스캔 한 코드: " + scanResultCode + "\n\n코드를 확인하고 한번도 시도해주세요.", en:"No action exists that matches the scanned code.\n\nScanned code: " + scanResultCode + "\n\nPlease check the code and try it once."};
var msg = notExistCodeMessage[lang];
$(".alert-area").css("top", positionY); alert(msg);
$(".alert-area").css("min-height", height); } else if (msgCode == "onlyRfid") {
$("body").css("overflow", "hidden"); alert(getMsg(msgCode));
} else {
$("#alertMsg").html(getMsg(msgCode));
$(".alert-overlay").removeClass("d-none");
$(".alert-area").removeClass("d-none");
var positionY = $(document).scrollTop() + screen.height/8;
var height = screen.height/4;
$(".alert-area").css("top", positionY);
$(".alert-area").css("min-height", height);
$("body").css("overflow", "hidden");
}
} }
CHK.resetSearch = function() { CHK.resetSearch = function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment