123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540 |
- define(function (require) {
- return function (context) {
- var $grid1, $form, $coma;
- // 输入搜索文本后点击回车按钮查询列表
- function enterQueryGrid1(e) {
- if (e.keyCode === 13) {
- var tmp = $(this).val();
- $form.formSet({queryProperties: tmp});
- queryGrid1();
- }
- }
- // 获取联机下拉选二级信息
- function getList(id) {
- id = id == undefined ? 0 : id
- var _datas = [];
- _datas.push({
- "id": "",
- "text": "全部",
- "selected": true
- });
- $.yvan.ajax({
- url: api('/home/getDepartmentIdLYepi.json?unitId=' + id),
- method: 'GET',
- async: true,
- success: function (data) {
- if (data.data != null && data.data != undefined) {
- for (var i = 0; i < data.data.length; i++) {
- _datas.push({
- "id": data.data[i].departmentId,
- "text": data.data[i].departmentName
- })
- }
- reloadValuea(_datas);
- }
- }
- });
- return _datas;
- }
- // 下拉选清空并重新赋值
- function reloadValuea(_datas) {
- if ($coma) {
- $coma.combobox('clear');// 清除当前的选项
- $coma.combobox('loadData', _datas);// 重新加载数据
- }
- }
- // 弹框的方式
- 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: 200
- },
- {xtype: 'hidden', name: 'unitId'},
- {
- name: 'reportStatus',
- xtype: 'combobox',
- label: '是否上报',
- data: [{id: '', text: '全部'}, {id: '0', text: '有数据未上报'}, {id: '1', text: '已上报'}, {id: '2', text: '无数据'}],
- value: '',
- onChange: function (value) {
- queryGrid1();
- },
- },
- {
- xtype: 'searchbox',
- label: '部门',
- labelWidth: 'auto',
- name: 'unit',
- prompt: "部门",
- width: 250,
- widget: widgets.selectTableUnit,// 弹出框方法
- onChange: function (value) {
- if (!isNotNullOrEmpty(value)) {
- $form.formSet({
- unitId : 0
- })
- }
- getList($form.formGet().unitId);
- queryGrid1();
- },
- },
- {
- xtype: 'combobox',
- label: '二级部门',
- name: 'departmentId',
- labelWidth: 'auto',
- width: 280,
- value: '',
- data: getList(),
- onRender: function () {
- $coma = $(this);
- },
- onValue: function (data) {
- },
- onChange: function () {
- queryGrid1();
- }
- },
- {
- name: 'date',
- label: '导出时间',
- prompt: '导出时间',
- xtype: 'datebox',
- labelWidth: 'auto',
- width: 200,
- },],[
- {
- name: 'msStatus',
- xtype: 'combobox',
- label: '个人上报状态',
- data: [{id: '', text: '全部'}, {id: '1', text: '未上报'}, {id: '2', text: '正常'}, {id: '3', text: '异常'}],
- value: '',
- onChange: function (value) {
- queryGrid1();
- },
- },
- {
- name: 'isContact',
- xtype: 'combobox',
- label: '密切接触人员',
- data: [{id: '', text: '全部'}, {id: '1', text: '正常'}, {id: '2', text: '异常'}],
- value: '',
- onChange: function (value) {
- queryGrid1();
- },
- },
- {
- name: 'isSuspected',
- xtype: 'combobox',
- label: '家人健康异常',
- data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
- value: '',
- onChange: function (value) {
- queryGrid1();
- },
- },
- {
- name: 'isTrip',
- xtype: 'combobox',
- label: '是否出行',
- data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
- value: '',
- onChange: function (value) {
- queryGrid1();
- },
- },
- // {
- // name: 'isBand',
- // xtype: 'combobox',
- // label: '是否迁移',
- // data: [{id: '', text: '全部'}, {id: '1', text: '否'}, {id: '2', text: '是'}],
- // value: '',
- // onChange: function (value) {
- // queryGrid1();
- // },
- // },
- ]]
- };
- return {
- north: {
- height: 132,
- /* 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
- }
- var msStatus = $form.formGet().msStatus;
- var isContact = $form.formGet().isContact;
- var isSuspected = $form.formGet().isSuspected;
- var isTrip = $form.formGet().isTrip;
- var departmentId = $form.formGet().departmentId;
- window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId="+unitId + "&date="+date+
- '&msStatus='+msStatus+'&isContact='+isContact+'&isSuspected='+isSuspected+'&isTrip='+isTrip +'&departmentId=' + departmentId));
- }
- },
- {
- text: '导出正常复工人员', iconCls: 'fa fa-cloud-upload', onClick: function () {
- var unitId = $form.formGet().unitId;
- window.open(api('/returnWork/exReturnWork?unitId='+unitId));
- }
- },
- {
- 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/dialogDetail2.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();
- }
- })
- );
- }
- },
- {
- text: '查看人员接种记录', iconCls: 'fa fa-search', onClick: function () {
- var row = $grid1.rowData();
- if ( row == null || row == undefined || row.userId == null || row.userId == "") {
- $.yvan.msg('请选择数据');
- return
- }
- if ( row.inoculateStatus.indexOf("是") < 0) {
- $.yvan.msg('该员工没有接种新冠疫苗');
- return
- }
- $.yvan.showDialog(this,
- require('/app/whepi/lingyun/dialogVaccine.js')({
- userId: row.userId,
- linkman: row.linkman,
- confirm: function () {
- // $grid2.reload();
- }
- })
- );
- }
- },
- {
- name: 'file',
- text: '凭证上传',
- iconCls: 'fa fa-cloud-upload',
- // accept: 'image/jpeg,image/png',
- accept: {
- title: 'file',
- // extensions: 'jpg,mp4,pdf,png,ppt,doc,xls,docx,xlsx,pptx',
- // mimeTypes: 'image/jpeg,video/mp4,application/pdf,image/png,application/vnd.ms-powerpoint,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation'
- extensions: 'jpg,png',
- mimeTypes: 'image/jpeg,image/png'
- },
- onClick: function () {
- var row = $grid1.rowData();
- if ( row == null || row == undefined || row.userId == null || row.userId == "") {
- $.yvan.msg('请选择数据');
- return
- }
- $.yvan.showUploadWindow($(this), {
- url: api('/sweepCode/file/uploadVaccine'), //上传路径
- param: JSON.stringify({userId: row.userId, userName: row.linkman}),
- uploadSuccess: function (file) {
- //上传一个文件,成功之后的回调.
- //如果有多个文件会回调多次
- // console.log(file);
- }
- });
- }
- },
- {
- text: '查看人员凭证', iconCls: 'fa fa-search', onClick: function () {
- var row = $grid1.rowData();
- if ( row == null || row == undefined || row.userId == null || row.userId == "") {
- $.yvan.msg('请选择数据');
- return
- }
- if ( row.imgCount <= 0) {
- $.yvan.msg('该员工没有上传相关凭证');
- return
- }
- $.yvan.showDialog(this,
- require('/app/whepi/lingyun/dialogVaccineImage.js')({
- userId: row.userId,
- linkman: row.linkman,
- confirm: function () {
- }
- })
- );
- }
- },
- {
- text: '导出接种明细', iconCls: 'fa fa-cloud-upload', onClick: function () {
- var unitId = $form.formGet().unitId;
- var departmentId = $form.formGet().departmentId;
- if (unitId == null || unitId == "") {
- unitId = 0
- }
- if (departmentId == null || departmentId == "") {
- departmentId = 0
- }
- window.open(api('/sweepCode/exSelectVaccine?unitId='+unitId+'&departmentId='+departmentId));
- }
- },
- ]
- },
- multiselect: true, /// 表格多选
- idField: 'userId',
- editable: true,
- editOnSelected: true,
- autoSizeColumns: true,
- columns:
- [
- [
- {field: 'userId', title: '用户ID', hidden: true},
- {field: 'imgCount', hidden: true},
- {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
- {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
- {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
- {
- field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
- if (value == 1) {
- return "<span style='color: green;'>是<span>";
- } else if (value == 2) {
- return "<span style='color: red;'>否<span>";
- } else {
- return "";
- }
- }
- },
- {
- field: 'travelRecords', title: '出行轨迹', maxWidth: 100, align: 'center', formatter: function (value) {
- if (value == 1) {
- return "<span style='color: red;'>是<span>";
- } else if (value == 2) {
- return "<span style='color: green;'>否<span>";
- } else {
- return "";
- }
- }
- },
- {
- field: 'returnWork', title: '今日复工', maxWidth: 100, align: 'center', formatter: function (value) {
- if (value == 1) {
- return "<span style='color: green;'>允许复工<span>";
- } else if (value == 0) {
- return "<span style='color: red;'>禁止复工<span>";
- }
- }
- },
- {field: 'reportStatus', title: '上报', hidden: true},
- {
- field: 'msStatus', title: '个人上报状态', maxWidth: 100, align: 'center', formatter: function (value, row) {
- if (row.rowData.reportStatus == 0) {
- return "<span style='color: #ffb717;'>未上报<span>";
- } else if (value == 1) {
- return "<span style='color: green;'>正常<span>";
- } else {
- return "<span style='color: red;'>异常<span>";
- }
- }
- },
- {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
- {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
- {field: 'oldOpenId', title: '旧openId',hidden: true},
- {field: 'isBand', title: '是否迁移',hidden: true, maxWidth: 200, align: 'center', formatter: function (value, row) {
- if (row.rowData.oldOpenId) {
- return "<span style='color: green;'>是<span>";
- } else {
- return "<span style='color: red;'>否<span>";
- }
- }
- },
- {field: 'bingqingDesc', title: '病情表述', align: 'left',},
- {field: 'isContactDesc', title: '密切接触人员', align: 'left',formatter: function (value) {
- if (value == "正常") {
- return "<span style='color: green;'>正常<span>";
- } else {
- return "<span style='color: red;'>异常<span>";
- }
- }
- },
- {field: 'isSuspectedDesc', title: '家人健康异常', align: 'left',formatter: function (value) {
- if (value == "否") {
- return "<span style='color: green;'>否<span>";
- } else {
- return "<span style='color: red;'>是<span>";
- }
- }
- },
- // {field: 'autoLocal', title: '定位地区', maxWidth: 200, align: 'left',},
- // {field: 'autoAddr', title: '定位地址', maxWidth: 200, align: 'left',},
- {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
- {field: 'tripDetDesc', title: '出行详细', align: 'left',},
- {
- field: 'inoculateStatus', title: '是否接种新冠疫苗', maxWidth: 130, align: 'center', formatter: function (value) {
- if (value == 1) {
- return "<span style='color: green;'>是<span>";
- } else if (value == 0) {
- return "<span style='color: red;'>否<span>";
- } else {
- return "";
- }
- }
- },
- {field: 'reason', title: '未接种原因', maxWidth: 200, align: 'left',},
- {
- field: 'vaccineType', title: '接种疫苗类别', maxWidth: 100, align: 'center', formatter: function (value) {
- if (value == 1) {
- return "<span>腺病毒疫苗<span>";
- } else if (value == 2) {
- return "<span>灭活疫苗<span>";
- } else if (value == 3) {
- return "<span>重组亚单位疫苗<span>";
- } else {
- return "";
- }
- }
- },
- ]
- ]
- }
- }
- };
- };
- }
- );
|