| | |
| | | <!DOCTYPE html> |
| | | <html xmlns="http://www.w3.org/1999/xhtml"> |
| | | |
| | | <head> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| | | <title>æåº¦æ±æ¥ç»è®¡æ¥è¡¨</title> |
| | |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="layui-fluid"> |
| | | <div class="layui-col-md12"> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">èå</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HEmpName" id="HEmpName" style="width:190px;"> |
| | | <input type="text" class="layui-input" name="HEmpName" id="HEmpName" |
| | | style="width:190px;"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">éç½®</button> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" |
| | | lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">éç½®</button> |
| | | </div> |
| | | </div> |
| | | <table class="" id="mainTable" lay-filter="mainTable"></table> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </script> |
| | | <script> |
| | | //#region æå 注é |
| | | //#endregion |
| | |
| | | base: '../../../layuiadmin/' //éæèµæºæå¨è·¯å¾ |
| | | }).extend({ |
| | | index: 'lib/index', //主å
¥å£æ¨¡å |
| | | }).use(['index', 'form', 'table', 'element', 'laypage','laydate'], function () { |
| | | |
| | | //#region å
Œ
±åé |
| | | }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () { |
| | | |
| | | //#region å
Œ
±åé |
| | | var $ = layui.$ |
| | | , admin = layui.admin |
| | | , layer = layui.layer |
| | |
| | | , element = layui.element |
| | | , laypage = layui.laypage |
| | | , laydate = layui.laydate |
| | | , util = layui.util |
| | | var sDate = Format(new Date(), "yyyy-MM-dd") |
| | | var sWhere = ""; |
| | | var option = []; |
| | |
| | | var columns = ""; |
| | | var HModName = "PM_ProjectWorkDaysSumReport"; |
| | | var titleData = []; //ä¸éè¦æ¾ç¤ºçåæ®µ |
| | | //#endregion |
| | | //#endregion |
| | | |
| | | //#region è¿å
¥é¡µé¢å³å è½½ |
| | | //#region è¿å
¥é¡µé¢å³å è½½ |
| | | |
| | | //åå§åçé¢ |
| | | set_ClearBill(); |
| | |
| | | //è·åç»ç» |
| | | Organ(); |
| | | //åå§åè¡¨åæ¶é´ |
| | | set_InitDate(); |
| | | set_InitDate(); |
| | | //åå§åè¡¨æ ¼ |
| | | set_InitGrid(); |
| | | //æ¥è¯¢ |
| | |
| | | }); |
| | | } |
| | | //éæ©æä»½å³éä¸å
³é 年份æå¯ä»¥å·¦å³ç¹å»éæ© |
| | | ,change: function (value, date, endDate) { //ç嬿¥æè¢«åæ¢ |
| | | , change: function (value, date, endDate) { //ç嬿¥æè¢«åæ¢ |
| | | lay('#HDate').val(value); |
| | | sDate = Format($("#HDate").val() + "-01", "yyyy-MM-dd"); |
| | | $('.laydate-month-list').on('click', 'li', function () {//å©ç¨çäºä»¶å§æ |
| | |
| | | } |
| | | //#endregion |
| | | |
| | | //#endregion |
| | | //#endregion |
| | | |
| | | //#region æ¬é¡µé¢ææè¢«è°ç¨çæ¹æ³ |
| | | //#region æ¬é¡µé¢ææè¢«è°ç¨çæ¹æ³ |
| | | |
| | | //#region å·¥å
·æ äºä»¶ |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | |
| | | }); |
| | | //#endregion |
| | | |
| | | //#region åå
æ ¼åå»äºä»¶ |
| | | table.on('tool(mainTable)', function (obj) { |
| | | let index = obj.index |
| | | let $elem = $(this) // è·åç¹å»çå
ç´ |
| | | |
| | | if (obj.event === "workTimeClickHandler") { |
| | | debugger |
| | | let dateInfo = $elem.data('value') |
| | | get_WorkTaskList(obj.data['èå'], dateInfo) |
| | | } |
| | | }) |
| | | //#endregion |
| | | |
| | | //#region 导åºExecel |
| | | function get_Export() { |
| | | table.exportFile(ins.config.id, option.data, "xls"); |
| | | } |
| | | //#endregion |
| | | |
| | | function get_WorkTaskList(Employee, DateInfo) { |
| | | let EmployeeEncode = encodeURIComponent(Employee) |
| | | layer.open({ |
| | | type: 2 |
| | | , skin: "layui-layer-rim" //å ä¸è¾¹æ¡ |
| | | , title: "å·¥ä½ä»»å¡" //æ é¢ |
| | | , closeBtn: 1 //çªä½å³ä¸è§å
³é ç æ ·å¼ |
| | | , shift: 2 //å¼¹åºå¨ç» |
| | | , area: ["90%", "90%"] //çªä½å¤§å° |
| | | , maxmin: true //设置æå¤§æå°æé®æ¯å¦æ¾ç¤º |
| | | , content: ['../../项ç®ç®¡ç/å·¥ä½ä»»å¡/PM_WorkTaskReportBillList.html?openType=&HOrgID=' + sessionStorage["OrganizationID"] + '&Employee=' + EmployeeEncode + '&DateInfo=' + DateInfo, "yes"] |
| | | , btn: ["ç¡®å®", "åæ¶"] |
| | | , btn1: function (index, laero) { |
| | | //å·æ°è¡¨æ ¼æ°æ® |
| | | get_Display(); |
| | | //æ´æ°è¡¨æ ¼ç¼åçæ°æ® |
| | | layer.close(index);//å
³éå¼¹çª |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //#region æ¥è¯¢ |
| | | function get_Display() { |
| | |
| | | var HEmpName = $("#HEmpName").val(); //èå |
| | | |
| | | sWhere = "'" + HDate + "','" + HEmpName + "'"; |
| | | |
| | | var ajaxLoad = layer.load(); |
| | | $.ajax({ |
| | | type: "GET", |
| | |
| | | switch (data[i].Type) { |
| | | //int |
| | | case 'DateTime': |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 }); |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div'>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 }); |
| | | break; |
| | | //æ¯æ¥å·¥ä½æ¶é¿ |
| | | case 'Decimal': |
| | | let date = util.toDateString(HDate, "yyyy-MM") |
| | | let prefix = data[i].name.split("_").reverse()[1] |
| | | console.log(typeof prefix) |
| | | if (typeof prefix == "undefined") { |
| | | |
| | | } |
| | | else if (prefix.length < 2) { |
| | | prefix = '-0' + prefix |
| | | } |
| | | else { |
| | | prefix = '-' + prefix |
| | | } |
| | | prefix = prefix || '' |
| | | |
| | | col.push({ |
| | | field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: ((d) => { |
| | | let node = document.createElement("div") |
| | | let node_sub = document.createElement("div") |
| | | node_sub.setAttribute("data-value", date + prefix) |
| | | node_sub.setAttribute("lay-event", "workTimeClickHandler") |
| | | node_sub.style.color = "blue"; |
| | | node_sub.innerHTML = "{{= d['" + data[i].name + "']==0? '0' : d['" + data[i].name + "'] }}" |
| | | node.appendChild(node_sub) |
| | | return node.outerHTML |
| | | })() |
| | | , width: 200 |
| | | }); |
| | | break |
| | | default: |
| | | if (data[i].name == 'æ¬æå计') { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true }); |
| | |
| | | } |
| | | //#endregion |
| | | |
| | | //#endregion |
| | | |
| | | //#endregion |
| | | |
| | | }); |
| | | |
| | |
| | | </script> |
| | | |
| | | </body> |
| | | </html> |
| | | |
| | | </html> |