Нет описания

accessPatient.js 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. $(function() {
  2. initTable()
  3. })
  4. $('#sc_btns').click(function(){
  5. initTable()
  6. })
  7. function initTable() {
  8. var $tableLeft = $('#table_all');
  9. $tableLeft.bootstrapTable('destroy');
  10. //先销毁表格
  11. $tableLeft.bootstrapTable({
  12. method: "get", //使用get请求到服务器获取数据
  13. url: huayi.config.callcenter_url + "testusertypeapi/api/Test/getorder",
  14. contentType: "application/x-www-form-urlencoded",
  15. striped: true, //表格显示条纹
  16. pagination: true, //启动分页
  17. pageSize: 10, //每页显示的记录数
  18. pageNumber: 1, //当前第几页
  19. fixedColumns: true,
  20. fixedNumber: 3,
  21. pageList: [5, 10, 20, 50, 100], //记录数可选列表
  22. search: false, //是否启用查询
  23. showColumns: false, //显示下拉框勾选要显示的列
  24. showRefresh: false, //显示刷新按钮
  25. sidePagination: "server", //表示服务端请求
  26. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  27. //设置为limit可以获取limit, offset, search, sort, order
  28. queryParamsType: "undefined",
  29. queryParams: function queryParams(params) { //设置查询参数
  30. console.log(params)
  31. var param = {
  32. PageIndex: params.pageNumber,
  33. PageSize: params.pageSize,
  34. userIdCard:$('#userIdCard').val(),
  35. userName:$('#userName').val(),
  36. userMobile:$('#userMobile').val(),
  37. deptname:$('#deptname').val(),
  38. docorname:$('#docorname').val()
  39. };
  40. return param;
  41. },
  42. onLoadSuccess: function(data) { //加载成功时执行
  43. var newDataL = {};
  44. newDataL.state = data.state;
  45. newDataL.message = data.message;
  46. newDataL.rows = data.data.rows;
  47. newDataL.total = data.data.total;
  48. $tableLeft.bootstrapTable('load', newDataL);
  49. $('.tool_downs').authorizeOperateButton();
  50. },
  51. onLoadError: function() { //加载失败时执行
  52. layer.msg("加载数据失败", {
  53. time: 1500,
  54. icon: 2
  55. });
  56. }
  57. });
  58. }
  59. //格式化操作
  60. //格式化操作
  61. function formatterOperate(val, row) {
  62. console.log(typeof(row.orderstate))
  63. if(row.orderstate=='0'){
  64. var str = '<ul class="tool_downs">' +
  65. '<li><a class="aBtn" id="HY_delete_' + row.orderId + '" onclick="btn_delete(\'' + row.orderIdHIS + '\',\'' +row.orderTime+
  66. '\')">取消预约</a><li>'
  67. '</ul>';
  68. return str
  69. }else{
  70. return ''
  71. }
  72. }
  73. function getGender(val){
  74. if(val=='M'){
  75. return '男'
  76. }else{
  77. return '女'
  78. }
  79. }
  80. function getState(val){
  81. if(val==0){
  82. return '预约成功'
  83. }else if(val==1){
  84. return '预约失败'
  85. }else{
  86. return '已取消'
  87. }
  88. }
  89. function getTimeFlag(val){
  90. if(val=='1'){
  91. return '上午'
  92. }else if(val=='2'){
  93. return '下午'
  94. }else if(val=='3'){
  95. return '晚上'
  96. }else if(val=='4'){
  97. return '白天'
  98. }else{
  99. return '昼夜'
  100. }
  101. }
  102. function btn_add() {
  103. layer.open({
  104. type: 2,
  105. content: "./addAcessppoint.html", //iframe的url,no代表不显示滚动条
  106. title: '添加预约信息',
  107. area: ['75%', '95%'], //宽高
  108. });
  109. }
  110. // function btn_edit(edit_id) {
  111. // layer.open({
  112. // type: 2,
  113. // content: "./addRiskLevel.html?edit_id=" + edit_id, //iframe的url,no代表不显示滚动条
  114. // title: '修改风险等级信息',
  115. // area: ['50%', '30%'], //宽高
  116. // });
  117. // }
  118. function btn_delete(ids,orderTime) {
  119. layer.confirm('确定取消当前预约?', {
  120. btn: ['是', '否'] //按钮
  121. }, function() {
  122. /*发送请求*/
  123. $.ajax({
  124. type: "get",
  125. url: huayi.config.callcenter_url + "testusertypeapi/api/Test/uporder",
  126. async: true,
  127. dataType: 'json',
  128. data: {
  129. orderIdHIS: ids,
  130. cancelTime:orderTime
  131. },
  132. success: function(data) {
  133. if (data.state.toLowerCase() == 'success') {
  134. layer.msg("预约取消成功!");
  135. initTable();
  136. }
  137. }
  138. });
  139. });
  140. }