郑州第一人民医院UI

afterDischarge.js 10KB

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