123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- <link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css"/>
- <link rel="stylesheet" type="text/css" href="../../../css/style.min.css" />
- <link href="../../../plugins/toastr/toastr.min.css" rel="stylesheet">
- <link rel="stylesheet" href="../css/advice.css" />
- </head>
- <body>
- <div class="c-container" id="advice">
- <div class="advice-box">
- <p class="advice-title">选择健康指导建议(可多选):</p>
- <ul class="advice-content">
- <li v-for="advice in adviceList">
- <input type="checkbox" :value="advice.adviceCode" v-model="advicCcodes"/><i></i><span v-text="advice.advice"></span>
- </li>
- <li v-if="!adviceList.length">
- <span>无建议模板</span>
- </li>
- </ul>
- <p class="qtjy">您还有其他补充建议:</p>
- <textarea class="advice-textarea form-control" v-model="otherAdvice" rows="4"></textarea>
- <div class="text-center">
- <button class="btn btn-default save" @click="save">保存</button>
- </div>
- </div>
- </div>
- <script src="../../../js/vue.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/jquery-2.2.4.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../api/http-request.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/es6-promise.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../plugins/toastr/toastr.min.js"></script>
- <script type="text/javascript" src="../../../api/jbsc-api.js" ></script>
- <script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
- <script type="text/javascript">
- var httpData=GetRequest();
- new Vue({
- el: "#advice",
- data: {
- screeningType:httpData['filter_code'],
- adviceList:[],
- resultCode:httpData['resultCode'],
- advicCcodes:[],
- otherAdvice:"",
- parentIframe:httpData['parentIframe'],//父级窗口 用户保存后关闭
- },
- mounted: function(){
- if(!this.screeningType){
- top.layer.msg("模板code丢失", {icon: 5});
- return
- }
- this.getAdvice();
- },
- methods: {
- getAdvice:function(){
- var vm=this;
- var data = {templateCode: vm.screeningType};
- var loadding = top.layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
- jbscAPI.getTemplateAdvice(data).then(function(res){
- top.layer.close(loadding);
- if(res.status==200){
- vm.adviceList=res.data
- }else{
- top.layer.msg(res.msg, {icon: 5});
- }
- })
- },
- save:function(){
- var vm=this;
- if(JSON.stringify(vm.advicCcodes)=='[]' && !vm.otherAdvice){
- top.layer.msg('请先填写建议或勾选建议在提交', {icon: 5});
- return ;
- }
- var data={
- code: vm.resultCode.toString(),
- adviceCodes: vm.advicCcodes.toString(),
- otherAdvice: vm.otherAdvice.toString()
- }
- var loadding = top.layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
- jbscAPI.updateAfterFollwoing(data).then(function(res){
- top.layer.close(loadding);
- if(res.status==200){
- top.layer.open({
- type: 2,
- // offset: ['100px'], //右下角弹出
- area: ['568px', '100%'],
- shade: 0.5,
- title: '查看筛选结果',
- fixed: true, //不固定
- maxmin: true,
- closeBtn:1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content: '../../jbsc/html/view_screening_results.html?resultCode='+vm.resultCode
- });
- vm.parentIframe && top.layer.close(vm.parentIframe); //再执行关闭
- var index = top.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- top.layer.close(index); //再执行关闭
- }else{
- top.layer.msg(res.msg, {icon: 5});
- }
- })
- }
- }
- })
- </script>
- </body>
- </html>
|