提交 329c6e9b 编写于 作者: F fancy

考勤新增从企业微信同步下来的数据查询,jira问题处理

上级 a82f1b68
......@@ -53,18 +53,36 @@
"id": "151",
"action": "openUnitDingdingIndex"
},
{
"access": "qywx",
"title": MWF.xApplication.Attendance.LP.navi.unitQywxIndex,
"id": "152",
"action": "openUnitQywxIndex"
},
{
"access": "dingding",
"title": MWF.xApplication.Attendance.LP.navi.dingdingPeopleDetail,
"id": "161",
"action": "openDingdingPeopleDetail"
},
{
"access": "qywx",
"title": MWF.xApplication.Attendance.LP.navi.qywxPeopleDetail,
"id": "162",
"action": "openQywxPeopleDetail"
},
{
"access": "dingding",
"title": MWF.xApplication.Attendance.LP.navi.dingdingUnitDetail,
"id": "171",
"action": "openDingdingUnitDetail"
},
{
"access": "qywx",
"title": MWF.xApplication.Attendance.LP.navi.qywxUnitDetail,
"id": "172",
"action": "openQywxUnitDetail"
},
{
"access": "admin",
"type": "sep"
......
[
{
"title": MWF.xApplication.Attendance.LP.name,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function( d ){ return d.o2User.split('@')[0] }",
"name": "o2User",
"width": "20%"
},
{
"title": MWF.xApplication.Attendance.LP.date,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function(d){ var date = new Date(d.userCheckTime); return date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate();}",
"name": "userCheckTime",
"width": "20%"
},
{
"title": MWF.xApplication.Attendance.LP.signinType,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function( data ){ return data.checkType; }",
"name": "checkType",
"width": "20%"
},
{
"title": MWF.xApplication.Attendance.LP.signinResult,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function( data ){ return data.exceptionType; }",
"name": "exceptionType",
"width": "20%"
},
{
"title": MWF.xApplication.Attendance.LP.signTime,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function(d){ var date = new Date(d.userCheckTime); return date.getHours()+':'+date.getMinutes()+':'+date.getSeconds();}",
"name": "userCheckTime",
"width": "20%"
}
]
\ No newline at end of file
[
{
"title" : MWF.xApplication.Attendance.LP.person,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function( d ){ return d.o2User.split('@')[0] }",
"name": "o2User",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.months,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function( data ){ return data.statisticYear + '-' + data.statisticMonth }",
"name": "statisticMonth",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.onDutyTimes,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "onDutyTimes",
"name": "onDutyTimes",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.offDutyTimes,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "offDutyTimes",
"name": "offDutyTimes",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.onDutyDayCount,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "workDayCount",
"name": "workDayCount",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.lateTimes,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "lateTimes",
"name": "lateTimes",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.leaveEarlyTimes,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "leaveEarlyTimes",
"name": "leaveEarlyTimes",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.notSignedCount,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "notSignedCount",
"name": "notSignedCount",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.outsideDutyTimes,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "outsideDutyTimes",
"name": "outsideDutyTimes",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.absenteeismTimes,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "absenteeismTimes",
"name": "absenteeismTimes",
"width": "9%"
}
]
\ No newline at end of file
[
{
"title": MWF.xApplication.Attendance.LP.name,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function( d ){ return d.o2User.split('@')[0] }",
"name": "o2User",
"width": "20%"
},
{
"title": MWF.xApplication.Attendance.LP.date,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function(d){ var date = new Date(d.userCheckTime); return date.getFullYear()+'-'+(date.getMonth()+1)+'-'+date.getDate();}",
"name": "userCheckTime",
"width": "20%"
},
{
"title": MWF.xApplication.Attendance.LP.signinType,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function( data ){ return data.checkType; }",
"name": "checkType",
"width": "20%"
},
{
"title": MWF.xApplication.Attendance.LP.signinResult,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function( data ){ return data.exceptionType; }",
"name": "exceptionType",
"width": "20%"
},
{
"title": MWF.xApplication.Attendance.LP.signTime,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function(d){ var date = new Date(d.userCheckTime); return date.getHours()+':'+date.getMinutes()+':'+date.getSeconds();}",
"name": "userCheckTime",
"width": "20%"
}
]
\ No newline at end of file
[
{
"title" : MWF.xApplication.Attendance.LP.person,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function( d ){ return d.o2User.split('@')[0] }",
"name": "o2User",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.months,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "function( data ){ return data.statisticYear + '-' + data.statisticMonth }",
"name": "statisticMonth",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.onDutyTimes,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "onDutyTimes",
"name": "onDutyTimes",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.offDutyTimes,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "offDutyTimes",
"name": "offDutyTimes",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.onDutyDayCount,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "workDayCount",
"name": "workDayCount",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.lateTimes,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "lateTimes",
"name": "lateTimes",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.leaveEarlyTimes,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "leaveEarlyTimes",
"name": "leaveEarlyTimes",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.notSignedCount,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "notSignedCount",
"name": "notSignedCount",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.outsideDutyTimes,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "outsideDutyTimes",
"name": "outsideDutyTimes",
"width": "9%"
},
{
"title" : MWF.xApplication.Attendance.LP.absenteeismTimes,
"headStyles": "normalThNode",
"contentStyles": "normalTdNode",
"item": "absenteeismTimes",
"name": "absenteeismTimes",
"width": "9%"
}
]
\ No newline at end of file
......@@ -168,6 +168,16 @@ MWF.xApplication.Attendance.Main = new Class({
this.explorer.load();
}.bind(this));
},
openUnitQywxIndex: function () {
MWF.xDesktop.requireApp("Attendance", "UnitQywxIndex", function () {
this.clearContent();
this.explorerContent = new Element("div", {
"styles": this.css.rightContentNode
}).inject(this.node);
this.explorer = new MWF.xApplication.Attendance.UnitQywxIndex(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
this.explorer.load();
}.bind(this));
},
openUnitDetail: function () {
MWF.xDesktop.requireApp("Attendance", "UnitDetail", function () {
this.clearContent();
......@@ -178,6 +188,7 @@ MWF.xApplication.Attendance.Main = new Class({
this.explorer.load();
}.bind(this));
},
openDingdingUnitDetail: function () {
MWF.xDesktop.requireApp("Attendance", "UnitDingdingDetail", function () {
this.clearContent();
......@@ -188,6 +199,16 @@ MWF.xApplication.Attendance.Main = new Class({
this.explorer.load();
}.bind(this));
},
openQywxUnitDetail: function () {
MWF.xDesktop.requireApp("Attendance", "UnitQywxDetail", function () {
this.clearContent();
this.explorerContent = new Element("div", {
"styles": this.css.rightContentNode
}).inject(this.node);
this.explorer = new MWF.xApplication.Attendance.UnitQywxDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
this.explorer.load();
}.bind(this));
},
openPeopleDetail: function () {
MWF.xDesktop.requireApp("Attendance", "PeopleDetail", function () {
this.clearContent();
......@@ -208,6 +229,16 @@ MWF.xApplication.Attendance.Main = new Class({
this.explorer.load();
}.bind(this));
},
openQywxPeopleDetail: function () {
MWF.xDesktop.requireApp("Attendance", "PeopleQywxDetail", function () {
this.clearContent();
this.explorerContent = new Element("div", {
"styles": this.css.rightContentNode
}).inject(this.node);
this.explorer = new MWF.xApplication.Attendance.PeopleQywxDetail(this.explorerContent, this, this.restActions, { "isAdmin": this.isAdmin() });
this.explorer.load();
}.bind(this));
},
openTopUnitDetail: function () {
MWF.xDesktop.requireApp("Attendance", "TopUnitDetail", function () {
this.clearContent();
......@@ -390,6 +421,9 @@ MWF.xApplication.Attendance.Navi = new Class({
} else if (navi.access && navi.access == "dingding") { //启用钉钉考勤同步后
debugger;
if ((this.app.isUnitManager() || this.app.isAdmin()) && (this.app.enableType == "dingding")) this.createNaviNode(navi);
} else if (navi.access && navi.access == "qywx") { // 启用企业微信考勤同步后
debugger;
if ((this.app.isUnitManager() || this.app.isAdmin()) && (this.app.enableType == "qywx")) this.createNaviNode(navi);
} else {
this.createNaviNode(navi);
}
......
MWF.xDesktop.requireApp("Attendance", "Explorer", null, false);
MWF.xDesktop.requireApp("Selector", "package", null, false);
MWF.xApplication.Attendance.PeopleQywxDetail = new Class({
Extends: MWF.widget.Common,
Implements: [Options, Events],
options: {
"style": "default"
},
initialize: function (node, app, actions, options) {
this.setOptions(options);
this.app = app;
this.path = "../x_component_Attendance/$PeopleDetail/";
this.cssPath = "../x_component_Attendance/$PeopleDetail/" + this.options.style + "/css.wcss";
this._loadCss();
this.actions = actions;
this.node = $(node);
},
load: function () {
this.loadTab();
},
loadTab: function () {
this.tabNode = new Element("div", { "styles": this.css.tabNode }).inject(this.node);
this.detailArea = new Element("div", { "styles": this.css.tabPageContainer }).inject(this.tabNode);
//this.selfHolidayArea = new Element("div",{"styles" : this.css.tabPageContainer }).inject(this.tabNode)
this.detailStaticArea = new Element("div", { "styles": this.css.tabPageContainer }).inject(this.tabNode);
//this.selfHolidayStaticArea = new Element("div",{"styles" : this.css.tabPageContainer }).inject(this.tabNode)
MWF.require("MWF.widget.Tab", function () {
this.tabs = new MWF.widget.Tab(this.tabNode, { "style": "attendance" });
this.tabs.load();
this.detailPage = this.tabs.addTab(this.detailArea, this.app.lp.personSigninDetail, false);
this.detailPage.contentNodeArea.set("class", "detailPage");
this.detailPage.addEvent("show", function () {
if (!this.detailExplorer) {
this.detailExplorer = new MWF.xApplication.Attendance.PeopleQywxDetail.Explorer(this.detailArea, this);
this.detailExplorer.load();
}
}.bind(this));
this.detailStaticPage = this.tabs.addTab(this.detailStaticArea, this.app.lp.personSigninStatic, false);
this.detailStaticPage.contentNodeArea.set("class", "detailStaticPage");
this.detailStaticPage.addEvent("show", function () {
if (!this.detailStaticExplorer) {
this.detailStaticExplorer = new MWF.xApplication.Attendance.PeopleQywxDetail.DetailStaticExplorer(this.detailStaticArea, this);
this.detailStaticExplorer.load();
}
}.bind(this));
this.tabs.pages[0].showTab();
}.bind(this));
}
});
MWF.xApplication.Attendance.PeopleQywxDetail.Explorer = new Class({
Extends: MWF.xApplication.Attendance.Explorer,
Implements: [Options, Events],
initialize: function (node, parent, options) {
this.setOptions(options);
this.parent = parent;
this.app = parent.app;
this.css = parent.css;
this.path = parent.path;
this.actions = parent.actions;
this.node = $(node);
this.initData();
if (!this.peopleActions) this.peopleActions = new MWF.xAction.org.express.RestActions();
},
initData: function () {
this.toolItemNodes = [];
},
reload: function () {
this.node.empty();
this.load();
},
load: function () {
this.loadFilter();
this.loadContentNode();
this.setNodeScroll();
},
loadFilter: function () {
var lp = MWF.xApplication.Attendance.LP;
this.fileterNode = new Element("div.fileterNode", {
"styles": this.css.fileterNode
}).inject(this.node);
var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='filterTable'>" +
"<tr>" +
" <td styles='filterTableValue' lable='person'></td>" +
" <td styles='filterTableTitle' item='person'></td>" +
" <td styles='filterTableTitle' lable='year'></td>" +
" <td styles='filterTableValue' item='year'></td>" +
" <td styles='filterTableTitle' lable='month'></td>" +
" <td styles='filterTableValue' item='month'></td>" +
" <td styles='filterTableTitle' lable='day'></td>" +
" <td styles='filterTableValue' item='day'></td>" +
" <td styles='filterTableTitle' lable='checkType'></td>" +
" <td styles='filterTableValue' item='checkType'></td>" +
" <td styles='filterTableTitle' lable='exceptionType'></td>" +
" <td styles='filterTableValue' item='exceptionType'></td>" +
" <td styles='filterTableValue' item='action'></td>" +
"</tr>" +
"</table>";
this.fileterNode.set("html", html);
MWF.xDesktop.requireApp("Template", "MForm", function () {
this.form = new MForm(this.fileterNode, {}, {
isEdited: true,
itemTemplate: {
person: { text: lp.person, type: "org", orgType: "person", notEmpty: true, style: { "min-width": "100px" } },
year: {
text: lp.annuaal,
"type": "select",
"selectValue": function () {
var years = [];
var year = new Date().getFullYear();
for (var i = 0; i < 6; i++) {
years.push(year--);
}
return years;
},
"event": {
"change": function (item, ev) {
var values = this.getDateSelectValue();
item.form.getItem("day").resetItemOptions(values, values)
}.bind(this)
}
},
month: {
text: lp.months,
"type": "select",
"defaultValue": function () {
var month = (new Date().getMonth() + 1).toString();
return month.length == 1 ? "0" + month : month;
},
"selectValue": ["", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
"event": {
"change": function (item, ev) {
var values = this.getDateSelectValue();
item.form.getItem("day").resetItemOptions(values, values)
}.bind(this)
}
},
day: { text: lp.date, "type": "select", "selectValue": this.getDateSelectValue.bind(this) },
checkType: { text: lp.signinType, "type": "select", "selectValue": lp.signinQywxTypeSelectText, "selectText": lp.signinQywxTypeSelectText },
exceptionType: { text: lp.signinResult, "type": "select", "selectValue": lp.signinQywxResultSelectText, "selectText": lp.signinQywxResultSelectText },
action: {
"value": lp.query, type: "button", className: "filterButton", event: {
click: function () {
var result = this.form.getResult(true, ",", true, true, false);
if (!result) return;
if (result.day && result.day != "") {
result.q_date = result.year + "-" + result.month + "-" + result.day;
}
this.loadView(result);
}.bind(this)
}
}
}
}, this.app, this.css);
this.form.load();
}.bind(this), true);
},
getDateSelectValue: function () {
if (this.form) {
var year = parseInt(this.form.getItem("year").getValue());
var month = parseInt(this.form.getItem("month").getValue()) - 1;
} else {
var year = (new Date()).getFullYear();
var month = (new Date()).getMonth();
}
var date = new Date(year, month, 1);
var days = [];
days.push("");
while (date.getMonth() === month) {
var d = date.getDate().toString();
if (d.length == 1) d = "0" + d;
days.push(d);
date.setDate(date.getDate() + 1);
}
return days;
},
loadContentNode: function () {
this.elementContentNode = new Element("div", {
"styles": this.css.elementContentNode
}).inject(this.node);
this.app.addEvent("resize", function () { this.setContentSize(); }.bind(this));
},
loadView: function (filterData) {
this.elementContentNode.empty();
if (this.view) delete this.view;
this.view = new MWF.xApplication.Attendance.PeopleQywxDetail.View(this.elementContentNode, this.app, this);
this.view.filterData = filterData;
this.view.listItemUrl = this.path + "listItem_qywx.json";
this.view.load();
this.setContentSize();
},
setContentSize: function () {
var tabNodeSize = this.parent.tabs ? this.parent.tabs.tabNodeContainer.getSize() : { "x": 0, "y": 0 };
var fileterNodeSize = this.fileterNode ? this.fileterNode.getSize() : { "x": 0, "y": 0 };
var nodeSize = this.parent.node.getSize();
var pt = this.elementContentNode.getStyle("padding-top").toFloat();
var pb = this.elementContentNode.getStyle("padding-bottom").toFloat();
//var filterSize = this.filterNode.getSize();
var height = nodeSize.y - tabNodeSize.y - pt - pb - fileterNodeSize.y - 20;
this.elementContentNode.setStyle("height", "" + height + "px");
this.pageCount = (height / 40).toInt() + 5;
if (this.view && this.view.items.length < this.pageCount) {
this.view.loadElementList(this.pageCount - this.view.items.length);
}
}
});
MWF.xApplication.Attendance.PeopleQywxDetail.SelfHoliday = new Class({
Extends: MWF.xApplication.Attendance.PeopleQywxDetail.Explorer,
loadView: function (filterData) {
this.elementContentNode.empty();
if (this.view) delete this.view;
this.view = new MWF.xApplication.Attendance.PeopleQywxDetail.SelfHolidayView(this.elementContentNode, this.app, this);
this.view.filterData = filterData;
this.view.load();
this.setContentSize();
}
});
MWF.xApplication.Attendance.PeopleQywxDetail.DetailStaticExplorer = new Class({
Extends: MWF.xApplication.Attendance.PeopleQywxDetail.Explorer,
loadFilter: function () {
var lp = MWF.xApplication.Attendance.LP;
this.fileterNode = new Element("div.fileterNode", {
"styles": this.css.fileterNode
}).inject(this.node);
var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' style='width: 460px;font-size: 14px;color:#666'>" +
"<tr>" +
" <td styles='filterTableValue' lable='q_empName'></td>" +
" <td styles='filterTableTitle' item='q_empName'></td>" +
" <td styles='filterTableTitle' lable='cycleYear'></td>" +
" <td styles='filterTableValue' item='cycleYear'></td>" +
" <td styles='filterTableTitle' lable='cycleMonth'></td>" +
" <td styles='filterTableValue' item='cycleMonth'></td>" +
" <td styles='filterTableValue' item='action'></td>" +
"</tr>" +
"</table>";
this.fileterNode.set("html", html);
MWF.xDesktop.requireApp("Template", "MForm", function () {
this.form = new MForm(this.fileterNode, {}, {
isEdited: true,
itemTemplate: {
q_empName: { text: lp.person, type: "org", orgType: "person", notEmpty: true, style: { "min-width": "100px" } },
cycleYear: {
text: lp.annuaal,
"type": "select",
"selectValue": function () {
var years = [];
var year = new Date().getFullYear();
for (var i = 0; i < 6; i++) {
years.push(year--);
}
return years;
}
},
cycleMonth: {
text: lp.months,
"type": "select",
"defaultValue": function () {
var month = (new Date().getMonth() + 1).toString();
return month.length == 1 ? "0" + month : month;
},
"selectValue": ["", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]
},
action: {
"value": lp.query, type: "button", className: "filterButton", event: {
click: function () {
var result = this.form.getResult(true, ",", true, true, false);
if (!result) return;
this.loadView(result);
}.bind(this)
}
}
}
}, this.app, this.css);
this.form.load();
}.bind(this), true);
},
loadView: function (filterData) {
this.elementContentNode.empty();
if (this.view) delete this.view;
this.view = new MWF.xApplication.Attendance.PeopleQywxDetail.DetailStaticView(this.elementContentNode, this.app, this);
this.view.filterData = filterData;
this.view.listItemUrl = this.path + "listItem_qywx_detailStatic.json";
this.view.load();
this.setContentSize();
}
});
MWF.xApplication.Attendance.PeopleQywxDetail.SelfHolidayStaticExplorer = new Class({
Extends: MWF.xApplication.Attendance.PeopleQywxDetail.Explorer,
loadView: function (filterData) {
this.elementContentNode.empty();
if (this.view) delete this.view;
this.view = new MWF.xApplication.Attendance.PeopleQywxDetail.SelfHolidayStaticView(this.elementContentNode, this.app, this);
this.view.filterData = filterData;
this.view.load();
this.setContentSize();
}
});
MWF.xApplication.Attendance.PeopleQywxDetail.View = new Class({
Extends: MWF.xApplication.Attendance.Explorer.View,
_createItem: function (data) {
return new MWF.xApplication.Attendance.PeopleQywxDetail.Document(this.table, data, this.explorer, this);
},
_getCurrentPageData: function (callback, count) {
if (!count) count = 20;
var id = (this.items.length) ? this.items[this.items.length - 1].data.id : "(0)";
var filter = this.filterData || {};
var action = o2.Actions.load("x_attendance_assemble_control");
action.QywxAttendanceAction.listDingdingAttendance(id, count, filter, function (json) {
if (callback) callback(json);
}.bind(this));
},
_removeDocument: function (documentData, all) {
},
_createDocument: function () {
},
_openDocument: function (documentData) {
}
});
MWF.xApplication.Attendance.PeopleQywxDetail.SelfHolidayView = new Class({
Extends: MWF.xApplication.Attendance.Explorer.View,
_createItem: function (data) {
return new MWF.xApplication.Attendance.PeopleQywxDetail.SelfHolidayDocument(this.table, data, this.explorer, this);
},
_getCurrentPageData: function (callback, count) {
var filter = this.filterData || {};
this.actions.listDetailFilter(filter, function (json) {
if (callback) callback(json);
}.bind(this))
},
_removeDocument: function (documentData, all) {
},
_createDocument: function () {
},
_openDocument: function (documentData) {
}
});
MWF.xApplication.Attendance.PeopleQywxDetail.DetailStaticView = new Class({
Extends: MWF.xApplication.Attendance.Explorer.View,
_createItem: function (data) {
return new MWF.xApplication.Attendance.PeopleQywxDetail.DetailStaticDocument(this.table, data, this.explorer, this);
},
_getCurrentPageData: function (callback, count) {
var filter = this.filterData || {};
var action = o2.Actions.load("x_attendance_assemble_control");
action.QywxAttendanceStatisticAction.personMonth(filter.q_empName, filter.cycleYear, filter.cycleMonth, function (json) {
// var data = json.data;
// data.sort(function (a, b) {
// return parseInt(b.statisticYear + b.statisticMonth) - parseInt(a.statisticYear + a.statisticMonth)
// });
// json.data = data;
if (callback) callback(json);
}.bind(this))
},
_removeDocument: function (documentData, all) {
},
_createDocument: function () {
},
_openDocument: function (documentData) {
}
});
MWF.xApplication.Attendance.PeopleQywxDetail.SelfHolidayStaticView = new Class({
Extends: MWF.xApplication.Attendance.Explorer.View,
_createItem: function (data) {
return new MWF.xApplication.Attendance.PeopleQywxDetail.SelfHolidayStaticDocument(this.table, data, this.explorer, this);
},
_getCurrentPageData: function (callback, count) {
var filter = this.filterData || {};
this.actions.listDetailFilter(filter, function (json) {
if (callback) callback(json);
}.bind(this))
},
_removeDocument: function (documentData, all) {
},
_createDocument: function () {
},
_openDocument: function (documentData) {
}
});
MWF.xApplication.Attendance.PeopleQywxDetail.Document = new Class({
Extends: MWF.xApplication.Attendance.Explorer.Document
});
MWF.xApplication.Attendance.PeopleQywxDetail.SelfHolidayDocument = new Class({
Extends: MWF.xApplication.Attendance.Explorer.Document
});
MWF.xApplication.Attendance.PeopleQywxDetail.DetailStaticDocument = new Class({
Extends: MWF.xApplication.Attendance.Explorer.Document
});
MWF.xApplication.Attendance.PeopleQywxDetail.SelfHolidayStaticDocument = new Class({
Extends: MWF.xApplication.Attendance.Explorer.Document
});
MWF.xDesktop.requireApp("Attendance", "Explorer", null, false);
MWF.xDesktop.requireApp("Selector", "package", null, false);
MWF.xApplication.Attendance.UnitQywxDetail = new Class({
Extends: MWF.widget.Common,
Implements: [Options, Events],
options: {
"style": "default"
},
initialize: function (node, app, actions, options) {
this.setOptions(options);
this.app = app;
this.path = "../x_component_Attendance/$UnitDetail/";
this.cssPath = "../x_component_Attendance/$UnitDetail/" + this.options.style + "/css.wcss";
this._loadCss();
this.actions = actions;
this.node = $(node);
},
load: function () {
this.loadTab();
},
loadTab: function () {
this.tabNode = new Element("div", { "styles": this.css.tabNode }).inject(this.node);
this.detailArea = new Element("div", { "styles": this.css.tabPageContainer }).inject(this.tabNode);
//this.selfHolidayArea = new Element("div",{"styles" : this.css.tabPageContainer }).inject(this.tabNode)
this.detailStaticArea = new Element("div", { "styles": this.css.tabPageContainer }).inject(this.tabNode);
//this.selfHolidayStaticArea = new Element("div",{"styles" : this.css.tabPageContainer }).inject(this.tabNode)
MWF.require("MWF.widget.Tab", function () {
this.tabs = new MWF.widget.Tab(this.tabNode, { "style": "attendance" });
this.tabs.load();
this.detailPage = this.tabs.addTab(this.detailArea, this.app.lp.unitSigninDetail, false);
this.detailPage.contentNodeArea.set("class", "detailPage");
this.detailPage.addEvent("show", function () {
if (!this.detailExplorer) {
this.detailExplorer = new MWF.xApplication.Attendance.UnitQywxDetail.Explorer(this.detailArea, this);
this.detailExplorer.load();
}
}.bind(this));
this.detailStaticPage = this.tabs.addTab(this.detailStaticArea, this.app.lp.unitSigninStatic, false);
this.detailStaticPage.contentNodeArea.set("class", "detailStaticPage");
this.detailStaticPage.addEvent("show", function () {
if (!this.detailStaticExplorer) {
this.detailStaticExplorer = new MWF.xApplication.Attendance.UnitQywxDetail.DetailStaticExplorer(this.detailStaticArea, this);
this.detailStaticExplorer.load();
}
}.bind(this));
this.tabs.pages[0].showTab();
}.bind(this));
}
});
MWF.xApplication.Attendance.UnitQywxDetail.Explorer = new Class({
Extends: MWF.xApplication.Attendance.Explorer,
Implements: [Options, Events],
initialize: function (node, parent, options) {
this.setOptions(options);
this.parent = parent;
this.app = parent.app;
this.lp = this.app.lp;
this.css = parent.css;
this.path = parent.path;
this.actions = parent.actions;
this.node = $(node);
this.initData();
if (!this.peopleActions) this.peopleActions = new MWF.xAction.org.express.RestActions();
},
initData: function () {
this.toolItemNodes = [];
},
reload: function () {
this.node.empty();
this.load();
},
load: function () {
this.loadFilter();
this.loadContentNode();
this.setNodeScroll();
},
loadFilter: function () {
var lp = MWF.xApplication.Attendance.LP;
this.fileterNode = new Element("div.fileterNode", {
"styles": this.css.fileterNode
}).inject(this.node);
var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='filterTable'>" +
"<tr>" +
" <td styles='filterTableValue' lable='unit'></td>" +
" <td styles='filterTableTitle' item='unit'></td>" +
" <td styles='filterTableTitle' lable='year'></td>" +
" <td styles='filterTableValue' item='year'></td>" +
" <td styles='filterTableTitle' lable='month'></td>" +
" <td styles='filterTableValue' item='month'></td>" +
" <td styles='filterTableTitle' lable='day'></td>" +
" <td styles='filterTableValue' item='day'></td>" +
" <td styles='filterTableTitle' lable='checkType'></td>" +
" <td styles='filterTableValue' item='checkType'></td>" +
" <td styles='filterTableTitle' lable='exceptionType'></td>" +
" <td styles='filterTableValue' item='exceptionType'></td>" +
" <td styles='filterTableValue' item='action'></td>" +
"</tr>" +
"</table>";
this.fileterNode.set("html", html);
MWF.xDesktop.requireApp("Template", "MForm", function () {
this.form = new MForm(this.fileterNode, {}, {
isEdited: true,
itemTemplate: {
unit: { text: lp.unit, type: "org", orgType: "unit", notEmpty: true, style: { "min-width": "200px" } },
year: {
text: lp.annuaal,
"type": "select",
"selectValue": function () {
var years = [];
var year = new Date().getFullYear();
for (var i = 0; i < 6; i++) {
years.push(year--);
}
return years;
},
"event": {
"change": function (item, ev) {
var values = this.getDateSelectValue();
item.form.getItem("day").resetItemOptions(values, values)
}.bind(this)
}
},
month: {
text: lp.months,
"type": "select",
"defaultValue": function () {
var month = (new Date().getMonth() + 1).toString();
return month.length == 1 ? "0" + month : month;
},
"selectValue": ["", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
"event": {
"change": function (item, ev) {
var values = this.getDateSelectValue();
item.form.getItem("day").resetItemOptions(values, values)
}.bind(this)
}
},
day: { text: lp.date, "type": "select", "selectValue": this.getDateSelectValue.bind(this) },
checkType: { text: lp.signinType, "type": "select", "selectValue": lp.signinQywxTypeSelectText, "selectText": lp.signinQywxTypeSelectText },
exceptionType: { text: lp.signinResult, "type": "select", "selectValue": lp.signinQywxResultSelectText, "selectText": lp.signinQywxResultSelectText },
action: {
"value": lp.query, type: "button", className: "filterButton", event: {
click: function () {
var result = this.form.getResult(true, ",", true, true, false);
if (!result) return;
if (result.day && result.day != "") {
result.q_date = result.year + "-" + result.month + "-" + result.day;
}
this.loadView(result);
}.bind(this)
}
}
}
}, this.app, this.css);
this.form.load();
}.bind(this), true);
},
getDateSelectValue: function () {
if (this.form) {
var year = parseInt(this.form.getItem("year").getValue());
var month = parseInt(this.form.getItem("month").getValue()) - 1;
} else {
var year = (new Date()).getFullYear();
var month = (new Date()).getMonth();
}
var date = new Date(year, month, 1);
var days = [];
days.push("");
while (date.getMonth() === month) {
var d = date.getDate().toString();
if (d.length == 1) d = "0" + d;
days.push(d);
date.setDate(date.getDate() + 1);
}
return days;
},
loadContentNode: function () {
this.elementContentNode = new Element("div", {
"styles": this.css.elementContentNode
}).inject(this.node);
this.app.addEvent("resize", function () { this.setContentSize(); }.bind(this));
},
loadView: function (filterData) {
this.elementContentNode.empty();
if (this.view) delete this.view;
this.view = new MWF.xApplication.Attendance.UnitQywxDetail.View(this.elementContentNode, this.app, this);
this.view.filterData = filterData;
this.view.listItemUrl = this.path + "listItem_qywx.json";
this.view.load();
this.setContentSize();
},
setContentSize: function () {
var tabNodeSize = this.parent.tabs ? this.parent.tabs.tabNodeContainer.getSize() : { "x": 0, "y": 0 };
var fileterNodeSize = this.fileterNode ? this.fileterNode.getSize() : { "x": 0, "y": 0 };
var nodeSize = this.parent.node.getSize();
var pt = this.elementContentNode.getStyle("padding-top").toFloat();
var pb = this.elementContentNode.getStyle("padding-bottom").toFloat();
//var filterSize = this.filterNode.getSize();
var height = nodeSize.y - tabNodeSize.y - pt - pb - fileterNodeSize.y - 20;
this.elementContentNode.setStyle("height", "" + height + "px");
this.pageCount = (height / 40).toInt() + 5;
if (this.view && this.view.items.length < this.pageCount) {
this.view.loadElementList(this.pageCount - this.view.items.length);
}
}
});
MWF.xApplication.Attendance.UnitQywxDetail.DetailStaticExplorer = new Class({
Extends: MWF.xApplication.Attendance.UnitQywxDetail.Explorer,
loadFilter: function () {
var lp = MWF.xApplication.Attendance.LP;
this.fileterNode = new Element("div.fileterNode", {
"styles": this.css.fileterNode
}).inject(this.node);
var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' style='width: 660px;font-size: 14px;color:#666'>" +
"<tr>" +
" <td styles='filterTableValue' lable='q_unitName'></td>" +
" <td styles='filterTableTitle' item='q_unitName'></td>" +
" <td styles='filterTableTitle' lable='cycleYear'></td>" +
" <td styles='filterTableValue' item='cycleYear'></td>" +
" <td styles='filterTableTitle' lable='cycleMonth'></td>" +
" <td styles='filterTableValue' item='cycleMonth'></td>" +
" <td styles='filterTableValue' item='action'></td>" +
"</tr>" +
"</table>";
this.fileterNode.set("html", html);
MWF.xDesktop.requireApp("Template", "MForm", function () {
this.form = new MForm(this.fileterNode, {}, {
isEdited: true,
itemTemplate: {
q_unitName: { text: lp.unit, type: "org", orgType: "unit", notEmpty: true, style: { "min-width": "200px" } },
cycleYear: {
text: lp.annuaal,
"type": "select",
"selectValue": function () {
var years = [];
var year = new Date().getFullYear();
for (var i = 0; i < 6; i++) {
years.push(year--);
}
return years;
}
},
cycleMonth: {
text: lp.months, notEmpty: true,
"type": "select",
"defaultValue": function () {
var month = (new Date().getMonth() + 1).toString();
return month.length == 1 ? "0" + month : month;
},
"selectValue": ["", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]
},
action: {
"value": lp.query, type: "button", className: "filterButton", event: {
click: function () {
var result = this.form.getResult(true, ",", true, true, false);
if (!result) return;
this.loadView(result);
}.bind(this)
}
}
}
}, this.app, this.css);
this.form.load();
}.bind(this), true);
},
loadView: function (filterData) {
this.elementContentNode.empty();
if (this.view) delete this.view;
this.view = new MWF.xApplication.Attendance.UnitQywxDetail.DetailStaticView(this.elementContentNode, this.app, this);
this.view.filterData = filterData;
this.view.listItemUrl = this.path + "listItem_qywx_detailStatic.json";
this.view.load();
this.setContentSize();
}
});
MWF.xApplication.Attendance.UnitQywxDetail.View = new Class({
Extends: MWF.xApplication.Attendance.Explorer.View,
_createItem: function (data) {
return new MWF.xApplication.Attendance.UnitQywxDetail.Document(this.table, data, this.explorer, this);
},
_getCurrentPageData: function (callback, count) {
if (!count) count = 20;
var id = (this.items.length) ? this.items[this.items.length - 1].data.id : "(0)";
var filter = this.filterData || {};
var action = o2.Actions.load("x_attendance_assemble_control");
action.QywxAttendanceAction.listDingdingAttendance(id, count, filter, function (json) {
if (callback) callback(json);
}.bind(this));
},
_removeDocument: function (documentData, all) {
},
_createDocument: function () {
},
_openDocument: function (documentData) {
}
});
MWF.xApplication.Attendance.UnitQywxDetail.DetailStaticView = new Class({
Extends: MWF.xApplication.Attendance.Explorer.View,
_createItem: function (data) {
return new MWF.xApplication.Attendance.UnitQywxDetail.DetailStaticDocument(this.table, data, this.explorer, this);
},
_getCurrentPageData: function (callback, count) {
var filter = this.filterData || {};
var action = o2.Actions.load("x_attendance_assemble_control");
action.QywxAttendanceStatisticAction.personMonthWithUnit(filter.q_unitName, filter.cycleYear, filter.cycleMonth, function (json) {
if (callback) callback(json);
}.bind(this));
},
_removeDocument: function (documentData, all) {
},
_createDocument: function () {
},
_openDocument: function (documentData) {
}
});
MWF.xApplication.Attendance.UnitQywxDetail.Document = new Class({
Extends: MWF.xApplication.Attendance.Explorer.Document
});
MWF.xApplication.Attendance.UnitQywxDetail.DetailStaticDocument = new Class({
Extends: MWF.xApplication.Attendance.Explorer.Document
});
此差异已折叠。
......@@ -56,6 +56,7 @@ MWF.xApplication.Attendance.LP = {
"abNormalDutyCount": "Abnormal check-in times",
"resultNormal": "Number of normal punches",
"seriousLateTimes": "Seriously Late Times",
"outsideDutyTimes": "Outside Checkin Times",
"absenteeismTimes": "Number of Absenteeism",
"notSignedCount": "Not Signed Count",
......@@ -218,8 +219,10 @@ MWF.xApplication.Attendance.LP = {
"noDepartment": "Your department was not found, please contact the administrator!",
"signinType": "Signin Type",
"signinTypeSelectText": ["", "Check in at work", "Check in after get off work"],
"signinQywxTypeSelectText": ["", "上班打卡", "下班打卡", "外出打卡"],
"signinResult": "signin result",
"signinResultSelectText": ["", "normal", "leave early", "late", "severely late", "absentee late", "not clocked in"],
"signinResultSelectText": ["", "normal", "leave early", "late", "severely late", "absentee late", "not clocked in", "Outside checkin"],
"signinQywxResultSelectText": ["", "正常", "时间异常", "地点异常", "未打卡", "wifi异常", "非常用设备"],
"systemSetting": "System Settings",
"reportTo": "Report object",
......@@ -392,8 +395,11 @@ MWF.xApplication.Attendance.LP = {
"unitDetail": "Department Statistics",
"topUnitDetail": "Company Statistics",
"unitDingdingIndex": "Dingding Department Report",
"unitQywxIndex": "Qywx Department Report",
"dingdingPeopleDetail": "Dingding Personal Statistics",
"dingdingUnitDetail": "Dingding Unit Statistics",
"qywxPeopleDetail": "Qywx Personal Statistics",
"qywxUnitDetail": "Qywx Unit Statistics",
"maintain": "Maintenance",
"importing": "Data Import",
......
......@@ -56,6 +56,7 @@ MWF.xApplication.Attendance.LP = {
"abNormalDutyCount" : "异常打卡人次",
"resultNormal" : "正常打卡次数",
"seriousLateTimes": "严重迟到次数",
"outsideDutyTimes": "外出签到次数",
"absenteeismTimes": "矿工次数",
"notSignedCount": "未打卡次数",
......@@ -226,8 +227,10 @@ MWF.xApplication.Attendance.LP = {
"noDepartment": "未找到您所在的部门,请联系管理员!",
"signinType": "打卡类型",
"signinTypeSelectText": ["", "上班打卡", "下班打卡"],
"signinQywxTypeSelectText": ["", "上班打卡", "下班打卡", "外出打卡"],
"signinResult": "打卡结果",
"signinResultSelectText": ["", "正常", "早退", "迟到", "严重迟到", "旷工迟到", "未打卡"],
"signinQywxResultSelectText": ["", "正常", "时间异常", "地点异常", "未打卡", "wifi异常", "非常用设备"],
"systemSetting" : "系统设置",
"reportTo": "汇报对象",
......@@ -401,8 +404,11 @@ MWF.xApplication.Attendance.LP = {
"unitDetail": "部门考勤统计",
"topUnitDetail": "公司考勤统计",
"unitDingdingIndex": "钉钉部门考勤月报",
"unitQywxIndex": "企业微信部门考勤月报",
"dingdingPeopleDetail": "钉钉个人考勤统计",
"dingdingUnitDetail": "钉钉部门考勤统计",
"qywxPeopleDetail": "企业微信个人考勤统计",
"qywxUnitDetail": "企业微信部门考勤统计",
"maintain": "维护",
"importing": "数据导入",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册