stop_special_service.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. },
  55. mounted:function(){
  56. this.getServiceItemsAfterStop()
  57. bindEvent();
  58. if(httpData.completePlan){//居民已确认完成计划,显示“查看签收”按钮
  59. $("#seeQianShou").show();
  60. }
  61. },
  62. methods:{
  63. getServiceItemsAfterStop: function() {
  64. var vm = this,
  65. loadding = layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
  66. rehaAPI.getServiceItemsAfterStop({planId: httpData.planids}).then(function(res){
  67. layer.close(loadding);
  68. if(res.status==200){
  69. vm.accountList = res.data
  70. patientImg = res.data.patient_img;
  71. }else{
  72. layer.msg(res.msg,{icon:5});
  73. }
  74. })
  75. }
  76. },
  77. filters:{
  78. formatDate:function(value, format) {
  79. if(!value) return ;
  80. var fmt=format || "yyyy-MM-dd hh:mm";
  81. var date = new Date(value);
  82. if (/(y+)/.test(fmt)) {
  83. fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
  84. }
  85. let o = {
  86. 'M+': date.getMonth() + 1,
  87. 'd+': date.getDate(),
  88. 'h+': date.getHours(),
  89. 'm+': date.getMinutes(),
  90. 's+': date.getSeconds()
  91. };
  92. for (let k in o) {
  93. if (new RegExp(`(${k})`).test(fmt)) {
  94. let str = o[k] + '';
  95. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : ('00' + str).substr(str.length));
  96. }
  97. }
  98. return fmt;
  99. },
  100. getImgUrl: function(value) {
  101. var url = httpRequest.getImgUrl(value);
  102. return url;
  103. }
  104. }
  105. })
  106. }();