123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293 |
- 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("激活计划")
- } else {
- $("#progress_"+planid).css({
- "background-color": "#ff9526"
- })
- $("#stopBtn_"+planid).html("终止计划")
- }
- 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,
-
- },
- 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
- 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("激活计划")
- } else {
- $("#progress_"+val[i].id).css({
- "background-color": "#ff9526"
- })
- $("#stopBtn_"+val[i].id).html("终止计划")
-
- }
-
- }
- 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
- }
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- gettypes: function () {
- var vm = this
- var search = true
- $("#Status").bsSuggest({
- data: {
- value: [{
- code: "",
- name: "全部"
- },
- {
- code: "1",
- name: "康复计划"
- },
- {
- code: "2",
- name: "(转)社区医院"
- },
- {
- code: "3",
- name: "(转)家庭病床"
- }
- ]
- },
- getDataMethod: "data",
- effectiveFields: ["name"],
- idField: "code",
- keyField: "name"
- });
- healthAPI.getSpecialDisease().then(function (res) {
- if (res.status == 200) {
- console.log(res)
- var data = {}
- data.value = _.map(res.data, function (v) {
- return {
- code: v.code,
- name: v.name
- }
- })
- if (search) {
- data.value = [{
- code: "",
- name: "全部"
- }].concat(data.value)
- }
- $("#Type").bsSuggest({
- data: data,
- getDataMethod: "data",
- effectiveFields: ["name"],
- idField: "code",
- keyField: "name"
- });
- vm.types = res.data;
- } else {
- showErrorMessage(res.msg);
- }
- })
- },
- search: function (page) {
- var vm = this
- vm.type = $("#Type").attr("data-id");
- vm.status = $("#Status").attr("data-id");
- vm.currentPage = page
- vm.getDatas()
- },
- daiban: function (page) {
- var vm = this
- vm.isTotayTodo = $("#c").prop("checked") ? 2 : 1
- $(".icon-chkbox").toggleClass("icon-bgchkbox");
- vm.currentPage = page
- console.log(vm.currentPage)
- vm.getDatas()
- },
- morePlan: function (data) {
- location.href = "moreplan.html?patientCode=" + data.patientCode
- },
- checkPlan: function (data) {
- location.href = "../../rehabilitation/html/rehabilitation_management.html?planId=" + data.id + "&status=" + data.status
- },
- stop: function (data) {
- var vm = this
- vm.planid = data.id
- conFirm("确定终止该计划吗", data.status, vm.isStop, vm.planid, vm.getDatas)
-
- },
- newRecover:function(){
- location.href="../../recover/html/new_recover.html"
- }
- }
- })
- });
|