moreplan.js 12 KB

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