123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- layui.use('element', function () {
- 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 conFirm(msg, num, isStop, planid, getDat) {
- if (num == 1) {
- layer.confirm('<p class="c-333 mb10">请说明中止计划的原因?</p><textarea class="plr5 ptb5 w-100 h200 c-333 set-textarea" maxlength="300" placeholder="请简要描述一下原因,不多于300字"></textarea>', {
- btn: ['确定', '取消'],
- area: ["400px", "auto"],
- title: "提示"
- }, function (index) {
- var reason = $(".set-textarea").val()
- console.log(reason)
- 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("中止计划")
- }
- var params = {
- status: isStop,
- planId: planid
- }
- healthAPI.updatePlanStatusById(params).then(function (res) {
- if (res.status == 200) {
- getDat()
- }
- })
- layer.close(index);
- });
- } else {
- 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("中止计划")
- }
- var params = {
- status: isStop,
- planId: planid
- }
- healthAPI.updatePlanStatusById(params).then(function (res) {
- if (res.status == 200) {
- getDat()
- }
- })
- layer.close(index);
- });
- }
- }
- var reqList = []; //记录请求的参数和url,用于后退时使用
- Vue.use(Vuedals.default);
- new Vue({
- el: "#app",
- data: {
- appname: "更多计划",
- isback: true,
- isrefresh: true,
- paticentcode: "",
- tablelistone: [],
- tablelist: [],
- name: "",
- sex: "",
- age: "",
- hospital: "",
- diseaseList: [],
- signFamilyFinishItemCount: "",
- signFamilyServiceRecordCount: "",
- signFamilyAdminTeamName: "",
- specialistAdminTeamName: "",
- specialistFinishItemCount: "",
- specialistServiceRecordCount: "",
- progress: "",
- specialistHospitalName: "",
- familyHospitalName: "",
- planid: "",
- isStop: 1,//
- patientPhoto: "",
- doctorType: "",
- docInfo: {},
- patientlist: [],
- },
- watch: {
- patientlist: function (val) {
- this.$nextTick(function () {
- element.init()
- var vm = this
- for (var i = 0; i < val.length; i++) {
- for (var j = 0; j < val[i].rehabilitationPlanList.length; j++) {
- var obj = val[i].rehabilitationPlanList[j]
- var isOperator = obj.isOperator
- var allFinishCount = obj.allFinishCount
- var allCount = obj.allCount
- var isStop = obj.status
- var ishospitalName = val[i].hospitalName
- var healthyConditionType=val[i].healthyConditionType
- if(healthyConditionType==1){
- $("#quote_"+val[i].patientCode).css("backgroundColor","#FF3B30")
- }
- if(healthyConditionType==2){
- $("#quote_"+val[i].patientCode).css("backgroundColor","#FF9526")
- }
- if(healthyConditionType==3){
- $("#quote_"+val[i].patientCode).css("backgroundColor","#2DBE55")
- }
- if(healthyConditionType==4){
- $("#quote_"+val[i].patientCode).css("backgroundColor","#02CFB9")
- }
- if (isOperator == 0) {
- $("#stopBtn_" + obj.planId).attr('disabled', 'true')
- $("#stopBtn_" + obj.planId).css("pointer-events", "none")
- $("#stopBtn_" + obj.planId).css("color", "#999999")
- }
- if (ishospitalName == null) {
- $("#hospitalName_" + obj.planId).html("暂无社区信息")
- }
- if (isStop == 2) {
- $("#span_font" + obj.planId).html("已完成")
- $("#span_font" + obj.planId).css("color","#ff9526")
- }else{
- if (isStop == 1) {
- $("#span_font" + obj.planId).html("进行中")
- $("#span_font" + obj.planId).css("color","#12b7f5")
-
- }
- if (isStop == 0) {
- $("#span_font" + obj.planId).html("已中止")
- $("#span_font" + obj.planId).css("color","#999999")
- $("#progress_" + obj.planId).css({
- "background-color": "gray"
- })
- $("#stopBtn_" + obj.planId).html("激活计划")
- } else {
- $("#progress_" + obj.planId).css({
- "background-color": "#ff9526"
- })
- $("#stopBtn_" + obj.planId).html("中止计划")
-
- }
- }
-
- if(allCount==0){
- Progress(obj.planId, 0 + "%")
- }else{
- var progressNum = Math.ceil((allFinishCount / allCount) * 100)
- Progress(obj.planId, progressNum + "%")
-
- }
-
- }
- }
- })
- }
- },
- mounted: function() {
- var vm = this
- vm.getDatas()
- EventBus.$on("back-click", function (arg) {
- history.go(-1);
- });
- //监听页面刷新
- EventBus.$on("refresh-click", function (arg) {
- location.reload();
- });
- },
- components: {
- vuedals: Vuedals.Component
- },
- methods: {
- setImgSrc: function (src) {
- if (!src) {
- return "../../../images/p-female.png"
- } else {
- var str = httpRequest.getImgUrl(src)
- return str
- }
- },
- getDatas: function () {
- var vm = this
- var httpData = GetRequest()
- vm.paticentcode = httpData.patientCode
- var params = {
- patientCode: vm.paticentcode
- }
- healthAPI.PlanDetailList(params).then(function (res) {
- if (res.status == 200) {
- console.log(res)
- vm.wujilu = false
- vm.name = res.data.patientName
- vm.sex = res.data.sex
- vm.age = res.data.age
- vm.patientlist = res.data
- vm.patientPhoto = res.data.patientPhoto
- vm.hospital = res.data.hospitalName
- vm.docInfo = JSON.parse(window.localStorage.getItem('wlyyAgent'))
- console.log(res.data.length)
- vm.signFamilyServiceRecordCount = res.data.signFamilyServiceRecordCount
- vm.signFamilyFinishItemCount = res.data.signFamilyFinishItemCount
- vm.signFamilyAdminTeamName = res.data.signFamilyAdminTeamName
- vm.specialistAdminTeamName = res.data.specialistAdminTeamName
- vm.specialistFinishItemCount = res.data.specialistFinishItemCount
- vm.specialistServiceRecordCount = res.data.specialistServiceRecordCount
- vm.specialistHospitalName = res.data.specialistHospitalName
- vm.familyHospitalName = res.data.familyHospitalName
- if (vm.tablelist.length == 0) {
- vm.wujilu = true
- }
- vm.doctorType = vm.docInfo.doctorType
- } else {
- // showErrorMessage(res.msg);
- }
- })
- },
- stop: function (data) {
- var vm = this
- vm.planid = data.planId
- console.log(data.planId)
- conFirm("确定终止该计划吗", data.status, vm.isStop, vm.planid, vm.getDatas)
- console.log(vm.isStop)
- },
- noOpen: function () {
- showInfoMessage("暂未开放")
- },
- checkPatient: function () {
- var vm = this
- layer.open({
- type: 2,
- area: ['750px', '650px'],
- shade: 0.5,
- title: '居民信息',
- fixed: true, //不固定
- maxmin: true,
- closeBtn: 1,
- shift: 5,
- shadeClose: false, //点击遮罩关闭层
- content: '../../temporary/html/userInfo.html?patient=' + vm.paticentcode
- });
- // location.href = "" +
- },
- checkPlan: function (data) {
- location.href = "../../rehabilitation/html/rehabilitation_management.html?planId=" + data.planId+"&patientCode="+this.paticentcode
- },
- }
- })
- });
|