new_recover.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>新增康复安排</title>
  6. <link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
  7. <link rel="stylesheet" type="text/css" href="../../../css/cross.ui.css" />
  8. <link rel="stylesheet" type="text/css" href="../../../css/style.min.css" />
  9. <link rel="stylesheet" type="text/css" href="../css/new_recover.css" />
  10. </head>
  11. <body class="m0">
  12. <div id="app" v-cloak>
  13. <div class="c-position-a" style="top: -999px; left: -999px;" v-show="isTest"></div>
  14. <div class="re-title no-select">
  15. <div class="name">新增康复安排</div>
  16. </div>
  17. <div class="content clearfix">
  18. <div class="fl c-h100 w300 person_info c-border-r" style="overflow: hidden;">
  19. <div v-if="!patiInfo" class="c-h100" style="overflow: auto;">
  20. <div class="c-border-b c-t-center pt20">
  21. <div class="set-photo">
  22. <img src="../../../images/p-female.png" alt="居民头像" />
  23. </div>
  24. <p class="ptb10">患者名</p>
  25. </div>
  26. <div>
  27. <div class="no-result c-t-center pt20">
  28. <img src="../images/wushuju01_img.png" alt="无数据" />
  29. <p class="c-999">暂无相关信息</p>
  30. <div class="pt30">
  31. <span class="c-fff btn cur-pit plr10 ptb5 bgc-12b7f5 b-r-3" @click="selectPatient()">同步信息</span>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. <div v-else class="c-h100 plr10" style="overflow: auto;">
  37. <div class="c-t-center pt20 c-position-r">
  38. <div class="set-photo">
  39. <img :src="setPatImg(patiInfo.photo)" alt="居民头像" />
  40. </div>
  41. <h3 class="ptb10 m0 c-f16">{{patiInfo.name}}</h3>
  42. <span class="c-position-a set-qiehuan cur-pit" @click="selectPatient()"></span>
  43. </div>
  44. <h4 class="h30 m0 c-f14 c-border-b">基本信息</h4>
  45. <ul class="c-333 m0 p0 pb20">
  46. <li class="pt10"><span class="c-999">性&emsp;&emsp;别:</span>{{patiInfo.sex == 1 ? "男" : "女"}}</li>
  47. <li class="pt10"><span class="c-999">年&emsp;&emsp;龄:</span>{{patiInfo.age}}岁</li>
  48. <li class="pt10"><span class="c-999">身份证号:</span>{{patiInfo.idcard}}</li>
  49. <li class="pt10"><span class="c-999">地&emsp;&emsp;址:</span>{{patiInfo.address}}</li>
  50. </ul>
  51. <h4 class="h30 m0 c-f14 c-border-b">家庭医生</h4>
  52. <ul class="c-333 m0 p0 pb20">
  53. <li class="pt10"><span class="c-999">签约社区:</span>{{patiInfo.ssHospitalName || patiInfo.jtHospitalName}}</li>
  54. <li class="pt10"><span class="c-999">全科医生:</span>{{patiInfo.ssDoctorName || patiInfo.jtDoctorName}}</li>
  55. <li class="pt10"><span class="c-999">健&ensp;管&ensp;师:</span>{{patiInfo.ssDoctorHealthName || patiInfo.jtDoctorHealthName}}</li>
  56. </ul>
  57. <!--<h4 class="h30 m0 c-f14 c-border-b">诊疗信息</h4>
  58. <ul class="c-333 m0 p0 pb20">
  59. <li class="pt10"><span class="c-999">诊疗医院:</span>男</li>
  60. <li class="pt10"><span class="c-999">入院科室:</span>男</li>
  61. <li class="pt10"><span class="c-999">主治医师:</span>男</li>
  62. <li class="pt10"><span class="c-999">入院诊断:</span>男</li>
  63. <li class="pt10"><span class="c-999">出院诊断:</span>男</li>
  64. </ul>
  65. <h4 class="h30 m0 c-f14 c-border-b">出院小结</h4>
  66. <p class="m0 pt10 c-333">依旧本次判断,对新消息进行出院诊断做出以下结论:忧郁啥啥事等等等问题</p>-->
  67. </div>
  68. </div>
  69. <div class="fl c-h100 w-100-300">
  70. <div class="c-h100 plr5" v-if="!isPlan">
  71. <h4 class="m0 pl10 lh40 c-border-b">配置康复计划</h4>
  72. <div style="overflow: hidden; height: calc(100% - 41px);">
  73. <div style="overflow: auto; height: 100%;">
  74. <div class="un-select c-t-center pt45" v-if="!patiInfo">
  75. <img src="../images/wushuju_img.png" alt="" />
  76. <p class="c-999">您还没有选择居民</p>
  77. </div>
  78. <ul class="muban_con lh40 c-t-center pt30" v-else>
  79. <li class="mb20" v-for="(muban, index) in mubanList" :key="index" @click="addMuban(muban.id)">{{muban.title}}</li>
  80. <li class="addmuban-btn c-fff" @click="addMuban()">新增模板</li>
  81. </ul>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="clearfix c-h100" v-else>
  86. <div class="fl w-100-300 c-h100">
  87. <div class="plr5 c-h100-80">
  88. <h4 class="m0 pl10 lh40 c-border-b set-label">配置康复计划
  89. <span v-for="(label, index) in spanLabel" :key="index" class="fr ml20 pl20 c-f14 c-999 cur-pit" :class="{'active': index == labelIndex}" @click="setLabelIndex(index, label)">{{label.labelName}}</span>
  90. </h4>
  91. <div class="c-h100-41" style="overflow: hidden;">
  92. <ul class="c-h100 p0 m0" style="overflow: auto;">
  93. <li class="mt10 plr10 ptb5 c-border b-r-3 clearfix" v-for="(detail, index) in templateDetail" :key="index">
  94. <div class="fl w-100-78 c-333">
  95. <p class="m0 p0 mb10 txt-ells cur-pit" @click="lookProject(detail)">{{detail.specialistServiceItemDO.title}}</p>
  96. <div class="clearfix">
  97. <p class="m0 mb5 mr20 p0 fl"><span class="c-999">医&emsp;&emsp;院:</span>{{detail.hospitalName}}</p>
  98. <div class="m0 mb5 mr20 p0 fl clearfix">
  99. <span class="fl c-999">执行人员:</span>
  100. <div class="fl c-position-r w100">
  101. <p class="m0 p0 plr10 c-border cur-pit set-xia" :class="{'set-shang':detail.selectDoc}" @click="changeSelectDoc(index, detail.selectDoc)">{{detail.executeDoctorName}}</p>
  102. <ul class="m0 p0 c-border-b c-border-l c-border-r c-position-a doc_list" v-if="detail.selectDoc">
  103. <li class="plr10 c-border-t cur-pit" v-for="(list, indDoc) in detail.docList" :key="indDoc" @click="selectLi(index, list)">{{list.name}}</li>
  104. </ul>
  105. </div>
  106. </div>
  107. <p class="m0 mb5 p0 fl"><span class="c-999">费&emsp;&emsp;用:</span>{{detail.expense}}{{detail.specialistServiceItemDO.unit}}</p>
  108. </div>
  109. <div class="m0 p0 lh18 clearfix">
  110. <span class="fl c-999">计划时间:</span>
  111. <p class="fl lh18 mb5 mr20 clearfix" v-for="(time, ind) in detail.specialistServiceItemDO.executeTime" :key="ind" v-if="detail.specialistServiceItemDO.executeTime.length">
  112. <span class="fl">{{time}}</span><span class="fl ml5 sub-tap cur-pit" @click="spliceTimeArr(index, ind)"></span>
  113. </p>
  114. <span class="fl c-12b7f5 cur-pit calendar" contenteditable="true" readonly @mousedown="selectTime(index)" class=flatpickr data-enable-time=true data-time_24hr=true>添加</span>
  115. <span class="fl c-12b7f5 cur-pit ml10" v-show="sureIndex == index">确定</span>
  116. </div>
  117. </div>
  118. <div class='fr w60 c-t-right clearfix'>
  119. <p class="m0 p0 mb10">×{{detail.specialistServiceItemDO.executeTime.length}}</p>
  120. <div class="fr sub-tap cur-pit" @click="subTemplate(index, detail)"></div>
  121. </div>
  122. </li>
  123. <li class="pt100 c-t-center" v-if="!templateDetail.length">
  124. 请在右侧“服务项”列表中选择
  125. </li>
  126. </ul>
  127. </div>
  128. </div>
  129. <div>
  130. <p class="m0 p0 pl20 ptb10 c-border-b set-label">支付方式:<span class="ml10 pl20 active">按服务支付</span><em class="c-red ml20">(按选择支付方式完成收费)</em></p>
  131. <div class="pl20 lh40">总费用:
  132. <span class="c-red c-f16">¥{{allFee}}</span>
  133. <span class="fr lh30 cur-pit w80 c-t-center c-fff" :class="allFee ? 'bgc-12b7f5' : 'bgc-999'" @click="createRehabilitationPlan()">生成计划</span>
  134. <span class="fr lh30 cur-pit w80 c-t-center bgc-green c-fff" @click="canclePlan()">取消</span>
  135. </div>
  136. </div>
  137. </div>
  138. <div class="fr w300 c-h100 c-border-l">
  139. <div class="plr5 c-h100">
  140. <h4 class="m0 pl10 lh40 c-border-b">添加其他项目</h4>
  141. <div class="clearfix mtb10 c-border">
  142. <input class="fl search-input plr10" type="text" v-model="searchKey" placeholder="输入项目名称" />
  143. <span class="fr search-btn" @click="searchProject()"></span>
  144. </div>
  145. <div class="c-h100-99" style="overflow: hidden;">
  146. <ul class="c-h100 p0 m0" style="overflow: auto;">
  147. <li v-for="(project1, index) in projectList" :key="index">
  148. <h4 class="set-arrow c-f14 h30 p0 m0 pl20 cur-pit" :class="{'active': index == proIndex1}" @click="selectPro(1, index)">{{project1.itemType == 1 ? '康复服务' : '健康服务'}}</h4>
  149. <ul class="c-h100 p0 m0 pl10" v-if="index == proIndex1">
  150. <li v-for="(project2, index2) in project1.item" :key="index2">
  151. <p class="set-arrow h30 c-f14 pl20 m0 c-333 cur-pit" :class="{'active': index2 == proIndex2}" @click="selectPro(2, index2)">{{project2.itemName}}</p>
  152. <ul class="p0 m0 pr10" v-if="index2 == proIndex2">
  153. <li v-for="(project3, index3) in project2.hospitalServiceItems" :key="index3" class="clearfix ptb5">
  154. <div class="fl project c-border w-100-66 cur-pit border-c12b7f5 ptb5 plr5 b-r-3 clearfix" @click="selectProject(index, index2, index3, project3)">
  155. <p class="fl w-100-78 txt-ells lh18">{{project3.specialistServiceItemDO.title}}</p>
  156. <span class="fr lh18 b-r-3 c-f12 ml5 bgc-green plr5 c-fff" v-if="project3.flag == 1 || project3.flag == 3">社区</span>
  157. <span class="fr lh18 b-r-3 c-f12 ml5 bgc-12b7f5 plr5 c-fff" v-if="project3.flag == 2 || project3.flag == 3">医院</span>
  158. </div>
  159. <span class="fr h30 btn cur-pit plr10 bgc-12b7f5 c-fff b-r-3" v-if="!project3.isSelect" @click="addProject(index, index2, index3, project3)">添加</span>
  160. <span class="fr h30 btn plr10 bgc-e1e1e1 c-fff b-r-3" v-else>添加</span>
  161. </li>
  162. </ul>
  163. </li>
  164. </ul>
  165. </li>
  166. </ul>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. <script src="../../../js/vue.js" type="text/javascript" charset="utf-8"></script>
  175. <script src="../../../js/jquery-2.2.4.js"></script>
  176. <script src="../../../plugins/layer/layer.min.js"></script>
  177. <script src="../../../js/bootstrap.min.js"></script>
  178. <script src="../../../js/es6-promise.js" type="text/javascript" charset="utf-8"></script>
  179. <script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
  180. <script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
  181. <link rel="stylesheet" href="../../../js/flatpickr/flatpickr.min.css">
  182. <script src="../../../js/flatpickr/flatpickr.min.js"></script>
  183. <script src="../../../api/http-request.js" type="text/javascript"></script>
  184. <script src="../../../api/recover_api.js" type="text/javascript"></script>
  185. <script type="text/javascript">
  186. var doctorType = (JSON.parse(window.localStorage.getItem('wlyyAgent'))||{}).doctorType,
  187. docInfo = JSON.parse(window.localStorage.getItem('wlyyAgent'))
  188. var httpData=GetRequest()
  189. function showSuccessMessage(msg) {
  190. layer.msg(msg, {
  191. icon: 1
  192. })
  193. }
  194. function showErrorMessage(msg) {
  195. layer.msg(msg, {
  196. icon: 5
  197. })
  198. }
  199. function showWarningMessage(msg) {
  200. layer.msg(msg, {
  201. icon: 2
  202. })
  203. }
  204. function showInfoMessage(msg) {
  205. layer.msg(msg, {
  206. icon: 6
  207. })
  208. }
  209. // 初始化加载flatpickr插件
  210. // $(".calendar").flatpickr();
  211. recoverVue = new Vue({
  212. el: "#app",
  213. data: {
  214. isTest: false,
  215. pati: null,
  216. isPlan: false,
  217. proIndex1: null,
  218. proIndex2: null,
  219. patiInfo: null,
  220. diseaseObj: null,
  221. mubanList: [],
  222. sureIndex: null,
  223. templateDetail: [],
  224. templateResult: [],
  225. allFee: 0,
  226. projectList: null,
  227. labelIndex: 2,
  228. labelCode: 1,
  229. spanLabel: [{
  230. labelName: "(转)家庭病床",
  231. code: 3
  232. }, {
  233. labelName: "(转)社区医院",
  234. code: 2
  235. }, {
  236. labelName: "康复计划",
  237. code: 1
  238. }],
  239. jDlist: null,
  240. zDlist: null,
  241. selectProjectDetail: null,
  242. searchKey: null
  243. },
  244. mounted: function() {
  245. },
  246. methods: {
  247. // 获取居民信息
  248. getPatientInfo: function() {
  249. this.findPatientSignSpecialistInfo()
  250. var vm = this,
  251. loadding = layer.load(0, {shade: false}),
  252. params = {
  253. patient: this.pati.patient
  254. }
  255. recoverAPI.getPatientInfo(params).then(function(res) {
  256. layer.close(loadding)
  257. if(res.status == 200) {
  258. vm.patiInfo = res.data
  259. console.log(vm.patiInfo)
  260. vm.jDlist = [{
  261. name: vm.patiInfo.ssDoctorName || vm.patiInfo.jtDoctorName,
  262. code: vm.patiInfo.ssDoctor || vm.patiInfo.jtDoctor
  263. }, {
  264. name: vm.patiInfo.ssDoctorHealthName || vm.patiInfo.jtDoctorHealthName,
  265. code: vm.patiInfo.ssDoctorHealth || vm.patiInfo.jtDoctorHealth
  266. }]
  267. } else {
  268. showErrorMessage(res.msg);
  269. }
  270. })
  271. },
  272. findPatientSignSpecialistInfo: function() {
  273. var vm = this,
  274. params = {
  275. patient: this.pati.patient,
  276. doctor: docInfo.uid
  277. }
  278. recoverAPI.findPatientSignSpecialistInfo(params).then(function(res) {
  279. if(res.status == 200) {
  280. vm.zDlist = [{
  281. name: res.data.doctorName,
  282. code: res.data.doctor
  283. }, {
  284. name: res.data.healthAssistantName,
  285. code: res.data.healthAssistant
  286. }]
  287. } else {
  288. showErrorMessage(res.msg);
  289. }
  290. })
  291. },
  292. // 模板列表
  293. findTemplateList: function() {
  294. var vm = this,
  295. loadding = layer.load(0, {shade: false}),
  296. params = {
  297. patient: this.pati.patient,
  298. doctor: docInfo.uid
  299. }
  300. recoverAPI.findTemplateList(params).then(function(res) {
  301. layer.close(loadding)
  302. if(res.status == 200) {
  303. vm.mubanList = res.data
  304. } else {
  305. showErrorMessage(res.msg);
  306. }
  307. })
  308. },
  309. // 模板详细
  310. findTemplateDetail: function(templateId) {
  311. var vm = this,
  312. loadding = layer.load(0, {shade: false}),
  313. params = {
  314. templateId: templateId
  315. }
  316. recoverAPI.findTemplateDetail(params).then(function(res) {
  317. layer.close(loadding)
  318. if(res.status == 200) {
  319. vm.templateDetail = []
  320. vm.templateResult = res.data
  321. vm.findServiceItemsByHospital()
  322. } else {
  323. showErrorMessage(res.msg);
  324. }
  325. })
  326. },
  327. // 服务项目列表
  328. findServiceItemsByHospital: function() {
  329. var vm = this,
  330. loadding = layer.load(0, {shade: false}),
  331. params = {
  332. doctor: docInfo.uid,
  333. patient: this.pati.patient,
  334. serviceItemName: this.searchKey
  335. }
  336. recoverAPI.findServiceItemsByHospital(params).then(function(res) {
  337. layer.close(loadding)
  338. if(res.status == 200) {
  339. vm.projectList = $.each(res.data[0], function(index, o) {
  340. $.each(vm.templateResult, function(index1, o1) {
  341. if(o1.specialistServiceItemDO.itemType == o.itemType) {
  342. $.each(o.item, function(index2, o2) {
  343. if(o1.specialistServiceItemDO.diseaseItem == o2.itemName) {
  344. $.each(o2.hospitalServiceItems, function(index3, o3) {
  345. if(o3.serviceItemId == o1.serviceItemId) {
  346. o3.isSelect = true
  347. o3.selectDoc = false
  348. o3.specialistServiceItemDO.executeTime = []
  349. if(o3.flag == 2) {
  350. o3.executeDoctor = vm.zDlist[0].code
  351. o3.executeDoctorName = vm.zDlist[0].name
  352. o3.docList = vm.zDlist
  353. } else {
  354. o3.executeDoctor = vm.jDlist[0].code
  355. o3.executeDoctorName = vm.jDlist[0].name
  356. o3.docList = vm.jDlist
  357. }
  358. vm.templateDetail.push(o3)
  359. }
  360. });
  361. }
  362. });
  363. }
  364. });
  365. return o;
  366. });
  367. } else {
  368. showErrorMessage(res.msg);
  369. }
  370. })
  371. },
  372. searchProject: function() {
  373. this.findServiceItemsByHospital()
  374. },
  375. setPatImg: function(src) {
  376. if(!src) {
  377. return "../../../images/p-female.png"
  378. } else {
  379. var str = httpRequest.getImgUrl(src);
  380. return str
  381. }
  382. },
  383. changeSelectDoc: function(index, bool) {
  384. this.templateDetail[index].selectDoc = !bool
  385. this.isTest = !this.isTest
  386. },
  387. selectLi: function(index, list) {
  388. this.templateDetail[index].selectDoc = false
  389. this.templateDetail[index].executeDoctor = list.code
  390. this.templateDetail[index].executeDoctorName = list.name
  391. this.templateDetail[index] = this.templateDetail[index]
  392. this.isTest = !this.isTest
  393. },
  394. subTemplate: function(index, detail) {
  395. var vm = this
  396. this.templateDetail.splice(index, 1)
  397. var len = detail.specialistServiceItemDO.executeTime.length
  398. if(len) {
  399. this.allFee -= (len * detail.expense)
  400. }
  401. $.each(vm.projectList, function(index, o) {
  402. if(detail.specialistServiceItemDO.itemType == o.itemType) {
  403. $.each(o.item, function(index2, o2) {
  404. if(detail.specialistServiceItemDO.diseaseItem == o2.itemName) {
  405. $.each(o2.hospitalServiceItems, function(index3, o3) {
  406. if(o3.serviceItemId == detail.serviceItemId) {
  407. o3.isSelect = false
  408. o3.specialistServiceItemDO.executeTime = []
  409. }
  410. });
  411. }
  412. });
  413. }
  414. });
  415. },
  416. // 选择项目
  417. selectProject: function(index, index2, index3, o) {
  418. this.selectProjectDetail = o
  419. selectPatientIndex = layer.open({
  420. type: 2,
  421. area: ['400px', '500px'],
  422. shade: 0.5,
  423. title: '选择项目',
  424. closeBtn: 1,
  425. shift: 5,
  426. shadeClose: false, //点击遮罩关闭层
  427. content: "select-project.html?isLook=true&projectId=" + o.id + "&index=" + index + "&index3=" + index3 + "&index2=" + index2
  428. });
  429. },
  430. // 添加项目
  431. addProject: function(index, index2, index3, obj) {
  432. if(obj) {
  433. this.selectProjectDetail = obj
  434. }
  435. if(this.selectProjectDetail.isSelect) {
  436. showWarningMessage("已添加!")
  437. return false;
  438. }
  439. this.selectProjectDetail.isSelect = true
  440. this.selectProjectDetail.selectDoc = false
  441. this.selectProjectDetail.specialistServiceItemDO.executeTime = []
  442. if(this.selectProjectDetail.flag == 2) {
  443. this.selectProjectDetail.executeDoctor = this.zDlist[0].code
  444. this.selectProjectDetail.executeDoctorName = this.zDlist[0].name
  445. this.selectProjectDetail.docList = this.zDlist
  446. } else {
  447. this.selectProjectDetail.executeDoctor = this.jDlist[0].code
  448. this.selectProjectDetail.executeDoctorName = this.jDlist[0].name
  449. this.selectProjectDetail.docList = this.jDlist
  450. }
  451. this.templateDetail.push(this.selectProjectDetail)
  452. this.projectList[index].item[index2].hospitalServiceItems[index3] = this.selectProjectDetail
  453. },
  454. // 查看项目
  455. lookProject: function(o) {
  456. selectPatientIndex = layer.open({
  457. type: 2,
  458. area: ['400px', '500px'],
  459. shade: 0.5,
  460. title: '查看项目',
  461. closeBtn: 1,
  462. shift: 5,
  463. shadeClose: false, //点击遮罩关闭层
  464. content: "select-project.html?projectId=" + o.id
  465. });
  466. },
  467. selectPatient: function() {
  468. selectPatientIndex = layer.open({
  469. type: 2,
  470. area: ['400px', '500px'],
  471. shade: 0.5,
  472. title: '同步出院小结',
  473. closeBtn: 1,
  474. shift: 5,
  475. shadeClose: false, //点击遮罩关闭层
  476. content: "select-patient.html"
  477. });
  478. },
  479. selectPatientOk: function(pati) {
  480. this.isPlan = false
  481. this.pati = pati
  482. this.getPatientInfo()
  483. this.findTemplateList()
  484. },
  485. addMuban: function(oId) {
  486. var vm = this
  487. selectDiseaseIndex = layer.open({
  488. type: 2,
  489. area: ['400px', '500px'],
  490. shade: 0.5,
  491. title: '选择疾病',
  492. closeBtn: 1,
  493. shift: 5,
  494. shadeClose: false, //点击遮罩关闭层
  495. content: "select-disease.html?teamCode=" + vm.pati.teamCode +"&templateId=" + oId || ''
  496. });
  497. },
  498. canclePlan: function(obj) {
  499. this.isPlan = false
  500. },
  501. newPlan: function(disease, templateId) {
  502. this.diseaseObj = disease
  503. this.isPlan = true
  504. if(templateId) {
  505. this.findTemplateDetail(templateId)
  506. } else {
  507. this.templateDetail = []
  508. this.findServiceItemsByHospital()
  509. }
  510. },
  511. selectPro: function(pro, index) {
  512. if(pro == 1) {
  513. this.proIndex2 = null;
  514. this.proIndex1 == index ? this.proIndex1 = null : this.proIndex1 = index
  515. } else {
  516. this.proIndex2 == index ? this.proIndex2 = null : this.proIndex2 = index
  517. }
  518. },
  519. setLabelIndex: function(index, label) {
  520. this.labelIndex = index
  521. this.labelCode = label.code
  522. },
  523. selectTime: function(index) {
  524. var currentEle = $(event.target),
  525. vm = this;
  526. this.sureIndex = index
  527. currentEle.flatpickr({
  528. defaultDate: currentEle.val(),
  529. minDate: "today",
  530. enableTime: true,
  531. onOpen: function(obj, str) {
  532. currentEle.val(str)
  533. },
  534. onClose: function(obj, str) {
  535. if(!str) {
  536. return false;
  537. }
  538. vm.sureIndex = null
  539. vm.templateDetail[index].specialistServiceItemDO.executeTime.push(str)
  540. vm.allFee += Number(vm.templateDetail[index].expense)
  541. }
  542. })
  543. },
  544. spliceTimeArr: function(index, ind) {
  545. this.templateDetail[index].specialistServiceItemDO.executeTime.splice(ind, 1)
  546. this.allFee -= Number(this.templateDetail[index].expense)
  547. },
  548. createRehabilitationPlan: function() {
  549. if(!this.allFee) {
  550. showWarningMessage("请选择计划时间!")
  551. return false;
  552. }
  553. var vm = this,
  554. loadding = layer.load(0, {shade: false}),
  555. data = {
  556. patient: this.pati.patient,
  557. name: this.pati.patientName,
  558. title: this.pati.patientName + this.diseaseObj.diseaseName + "康复计划",
  559. disease: this.diseaseObj.diseaseCode,
  560. diseaseName: this.diseaseObj.diseaseName,
  561. planType: this.labelCode,
  562. payment: 2,
  563. totalExpense: this.allFee,
  564. detail: []
  565. },
  566. params = {};
  567. $.each(vm.templateDetail, function(index, o) {
  568. if(o.specialistServiceItemDO.executeTime.length) {
  569. var obj = {
  570. hospitalServiceItemId: o.id,
  571. type: o.flag == 2 ? 2 : 1,
  572. doctor: o.executeDoctor,
  573. doctorName: o.executeDoctorName,
  574. executeTime: o.specialistServiceItemDO.executeTime.join(",")
  575. }
  576. data.detail.push(obj)
  577. }
  578. });
  579. params = {
  580. json: JSON.stringify(data)
  581. }
  582. recoverAPI.createRehabilitationPlan(params).then(function(res) {
  583. layer.close(loadding)
  584. if(res.status == 200) {
  585. showSuccessMessage("康复计划配置成功!")
  586. setTimeout(function() {
  587. window.location.href = "../../rehabilitation/html/health_control.html"
  588. }, 1000)
  589. } else {
  590. showErrorMessage(res.msg);
  591. }
  592. })
  593. }
  594. }
  595. })
  596. </script>
  597. </body>
  598. </html>