郑州第一人民医院UI

afterDischarge.js 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. $(function() {
  2. getdept()
  3. initTable()
  4. var t, n, count = 0;
  5. t = setInterval("showAuto()", 5000);
  6. $("#sc_btns").click(function() {
  7. initTable()
  8. })
  9. //时间
  10. laydate.render({
  11. elem: '#startTime',
  12. range: '~',
  13. theme: '#249fea'
  14. });
  15. })
  16. function getdept() {
  17. $("#deptname").html('');
  18. equipmentdata = []
  19. $("#deptname").append('<option value="">请选择科室名称</option>');
  20. $.ajax({
  21. type: "get",
  22. url: huayi.config.callcenter_url + "testusertypeapi/api/Test/gethzcyksinfo",
  23. async: true,
  24. dataType: 'json',
  25. success: function(data) {
  26. var leveldata = []
  27. if (data.state.toLowerCase() == 'success') {
  28. console.log(data)
  29. leveldata = data.data
  30. $(leveldata).each(function(q, p) {
  31. $("<option value='" + p + "'>" + p + "</option>").appendTo("#deptname");
  32. $("#deptname").selectpicker('refresh');
  33. });
  34. } else {
  35. $("#deptname").empty();
  36. $("#deptname").selectpicker('refresh');
  37. }
  38. }
  39. });
  40. }
  41. function initTable() {
  42. var $tableLeft = $('#table_all');
  43. $tableLeft.bootstrapTable('destroy');
  44. //先销毁表格
  45. $tableLeft.bootstrapTable({
  46. method: "get", //使用get请求到服务器获取数据
  47. url: huayi.config.callcenter_url + "testusertypeapi/api/Test/getsendhfinfo",
  48. contentType: "application/x-www-form-urlencoded",
  49. striped: true, //表格显示条纹
  50. pagination: true, //启动分页
  51. pageSize: 10, //每页显示的记录数
  52. pageNumber: 1, //当前第几页
  53. fixedColumns: true,
  54. fixedNumber: 3,
  55. pageList: [5, 10, 20, 50, 100], //记录数可选列表
  56. search: false, //是否启用查询
  57. showColumns: false, //显示下拉框勾选要显示的列
  58. showRefresh: false, //显示刷新按钮
  59. sidePagination: "server", //表示服务端请求
  60. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  61. //设置为limit可以获取limit, offset, search, sort, order
  62. queryParamsType: "undefined",
  63. queryParams: function queryParams(params) { //设置查询参数
  64. console.log(params)
  65. var param = {
  66. PageIndex: params.pageNumber,
  67. PageSize: params.pageSize,
  68. key: $("#key").val(),
  69. yqinfo: $("#projectid").val(),
  70. sendmydcent: $("#myd").val(),
  71. deptname: $("#deptname").val(),
  72. stime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[0], //开始时间
  73. etime: $('#startTime').val() && $('#startTime').val().split(' ~ ')[1], //结束时间
  74. };
  75. return param;
  76. },
  77. onPostBody:function () {
  78. //console.log("行数据渲染完成!");
  79. var totalPages = $tableLeft.bootstrapTable("getOptions").totalPages;
  80. var pageNumber = $tableLeft.bootstrapTable("getOptions").pageNumber;
  81. var goInputWidth = 45;//输入框默认宽度
  82. var maxLen = (""+totalPages).length;
  83. //根据总页数设定跳转页面输入框宽度
  84. if (totalPages>999)
  85. goInputWidth = maxLen*10+15;
  86. var $pageGo = $('<span style="padding-left: 5px;">跳转到<input type="number" maxlength="'
  87. + maxLen+ '" min="1" max="' + totalPages
  88. + '" class="input-box" id="c_jump-to-page" value="'
  89. + pageNumber+ '" style="width: '+goInputWidth+'px;" />/'
  90. + totalPages+'页&nbsp;</span>');
  91. var $go = $("<a href=\"javascript:;\">Go</a>");
  92. var $shou=$("<a href=\"javascript:;\">首页</a>")
  93. var $wei=$("<a href=\"javascript:;\">尾页</a>")
  94. $pageGo.append($go);
  95. $pageGo.append($shou);
  96. $pageGo.append($wei);
  97. $(".pagination-detail").append($pageGo);
  98. //页码范围限定(部分浏览器min~max失效时)
  99. $pageGo.change(function () {
  100. var goPage = $('#c_jump-to-page').val();
  101. if (goPage<1)
  102. $('#c_jump-to-page').val(1);
  103. if (goPage>totalPages)
  104. $('#c_jump-to-page').val(totalPages);
  105. });
  106. //跳转到
  107. $go.click(function () {
  108. var goPage = parseInt($('#c_jump-to-page').val());
  109. console.log(totalPages)
  110. if (goPage!=pageNumber)
  111. $tableLeft.bootstrapTable('selectPage', parseInt(goPage));
  112. });
  113. $shou.click(function () {
  114. $tableLeft.bootstrapTable('selectPage',1);
  115. });
  116. $wei.click(function () {
  117. $tableLeft.bootstrapTable('selectPage', totalPages);
  118. });
  119. },
  120. onLoadSuccess: function(data) { //加载成功时执行
  121. var newDataL = {};
  122. newDataL.state = data.state;
  123. newDataL.message = data.message;
  124. newDataL.rows = data.data.rows;
  125. newDataL.total = data.data.total;
  126. $tableLeft.bootstrapTable('load', newDataL);
  127. $('.tool_downs').authorizeOperateButton();
  128. },
  129. onLoadError: function() { //加载失败时执行
  130. layer.msg("加载数据失败", {
  131. time: 1500,
  132. icon: 2
  133. });
  134. }
  135. });
  136. }
  137. $(function() {
  138. projectName()
  139. })
  140. // 院区选择
  141. function projectName() {
  142. $("#projectid").empty();
  143. $("#projectid").append("<option value=''>请选择医院</option>");
  144. $.getJSON(huayi.config.callcenter_url + "equipmentapi/api/ProjectInfo/getlistdrop", function(result) {
  145. if (result.state.toLowerCase() == "success") {
  146. var content = result.data;
  147. $(content).each(function(i, n) {
  148. $("<option value='" + n.id + "'>" + n.text + "</option>").appendTo("#projectid");
  149. })
  150. $("#projectid").selectpicker('refresh');
  151. }
  152. })
  153. }
  154. //格式化操作
  155. function formatterOperate(val, row) {
  156. {
  157. var str = '<ul class="tool_downs">' +
  158. '<li><a class="aBtn" authorize="yes" id="HY_discharge_' + row.id + '" onclick="btn_myd(\'' + row.id +
  159. '\')">满意度</a><li>' +
  160. '<li><a class="aBtn" authorize="yes" id="HY_remarks_' + row.id + '" onclick="btn_remark(\'' + row.id +
  161. '\')">备注</a><li>' +
  162. '<li><a class="aBtn" authorize="yes" id="HY_detail_' + row.id + '" onclick="btn_detail(\'' + row.id +
  163. '\')">详情</a><li>'
  164. '</ul>';
  165. return str
  166. }
  167. }
  168. function btn_myd(sendmyeds) {
  169. layer.open({
  170. type: 2,
  171. content: "./myd.html?sendmyeds=" + sendmyeds,
  172. title: '修改满意度',
  173. area: ['50%', '45%'], //宽高
  174. });
  175. }
  176. function btn_detail(detail_id) {
  177. layer.open({
  178. type: 2,
  179. content: "./afterDischargeDetail.html?detail_id=" + detail_id,
  180. title: '出院患者记录详细信息',
  181. area: ['50%', '65%'], //宽高
  182. });
  183. }
  184. // 备注
  185. function btn_remark(remark_id) {
  186. layer.open({
  187. type: 2,
  188. content: "./remark.html?remark_id=" + remark_id,
  189. title: '备注',
  190. area: ['50%', '65%'], //宽高
  191. });
  192. }
  193. //获取短信回复内容
  194. function sendmsg() {
  195. $.ajax({
  196. type: "get",
  197. url: huayi.config.callcenter_url + "testusertypeapi/api/Test/getmassagereply", //获取数据的Servlet地址
  198. async: true,
  199. dataType: 'json',
  200. data: {},
  201. success: function(data) {
  202. }
  203. });
  204. }
  205. function showAuto() {
  206. sendmsg()
  207. }
  208. // 导出
  209. $("#HY_export").click(function() {
  210. var key = $("#key").val() //关键字
  211. var yqinfo = $('#yqinfo').val()
  212. var sendmydcent = $('#sendmydcent').val() //满意度
  213. var deptname = $('#deptname').val() //科室名称
  214. var stime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[0] //开始时间
  215. var etime = $('#startTime').val() && $('#startTime').val().split(' ~ ')[1] //结束时间
  216. window.location.href = huayi.config.callcenter_url + "testusertypeapi/api/Test/exportexcel?sendmydcent=" +
  217. sendmydcent + "&stime=" + stime + "&etime=" + etime + "+&key=" + key + "&deptname=" + deptname + "&yqinfo=" +
  218. yqinfo
  219. })