moreplan.js 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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. if (isOperator==0) {
  90. console.log('aa')
  91. $("#stopBtn_" + val[i].planId).attr('disabled', 'true')
  92. $("#stopBtn_" + val[i].planId).css("pointer-events", "none")
  93. $("#stopBtn_" + val[i].planId).css("color","#999999")
  94. }
  95. if (ishospitalName == null) {
  96. $("#hospitalName_" + val[i].planId).html("暂无社区信息")
  97. }
  98. if (isStop == 2) {
  99. $("#span_font" + val[i].planId).html("已完成")
  100. $("#span_font" + val[i].planId).addClass("corg")
  101. }
  102. if (isStop == 1) {
  103. $("#span_font" + val[i].planId).html("进行中")
  104. $("#span_font" + val[i].planId).addClass("cblue")
  105. }
  106. if (isStop == 0) {
  107. $("#span_font" + val[i].planId).html("已中止")
  108. $("#span_font" + val[i].planId).addClass("cgre")
  109. $("#progress_" + val[i].planId).css({
  110. "background-color": "gray"
  111. })
  112. $("#stopBtn_" + val[i].planId).html("激活计划")
  113. } else {
  114. $("#progress_" + val[i].planId).css({
  115. "background-color": "#ff9526"
  116. })
  117. $("#stopBtn_" + val[i].planId).html("终止计划")
  118. }
  119. var progressNum = Math.ceil((allFinishCount / allCount) * 100)
  120. Progress(val[i].planId, progressNum + "%")
  121. }
  122. }
  123. })
  124. }
  125. },
  126. mounted() {
  127. var vm = this
  128. vm.getDatas()
  129. EventBus.$on("back-click", function (arg) {
  130. history.go(-1);
  131. });
  132. //监听页面刷新
  133. EventBus.$on("refresh-click", function (arg) {
  134. location.reload();
  135. });
  136. },
  137. components: {
  138. vuedals: Vuedals.Component
  139. },
  140. methods: {
  141. setImgSrc: function (src) {
  142. if (!src) {
  143. return "../../../images/p-female.png"
  144. } else {
  145. var str = httpRequest.getImgUrl(src)
  146. return str
  147. }
  148. },
  149. getDatas: function () {
  150. var vm = this
  151. var httpData = GetRequest()
  152. vm.paticentcode = httpData.patientCode
  153. var params = {
  154. patientCode: vm.paticentcode
  155. }
  156. healthAPI.PlanDetailList(params).then(function (res) {
  157. if (res.status == 200) {
  158. console.log(res)
  159. vm.wujilu = false
  160. vm.name = res.data.patientName
  161. vm.sex = res.data.sex
  162. vm.age = res.data.age
  163. vm.patientlist=res.data
  164. vm.patientPhoto = res.data.patientPhoto
  165. vm.hospital = res.data.hospitalName
  166. vm.docInfo = JSON.parse(window.localStorage.getItem('wlyyAgent'))
  167. console.log(res.data.length)
  168. for(var i=0;i<res.data.length;i++){
  169. // vm.diseaseList = res.data[i].diseaseList
  170. vm.tablelist = _.sortBy(res.data[i].rehabilitationPlanList, "patientName")
  171. console.log(vm.diseaseList)
  172. }
  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: ['600px', '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. });