jiankangtijianxiangqing.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. var d= dialog({contentType:'load', skin:'bk-popup'}).show();
  2. var Requests = GetRequest(),
  3. medicalNo = Requests.medicalNo;
  4. getReqPromise('patient/archives/medical_detail',{
  5. medicalNo: medicalNo
  6. },'JSON','POST').then(function(res){
  7. d.close();
  8. var data = {};
  9. if(res.status == 200) {
  10. data = res.medical_detail;
  11. } else {
  12. mui.toast(res.msg);
  13. }
  14. var vm = avalon.define($.extend({},{"$id": "viewController"},{
  15. data: data
  16. }));
  17. avalon.scan();
  18. }).catch(function(e) {
  19. d.close();
  20. console && console.error(e);
  21. })
  22. .then(function() {
  23. function showAutoItems(el) {
  24. var $item = $(el).closest('[auto-item]');
  25. if($item.length && $item.is(":hidden")) {
  26. $item.removeClass('elastic-columns-ignore')
  27. $item.show();
  28. showAutoItems($item.parent());
  29. }
  30. }
  31. _.each($('[item-value]'),function(el) {
  32. var $el = $(el);
  33. var text = $.trim($el.text());
  34. if(text) {
  35. showAutoItems($el);
  36. }
  37. })
  38. })
  39. .then(function() {
  40. $('.c-panel').on('click','.c-panel-bar',function() {
  41. var $panel = $(this).closest('.c-panel'),
  42. $content = $panel.find('.c-panel-content');
  43. $('.c-panel.expanding').not($panel[0]).removeClass('expanding').find('.c-panel-content').slideUp();
  44. $panel.toggleClass('expanding');
  45. if($panel.hasClass('expanding')) {
  46. var $container = $panel.find('.card-layout');
  47. $content.slideDown(function() {
  48. if($container.length) {
  49. $container.elasticColumns(
  50. {
  51. columns: 2, // the number of colums
  52. innerMargin: 5, // the gap between two tiles
  53. outerMargin: 5 // the gap between the tiles and
  54. // the edge of the container
  55. });
  56. }
  57. });
  58. } else {
  59. $content.slideUp();
  60. }
  61. });
  62. }).catch(function(e) {
  63. d.close();
  64. console && console.error(e);
  65. })