service_item_content.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <link rel="stylesheet" href="../../../css/bootstrap.min.css" />
  7. <link rel="stylesheet" type="text/css" href="../../../css/style.min.css"/>
  8. <link rel="stylesheet" type="text/css" href="../../../css/cross.css"/>
  9. <style type="text/css">
  10. [v-cloak]{display: none;}
  11. .flex-box{display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */ /* OLD - Firefox 19- (buggy but mostly works) */
  12. display: -ms-flexbox; /* TWEENER - IE 10 */ /* NEW - Chrome */
  13. display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */
  14. -webkit-box-pack: center;
  15. -ms-flex-pack: center;
  16. justify-content: center;
  17. -webkit-box-align: center;
  18. -ms-flex-align: center;
  19. align-items: center;
  20. -ms-flex-wrap: wrap;
  21. flex-wrap: wrap;
  22. }
  23. .flex-box-item{-webkit-box-flex: 1; /* OLD - iOS 6-, Safari 3.1-6 */
  24. -moz-box-flex: 1; /* OLD - Firefox 19- */
  25. -webkit-flex: 1; /* Chrome */
  26. -ms-flex: 1; /* IE 10 */
  27. width: 50%; /* For old syntax, otherwise collapses. */
  28. flex: 1; /* NEW, Spec - Opera 12.1, Firefox 20+ */
  29. position: relative;}
  30. .icon{width: 12px;height: 12px;vertical-align: middle;background-size: 100% auto;background-repeat: no-repeat;display: inline-block;background-position: center center;}
  31. .icon-arrow-down{background-image: url(../images/icon/tiaozhuan_xia_icon.png);}
  32. .icon-gouxuan{background-image: url(../images/icon/gouxuan_lanse_icon.png);}
  33. .icon-check,.icon-arrow-down{transition: all .3s ease-in-out;}
  34. .active .icon-check,.collapsed .icon-arrow-down{transform: rotateZ(180deg);}
  35. .icon-check{background-image: url(../images/icon/zhankai_btn.png);}
  36. .icon-16{width: 16px;height: 16px;}
  37. .icon-18{width: 18px;height: 18px;}
  38. .record-list{max-height: 0;overflow: hidden;transition: all .3s linear;}
  39. .record-list.active{max-height: 9999px;height: auto;}
  40. .record-item{background-color: #f5f5fa;margin-bottom: 10px;padding: 10px;}
  41. .service-top{font-size: 0;line-height: 1;font-weight: 500;}
  42. .service-name span{vertical-align: middle;font-size: 16px;}
  43. .service-name span+span{margin-left: 10px;}
  44. .service-name{line-height: 1.5;margin-bottom: 0;}
  45. .service-index{border: 1px solid #12b7f5;width: 16px;line-height: 1;height: 16px;font-size: 14px;display: inline-block;text-align: center;color: #12b7f5;}
  46. .label-group{padding-left: 26px;}
  47. .label-group span{color: #12b7f5;font-size: 14px;line-height: 1;margin-top: 10px;}
  48. .label-blue{border-radius: 5px;border: solid 1px #12b7f5;padding: 4px 15px;display: inline-block;margin-right: 27px;}
  49. .panel-body{padding: 20px;font-size: 14px;color: #999;}
  50. .panelcurPage{border-bottom: 1px solid #d7dce6;}
  51. .service-content{line-height: 30px;padding-bottom: 15px;}
  52. .service-address{border-bottom: 1px solid #d7dce6;}
  53. .btn-yuyue{background-color: #02cfb9;color: #fff;}
  54. .btn-yuyue:hover,.btn-yuyue:link{color: #fff;background-color: #01c1ad;}
  55. .btn-fuwuma{background-color: #2dbe55;color: #fff;}
  56. .btn-fuwuma:hover,.btn-fuwuma:link{color: #fff;background-color: #209440;}
  57. .btn-zhidao{background-color: #12b7f5;color: #fff;}
  58. .btn-zhidao:hover,.btn-zhidao:link{color: #fff;background-color: #10a0d6;}
  59. .service-operation .btn{width: 90px;}
  60. .view-detail{color: #12b7f5;cursor: pointer;}
  61. .yslb>span:after{content: '、';}
  62. .yslb>span:last-child:after{display: none;}
  63. .btns-group{padding-left: 20px;}
  64. .btns-group .btn{margin-right: 20px;}
  65. .fuwuma-model{position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 9;}
  66. .fuwuma-layer{position: absolute;top: 0;left: 0;right: 0;bottom: 0;background-color: rgba(0,0,0,.35);}
  67. .fuwuma-content{width: 260px;height: 260px;top: 50%;position: absolute;margin-top: -130px;left: 50%;margin-left: -130px;}
  68. .fuwuma-content img{width: 100%;display: block;}
  69. </style>
  70. </head>
  71. <body>
  72. <div class="panel-group" id="app" v-cloak role="tablist" aria-multiselectable="true">
  73. <div class="panelcurPage" v-for="(service,index) in serviceData">
  74. <div class="panel-heading" role="tab" @click="changeCollapseIndex(index)">
  75. <h4 class="panel-title">
  76. <a role="button" class="flex-box">
  77. <div class="flex-box-item service-top">
  78. <p class="service-name"><span class="service-index">{{index+1}}</span><span>{{service.title}}</span></p>
  79. <div class="label-group">
  80. <span class="pull-right mt5"><i v-if="service.statusName=='已完成'" class="icon icon-gouxuan icon-18 mr5"></i>{{service.statusName}}</span>
  81. <span class="label-blue">{{service.shortExecuteTime}}</span>
  82. <span class="label-blue" v-for="doctor in service.executeDoctorList">{{doctor}}</span>
  83. </div>
  84. </div>
  85. <span class="icon icon-arrow-down ml50"></span>
  86. </a>
  87. </h4>
  88. </div>
  89. <div class="panel-collapse collapse" :class="{in:collapseIndex==index}" role="tabpanel" aria-labelledby="headingOne">
  90. <div class="panel-body">
  91. <div class="service-content">{{service.content}}</div>
  92. <div class="service-address ptb20">
  93. <div class="flex-box">
  94. <div class="flex-box-item">
  95. <p class="m0">地点:{{service.hospitalName}}</p>
  96. <p class="m0">时间:{{service.executeTime | formatDate}}</p>
  97. </div>
  98. <div class="flex-box-item">
  99. <p class="m0 yslb">执行:<span v-for="(doctor,index) in service.executeDoctorList">{{doctor}}</span></p>
  100. <p class="m0">收费:{{service.expense}}元</p>
  101. </div>
  102. </div>
  103. </div>
  104. <div class="service-operation pt10">
  105. <p><span class="pull-right view-detail" v-if="service.messageList.length" :class="{active:isCollapse}" @click="chakan"><i class="icon icon-check mr5 icon-16"></i>{{isCollapse?'收起详情':'查看详情'}}</span><span class="pull-right" v-if="!service.messageList.length">暂无记录</span>指导与汇报记录</p>
  106. <div class="record-list" :class="{active:isCollapse}">
  107. <div class="record-item" v-for="item in service.messageList">
  108. <div class="flex-box c-999 f14">
  109. <div class="flex-box-item">
  110. {{item.adminTeamName}}
  111. </div>
  112. <div class="flex-box-item">
  113. {{item.createTime}}
  114. </div>
  115. </div>
  116. <div class="f14 c-333">{{item.content}}</div>
  117. </div>
  118. </div>
  119. <div class="flex-box btns-group" v-if="service.isMyTask==1 || service.isZD">
  120. <button class="btn btn-yuyue" v-if="service.reserve==1" @click="qwapp">转诊预约</button>
  121. <button class="btn btn-yuyue" v-if="service.itemType==2 && service.operate!=1" @click="jkjy(service.patient,service.planDetaiId)">健康教育</button>
  122. <button class="btn btn-yuyue" v-if="service.itemType==3 && service.operate!=1" @click="jkzd(service.planDetaiId,service.patient)">健康指导</button>
  123. <button class="btn btn-yuyue" v-if="service.itemType==4 && service.operate!=1" @click="zwkf">随访</button>
  124. <button class="btn btn-zhidao" @click="zdly(service)" v-if="service.isZD">指导留言</button>
  125. <button class="btn btn-zhidao" @click="zdly(service)" v-if="service.isCK">查看留言</button>
  126. <button class="btn btn-fuwuma" v-if="service.itemType==1 && service.operate!=1" @click="fwm(service.planDetaiId,service.patient)">服务码</button>
  127. <!--<button class="btn btn-fuwuma" @click="fwm(service.planDetaiId,service.patient)">服务码</button>-->
  128. <button class="btn btn-fuwuma" v-if="service.operate==1" @click="goToFinish(service.planDetaiId)">完成</button>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. <div class="fuwuma-model" v-show="qrModal">
  135. <div class="fuwuma-layer" @click="qrModal=false"></div>
  136. <div class="fuwuma-content">
  137. <img :src="qrCode" width="300px" />
  138. </div>
  139. </div>
  140. </div>
  141. <script type="text/javascript" src="../../../js/vue.js"></script>
  142. <script type="text/javascript" src="../../../js/jquery-2.2.4.js"></script>
  143. <script type="text/javascript" src="../../../api/http-request.js"></script>
  144. <script type="text/javascript" src="../../../api/rehabilitation-api.js"></script>
  145. <script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
  146. <script type="text/javascript" src="../../../js/underscore.js"></script>
  147. <script type="text/javascript">
  148. !function(){
  149. var httpData=GetRequest();
  150. var userInfo = JSON.parse(window.localStorage.getItem(httpRequest.agentName));
  151. window.serviceItem=new Vue({
  152. el:"#app",
  153. data:{
  154. planids:httpData['planids'],
  155. serviceData:[],
  156. isCollapse :false,
  157. collapseIndex:0,
  158. qrCode:'',
  159. qrModal:false,
  160. },
  161. mounted:function(){
  162. this.getServiceItemList();
  163. },
  164. methods:{
  165. chakan:function(){
  166. this.isCollapse=!this.isCollapse;
  167. },
  168. changeCollapseIndex:function(idx){
  169. this.collapseIndex=idx;
  170. },
  171. qwapp:function(){
  172. top.layer.msg('请前往app处理',{icon:5});
  173. },
  174. //获取服务列表
  175. getServiceItemList:function(){
  176. var vm=this;
  177. var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent'));
  178. var loadding = top.layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
  179. rehaAPI.serviceItemList({planDetailIds:vm.planids}).then(function(res){
  180. top.layer.close(loadding);
  181. if(res.status==200){
  182. vm.serviceData=_.map(res.data||{},function(o){
  183. if(o.isMyTask==1){//执行者
  184. if(loginDoctor.doctorType!=1){//说明是家医
  185. o.isCK=true;//无法显示按钮
  186. }else{//专科
  187. o.isCK=false;
  188. }
  189. }else{
  190. if(loginDoctor.doctorType==o.specialistDoctorCode){//说明我自己是创建者
  191. o.isZD=false;//无法显示按钮
  192. }
  193. }
  194. return o
  195. })
  196. }else{
  197. top.layer.msg(res.msg,{icon:5});
  198. }
  199. })
  200. },
  201. //健康教育
  202. jkjy:function(patient,planId){
  203. var vm=this
  204. top.layer.open({
  205. type: 2,
  206. // offset: ['100px'], //右下角弹出
  207. area: ['800px', '648px'],
  208. shade: 0.5,
  209. title: '健康教育',
  210. fixed: true, //不固定
  211. maxmin: true,
  212. closeBtn: 1,
  213. shift: 5,
  214. shadeClose: false, //点击遮罩关闭层
  215. content: '../../article/html/article.html?code='+patient+'&planId='+planId+'&isReha=true'
  216. });
  217. },
  218. // 健康指导
  219. jkzd:function(patient,planId){
  220. var vm=this
  221. top.layer.open({
  222. type: 2,
  223. // offset: ['100px'], //右下角弹出
  224. area: ['800px', '648px'],
  225. shade: 0.5,
  226. title: '健康教育',
  227. fixed: true, //不固定
  228. maxmin: true,
  229. closeBtn: 1,
  230. shift: 5,
  231. shadeClose: false, //点击遮罩关闭层
  232. content:'../../guidance/html/index.html#/person-edit-panel?patient='+patient+'&planId='+planId
  233. });
  234. },
  235. // 暂未开放
  236. zwkf:function(){
  237. top.layer.msg('此功能暂未开放',{icon:1});
  238. },
  239. goToFinish:function(planid){
  240. top.layer.open({
  241. type: 2,
  242. // offset: ['100px'], //右下角弹出
  243. area: ['600px', '650px'],
  244. shade: 0.5,
  245. title: '完成项目确认',
  246. fixed: true, //不固定
  247. maxmin: true,
  248. closeBtn:1,
  249. shift: 5,
  250. shadeClose: false, //点击遮罩关闭层
  251. content: '../../rehabilitation/html/guide_the_message.html?planid='+planid
  252. });
  253. },
  254. fwm:function(planid,patient){
  255. this.loadSocket(planid,patient);
  256. },
  257. zdly:function(data){
  258. var vm = this
  259. var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent'));
  260. var otherCode,otherName;
  261. var planDetailId=data.planDetaiId;
  262. if(loginDoctor.doctorType==1){
  263. otherCode=data.familyDoctorCode;
  264. otherName=data.familyDoctorName;
  265. }else{
  266. otherCode=data.specialistDoctorCode;
  267. otherName=data.specialistDoctorName;
  268. }
  269. top.layer.open({
  270. type: 2,
  271. // offset: ['100px'], //右下角弹出
  272. area: ['800px', '650px'],
  273. shade: 0.5,
  274. title: '指导留言',
  275. fixed: true, //不固定
  276. maxmin: true,
  277. closeBtn:1,
  278. shift: 5,
  279. shadeClose: false, //点击遮罩关闭层
  280. content: '../../consulting/html/consulting.html?otherCode='+otherCode+'&otherName='+encodeURI(otherName)+'&planDetailId='+planDetailId,
  281. end:function(){ // 未点击确定按钮,点击关闭按钮
  282.       vm.getServiceItemList();
  283.     }
  284. });
  285. },
  286. loadSocket:function(planid,patient){
  287. var vm=this;
  288. var imurl=httpRequest.socketUrl;
  289. jQuery.getScript(imurl+"/socket.io/socket.io.js").done(function() {
  290. var type=2;//咨询类型
  291. var socket = io.connect(imurl);
  292. var sessionId = 'system';
  293. socket.emit('login', {userId: userInfo.uid, password: userInfo.uid,sessionId:sessionId,clientType:"doctor"});
  294. socket.on('message', function (data) {
  295. console.log(data);
  296. if(data.type==0){
  297. vm.checkAfterQrCode(planid,patient);
  298. }
  299. });
  300. socket.on('error', function (data) {
  301. console.log(data);
  302. });
  303. socket.on('ack', function (data) {
  304. console.log(data);
  305. vm.getQRCode(planid);
  306. });
  307. function getLocalTime(nS) {
  308. return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ');
  309. }
  310. })
  311. .fail(function() {
  312. top.layer.msg('服务码创建失败',{icon:5});
  313. });
  314. },
  315. checkAfterQrCode:function(planid,patient){
  316. var vm=this;
  317. var params={
  318. planDetailId:planid,
  319. patientCode: patient
  320. }
  321. rehaAPI.checkAfterQrCode(params).then(function(res){
  322. var icon=5;
  323. if(data.status==200){
  324. if(data.data){
  325. icon=1;
  326. vm.goToFinish(planid);
  327. }
  328. }
  329. top.layer.msg(res.msg,{icon:icon});
  330. })
  331. },
  332. getQRCode:function(planid){
  333. var vm=this;
  334. var loginDoctor = JSON.parse(window.localStorage.getItem('wlyyAgent'));
  335. var params={
  336. planDetailId:planid,
  337. doctorCode: loginDoctor.uid
  338. }
  339. rehaAPI.createServiceQrCode(params).then(function(res){
  340. console.log(res);
  341. if(res.status==200){
  342. vm.qrCode=res.data;
  343. setTimeout(function(){
  344. vm.qrModal=true;
  345. },100)
  346. }else{
  347. top.layer.msg('服务码获取失败',{icon:5});
  348. }
  349. })
  350. }
  351. },
  352. filters:{
  353. formatDate:function(value, format) {
  354. if(!value) return ;
  355. var fmt=format || "yyyy-MM-dd hh:mm";
  356. var date = new Date(value);
  357. if (/(y+)/.test(fmt)) {
  358. fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
  359. }
  360. let o = {
  361. 'M+': date.getMonth() + 1,
  362. 'd+': date.getDate(),
  363. 'h+': date.getHours(),
  364. 'm+': date.getMinutes(),
  365. 's+': date.getSeconds()
  366. };
  367. for (let k in o) {
  368. if (new RegExp(`(${k})`).test(fmt)) {
  369. let str = o[k] + '';
  370. fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : ('00' + str).substr(str.length));
  371. }
  372. }
  373. return fmt;
  374. }
  375. }
  376. })
  377. }()
  378. </script>
  379. </body>
  380. </html>