addRecoveryDown.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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 href="../../../plugins/toastr/toastr.min.css" rel="stylesheet">
  10. <link rel="stylesheet" type="text/css" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css" />
  11. <link rel="stylesheet" type="text/css" href="../css/common.css" />
  12. </head>
  13. <body class="m0">
  14. <div id="app" class="p15 c-333" v-cloak>
  15. <div class="ui-row flex">
  16. <div class="ui-row-item flex">
  17. <label class="c-999 w-80">专科团队:</label>
  18. <select v-model="curTeamId" class="form-control w-180 h30">
  19. <option :value="o.id" v-for="(o, i) in teamList">{{o.name}}</option>
  20. </select>
  21. </div>
  22. <div class="ui-row-item flex ml50">
  23. <label class="c-999 w-80">患者身份证:</label>
  24. <div>
  25. <input type="text" v-model="searchKey" placeholder="请输入患者身份证查询" class="form-control w-220 h30">
  26. </div>
  27. </div>
  28. <div class="ui-row-item flex">
  29. <button class="btn btn-12B7F5 btn-size-s ml10" @click="onSearch">搜索</button>
  30. <button class="btn btn-12B7F5 btn-size-s ml10">扫码下转</button>
  31. </div>
  32. </div>
  33. <div v-if="patientInfo" >
  34. <h4 class="m0 h30 c-f14 c-border-b f-w500">家签信息</h4>
  35. <div class="flex mt20">
  36. <div class="flex1 flex c-f14">
  37. <label class="c-999 w-80">患者信息:</label>
  38. <div class="flex1 c-333">{{patientInfo.patientName}}&emsp;{{patientInfo.sex=='1'?'男':'女'}}&emsp;{{patientInfo.age}}岁</div>
  39. </div>
  40. <div class="flex1 flex c-f14">
  41. <label class="c-999 w-80">家签社区:</label>
  42. <div class="flex1 c-333">{{patientInfo.hospitalName}}</div>
  43. </div>
  44. <div class="flex1 flex c-f14">
  45. <label class="c-999 w-80">家签医生:</label>
  46. <div class="flex1 c-333">{{patientInfo.doctorName}}{{patientInfo.doctorHealthName?'、'+patientInfo.doctorHealthName:''}}</div>
  47. </div>
  48. </div>
  49. <h4 class="m0 h30 c-f14 c-border-b f-w500 mt30">患者分类</h4>
  50. <div class="mt20">
  51. <div class="flex vc">
  52. <label class="c-999 w-80">健康情况:</label>
  53. <select v-model="curHealthStatu" class="form-control w-180 h30">
  54. <option v-for="(o, i) in healthLabel" v-bind:value="o.labelCode">{{o.labelName}}</option>
  55. </select>
  56. </div>
  57. <div class="flex mt20">
  58. <label class="c-999 w-80">疾病类型:</label>
  59. <div class="flex1">
  60. <div v-for="(o, i) in diseaseLabel" class="row-line-item w-180">
  61. <label class="checkbox-inline">
  62. <input type="checkbox" v-model="o.flag"/>
  63. <span>{{o.diseaseName}}</span>
  64. </label>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="flex mt20">
  69. <label class="c-999 w-80">自定义分组:</label>
  70. <div class="flex1">
  71. <div v-for="(o, i) in customLabel" class="row-line-item w-180">
  72. <label class="checkbox-inline">
  73. <input type="checkbox" v-model="o.flag"/>
  74. <span>{{o.labelName}}</span>
  75. </label>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="c-t-center mt50">
  81. <button type="button" class="btn btn-white btn-size-m mr15">取消</button>
  82. <button type="button" class="btn btn-12B7F5 btn-size-m" @click="saveBtn">保存</button>
  83. </div>
  84. </div>
  85. <div v-else class="c-t-center mt50"><img src="../images/wushuju_img.png" alt=""> <p class="c-999 mt10">{{emptyText}}</p></div>
  86. </div>
  87. <script src="../../../js/vue.js" type="text/javascript" charset="utf-8"></script>
  88. <script src="../../../js/jquery-2.2.4.js"></script>
  89. <script src="../../../plugins/layer/layer.min.js"></script>
  90. <script src="../../../plugins/toastr/toastr.min.js"></script>
  91. <script src="https://unpkg.com/element-ui/lib/index.js" type="text/javascript" charset="utf-8"></script>
  92. <script src="../../../js/bootstrap.min.js"></script>
  93. <script src="../../../js/es6-promise.js" type="text/javascript" charset="utf-8"></script>
  94. <script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
  95. <script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
  96. <script src="../../../api/http-request.js" type="text/javascript"></script>
  97. <script type="text/javascript" src="../../../api/rehabilitation-api.js"></script>
  98. <script type="text/javascript">
  99. var doctorType = (JSON.parse(window.localStorage.getItem('wlyyAgent'))||{}).doctorType
  100. var httpData=GetRequest()
  101. var docInfo = JSON.parse(window.localStorage.getItem("docInfo"));
  102. console.log(httpData)
  103. function showSuccessMessage(msg) {
  104. layer.msg(msg, {
  105. icon: 1
  106. })
  107. }
  108. function showErrorMessage(msg) {
  109. layer.msg(msg, {
  110. icon: 5
  111. })
  112. }
  113. function showWarningMessage(msg) {
  114. layer.msg(msg, {
  115. icon: 2
  116. })
  117. }
  118. function showInfoMessage(msg) {
  119. layer.msg(msg, {
  120. icon: 6
  121. })
  122. }
  123. selectVue = new Vue({
  124. el: "#app",
  125. data: {
  126. pickerOptions1: {
  127. disabledDate: function(time) {
  128. return time.getTime() < Date.now() - 8.64e7;
  129. }
  130. },
  131. patientInfo: undefined,
  132. searchKey: '',
  133. customLabel: [],
  134. diseaseLabel: [],
  135. healthLabel: [],
  136. teamList: [], // 专科团队列表
  137. curTeamId: '',
  138. curHealthStatu: '',
  139. emptyText: '暂无数据'
  140. },
  141. mounted: function() {
  142. this.getSpecialistTeamList()
  143. },
  144. watch: {
  145. curTeamId: function(){
  146. this.getSpecialistPatientLabel(this.curTeamId)
  147. }
  148. },
  149. methods: {
  150. // 获取下转居民列表
  151. onSearch: function(){
  152. if(this.searchKey.trim().length==0){
  153. showWarningMessage('请输入居民身份证进行查询!')
  154. return false;
  155. }
  156. var vm = this,
  157. loading = layer.load(0, {shade: false})
  158. var params = {
  159. idcard: this.searchKey
  160. }
  161. rehaAPI.getRehabilitationPatientList(params).then(function(res){
  162. layer.close(loading)
  163. if(res.status == 200) {
  164. if(res.data.length>0){
  165. vm.patientInfo = res.data[0]
  166. vm.getPatientLabelInfo()
  167. } else {
  168. vm.patientInfo = undefined
  169. vm.emptyText = '患者暂未家签,请先提醒患者完成家庭医生签约'
  170. }
  171. } else {
  172. showErrorMessage(res.msg);
  173. }
  174. })
  175. },
  176. getSpecialistTeamList: function(){
  177. var vm = this,
  178. loading = layer.load(0, {shade: false})
  179. var params = {
  180. doctor: docInfo.code
  181. }
  182. rehaAPI.getSpecialistTeamList(params).then(function(res){
  183. layer.close(loading)
  184. if(res.status == 200) {
  185. vm.teamList = res.data || []
  186. vm.curTeamId = vm.teamList[0].id
  187. } else {
  188. showErrorMessage(res.msg);
  189. }
  190. })
  191. },
  192. // 获取居民标签(健康情况、疾病类型、自定义分组)
  193. getPatientLabelInfo: function(){
  194. var vm = this,
  195. loading = layer.load(0, {shade: false})
  196. var params = {
  197. patient: vm.patientInfo.patient // "915cdef5-5b1d-11e6-8344-fa163e8aee56"
  198. }
  199. rehaAPI.getPatientLabelInfo(params).then(function(res){
  200. layer.close(loading)
  201. if(res.status == 200) {
  202. var healthLabel = res.data['healthLabel']||[],
  203. diseaseLabel = res.data['diseaseServer']||[],
  204. customLabel = res.data['customLabel']||[];
  205. vm.patientInfo.healthLabel = healthLabel
  206. vm.patientInfo.diseaseLabel = diseaseLabel
  207. vm.patientInfo.customLabel = customLabel
  208. vm.getSpecialistPatientLabel(vm.curTeamId)
  209. } else {
  210. showErrorMessage(res.msg);
  211. }
  212. })
  213. },
  214. // 获取居民标签字典(健康情况、疾病类型、自定义分组)
  215. getSpecialistPatientLabel: function(teamId){
  216. var vm = this,
  217. loading = layer.load(0, {shade: false})
  218. var params = {
  219. teamCode: teamId
  220. }
  221. rehaAPI.getSpecialistPatientLabel(params).then(function(res){
  222. layer.close(loading)
  223. if(res.status==200){
  224. var dLabel = [], cLabel = [];
  225. $.each(res.data['diseaseLabel'], function(index, o){
  226. o.flag = false
  227. o.disease = o.code
  228. o.diseaseName = o.name
  229. $.each(vm.patientInfo.diseaseLabel, function(index1, o1){
  230. if(o1.disease == o.code){
  231. o.flag = true
  232. }
  233. })
  234. dLabel.push(o)
  235. })
  236. $.each(res.data['customLabel'], function(index, o){
  237. o.flag = false
  238. o.labelCode = o.labelCode
  239. o.labelName = o.labelName
  240. $.each(vm.patientInfo.customLabel, function(index1, o1){
  241. if(o1.label == o.labelCode){
  242. o.flag = true
  243. }else{
  244. }
  245. })
  246. cLabel.push(o)
  247. })
  248. vm.healthLabel = res.data['healthLabel'] || []
  249. vm.curHealthStatu = vm.patientInfo.healthLabel&&vm.patientInfo.healthLabel.length>0?vm.patientInfo.healthLabel[0].label:res.data['healthLabel'][0].labelCode
  250. vm.diseaseLabel = dLabel
  251. vm.customLabel = cLabel
  252. }else{
  253. showErrorMessage(res.msg);
  254. }
  255. })
  256. },
  257. saveBtn: function(){
  258. var vm = this
  259. var vm = this, num1 = 0, num2 = 0,
  260. health = {}, disease = [], custom = []
  261. if(!vm.curHealthStatu){
  262. showWarningMessage('请选择健康情况!')
  263. return false
  264. }
  265. $.each(vm.healthLabel, function(index, o){
  266. if(o.labelCode == vm.curHealthStatu){
  267. health = {
  268. label: o.labelCode,
  269. labelName: o.labelName,
  270. labelType: o.labelType
  271. }
  272. }
  273. })
  274. for(var i=0; i<vm.diseaseLabel.length; i++){
  275. var o = vm.diseaseLabel[i]
  276. if(!o.flag){
  277. num1++
  278. } else {
  279. disease.push({
  280. disease: o.disease,
  281. diseaseName: o.diseaseName
  282. })
  283. }
  284. if(num1==vm.diseaseLabel.length){
  285. showWarningMessage('请选择疾病类型!')
  286. return false
  287. }
  288. }
  289. for(var i=0; i<vm.customLabel.length; i++){
  290. var o = vm.customLabel[i]
  291. if(!o.flag){
  292. num2++
  293. } else {
  294. custom.push({
  295. label: o.labelCode,
  296. labelName: o.labelName,
  297. labelType: o.labelType
  298. })
  299. }
  300. if(num2==vm.customLabel.length){
  301. showWarningMessage('请选择自定义分组!')
  302. return false
  303. }
  304. }
  305. var data = {
  306. health: health,
  307. disease: disease,
  308. custom: custom
  309. }
  310. var params = {
  311. patient: vm.patientInfo.patient, // "915cdef5-5b1d-11e6-8344-fa163e8aee56"
  312. patientName: vm.patientInfo.patientName,
  313. json: JSON.stringify(data)
  314. }
  315. var loading = top.layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
  316. rehaAPI.updatePatientLabelInfo(params).then(function(res){
  317. layer.close(loading);
  318. if(res.status==200){
  319. layer.confirm('康复下转基本信息保存成功,请为患者创建康复计划', { btn: ['创建康复计划', '取消'], title: "康复下转" }, function (index) {
  320. window.location.href="./new_recover.html?patient="+vm.patientInfo.patient
  321. })
  322. }else{
  323. showErrorMessage(res.msg)
  324. }
  325. })
  326. }
  327. }
  328. })
  329. </script>
  330. </body>
  331. </html>