|
@@ -1,7 +1,7 @@
|
|
|
define(function (require) {
|
|
|
return function (context) {
|
|
|
|
|
|
- var $grid1, $form;
|
|
|
+ var $grid1, $form, $coma;
|
|
|
|
|
|
// 弹框的方式
|
|
|
var widgets = {
|
|
@@ -15,13 +15,48 @@ define(function (require) {
|
|
|
},
|
|
|
}
|
|
|
|
|
|
+ // 下拉选清空并重新赋值
|
|
|
+ function reloadValuea(_datas) {
|
|
|
+ if ($coma) {
|
|
|
+ $coma.combobox('clear');// 清除当前的选项
|
|
|
+ $coma.combobox('loadData', _datas);// 重新加载数据
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取联机下拉选二级信息
|
|
|
+ function getList(id) {
|
|
|
+ id = id == undefined ? 0 : id
|
|
|
+ var _datas = [];
|
|
|
+ _datas.push({
|
|
|
+ "id": "",
|
|
|
+ "text": "全部",
|
|
|
+ "selected": true
|
|
|
+ });
|
|
|
+ $.yvan.ajax({
|
|
|
+ url: api('/home/getDepartmentIdLYepi.json?unitId=' + id),
|
|
|
+ method: 'GET',
|
|
|
+ async: true,
|
|
|
+ success: function (data) {
|
|
|
+ if (data.data != null && data.data != undefined) {
|
|
|
+ for (var i = 0; i < data.data.length; i++) {
|
|
|
+ _datas.push({
|
|
|
+ "id": data.data[i].departmentId,
|
|
|
+ "text": data.data[i].departmentName
|
|
|
+ })
|
|
|
+ }
|
|
|
+ reloadValuea(_datas);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return _datas;
|
|
|
+ }
|
|
|
|
|
|
// 导出
|
|
|
function exportExcel() {
|
|
|
var queryForm = $form.formGet();
|
|
|
$.yvan.download({
|
|
|
method: 'post',
|
|
|
- url: api('/sweepCode/exportLY?queryProperties=' + queryForm.queryProperties + '&errorInfo=' + queryForm.errorInfo + '&phone=' + queryForm.phone + '&unitId=' + queryForm.unitId + '&goStatus=' + queryForm.goStatus + '&dateSta=' + queryForm.dateSta + '&dateEnd=' + queryForm.dateEnd),
|
|
|
+ url: api('/clock/exSelectClockLY?phone=' + queryForm.phone + '&unitId=' + queryForm.unitId + '&departmentId=' + queryForm.departmentId + '&dateSta=' + queryForm.dateSta + '&dateEnd=' + queryForm.dateEnd),
|
|
|
fileName: '签到管理-' + $.yvan.getMoment().format('YYYY-MM-DD HH:mm:ss') + '.xlsx'
|
|
|
|
|
|
});
|
|
@@ -52,7 +87,7 @@ define(function (require) {
|
|
|
|
|
|
// 检索条件查询
|
|
|
function queryGrid1() {
|
|
|
- var queryUrl = '/sweepCode/selectCodeLY';// 自行替换此参数
|
|
|
+ var queryUrl = '/clock/selectClockLY';// 自行替换此参数
|
|
|
var queryForm = $form.formGet();
|
|
|
if (!queryForm.dateSta) {
|
|
|
$form.formSet({dateSta: getFormatDate() + " 00:00:00"});
|
|
@@ -98,14 +133,14 @@ define(function (require) {
|
|
|
},
|
|
|
xtype: 'form',
|
|
|
items: [[
|
|
|
- {
|
|
|
- xtype: 'textbox',
|
|
|
- label: '大门名称',
|
|
|
- name: 'queryProperties',
|
|
|
- prompt: "大门名称",
|
|
|
- labelWidth: 'auto',
|
|
|
- events: {keydown: enterQueryGrid1}, width: 250
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // xtype: 'textbox',
|
|
|
+ // label: '大门名称',
|
|
|
+ // name: 'queryProperties',
|
|
|
+ // prompt: "大门名称",
|
|
|
+ // labelWidth: 'auto',
|
|
|
+ // events: {keydown: enterQueryGrid1}, width: 250
|
|
|
+ // },
|
|
|
{
|
|
|
xtype: 'textbox',
|
|
|
label: '姓名/电话',
|
|
@@ -126,42 +161,61 @@ define(function (require) {
|
|
|
onChange: function (value) {
|
|
|
if (!isNotNullOrEmpty(value)) {
|
|
|
$form.formSet({
|
|
|
- unitId: ''
|
|
|
+ unitId: 0
|
|
|
})
|
|
|
}
|
|
|
+ var unitId = $form.formGet().unitId;
|
|
|
+ getList($form.formGet().unitId);
|
|
|
queryGrid1();
|
|
|
},
|
|
|
+ },
|
|
|
+ {
|
|
|
+ xtype: 'combobox',
|
|
|
+ label: '二级部门',
|
|
|
+ name: 'departmentId',
|
|
|
+ labelWidth: 'auto',
|
|
|
+ width: 280,
|
|
|
+ value: '',
|
|
|
+ data: getList(),
|
|
|
+ onRender: function () {
|
|
|
+ $coma = $(this);
|
|
|
+ },
|
|
|
+ onValue: function (data) {
|
|
|
+ },
|
|
|
+ onChange: function () {
|
|
|
+ queryGrid1();
|
|
|
+ }
|
|
|
},],[
|
|
|
- // {
|
|
|
- // xtype: 'datetimebox',
|
|
|
- // name: 'dateSta',
|
|
|
- // label: '进出时间',
|
|
|
- // labelWidth: 'auto',
|
|
|
- // width: 230,
|
|
|
- // onChange: function (data) {
|
|
|
- // /* var expDateStart = $form.formGet().nextRepairDate;
|
|
|
- // var expDateEnd = $form.formGet().expDateEnd;
|
|
|
- // var expDateStart = new Date(expDateStart.replace("-", "/"));
|
|
|
- // var expDateEnd = new Date(expDateEnd.replace("-", "/"));
|
|
|
- // if (expDateStart > expDateEnd) {
|
|
|
- // $.yvan.msg('起止日期必须大于起始日期');
|
|
|
- // return;
|
|
|
- // }*/
|
|
|
- // }
|
|
|
- // },
|
|
|
- // {
|
|
|
- // xtype: 'datetimebox', label: '--', name: 'dateEnd', labelWidth: 'auto', width: 220,
|
|
|
- // onChange: function (data) {
|
|
|
- // /* var expDateStart = $form.formGet().nextRepairDate;
|
|
|
- // var expDateEnd = $form.formGet().expDateEnd;
|
|
|
- // var expDateStart = new Date(expDateStart.replace("-", "/"));
|
|
|
- // var expDateEnd = new Date(expDateEnd.replace("-", "/"));
|
|
|
- // if (expDateStart > expDateEnd) {
|
|
|
- // $.yvan.msg('起止日期必须大于起始日期');
|
|
|
- // return;
|
|
|
- // }*/
|
|
|
- // }
|
|
|
- // }
|
|
|
+ {
|
|
|
+ xtype: 'datetimebox',
|
|
|
+ name: 'dateSta',
|
|
|
+ label: '进出时间',
|
|
|
+ labelWidth: 'auto',
|
|
|
+ width: 230,
|
|
|
+ onChange: function (data) {
|
|
|
+ /* var expDateStart = $form.formGet().nextRepairDate;
|
|
|
+ var expDateEnd = $form.formGet().expDateEnd;
|
|
|
+ var expDateStart = new Date(expDateStart.replace("-", "/"));
|
|
|
+ var expDateEnd = new Date(expDateEnd.replace("-", "/"));
|
|
|
+ if (expDateStart > expDateEnd) {
|
|
|
+ $.yvan.msg('起止日期必须大于起始日期');
|
|
|
+ return;
|
|
|
+ }*/
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ xtype: 'datetimebox', label: '--', name: 'dateEnd', labelWidth: 'auto', width: 220,
|
|
|
+ onChange: function (data) {
|
|
|
+ /* var expDateStart = $form.formGet().nextRepairDate;
|
|
|
+ var expDateEnd = $form.formGet().expDateEnd;
|
|
|
+ var expDateStart = new Date(expDateStart.replace("-", "/"));
|
|
|
+ var expDateEnd = new Date(expDateEnd.replace("-", "/"));
|
|
|
+ if (expDateStart > expDateEnd) {
|
|
|
+ $.yvan.msg('起止日期必须大于起始日期');
|
|
|
+ return;
|
|
|
+ }*/
|
|
|
+ }
|
|
|
+ }
|
|
|
]]
|
|
|
};
|
|
|
|
|
@@ -180,7 +234,7 @@ define(function (require) {
|
|
|
|
|
|
return {
|
|
|
north: {
|
|
|
- height: 88,
|
|
|
+ height: 132,
|
|
|
/* split: true,
|
|
|
border: false,*///底框是否可变动
|
|
|
items: [
|
|
@@ -209,10 +263,7 @@ define(function (require) {
|
|
|
// {field: 'uptownName', title: '小区名称', maxWidth: 200, align: 'left',},
|
|
|
// {field: 'ridgepole', title: '楼栋', maxWidth: 200, align: 'left',},
|
|
|
{field: 'unit', title: '部门', maxWidth: 200,},
|
|
|
- {
|
|
|
- field: 'doorplate',
|
|
|
- title: '工号', maxWidth: 200,
|
|
|
- },
|
|
|
+ {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
|
|
|
{
|
|
|
field: 'linkman',
|
|
|
title: '用户名',
|
|
@@ -222,49 +273,22 @@ define(function (require) {
|
|
|
title: '电话',
|
|
|
},
|
|
|
{
|
|
|
- field: 'doorName',
|
|
|
- title: '出入大门',
|
|
|
- align: 'left',
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'date',
|
|
|
- title: '进出时间',
|
|
|
- align: 'left',
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'inType',
|
|
|
- title: '记录状态',
|
|
|
- align: 'center',
|
|
|
- formatter:function (value) {
|
|
|
- if(value==1){
|
|
|
- return "进入"
|
|
|
- }else if(value ==2){
|
|
|
- return "外出"
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'goStatus',
|
|
|
- title: '通行状态',
|
|
|
- align: 'center',
|
|
|
- formatter:function (value) {
|
|
|
- if(value==1){
|
|
|
- return "允许"
|
|
|
- }else if(value ==-1){
|
|
|
- return "禁止"
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+ field: 'doorplate',
|
|
|
+ title: '工号', maxWidth: 200,
|
|
|
},
|
|
|
+ // {
|
|
|
+ // field: 'doorName',
|
|
|
+ // title: '出入大门',
|
|
|
+ // align: 'left',
|
|
|
+ // },
|
|
|
{
|
|
|
- field: 'errorInfo',
|
|
|
- title: '禁止提示',
|
|
|
+ field: 'dateStr',
|
|
|
+ title: '签到时间',
|
|
|
align: 'left',
|
|
|
},
|
|
|
- {field: 'longitude', title: '经度', maxWidth: 200, align: 'left',},
|
|
|
- {field: 'latitude', title: '纬度', maxWidth: 200, align: 'left',},
|
|
|
- {field: 'address', title: '详细地址', maxWidth: 200, align: 'left',},
|
|
|
+ // {field: 'longitude', title: '经度', maxWidth: 200, align: 'left',},
|
|
|
+ // {field: 'latitude', title: '纬度', maxWidth: 200, align: 'left',},
|
|
|
+ // {field: 'address', title: '详细地址', maxWidth: 200, align: 'left',},
|
|
|
]
|
|
|
]
|
|
|
}
|