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(); queryForm.jmId=context.jmId, $grid1.reload({ mtype: 'POST', url: api('/zhihuibu/tgDetail'), 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('/tuangou/member/list/exportList?jmId='+context.jmId+"&queryProperties="+queryForm.queryProperties), 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: 'uptownName', title: '小区名称', align: 'left'}, {field: 'ridgepole', title: '楼栋',align: 'left'}, {field: 'unit', title: '单元', align: 'left'}, {field: 'houseNumber', title: '门牌号', align: 'left'}, {field: 'buyCount', title: '数量',align: 'left'}, {field: 'phone', title: '联系方式', align: 'center'}, {field: 'myRemark', title: '需求备注', minWidth: 100, maxWidth: 200}, ]], } } }; }; });