jw-prescription-list.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. var request = getRequest(),
  2. patient = request.patient,
  3. startDate = '',
  4. endDate = '';
  5. $(function(){
  6. getList();
  7. });
  8. function getList(isRefresh){
  9. var options = $.extend(jwPrescriptionAPI.getListTableAjaxObj, {
  10. queryParams: queryParams,
  11. queryParamsType: "limit",
  12. pagination: true,
  13. paginationLoop: true,
  14. sidePagination: 'server',
  15. pageNumber: 1,
  16. pageSize: 10,
  17. responseHandler: function (res) {
  18. // var data = JSON.parse(res.data);
  19. return {
  20. rows: res.data.list,
  21. total: res.data.total
  22. }
  23. },
  24. columns: [{
  25. field: '',
  26. title:'',
  27. formatter: function(val, row, index){
  28. var html = template('info_tmp', row);
  29. return html;
  30. }
  31. },{
  32. field: 'createTime',
  33. title: '申请时间',
  34. class: 'c-999 pr20',
  35. align: 'right',
  36. formatter: function(val, row, index){
  37. return '<span class="pr10">'+val+'</span>';
  38. }
  39. }],
  40. onClickRow: function(row, $el){
  41. document.location.href = "jw-prescription-info.html?code="+row.code+"&patient="+patient;
  42. }
  43. })
  44. $("#prescriptTable").bootstrapTable(options);
  45. }
  46. function queryParams(params) {
  47. return {
  48. page: params.offset/params.limit,
  49. size: params.limit,
  50. patient: patient,
  51. };
  52. }
  53. template.helper('getTypeName', function(type){
  54. if(type == 1){
  55. return "门诊";
  56. }else if(type == 2){
  57. return "住院";
  58. }else if(type == 3){
  59. return "体检";
  60. }
  61. return '';
  62. });