update
parent
aaddec10d4
commit
385f12898e
|
|
@ -117,15 +117,53 @@ namespace abbott_2024_event.BackEnd.api
|
|||
int pageNum = 4;
|
||||
|
||||
foreach (babyRec rec in babyRecs) {
|
||||
string baby_inpercent = "";
|
||||
|
||||
if (rec.babyRec_inpercent > 97)
|
||||
|
||||
string inpercent = "";
|
||||
|
||||
|
||||
switch (rec.babyRec_inpercent)
|
||||
{
|
||||
baby_inpercent = "大於 97%";
|
||||
}
|
||||
else
|
||||
{
|
||||
baby_inpercent = rec.babyRec_inpercent.ToString() + "%";
|
||||
case 3:
|
||||
{
|
||||
inpercent = "0%~3%";
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
inpercent = "3%~15%";
|
||||
break;
|
||||
}
|
||||
case 25:
|
||||
{
|
||||
inpercent = "15%~25%";
|
||||
break;
|
||||
}
|
||||
case 50:
|
||||
{
|
||||
inpercent = "25%~50%";
|
||||
break;
|
||||
}
|
||||
case 75:
|
||||
{
|
||||
inpercent = "50%~75%";
|
||||
break;
|
||||
}
|
||||
case 85:
|
||||
{
|
||||
inpercent = "75%~85%";
|
||||
break;
|
||||
}
|
||||
case 97:
|
||||
{
|
||||
inpercent = "85%~97%";
|
||||
break;
|
||||
}
|
||||
case 100:
|
||||
{
|
||||
inpercent = "97%~100%";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -133,7 +171,7 @@ namespace abbott_2024_event.BackEnd.api
|
|||
excelRow.CreateCell(0).SetCellValue(rec.babyRec_recdate.ToString("yyyy/MM/dd"));
|
||||
excelRow.CreateCell(1).SetCellValue(rec.babyRec_yearMonthStr);
|
||||
excelRow.CreateCell(2).SetCellValue(rec.babyRec_height);
|
||||
excelRow.CreateCell(3).SetCellValue(baby_inpercent);
|
||||
excelRow.CreateCell(3).SetCellValue(inpercent);
|
||||
pageNum++;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ using System.Data.SqlClient;
|
|||
using System.Runtime.Remoting;
|
||||
using Dapper;
|
||||
using System.Linq;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
|
||||
namespace abbott_2024_event.BackEnd.api
|
||||
{
|
||||
|
|
@ -108,18 +109,54 @@ namespace abbott_2024_event.BackEnd.api
|
|||
baby_gender = "女";
|
||||
}
|
||||
|
||||
string baby_inpercent = "";
|
||||
string inpercent = "";
|
||||
|
||||
if (view.babyRec_inpercent > 97)
|
||||
|
||||
switch (view.babyRec_inpercent)
|
||||
{
|
||||
baby_inpercent = "大於 97%";
|
||||
}
|
||||
else {
|
||||
baby_inpercent = view.babyRec_inpercent.ToString() + "%";
|
||||
case 3:
|
||||
{
|
||||
inpercent = "0%~3%";
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
inpercent = "3%~15%";
|
||||
break;
|
||||
}
|
||||
case 25:
|
||||
{
|
||||
inpercent = "15%~25%";
|
||||
break;
|
||||
}
|
||||
case 50:
|
||||
{
|
||||
inpercent = "25%~50%";
|
||||
break;
|
||||
}
|
||||
case 75:
|
||||
{
|
||||
inpercent = "50%~75%";
|
||||
break;
|
||||
}
|
||||
case 85:
|
||||
{
|
||||
inpercent = "75%~85%";
|
||||
break;
|
||||
}
|
||||
case 97:
|
||||
{
|
||||
inpercent = "85%~97%";
|
||||
break;
|
||||
}
|
||||
case 100:
|
||||
{
|
||||
inpercent = "97%~100%";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
HSSFRow excelRow = (HSSFRow)sheet.CreateRow(pageNum);
|
||||
excelRow.CreateCell(0).SetCellValue(view.line_uid);
|
||||
excelRow.CreateCell(1).SetCellValue(view.line_displayName);
|
||||
|
|
@ -129,7 +166,7 @@ namespace abbott_2024_event.BackEnd.api
|
|||
excelRow.CreateCell(5).SetCellValue(view.babyRec_recdate.ToString("yyyy/MM/dd"));
|
||||
excelRow.CreateCell(6).SetCellValue(view.babyRec_yearMonthStr);
|
||||
excelRow.CreateCell(7).SetCellValue(view.babyRec_height);
|
||||
excelRow.CreateCell(8).SetCellValue(baby_inpercent);
|
||||
excelRow.CreateCell(8).SetCellValue(inpercent);
|
||||
|
||||
pageNum++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,6 +274,50 @@ function loadDataTable() {
|
|||
inpercent = item.baby_percent + '%';
|
||||
}
|
||||
|
||||
switch (item.baby_percent) {
|
||||
case 3:
|
||||
{
|
||||
inpercent = '0%~3%';
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
inpercent = '3%~15%';
|
||||
break;
|
||||
}
|
||||
case 25:
|
||||
{
|
||||
inpercent = '15%~25%';
|
||||
break;
|
||||
}
|
||||
case 50:
|
||||
{
|
||||
inpercent = '25%~50%';
|
||||
break;
|
||||
}
|
||||
case 75:
|
||||
{
|
||||
inpercent = '50%~75%';
|
||||
break;
|
||||
}
|
||||
case 85:
|
||||
{
|
||||
inpercent = '75%~85%';
|
||||
break;
|
||||
}
|
||||
case 97:
|
||||
{
|
||||
inpercent = '85%~97%';
|
||||
break;
|
||||
}
|
||||
case 100:
|
||||
{
|
||||
inpercent = '97%~100%';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
htmlString += "<tr>";
|
||||
htmlString += " <td style='border: 0px;'>" + item.baby_name + "(" + gender + ")</td>";
|
||||
htmlString += " <td style='border: 0px;'>生日:" + item.baby_birthday + "</td>";
|
||||
|
|
@ -386,14 +430,57 @@ function initSubTable() {
|
|||
orderable: false,
|
||||
searchable: false,
|
||||
render: function render(data, type, row, meta) {
|
||||
var inpercent = "";
|
||||
|
||||
|
||||
switch (row.babyRec_inpercent) {
|
||||
case 3:
|
||||
{
|
||||
inpercent = '0%~3%';
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
inpercent = '3%~15%';
|
||||
break;
|
||||
}
|
||||
case 25:
|
||||
{
|
||||
inpercent = '15%~25%';
|
||||
break;
|
||||
}
|
||||
case 50:
|
||||
{
|
||||
inpercent = '25%~50%';
|
||||
break;
|
||||
}
|
||||
case 75:
|
||||
{
|
||||
inpercent = '50%~75%';
|
||||
break;
|
||||
}
|
||||
case 85:
|
||||
{
|
||||
inpercent = '75%~85%';
|
||||
break;
|
||||
}
|
||||
case 97:
|
||||
{
|
||||
inpercent = '85%~97%';
|
||||
break;
|
||||
}
|
||||
case 100:
|
||||
{
|
||||
inpercent = '97%~100%';
|
||||
break;
|
||||
}
|
||||
|
||||
if (row.babyRec_inpercent > 97) {
|
||||
return "> 97%";
|
||||
} else {
|
||||
return row.babyRec_inpercent + "%"
|
||||
}
|
||||
|
||||
|
||||
return inpercent;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -154,7 +154,11 @@
|
|||
<script src="assets/vendor/jquery/jquery.min.js"></script>
|
||||
<script src="assets/javascript/sha256.js"></script>
|
||||
<script src="assets/vendor/popper.js/umd/popper.min.js"></script>
|
||||
<script src="assets/vendor/bootstrap/js/bootstrap.min.js"></script> <!-- END BASE JS -->
|
||||
<script src="assets/vendor/bootstrap/js/bootstrap.min.js"></script>
|
||||
<%--<script src="assets/vendor/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
|
||||
<script src="assets/vendor/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js"></script>--%>
|
||||
|
||||
<!-- END BASE JS -->
|
||||
<!-- BEGIN PLUGINS JS -->
|
||||
<script src="assets/vendor/pace-progress/pace.min.js"></script>
|
||||
<script src="assets/vendor/stacked-menu/js/stacked-menu.min.js"></script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
<%@ WebHandler Language="C#" CodeBehind="babyRecList.ashx.cs" Class="abbott_2024_event.BackEnd.api.babyRecList" %>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<%@ WebHandler Language="C#" CodeBehind="exportBabyRec.ashx.cs" Class="abbott_2024_event.BackEnd.api.exportBabyRec" %>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<%@ WebHandler Language="C#" CodeBehind="exportExcel.ashx.cs" Class="abbott_2024_event.BackEnd.api.exportExcel" %>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<%@ WebHandler Language="C#" CodeBehind="lineData.ashx.cs" Class="abbott_2024_event.BackEnd.api.lineData" %>
|
||||
|
|
@ -0,0 +1 @@
|
|||
<%@ WebHandler Language="C#" CodeBehind="userList.ashx.cs" Class="abbott_2024_event.BackEnd.api.userList" %>
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
|
||||
var oTable;
|
||||
var oPos;
|
||||
|
||||
$(document).ready(function () {
|
||||
var actualDate = new Date(); // convert to actual date
|
||||
var prevDate = new Date(actualDate.getFullYear(), actualDate.getMonth() - 6, actualDate.getDate());
|
||||
|
|
@ -16,4 +19,477 @@ $(document).ready(function () {
|
|||
language: "zh-TW",
|
||||
autoclose: true
|
||||
});
|
||||
|
||||
var start = $("#startDate").val();
|
||||
var end = $("#endDate").val();
|
||||
var gender = $("#gender_select").val();
|
||||
var min_age = $("#age_start").val();
|
||||
var max_age = $("#age_end").val();
|
||||
|
||||
$('#export_btn').click(function () {
|
||||
var start = $("#startDate").val();
|
||||
var end = $("#endDate").val();
|
||||
var gender = $("#gender_select").val();
|
||||
var min_age = $("#age_start").val();
|
||||
var max_age = $("#age_end").val();
|
||||
|
||||
var url = "api/exportExcel.ashx?start=" + start + "&end=" + end + "&gender=" + gender + "&min_age=" + min_age + "&max_age=" + max_age;
|
||||
window.open(url);
|
||||
});
|
||||
|
||||
//$.ajax({
|
||||
// url: "api/userList.ashx",
|
||||
// type: "POST",
|
||||
// data: formData,
|
||||
// success: function (data, textStatus, jqXHR) {
|
||||
// if (data.ret == "yes") {
|
||||
// location.href = "userList.aspx";
|
||||
// } else {
|
||||
// alert(data.message);
|
||||
// }
|
||||
// },
|
||||
// error: function (jqXHR, textStatus, errorThrown) {
|
||||
// alert('网絡或伺服器发生错误,请稍后重试!');
|
||||
// }
|
||||
//});
|
||||
|
||||
|
||||
loadDataTable();
|
||||
|
||||
initSubTable();
|
||||
|
||||
|
||||
$('#baby_select').on('change', function () {
|
||||
loadBabyRec();
|
||||
});
|
||||
|
||||
$('#downloadBtn').click(function () {
|
||||
var line_uid = $('#line_uid_data').val();
|
||||
var baby_uid = $('#baby_select').val();
|
||||
|
||||
|
||||
var url = "api/exportBabyRec.ashx?line_uid=" + line_uid + "&baby_uid=" + baby_uid;
|
||||
window.open(url);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function loadBabyRec() {
|
||||
var baby_uid = $('#baby_select').val();
|
||||
|
||||
var formData = {
|
||||
baby_uid: baby_uid
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "api/babyRecList.ashx",
|
||||
type: "POST",
|
||||
data: formData,
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
if (data.ret == "yes") {
|
||||
$('#dt-responsive-baby').dataTable().fnClearTable();
|
||||
if (data.recs.length > 0) {
|
||||
|
||||
$('#dt-responsive-baby').dataTable().fnAddData(data.recs);
|
||||
}
|
||||
|
||||
} else {
|
||||
alert(data.message);
|
||||
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('网絡或伺服器发生错误,请稍后重试!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function buttonClick(obj) {
|
||||
var uid = obj.getAttribute('data-uid');
|
||||
|
||||
var formData = {
|
||||
line_uid: uid
|
||||
}
|
||||
|
||||
$('#line_uid_data').val(uid);
|
||||
|
||||
$.ajax({
|
||||
url: "api/lineData.ashx",
|
||||
type: "POST",
|
||||
data: formData,
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
if (data.ret == "yes") {
|
||||
$('#LineTitle').val("Line 名稱:" + data.user.line_displayName + ", Line Uid:" + data.user.line_uid);
|
||||
|
||||
$("#baby_select option").remove();
|
||||
|
||||
$.each(data.user.babyDatas, function (i, item) {
|
||||
|
||||
var gender = "";
|
||||
|
||||
if (item.baby_gender == "M") {
|
||||
gender = "男";
|
||||
} else {
|
||||
gender = "女";
|
||||
}
|
||||
|
||||
var babyTxt = item.baby_name + " (" + gender + "), 生日:" + item.baby_birthday;
|
||||
|
||||
$("#baby_select").append($("<option></option>").attr("value", item.baby_uid).text(babyTxt));
|
||||
});
|
||||
|
||||
loadBabyRec();
|
||||
|
||||
$('#clientHistoryListModal').modal('toggle');
|
||||
|
||||
} else {
|
||||
alert(data.message);
|
||||
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('网絡或伺服器发生错误,请稍后重试!');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
function loadDataTable() {
|
||||
var dataTables = {
|
||||
init: function init() {
|
||||
|
||||
this.bindUIActions();
|
||||
},
|
||||
bindUIActions: function bindUIActions() {
|
||||
|
||||
// event handlers
|
||||
this.table = this.handleDataTables();
|
||||
|
||||
// add buttons
|
||||
//this.table.buttons().container().appendTo('#dt-buttons').unwrap();
|
||||
},
|
||||
handleDataTables: function handleDataTables() {
|
||||
//$('#myTable').append("<tfoot><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></tfoot>");
|
||||
return $('#myTable').DataTable({
|
||||
dom: '<\'text-muted\'Bif>\n <\'table-responsive\'trl>\n <\'mt-4\'p>',
|
||||
lengthChange: true,
|
||||
lengthMenu: [[25, 50, 100, -1], [25, 50, 100, "All"]],
|
||||
pageLength: 50,
|
||||
buttons: [
|
||||
//{
|
||||
// text: 'Excel',
|
||||
// action: function (e, dt, node, config) {
|
||||
|
||||
// var start = $("#startDate").val();
|
||||
// var end = $("#endDate").val();
|
||||
// var gender = $("#gender_select").val();
|
||||
// var min_age = $("#age_start").val();
|
||||
// var max_age = $("#age_end").val();
|
||||
|
||||
// var url = "api/exportExcel.ashx?start=" + start + "&end=" + end + "&gender=" + gender + "&min_age=" + min_age + "&max_age=" + max_age;
|
||||
// window.open(url);
|
||||
|
||||
// }
|
||||
//}
|
||||
],
|
||||
language: {
|
||||
paginate: {
|
||||
previous: '<i class="fa fa-lg fa-angle-left"></i>',
|
||||
next: '<i class="fa fa-lg fa-angle-right"></i>'
|
||||
},
|
||||
buttons: {
|
||||
copyTitle: 'Data copied',
|
||||
copyKeys: 'Use your keyboard or menu to select the copy command'
|
||||
}
|
||||
},
|
||||
autoWidth: false,
|
||||
ajax: {
|
||||
url: 'Api/userList.ashx',
|
||||
type: 'POST',
|
||||
data: function (d) {
|
||||
Object.assign(d, {
|
||||
start: $("#startDate").val(),
|
||||
end: $("#endDate").val(),
|
||||
gender: $("#gender_select").val(),
|
||||
min_age: $("#age_start").val(),
|
||||
max_age: $("#age_end").val()
|
||||
});
|
||||
|
||||
return d;
|
||||
},
|
||||
dataSrc: 'datas'
|
||||
},
|
||||
rowId: 'line_uid',
|
||||
deferRender: true,
|
||||
initComplete: function () {
|
||||
//mainItemTable = $('#dt-responsive').dataTable();
|
||||
$('#myTable').on('click', 'a', function () {
|
||||
buttonClick(this);
|
||||
});
|
||||
|
||||
$('#myTable').on('click', 'button', function () {
|
||||
buttonClick(this);
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
order: [[2, 'desc']],
|
||||
info: true,
|
||||
search: "搜尋:",
|
||||
searching: true,
|
||||
columns: [
|
||||
{ data: 'line_displayName', className: 'align-middle text-left', orderable: true, searchable: true },
|
||||
{ data: 'line_uid', className: 'align-middle text-left', orderable: false, searchable: true },
|
||||
{ data: 'testdate', className: 'align-top text-center', orderable: false, searchable: false, visible: false },
|
||||
{ data: 'line_uid', className: 'align-middle text-left', orderable: false, searchable: false },
|
||||
{ data: 'line_uid', className: 'align-middle text-center', orderable: false, searchable: false }
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
targets: 3,
|
||||
className: 'align-middle text-left',
|
||||
orderable: false,
|
||||
searchable: true,
|
||||
render: function render(data, type, row, meta) {
|
||||
var gender = '';
|
||||
var inpercent = '';
|
||||
|
||||
|
||||
|
||||
|
||||
var htmlString = '';
|
||||
|
||||
$.each(row.babyDatas, function (i, item) {
|
||||
if (item.baby_gender == 'M') {
|
||||
gender = '男';
|
||||
} else {
|
||||
gender = '女';
|
||||
}
|
||||
|
||||
if (item.baby_percent > 97) {
|
||||
inpercent = '> 97%';
|
||||
} else {
|
||||
inpercent = item.baby_percent + '%';
|
||||
}
|
||||
|
||||
switch (item.baby_percent) {
|
||||
case 3:
|
||||
{
|
||||
inpercent = '0%~3%';
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
inpercent = '3%~15%';
|
||||
break;
|
||||
}
|
||||
case 25:
|
||||
{
|
||||
inpercent = '15%~25%';
|
||||
break;
|
||||
}
|
||||
case 50:
|
||||
{
|
||||
inpercent = '25%~50%';
|
||||
break;
|
||||
}
|
||||
case 75:
|
||||
{
|
||||
inpercent = '50%~75%';
|
||||
break;
|
||||
}
|
||||
case 85:
|
||||
{
|
||||
inpercent = '75%~85%';
|
||||
break;
|
||||
}
|
||||
case 97:
|
||||
{
|
||||
inpercent = '85%~97%';
|
||||
break;
|
||||
}
|
||||
case 100:
|
||||
{
|
||||
inpercent = '97%~100%';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
htmlString += "<tr>";
|
||||
htmlString += " <td style='border: 0px;'>" + item.baby_name + "(" + gender + ")</td>";
|
||||
htmlString += " <td style='border: 0px;'>生日:" + item.baby_birthday + "</td>";
|
||||
htmlString += " <td style='border: 0px;'>測驗日期:" + item.baby_testdate + "</td>";
|
||||
htmlString += " <td style='border: 0px;'>年齡:" + item.baby_age + "</td>";
|
||||
htmlString += " <td style='border: 0px;'>身高:" + item.baby_height + " cm </td>";
|
||||
htmlString += " <td style='border: 0px;'>成長百分比:" + inpercent + "</td>";
|
||||
htmlString += "</tr>";
|
||||
|
||||
});
|
||||
|
||||
htmlString = "<table class='table table-nostriped'>" + htmlString + "</table>";
|
||||
|
||||
return htmlString;
|
||||
|
||||
//return '<a href="javascript: void(0);" data-uid="' + row.company_uid + '" data-method="preview" >' + row.company_name + '</a>';
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
targets: 4,
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
render: function render(data, type, row, meta) {
|
||||
var ret = '';
|
||||
|
||||
ret += '<button type="button" data-uid="' + row.line_uid + '" data-method="edit" class="btn btn-sm btn-icon btn-secondary" ><i class="fas fa-th-list"></i> <span class="sr-only">View</span></button>';
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
});
|
||||
},
|
||||
handleSearchRecords: function handleSearchRecords() {
|
||||
var self = this;
|
||||
|
||||
$('#table-search, #filterBy').on('keyup change focus', function (e) {
|
||||
var filterBy = $('#filterBy').val();
|
||||
var hasFilter = filterBy !== '';
|
||||
var value = $('#table-search').val();
|
||||
|
||||
self.table.search('').columns().search('').draw();
|
||||
|
||||
if (hasFilter) {
|
||||
self.table.columns(filterBy).search(value).draw();
|
||||
} else {
|
||||
self.table.search(value).draw();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
dataTables.init();
|
||||
}
|
||||
|
||||
function initSubTable() {
|
||||
$("#dt-responsive-baby").DataTable({
|
||||
dom: '<\'text-muted\'Bi>\n <\'table-fixed\'trl>\n <\'mt-4\'p>',
|
||||
lengthChange: true,
|
||||
lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]],
|
||||
pageLength: 25,
|
||||
buttons: [],
|
||||
language: {
|
||||
paginate: {
|
||||
previous: '<i class="fa fa-lg fa-angle-left"></i>',
|
||||
next: '<i class="fa fa-lg fa-angle-right"></i>'
|
||||
},
|
||||
buttons: {
|
||||
copyTitle: 'Data copied',
|
||||
copyKeys: 'Use your keyboard or menu to select the copy command'
|
||||
}
|
||||
},
|
||||
deferRender: true,
|
||||
rowId: 'babyRec_uid',
|
||||
deferRender: true,
|
||||
order: [[0, 'desc']],
|
||||
columns: [
|
||||
{ data: 'babyRec_recdate', className: 'align-middle text-left', orderable: true, searchable: false },
|
||||
{ data: 'babyRec_yearMonthStr', className: 'align-middle text-left', orderable: true, searchable: false },
|
||||
{ data: 'babyRec_height', className: 'align-middle text-left', orderable: true, searchable: false },
|
||||
{ data: 'babyRec_inpercent', className: 'align-middle text-left', orderable: true, searchable: false }
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
targets: 0,
|
||||
orderable: true,
|
||||
searchable: false,
|
||||
render: function render(data, type, row, meta) {
|
||||
tMonth = row.babyRec_recMonth;
|
||||
tDay = row.babyRec_recDay;
|
||||
|
||||
if (tDay < 10) {
|
||||
tDay = '0' + tDay;
|
||||
}
|
||||
|
||||
if (tMonth < 10) {
|
||||
tMonth = '0' + tMonth;
|
||||
}
|
||||
|
||||
return row.babyRec_recYear + "/" + tMonth + "/" + tDay;
|
||||
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
targets: 3,
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
render: function render(data, type, row, meta) {
|
||||
var inpercent = "";
|
||||
|
||||
|
||||
switch (row.babyRec_inpercent) {
|
||||
case 3:
|
||||
{
|
||||
inpercent = '0%~3%';
|
||||
break;
|
||||
}
|
||||
case 15:
|
||||
{
|
||||
inpercent = '3%~15%';
|
||||
break;
|
||||
}
|
||||
case 25:
|
||||
{
|
||||
inpercent = '15%~25%';
|
||||
break;
|
||||
}
|
||||
case 50:
|
||||
{
|
||||
inpercent = '25%~50%';
|
||||
break;
|
||||
}
|
||||
case 75:
|
||||
{
|
||||
inpercent = '50%~75%';
|
||||
break;
|
||||
}
|
||||
case 85:
|
||||
{
|
||||
inpercent = '75%~85%';
|
||||
break;
|
||||
}
|
||||
case 97:
|
||||
{
|
||||
inpercent = '85%~97%';
|
||||
break;
|
||||
}
|
||||
case 100:
|
||||
{
|
||||
inpercent = '97%~100%';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return inpercent;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
initComplete: function () {
|
||||
|
||||
},
|
||||
info: false,
|
||||
ordering: true,
|
||||
paging: true
|
||||
});
|
||||
}
|
||||
18
bin/app.publish/BackEnd/assets/javascript/pages/dataTables.fixedHeader.min.js
vendored
Normal file
18
bin/app.publish/BackEnd/assets/javascript/pages/dataTables.fixedHeader.min.js
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/*!
|
||||
FixedHeader 3.1.5
|
||||
©2009-2018 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(d){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(g){return d(g,window,document)}):"object"===typeof exports?module.exports=function(g,i){g||(g=window);if(!i||!i.fn.dataTable)i=require("datatables.net")(g,i).$;return d(i,g,g.document)}:d(jQuery,window,document)})(function(d,g,i,k){var j=d.fn.dataTable,l=0,h=function(a,b){if(!(this instanceof h))throw"FixedHeader must be initialised with the 'new' keyword.";!0===b&&(b={});a=new j.Api(a);this.c=d.extend(!0,
|
||||
{},h.defaults,b);this.s={dt:a,position:{theadTop:0,tbodyTop:0,tfootTop:0,tfootBottom:0,width:0,left:0,tfootHeight:0,theadHeight:0,windowHeight:d(g).height(),visible:!0},headerMode:null,footerMode:null,autoWidth:a.settings()[0].oFeatures.bAutoWidth,namespace:".dtfc"+l++,scrollLeft:{header:-1,footer:-1},enable:!0};this.dom={floatingHeader:null,thead:d(a.table().header()),tbody:d(a.table().body()),tfoot:d(a.table().footer()),header:{host:null,floating:null,placeholder:null},footer:{host:null,floating:null,
|
||||
placeholder:null}};this.dom.header.host=this.dom.thead.parent();this.dom.footer.host=this.dom.tfoot.parent();var e=a.settings()[0];if(e._fixedHeader)throw"FixedHeader already initialised on table "+e.nTable.id;e._fixedHeader=this;this._constructor()};d.extend(h.prototype,{enable:function(a){this.s.enable=a;this.c.header&&this._modeChange("in-place","header",!0);this.c.footer&&this.dom.tfoot.length&&this._modeChange("in-place","footer",!0);this.update()},headerOffset:function(a){a!==k&&(this.c.headerOffset=
|
||||
a,this.update());return this.c.headerOffset},footerOffset:function(a){a!==k&&(this.c.footerOffset=a,this.update());return this.c.footerOffset},update:function(){this._positions();this._scroll(!0)},_constructor:function(){var a=this,b=this.s.dt;d(g).on("scroll"+this.s.namespace,function(){a._scroll()}).on("resize"+this.s.namespace,j.util.throttle(function(){a.s.position.windowHeight=d(g).height();a.update()},50));var e=d(".fh-fixedHeader");!this.c.headerOffset&&e.length&&(this.c.headerOffset=e.outerHeight());
|
||||
e=d(".fh-fixedFooter");!this.c.footerOffset&&e.length&&(this.c.footerOffset=e.outerHeight());b.on("column-reorder.dt.dtfc column-visibility.dt.dtfc draw.dt.dtfc column-sizing.dt.dtfc responsive-display.dt.dtfc",function(){a.update()});b.on("destroy.dtfc",function(){a.c.header&&a._modeChange("in-place","header",true);a.c.footer&&a.dom.tfoot.length&&a._modeChange("in-place","footer",true);b.off(".dtfc");d(g).off(a.s.namespace)});this._positions();this._scroll()},_clone:function(a,b){var e=this.s.dt,
|
||||
c=this.dom[a],f="header"===a?this.dom.thead:this.dom.tfoot;!b&&c.floating?c.floating.removeClass("fixedHeader-floating fixedHeader-locked"):(c.floating&&(c.placeholder.remove(),this._unsize(a),c.floating.children().detach(),c.floating.remove()),c.floating=d(e.table().node().cloneNode(!1)).css("table-layout","fixed").attr("aria-hidden","true").removeAttr("id").append(f).appendTo("body"),c.placeholder=f.clone(!1),c.placeholder.find("*[id]").removeAttr("id"),c.host.prepend(c.placeholder),this._matchWidths(c.placeholder,
|
||||
c.floating))},_matchWidths:function(a,b){var e=function(b){return d(b,a).map(function(){return d(this).width()}).toArray()},c=function(a,c){d(a,b).each(function(a){d(this).css({width:c[a],minWidth:c[a]})})},f=e("th"),e=e("td");c("th",f);c("td",e)},_unsize:function(a){var b=this.dom[a].floating;b&&("footer"===a||"header"===a&&!this.s.autoWidth)?d("th, td",b).css({width:"",minWidth:""}):b&&"header"===a&&d("th, td",b).css("min-width","")},_horizontal:function(a,b){var e=this.dom[a],c=this.s.position,
|
||||
d=this.s.scrollLeft;e.floating&&d[a]!==b&&(e.floating.css("left",c.left-b),d[a]=b)},_modeChange:function(a,b,e){var c=this.dom[b],f=this.s.position,g=this.dom["footer"===b?"tfoot":"thead"],h=d.contains(g[0],i.activeElement)?i.activeElement:null;h&&h.blur();if("in-place"===a){if(c.placeholder&&(c.placeholder.remove(),c.placeholder=null),this._unsize(b),"header"===b?c.host.prepend(g):c.host.append(g),c.floating)c.floating.remove(),c.floating=null}else"in"===a?(this._clone(b,e),c.floating.addClass("fixedHeader-floating").css("header"===
|
||||
b?"top":"bottom",this.c[b+"Offset"]).css("left",f.left+"px").css("width",f.width+"px"),"footer"===b&&c.floating.css("top","")):"below"===a?(this._clone(b,e),c.floating.addClass("fixedHeader-locked").css("top",f.tfootTop-f.theadHeight).css("left",f.left+"px").css("width",f.width+"px")):"above"===a&&(this._clone(b,e),c.floating.addClass("fixedHeader-locked").css("top",f.tbodyTop).css("left",f.left+"px").css("width",f.width+"px"));h&&h!==i.activeElement&&setTimeout(function(){h.focus()},10);this.s.scrollLeft.header=
|
||||
-1;this.s.scrollLeft.footer=-1;this.s[b+"Mode"]=a},_positions:function(){var a=this.s.dt.table(),b=this.s.position,e=this.dom,a=d(a.node()),c=a.children("thead"),f=a.children("tfoot"),e=e.tbody;b.visible=a.is(":visible");b.width=a.outerWidth();b.left=a.offset().left;b.theadTop=c.offset().top;b.tbodyTop=e.offset().top;b.theadHeight=b.tbodyTop-b.theadTop;f.length?(b.tfootTop=f.offset().top,b.tfootBottom=b.tfootTop+f.outerHeight(),b.tfootHeight=b.tfootBottom-b.tfootTop):(b.tfootTop=b.tbodyTop+e.outerHeight(),
|
||||
b.tfootBottom=b.tfootTop,b.tfootHeight=b.tfootTop)},_scroll:function(a){var b=d(i).scrollTop(),e=d(i).scrollLeft(),c=this.s.position,f;if(this.s.enable&&(this.c.header&&(f=!c.visible||b<=c.theadTop-this.c.headerOffset?"in-place":b<=c.tfootTop-c.theadHeight-this.c.headerOffset?"in":"below",(a||f!==this.s.headerMode)&&this._modeChange(f,"header",a),this._horizontal("header",e)),this.c.footer&&this.dom.tfoot.length))b=!c.visible||b+c.windowHeight>=c.tfootBottom+this.c.footerOffset?"in-place":c.windowHeight+
|
||||
b>c.tbodyTop+c.tfootHeight+this.c.footerOffset?"in":"above",(a||b!==this.s.footerMode)&&this._modeChange(b,"footer",a),this._horizontal("footer",e)}});h.version="3.1.5";h.defaults={header:!0,footer:!1,headerOffset:0,footerOffset:0};d.fn.dataTable.FixedHeader=h;d.fn.DataTable.FixedHeader=h;d(i).on("init.dt.dtfh",function(a,b){if("dt"===a.namespace){var e=b.oInit.fixedHeader,c=j.defaults.fixedHeader;if((e||c)&&!b._fixedHeader)c=d.extend({},c,e),!1!==e&&new h(b,c)}});j.Api.register("fixedHeader()",function(){});
|
||||
j.Api.register("fixedHeader.adjust()",function(){return this.iterator("table",function(a){(a=a._fixedHeader)&&a.update()})});j.Api.register("fixedHeader.enable()",function(a){return this.iterator("table",function(b){b=b._fixedHeader;a=a!==k?a:!0;b&&a!==b.s.enable&&b.enable(a)})});j.Api.register("fixedHeader.disable()",function(){return this.iterator("table",function(a){(a=a._fixedHeader)&&a.s.enable&&a.enable(!1)})});d.each(["header","footer"],function(a,b){j.Api.register("fixedHeader."+b+"Offset()",
|
||||
function(a){var c=this.context;return a===k?c.length&&c[0]._fixedHeader?c[0]._fixedHeader[b+"Offset"]():k:this.iterator("table",function(c){if(c=c._fixedHeader)c[b+"Offset"](a)})})});return h});
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
<div class="card-body">
|
||||
<!-- .form-row -->
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-2">
|
||||
<label for="quotation-datepicker">測驗起訖日期</label>
|
||||
<div class="input-daterange input-group" id="quotation-datepicker">
|
||||
<input type="text" class="form-control form-control-sm" name="start" id="startDate" />
|
||||
|
|
@ -81,10 +81,14 @@
|
|||
<option value="10" selected="selected">10歲</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
<div class="col-md-2">
|
||||
<label for="search_btn" style="display: block;"> </label>
|
||||
<button type="button" class="btn btn-info btn-sm" id="search_btn">篩選</button>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label for="export_btn" style="display: block;"> </label>
|
||||
<button type="button" class="btn btn-danger btn-sm" id="export_btn">匯出</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- /.form-row -->
|
||||
|
|
@ -94,14 +98,12 @@
|
|||
<!-- thead -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="min-width: 130px;"> </th>
|
||||
<th>報價單編號 </th>
|
||||
<th>報價單名稱 </th>
|
||||
<th>收入(含稅) </th>
|
||||
<th>支出(含稅) </th>
|
||||
<th>客戶 </th>
|
||||
<th>發票狀態 </th>
|
||||
<th>備註</th>
|
||||
|
||||
<th>Line名稱 </th>
|
||||
<th>Line UID </th>
|
||||
<th style="display:none;">測驗日期 </th>
|
||||
<th style="min-width: 50%;">寶寶資料</th>
|
||||
<th style="min-width: 60px;"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<!-- /thead -->
|
||||
|
|
@ -116,8 +118,79 @@
|
|||
</div>
|
||||
<!-- /.page-inner -->
|
||||
|
||||
<!-- .modal -->
|
||||
<form id="clientHistoryListForm" name="clientHistoryListForm">
|
||||
<div class="modal fade" id="clientHistoryListModal" tabindex="-1" role="dialog" aria-labelledby="clientHistoryListModalLabel" data-backdrop="static"
|
||||
data-keyboard="false" aria-hidden="true">
|
||||
<!-- .modal-dialog -->
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<!-- .modal-content -->
|
||||
<div class="modal-content">
|
||||
<!-- .modal-header -->
|
||||
<div class="modal-header">
|
||||
<h6 id="clientNewModalLabel" class="modal-title inline-editable">
|
||||
<span class="sr-only"></span> <input id="LineTitle" type="text" class="form-control form-control-lg" placeholder="" required="">
|
||||
</h6>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span><span class="sr-only">Close</span>
|
||||
</button>
|
||||
</div><!-- /.modal-header -->
|
||||
<!-- .modal-body -->
|
||||
<div class="modal-body">
|
||||
<input type="hidden" id="line_uid_data" />
|
||||
<!-- .page-section -->
|
||||
<div class="page-section">
|
||||
|
||||
<!-- .card -->
|
||||
<div class="card card-fluid">
|
||||
<!-- .card-body -->
|
||||
<div class="card-body">
|
||||
<div class="form-row">
|
||||
<div class="col-md-6" id="prm_project_serial">
|
||||
<!-- .form-group -->
|
||||
<div class="form-group">
|
||||
<select id="baby_select" class="form-control">
|
||||
</select>
|
||||
</div><!-- /.form-group -->
|
||||
</div>
|
||||
<div class="col-md-6" id="prm_project_serial2">
|
||||
<button type="button" class="btn btn-primary ml-auto" id="downloadBtn">下載寶寶總數據</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- .card -->
|
||||
<div class="card card-fluid">
|
||||
<!-- .card-body -->
|
||||
<div class="card-body">
|
||||
<!-- .table -->
|
||||
<table id="dt-responsive-baby" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> 測驗日期 </th>
|
||||
<th> 測驗時年齡 </th>
|
||||
<th> 測驗時身高 </th>
|
||||
<th> 成長百分比 </th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
</table><!-- /.table -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!-- /.card-body -->
|
||||
</div><!-- /.card -->
|
||||
</div><!-- /.page-section -->
|
||||
</div><!-- /.modal-body -->
|
||||
<!-- .modal-footer -->
|
||||
<div class="modal-footer">
|
||||
<button id="closeBtn" type="button" class="btn btn-light" data-dismiss="modal">關閉</button>
|
||||
</div><!-- /.modal-footer -->
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div>
|
||||
</form><!-- /.modal -->
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
|
||||
<script src="assets/javascript/custom/userList.js?v=1"></script>
|
||||
<script src="assets/javascript/custom/userList.js?v=3"></script>
|
||||
</asp:Content>
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue