moreplan.js 9.5 KB

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