|
@@ -0,0 +1,275 @@
|
|
|
+define(function (require) {
|
|
|
+ return function (context) {
|
|
|
+
|
|
|
+ var $grid1, $form;
|
|
|
+
|
|
|
+ // 弹框的方式
|
|
|
+ var widgets = {
|
|
|
+ // 搜索分类检索
|
|
|
+ selectTableUnit: {
|
|
|
+ url: 'app/whepi/home/selectLYbumen.js',
|
|
|
+ bind: {
|
|
|
+ unitId: 'unitId',
|
|
|
+ unit: 'unit',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 导出
|
|
|
+ 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),
|
|
|
+ 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 = '/sweepCode/selectCodeLY';// 自行替换此参数
|
|
|
+ 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: 'hidden', name: 'unitId'},
|
|
|
+ {
|
|
|
+ xtype: 'searchbox',
|
|
|
+ label: '部门',
|
|
|
+ name: 'unit',
|
|
|
+ prompt: "部门",
|
|
|
+ width: '300px',
|
|
|
+ widget: widgets.selectTableUnit,// 弹出框方法
|
|
|
+ labelWidth: '70px',
|
|
|
+ onChange: function (value) {
|
|
|
+ if (!isNotNullOrEmpty(value)) {
|
|
|
+ $form.formSet({
|
|
|
+ unitId: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ 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;
|
|
|
+ // }*/
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ ]]
|
|
|
+ };
|
|
|
+
|
|
|
+ var gridToolbarTitle = '签到列表';// 自行替换此参数
|
|
|
+ var gridToolbar = {
|
|
|
+ xtype: 'toolbar',
|
|
|
+ title: gridToolbarTitle,
|
|
|
+ items: [
|
|
|
+ {
|
|
|
+ text: '导出', iconCls: 'fa fa-cloud-upload', onClick: function () {
|
|
|
+ exportExcel();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ };
|
|
|
+
|
|
|
+ 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: 'ridgepole', title: '楼栋', maxWidth: 200, align: 'left',},
|
|
|
+ {field: 'unit', title: '部门', maxWidth: 200,},
|
|
|
+ {
|
|
|
+ field: 'doorplate',
|
|
|
+ title: '工号', maxWidth: 200,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'linkman',
|
|
|
+ title: '用户名',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'phone',
|
|
|
+ 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: 'errorInfo',
|
|
|
+ title: '禁止提示',
|
|
|
+ align: 'left',
|
|
|
+ },
|
|
|
+ {field: 'longitude', title: '经度', maxWidth: 200, align: 'left',},
|
|
|
+ {field: 'latitude', title: '纬度', maxWidth: 200, align: 'left',},
|
|
|
+ {field: 'address', title: '详细地址', maxWidth: 200, align: 'left',},
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ };
|
|
|
+ }
|
|
|
+);
|