更新师傅状态

This commit is contained in:
kuang.yifei@iwhalecloud.com 2022-07-10 18:49:02 +08:00
parent 0ae1e87b4d
commit 5e0afb3ce6
2 changed files with 14 additions and 2 deletions

View File

@ -202,6 +202,18 @@ public class WorkerController extends BaseController {
}
}
@PostMapping("/changeStatus")
@ResponseBody
public AjaxResult changeStatus(Worker worker){
try {
workerService.updateWorker(worker);
return AjaxResult.success("修改成功");
}catch (Exception e){
logger.error(ExceptionUtil.getExceptionMessage(e));
return AjaxResult.error(e.getMessage());
}
}
@PostMapping("/settled")
@ResponseBody
@Transactional(rollbackFor = Exception.class)

View File

@ -175,9 +175,9 @@
/* 用户状态显示 */
function statusTools(row) {
if (row.status == 0) {
return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.workerId + '\')"></i> ';
} else {
return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.workerId + '\')"></i> ';
} else {
return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.workerId + '\')"></i> ';
}
}