123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- define(function (require) {
- return function (context) {
- var $grid1, $form, $coma;
- // 导出
- function exportExcel() {
- var queryForm = $form.formGet();
- $.yvan.download({
- method: 'post',
- url: api('/clock/exSelectClockLY?queryProperties=' + queryForm.queryProperties + '&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'
- });
- }
- // 输入搜索文本后点击回车按钮查询列表
- function enterQueryGrid1(e) {
- if (e.keyCode === 13) {
- var tmp = $(this).val();
- $form.formSet({queryProperties: tmp});
- queryGrid1();
- }
- }
- function enterQueryGrid2(e) {
- if (e.keyCode === 13) {
- var tmp = $(this).val();
- $form.formSet({phone: tmp});
- queryGrid1();
- }
- }
- function enterQueryGrid3(e) {
- if (e.keyCode === 13) {
- var tmp = $(this).val();
- $form.formSet({errorInfo: tmp});
- queryGrid1();
- }
- }
- // 检索条件查询
- function queryGrid1() {
- var queryUrl = '/clock/selectClockLY';// 自行替换此参数
- var queryForm = $form.formGet();
- if (!queryForm.dateSta) {
- $form.formSet({dateSta: getFormatDate() + " 00:00:00"});
- queryForm.dateSta = getFormatDate() + " 00:00:00";
- }
- if (!queryForm.dateEnd) {
- $form.formSet({dateEnd: getFormatDate() + " 23:59:59"});
- queryForm.dateEnd = getFormatDate() + " 23:59:59";
- }
- queryForm.roleCode = App.currentRoleCode;
- $grid1.reload({
- mtype: 'POST',
- url: api(queryUrl),
- queryParams: queryForm
- }, true);
- }
- // 搜索按钮
- var queryToolbarTitle = '签到管理';// 自行替换此参数
- var queryToolbar = {
- xtype: 'toolbar', title: queryToolbarTitle, items: [
- {
- text: '查询', iconCls: 'fa fa-search', onClick: function () {
- queryGrid1();
- }
- }, {
- text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
- $form.formClear();
- queryGrid1();
- }
- }, {
- text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
- App.closeMe(this);
- }
- }
- ]
- };
- // 搜索条件
- var queryForm = {
- onRender: function () {
- $form = $(this);
- },
- xtype: 'form',
- items: [[
- {
- xtype: 'textbox',
- label: '大门名称',
- name: 'queryProperties',
- prompt: "大门名称",
- labelWidth: 'auto',
- events: {keydown: enterQueryGrid1}, width: 250
- },
- {
- xtype: 'textbox',
- label: '姓名/电话',
- name: 'phone',
- prompt: "姓名/电话",
- labelWidth: 'auto',
- events: {keydown: enterQueryGrid2}, width: 250
- },
- {
- 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;
- }*/
- }
- }
- ],]
- };
- var gridToolbarTitle = '签到列表';// 自行替换此参数
- var gridToolbar = {
- xtype: 'toolbar',
- title: gridToolbarTitle,
- items: [
- {
- text: '导出', iconCls: 'fa fa-cloud-upload', onClick: function () {
- exportExcel();
- }
- },
- {
- text: '分单位统计考勤', iconCls: 'fa fa-cloud-upload', onClick: function () {
- var queryForm = $form.formGet();
- $.yvan.download({
- method: 'post',
- url: api('/clock/exClockCount?queryProperties=' + queryForm.queryProperties + '&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'
- });
- }
- },
- ]
- };
- return {
- north: {
- height: 88,
- /* split: true,
- border: false,*///底框是否可变动
- items: [
- queryToolbar,
- queryForm
- ]
- },
- center: {
- height: '60%',
- split: true,
- items:
- {
- onRender: function () {
- $grid1 = $(this);
- queryGrid1()
- },
- xtype: 'grid',
- toolbar:
- gridToolbar,
- idField: 'joId',
- autoSizeColumns: true,//序号多 正确显示
- columns:
- [
- [
- {field: 'uptownId', title: '小区id', maxWidth: 200, align: 'left', hidden: true},
- // {field: 'uptownName', title: '小区名称', maxWidth: 200, align: 'left',},
- {field: 'doorName', title: '出入大门', align: 'left',},
- {field: 'unit', title: '部门', maxWidth: 200,},
- {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
- {
- field: 'linkman',
- title: '用户名',
- },
- {
- field: 'phone',
- title: '电话',
- },
- {
- field: 'doorplate',
- title: '工号', maxWidth: 200,
- },
- {
- 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',},
- ]
- ]
- }
- }
- };
- };
- }
- );
|