|
@@ -0,0 +1,197 @@
|
|
|
+define(function (require) {
|
|
|
+ return function (context) {
|
|
|
+
|
|
|
+ var $grid1, $form;
|
|
|
+
|
|
|
+
|
|
|
+ // 导出
|
|
|
+ function exportExcel() {
|
|
|
+ var row = $grid1.rowData();
|
|
|
+ if (!row) {
|
|
|
+ $.yvan.msg('请先选择一行数据');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var queryForm = $form.formGet();
|
|
|
+ $.yvan.download({
|
|
|
+ method: 'post',
|
|
|
+ url: api('/sweepCode/export?queryProperties=' + queryForm.queryProperties + '&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 queryGrid1() {
|
|
|
+ var queryUrl = '/sweepCode/selectCode';// 自行替换此参数
|
|
|
+ var queryForm = $form.formGet();
|
|
|
+ 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 queryFormPrompt = '名称';// 自行替换此参数
|
|
|
+ var queryForm = {
|
|
|
+ onRender: function () {
|
|
|
+ $form = $(this);
|
|
|
+ },
|
|
|
+ xtype: 'form',
|
|
|
+ items: [[
|
|
|
+ {
|
|
|
+ xtype: 'textbox',
|
|
|
+ label: '小区名称',
|
|
|
+ name: 'queryProperties',
|
|
|
+ prompt: queryFormPrompt,
|
|
|
+ labelWidth: 'auto',
|
|
|
+ events: {keydown: enterQueryGrid1}, width: 350
|
|
|
+ },
|
|
|
+ {
|
|
|
+ xtype: 'datebox',
|
|
|
+ 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: 'datebox', label: '--', name: 'dateEnd', labelWidth: 'auto', width: 180,
|
|
|
+ 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: '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 "外出"
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ };
|
|
|
+ }
|
|
|
+);
|