123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365 |
- define(function (require) {
- return function (context) {
- var $grid,$grid2, $form;
- // 输入搜索文本后点击回车按钮查询列表
- function enterQueryGrid1(e) {
- if (e.keyCode === 13) {
- var tmp = $(this).val();
- $form.formSet({queryProperties: tmp});
- queryGrid1();
- }
- }
- // 查询列表
- function queryGrid1() {
- var queryUrl = '/home/queryRibaoTest';// 自行替换此参数
- $grid.jqGrid("clearGridData");
- var queryForm = $form.formGet();
- $grid.reload({
- mtype: 'get',
- url: api(queryUrl),
- queryParams: queryForm
- });
- }
- function queryGrid2(rowid) {
- var row = $grid.rowData(rowid);
- if (!row) {
- $.yvan.msg('请先选择一行数据');
- return;
- }
- var queryUrl = '/home/queryRibaoTestxq';// 自行替换此参数
- var queryForm = $form.formGet();
- queryForm.reportId = row.reportId;
- queryForm.reportDate = row.reportDate;
- $grid2.reload({
- mtype: 'get',
- url: api(queryUrl),
- queryParams: queryForm
- }, true);
- }
- //删除
- function deleteRow1() {
- var row = $grid.rowData();
- if (!row) {
- $.yvan.msg('请先选择一行数据');
- return;
- }
- $.yvan.confirm('确定上报[' + row.reportDate + "] ?", {
- yes: function (index) {
- $.yvan.ajax({
- url: api('/home/shaobaoReport'),
- data: {
- reportDate: row.reportDate,
- },
- method: 'post',
- success: function (data) {
- $.yvan.msg(data.msg);
- $grid.reload();
- $grid2.reload();
- }
- });
- }
- });
- }
- // 搜索按钮
- 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: 'yvselect',
- label: '上报状态',
- name: 'reportStatus',
- labelWidth: 'auto',
- width: 200,
- data: [
- {id: '', text: '全部'},
- {id: '0', text: '未上报'},
- {id: '1', text: '已上报'},
- ],
- onChange: function (data) {
- queryGrid1();
- },
- },
- ]
- ]
- };
- // 列表增删改查按钮
- var gridToolbarTitle = '上报列表';
- var gridToolbar = {
- xtype: 'toolbar', title: gridToolbarTitle,items: [
- {
- text: '上报', iconCls: 'fa fa-pencil-square-o', onClick: function () {
- deleteRow1();
- }
- }
- ]
- }
- return {
- center: {
- border: false,
- items: {
- onRender: function () {
- $grid = $(this);
- queryGrid1();
- },
- xtype: 'grid',
- idField: "reportId",
- pagination: false,
- toolbar: {
- xtype: 'div',
- items: [
- queryToolbar,
- queryForm,
- gridToolbar
- ]
- },
- columns: [[
- {title: '账号ID', field: 'reportId', hidden: true},
- {title: '上报日期', field: 'reportDate'},
- {
- title: '上报状态', field: 'reportStatus', formatter: function (value) {
- if (value == 0)
- return "未上报";
- else
- return "<span style='color:green'>已上报</span>";
- }
- },
- {
- title: '异常状态', field: 'msStatus', formatter: function (value) {
- if (value == 1)
- return "<span style='color:green'>正常</span>";
- if (value == 2)
- return "<span style='color:red'>异常</span>";
- }
- },
- {title: '居家人数', field: 'safetyNum'},
- {title: '确诊人数', field: 'sureNum'},
- {title: '疑似人数', field: 'suspectedNum'},
- {title: '正常人数', field: 'normalNum'},
- {title: '隔离人数', field: 'singleNum'},
- {title: '新增人', field: 'userCreateName'},
- {title: '新增时间', field: 'timeCreate', formatter: 'ts'},
- {title: '更新人', field: 'userUpdateName'},
- {title: '更新时间', field: 'timeUpdate', formatter: 'ts'}
- ]],
- onSelectRow: function (rowid) {
- var row = $grid.rowData(rowid);
- if (!row) {
- $.yvan.msg('请先选择一行数据');
- return;
- }
- clearGrid($grid2);
- queryGrid2(rowid);
- }
- }
- },
- south:
- {
- height: '40%',
- border: false,
- items:
- {
- onRender: function () {
- $grid2 = $(this);
- },
- xtype: 'grid',
- toolbar:
- {
- xtype: 'div',
- items: [{
- xtype: 'toolbar', title: '详情列表',
- items: [{
- text: '编辑上报信息', iconCls: 'fa fa-pencil-square-o', onClick: function () {
- var row = $grid2.rowData();
- if (!row) {
- $.yvan.msg('请先选择一行数据');
- return;
- }
- $.yvan.showDialog(this,
- require('/app/whepi/lingyun/dialogLiaodan.js')({
- isEdit: true,
- row: row,
- confirm: function () {
- $grid2.reload();
- }
- })
- );
- }
- }]
- }],
- },
- autoSizeColumns: true,
- sortable: true,
- pagination: false,
- columns:
- [
- [{title: '疑似ID', field: 'suspectedId', hidden: true},
- {title: '性别', field: 'grender', hidden: true},
- {title: '新冠肺炎', field: 'medical', hidden: true},
- {title: '咳嗽现象', field: 'cough', hidden: true},
- {title: '肌肉酸疼', field: 'muscle', hidden: true},
- {title: '呼吸困难', field: 'dyspnea', hidden: true},
- {title: '乏力现象', field: 'fatigue', hidden: true},
- {title: '腹泻现象', field: 'diarrhea', hidden: true},
- {title: '姓名', field: 'userName'},
- {
- title: '性别', field: 'grenderStr', formatter: function (value) {
- if (value == 1)
- return "男";
- else
- return "女";
- }
- },
- {
- title: '岁数', field: 'age'
- },
- {title: '基本情况', field: 'familyStatus'},
- {title: '本人身体情况', field: 'medicalStr',formatter:function(value){
- if(value == 0){
- return "正常"
- }else if(value == 1){
- return "异常"
- }else if(value == 2){
- return "疑似"
- }else if(value == 3){
- return "有接触史"
- }else if(value == 4){
- return "解除隔离"
- }
- }},
- {title: '体温', field: 'temperature'},
- {title: '咳嗽现象', field: 'coughStr',formatter:function(value){
- if(value == 0){
- return "无咳嗽"
- }else if(value == 1){
- return "偶有短暂咳嗽"
- }else if(value == 2){
- return "咳嗽轻度影响生活"
- }else if(value == 3){
- return "咳嗽严重影响生活"
- }
- }},
- {title: '肌肉酸疼', field: 'muscleStr',formatter:function(value){
- if(value == 0){
- return "无"
- }else if(value == 1){
- return "按压有"
- }else if(value == 2){
- return "偶尔"
- }else if(value == 3){
- return "持续有"
- }
- }},
- {title: '呼吸困难', field: 'dyspneaStr',formatter:function(value){
- if(value == 0){
- return "无"
- }else if(value == 1){
- return "急走或上坡气短"
- }else if(value == 2){
- return "气短而走路变慢"
- }else if(value == 3){
- return "走路数分钟后气短"
- }else if(value == 4){
- return "气短无法离开房间"
- }
- }},
- {title: '乏力现象', field: 'fatigueStr',formatter:function(value){
- if(value == 0){
- return "无"
- }else if(value == 1){
- return "体力劳动后不能恢复"
- }else if(value == 2){
- return "轻体力活非常累"
- }else if(value == 3) {
- return "不能正常生活"
- }
- }},
- {title: '腹泻现象', field: 'diarrheaStr',formatter:function(value){
- if(value == 0){
- return "无"
- }else if(value == 1){
- return "轻度腹泻少于于3次"
- }else if(value == 2){
- return "中度腹泻4-6次"
- }else if(value == 3) {
- return "3重度腹泻超过6次"
- }
- }},
- {title: '其它描述', field: 'others'},
- {title: '工作驻地', field: 'workLocalOther',hidden: true},
- {title: '工作驻地', field: 'workLocal',hidden: true},
- {title: '工作驻地', field: 'workLocalOtherStr'},
- {title: '今晚驻地', field: 'todayLocalOther',hidden: true},
- {title: '今晚驻地', field: 'todayLocal',hidden: true},
- {title: '今晚驻地', field: 'todayLocalOtherStr'},
- {title: '是否出行', field: 'isTrip',hidden: true},
- {title: '是否出行', field: 'isTripStr',formatter:function(value){
- if(value == 0){
- return "否"
- }else if(value == 1){
- return "是"
- }
- }},
- {title: '出发地', field: 'startLocalOther',hidden: true},
- {title: '出发地', field: 'startLocal',hidden: true},
- {title: '出发地', field: 'startLocalOtherStr'},
- {title: '目的地', field: 'endLocalOther',hidden: true},
- {title: '目的地', field: 'endLocal',hidden: true},
- {title: '目的地', field: 'endLocalOtherStr'},
- {title: '车次/车牌号/航班', field: 'tripTypeDesp'},
- {title: '出行方式', field: 'tripTypeStr',formatter:function(value){
- if(value == 1){
- return "长途汽车"
- }else if(value == 2){
- return "火车"
- }else if(value == 3){
- return "飞机"
- }else if(value ==undefined){
- return ""
- }else if(value ==null){
- return ""
- }else if(value ==""){
- return ""
- }
- }},
- {title: '出行方式', field: 'tripType',hidden: true},
- ]
- ]
- }
- }
- };
- };
- });
|