Authored by wangwei

提交时与后台交互查询锁定状态

... ... @@ -54,7 +54,8 @@ module.exports={
title: "解除锁定",
url: "/resources/updateLock",
params: [
{name: "id", type: "number"}
{name: "id", type: "number"},
{name: "status", type: "number"}
]
},
getUrlAction:{
... ...
... ... @@ -22,11 +22,11 @@ common.util.__ajax({
console.log(resources);
}, true);
common.util.__ajax({
url: "/resources/checkLock",
data: {id: param},
url: "/resources/updateLock",
data: {id: param,
status:1},
async: false
}, function (res) {
lockStatus = res.data;
}, true);
/*配置模块*/
... ... @@ -465,7 +465,14 @@ function secondsToStrDate(seconds) {
return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
}
function checkLockStatus(){
if(lockStatus == '0') {
common.util.__ajax({
url: "/resources/checkLock",
data: {id: param},
async: false
}, function (res) {
lockStatus = res.data;
}, true);
if(lockStatus == '2') {
common.util.__tip("该资源位已被锁定,不能操作");
return false;
}else{
... ...
... ... @@ -156,7 +156,8 @@ $(document).on("click", ".updateLockBtn", function() {
common.dialog.confirm("警告", "是否确认解除锁定?",function() {
common.util.__ajax({
url: "/resources/updateLock",
data: {id: item.id}
data: {id: item.id,
status:0}
}, function () {
g.reload();
});
... ...