郑州第一人民医院UI

afterDischarge.js 11KB

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