根据新增或更改设置input禁用disabled
如果后台传的fuwuzhan为null,则设置input 可用,如果不为空,则设置为禁用disabled
1,thymeleaf设置
<input type="text" name="id" lay-verify="required" autocomplete="off" placeholder=""
class="layui-input" th:value="${fuwuzhan==null?'':fuwuzhan.id}"
th:disabled="${fuwuzhan==null?false:true}">
2,jquery设置
$('#id').attr('disabled',true);
$('#id').attr('disabled',false);
2021-02-03