moreplan.js 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. layui.use('element', function () {
  2. element = layui.element//Tab的切换功能,切换事件监听等,需要依赖element模块
  3. function Progress(dom, num) {
  4. window.setTimeout(function () {
  5. element.progress(dom, num)
  6. }, 360)
  7. }
  8. function showInfoMessage(msg) {
  9. layer.msg(msg, {
  10. icon: 6
  11. })
  12. }
  13. function conFirm(msg, num, isStop, planid, getDat) {
  14. layer.confirm('您确定要执行该操作吗?', { btn: ['确定', '取消'], title: "提示" }, function (index) {
  15. if (num == 2) {
  16. showInfoMessage("计划已完成")
  17. $("#stopBtn_" + planid).attr('disabled', true).addClass("falsebutton")
  18. } else {
  19. isStop = num == 0 ? 1 : 0
  20. }
  21. if (isStop == 0) {
  22. $("#progress_" + planid).css({
  23. "background-color": "gray"
  24. })
  25. $("#stopBtn_" + planid).html("激活计划")
  26. } else {
  27. $("#progress_" + planid).css({
  28. "background-color": "#ff9526"
  29. })
  30. $("#stopBtn_" + planid).html("终止计划")
  31. }
  32. var params = {
  33. status: isStop,
  34. planId: planid
  35. }
  36. healthAPI.updatePlanStatusById(params).then(function (res) {
  37. if (res.status == 200) {
  38. getDat()
  39. }
  40. })
  41. layer.close(index);
  42. });
  43. }
  44. var reqList = []; //记录请求的参数和url,用于后退时使用
  45. Vue.use(Vuedals.default);
  46. new Vue({
  47. el: "#app",
  48. data: {
  49. appname: "更多计划",
  50. isback: true,
  51. isrefresh: true,
  52. paticentcode: "",
  53. tablelistone: [],
  54. tablelist: [],
  55. name: "",
  56. sex: "",
  57. age: "",
  58. hospital: "",
  59. diseaseList: [],
  60. signFamilyFinishItemCount: "",
  61. signFamilyServiceRecordCount: "",
  62. signFamilyAdminTeamName: "",
  63. specialistAdminTeamName: "",
  64. specialistFinishItemCount: "",
  65. specialistServiceRecordCount: "",
  66. progress: "",
  67. specialistHospitalName: "",
  68. familyHospitalName: "",
  69. planid: "",
  70. isStop: 1,//
  71. patientPhoto: "",
  72. doctorType: "",
  73. docInfo: [],
  74. },
  75. watch: {
  76. tablelist: function (val) {
  77. this.$nextTick(function () {
  78. element.init()
  79. for (var i = 0; i < val.length; i++) {
  80. var allFinishCount = val[i].allFinishCount
  81. var allCount = val[i].allCount
  82. var isStop = val[i].status
  83. var ishospitalName = val[i].hospitalName
  84. if (ishospitalName == null) {
  85. $("#hospitalName_" + val[i].id).html("暂无社区信息")
  86. }
  87. if (isStop == 2) {
  88. $("#span_font" + val[i].planId).html("已完成")
  89. $("#span_font" + val[i].planId).addClass("corg")
  90. }
  91. if (isStop == 1) {
  92. $("#span_font" + val[i].planId).html("进行中")
  93. $("#span_font" + val[i].planId).addClass("cblue")
  94. }
  95. if (isStop == 0) {
  96. $("#span_font" + val[i].planId).html("已中止")
  97. $("#span_font" + val[i].planId).addClass("cgre")
  98. $("#progress_" + val[i].planId).css({
  99. "background-color": "gray"
  100. })
  101. $("#stopBtn_" + val[i].planId).html("激活计划")
  102. } else {
  103. $("#progress_" + val[i].planId).css({
  104. "background-color": "#ff9526"
  105. })
  106. $("#stopBtn_" + val[i].planId).html("终止计划")
  107. }
  108. var progressNum = Math.ceil((allFinishCount / allCount) * 100)
  109. Progress(val[i].planId, progressNum + "%")
  110. }
  111. })
  112. },
  113. },
  114. mounted() {
  115. var vm = this
  116. vm.getDatas()
  117. EventBus.$on("back-click", function (arg) {
  118. history.go(-1);
  119. });
  120. //监听页面刷新
  121. EventBus.$on("refresh-click", function (arg) {
  122. location.reload();
  123. });
  124. },
  125. components: {
  126. vuedals: Vuedals.Component
  127. },
  128. methods: {
  129. setImgSrc: function (src) {
  130. if (!src) {
  131. return "../../../images/p-female.png"
  132. } else {
  133. var str = httpRequest.getImgUrl(src)
  134. return str
  135. }
  136. },
  137. getDatas: function () {
  138. var vm = this
  139. var httpData = GetRequest()
  140. vm.paticentcode = httpData.patientCode
  141. var params = {
  142. patientCode: vm.paticentcode
  143. }
  144. healthAPI.PlanDetailList(params).then(function (res) {
  145. if (res.status == 200) {
  146. console.log(res)
  147. vm.wujilu = false
  148. vm.name = res.data.patientName
  149. vm.sex = res.data.sex
  150. vm.age = res.data.age
  151. vm.patientPhoto = res.data.patientPhoto
  152. vm.hospital = res.data.hospitalName
  153. vm.diseaseList = res.data.diseaseList
  154. vm.tablelist = _.sortBy(res.data.rehabilitationPlanList, "patientName")
  155. vm.signFamilyServiceRecordCount = res.data.signFamilyServiceRecordCount
  156. vm.signFamilyFinishItemCount = res.data.signFamilyFinishItemCount
  157. vm.signFamilyAdminTeamName = res.data.signFamilyAdminTeamName
  158. vm.specialistAdminTeamName = res.data.specialistAdminTeamName
  159. vm.specialistFinishItemCount = res.data.specialistFinishItemCount
  160. vm.specialistServiceRecordCount = res.data.specialistServiceRecordCount
  161. vm.specialistHospitalName = res.data.specialistHospitalName
  162. vm.familyHospitalName = res.data.familyHospitalName
  163. if (vm.tablelist.length == 0) {
  164. vm.wujilu = true
  165. }
  166. vm.doctorType= vm.docInfo.doctorType
  167. if(vm.doctorType!==1){
  168. $(".ii").attr('disabled', 'true')
  169. $(".ii").css("pointer-events", "none");
  170. }
  171. } else {
  172. // showErrorMessage(res.msg);
  173. }
  174. })
  175. },
  176. stop: function (data) {
  177. var vm = this
  178. vm.planid = data.planId
  179. console.log(data.planId)
  180. conFirm("确定终止该计划吗", data.status, vm.isStop, vm.planid, vm.getDatas)
  181. console.log(vm.isStop)
  182. },
  183. noOpen: function () {
  184. showInfoMessage("暂未开放")
  185. },
  186. checkPatient: function () {
  187. var vm = this
  188. location.href = "../../temporary/html/userInfo.html?patient=" + vm.paticentcode
  189. },
  190. checkPlan: function (data) {
  191. location.href = "../../rehabilitation/html/rehabilitation_management.html?planId=" + data.planId
  192. },
  193. }
  194. })
  195. });