123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- define(function (require) {
- return function (context) {
- var $grid1, $form;
- // 输入搜索文本后点击回车按钮查询列表
- function enterQueryGrid1(e) {
- if (e.keyCode === 13) {
- var tmp = $(this).val();
- $form.formSet({queryProperties: tmp});
- queryGrid1();
- }
- }
- // 弹框的方式
- var widgets = {
- // 搜索分类检索
- selectTableUnit: {
- url: 'app/whepi/home/selectLYbumen.js',
- bind: {
- unitId: 'unitId',
- unit: 'unit',
- },
- },
- };
- // 检索条件查询
- function queryGrid1() {
- var queryForm = $form.formGet();
- $grid1.reload({
- mtype: 'POST',
- url: api('/sweepCode/selectLingyunUser'),
- queryParams: queryForm
- }, true);
- }
- var queryToolbar = {
- xtype: 'toolbar',
- title: '用户管理',
- 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: 350
- },
- {xtype: 'hidden', name: 'unitId'},
- {
- xtype: 'searchbox',
- label: '部门',
- name: 'unit',
- prompt: "部门",
- width: '400px',
- widget: widgets.selectTableUnit,// 弹出框方法
- labelWidth: '120px',
- onChange: function (value) {
- if (!isNotNullOrEmpty(value)) {
- $form.formSet({
- unitId : ''
- })
- }
- queryGrid1();
- },
- },
- {
- name: 'date',
- label: '导出时间',
- prompt: '导出时间',
- xtype: 'datebox',
- labelWidth: 'auto',
- width: 250,
- },
- ]]
- };
- 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: {
- xtype: 'toolbar',
- title: '用户列表',
- items: [
- {
- text: '生成健康及旅居申请表', iconCls: 'fa fa-cloud-upload', onClick: function () {
- var row = $grid1.checkedData();
- if (row.length == 0) {
- $.yvan.msg('请至少选择一行数据');
- return;
- }
- var ids = "";
- for (var i = 0; i < row.length; i++) {
- ids += row[i].userId + ","
- }
- ids=ids.substring(0,ids.length-1);
- window.open(api('/export/lyReports?userId=' + ids));
- }
- },
- {
- text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-cloud-upload', onClick: function () {
- var row = $grid1.checkedData();
- if (row.length == 0) {
- $.yvan.msg('请至少选择一行数据');
- return;
- }
- var ids = "";
- for (var i = 0; i < row.length; i++) {
- ids += row[i].userId + ","
- }
- ids=ids.substring(0,ids.length-1);
- window.open(api('/export/lyApproves?userId=' + ids));
- }
- },
- {
- text: '导出人员报表', iconCls: 'fa fa-cloud-upload', onClick: function () {
- var queryProperties = $form.formGet().queryProperties;
- var unitId = $form.formGet().unitId;
- var date = $form.formGet().date;
- if ( date == null || date == "") {
- $.yvan.msg('请选择导出时间');
- return
- }
- window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId="+unitId + "&date="+date));
- }
- },
- {
- text: '查看人员上报情况', iconCls: 'fa fa-search', onClick: function () {
- var row = $grid1.rowData();
- if ( row == null || row == undefined || row.userId == null || row.userId == "") {
- $.yvan.msg('请选择数据');
- return
- }
- $.yvan.showDialog(this,
- require('/app/whepi/lingyun/dialogDetail.js')({
- userId: row.userId,
- linkman: row.linkman,
- confirm: function () {
- // $grid2.reload();
- }
- })
- );
- }
- },
- {
- text: '查看人员可复工状况', iconCls: 'fa fa-search', onClick: function () {
- var row = $grid1.rowData();
- if ( row == null || row == undefined || row.userId == null || row.userId == "") {
- $.yvan.msg('请选择数据');
- return
- }
- $.yvan.showDialog(this,
- require('/app/whepi/lingyun/dialogFugong.js')({
- userId: row.userId,
- confirm: function () {
- // $grid2.reload();
- }
- })
- );
- }
- },
- ]
- },
- multiselect: true, /// 表格多选
- idField: 'userId',
- editable: true,
- editOnSelected: true,
- autoSizeColumns: true,
- columns:
- [
- [
- {field: 'userId', title: '用户ID', hidden: true},
- {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
- {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
- {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
- {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
- {field: 'bingqingDesc', title: '病情表述', maxWidth: 200, align: 'left',},
- {field: 'workLoalDesc', title: '工作驻地', maxWidth: 200, align: 'left',},
- {field: 'todayLoalDesc', title: '今晚住地', maxWidth: 200, align: 'left',},
- {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
- {field: 'tripDetDesc', title: '出行详细', align: 'left',},
- ]
- ]
- }
- }
- };
- };
- }
- );
|