addRecoveryDown.html 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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.label">{{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">患者暂未家签,请先提醒患者完成家庭医生签约</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: '350524200505041022',
  133. customLabel: [],
  134. diseaseLabel: [],
  135. healthLabel: [],
  136. teamList: [], // 专科团队列表
  137. curTeamId: '',
  138. curHealthStatu: ''
  139. },
  140. mounted: function() {
  141. this.getSpecialistTeamList()
  142. },
  143. methods: {
  144. // 获取下转居民列表
  145. onSearch: function(){
  146. if(this.searchKey.trim().length==0){
  147. return false;
  148. }
  149. var vm = this,
  150. loading = layer.load(0, {shade: false})
  151. var params = {
  152. idcard: this.searchKey
  153. }
  154. rehaAPI.getRehabilitationPatientList(params).then(function(res){
  155. layer.close(loading)
  156. if(res.status == 200) {
  157. if(res.data.length>0){
  158. vm.patientInfo = res.data[0]
  159. vm.getPatientLabelInfo()
  160. }
  161. } else {
  162. showErrorMessage(res.msg);
  163. }
  164. })
  165. },
  166. // 获取居民标签(健康情况、疾病类型、自定义分组)
  167. getPatientLabelInfo: function(){
  168. var vm = this,
  169. loading = layer.load(0, {shade: false})
  170. var params = {
  171. patient: vm.patientInfo.patient // "915cdef5-5b1d-11e6-8344-fa163e8aee56"
  172. }
  173. rehaAPI.getPatientLabelInfo(params).then(function(res){
  174. layer.close(loading)
  175. if(res.status == 200) {
  176. var diseaseLabel = [], customLabel = [];
  177. $.each(res.data['diseaseServer'], function(index, o){
  178. o.flag = false
  179. diseaseLabel.push(o)
  180. })
  181. $.each(res.data['customLabel'], function(index, o){
  182. o.flag = false
  183. customLabel.push(o)
  184. })
  185. vm.healthLabel = res.data['healthLabel'] || []
  186. vm.curHealthStatu = vm.healthLabel.length>0?vm.healthLabel[0].label:undefined
  187. vm.diseaseLabel = diseaseLabel
  188. vm.customLabel = customLabel
  189. } else {
  190. showErrorMessage(res.msg);
  191. }
  192. })
  193. },
  194. getSpecialistTeamList: function(){
  195. var vm = this,
  196. loading = layer.load(0, {shade: false})
  197. var params = {
  198. doctor: docInfo.code
  199. }
  200. rehaAPI.getSpecialistTeamList(params).then(function(res){
  201. layer.close(loading)
  202. if(res.status == 200) {
  203. vm.teamList = res.data || []
  204. vm.curTeamId = vm.teamList[0].id
  205. } else {
  206. showErrorMessage(res.msg);
  207. }
  208. })
  209. },
  210. saveBtn: function(){
  211. var vm = this
  212. var vm = this, num1 = 0, num2 = 0,
  213. health = {}, disease = [], custom = []
  214. if(!vm.curHealthStatu){
  215. showWarningMessage('请选择健康情况!')
  216. return false
  217. }
  218. $.each(vm.healthLabel, function(index, o){
  219. if(o.label == vm.curHealthStatu){
  220. health = {
  221. label: o.label,
  222. labelName: o.labelName,
  223. labelType: o.labelType
  224. }
  225. }
  226. })
  227. for(var i=0; i<vm.diseaseLabel.length; i++){
  228. var o = vm.diseaseLabel[i]
  229. if(!o.flag){
  230. num1++
  231. } else {
  232. disease.push({
  233. disease: o.disease,
  234. diseaseName: o.diseaseName
  235. })
  236. }
  237. if(num1==vm.diseaseLabel.length){
  238. showWarningMessage('请选择疾病类型!')
  239. return false
  240. }
  241. }
  242. for(var i=0; i<vm.customLabel.length; i++){
  243. var o = vm.customLabel[i]
  244. if(!o.flag){
  245. num2++
  246. } else {
  247. custom.push({
  248. label: o.label,
  249. labelName: o.labelName,
  250. labelType: o.labelType
  251. })
  252. }
  253. if(num2==vm.customLabel.length){
  254. showWarningMessage('请选择自定义分组!')
  255. return false
  256. }
  257. }
  258. var data = {
  259. health: health,
  260. disease: disease,
  261. custom: custom
  262. }
  263. var params = {
  264. patient: vm.patientInfo.patient, // "915cdef5-5b1d-11e6-8344-fa163e8aee56"
  265. patientName: vm.patientInfo.patientName,
  266. json: JSON.stringify(data)
  267. }
  268. var loading = top.layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
  269. rehaAPI.updatePatientLabelInfo(params).then(function(res){
  270. layer.close(loading);
  271. if(res.status==200){
  272. layer.confirm('康复下转基本信息保存成功,请为患者创建康复计划', { btn: ['创建康复计划', '取消'], title: "康复下转" }, function (index) {
  273. window.location.href="./new_recover.html?patient="+vm.patientInfo.patient
  274. })
  275. }else{
  276. showErrorMessage(res.msg)
  277. }
  278. })
  279. }
  280. }
  281. })
  282. </script>
  283. </body>
  284. </html>