| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329 |
- var f_State = '住院患者'
- var $tableLeft = ''
- $(function() {
- getdept()
- initTable()
- var t, n, count = 0;
- t = setInterval("showAuto()", 1000 * 60);
- $("#sc_btns").click(function() {
- initTable()
- })
- //时间
- laydate.render({
- elem: '#startTime',
- range: '~',
- theme: '#249fea'
- });
- //TAB切换
- $('#tab_head_left li').click(function() {
- $(this).addClass('tab_head_active').siblings().removeClass('tab_head_active');
- state = $(this).attr('data-index');
- f_State = state
- initTable();
- })
- })
- function getdept() {
- $("#deptname").html('');
- equipmentdata = []
- $("#deptname").append('<option value="">请选择科室名称</option>');
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "testusertypeapi/api/Test/gethzcyksinfo",
- async: true,
- dataType: 'json',
- success: function(data) {
- var leveldata = []
- if (data.state.toLowerCase() == 'success') {
- console.log(data)
- leveldata = data.data
- $(leveldata).each(function(q, p) {
- $("<option value='" + p + "'>" + p + "</option>").appendTo("#deptname");
- $("#deptname").selectpicker('refresh');
- });
- } else {
- $("#deptname").empty();
- $("#deptname").selectpicker('refresh');
- }
- }
- });
- }
- function initTable() {
- $tableLeft = $('#table_all');
- $tableLeft.bootstrapTable('destroy');
- //先销毁表格
- $tableLeft.bootstrapTable({
- method: "get", //使用get请求到服务器获取数据
- url: huayi.config.callcenter_url + "testusertypeapi/api/Test/getsendhfinfo",
- contentType: "application/x-www-form-urlencoded",
- striped: true, //表格显示条纹
- pagination: true, //启动分页
- pageSize: 10, //每页显示的记录数
- pageNumber: 1, //当前第几页
- fixedColumns: true,
- fixedNumber: 3,
- pageList: [5, 10, 20, 50, 100], //记录数可选列表
- search: false, //是否启用查询
- showColumns: false, //显示下拉框勾选要显示的列
- showRefresh: false, //显示刷新按钮
- sidePagination: "server", //表示服务端请求
- //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
- //设置为limit可以获取limit, offset, search, sort, order
- queryParamsType: "undefined",
- queryParams: function queryParams(params) { //设置查询参数
- console.log(params)
- var param = {
- PageIndex: params.pageNumber,
- PageSize: params.pageSize,
- iszyormz: f_State,
- key: $("#key").val(),
- yqinfo: $("#projectid").val(),
- sendmydcent: $("#myd").val(),
- deptname: $("#deptname").val(),
- stime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[0], //开始时间
- etime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[1], //结束时间
- };
- return param;
- },
- onPostBody: function() {
- //console.log("行数据渲染完成!");
- var totalPages = $tableLeft.bootstrapTable("getOptions").totalPages;
- var pageNumber = $tableLeft.bootstrapTable("getOptions").pageNumber;
- var goInputWidth = 45; //输入框默认宽度
- var maxLen = ("" + totalPages).length;
- //根据总页数设定跳转页面输入框宽度
- if (totalPages > 999)
- goInputWidth = maxLen * 10 + 15;
- var $pageGo = $('<span style="padding-left: 5px;">跳转到<input type="number" maxlength="' +
- maxLen + '" min="1" max="' + totalPages +
- '" class="input-box" id="c_jump-to-page" value="' +
- pageNumber + '" style="width: ' + goInputWidth + 'px;" />/' +
- totalPages + '页 </span>');
- var $go = $("<a href=\"javascript:;\">Go</a>");
- var $shou = $("<a href=\"javascript:;\">首页</a>")
- var $wei = $("<a href=\"javascript:;\">尾页</a>")
- $pageGo.append($go);
- $pageGo.append($shou);
- $pageGo.append($wei);
- $(".pagination-detail").append($pageGo);
- //页码范围限定(部分浏览器min~max失效时)
- $pageGo.change(function() {
- var goPage = $('#c_jump-to-page').val();
- if (goPage < 1)
- $('#c_jump-to-page').val(1);
- if (goPage > totalPages)
- $('#c_jump-to-page').val(totalPages);
- });
- //跳转到
- $go.click(function() {
- var goPage = parseInt($('#c_jump-to-page').val());
- console.log(totalPages)
- if (goPage != pageNumber)
- $tableLeft.bootstrapTable('selectPage', parseInt(goPage));
- });
- $shou.click(function() {
- $tableLeft.bootstrapTable('selectPage', 1);
- });
- $wei.click(function() {
- $tableLeft.bootstrapTable('selectPage', totalPages);
- });
- },
- onLoadSuccess: function(data) { //加载成功时执行
- //判断 住院患者和门诊患者展示信息
- if (f_State == '住院患者') {
- $tableLeft.bootstrapTable('showColumn', 'ZY_NO'); //显示
- // $tableLeft.bootstrapTable('showColumn', 'NAME');//显示
- // $tableLeft.bootstrapTable('showColumn', 'SEX');//显示
- // $tableLeft.bootstrapTable('showColumn', 'PAT_PHONE');//显示
- $tableLeft.bootstrapTable('showColumn', 'ZY_AGE'); //显示
- $tableLeft.bootstrapTable('showColumn', 'CY_ZD'); //显示
- $tableLeft.bootstrapTable('showColumn', 'CY_DEPT_NAME'); //显示
- $tableLeft.bootstrapTable('showColumn', 'CY_DATE'); //显示
- $tableLeft.bootstrapTable('showColumn', 'ZY_DAYS'); //显示
- $tableLeft.bootstrapTable('showColumn', 'PA_ADDRESS'); //显示
- $tableLeft.bootstrapTable('showColumn', 'ZY_DEPT_NAME'); //显示
- // $tableLeft.bootstrapTable('hideColumn', 'chinic_no');//隐藏上述variablevalue列
- // $tableLeft.bootstrapTable('hideColumn', 'patient_name');//隐藏上述variablevalue列
- // $tableLeft.bootstrapTable('hideColumn', 'sex');//隐藏上述variablevalue列
- // $tableLeft.bootstrapTable('hideColumn', 'phone');//隐藏上述variablevalue列
- $tableLeft.bootstrapTable('hideColumn', 'JB_NAME'); //隐藏上述variablevalue列
- $tableLeft.bootstrapTable('hideColumn', 'mzjzdeptname'); //隐藏上述variablevalue列
- $tableLeft.bootstrapTable('hideColumn', 'mzjztime'); //隐藏上述variablevalue列
- $tableLeft.bootstrapTable('hideColumn', 'ZZ_DOC'); //隐藏上述variablevalue列
- } else {
- $tableLeft.bootstrapTable('hideColumn', 'ZY_AGE'); //隐藏上述variablevalue列
- $tableLeft.bootstrapTable('hideColumn', 'ZY_NO'); //隐藏上述variablevalue列
- // $tableLeft.bootstrapTable('hideColumn', 'NAME');//隐藏上述variablevalue列
- // $tableLeft.bootstrapTable('hideColumn', 'SEX');//隐藏上述variablevalue列
- // $tableLeft.bootstrapTable('hideColumn', 'PAT_PHONE');//隐藏上述variablevalue列
- $tableLeft.bootstrapTable('hideColumn', 'CY_ZD'); //隐藏上述variablevalue列
- $tableLeft.bootstrapTable('hideColumn', 'CY_DEPT_NAME'); //隐藏上述variablevalue列
- $tableLeft.bootstrapTable('hideColumn', 'CY_DATE'); //隐藏上述variablevalue列
- $tableLeft.bootstrapTable('hideColumn', 'ZY_DEPT_NAME'); //隐藏上述variablevalue列
- $tableLeft.bootstrapTable('hideColumn', 'ZY_DAYS'); //显示
- $tableLeft.bootstrapTable('hideColumn', 'PA_ADDRESS'); //显示
- // $tableLeft.bootstrapTable('showColumn', 'chinic_no');// 显示
- // $tableLeft.bootstrapTable('showColumn', 'patient_name');// 显示
- // $tableLeft.bootstrapTable('showColumn', 'sex');// 显示
- // $tableLeft.bootstrapTable('showColumn', 'phone');// 显示
- $tableLeft.bootstrapTable('showColumn', 'JB_NAME'); // 显示
- $tableLeft.bootstrapTable('showColumn', 'mzjzdeptname'); // 显示
- $tableLeft.bootstrapTable('showColumn', 'mzjztime'); // 显示
- $tableLeft.bootstrapTable('showColumn', 'ZZ_DOC'); // 显示
- }
- var newDataL = {};
- newDataL.state = data.state;
- newDataL.message = data.message;
-
- newDataL.rows = data.data.rows;
- newDataL.total = data.data.total;
- newDataL.total = 1;
- $tableLeft.bootstrapTable('load', newDataL);
- $('.tool_downs').authorizeOperateButton();
- },
- onLoadError: function() { //加载失败时执行
- layer.msg("加载数据失败", {
- time: 1500,
- icon: 2
- });
- }
- });
- }
- $(function() {
- projectName()
- })
- // 院区选择
- function projectName() {
- $("#projectid").empty();
- $("#projectid").append("<option value=''>请选择医院</option>");
- $.getJSON(huayi.config.callcenter_url + "equipmentapi/api/ProjectInfo/getlistdrop", function(result) {
- if (result.state.toLowerCase() == "success") {
- var content = result.data;
- $(content).each(function(i, n) {
- $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo("#projectid");
- })
- $("#projectid").selectpicker('refresh');
- }
- })
- }
- //格式化操作
- function formatterOperate(val, row) {
- if (f_State == "门诊患者") {
- {
- var str = '<ul class="tool_downs">' +
- '<li><a class="aBtn" authorize="yes" id="HY_discharge_' + row.id + '" onclick="btn_myd(\'' + row.id +
- '\')">满意度</a><li>' +
- '<li><a class="aBtn" authorize="yes" id="HY_remarks_' + row.id + '" onclick="btn_remark(\'' + row.id +
- '\')">备注</a><li>'
- '</ul>';
- return str
- }
- } else {
- {
- var str = '<ul class="tool_downs">' +
- '<li><a class="aBtn" authorize="yes" id="HY_discharge_' + row.id + '" onclick="btn_myd(\'' + row.id +
- '\')">满意度</a><li>' +
- '<li><a class="aBtn" authorize="yes" id="HY_remarks_' + row.id + '" onclick="btn_remark(\'' + row.id +
- '\')">备注</a><li>' +
- '<li id="detail"><a class="aBtn" authorize="yes" id="HY_detail_' + row.id + '" onclick="btn_detail(\'' +
- row.id +
- '\')">详情</a><li>'
- '</ul>';
- return str
- }
- }
- }
- // // 外呼
- // function callout(val, row) {
- // var str='<div>'+ val+'<img src="./img/extensionnumber_icons.png" style="width:15px;height:15px;display:block" />'+ '</div>'
- // return str
- // }
- function btn_myd(sendmyeds) {
- layer.open({
- type: 2,
- content: "./myd.html?sendmyeds=" + sendmyeds,
- title: '修改满意度',
- area: ['50%', '45%'], //宽高
- });
- }
- function btn_detail(detail_id) {
- layer.open({
- type: 2,
- content: "./afterDischargeDetail.html?detail_id=" + detail_id,
- title: '出院患者记录详细信息',
- area: ['50%', '65%'], //宽高
- });
- }
- // 备注
- function btn_remark(remark_id) {
- layer.open({
- type: 2,
- content: "./remark.html?remark_id=" + remark_id,
- title: '备注',
- area: ['50%', '65%'], //宽高
- });
- }
- //获取短信回复内容
- function sendmsg() {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "testusertypeapi/api/Test/getmassagereply", //获取数据的Servlet地址
- async: true,
- dataType: 'json',
- data: {},
- success: function(data) {
- }
- });
- }
- function showAuto() {
- sendmsg()
- }
- // 导出
- $("#HY_export").click(function() {
- var key = $("#key").val() //关键字
- var yqinfo = $('#projectid').val()
- var sendmydcent = $('#myd').val() //满意度
- var deptname = $('#deptname').val() //科室名称
- var iszyormz = f_State
- var stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0] //开始时间
- var etime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1] //结束时间
- window.location.href = huayi.config.callcenter_url + "testusertypeapi/api/Test/exportexcel?sendmydcent=" +
- sendmydcent + "&stime=" + stime + "&etime=" + etime + "+&key=" + key + "&deptname=" + deptname +
- "&yqinfo=" +
- yqinfo + "&iszyormz=" +
- iszyormz
- })
|