|
@ -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',
|