moreplan.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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. if (num == 1) {
  15. layer.confirm('<p class="c-333 mb10">请说明中止计划的原因?</p><textarea class="plr5 ptb5 w-100 h200 c-333 set-textarea" maxlength="300" placeholder="请简要描述一下原因,不多于300字"></textarea>', {
  16. btn: ['确定', '取消'],
  17. area: ["400px", "auto"],
  18. title: "提示"
  19. }, function (index) {
  20. var reason = $(".set-textarea").val()
  21. console.log(reason)
  22. if (num == 2) {
  23. showInfoMessage("计划已完成")
  24. $("#stopBtn_" + planid).attr('disabled', true).addClass("falsebutton")
  25. } else {
  26. isStop = num == 0 ? 1 : 0
  27. }
  28. if (isStop == 0) {
  29. $("#progress_" + planid).css({
  30. "background-color": "gray"
  31. })
  32. $("#stopBtn_" + planid).html("激活计划")
  33. } else {
  34. $("#progress_" + planid).css({
  35. "background-color": "#ff9526"
  36. })
  37. $("#stopBtn_" + planid).html("中止计划")
  38. }
  39. var params = {
  40. status: isStop,
  41. planId: planid
  42. }
  43. healthAPI.updatePlanStatusById(params).then(function (res) {
  44. if (res.status == 200) {
  45. getDat()
  46. }
  47. })
  48. layer.close(index);
  49. });
  50. } else {
  51. layer.confirm('您确定要执行该操作吗?', { btn: ['确定', '取消'], title: "提示" }, function (index) {
  52. if (num == 2) {
  53. showInfoMessage("计划已完成")
  54. $("#stopBtn_" + planid).attr('disabled', true).addClass("falsebutton")
  55. } else {
  56. isStop = num == 0 ? 1 : 0
  57. }
  58. if (isStop == 0) {
  59. $("#progress_" + planid).css({
  60. "background-color": "gray"
  61. })
  62. $("#stopBtn_" + planid).html("激活计划")
  63. } else {
  64. $("#progress_" + planid).css({
  65. "background-color": "#ff9526"
  66. })
  67. $("#stopBtn_" + planid).html("中止计划")
  68. }
  69. var params = {
  70. status: isStop,
  71. planId: planid
  72. }
  73. healthAPI.updatePlanStatusById(params).then(function (res) {
  74. if (res.status == 200) {
  75. getDat()
  76. }
  77. })
  78. layer.close(index);
  79. });
  80. }
  81. }
  82. var reqList = []; //记录请求的参数和url,用于后退时使用
  83. Vue.use(Vuedals.default);
  84. new Vue({
  85. el: "#app",
  86. data: {
  87. appname: "更多计划",
  88. isback: true,
  89. isrefresh: true,
  90. paticentcode: "",
  91. tablelistone: [],
  92. tablelist: [],
  93. name: "",
  94. sex: "",
  95. age: "",
  96. hospital: "",
  97. diseaseList: [],
  98. signFamilyFinishItemCount: "",
  99. signFamilyServiceRecordCount: "",
  100. signFamilyAdminTeamName: "",
  101. specialistAdminTeamName: "",
  102. specialistFinishItemCount: "",
  103. specialistServiceRecordCount: "",
  104. progress: "",
  105. specialistHospitalName: "",
  106. familyHospitalName: "",
  107. planid: "",
  108. isStop: 1,//
  109. patientPhoto: "",
  110. doctorType: "",
  111. docInfo: {},
  112. patientlist: [],
  113. },
  114. watch: {
  115. patientlist: function (val) {
  116. this.$nextTick(function () {
  117. element.init()
  118. var vm = this
  119. for (var i = 0; i < val.length; i++) {
  120. for (var j = 0; j < val[i].rehabilitationPlanList.length; j++) {
  121. var obj = val[i].rehabilitationPlanList[j]
  122. var isOperator = obj.isOperator
  123. var allFinishCount = obj.allFinishCount
  124. var allCount = obj.allCount
  125. var isStop = obj.status
  126. var ishospitalName = val[i].hospitalName
  127. var healthyConditionType=val[i].healthyConditionType
  128. if(healthyConditionType==1){
  129. $("#quote_"+val[i].patientCode).css("backgroundColor","#FF3B30")
  130. }
  131. if(healthyConditionType==2){
  132. $("#quote_"+val[i].patientCode).css("backgroundColor","#FF9526")
  133. }
  134. if(healthyConditionType==3){
  135. $("#quote_"+val[i].patientCode).css("backgroundColor","#2DBE55")
  136. }
  137. if(healthyConditionType==4){
  138. $("#quote_"+val[i].patientCode).css("backgroundColor","#02CFB9")
  139. }
  140. if (isOperator == 0) {
  141. $("#stopBtn_" + obj.planId).attr('disabled', 'true')
  142. $("#stopBtn_" + obj.planId).css("pointer-events", "none")
  143. $("#stopBtn_" + obj.planId).css("color", "#999999")
  144. }
  145. if (ishospitalName == null) {
  146. $("#hospitalName_" + obj.planId).html("暂无社区信息")
  147. }
  148. if (isStop == 2) {
  149. $("#span_font" + obj.planId).html("已完成")
  150. $("#span_font" + obj.planId).css("color","#ff9526")
  151. }else{
  152. if (isStop == 1) {
  153. $("#span_font" + obj.planId).html("进行中")
  154. $("#span_font" + obj.planId).css("color","#12b7f5")
  155. }
  156. if (isStop == 0) {
  157. $("#span_font" + obj.planId).html("已中止")
  158. $("#span_font" + obj.planId).css("color","#999999")
  159. $("#progress_" + obj.planId).css({
  160. "background-color": "gray"
  161. })
  162. $("#stopBtn_" + obj.planId).html("激活计划")
  163. } else {
  164. $("#progress_" + obj.planId).css({
  165. "background-color": "#ff9526"
  166. })
  167. $("#stopBtn_" + obj.planId).html("中止计划")
  168. }
  169. }
  170. if(allCount==0){
  171. Progress(obj.planId, 0 + "%")
  172. }else{
  173. var progressNum = Math.ceil((allFinishCount / allCount) * 100)
  174. Progress(obj.planId, progressNum + "%")
  175. }
  176. }
  177. }
  178. })
  179. }
  180. },
  181. mounted: function() {
  182. var vm = this
  183. vm.getDatas()
  184. EventBus.$on("back-click", function (arg) {
  185. history.go(-1);
  186. });
  187. //监听页面刷新
  188. EventBus.$on("refresh-click", function (arg) {
  189. location.reload();
  190. });
  191. },
  192. components: {
  193. vuedals: Vuedals.Component
  194. },
  195. methods: {
  196. setImgSrc: function (src) {
  197. if (!src) {
  198. return "../../../images/p-female.png"
  199. } else {
  200. var str = httpRequest.getImgUrl(src)
  201. return str
  202. }
  203. },
  204. getDatas: function () {
  205. var vm = this
  206. var httpData = GetRequest()
  207. vm.paticentcode = httpData.patientCode
  208. var params = {
  209. patientCode: vm.paticentcode
  210. }
  211. healthAPI.PlanDetailList(params).then(function (res) {
  212. if (res.status == 200) {
  213. console.log(res)
  214. vm.wujilu = false
  215. vm.name = res.data.patientName
  216. vm.sex = res.data.sex
  217. vm.age = res.data.age
  218. vm.patientlist = res.data
  219. vm.patientPhoto = res.data.patientPhoto
  220. vm.hospital = res.data.hospitalName
  221. vm.docInfo = JSON.parse(window.localStorage.getItem('wlyyAgent'))
  222. console.log(res.data.length)
  223. vm.signFamilyServiceRecordCount = res.data.signFamilyServiceRecordCount
  224. vm.signFamilyFinishItemCount = res.data.signFamilyFinishItemCount
  225. vm.signFamilyAdminTeamName = res.data.signFamilyAdminTeamName
  226. vm.specialistAdminTeamName = res.data.specialistAdminTeamName
  227. vm.specialistFinishItemCount = res.data.specialistFinishItemCount
  228. vm.specialistServiceRecordCount = res.data.specialistServiceRecordCount
  229. vm.specialistHospitalName = res.data.specialistHospitalName
  230. vm.familyHospitalName = res.data.familyHospitalName
  231. if (vm.tablelist.length == 0) {
  232. vm.wujilu = true
  233. }
  234. vm.doctorType = vm.docInfo.doctorType
  235. } else {
  236. // showErrorMessage(res.msg);
  237. }
  238. })
  239. },
  240. stop: function (data) {
  241. var vm = this
  242. vm.planid = data.planId
  243. console.log(data.planId)
  244. conFirm("确定终止该计划吗", data.status, vm.isStop, vm.planid, vm.getDatas)
  245. console.log(vm.isStop)
  246. },
  247. noOpen: function () {
  248. showInfoMessage("暂未开放")
  249. },
  250. checkPatient: function () {
  251. var vm = this
  252. layer.open({
  253. type: 2,
  254. area: ['750px', '650px'],
  255. shade: 0.5,
  256. title: '居民信息',
  257. fixed: true, //不固定
  258. maxmin: true,
  259. closeBtn: 1,
  260. shift: 5,
  261. shadeClose: false, //点击遮罩关闭层
  262. content: '../../temporary/html/userInfo.html?patient=' + vm.paticentcode
  263. });
  264. // location.href = "" +
  265. },
  266. checkPlan: function (data) {
  267. location.href = "../../rehabilitation/html/rehabilitation_management.html?planId=" + data.planId+"&patientCode="+this.paticentcode
  268. },
  269. }
  270. })
  271. });