moreplan.js 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. $("#button_id").attr('disabled', true).addClass("falsebutton")
  18. } else {
  19. isStop = num == 0 ? 1 : 0
  20. }
  21. var params = {
  22. status: isStop,
  23. planId: planid
  24. }
  25. healthAPI.updatePlanStatusById(params).then(function (res) {
  26. if (res.status == 200) {
  27. getDat()
  28. }
  29. })
  30. layer.close(index);
  31. });
  32. }
  33. var reqList = []; //记录请求的参数和url,用于后退时使用
  34. Vue.use(Vuedals.default);
  35. new Vue({
  36. el: "#app",
  37. data: {
  38. appname: "更多计划",
  39. isback: true,
  40. isrefresh: true,
  41. paticentcode: "",
  42. tablelistone: [],
  43. tablelist: [],
  44. name: "",
  45. sex: "",
  46. age: "",
  47. hospital: "",
  48. diseaseList: [],
  49. signFamilyFinishItemCount: "",
  50. signFamilyServiceRecordCount: "",
  51. signFamilyAdminTeamName: "",
  52. specialistAdminTeamName: "",
  53. specialistFinishItemCount: "",
  54. specialistServiceRecordCount: "",
  55. progress: "",
  56. specialistHospitalName: "",
  57. familyHospitalName: "",
  58. planid: "",
  59. isStop: 1 //
  60. },
  61. watch: {
  62. tablelist: function (val) {
  63. this.$nextTick(function () {
  64. element.init()
  65. for (var i = 0; i < val.length; i++) {
  66. var allFinishCount = val[i].allFinishCount
  67. var allCount = val[i].allCount
  68. var isStop = val[i].status
  69. var bname=val[i].patientName
  70. // if()
  71. if(isStop==2){
  72. $("#span_font").html("已完成")
  73. $("#span_font").addClass("corg")
  74. }
  75. if(isStop==1){
  76. $("#span_font").html("进行中")
  77. $("#span_font").addClass("cblue")
  78. }
  79. if (isStop == 0) {
  80. $(".layui-progress-bar").css({
  81. "background-color": "gray"
  82. })
  83. $("#button_id").html("激活计划")
  84. $("#span_font").html("已中止")
  85. $("#span_font").addClass("cgre")
  86. } else {
  87. $(".layui-progress-bar").css({
  88. "background-color": "#ff9526"
  89. })
  90. $("#button_id").html("终止计划")
  91. }
  92. var progressNum = Math.ceil((allFinishCount / allCount) * 100)
  93. Progress(val[i].planId, progressNum + "%")
  94. }
  95. })
  96. },
  97. },
  98. mounted() {
  99. var vm = this
  100. vm.getDatas()
  101. EventBus.$on("back-click", function (arg) {
  102. history.go(-1);
  103. });
  104. //监听页面刷新
  105. EventBus.$on("refresh-click", function (arg) {
  106. location.reload();
  107. });
  108. },
  109. components: {
  110. vuedals: Vuedals.Component
  111. },
  112. methods: {
  113. setImgSrc: function(src) {
  114. var str = httpRequest.getImgUrl(src)
  115. return str
  116. },
  117. getDatas: function () {
  118. var vm = this
  119. var httpData = GetRequest()
  120. vm.paticentcode = httpData.patientCode
  121. var params = {
  122. patientCode: vm.paticentcode
  123. }
  124. healthAPI.PlanDetailList(params).then(function (res) {
  125. if (res.status == 200) {
  126. console.log(res)
  127. vm.wujilu = false
  128. vm.name = res.data.patientName
  129. vm.sex = res.data.sex
  130. vm.age = res.data.age
  131. vm.hospital = res.data.hospitalName
  132. vm.diseaseList = res.data.diseaseList
  133. vm.tablelist=_.sortBy(res.data.rehabilitationPlanList,"patientName")
  134. vm.signFamilyServiceRecordCount = res.data.signFamilyServiceRecordCount
  135. vm.signFamilyFinishItemCount = res.data.signFamilyFinishItemCount
  136. vm.signFamilyAdminTeamName = res.data.signFamilyAdminTeamName
  137. vm.specialistAdminTeamName = res.data.specialistAdminTeamName
  138. vm.specialistFinishItemCount = res.data.specialistFinishItemCount
  139. vm.specialistServiceRecordCount = res.data.specialistServiceRecordCount
  140. vm.specialistHospitalName = res.data.specialistHospitalName
  141. vm.familyHospitalName = res.data.familyHospitalName
  142. if (vm.tablelist.length == 0) {
  143. vm.wujilu = true
  144. }
  145. } else {
  146. // showErrorMessage(res.msg);
  147. }
  148. })
  149. },
  150. stop: function (data) {
  151. var vm = this
  152. vm.planid = data.planId
  153. console.log(data.planId)
  154. ConFirm("确定终止该计划吗", data.status, vm.isStop,vm.planid,vm.getDatas)
  155. var params = {
  156. status: vm.isStop,
  157. planId: vm.planid
  158. }
  159. console.log(vm.isStop)
  160. },
  161. noOpen:function(){
  162. showInfoMessage("暂未开放")
  163. }
  164. }
  165. })
  166. });