| | |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar"> |
| | | <input id="app-edit-search" class="layui-input search-input" type="text" placeholder="输入医生姓名" />  |
| | | <input type="text" class="layui-input search-input" id="test1"> 至 <input type="text" |
| | | class="layui-input search-input" id="test2">   |
| | | <input id="app-edit-search" class="layui-input search-input" type="text" placeholder="按医生姓名" />  |
| | | <input type="text" class="layui-input search-input" id="test1" placeholder="开始时间" > 至 <input type="text" |
| | | class="layui-input search-input" id="test2" placeholder="结束时间" >   |
| | | <button id="app-btn-search" class="layui-btn icon-btn permissions" permissions="diagnostic-get"><i class="layui-icon"></i>搜索</button> |
| | | <!-- <button id="app-btn-add" class="layui-btn icon-btn"><i class="layui-icon"></i>添加</button> --> |
| | | <button id="app-btn-export" class="layui-btn icon-btn permissions" permissions="dataneed-export"><i class="layui-icon"></i>导出</button> |
| | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">需求类型</label> |
| | | <div class="layui-input-block"> |
| | | <input name="needType" placeholder="请输入应用标识" type="text" class="layui-input" maxlength="20" |
| | | lay-verify="required" required/> |
| | | <input name="needTypeName" id="needTypeName" placeholder="请输入应用标识" type="text" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">科室名称</label> |
| | | <div class="layui-input-block"> |
| | | <input name="departmentName" placeholder="请输入回调地址" type="text" class="layui-input" maxlength="20"/> |
| | | <input name="departmentName" type="text" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">医生联系方式</label> |
| | | <div class="layui-input-block"> |
| | | <input name="doctorTel" placeholder="请输入回调地址" type="text" class="layui-input" maxlength="20"/> |
| | | <input name="doctorTel" type="text" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">需求数据的开始时间</label> |
| | | <div class="layui-input-block"> |
| | | <input name="needBegintime" placeholder="请输入回调地址" type="text" class="layui-input" maxlength="20"/> |
| | | <input name="needBegintime" type="text" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">需求数据的结束时间</label> |
| | | <div class="layui-input-block"> |
| | | <input name="needEndtime" placeholder="请输入回调地址" type="text" class="layui-input" maxlength="20"/> |
| | | <input name="needEndtime" type="text" class="layui-input" maxlength="20"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">需求标签</label> |
| | | <div class="layui-input-block"> |
| | | <input name="needTags" placeholder="请输入回调地址" type="text" class="layui-input" maxlength="20"/> |
| | | <textarea name="needTags" class="layui-input" style="height:200px;overflow:auto" maxlength="20"> </textarea> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item model-form-footer"> |
| | |
| | | var laydate = layui.laydate; |
| | | //执行一个laydate实例 |
| | | laydate.render({ |
| | | elem: '#test1' //指定元素 |
| | | elem: '#test1', //指定元素 |
| | | done: function (value, date, endDate) { |
| | | var startDate = new Date(value).getTime(); |
| | | var endTime = new Date($('#test2').val()).getTime(); |
| | | if (endTime < startDate) { |
| | | layer.msg('结束时间不能小于开始时间'); |
| | | $('#test1').val($('#test2').val()); |
| | | } else { |
| | | $('#custom_beginTime').val($("#test1").val()) |
| | | } |
| | | } |
| | | }); |
| | | laydate.render({ |
| | | elem: '#test2' //指定元素 |
| | | elem: '#test2', //指定元素 |
| | | done: function (value, date, endDate) { |
| | | var startDate = new Date($('#test1').val()).getTime(); |
| | | var endTime = new Date(value).getTime(); |
| | | if (endTime < startDate) { |
| | | layer.msg('结束时间不能小于开始时间'); |
| | | $('#test2').val($('#test1').val()); |
| | | } else { |
| | | $('#custom_endTime').val($("#test2").val()) |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // 渲染表格 |
| | |
| | | page: true, |
| | | cols: [[ |
| | | { type: 'numbers' }, |
| | | { field: 'doctorName', width: 100, title: '医生姓名' }, |
| | | { field: 'doctorTel', width: 150, title: '联系电话' }, |
| | | { field: 'hospitalName', width: 300, title: '所在医院' }, |
| | | { field: 'needBegintime', width: 240, title: '时间段', templet: "<div>{{layui.util.toDateString(d.needBegintime, 'yyyy-MM-dd')}}至{{layui.util.toDateString(d.needEndtime, 'yyyy-MM-dd')}}</div>" }, |
| | | { field: 'needType', width: 100, title: '数据类型', templet: function (d) { if (d.needType == 1) { return '筛查' } else { return '就诊' } } },// 0就诊数据 1筛查 |
| | | { field: 'needTags', width: 100, align: 'center', toolbar: '#app-table-bar', title: '需求标签' }, |
| | | { field: 'enabled', width: 200, toolbar: '#app-table-bar1', title: '处理状态', }, |
| | | { field: 'downTime', width: 250, title: '下载时间', templet: "<div>{{layui.util.toDateString(d.downTime, 'yyyy-MM-dd HH:mm')}}</div>" } |
| | | { field: 'doctorName',align:'center', width: 100, title: '医生姓名' }, |
| | | { field: 'doctorTel',align:'center', width: 150, title: '联系电话' }, |
| | | { field: 'hospitalName',align:'center', width: 300, title: '所在医院' }, |
| | | { field: 'needBegintime',align:'center', width: 240, title: '时间段', templet: "<div>{{layui.util.toDateString(d.needBegintime, 'yyyy-MM-dd')}} 至 {{layui.util.toDateString(d.needEndtime, 'yyyy-MM-dd')}}</div>" }, |
| | | { field: 'needType',align:'center', width: 100, title: '数据类型', templet: function (d) { if (d.needType == 1) { return '筛查' } else { return '就诊' } } },// 0就诊数据 1筛查 |
| | | { field: 'needTags',align:'center', width: 100, align: 'center', toolbar: '#app-table-bar', title: '需求标签' }, |
| | | { field: 'enabled',align:'center', width: 200, toolbar: '#app-table-bar1', title: '处理状态', }, |
| | | { field: 'downTime',align:'center', width: 250, title: '下载时间', templet: "<div>{{layui.util.toDateString(d.downTime, 'yyyy-MM-dd HH:mm')}}</div>" }, |
| | | { field: 'creatTime',align:'center', width: 250, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.creatTime, 'yyyy-MM-dd')}}</div>" } |
| | | ]],done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | |
| | | }); |
| | | //更新上传的状态 |
| | | var updateEnabled = function (dataFile, enabled) { |
| | | console.log($("#upload-id").val()) |
| | | |
| | | admin.req('api-opration/dataneed/updateEnabled', { |
| | | id: $("#upload-id").val(), |
| | | enabled: enabled, |
| | |
| | | layer.closeAll(); |
| | | table.reload('app-table', { where: {} }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 500 }); |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | } |
| | | }, 'GET'); |
| | | } |
| | | // 搜索按钮点击事件 |
| | | $('#app-btn-search').click(function () { |
| | | var key = $('#app-edit-search').val(); |
| | | var needBegintime = $('#test1').val(); |
| | | var needEndtime = $('#test2').val(); |
| | | if (needBegintime != null && needEndtime != null) { |
| | | var flag = compareDate(needBegintime, needEndtime); |
| | | var createTimeBegin = $('#test1').val(); |
| | | var createTimeEnd = $('#test2').val(); |
| | | if (createTimeBegin != null && createTimeEnd != null) { |
| | | var flag = compareDate(createTimeBegin, createTimeEnd); |
| | | if (!flag) { |
| | | layer.msg('结束时间不得小于开始时间'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | table.reload('app-table', { where: { doctorName: key, needBegintime: needBegintime, needEndtime: needEndtime } }); |
| | | table.reload('app-table', { where: { doctorName: key, createTimeBegin: createTimeBegin, createTimeEnd: createTimeEnd },page: {curr: 1 } }); |
| | | }); |
| | | //比较日期大小 |
| | | function compareDate(logintime, logouttime) { |
| | |
| | | } |
| | | // 导出 |
| | | $('#app-btn-export').click(function () { |
| | | var key = $('#app-edit-search').val(); |
| | | var needBegintime = $('#test1').val(); |
| | | var needEndtime = $('#test2').val(); |
| | | if (needBegintime != null && needEndtime != null) { |
| | | var flag = compareDate(needBegintime, needEndtime); |
| | | if (!flag) { |
| | | layer.msg('结束时间不得小于开始时间'); |
| | | return; |
| | | } |
| | | } |
| | | //获取 |
| | | var url = config.base_server + 'api-opration/dataneed/export'; |
| | | var xhr = new XMLHttpRequest(); |
| | | xhr.open('POST', url, true); |
| | | xhr.responseType = "blob"; |
| | | var form = new FormData(); |
| | | // Add selected file to form |
| | | form.append("doctor_name", key); |
| | | form.append('need_begintime',needBegintime); |
| | | form.append('need_endtime',needEndtime); |
| | | |
| | | xhr.setRequestHeader("client_type", "DESKTOP_WEB"); |
| | | xhr.setRequestHeader("Authorization", "Bearer " + config.getToken().access_token); |
| | | xhr.onload = function () { |
| | | if (this.status == 200) { |
| | | var fileName = "user.xlsx"; |
| | | var fileName = "数据需求.xlsx"; |
| | | var blob = this.response; |
| | | var a = document.createElement('a'); |
| | | a.innerHTML = fileName; |
| | |
| | | document.body.removeChild(a); |
| | | } |
| | | } |
| | | xhr.send(); |
| | | xhr.send(form); |
| | | }); |
| | | |
| | | // 显示编辑弹窗 |
| | |
| | | layer.open({ |
| | | type: 1, |
| | | title: '详情', |
| | | area: '450px', |
| | | offset: '120px', |
| | | area: '700px', |
| | | offset: '0px', |
| | | content: $('#app-model').html(), |
| | | success: function () { |
| | | $('#app-form')[0].reset(); |
| | | $('#app-form').attr('method', 'POST'); |
| | | if (data) { |
| | | if (data.needBegintime) { |
| | | var needBegintime = layui.util.toDateString(data.needBegintime, 'yyyy年MM月dd日 HH:mm:ss'); |
| | | var needBegintime = layui.util.toDateString(data.needBegintime, 'yyyy年MM月dd日'); |
| | | data.needBegintime = needBegintime |
| | | } |
| | | if (data.needEndtime) { |
| | | var needEndtime = layui.util.toDateString(data.needEndtime, 'yyyy年MM月dd日 HH:mm:ss'); |
| | | var needEndtime = layui.util.toDateString(data.needEndtime, 'yyyy年MM月dd日'); |
| | | data.needEndtime = needEndtime |
| | | } |
| | | $("input[name='clientId']").attr('disabled', true); |
| | | $("input[name='clientId']").attr('class', "layui-input layui-disabled"); |
| | | $("input[name='webServerRedirectUri']").attr('disabled', true); |
| | | $("input[name='webServerRedirectUri']").attr('class', "layui-input layui-disabled"); |
| | | if(data.needType===1) |
| | | { |
| | | $("#needTypeName").val("筛查"); |
| | | } |
| | | else{ |
| | | $("#needTypeName").val("就诊"); |
| | | } |
| | | form.val('app-form', data); |
| | | $('#app-form').find('input,textarea').prop('readonly', true); |
| | | $('#app-form').attr('method', 'POST'); |
| | | } |
| | | } |