{% extends "data_list.html" %} {% load i18n %} {% load iclock_tags %} {% block tblHeader %} fieldHeaders=["{{ cl.FieldName.PIN }}", "{{ cl.FieldName.EName }}", "{% trans 'department number' %}", "{% trans 'department name' %}", "{{ cl.FieldName.Gender }}", "{{ cl.FieldName.Birthday }}", "{{ cl.FieldName.National }}","{{ cl.FieldName.Title }}","{{ cl.FieldName.Tele }}","{{ cl.FieldName.Mobile }}","{{ cl.FieldName.Card }}","{{ cl.FieldName.SN }}", ""+gettext("FP")+"", "{{ cl.FieldName.OffDuty }}","{%trans "Transactions"%}", "{%trans "Picture"%}"]; hd='({%trans 'After the submission of the operation need to be about half a minute or so of device in the entry into force'%})' department=[]; $.ajax({ type: "POST", url:"/iclock/data/department/?l=10000&t=dept_json.js", dataType:"json", success:function(json){ department=json; } }); {% if true %} {% block clear %} {% if request.clear_employee %} {% else %} {% endif %} {% endblock %} {% endif %} function selectDevAct(action) { sn=prompt("{%trans "Sequence of input devices"%}:\n"+hd, ""); if(!sn) return ''; return '?action='+action+'&SN='+sn; } function toDev(url) { createDialog("miniData?key=iclock", "{%trans "Transfer employee to the device"%}", "{%trans "device"%}", 250, url); } function hide_batchOp() {//隐藏部分批处理动作 if ("{{ permissions }}" == "22") { //机构管理员 str = "op={%trans "Deleted from the device employee"%}op={%trans "Change employee department"%} "; $(".selectedDataOp a").each(function (i){ if (str.indexOf($(this).html()) > -1) $(this).hide(); }); }; } function selectUnitAct() { sn=prompt("{%trans "Input Department #"%}:", ""); if(!sn) return ''; return '?action=dept&department='+sn; } function strOfData(data) { return data[1]+" "+data[2]; } function copyEmployeeInfo(url) {//拷贝人员信息 var strCopyFields = "", strCopySource =""; if(url.selectedCount > 1 && url.count > 0) { showHtml = "
{%trans "copy employee information"%}
"; showHtml += '
'; showHtml += "
从    " + createSelectHtml(url.ss) + "
"; showHtml += '
{%trans "copy the following fields"%}:
'; arrCopyFields = options.copyFields.split(',') showHtml += "
" + createCheckBoxHtml(arrCopyFields,1) + "
"; showHtml += "
{%trans "To your choice in front of the other transaction"%}
"; showHtml += createSubmitButton(); showHtml += "
"; $.blockUI(showHtml); blockUI_center(); var strCopyFields = "" $("#sltShow").keypress(function(){ $("#sltShow").change(); }) $("#sltShow").change(function(){ strCopySource = document.getElementById("sltShow").value if (strCopySource) {//取该记录的可复制信息 var ajaxUrl = "?getCopyInfo=" + strCopySource; $.ajax({type: "GET", url: ajaxUrl, dataType:"json", success: function(data){ for (var row in arrCopyFields) { fieldName = arrCopyFields[row].split(":")[0] objData = document.getElementById("spanShow_" + row + "_value") objChk = document.getElementById("chkShow_" + row) if (data[fieldName] && data[fieldName]!='None') { objData.innerHTML = data[fieldName]; if (!objChk.checked) objChk.click(); } else { objData.innerHTML = "{%trans "null"%}"; if (objChk.checked) objChk.click(); } } } }); } else { for (var row in arrCopyFields) {//沒做选择 obj = document.getElementById("spanShow_" + row + "_value") obj.innerHTML = "" for (var row in arrCopyFields) { objChk = document.getElementById("chkShow_" + row) if (objChk.checked) objChk.click(); } } } }) $("#btnShowOK").click(function(){ strCopyFields = "" for (var row in arrCopyFields) { var obj = document.getElementById("chkShow_" + row) if (obj.checked) { strCopyFields += "," + obj.value } } if (!strCopyFields) { alert("{%trans "You have no choice any character, for copying data"%}.") $.unblockUI(); } else { strCopyFields = strCopyFields.substring(1) strCopySource = document.getElementById("sltShow").value if (strCopySource == "") { alert("{%trans "You have no source of data, select"%}."); return false; } $.unblockUI(); a = '?action=copy&source=' + strCopySource + "&fields=" + strCopyFields; window.location.href = a +"&p="+page_index+url.ret } }) } else { alert("{%trans "You have to choose at least two employee"%}"); return false; } } function actionToDevWithin(url, keys) { var fromTime=$("#id_date_range_from").val(); var toTime=$("#id_date_range_to").val(); urlStr=getQueryStr(window.location.href, ["action"], '?action=toDevWithin&SN='+keys+'&start='+fromTime+'&end='+toTime); if('1null'=="1"+keys) { alert(gettext("Must select a device!")) return; } if(toTime!="") { if(toTime.length<10 && toTime.indexOf("-")==-1){ alert(gettext("Must input a valid date!")); return} } $.ajax({type: "POST", url: urlStr, data: url.ret, dataType:"text", success: actionSuccess, error: function(){alert(String.format(gettext('Operating failed for {0} !'),options.title)); $.unblockUI();} }); } function doAction(url, action) { if (action == 'toDev') createDialog(url, '?action=toDev&SN=', "miniData?key=SN", "{%trans "Transfer employee to the device"%}", "{%trans "device"%}", 350, 1); if (action == 'toDevWithin') { createDateRangeDlg("{%trans "Transfer employee to the device temporarily"%}") var sns=createMiniSel(true) $(".dialog table").after("
{%trans 'Transfer employee to the device' %}:
"+sns); if(procMiniData("miniData?key=SN")) { procSubmit("btnShowOK", url, actionToDevWithin) } } else if (action == 'delDev') createDialog(url, '?action=delDev&SN=', "miniData?key=SN", "{%trans "Deleted employee from the device"%}", "{%trans "device"%}", 350, 1); else if (action == 'toDepart') createDialog(url, '?action=dept&department=', "miniData?key=depart", "{%trans "Change employee's department"%}", "{%trans "department"%}", 350, 1); else if (action == 'mvToDev') createDialog(url, '?action=mvToDev&SN=', "miniData?key=SN", "{%trans "Change the employee's registration device"%}", "{%trans "new device"%}", 350, 1); } extraBatchOp=[ {action:{% if user|HasPerm:"iclock.toDev_employee" %}function(url){doAction(url, 'toDev')}{% else %}''{% endif %}, title: '{%trans "Transfer employee to the device"%}'}, //{action:{% if user|HasPerm:"iclock.toDevWithin_employee" %}function(url){doAction(url, 'toDevWithin')}{% else %}''{% endif %}, title: '{%trans "Transfer to the device temporarily"%}'}, {action:{% if user|HasPerm:"iclock.delDev_employee" %}function(url){doAction(url, 'delDev')}{% else %}''{% endif %}, title:'{%trans "Delete employee from the device"%}'}, //{action:{% if user|HasPerm:"iclock.empLeave_employee" %}'?action=empLeave'{% else %}''{% endif %}, title: '{%trans "Employee leave"%}'}, {action:{% if user|HasPerm:"iclock.mvToDev_employee" %}function(url){doAction(url, 'mvToDev')}{% else %}''{% endif %}, title: "{%trans "Move employee to a new device"%}"}, {action:{% if user|HasPerm:"iclock.toDepart_employee" %}function(url){doAction(url, 'toDepart')}{% else %}''{% endif %}, title: "{%trans "Change employee's department"%}"}, {action:{% if user|HasPerm:"iclock.enroll_employee" %}'?action=enroll'{% else %}''{% endif %}, title: "{%trans "Enroll employee's fingerprint"%}"} ]; function getMoreInfo(index){ return "{% trans "Emp name" %}:"+data[index][2] +"
{% trans "department number" %}:"+data[index][3] +"
{% trans "department name" %}:"+data[index][4] +"
{% trans "Sex" %}:"+(data[index][5]=="None"?"":data[index][5]) +"
{% trans "Birthday" %}:"+(data[index][6]=="None"?"":data[index][6]) +"
{% trans "Nationality" %}:"+(data[index][7]=="None"?"":data[index][7]) +"
{% trans "Title" %}:"+(data[index][8]=="None"?"":data[index][8]) +"
{% trans "Office phone" %}:"+(data[index][9]=="None"?"":data[index][9]) +"
{% trans "Mobile" %}:"+(data[index][10]=="None"?"":data[index][10]) +"
{% trans "Id card" %}:"+data[index][11] +"
{% trans "FP" %}:"+data[index][15] +"
{% trans "Left" %}:"+data[index][16] } function showBox(data) { var html=""; if(data.length>0) { for(var i=0;i" +"
" +"" +""+img +data[i][2] +"
" +"
" +""+data[i][1]+"
" +data[i][4]+"
" +"{%trans "Registration device"%}: " +""+data[i][12]+"
" +"{%trans "Transactions"%}: "+data[i][17]+"
" +'
' +"" } } else html+="
{%trans "No Employee!" %}
" return html; } options.disableCols=[0, 12, 13,16]; options.showStyle=true; function deviceText(data) { if(data[12]!="") return ""+data[13]+""; return ""; } {% endblock %} {% block rowdata %} {% for item in latest_item_list %} ["{{ item.id }}", "{{ item.PIN }}", "{{ item.EName }}", "{{ item.Dept.DeptID }}", "{{ item.Dept.DeptName }}", "{{ item.get_Gender_display }}", "{{ item.Birthday|shortDate4 }}", "{{ item.National }}","{{ item.Title }}","{{ item.Tele }}","{{ item.Mobile }}","{{ item.Card }}","{{ item.Device.SN }}","{{ item.Device }}", deviceText, {{ item.fpCount }}, "{{ item.get_OffDuty_display }}", "{%trans "view"%}","{{item|thumbnailUrl}}"]{%if not forloop.last%},{%endif%} {% endfor %} {% endblock %} {% block extraSection %} {%trans "The Total Number Of FingerTemp:"%}{{ fpcount }} {% endblock %}