new_recover.html 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669
  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/cross.css" />
  8. <link rel="stylesheet" type="text/css" href="../../../css/cross.ui.css" />
  9. <link rel="stylesheet" type="text/css" href="../../../css/style.min.css" />
  10. <link href="../../../plugins/toastr/toastr.min.css" rel="stylesheet">
  11. <link rel="stylesheet" type="text/css" href="../../../css/element-ui.css" />
  12. <link rel="stylesheet" type="text/css" href="../css/new_recover.css" />
  13. <script src="../../../js/esModule.js" type="text/javascript"></script>
  14. <style>
  15. .c-row{
  16. width: 100%;
  17. }
  18. </style>
  19. </head>
  20. <body class="m0">
  21. <div id="app" v-cloak>
  22. <div class="c-position-a" style="top: -999px; left: -999px;" v-show="isTest"></div>
  23. <div class="c-h100 clearfix">
  24. <div class="fl c-h100 w400 person_info c-border-r" style="overflow: hidden;">
  25. <div v-if="!patiInfo" class="c-h100" style="overflow: auto;">
  26. <div class="c-border-b c-t-center pt20">
  27. <div class="set-photo imgw80">
  28. <img src="../../../images/p-female.png" alt="居民头像" />
  29. </div>
  30. <p class="ptb10">患者名</p>
  31. </div>
  32. <div>
  33. <div class="no-result c-t-center pt20">
  34. <img src="../images/wushuju01_img.png" alt="无数据" />
  35. <p class="c-999">暂无相关信息</p>
  36. <div class="pt30">
  37. <span class="c-fff btn cur-pit plr10 ptb5 bgc-12b7f5 b-r-3" @click="selectPatient()">同步信息</span>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. <div v-else class="c-h100 plr10" style="overflow: auto;">
  43. <div class="c-t-center pt20 c-position-r">
  44. <div class="set-photo imgw80">
  45. <img :src="setPatImg(patiInfo.photo)" alt="居民头像" />
  46. </div>
  47. <h3 class="ptb10 m0 c-f16">{{patiInfo.name}}</h3>
  48. <span v-if="!isEditConfig" class="c-position-a set-qiehuan cur-pit" @click="selectPatient()"></span>
  49. </div>
  50. <h4 class="h30 m0 c-f14 c-border-b f-w500">基本信息</h4>
  51. <ul class="c-333 m0 p0 pb20">
  52. <li class="pt10"><span class="c-999">性&emsp;&emsp;别:</span>{{patiInfo.sex == 1 ? "男" : "女"}}</li>
  53. <li class="pt10"><span class="c-999">年&emsp;&emsp;龄:</span>{{patiInfo.age}}岁</li>
  54. <li class="pt10"><span class="c-999">身份证号:</span>{{patiInfo.idcard}}</li>
  55. <li class="pt10"><span class="c-999">地&emsp;&emsp;址:</span>{{patiInfo.address}}</li>
  56. </ul>
  57. <h4 class="h30 m0 c-f14 c-border-b f-w500">家庭医生</h4>
  58. <ul class="c-333 m0 p0 pb20">
  59. <li class="pt10"><span class="c-999">签约社区:</span>{{patiInfo.ssHospitalName || patiInfo.jtHospitalName}}</li>
  60. <li class="pt10"><span class="c-999">全科医生:</span>{{patiInfo.ssDoctorName || patiInfo.jtDoctorName}}</li>
  61. <li class="pt10"><span class="c-999">健&ensp;管&ensp;师:</span>{{patiInfo.ssDoctorHealthName || patiInfo.jtDoctorHealthName}}</li>
  62. </ul>
  63. <h4 class="h30 m0 c-f14 c-border-b f-w500" style="overflow: hidden;">
  64. 康复建议
  65. <span v-if="!isEditConfig" class="click-text" @click="editAdviceTextarea">
  66. {{isEdit == true? '编辑':'保存'}}
  67. </span>
  68. </h4>
  69. <textarea v-bind:disabled="isEdit||isEditConfig" v-model="adviceContent" class="m0 p10 c-333 mt10" :class="{'bg-f5f5fa':isEdit, 'bd-red':showAdviceContentTip}" style="width: 100%;height: 200px; width: 100%; border:1px solid #e1e1e1; resize:none;" placeholder="请输入您的康复建议..."></textarea>
  70. <h4 class="h30 m0 c-f14 c-border-b f-w500" style="overflow: hidden;">
  71. 住院病历
  72. </h4>
  73. <div v-if="medicalRecordsList.length>0" v-for="(o, i) in medicalRecordsList" class="mt10">
  74. <div class="flex vc c-f14 c-border plr10 ptb5 link-control" style="cursor: pointer;" @click="editMedicalRecords(o, i)" :class="{'bd-12b7f5': curMedicalRecordsIndex==i}">
  75. <span class="c-666 mr15">
  76. {{formatter(o.admissionTime||o.createTime)}}
  77. </span>
  78. <div class="flex1 c-12b7f5 ellipsis-1">
  79. {{o.hospitalName}}
  80. </div>
  81. </div>
  82. </div>
  83. <div v-if="!isEditConfig&&medicalRecordsList.length==0" class="ui-grid">
  84. <button type="button" class="ui-col-1 btn btn-default fr mr5" style="width: 100%; background: #12B7F5; border-radius: 0px ;border: 0px ;padding: 10px;margin-top: 15px;" @click="comMedicalRecords()">同步病历</button>
  85. <button type="button" class="ui-col-1 btn btn-default fr ml5" style="width: 100%; background: #12B7F5; border-radius: 0px ;border: 0px ;padding: 10px;margin-top: 15px;" @click="addMedicalRecords()">手动上传</button>
  86. </div>
  87. </div>
  88. </div>
  89. <div class="fl c-h100 w-100-400">
  90. <div class="c-h100 plr5" v-if="!isPlan&&!isEditConfig">
  91. <h4 class="m0 pl15 lh40 c-border-b f-w500 c-position-r"><span class="c-position-a set-blue-span"></span>配置康复计划</h4>
  92. <div style="overflow: hidden; height: calc(100% - 41px);">
  93. <div style="overflow: auto; height: 100%;">
  94. <div class="un-select c-t-center pt45" v-if="!patiInfo">
  95. <img src="../images/wushuju_img.png" alt="" />
  96. <p class="c-999">您还没有选择居民</p>
  97. </div>
  98. <ul class="muban_con lh40 c-t-center pt30" v-else>
  99. <li class="mb20" v-for="(muban, index) in mubanList" :key="index" @click="addMuban(muban.id)">{{muban.title}}</li>
  100. <li class="addmuban-btn c-fff" @click="addMuban()">新增模板</li>
  101. </ul>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="clearfix c-h100" v-else>
  106. <div class="fl c-h100" :class="{'c-row':isEditConfig, 'w-100-400':!isEditConfig}">
  107. <div class="plr5 c-h100-79 mb40">
  108. <h4 class="m0 pl15 lh40 c-border-b set-label f-w500 c-position-r">
  109. <em class="c-position-a set-blue-span"></em>
  110. 配置康复计划
  111. <!-- <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> -->
  112. </h4>
  113. <div class="ui-col-1 mt20 mr20 c-t-right">
  114. <img style="width: 24px;height: 24px;" @click="switchWay" src="../images/switch.png"></img><span @click="switchWay" class="ml5 c-f14">{{selectWay=='during'?'切换为时间点':'切换为时间段'}}</span>
  115. </div>
  116. <div class="c-h100-41" style="overflow: hidden;">
  117. <ul class="c-h100 p0 m0" style="overflow: auto;">
  118. <li class="mt10 plr10 ptb5 c-border b-r-3 clearfix" v-for="(detail, index) in templateDetail" :key="index">
  119. <div v-if="detail.code=='2'||detail.code=='3'">
  120. <div class="fl w-100-78 c-333">
  121. <p :class='detail.isTimeSame ? "m0 p0 mb10 txt-ells cur-pit c-red" : "m0 p0 mb10 txt-ells cur-pit"'>{{detail.name}}</p>
  122. <div class="clearfix">
  123. <p class="w400 m0 mb10 p0 fl"><span class="c-999">医&emsp;&emsp;院:</span>{{docInfo.hospitalName}}</p>
  124. <p class="m0 p0 mb10 fl"><span class="c-999">费&emsp;&emsp;用:</span>{{detail.expense}}</p>
  125. </div>
  126. <div class="m0 p0 clearfix">
  127. <div class="w400 m0 mb10 p0 fl clearfix">
  128. <span class="fl c-999">选择频次:</span>
  129. <div class="fl c-position-r w100">
  130. 不限频次
  131. </div>
  132. </div>
  133. </div>
  134. <div class="clearfix">
  135. <span class="fl c-999">备&emsp;&emsp;注:</span>
  136. <div class="fl maxw600 plr15 ptb10 c-border set-textarea">
  137. <textarea placeholder="不补充说明特殊用法、方式" v-model="detail.remark" name="" rows="" cols=""></textarea>
  138. </div>
  139. </div>
  140. </div>
  141. <div class='fr w60 c-t-right clearfix'>
  142. <div class="clearfix mb10"><span class="fr sub-tap cur-pit" @click="subTemplate(index, detail)"></span></div>
  143. </div>
  144. </div>
  145. <div v-else>
  146. <div class="fl w-100-78 c-333">
  147. <p :class='detail.isTimeSame ? "m0 p0 mb10 txt-ells cur-pit c-red" : "m0 p0 mb10 txt-ells cur-pit"'>{{detail.name}}</p>
  148. <div class="clearfix">
  149. <p class="w400 m0 mb10 p0 fl"><span class="c-999">医&emsp;&emsp;院:</span>{{detail.executeHospitalName}}</p>
  150. <p class="m0 p0 mb10 fl"><span class="c-999">费&emsp;&emsp;用:</span>{{detail.expense}}</p>
  151. </div>
  152. <div class="m0 p0 clearfix">
  153. <!-- 选择频次 时间点multiple/ 默认时间段during -->
  154. <div class="w400 m0 mb10 p0 fl clearfix">
  155. <span class="fl c-999">选择频次:</span>
  156. <div class="fl c-position-r custom-dropdown">
  157. <p class="m0 p0 plr10 c-border cur-pit set-xia" :class="{'set-shang':detail.selectFre}" @click="changeSelectFre(index, detail.selectFre)">{{detail.frequencyName}}</p>
  158. <ul class="m0 p0 c-border-b c-border-l c-border-r c-position-a doc_list" v-if="detail.selectFre" style="overflow-y: auto; height: 100px;">
  159. <li class="plr10 c-border-t cur-pit" v-for="(list, indDoc) in detail.frequencyList" :key="indDoc" @click="selectFre(index, list)">{{list.name}}</li>
  160. </ul>
  161. </div>
  162. </div>
  163. <div v-if="detail.frequencyName!='不限频次'" class="m0 mb10 p0 fl clearfix">
  164. <span class="fl c-999">执行人员:</span>
  165. <div class="fl c-position-r custom-dropdown">
  166. <p class="m0 p0 plr10 c-border cur-pit set-xia" :class="{'set-shang':detail.selectDoc}" @click="changeSelectDoc(index, detail.selectDoc)">{{detail.executeDoctorName}}</p>
  167. <ul class="m0 p0 c-border-b c-border-l c-border-r c-position-a doc_list" v-if="detail.selectDoc" style="overflow-y: auto; max-height: 100px;">
  168. <li class="plr10 c-border-t cur-pit" v-for="(list, indDoc) in detail.docList" :key="indDoc" @click="selectLi(index, list)">{{list.name}}</li>
  169. </ul>
  170. </div>
  171. </div>
  172. </div>
  173. <!-- <div v-if="detail.frequencyName!='不限频次'" class="pl65 mb10 set-label" v-if="detail.frequency.unit == 'H'">
  174. <span :class="detail.timeType == 1 ? 'pl20 mr5 cur-pit active' : 'pl20 mr5 cur-pit'" @click="selectTimeType(index, 1)">白天</span>
  175. <span :class="detail.timeType == 2 ? 'pl20 mr5 cur-pit active' : 'pl20 mr5 cur-pit'" @click="selectTimeType(index, 2)">晚上</span>
  176. <span :class="detail.timeType == 0 ? 'pl20 cur-pit active' : 'pl20 cur-pit'" @click="selectTimeType(index, 0)">全天</span>
  177. </div> -->
  178. <div v-if="detail.frequencyName!='不限频次'">
  179. <div class="clearfix">
  180. <span class="fl c-999 lh24">起始时间:</span>
  181. <div v-if="detail.mode=='during'">
  182. <div class="fl maxw600 mb10">
  183. <el-date-picker v-model="detail.value14[0]" type="date" placeholder="开始日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions1" @input="getRandgeDate(index, 0)">
  184. </el-date-picker>
  185. <span>—</span>
  186. <el-date-picker v-model="detail.value14[1]" type="date" placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions1" @input="getRandgeDate(index, 1)">
  187. </el-date-picker>
  188. </div>
  189. </el-date-picker>
  190. <span class="fl lh24 mlr10 c-999">或</span>
  191. <div class="fl maxw600 mb10">
  192. <el-date-picker type="dates" :picker-options="pickerOptions1" v-model="detail.value15" value-format="yyyy-MM-dd" @input="getSelectDate(index)" placeholder="选择一个或者多个日期"></el-date-picker>
  193. </div>
  194. </div>
  195. <!-- 设置周几 根据所选择频率获取对应数组 -->
  196. <div v-if="detail.mode=='multiple'" class="fl maxw600 mb10 setInput">
  197. <el-select v-model="detail.dateCode" placeholder="请选择" @focus="selectTime(detail.frequencyName)" @change="setExecuteTime(detail)">
  198. <el-option
  199. v-for="item in multipleTimeList[detail.timeMode]"
  200. size="mini"
  201. :key="item.code"
  202. :label="item.name"
  203. :value="item.code">
  204. </el-option>
  205. </el-select>
  206. </div>
  207. </div>
  208. </div>
  209. <div class="ui-grid ui-grid-middle">
  210. <div class="clearfix ui-col-2">
  211. <span class="fl c-999">备&emsp;&emsp;注:</span>
  212. <div class="fl maxw600 plr15 ptb10 c-border set-textarea">
  213. <textarea placeholder="不补充说明特殊用法、方式" v-model="detail.remark" name="" rows="" cols=""></textarea>
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. <div class='fr w60 c-t-right clearfix'>
  219. <p v-if="detail.frequencyCode" class="m0 p0 mb10">×{{mul(detail.executeTime.length, detail.frequency.count)}}</p>
  220. <div v-if="detail.frequencyCode" class="clearfix mb10"><span class="fr sub-tap cur-pit" @click="subTemplate(index, detail)"></span></div>
  221. <div v-if="detail.frequencyCode" class="clearfix"><span class="fr fuzhi-tap cur-pit" @click="copyTemplate(index, detail)"></span></div>
  222. </div>
  223. </div>
  224. </li>
  225. <li class="pt100 c-t-center" v-if="!templateDetail.length">
  226. <span class="set-right-arraw pr20">请在右侧“服务项”列表中选择</span>
  227. </li>
  228. </ul>
  229. </div>
  230. </div>
  231. <div>
  232. <p class="m0 p0 pl20 ptb10 c-border-b set-label">支付方式:<span class="ml10 pl20 active">按服务支付</span><em class="c-red ml20">(按选择支付方式完成收费)</em></p>
  233. <div class="pl20 lh40">总费用:
  234. <span class="c-red c-f16">¥{{allFee}}</span>
  235. <span v-if="!isEditConfig" class="fr lh30 cur-pit plr15 c-t-center c-fff" :class="havePlan ? 'bgc-12b7f5' : 'bgc-d7dce6'" @click="createRehabilitationPlan()">生成计划</span>
  236. <span v-else class="fr lh30 cur-pit plr15 c-t-center c-fff" :class="havePlan ? 'bgc-12b7f5' : 'bgc-d7dce6'" @click="updateRehabilitationPlan()">完成编辑</span>
  237. <span class="fr lh30 cur-pit plr15 c-t-center bgc-green c-fff" @click="canclePlan()">取消</span>
  238. </div>
  239. </div>
  240. </div>
  241. <div v-if="!isEditConfig" class="fr w400 c-h100 c-border-l">
  242. <div class="plr5 c-h100">
  243. <h4 class="m0 pl15 lh40 c-border-b c-position-r f-w500">
  244. <em class="c-position-a set-blue-span"></em>添加其他项目
  245. </h4>
  246. <div class="clearfix mtb10 c-border">
  247. <input class="fl search-input plr10" type="text" v-model="searchKey" placeholder="输入项目名称" />
  248. <span class="fr search-btn" @click="searchProject()"></span>
  249. </div>
  250. <div class="c-h100-99" style="overflow: hidden;">
  251. <div class="c-h100 p0 m0" style="overflow: auto;">
  252. <ul class="p0 m0 pr10">
  253. <li v-for="(o, i) in serviceItems" :key="i" class="clearfix ptb5">
  254. <!-- @click="selectProject(i, o)" -->
  255. <div class="fl c-border w-100-66 cur-pit border-c12b7f5 ptb5 plr5 b-r-3 clearfix" :class="o.isSelect ? 'bgc-12b7f5' : 'bgc-fff'">
  256. <p class="fl w-100-78 txt-ells lh18" :class="o.isSelect ? 'c-fff' : 'c-666'">{{o.name}}</p>
  257. </div>
  258. <span class="fr h30 btn cur-pit plr10 bgc-12b7f5 c-fff b-r-3" style="padding: 0 10px;" v-if="!o.isSelect" @click="addProject(i, o)">添加</span>
  259. <span class="fr h30 btn plr10 bgc-e1e1e1 c-fff b-r-3" style="padding: 0 10px;" v-else>添加</span>
  260. </li>
  261. </ul>
  262. </div>
  263. </div>
  264. <!-- <div class="c-h100-99" style="overflow: hidden;">
  265. <ul class="c-h100 p0 m0" style="overflow: auto;">
  266. <li v-for="(project1, index) in projectList" :key="index">
  267. <h4 class="set-arrow c-f14 h30 p0 m0 pl20 f-w500 cur-pit" :class="{'active': index == proIndex1}" @click="selectPro(1, index)">{{project1.itemType == 1 ? '诊疗服务' : '健康服务'}}</h4>
  268. <ul class="c-h100 p0 m0 pl10" v-if="index == proIndex1">
  269. <li v-for="(project2, index2) in project1.item" :key="index2">
  270. <p class="set-arrow h30 c-f14 pl20 m0 c-333 cur-pit" :class="{'active': index2 == proIndex2}" @click="selectPro(2, index2)">{{project2.itemName}}</p>
  271. <ul class="p0 m0 pr10" v-if="index2 == proIndex2">
  272. <li v-for="(project3, index3) in project2.hospitalServiceItems" :key="index3" class="clearfix ptb5">
  273. <div class="fl c-border w-100-66 cur-pit border-c12b7f5 ptb5 plr5 b-r-3 clearfix" :class="project3.isSelect ? 'bgc-12b7f5' : 'bgc-fff'" @click="selectProject(index, index2, index3, project3)">
  274. <p class="fl w-100-78 txt-ells lh18" :class="project3.isSelect ? 'c-fff' : 'c-666'">{{project3.specialistServiceItemDO.title}}</p>
  275. <span class="fr lh18 b-r-3 c-f12 ml5 bgc-4dcd70 plr5 c-fff" v-if="project3.flag == 1 || project3.flag == 3">社区</span>
  276. <span class="fr lh18 b-r-3 c-f12 ml5 bgc-55cefc plr5 c-fff" v-if="project3.flag == 2 || project3.flag == 3">医院</span>
  277. </div>
  278. <span class="fr h30 btn cur-pit plr10 bgc-12b7f5 c-fff b-r-3" style="padding: 0 10px;" v-if="!project3.isSelect" @click="addProject(index, index2, index3, project3)">添加</span>
  279. <span class="fr h30 btn plr10 bgc-e1e1e1 c-fff b-r-3" style="padding: 0 10px;" v-else>添加</span>
  280. </li>
  281. </ul>
  282. </li>
  283. </ul>
  284. </li>
  285. </ul>
  286. </div> -->
  287. </div>
  288. </div>
  289. </div>
  290. </div>
  291. </div>
  292. </div>
  293. <script src="../../../js/vue.js" type="text/javascript" charset="utf-8"></script>
  294. <script src="../../../js/jquery-2.2.4.js"></script>
  295. <script src="../../../plugins/layer/layer.min.js"></script>
  296. <script src="../../../plugins/toastr/toastr.min.js"></script>
  297. <script src="../../../js/bootstrap.min.js"></script>
  298. <script src="../../../js/es6-promise.js" type="text/javascript" charset="utf-8"></script>
  299. <script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
  300. <script src="../../../js/moment.js"></script>
  301. <script src="../../../js/getPlanDate.js"></script>
  302. <script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
  303. <script src="../../../js/element-ui.js" type="text/javascript" charset="utf-8"></script>
  304. <script src="../../../api/http-request.js" type="text/javascript"></script>
  305. <script src="../../../api/recover_api.js" type="text/javascript"></script>
  306. <script type="text/javascript" src="../../../api/rehabilitation-api.js"></script>
  307. <script type="text/javascript">
  308. var doctorType = (JSON.parse(window.localStorage.getItem('wlyyAgent'))||{}).doctorType,
  309. docInfo = JSON.parse(window.localStorage.getItem('wlyyAgent'))
  310. console.log('docInfodocInfodocInfodocInfo', docInfo)
  311. var httpData=GetRequest()
  312. function showSuccessMessage(msg) {
  313. layer.msg(msg, {
  314. icon: 1
  315. })
  316. }
  317. function showErrorMessage(msg) {
  318. layer.msg(msg, {
  319. icon: 5
  320. })
  321. }
  322. function showWarningMessage(msg) {
  323. layer.msg(msg, {
  324. icon: 2
  325. })
  326. }
  327. function showInfoMessage(msg) {
  328. layer.msg(msg, {
  329. icon: 6
  330. })
  331. }
  332. top.recoverVue = new Vue({
  333. el: "#app",
  334. data: {
  335. pickerOptions1: {
  336. disabledDate: function(time) {
  337. return time.getTime() < Date.now() - 8.64e7;
  338. }
  339. },
  340. surefont: '添加',
  341. isTest: false,
  342. pati: null,
  343. isPlan: false,
  344. proIndex1: null,
  345. proIndex2: null,
  346. patiInfo: null,
  347. diseaseObj: null, // 疾病
  348. mubanList: [],
  349. templateDetail: [],
  350. templateResult: [],
  351. allFee: 0,
  352. projectList: null,
  353. serviceItems: null, // 服务项列表
  354. labelIndex: 2,
  355. labelCode: 1,
  356. selectWay:'during',
  357. spanLabel: [{
  358. labelName: "(转)家庭病床",
  359. code: 3
  360. }, {
  361. labelName: "(转)社区医院",
  362. code: 2
  363. }, {
  364. labelName: "康复计划",
  365. code: 1
  366. }],
  367. jDlist: [], //家签医生
  368. zDlist: [], //专科医生
  369. multipleTimeList:{},
  370. frequencysList1:[{'code':'','name':'不限频次'},{"code":"qd_10-week1","name":"1周/次","type":1,mode:"week",'count':1},
  371. {"code":"qd_10-week1","name":"2周/次","type":2,mode:"week",'count':1},
  372. {"code":"qd_10-month1","name":"1月/次","type":1,mode:"month",'count':1},
  373. {"code":"qd_10-month1","name":"2月/次","type":2,mode:"month",'count':1},
  374. {"code":"qd_10-month1","name":"3月/次","type":3,mode:"month",'count':1}], //频次列表-multiple
  375. weekValue:'',
  376. selectProjectDetail: null,
  377. searchKey: null,
  378. havePlan: false,
  379. frequencyList: [],
  380. frequencyListObj: {},
  381. diagnosisInfo:"",
  382. indexOrder:0,
  383. profileRes:[],
  384. nodata:false,
  385. subsidiaryInfo:{},
  386. edit:true,
  387. selectDiseaseIndex:'',
  388. isPlanId :'',
  389. selectPatientIndex: '',
  390. adviceContent: '', //康复建议
  391. isEdit: false,
  392. medicalRecordsList: [],
  393. docInfo: JSON.parse(window.localStorage.getItem('wlyyAgent')),
  394. showAdviceContentTip: false,
  395. curMedicalRecordsIndex: -1,
  396. healthCodeArr: [],
  397. diseaseCodeArr: [],
  398. diseaseNameArr: [],
  399. teamCode: httpData['teamCode'],
  400. isEditConfig: httpData['isEditConfig']||false,
  401. planId: httpData['planId'],
  402. planInfo: {},
  403. planDetailId: httpData['planDetailId'],
  404. service:{
  405. relationRecordImg:{},
  406. messageList:{},
  407. },
  408. patient: httpData.patient || undefined
  409. },
  410. mounted: function() {
  411. this.selectFrequencys()
  412. this.initTimeData()
  413. if(this.patient) {
  414. this.isPlan = false
  415. this.allFee = 0
  416. this.templateDetail = []
  417. this.pati = {patient: this.patient}
  418. this.getPatientInfo()
  419. }
  420. if(this.teamCode){
  421. this.findTemplateList()
  422. }
  423. if(this.planId){
  424. this.planSchedule()
  425. }
  426. },
  427. watch: {
  428. adviceContent: function(){
  429. var vm = this
  430. if(vm.adviceContent.trim().length>0){
  431. vm.showAdviceContentTip = false
  432. } else {
  433. vm.showAdviceContentTip = true
  434. }
  435. },
  436. templateDetail: function(){
  437. if(this.templateDetail.length==0){
  438. this.havePlan = false
  439. }else{
  440. this.havePlan = true
  441. }
  442. }
  443. },
  444. methods: {
  445. getServiceItem: function() {
  446. var vm = this;
  447. var loadding = top.layer.load(0, {
  448. shade: false
  449. }); //0代表加载的风格,支持0-2
  450. rehaAPI.serviceItem({
  451. planDetailId: vm.planDetailId
  452. }).then(function(res) {
  453. top.layer.close(loadding);
  454. if(res.status == 200) {
  455. vm.service = res.data;
  456. var o1 = {}
  457. o1.isSelect = true
  458. o1.selectDoc = false
  459. o1.selectDate = 1
  460. o1.value14 = []
  461. o1.value15 = null
  462. o1.executeTime = []
  463. o1.mode='during'
  464. // 默认频次
  465. o1.selectFre = false
  466. if(vm.service.frequencyCode!=''){
  467. o1.frequencyCode = vm.service.frequencyCode
  468. o1.frequencyName = vm.frequencyListObj[vm.service.frequencyCode]
  469. o1.frequency = vm.frequencyList[1]
  470. } else {
  471. o1.frequencyCode = ''
  472. o1.frequencyName = '不限频次'
  473. o1.frequency = vm.frequencyList[0]
  474. }
  475. o1.expense=vm.service.expense||0
  476. o1.frequencyList = vm.frequencyList
  477. o1.timeType = 0
  478. o1.remark = vm.service.remark
  479. o1.executeDoctor = vm.service.executeDoctorCode
  480. o1.executeDoctorName = vm.service.executeDoctorName
  481. o1.executeHospitalName = vm.service.hospitalName
  482. o1.docList = vm.jDlist
  483. o1.code = vm.service.type
  484. o1.name = vm.service.title
  485. vm.templateDetail.push(o1)
  486. vm.judgeHavePlan()
  487. } else {
  488. showErrorMessage(res.msg)
  489. }
  490. })
  491. },
  492. initTimeData:function(){
  493. var vm=this
  494. vm.multipleTimeList ={"week":[],"month":[]}
  495. for(var i=1;i<=28;i++){
  496. switch(i){
  497. case 1:vm.multipleTimeList.week.push({name:"周一",code:String(i)});break;
  498. case 2:vm.multipleTimeList.week.push({name:"周二",code:String(i)});break;
  499. case 3:vm.multipleTimeList.week.push({name:"周三",code:String(i)});break;
  500. case 4:vm.multipleTimeList.week.push({name:"周四",code:String(i)});break;
  501. case 5:vm.multipleTimeList.week.push({name:"周五",code:String(i)});break;
  502. case 6:vm.multipleTimeList.week.push({name:"周六",code:String(i)});break;
  503. case 7:vm.multipleTimeList.week.push({name:"周日",code:String(i)});break;
  504. default:break;
  505. }
  506. // if(i<=7){
  507. vm.multipleTimeList.month.push({name:i+"号",code:String(i)})
  508. // }
  509. }
  510. },
  511. selectTime:function(item){
  512. if(!item){
  513. showErrorMessage('请先选择频次')
  514. return false
  515. }
  516. },
  517. setExecuteTime:function(item){
  518. if(item.dateCode){
  519. item.executeTime=getFreDateArr(item.timeMode+item.frequencysList1Type, Number(item.dateCode)).map(function(o) {return o.format("YYYY-MM-DD")})
  520. this.judgeHavePlan()
  521. }
  522. this.$forceUpdate()
  523. },
  524. //获取计划表
  525. planSchedule:function(){
  526. var vm = this;
  527. var params = {
  528. planId: this.planId,
  529. patientCode: this.patient
  530. };
  531. rehaAPI.planSchedule(params).then(function(res){
  532. if(res.status == 200){
  533. vm.planInfo = res.data;
  534. vm.adviceContent = vm.planInfo.adviceContent
  535. vm.selectByMedicalCode(res.data.medicalRecordsCode)
  536. }else{
  537. showErrorMessage(res.msg)
  538. }
  539. })
  540. },
  541. // 获取住院病历列表
  542. selectByMedicalCode: function(medicalRecordsCode){
  543. var vm = this;
  544. var params = {
  545. medical: medicalRecordsCode
  546. };
  547. rehaAPI.selectByMedicalCode(params).then(function(res){
  548. if(res.status==200){
  549. vm.medicalRecordsList = res.data
  550. }else {
  551. showErrorMessage(res.msg);
  552. }
  553. })
  554. },
  555. comMedicalRecords:function(record,isEdit){
  556. var vm = this
  557. var loading = layer.load(0, {shade: false})
  558. var event=record&&record.event?record.event:""
  559. if(!isEdit){
  560. isEdit = ""
  561. }
  562. recoverAPI.getPatientAccetokenByIdcard({idcard:vm.pati.idcard}).then(function(res){
  563. layer.close(loading)
  564. if(res.status==200){
  565. this.selectPatientIndex = layer.open({
  566. type: 2,
  567. area: ['75%', '650px'],
  568. shade: 0.5,
  569. title: '住院病历',
  570. closeBtn: 1,
  571. shift: 5,
  572. shadeClose: false, //点击遮罩关闭层
  573. content: httpRequest.server+"profileweb/#/zhuyuan?patientCode="+res.data.patientCode+"&hospital="+docInfo.hospital+"&recoverDown="+isEdit+"&event="+event,
  574. end: function(){
  575. var comProfile = sessionStorage.getItem("comProfile")
  576. if(comProfile){
  577. sessionStorage.removeItem("comProfile")
  578. vm.comMedicalRecordsBack(JSON.parse(comProfile),event); //同步住院病历
  579. }
  580. }
  581. });
  582. }else{
  583. showErrorMessage(res.msg);
  584. }
  585. })
  586. },
  587. comMedicalRecordsBack:function(comProfile,event){
  588. var vm = this
  589. var jsonData = {
  590. admissionTime: comProfile.data['入院时间']||"",
  591. dischargeTime: comProfile.data['出院时间']||"",
  592. admittingDiagnosis: "", // 入院诊断
  593. admittingDiagnosisName: comProfile.data['入院诊断']||"", //入院诊断名称
  594. dischargeDiagnosis: "", // 出院诊断
  595. dischargeDiagnosisName: comProfile.data['出院诊断']||"", // 出院诊断名称,多个用逗号
  596. advice: comProfile.data['出院医嘱']||"出院继续观察",
  597. images: "",
  598. "event": comProfile.event.id,
  599. "dataFrom":comProfile.event.dataFrom,
  600. "hospital":comProfile.event.orgCode,
  601. "jwpatient":comProfile.event.patient,
  602. }
  603. var params = {
  604. doctorCode: docInfo.uid,
  605. patient: vm.pati.patient,
  606. patientName: vm.pati.patientName,
  607. jsonData: JSON.stringify(jsonData)
  608. }
  609. var loading = layer.load(0, {shade: false})
  610. rehaAPI.createMedicalRecords(params).then(function(res){
  611. layer.close(loading)
  612. if(res.status==200){
  613. if(!event){
  614. vm.medicalRecordsList.unshift(res.data)
  615. }else{
  616. vm.$set(vm.medicalRecordsList, vm.curMedicalRecordsIndex, res.data)
  617. }
  618. if(!vm.adviceContent){
  619. vm.adviceContent = res.data.advice
  620. }
  621. }else{
  622. showErrorMessage(res.msg);
  623. }
  624. })
  625. },
  626. // 添加住院病历
  627. addMedicalRecords: function(){
  628. var vm = this
  629. this.selectPatientIndex = layer.open({
  630. type: 2,
  631. area: ['480px', '650px'],
  632. shade: 0.5,
  633. title: '添加住院病历',
  634. closeBtn: 1,
  635. shift: 5,
  636. shadeClose: false, //点击遮罩关闭层
  637. content: "medical-records.html?patient="+vm.pati.patient+'&patientName='+vm.pati.patientName
  638. });
  639. },
  640. // 编辑住院病历
  641. editMedicalRecords: function(o, i){
  642. var vm = this
  643. if(vm.isEditConfig){
  644. if(o.event){
  645. vm.comMedicalRecords(o)
  646. }else{
  647. window.localStorage.setItem('curMedicalRecords', JSON.stringify(o))
  648. this.selectPatientIndex = layer.open({
  649. type: 2,
  650. area: ['480px', '650px'],
  651. shade: 0.5,
  652. title: '添加住院病历',
  653. closeBtn: 1,
  654. shift: 5,
  655. shadeClose: false, //点击遮罩关闭层
  656. content: "../../rehabilitation/html/medical-records-detail.html?medicalRecordsCode="+o.code
  657. });
  658. }
  659. }else{
  660. vm.curMedicalRecordsIndex = i
  661. if(o.event){
  662. vm.comMedicalRecords(o,true)
  663. }else{
  664. window.localStorage.setItem('curMedicalRecords', JSON.stringify(o))
  665. this.selectPatientIndex = layer.open({
  666. type: 2,
  667. area: ['480px', '650px'],
  668. shade: 0.5,
  669. title: '添加住院病历',
  670. closeBtn: 1,
  671. shift: 5,
  672. shadeClose: false, //点击遮罩关闭层
  673. content: "medical-records.html?patient="+vm.pati.patient+'&patientName='+vm.pati.patientName+'&medicalRecordsId='+o.id
  674. });
  675. }
  676. }
  677. },
  678. //关闭添加住院病历弹框
  679. closeMedicalRecords: function(){
  680. layer.close(this.selectPatientIndex)
  681. },
  682. completeMedicalRecords: function(type, data){
  683. var vm = this;
  684. if(type=='edit'){
  685. this.$set(this.medicalRecordsList, this.curMedicalRecordsIndex, data)
  686. } else {
  687. this.medicalRecordsList.unshift(data)
  688. }
  689. if(!vm.adviceContent){
  690. vm.adviceContent = data.advice
  691. }
  692. layer.close(this.selectPatientIndex)
  693. },
  694. //获取诊疗信息
  695. diagnosisQuery:function(){
  696. var vm = this;
  697. loadding = layer.load(0, {shade: false});
  698. params = {
  699. patient: this.pati.patient,
  700. // patient:"3b26a7905e034c36a5ba8e65bdc0dc7f",
  701. type: '2',
  702. page: 1,
  703. pageSize: 50,
  704. lastTime: ''
  705. }
  706. recoverAPI.diagnosisQuery(params).then(function(res){
  707. layer.close(loadding)
  708. if (res.status == 200) {
  709. if(res.data.length == 0){
  710. vm.diagnosisInfo = [{orgName:'无'}]
  711. console.log(vm.diagnosisInfo)
  712. vm.nodata = true
  713. }else{
  714. vm.diagnosisInfo = res.data;
  715. }
  716. vm.orderHospital(0)
  717. }else{
  718. vm.diagnosisInfo = [{orgName:'无'}]
  719. vm.orderHospital(0)
  720. showErrorMessage(res.msg);
  721. }
  722. })
  723. },
  724. //按照医院查询诊疗信息
  725. orderHospital:function(index){
  726. var vm = this;
  727. vm.indexOrder = index
  728. loadding = layer.load(0, {shade: false});
  729. var sec_params = {
  730. patient: vm.pati.patient,
  731. event:vm.diagnosisInfo[index].id || "",
  732. catalog:'0213',
  733. serial:"1"
  734. }
  735. recoverAPI.diagnosisSubsidiary(sec_params).then(function(res){
  736. layer.close(loadding)
  737. vm.subsidiaryInfo = vm.selectXmlDom(res,'0213')
  738. console.log(vm.subsidiaryInfo)
  739. })
  740. },
  741. //获取xml数据
  742. selectXmlDom: function (profileRes,tempalteCode) {
  743. var vm = this;
  744. if(profileRes.status == 200){
  745. var $dom = $(profileRes.data.replace(/<\?xml .*\?>/,'')),
  746. version = $dom.find(">version").length?$dom.find(">version").attr("code"):$dom.attr('version');
  747. $.trim(version) || (function () {
  748. version = $dom.find(">ClinicalDocument").length? '2.0.0.1' : '';
  749. })();
  750. if($.trim(version)) {
  751. var verNum = version.split('.')[0];
  752. var jsonData = {}
  753. // xml 转 json
  754. if((typeof profileRes.data=='string')&&profileRes.data.constructor==String) {
  755. // 去除携带的脚本内容
  756. profileRes.data = profileRes.data.replace(/<script[^>]*?>[\s\S]*?<\/script>/ig,'');
  757. // console.log(profileRes.data.replace(/<\?xml .*\?>/,''))
  758. jsonData = vm.handleData(profileRes.data.replace(/<\?xml .*\?>/,''));
  759. }
  760. }
  761. }else{
  762. showErrorMessage(profileRes.msg)
  763. jsonData = {data:{}}
  764. }
  765. return jsonData;
  766. },
  767. handleData :function (xmlStr) {
  768. var $xmlDom = $(xmlStr),
  769. $nodes = {
  770. } ;
  771. var resultData = [];
  772. return {
  773. data:{
  774. "department": $xmlDom.find('component section entry inDept').text(),//科室
  775. "dednumber": $xmlDom.find('component section entry bed').text(),//床号
  776. "HospitalizationNumber": "",//住院号
  777. "name": $xmlDom.find('recordTarget patient name').text(),//姓名
  778. "sex": $xmlDom.find('recordTarget patient sex').text(),//性别
  779. "nation": $xmlDom.find('recordTarget nation').text(),//民族
  780. "marriage": $xmlDom.find('recordTarget marriage').text(),//婚姻
  781. "admissionTime": $xmlDom.find('component section entry inTime').attr('value'),//入院时间
  782. "dischargeTime": $xmlDom.find('component section entry outTime').attr('value'),//出院时间
  783. "lengthStay": $xmlDom.find('component section entry inHospitalDay').text(),//住院天数
  784. "admissionStatus": $xmlDom.find('component section entry inCondition').text(),//入院情况
  785. "admissionDiagnosis": $xmlDom.find('component section entry inDiagnosis').text(),//入院诊断
  786. "dischargeDiagnosis": $xmlDom.find('component section entry outDiagnosis').text(),//出院诊断
  787. "DiagnosisProcess": $xmlDom.find('component section entry remedialCourse').text(),//诊疗经过
  788. "dischargeStatus": $xmlDom.find('component section entry outCondition').text(),//出院情况
  789. "dischargeOrder": $xmlDom.find('component section entry outOrder').text(),//出院医嘱
  790. "treatmentOutcome": $xmlDom.find('component section entry remedialResult').text(),//治疗结果
  791. "residentPhysician": $xmlDom.find('residentDoctor name').text(),//住院医师
  792. "attendingDoctor": $xmlDom.find('inChargeDoctor name').text(),//主治医师
  793. "time": $xmlDom.find('inChargeDoctor time').attr('value')//时间
  794. }
  795. }
  796. },
  797. //编辑诊疗
  798. editdiagnosis:function(){
  799. var vm = this;
  800. vm.edit = !vm.edit;
  801. vm.nodata = false
  802. vm.subsidiaryInfo.data.department = $('#department').find('input').val()
  803. vm.subsidiaryInfo.data.attendingDoctor = $('#attendingDoctor').find('input').val()
  804. vm.subsidiaryInfo.data.admissionDiagnosis = $('#department').find('input').val()
  805. vm.subsidiaryInfo.data.dischargeDiagnosis = $('#dischargeDiagnosis').find('input').val()
  806. },
  807. // 获取居民标签(健康情况、疾病类型、自定义分组)
  808. getPatientLabelInfo: function(){
  809. var vm = this,
  810. loading = layer.load(0, {shade: false})
  811. var params = {
  812. patient: this.pati.patient
  813. }
  814. rehaAPI.getPatientLabelInfo(params).then(function(res){
  815. layer.close(loading)
  816. if(res.status == 200) {
  817. var healthLabel = res.data['healthLabel']||[],
  818. diseaseLabel = res.data['diseaseServer']||[],
  819. customLabel = res.data['customLabel']||[];
  820. $.each(diseaseLabel, function(index, item){
  821. vm.diseaseCodeArr.push(item.disease)
  822. vm.diseaseNameArr.push(item.diseaseName)
  823. })
  824. $.each(healthLabel, function(index, item){
  825. vm.healthCodeArr.push(item.label)
  826. })
  827. } else {
  828. showErrorMessage(res.msg);
  829. }
  830. })
  831. },
  832. // 编辑康复建议
  833. editAdviceTextarea: function(){
  834. this.isEdit = !this.isEdit
  835. },
  836. // 获取频次列表
  837. selectFrequencys: function() {
  838. var vm = this,
  839. loadding = layer.load(0, {shade: false});
  840. recoverAPI.selectFrequencys().then(function(res) {
  841. layer.close(loadding)
  842. if(res.status == 200) {
  843. vm.frequencyList = [{code:'', name: '不限频次'}].concat(res.data)
  844. console.log('vm.frequencyList', vm.frequencyList)
  845. $.each(res.data, function(index, item){
  846. vm.frequencyListObj[item.code]=item.name
  847. })
  848. } else {
  849. showErrorMessage(res.msg);
  850. }
  851. })
  852. },
  853. // 获取居民信息
  854. getPatientInfo: function() {
  855. var vm = this,
  856. loadding = layer.load(0, {shade: false}),
  857. params = {
  858. patient: this.pati.patient
  859. }
  860. recoverAPI.getPatientInfo(params).then(function(res) {
  861. layer.close(loadding)
  862. if(res.status == 200) {
  863. vm.patiInfo = res.data
  864. vm.pati.patientName = res.data.name
  865. if(vm.planId){ // 编辑服务项时获取服务医生列表
  866. vm.selectPlanServerDoctor(vm.planId)
  867. } else {
  868. vm.jDlist.push({
  869. name: vm.patiInfo.ssDoctorName || vm.patiInfo.jtDoctorName,
  870. code: vm.patiInfo.ssDoctor || vm.patiInfo.jtDoctor,
  871. hospitalName: vm.patiInfo.jtHospitalName,
  872. type: 1, //1家医2专医
  873. })
  874. vm.jDlist.push({
  875. name: vm.patiInfo.ssDoctorHealthName || vm.patiInfo.jtDoctorHealthName,
  876. code: vm.patiInfo.ssDoctorHealth || vm.patiInfo.jtDoctorHealth,
  877. hospitalName: vm.patiInfo.jtHospitalName,
  878. type: 1, //1家医2专医
  879. })
  880. vm.jDlist.push({
  881. name: docInfo.name,
  882. code: docInfo.uid,
  883. hospitalName: docInfo.hospitalName,
  884. type: 2, //1家医2专医
  885. })
  886. }
  887. // 获取居民标签
  888. vm.getPatientLabelInfo()
  889. if(vm.docInfo.doctorType==1){
  890. vm.findPatientSignSpecialistInfo()
  891. }
  892. } else {
  893. showErrorMessage(res.msg);
  894. }
  895. })
  896. },
  897. // 获取服务医生列表
  898. selectPlanServerDoctor: function(id){
  899. var vm = this,
  900. params = {
  901. planId: id
  902. }
  903. rehaAPI.selectPlanServerDoctor(params).then(function(res){
  904. var jtList = [], zkList = []
  905. if(res.status==200){
  906. $.each(res.data, function(index, item){
  907. if(item.level==1){
  908. zkList.push({
  909. name: item.name,
  910. code: item.code,
  911. hospitalName: item.hospitalName
  912. })
  913. } else {
  914. jtList.push({
  915. name: item.name,
  916. code: item.code,
  917. hospitalName: item.hospitalName
  918. })
  919. }
  920. })
  921. vm.jDlist = jtList.concat(zkList)
  922. vm.getServiceItem()
  923. }else{
  924. layer.msg(res.msg,{icon:5});
  925. }
  926. })
  927. },
  928. // 签约专科信息
  929. findPatientSignSpecialistInfo: function() {
  930. var vm = this,
  931. params = {
  932. patient: this.pati.patient,
  933. doctor: docInfo.uid
  934. }
  935. recoverAPI.findPatientSignSpecialistInfo(params).then(function(res) {
  936. if(res.status == 200) {
  937. vm.pati.teamCode = res.data.teamCode
  938. if(!vm.teamCode){
  939. vm.teamCode = res.data.teamCode
  940. }
  941. vm.specialistTeam(vm.teamCode)
  942. } else {
  943. showErrorMessage(res.msg);
  944. }
  945. })
  946. },
  947. // 获取专科团队
  948. specialistTeam: function(teamCode) {
  949. var vm = this,
  950. params = {
  951. teamId: teamCode
  952. }
  953. recoverAPI.specialistTeam(params).then(function(res) {
  954. if(res.status == 200) {
  955. vm.zDlist = res.data.members
  956. } else {
  957. showErrorMessage(res.msg);
  958. }
  959. })
  960. },
  961. // 模板列表
  962. findTemplateList: function() {
  963. var vm = this,
  964. loadding = layer.load(0, {shade: false}),
  965. params = {
  966. patient: this.pati.patient,
  967. doctor: docInfo.uid,
  968. adminTeamCode: vm.teamCode
  969. }
  970. recoverAPI.findTemplateList(params).then(function(res) {
  971. layer.close(loadding)
  972. if(res.status == 200) {
  973. vm.mubanList = res.data
  974. } else {
  975. showErrorMessage(res.msg);
  976. }
  977. })
  978. },
  979. // 模板详细
  980. findTemplateDetail: function(templateId) {
  981. var vm = this,
  982. loadding = layer.load(0, {shade: false}),
  983. params = {
  984. templateId: templateId
  985. }
  986. recoverAPI.findTemplateDetail(params).then(function(res) {
  987. layer.close(loadding)
  988. if(res.status == 200) {
  989. vm.templateDetail = []
  990. res.data.planArr=[]
  991. vm.templateResult = $.map(res.data,function(item){
  992. $.map(item.list,function(it){
  993. it.code=item.code
  994. it.name=item.name
  995. res.data.planArr.push(it)
  996. })
  997. return res.data.planArr
  998. })
  999. vm.templateResult=_.uniq(vm.templateResult,function(item){
  1000. return item.id
  1001. })
  1002. vm.getServiceItemList().then(function(){
  1003. var arr = []
  1004. $.each(vm.serviceItems, function(index,o) {
  1005. $.each(vm.templateResult, function(index1, o1) {
  1006. if(o1.code == o.code) {
  1007. if(o1.executeTimes){
  1008. o.isSelect = true
  1009. o1.selectFre = true
  1010. o1.isSelect = true
  1011. o1.selectDoc = false
  1012. o1.selectDate = 1
  1013. o1.value14 = []
  1014. o1.value15 = null
  1015. o1.executeTimes?o1.executeTime = o1.executeTimes.split(','):o1.executeTime=[]
  1016. o1.executeTime=_.map(o1.executeTime,function(item){
  1017. return item.substring(0,item.length-6)
  1018. })
  1019. // 默认频次
  1020. o1.selectFre = false
  1021. o1.mode='multiple'
  1022. o1.timeMode=_.find(vm.frequencysList1,{'name':o1.frequencyName}).mode
  1023. o1.frequencysList1Type=_.find(vm.frequencysList1,{'name':o1.frequencyName}).type
  1024. o1.frequency = vm.frequencysList1[1]
  1025. o1.frequencyList = vm.frequencysList1
  1026. o1.timeType = 0
  1027. o1.docList = vm.jDlist
  1028. if(o1.type==1){
  1029. o1.executeDoctorName=vm.jDlist[0].name
  1030. o1.executeDoctor=vm.jDlist[0].code
  1031. o1.executeHospitalName = vm.jDlist[0].hospitalName
  1032. }else{
  1033. o1.executeDoctorName=docInfo.name
  1034. o1.executeDoctor=docInfo.uid
  1035. o1.executeHospitalName = docInfo.hospitalName
  1036. }
  1037. }else{
  1038. o.isSelect = true
  1039. o1.selectFre = true
  1040. o1.isSelect = true
  1041. o1.selectDoc = false
  1042. o1.selectDate = 1
  1043. o1.value14 = []
  1044. o1.value15 = null
  1045. o1.executeTime = []
  1046. // 默认频次
  1047. o1.selectFre = false
  1048. o1.frequencyCode = ''
  1049. o1.frequencyName = '不限频次'
  1050. o1.mode='during'
  1051. o1.frequency = vm.frequencyList[0]
  1052. o1.frequencyList = vm.frequencyList
  1053. o1.timeType = 0
  1054. o1.remark = null
  1055. o1.executeDoctor = vm.jDlist[0].code
  1056. o1.executeDoctorName = vm.jDlist[0].name
  1057. o1.executeHospitalName = vm.jDlist[0].hospitalName
  1058. o1.docList = vm.jDlist
  1059. }
  1060. arr.push(o1)
  1061. }
  1062. })
  1063. })
  1064. vm.templateDetail = arr
  1065. // 赋值模板所带的默认服务项费用
  1066. _.each(vm.templateDetail,function(item){
  1067. _.map(vm.serviceItems,function(it){
  1068. if(item.code==it.code){
  1069. it.expense=item.expense
  1070. return it
  1071. }
  1072. })
  1073. })
  1074. vm.checkAllMoney()
  1075. vm.$forceUpdate()
  1076. })
  1077. // vm.findServiceItemsByHospital()
  1078. } else {
  1079. showErrorMessage(res.msg);
  1080. }
  1081. })
  1082. },
  1083. // 服务项目列表 2020-03-03 新增接口
  1084. getServiceItemList: function(isSearch){
  1085. var vm = this,
  1086. loadding = layer.load(0, {shade: false}),
  1087. params = {
  1088. name: vm.searchKey
  1089. }
  1090. return rehaAPI.getServiceItemList(params).then(function(res) {
  1091. layer.close(loadding)
  1092. if(res.status == 200) {
  1093. var serviceItems = res.data
  1094. vm.serviceItems = $.each(serviceItems, function(index,o) {
  1095. o.isSelect = false
  1096. return o;
  1097. })
  1098. }else {
  1099. showErrorMessage(res.msg);
  1100. }
  1101. })
  1102. },
  1103. searchProject: function() {
  1104. this.getServiceItemList(true)
  1105. },
  1106. setPatImg: function(src) {
  1107. if(!src) {
  1108. return "../../../images/p-female.png"
  1109. } else {
  1110. var str = httpRequest.getImgUrl(src);
  1111. return str
  1112. }
  1113. },
  1114. changeSelectFre: function(index, bool) {
  1115. this.templateDetail[index].selectFre = !bool
  1116. this.isTest = !this.isTest
  1117. },
  1118. changeSelectDoc: function(index, bool) {
  1119. this.templateDetail[index].selectDoc = !bool
  1120. this.isTest = !this.isTest
  1121. },
  1122. // 选择频次
  1123. selectFre: function(index, list) {
  1124. this.templateDetail[index].selectFre = false
  1125. this.templateDetail[index].frequencyCode = list.code
  1126. this.templateDetail[index].frequencyName = list.name
  1127. this.templateDetail[index].timeMode=list.mode
  1128. this.templateDetail[index].frequencysList1Type=list.type
  1129. this.templateDetail[index].dateCode=''
  1130. this.templateDetail[index].frequency = list
  1131. this.templateDetail[index] = this.templateDetail[index]
  1132. this.isTest = !this.isTest
  1133. // if(this.templateDetail[index].frequencyCode==''&&this.isEditConfig){
  1134. // var obj = this.templateDetail[index]
  1135. // this.templateDetail = [].push(obj)
  1136. // }
  1137. this.judgeHavePlan()
  1138. },
  1139. // 选择时间段
  1140. selectTimeType: function(index, timetype) {
  1141. this.templateDetail[index].timeType = timetype
  1142. this.isTest = !this.isTest
  1143. },
  1144. // 选择执行医生
  1145. selectLi: function(index, list) {
  1146. this.templateDetail[index].selectDoc = false
  1147. this.templateDetail[index].executeDoctor = list.code
  1148. this.templateDetail[index].type = list.type
  1149. this.templateDetail[index].executeDoctorName = list.name
  1150. this.templateDetail[index].executeHospitalName = list.hospitalName
  1151. this.templateDetail[index] = this.templateDetail[index]
  1152. this.isTest = !this.isTest
  1153. },
  1154. // 删除配置计划
  1155. subTemplate: function(index, detail) {
  1156. var vm = this
  1157. this.isTest = !this.isTest
  1158. this.templateDetail.splice(index, 1)
  1159. var len = detail.executeTime.length
  1160. var deleteJudge = true
  1161. $.each(vm.templateDetail, function(index, o) {
  1162. if(o.code == detail.code) {
  1163. deleteJudge = false
  1164. }
  1165. });
  1166. if(deleteJudge) {
  1167. $.each(vm.serviceItems, function(index, o) {
  1168. if(detail.code == o.code) {
  1169. o.isSelect = false
  1170. o.executeTime = []
  1171. vm.serviceItems[index] = o
  1172. }
  1173. });
  1174. }
  1175. this.checkAllMoney()
  1176. this.judgeHavePlan()
  1177. },
  1178. // 复制计划
  1179. copyTemplate: function(index, detail) {
  1180. var vm = this,
  1181. obj = JSON.parse(JSON.stringify(detail));
  1182. this.isTest = !this.isTest
  1183. obj.executeTime = []
  1184. obj.mode=this.selectWay
  1185. obj.selectFre=true
  1186. obj.mode=='during'?obj.frequencyList=vm.frequencyList:obj.frequencyList=vm.frequencysList1
  1187. obj.frequencyCode=''
  1188. obj.frequencyName=''
  1189. obj.dateCode=''
  1190. obj.value14 = []
  1191. obj.value15 = null
  1192. this.templateDetail.push(obj)
  1193. if(obj.code!='2'&&obj.code!='3'){
  1194. this.havePlan = false
  1195. }
  1196. },
  1197. switchWay:function(){
  1198. this.selectWay=='during'?this.selectWay='multiple':this.selectWay='during'
  1199. },
  1200. // 选择项目
  1201. selectProject: function(index, index2, index3, o) {
  1202. this.selectProjectDetail = o
  1203. this.selectPatientIndex = layer.open({
  1204. type: 2,
  1205. area: ['400px', '500px'],
  1206. shade: 0.5,
  1207. title: '选择项目',
  1208. closeBtn: 1,
  1209. shift: 5,
  1210. shadeClose: false, //点击遮罩关闭层
  1211. content: "select-project.html?isLook=true&projectId=" + o.id + "&index=" + index + "&index3=" + index3 + "&index2=" + index2
  1212. });
  1213. },
  1214. // 添加项目
  1215. addProject: function(index, obj) {
  1216. if(obj) {
  1217. this.selectProjectDetail = obj
  1218. }
  1219. if(this.selectProjectDetail.isSelect) {
  1220. showWarningMessage("已添加!")
  1221. return false;
  1222. }
  1223. this.selectProjectDetail.isSelect = true
  1224. this.selectProjectDetail.selectDoc = false
  1225. this.selectProjectDetail.selectDate = 1
  1226. this.selectProjectDetail.expense=obj.expense||0
  1227. this.selectProjectDetail.value14 = []
  1228. this.selectProjectDetail.value15 = null
  1229. this.selectProjectDetail.executeTime = []
  1230. // 频次选择
  1231. this.selectProjectDetail.selectFre = true
  1232. this.selectProjectDetail.frequencyCode = this.frequencyList[0].code
  1233. this.selectProjectDetail.frequencyName = this.frequencyList[0].name
  1234. this.selectProjectDetail.frequency = this.frequencyList[0]
  1235. this.selectProjectDetail.mode = this.selectWay
  1236. this.selectWay=='during'?this.selectProjectDetail.frequencyList=this.frequencyList:this.selectProjectDetail.frequencyList=this.frequencysList1
  1237. this.selectProjectDetail.dateCode=''
  1238. this.selectProjectDetail.timeType = 0
  1239. this.selectProjectDetail.remark = null
  1240. this.selectProjectDetail.executeDoctor = this.jDlist[0].code
  1241. this.selectProjectDetail.executeDoctorName = this.jDlist[0].name
  1242. this.selectProjectDetail.executeHospitalName = this.jDlist[0].hospitalName
  1243. this.selectProjectDetail.docList = this.jDlist
  1244. this.templateDetail.push(this.selectProjectDetail)
  1245. this.serviceItems[index] = this.selectProjectDetail
  1246. if(this.selectProjectDetail.code!='2'&&this.selectProjectDetail.code!='3'){
  1247. this.havePlan = false
  1248. }
  1249. this.checkAllMoney()
  1250. this.judgeHavePlan()
  1251. },
  1252. // 选择居民
  1253. selectPatient: function() {
  1254. this.selectPatientIndex = layer.open({
  1255. type: 2,
  1256. area: ['400px', '500px'],
  1257. shade: 0.5,
  1258. title: '同步患者',
  1259. closeBtn: 1,
  1260. shift: 5,
  1261. shadeClose: false, //点击遮罩关闭层
  1262. content: "select-patient.html"
  1263. });
  1264. },
  1265. // 选择居民回调
  1266. selectPatientOk: function(pati) {
  1267. this.isPlan = false
  1268. this.allFee = 0
  1269. this.templateDetail = []
  1270. this.pati = pati
  1271. this.isEdit = false
  1272. this.showAdviceContentTip = false
  1273. this.medicalRecordsList = []
  1274. this.getPatientInfo()
  1275. this.findTemplateList()
  1276. // this.diagnosisQuery()
  1277. layer.close(this.selectPatientIndex)
  1278. },
  1279. // 添加模板
  1280. addMuban: function(oId) {
  1281. var vm = this
  1282. var templateId = oId||''
  1283. vm.newPlan(templateId)
  1284. },
  1285. // 取消计划
  1286. canclePlan: function(obj) {
  1287. var vm = this
  1288. cancleIndex = layer.open({
  1289. type: 2,
  1290. area: ['400px', '180px'],
  1291. shade: 0.5,
  1292. title: '取消确认',
  1293. closeBtn: 1,
  1294. shift: 5,
  1295. shadeClose: false, //点击遮罩关闭层
  1296. content: "cancle_sure.html"
  1297. });
  1298. },
  1299. cancleSure: function() {
  1300. this.isPlan = false
  1301. this.allFee = 0
  1302. this.templateDetail = []
  1303. },
  1304. // (disease, templateId)
  1305. newPlan: function(templateId) {
  1306. // this.diseaseObj = disease
  1307. // var templateId = this.templateId
  1308. this.isPlan = true
  1309. if(templateId) {
  1310. this.findTemplateDetail(templateId)
  1311. } else {
  1312. this.templateDetail = []
  1313. this.getServiceItemList()
  1314. // this.findServiceItemsByHospital()
  1315. }
  1316. },
  1317. selectPro: function(pro, index) {
  1318. if(pro == 1) {
  1319. this.proIndex2 = null;
  1320. this.proIndex1 == index ? this.proIndex1 = null : this.proIndex1 = index
  1321. } else {
  1322. this.proIndex2 == index ? this.proIndex2 = null : this.proIndex2 = index
  1323. }
  1324. },
  1325. setLabelIndex: function(index, label) {
  1326. this.labelIndex = index
  1327. this.labelCode = label.code
  1328. },
  1329. changeSelectDate: function(index, num) {
  1330. if(this.templateDetail[index].executeTime.length) {
  1331. showWarningMessage("请先清除此选项的计划时间!");
  1332. return false;
  1333. }
  1334. this.isTest = !this.isTest
  1335. this.templateDetail[index].selectDate = num
  1336. },
  1337. openSelectTime: function(index) {
  1338. var vm = this
  1339. selectTimeIndex = layer.open({
  1340. type: 2,
  1341. area: ['600px', '500px'],
  1342. shade: 0.5,
  1343. title: '服务时间选择',
  1344. closeBtn: 1,
  1345. shift: 5,
  1346. shadeClose: false, //点击遮罩关闭层
  1347. content: "select_timer.html"
  1348. });
  1349. },
  1350. formatter: function(time){
  1351. return new Date(time).format('yyyy-MM-dd')
  1352. },
  1353. // 选择日期
  1354. getSelectDate: function(index) {
  1355. var vm = this,
  1356. projectId = vm.templateDetail[index].code;
  1357. if(!this.templateDetail[index].value15) {
  1358. return false;
  1359. }
  1360. vm.templateDetail = $.map(vm.templateDetail, function(o, index) {
  1361. if(projectId == o.code) {
  1362. o.isTimeSame = false
  1363. }
  1364. return o
  1365. })
  1366. this.templateDetail[index].executeTime = []
  1367. var arr = this.templateDetail[index].value15
  1368. this.templateDetail[index].executeTime = arr
  1369. this.templateDetail[index].value14 = []
  1370. this.isTest = !this.isTest
  1371. this.judgeHavePlan()
  1372. },
  1373. // 选择周期
  1374. getRandgeDate: function(index, i) {
  1375. var vm = this
  1376. var templateDetail=this.templateDetail[index]
  1377. if(!templateDetail.value14[i]){
  1378. this.templateDetail[index].executeTime = []
  1379. this.havePlan = false
  1380. return false
  1381. }
  1382. if(templateDetail.value14[0]>templateDetail.value14[1]){
  1383. showWarningMessage("开始时间应小于结束时间!")
  1384. return false;
  1385. }
  1386. var projectId = vm.templateDetail[index].code;
  1387. vm.templateDetail = $.map(vm.templateDetail, function(o, index) {
  1388. if(projectId == o.code) {
  1389. o.isTimeSame = false
  1390. }
  1391. return o
  1392. })
  1393. this.templateDetail[index].executeTime = []
  1394. var arr = this.templateDetail[index].value14,
  1395. startTime = new Date(arr[0]).getTime(),
  1396. endTime = new Date(arr[1]).getTime(),
  1397. absTime = endTime - startTime,
  1398. oneday = 60 * 60 *24 * 1000,
  1399. i = 0;
  1400. for(i; i * oneday <= absTime; i++) {
  1401. var num = i * oneday + startTime,
  1402. str = new Date(num).format("yyyy-MM-dd")
  1403. this.templateDetail[index].executeTime.push(str)
  1404. }
  1405. var obj = {
  1406. startTime: arr[0],
  1407. endTime: arr[1],
  1408. length: i
  1409. }
  1410. this.templateDetail[index].value15 = null
  1411. this.isTest = !this.isTest
  1412. this.judgeHavePlan()
  1413. },
  1414. // 计算总费用
  1415. checkAllMoney: function() {
  1416. var vm = this
  1417. this.allFee = 0
  1418. var arr=JSON.parse(JSON.stringify(vm.templateDetail))
  1419. arr=_.uniq(arr,'code')
  1420. $.each(arr, function(index, o) {
  1421. // var fee = vm.mul(vm.mul(o.expense, o.frequency.count), o.executeTime.length)
  1422. vm.allFee = vm.add(vm.allFee, o.expense)
  1423. });
  1424. },
  1425. judgeHavePlan: function() {
  1426. var arr = []
  1427. for(var k = 0; k < this.templateDetail.length; k++) {
  1428. if(this.templateDetail[k].code=='2'||this.templateDetail[k].code=='3'){
  1429. arr.push(true)
  1430. } else if(this.templateDetail[k].frequencyCode){
  1431. if(this.templateDetail[k].executeTime[0]) {
  1432. arr.push(true)
  1433. }else {
  1434. arr.push(false)
  1435. }
  1436. } else {
  1437. arr.push(true)
  1438. }
  1439. }
  1440. var flag = _.every(arr, Boolean)
  1441. if(flag){
  1442. this.havePlan = true
  1443. }else{
  1444. this.havePlan = false
  1445. }
  1446. },
  1447. // 编辑居民康复计划详情
  1448. updateRehabilitationPlan: function(){
  1449. var vm = this
  1450. var ispass1=_.every(vm.templateDetail,function(item){
  1451. if(item.code!='2'&&item.code!='3'){
  1452. return _.every(vm.templateDetail,function(it,index){
  1453. return _.every(vm.templateDetail,function(i,ind){
  1454. if(index!=ind){
  1455. var same=_.intersection(it.executeTime,i.executeTime)
  1456. if(same.length>0){
  1457. return false
  1458. }else{
  1459. return true
  1460. }
  1461. }else{
  1462. return true
  1463. }
  1464. })
  1465. })
  1466. }else{
  1467. return true
  1468. }
  1469. })
  1470. if(!ispass1){ //时间重复
  1471. showErrorMessage('存在重复时间')
  1472. return false
  1473. }
  1474. var loadding = layer.load(0, {shade: false}),
  1475. data = {
  1476. planId: vm.planId,
  1477. hospitalServiceItemId: vm.service.type,
  1478. detail: [],
  1479. };
  1480. $.each(vm.templateDetail, function(index, o) {
  1481. var obj;
  1482. if(o.code=='2'||o.code=='3'||!o.frequencyCode){
  1483. obj = {
  1484. hospitalServiceItemId: o.code,
  1485. type: 2,
  1486. doctor: vm.jDlist[0].code,
  1487. doctorName: vm.jDlist[0].name,
  1488. executeTimes: '',
  1489. frequencyCode: '',
  1490. timeType: 0,
  1491. remark: o.remark || '',
  1492. expense:o.expense || 0
  1493. }
  1494. }else{
  1495. if(o.executeTime.length) {
  1496. var executeTime = []
  1497. $.each(o.executeTime, function(ind, v) {
  1498. v += ' 00:00'
  1499. executeTime.push(v)
  1500. });
  1501. obj = {
  1502. hospitalServiceItemId: o.code, // 服务项code
  1503. type: o.type,
  1504. doctor: o.executeDoctor,
  1505. doctorName: o.executeDoctorName,
  1506. executeTimes: executeTime.length>0?executeTime.join(","):'',
  1507. frequencyCode: o.frequencyCode.split("-")[0],
  1508. timeType: 0, //1白天2晚上0全天
  1509. remark: o.remark || '',
  1510. expense:o.expense||0
  1511. }
  1512. }
  1513. }
  1514. data.detail.push(obj)
  1515. });
  1516. var params = {
  1517. json: JSON.stringify(data)
  1518. }
  1519. recoverAPI.updateRehabilitationPlan(params).then(function(res){
  1520. layer.close(loadding)
  1521. if(res.status ==200){
  1522. showSuccessMessage('保存成功!')
  1523. window.history.go(-1)
  1524. } else {
  1525. showErrorMessage(res.msg);
  1526. }
  1527. })
  1528. },
  1529. createRehabilitationPlan: function() {
  1530. var vm = this
  1531. if(!this.adviceContent){
  1532. vm.showAdviceContentTip = true
  1533. showWarningMessage("请输入康复建议!")
  1534. return false;
  1535. }
  1536. if(vm.medicalRecordsList.length==0){
  1537. showWarningMessage("请选择住院病历!")
  1538. return false;
  1539. }
  1540. if(!this.havePlan) {
  1541. showWarningMessage("请选择计划时间!")
  1542. return false;
  1543. }
  1544. var codeArr=[];
  1545. $.each(vm.medicalRecordsList,function(i, o){
  1546. codeArr.push(o.code)
  1547. })
  1548. var loadding = layer.load(0, {shade: false}),
  1549. data = {
  1550. patient: this.pati.patient,
  1551. name: this.pati.patientName,
  1552. title: this.pati.patientName + "的康复计划",
  1553. healthStatusCode:this.healthCodeArr.join(','),
  1554. disease: this.diseaseCodeArr.join(','),
  1555. diseaseName: this.diseaseNameArr.join(','),
  1556. planType: this.labelCode || 1,
  1557. payment: 2,
  1558. totalExpense: this.allFee || 0,
  1559. adviceContent: this.adviceContent,
  1560. medicalRecordsCode: codeArr.join(','),
  1561. teamCode: vm.teamCode,
  1562. detail: [],
  1563. };
  1564. $.each(vm.templateDetail, function(index, o) {
  1565. var obj;
  1566. if(o.code=='2'||o.code=='3'||!o.frequencyCode){
  1567. obj = {
  1568. hospitalServiceItemId: o.code,
  1569. type: 2,
  1570. doctor: vm.jDlist[0].code,
  1571. doctorName: vm.jDlist[0].name,
  1572. executeTimes: '',
  1573. frequencyCode: '',
  1574. timeType: 0,
  1575. remark: o.remark || '',
  1576. expense:o.expense||0,
  1577. }
  1578. }else{
  1579. if(o.executeTime.length) {
  1580. var executeTime = []
  1581. $.each(o.executeTime, function(ind, v) {
  1582. v += ' 00:00'
  1583. executeTime.push(v)
  1584. });
  1585. obj = {
  1586. hospitalServiceItemId: o.code,
  1587. type: o.type,
  1588. doctor: o.executeDoctor,
  1589. doctorName: o.executeDoctorName,
  1590. executeTimes: executeTime.join(","),
  1591. frequencyCode: o.frequencyCode.split("-")[0],
  1592. timeType: 0,
  1593. remark: o.remark || '',
  1594. expense:o.expense||0,
  1595. }
  1596. }
  1597. }
  1598. data.detail.push(obj)
  1599. });
  1600. var params = {
  1601. json: JSON.stringify(data)
  1602. }
  1603. // console.log('paramsparamsparamsparamsparams', data)
  1604. // return
  1605. recoverAPI.createRehabilitationPlan(params).then(function(res) {
  1606. layer.close(loadding)
  1607. if(res.status == 200) {
  1608. vm.isPlanId = res.data
  1609. setTimeout(function() {
  1610. window.location.href = "../../rehabilitation/html/health_control.html"
  1611. }, 1000)
  1612. showSuccessMessage("康复计划配置成功!")
  1613. } else {
  1614. showErrorMessage(res.msg || "同康复计划项目创建时间重复!");
  1615. vm.templateDetail = $.map(vm.templateDetail, function(o, index) {
  1616. $.each(res.data, function(ind, v) {
  1617. if(v == o.id) {
  1618. o.isTimeSame = true
  1619. }
  1620. });
  1621. return o
  1622. })
  1623. }
  1624. })
  1625. },
  1626. // 字符串方法计算加减乘除(精确度百分位)
  1627. add: function(num1,num2){
  1628. var r1,r2,m,n;
  1629. try{r1=num1.toString().split(".")[1].length}catch(e){r1=0}
  1630. try{r2=num2.toString().split(".")[1].length}catch(e){r2=0}
  1631. m = Math.pow(10,Math.max(r1,r2));
  1632. n = (r1>=r2)?r1:r2;
  1633. return ((num1*m + num2*m)/m).toFixed(n);
  1634. },
  1635. sub: function(num1,num2){
  1636. var r1,r2,m,n;
  1637. try{r1=num1.toString().split(".")[1].length}catch(e){r1=0}
  1638. try{r2=num2.toString().split(".")[1].length}catch(e){r2=0}
  1639. n = (r1>=r2)?r1:r2;
  1640. m = Math.pow(10,Math.max(r1,r2));
  1641. return ((num1*m - num2*m)/m).toFixed(n);
  1642. },
  1643. mul: function(num1,num2){
  1644. var m = 0;
  1645. try{m+=num1.toString().split(".")[1].length}catch(e){}
  1646. try{m+=num2.toString().split(".")[1].length}catch(e){}
  1647. return (Number(num1.toString().replace(".",""))*Number(num2.toString().replace(".","")))/Math.pow(10,m)
  1648. },
  1649. div: function(arg1,arg2){
  1650. var t1=0,t2=0,r1,r2;
  1651. try{t1=arg1.toString().split(".")[1].length}catch(e){}
  1652. try{t2=arg2.toString().split(".")[1].length}catch(e){}
  1653. r1=Number(arg1.toString().replace(".",""));
  1654. r2=Number(arg2.toString().replace(".",""));
  1655. return (r1/r2)*Math.pow(10,t2-t1);
  1656. }
  1657. }
  1658. })
  1659. </script>
  1660. </body>
  1661. </html>