advice.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css"/>
  7. <link rel="stylesheet" type="text/css" href="../../../css/style.min.css" />
  8. <link href="../../../plugins/toastr/toastr.min.css" rel="stylesheet">
  9. <link rel="stylesheet" href="../css/advice.css" />
  10. </head>
  11. <body>
  12. <div class="c-container" id="advice">
  13. <div class="advice-box">
  14. <p class="advice-title">选择健康指导建议(可多选):</p>
  15. <ul class="advice-content">
  16. <li v-for="advice in adviceList">
  17. <input type="checkbox" :value="advice.adviceCode" v-model="advicCcodes"/><i></i><span v-text="advice.advice"></span>
  18. </li>
  19. <li v-if="!adviceList.length">
  20. <span>无建议模板</span>
  21. </li>
  22. </ul>
  23. <p class="qtjy">您还有其他补充建议:</p>
  24. <textarea class="advice-textarea form-control" v-model="otherAdvice" rows="4"></textarea>
  25. <div class="text-center">
  26. <button class="btn btn-default save" @click="save">保存</button>
  27. </div>
  28. </div>
  29. </div>
  30. <script src="../../../js/vue.js" type="text/javascript" charset="utf-8"></script>
  31. <script src="../../../js/jquery-2.2.4.js" type="text/javascript" charset="utf-8"></script>
  32. <script src="../../../api/http-request.js" type="text/javascript" charset="utf-8"></script>
  33. <script src="../../../js/es6-promise.js" type="text/javascript" charset="utf-8"></script>
  34. <script src="../../../plugins/toastr/toastr.min.js"></script>
  35. <script type="text/javascript" src="../../../api/jbsc-api.js" ></script>
  36. <script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
  37. <script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
  38. <script type="text/javascript">
  39. var httpData=GetRequest();
  40. new Vue({
  41. el: "#advice",
  42. data: {
  43. screeningType:httpData['filter_code'],
  44. adviceList:[],
  45. resultCode:httpData['resultCode'],
  46. advicCcodes:[],
  47. otherAdvice:"",
  48. parentIframe:httpData['parentIframe'],//父级窗口 用户保存后关闭
  49. },
  50. mounted: function(){
  51. if(!this.screeningType){
  52. top.layer.msg("模板code丢失", {icon: 5});
  53. return
  54. }
  55. this.getAdvice();
  56. },
  57. methods: {
  58. getAdvice:function(){
  59. var vm=this;
  60. var data = {templateCode: vm.screeningType};
  61. var loadding = top.layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
  62. jbscAPI.getTemplateAdvice(data).then(function(res){
  63. top.layer.close(loadding);
  64. if(res.status==200){
  65. vm.adviceList=res.data
  66. }else{
  67. top.layer.msg(res.msg, {icon: 5});
  68. }
  69. })
  70. },
  71. save:function(){
  72. var vm=this;
  73. if(JSON.stringify(vm.advicCcodes)=='[]' && !vm.otherAdvice){
  74. top.layer.msg('请先填写建议或勾选建议在提交', {icon: 5});
  75. return ;
  76. }
  77. var data={
  78. code: vm.resultCode.toString(),
  79. adviceCodes: vm.advicCcodes.toString(),
  80. otherAdvice: vm.otherAdvice.toString()
  81. }
  82. var loadding = top.layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
  83. jbscAPI.updateAfterFollwoing(data).then(function(res){
  84. top.layer.close(loadding);
  85. if(res.status==200){
  86. top.layer.open({
  87. type: 2,
  88. // offset: ['100px'], //右下角弹出
  89. area: ['568px', '100%'],
  90. shade: 0.5,
  91. title: '查看筛选结果',
  92. fixed: true, //不固定
  93. maxmin: true,
  94. closeBtn:1,
  95. shift: 5,
  96. shadeClose: false, //点击遮罩关闭层
  97. content: '../../jbsc/html/view_screening_results.html?resultCode='+vm.resultCode
  98. });
  99. vm.parentIframe && top.layer.close(vm.parentIframe); //再执行关闭
  100. var index = top.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  101. top.layer.close(index); //再执行关闭
  102. }else{
  103. top.layer.msg(res.msg, {icon: 5});
  104. }
  105. })
  106. }
  107. }
  108. })
  109. </script>
  110. </body>
  111. </html>