define(function (require) { return function (context) { var $dlg, $grid1, $form; // 输入搜索文本后点击回车按钮查询列表 function enterQueryGrid1(e) { if (e.keyCode === 13) { var tmp = $(this).val(); $form.formSet({queryProperties: tmp}); queryGrid1(); } } function queryGrid() { $grid1.jqGrid("clearGridData"); var queryForm = $form.formGet(); $grid1.reload({ mtype: 'POST', url: api('/sys/importExcel/getAllPeopleInfo'), queryParams: queryForm }, true); } var queryToolbar = { xtype: 'toolbar', title: '需求统计', items: [ { text: '查询', iconCls: 'fa fa-search', onClick: function () { queryGrid(); } }, { text: '重置', iconCls: 'fa fa-refresh', onClick: function () { $form.formClear(); queryGrid(); } }, { text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () { $dlg.window('close'); } } ] }; // 搜索条件 var queryForm = { onRender: function () { $form = $(this); }, xtype: 'form', items: [[ { xtype: 'textbox', label: '检索条件', name: 'queryProperties', prompt: '小区', labelWidth: 'auto', events: {keydown: enterQueryGrid1}, width: 350 }, ]] }; // 列表2增删改查按钮 var gridToolbar2 = { xtype: 'toolbar', title: '需求列表', items: [ { text: '导出excel', iconCls: 'fa fa-external-link-square', onClick: function () { $.yvan.download({ method: 'get', url: api('/sys/importExcel/errorPeopleInfo'), fileName: '人员基本信息错误数据-' + $.yvan.getMoment().format('YYYY-MM-DD HH:mm:ss') + '.xlsx' }); } }, ] }; return { xtype: 'dialog', dialogId: 'dialogimport', title: '', width: '100%', height: '100%', onOpen: function () { $dlg = $(this); queryGrid(); }, north: { height: 90, split: true, border: false, items: [ queryToolbar, queryForm ] }, center: { border: false, items: { onRender: function () { $grid1 = $(this); }, autoSizeColumns: true, xtype: 'grid', toolbar: gridToolbar2, idField: 'peopleId', columns: [[ {field: 'peopleId', hidden: true}, {field: 'excelNum', title: '序号', align: "right", maxWidth: 100, }, {field: 'peopleCode', title: '小区名称', minWidth: 100, maxWidth: 200}, {field: 'name', title: '楼栋', minWidth: 100, maxWidth: 200}, {field: 'nativePlace', title: '单元', minWidth: 100, maxWidth: 200}, {field: 'birthday', title: '门牌号', minWidth: 100, maxWidth: 200}, {field: 'joIdAffiliated', title: '数量', minWidth: 100, maxWidth: 200}, {field: 'joIdCode', title: '联系方式', minWidth: 100, maxWidth: 200}, {field: 'phone', title: '需求备注', minWidth: 100, maxWidth: 200}, ]], } } }; }; });