Commit fc7965f0 by NGO THI HONG

#49091 Add Tab pickup

parent 1543b737
<!DOCTYPE html>
<html lang="ja-JP">
<head>
<meta charset="utf-8">
<title>ピックアップ</title>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<!-- vender css -->
<link rel="stylesheet" type="text/css" href="css/fontawesome_relative_path.css">
<!-- main css -->
<link rel="stylesheet" type="text/css" href="css/app.css">
<link rel="stylesheet" type="text/css" href="css/fontawesome_relative_path.css">
<link rel="stylesheet" type="text/css" href="css/header.css">
<link rel="stylesheet" type="text/css" href="css/footer.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="js/jquery-1.11.2.min.js?__UPDATEID__"></script>
<script src="script/check.js?__UPDATEID__"></script>
<script src="script/check-list.js?__UPDATEID__"></script>
<script src="script/check-foriOS.js"></script>
<script src="script/constant.js?__UPDATEID__"></script>
<script src="script/check_PU.js?__UPDATEID__"></script>
</head>
<body onload="CHK_pu.init();">
<header >
<nav class="navbar navbar-dark bg-primary position-fixed fixed-top w-100">
<a class="navbar-brand category-btn lht-0">
<i class="fas fa-chevron-left fs-12 p-1"></i>
<span class="d-none d-md-inline fs-10 multi-lang" data-msg="buttonBack">
戻る
</span>
</a>
<h1 class="fs-10 font-weight-bold mb-0 text-white multi-lang" data-msg="labelPickUp">ピックアップ</h1>
<a href="#" class="nav-link text-white lht-0 p-1">
<img class="icon" src="img/icon_update.svg" alt="更新">
<span class="d-none d-md-inline fs-10 align-middle multi-lang" data-msg="buttonRefresh">
更新
</span>
</a>
</nav>
</header>
<!-- tab -->
<section class="main-section">
<main>
<div class="tab-wrap">
<input id="tab-NewReport" type="radio" name="tab-task" class="tab-switch">
<input id="tab-ContinueWork" type="radio" name="tab-task" class="tab-switch" checked>
<input id="tab-ReportWithWarning" type="radio" name="tab-task" class="tab-switch">
<ul class="tab-menu pl-0">
<li class="tab-label list-unstyled on"><label class="tab-label-NewReport fs-9 multi-lang" data-msg="labelNewReport" for="tab-NewReport">新規報告<div class="task-cnt">10</div></label></li>
<li class="tab-label list-unstyled"><label class="tab-label-ContinueWork fs-9 multi-lang" data-msg="labelContinueWork" for="tab-ContinueWork">工程作業<div class="task-cnt">99+</div></label></li>
<li class="tab-label list-unstyled"><label class="tab-label-ReportWithWarning fs- multi-lang" data-msg="labelReportWithWarning" for="tab-ReportWithWarning">警告を含む報告<div class="task-cnt">10</div></label></li>
</ul>
<div class="tab-content-area">
<!-- 新規報告 -->
<div id="tab-content-NewReport" class="tab-content on">
<div class="container-fluid">
<ul class="task-list p-0 mt-3" id="newReport-list">
<li class='item list-unstyled rounded border mb-2' name = 'operationId_x5489'>
<a href="#" class="d-block px-3 py-3 text-decoration-none text-dark">
<div class="title">作業名が入ります。</div>
<i class="fas fa-chevron-right fs-12"></i>
</a>
</li>
</ul>
</div>
</div>
<!-- 工程作業 -->
<div id="tab-content-ContinueWork" class="tab-content">
<div class="container-fluid">
<ul class="task-list p-0 mt-3" id="continueWork-list">
</ul>
</div>
</div>
<!-- 警告を含む報告 -->
<div id="tab-content-ReportWithWarning" class="tab-content">
<div class="container-fluid">
<ul class="task-list p-0 mt-3" id="reportWithWarning-list">
</ul>
</div>
</div>
</div>
</div>
</main>
</section>
<footer class="fixed-bottom bg-light">
<nav class="d-flex justify-content-around">
<a href="#" class="d-block w-100 text-center py-2 text-decoration-none">
<img src="img/icon_dashboard.svg" alt="ダッシュボード" class="p-1">
<div class="fs-7">ダッシュボード</div>
</a>
<a href="#" class="d-block w-100 text-center py-2 text-decoration-none text-secondary">
<i class="fas fa-tasks fs-14 p-1"></i>
<div class="fs-7">作業一覧</div>
</a>
<a href="#" class="d-block w-100 text-center py-2 text-decoration-none text-secondary">
<i class="fas fa-folder fs-14 p-1"></i>
<div class="fs-7">関連資料</div>
</a>
<a href="#" class="d-block w-100 text-center py-2 text-decoration-none text-secondary">
<i class="fas fa-cog fs-14 p-1"></i>
<div class="fs-7">設定</div>
</a>
</nav>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/common.js"></script>
</body>
</html>
\ No newline at end of file
......@@ -19,6 +19,17 @@ CHK_pu.initCommon = function() {
}
CHK_pu.init = function() {
// 作業一覧JSONデータ
CHK.loadJson(CHK.jsonPath.operationList, function (json) {
CHK.operation = json;
CHK_pu.createNewReportList(CHK.operation.operationList);
CHK_pu.createContinueWorkList(CHK.operation.operationList);
CHK_pu.createReportWithWarning(CHK.operation.operationList);
});
}
CHK_pu.getPickup = function(operationList) {
for (var i = 0; i < operationList.length; i++) {
if (operationList[i].reportType == 3 ) {
......@@ -31,100 +42,8 @@ CHK_pu.getPickup = function(operationList) {
}
CHK_pu.createNewReportList = function(operationList, isSearched = false) {
//alert("hongnt CHK_pu.createOperationList ");
var searchKeyword = $("#searchTaskName").val();
var searchStartDate = $("#searchStartDate").val();
var searchEndDate = $("#searchEndDate").val();
var operationGroupMasterId = CHK.operationGroupMasterId;
$('#operationTable').empty();
if (isSearched) {
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;
})
console.log("createNewReportList" , operationList );
if (operationList.length > 1) {
var sortType = $(".sort-type.active").data("sort");
if (isSearched) {
if (CHK.isIOS) {
webkit.messageHandlers.saveSortType.postMessage(sortType);
} else if (CHK.isAndroid) {
android.setSortType(sortType);
} else {
var param = {};
param.cmd = CHK.getCommand("saveSortType");
param.sortType = sortType;
CHK.sendABookCheckApi(param);
}
}
switch(sortType) {
case CHK_CONSTANT.SORT_TYPE.NAME:
operationList.sort(function(a,b) {
if (a.operationName > b.operationName) return 1;
if (a.operationName < b.operationName) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_DESC:
operationList.sort(function(a,b) {
if (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) return 1;
if (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_ASC:
operationList.sort(function(a,b) {
if (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) return 1;
if (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.TYPE:
operationList.sort(function(a,b) {
if (a.operationType < b.operationType) return 1;
if (a.operationType > b.operationType) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.LAST_EDIT_DATE:
operationList.sort(function(a,b) {
if (!a.operationOpenDate) {
a.operationOpenDate = "1900-01-01 09:00:00";
}
if (!b.operationOpenDate) {
b.operationOpenDate = "1900-01-01 09:00:00";
}
if (a.operationOpenDate < b.operationOpenDate) return 1;
if (a.operationOpenDate > b.operationOpenDate) return -1;
return 0;
});
break;
}
}
for (var i = 0; i < operationList.length; i++) {
//TODO aタグlist.html 転移処理
......@@ -147,105 +66,14 @@ CHK_pu.createNewReportList = function(operationList, isSearched = false) {
if(CHK.isAndroid) {
android.hideLoading();
}
console.log("end createNewReportList" );
};
CHK_pu.createContinueWorkList = function(operationList, isSearched = false) {
//alert("hongnt CHK_pu.createOperationList ");
var searchKeyword = $("#searchTaskName").val();
var searchStartDate = $("#searchStartDate").val();
var searchEndDate = $("#searchEndDate").val();
var operationGroupMasterId = CHK.operationGroupMasterId;
$('#operationTable').empty();
if (isSearched) {
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) {
var sortType = $(".sort-type.active").data("sort");
if (isSearched) {
if (CHK.isIOS) {
webkit.messageHandlers.saveSortType.postMessage(sortType);
} else if (CHK.isAndroid) {
android.setSortType(sortType);
} else {
var param = {};
param.cmd = CHK.getCommand("saveSortType");
param.sortType = sortType;
CHK.sendABookCheckApi(param);
}
}
switch(sortType) {
case CHK_CONSTANT.SORT_TYPE.NAME:
operationList.sort(function(a,b) {
if (a.operationName > b.operationName) return 1;
if (a.operationName < b.operationName) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_DESC:
operationList.sort(function(a,b) {
if (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) return 1;
if (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.START_DATE_ASC:
operationList.sort(function(a,b) {
if (setOperationDate(a.operationStartDate) > setOperationDate(b.operationStartDate)) return 1;
if (setOperationDate(a.operationStartDate) < setOperationDate(b.operationStartDate)) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.TYPE:
operationList.sort(function(a,b) {
if (a.operationType < b.operationType) return 1;
if (a.operationType > b.operationType) return -1;
return 0;
});
break;
case CHK_CONSTANT.SORT_TYPE.LAST_EDIT_DATE:
operationList.sort(function(a,b) {
if (!a.operationOpenDate) {
a.operationOpenDate = "1900-01-01 09:00:00";
}
if (!b.operationOpenDate) {
b.operationOpenDate = "1900-01-01 09:00:00";
}
if (a.operationOpenDate < b.operationOpenDate) return 1;
if (a.operationOpenDate > b.operationOpenDate) return -1;
return 0;
});
break;
}
}
console.log("createContinueWorkList" );
for (var i = 0; i < operationList.length; i++) {
if (operationList[i].reportType === 3)
{
......@@ -272,8 +100,41 @@ CHK_pu.createContinueWorkList = function(operationList, isSearched = false) {
$("#continueWork-list").append(operationNameLi);
}
}
if(CHK.isAndroid) {
android.hideLoading();
}
};
CHK_pu.createReportWithWarning = function(operationList, isSearched = false) {
console.log("createReportWithWarning" );
for (var i = 0; i < operationList.length; i++) {
if (operationList[i].reportType === 3)
{
//TODO aタグlist.html 転移処理
var operationNameLi;
if (operationList[i].permitCodeRequiredFlg == 1) {
operationNameLi = $("<li class='item list-unstyled rounded border mb-2' name = 'operationId_" + operationList[i].operationId
+ "'><a href=\"javascript:CHK.displayAlert('onlyRfid');\" class='d-block px-3 py-2 text-decoration-none text-dark'>"
+"<div class='tag fs-8 text-secondary px-2 py-1 mr-2 rounded border mb-1'>" + operationList[i].operationName
+ "</div> <div class='title'>" + operationList[i].operationName
+ "</div> <div class='sub-title-wrap'> <div class='fs-8 text-secondary mr-2'><div class='data'>" + "code-0001"
+ "</div></div> <div class='sub-title'>" + operationList[i].operationName
+ "</div></div> <i class='fas fa-chevron-right fs-12''></i> </a></li>");
} else {
operationNameLi = $("<li class='item list-unstyled rounded border mb-2' name = 'operationId_" + operationList[i].operationId
+ "'><a href=\"javascript:CHK_L.sendAppCommand('goOperation', '" + operationList[i].operationId + "', '" + operationList[i].contentId
+ "');\" class='d-block px-3 py-2 text-decoration-none text-dark'>"
+"<div class='tag fs-8 text-secondary px-2 py-1 mr-2 rounded border mb-1'>" + operationList[i].operationName
+ "</div> <div class='title'>" + operationList[i].operationName
+ "</div> <div class='sub-title-wrap'> <div class='fs-8 text-secondary mr-2'><div class='data'>" + "code-0001"
+ "</div></div> <div class='sub-title'>" + operationList[i].operationName
+ "</div></div> <i class='fas fa-chevron-right fs-12''></i> </a></li>");
}
$("#reportWithWarning-list").append(operationNameLi);
}
}
if(CHK.isAndroid) {
android.hideLoading();
......
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