moreplan.js 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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. patientlist:[],
  75. docInfo:[],
  76. },
  77. watch: {
  78. tablelist: function (val) {
  79. this.$nextTick(function () {
  80. element.init()
  81. var vm=this
  82. for (var i = 0; i < val.length; i++) {
  83. var allFinishCount = val[i].allFinishCount
  84. var allCount = val[i].allCount
  85. var isStop = val[i].status
  86. var ishospitalName = val[i].hospitalName
  87. for (var i = 0; i < val.length; i++){
  88. var isOperator=val[i].isOperator
  89. console.log(isOperator)
  90. if (isOperator==0) {
  91. console.log('aa')
  92. $("#stopBtn_" + val[i].planId).attr('disabled', 'true')
  93. $("#stopBtn_" + val[i].planId).css("pointer-events", "none")
  94. // $(".ii_"+val[i].patientCode).attr('disabled', 'true')
  95. // $(".ii_"+val[i].patientCode).css("pointer-events", "none");
  96. }
  97. if (ishospitalName == null) {
  98. $("#hospitalName_" + val[i].planId).html("暂无社区信息")
  99. }
  100. if (isStop == 2) {
  101. $("#span_font" + val[i].planId).html("已完成")
  102. $("#span_font" + val[i].planId).addClass("corg")
  103. }
  104. if (isStop == 1) {
  105. $("#span_font" + val[i].planId).html("进行中")
  106. $("#span_font" + val[i].planId).addClass("cblue")
  107. }
  108. if (isStop == 0) {
  109. $("#span_font" + val[i].planId).html("已中止")
  110. $("#span_font" + val[i].planId).addClass("cgre")
  111. $("#progress_" + val[i].planId).css({
  112. "background-color": "gray"
  113. })
  114. $("#stopBtn_" + val[i].planId).html("激活计划")
  115. } else {
  116. $("#progress_" + val[i].planId).css({
  117. "background-color": "#ff9526"
  118. })
  119. $("#stopBtn_" + val[i].planId).html("终止计划")
  120. }
  121. var progressNum = Math.ceil((allFinishCount / allCount) * 100)
  122. Progress(val[i].planId, progressNum + "%")
  123. }
  124. }
  125. })
  126. },
  127. patientlist:function(val){
  128. this.$nextTick(function () {
  129. })
  130. }
  131. },
  132. mounted() {
  133. var vm = this
  134. vm.getDatas()
  135. EventBus.$on("back-click", function (arg) {
  136. history.go(-1);
  137. });
  138. //监听页面刷新
  139. EventBus.$on("refresh-click", function (arg) {
  140. location.reload();
  141. });
  142. },
  143. components: {
  144. vuedals: Vuedals.Component
  145. },
  146. methods: {
  147. setImgSrc: function (src) {
  148. if (!src) {
  149. return "../../../images/p-female.png"
  150. } else {
  151. var str = httpRequest.getImgUrl(src)
  152. return str
  153. }
  154. },
  155. getDatas: function () {
  156. var vm = this
  157. var httpData = GetRequest()
  158. vm.paticentcode = httpData.patientCode
  159. var params = {
  160. patientCode: vm.paticentcode
  161. }
  162. healthAPI.PlanDetailList(params).then(function (res) {
  163. if (res.status == 200) {
  164. console.log(res)
  165. vm.wujilu = false
  166. vm.name = res.data.patientName
  167. vm.sex = res.data.sex
  168. vm.age = res.data.age
  169. vm.patientPhoto = res.data.patientPhoto
  170. vm.hospital = res.data.hospitalName
  171. vm.patientlist=res.data
  172. vm.docInfo = JSON.parse(window.localStorage.getItem('wlyyAgent'))
  173. for(var i=0;i<res.data.length;i++){
  174. vm.diseaseList = res.data[i].diseaseList
  175. vm.tablelist = _.sortBy(res.data[i].rehabilitationPlanList, "patientName")
  176. }
  177. vm.signFamilyServiceRecordCount = res.data.signFamilyServiceRecordCount
  178. vm.signFamilyFinishItemCount = res.data.signFamilyFinishItemCount
  179. vm.signFamilyAdminTeamName = res.data.signFamilyAdminTeamName
  180. vm.specialistAdminTeamName = res.data.specialistAdminTeamName
  181. vm.specialistFinishItemCount = res.data.specialistFinishItemCount
  182. vm.specialistServiceRecordCount = res.data.specialistServiceRecordCount
  183. vm.specialistHospitalName = res.data.specialistHospitalName
  184. vm.familyHospitalName = res.data.familyHospitalName
  185. if (vm.tablelist.length == 0) {
  186. vm.wujilu = true
  187. }
  188. vm.doctorType= vm.docInfo.doctorType
  189. } else {
  190. // showErrorMessage(res.msg);
  191. }
  192. })
  193. },
  194. stop: function (data) {
  195. var vm = this
  196. vm.planid = data.planId
  197. console.log(data.planId)
  198. conFirm("确定终止该计划吗", data.status, vm.isStop, vm.planid, vm.getDatas)
  199. console.log(vm.isStop)
  200. },
  201. noOpen: function () {
  202. showInfoMessage("暂未开放")
  203. },
  204. checkPatient: function () {
  205. var vm = this
  206. location.href = "../../temporary/html/userInfo.html?patient=" + vm.paticentcode
  207. },
  208. checkPlan: function (data) {
  209. location.href = "../../rehabilitation/html/rehabilitation_management.html?planId=" + data.planId
  210. },
  211. }
  212. })
  213. });