layui.use('element', function () { // var $ = layui.jquery element = layui.element//Tab的切换功能,切换事件监听等,需要依赖element模块 function Progress(dom, num) { window.setTimeout(function () { element.progress(dom, num) }, 360) } function showInfoMessage(msg) { layer.msg(msg, { icon: 6 }) } function showErrorMessage(msg) { layer.msg(msg, { icon: 5 }) } function conFirm(msg, num, isStop, planid, getDat) { layer.confirm('您确定要执行该操作吗?', { btn: ['确定', '取消'], title: "提示" }, function (index) { if (num == 2) { showInfoMessage("计划已完成") $("#stopBtn_" + planid).attr('disabled', true).addClass("falsebutton") } else { isStop = num == 0 ? 1 : 0 } if (isStop == 0) { $("#progress_" + planid).css({ "background-color": "gray" }) $("#stopBtn_" + planid).html("激活计划") $("#stopBtn_" + planid).css({ "background-color": "#2dbe55" }) } else { $("#progress_" + planid).css({ "background-color": "#ff9526" }) $("#stopBtn_" + planid).html("中止计划") $("#stopBtn_" + planid).css({ "background-color": "#ff3b30" }) } console.log(isStop) var params = { status: isStop, planId: planid } healthAPI.updatePlanStatusById(params).then(function (res) { if (res.status == 200) { getDat() } }) layer.close(index); }); } new Vue({ el: '#app', data: { code: "", modal: "", type: "", status: "", plan: "", name: "", isDanger: "0", pagesize: 10, total: "", pagetotal: '', //总页数 currentPage: 1, //当前页数 tablelist: [], diseaselist: [], types: [], Statics: {}, wujilu: false, datamodelshow: true, plantype: 1, todaylog: 1, isTotayTodo: 1, progress: "", allFinishCount: "", allCount: "", planid: "", isStop: 1, // isActive: true, doctorType: "", docCode:"", docInfo: [], isLeader: 0, planCreateUser: "" }, watch: { tablelist: function (val) { var vm = this this.$nextTick(function () { element.init() for (var i = 0; i < val.length; i++) { var allFinishCount = val[i].allFinishCount var allCount = val[i].allCount var isStop = val[i].status var ishospitalName = val[i].hospitalName vm.planCreateUser = val[i].planCreateUser if (ishospitalName == null) { $("#hospitalName_" + val[i].id).html("暂无社区信息") } if (allCount == 0) { Progress(val[i].id, 0 + "%") } else { var progressNum = Math.ceil((allFinishCount / allCount) * 100) Progress(val[i].id, progressNum + "%") } if (isStop == 0) { $("#progress_" + val[i].id).css({ "background-color": "gray" }) $("#stopBtn_" + val[i].id).html("激活计划") $("#stopBtn_" + val[i].id).css({ "background-color": "#2dbe55" }) } else { $("#progress_" + val[i].id).css({ "background-color": "#ff9526" }) $("#stopBtn_" + val[i].id).html("中止计划") $("#stopBtn_" + val[i].id).css({ "background-color": "#ff3b30" }) } } var lastColor = 'red'; for (var i = 0; i < val.length; i++) { if (i == 0) { $($(".quote")[i]).css("background-color", "#12b7f5") continue } if (val[i].patientName == val[i - 1].patientName) { $($(".quote")[i]).css("background-color", "#02cfb9") if (lastColor === 'red') { $($(".quote")[i]).css("background-color", "#12b7f5") } } else { if (lastColor !== 'red') { $($(".quote")[i]).css("background-color", "#12b7f5") lastColor = 'red' } else { lastColor = 'white' $($(".quote")[i]).css("background-color", "#02cfb9") } } } }) }, }, mounted() { var vm = this // vm.getModal() vm.getDatas() vm.gettypes() }, methods: { setImgSrc: function (src) { var str = httpRequest.getImgUrl(src) return str }, getDatas: function () { var vm = this var params = { patientCondition: vm.name,// 居民条件,可以按身份证或者居民名称模糊匹配 diseaseCode: vm.type, //疾病类型 planType: vm.status, //安排类型(1康复计划,2转社区医院,3转家庭病床) todaybacklog: vm.isTotayTodo, // 今日待办(1、今日待办,2、全部) page: vm.currentPage, pageSize: vm.pagesize, isDanger: vm.isDanger, } healthAPI.getSpecialList(params).then(function (res) { console.log(res) if (res.status == 200) { vm.wujilu = false vm.total = res.data.totalCount vm.pagetotal = Math.ceil(res.data.totalCount / vm.pagesize) vm.tablelist = _.sortBy(res.data.detailModelList, "patientName") if (vm.tablelist.length == 0) { vm.wujilu = true } vm.docInfo = JSON.parse(window.localStorage.getItem('wlyyAgent')) vm.doctorType = vm.docInfo.doctorType if (vm.doctorType !== 1) { $(".neironglef>button").attr('disabled', "true") $(".neironglef>button").addClass("falsebutton") $(".neironglef>button").css("color", "white") } healthAPI.doctorBaseinfo().then(function (res) { vm.isLeader = res.data.isLeader for(var i=0;i