stop_special_service.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. !function(){
  2. var httpData=GetRequest();
  3. var patientImg = "";
  4. var userInfo = JSON.parse(window.localStorage.getItem(httpRequest.agentName));
  5. //设置网页打印的页眉页脚为空
  6. function PageSetup_Null() {
  7. var HKEY_Root,HKEY_Path,HKEY_Key;
  8. HKEY_Root="HKEY_CURRENT_USER";
  9. HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
  10. try {
  11. var Wsh = new ActiveXObject("WScript.Shell");
  12. HKEY_Key="header";
  13. Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
  14. HKEY_Key="footer";
  15. Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
  16. window.print();
  17. } catch(e) {
  18. window.print();
  19. }
  20. }
  21. function bindEvent() {
  22. $("#printBtn").click(function() {
  23. var bdhtml = window.document.body.innerHTML,
  24. sprnstr = "<!--startprint-->",
  25. eprnstr = "<!--endprint-->",
  26. prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
  27. prnhtml=prnhtml.substring(0, prnhtml.indexOf(eprnstr));
  28. window.document.body.innerHTML = prnhtml;
  29. PageSetup_Null();
  30. })
  31. //查看签收
  32. $("#seeQianShou").click(function() {
  33. var imgUrl = httpRequest.getImgUrl(patientImg);
  34. parent.layer.open({
  35. type: 1,
  36. title:false,
  37. shadeClose: true,
  38. content:'<img style="width:360px;height:500px;" src="'+imgUrl+'">'
  39. })
  40. // parent.layer.open({
  41. // type:1,
  42. // shift: 2,
  43. // shade:0.6,
  44. // title:false,
  45. // shadeClose:true,
  46. // content:'<img style="width:360px;height:500px;" src="'+imgUrl+'">'
  47. // });
  48. })
  49. }
  50. new Vue({
  51. el:"#app",
  52. data:{
  53. accountList: {},
  54. planStatus:""
  55. },
  56. mounted:function(){
  57. this.getServiceItemsAfterStop()
  58. bindEvent();
  59. this.planStatus = httpData.planStatus || "";
  60. },
  61. methods:{
  62. getServiceItemsAfterStop: function() {
  63. var vm = this,
  64. loadding = layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
  65. rehaAPI.getServiceItemsAfterStop({planId: httpData.planids}).then(function(res){
  66. layer.close(loadding);
  67. if(res.status==200){
  68. vm.accountList = res.data
  69. patientImg = res.data.patient_img;
  70. }else{
  71. layer.msg(res.msg,{icon:5});
  72. }
  73. })
  74. }
  75. },
  76. filters:{
  77. formatDate:function(value, format) {
  78. if(!value) return ;
  79. var fmt=format || "yyyy-MM-dd hh:mm";
  80. var date = new Date(value);
  81. if (/(y+)/.test(fmt)) {
  82. fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
  83. }
  84. let o = {
  85. 'M+': date.getMonth() + 1,
  86. 'd+': date.getDate(),
  87. 'h+': date.getHours(),
  88. 'm+': date.getMinutes(),
  89. 's+': date.getSeconds()
  90. };
  91. for (let k in o) {
  92. if (new RegExp(`(${k})`).test(fmt)) {
  93. let str = o[k] + '';
  94. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : ('00' + str).substr(str.length));
  95. }
  96. }
  97. return fmt;
  98. },
  99. getImgUrl: function(value) {
  100. var url = httpRequest.getImgUrl(value);
  101. return url;
  102. }
  103. }
  104. })
  105. }();