moreplan.js 10 KB

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