linehang 6 роки тому
батько
коміт
90a5b62dbe

+ 3 - 1
app/rehabilitation/css/health_control.css

@ -492,4 +492,6 @@ a:hover{
}
[v-cloak]{
    display: none;
}
}
.w-100 {width: 100%;}
.h200 {height: 200px;}

+ 3 - 1
app/rehabilitation/css/moreplan.css

@ -365,4 +365,6 @@ body{
}
.datab{
    width: 800px;
}
}
.w-100 {width: 100%;}
.h200 {height: 200px;}

+ 83 - 40
app/rehabilitation/js/health_control.js

@ -16,46 +16,89 @@ layui.use('element', function () {
        })
    }
    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);
        });
    	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()
	    		if (!reason) {
	    			showErrorMessage("请填写中止计划原因!");
	    			return false;
	    		}
	            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"
	                })
	            }
	            var params = {
	                status: isStop,
	                planId: planid,
	                abortReason: reason
	            }
	            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("激活计划")
			      	$("#stopBtn_" + planid).css({
			          	"background-color": "#2dbe55"
			      	})
			  	} else {
			      	$("#progress_" + planid).css({
			          	"background-color": "#ff9526"
			      	})
			      	$("#stopBtn_" + planid).html("中止计划")
			      	$("#stopBtn_" + planid).css({
			          	"background-color": "#ff3b30"
		          	})
		      	}
		      	var params = {
		          	status: isStop,
		          	planId: planid
		      	}
		      	healthAPI.updatePlanStatusById(params).then(function (res) {
		          	if (res.status == 200) {
		              	getDat()
		          	}
		      	})
		      	layer.close(index);
		  	});
    	}
    }
    new Vue({
        el: '#app',

+ 67 - 36
app/rehabilitation/js/moreplan.js

@ -12,42 +12,73 @@ layui.use('element', function () {
        })
    }
    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("中止计划")
            }
            var params = {
                status: isStop,
                planId: planid
            }
            healthAPI.updatePlanStatusById(params).then(function (res) {
                if (res.status == 200) {
                    getDat()
                }
            })
            layer.close(index);
        });
    	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);