app/views/educode_sales/customers/edit.html.erb in educode_sales-0.6.1 vs app/views/educode_sales/customers/edit.html.erb in educode_sales-0.6.2
- old
+ new
@@ -1,16 +1,60 @@
-<%#= Gon::Base.render_data %>
-<form class="layui-form " action="">
+<form class="layui-form layuimini-form " action="">
<div class="layui-form-item" style="padding: 25px">
+ <div class="layui-inline">
+ <label class="layui-form-label required">学校:</label>
+ <div class="layui-input-block">
+ <input type="text" name="name" required lay-verify="required" value="<%=@school.name %>" placeholder="请输入学校" autocomplete="off"
+ class="layui-input" id="inputFocus">
+ </div>
+ </div>
+ <br>
+ <div class="layui-inline">
+ <label class="layui-form-label required">省:</label>
+ <div class="layui-input-block">
+ <input type="text" name="province" lay-verify="required" value="<%=@school.province %>" autocomplete="off"
+ class="layui-input" placeholder="请输入地址" >
+ </div>
+ </div>
+ <br>
+ <div class="layui-inline">
+ <label class="layui-form-label ">市:</label>
+ <div class="layui-input-block">
+ <input type="text" name="city" value="<%=@school.city %>" autocomplete="off"
+ class="layui-input" placeholder="请输入地址" >
+ </div>
+ </div>
+ <br>
+ <div class="layui-inline">
+ <label class="layui-form-label ">地址:</label>
+ <div class="layui-input-block">
+ <input type="text" name="address" value="<%=@school.address %>" autocomplete="off"
+ class="layui-input" placeholder="请输入地址" >
+ </div>
+ </div>
<div class="layui-form-item">
- <label class="layui-form-label required">负责区域</label>
+ <label class="layui-form-label">学校性质:</label>
<div class="layui-input-block">
- <div id="area_edit" class="demo-transfer"></div>
+ <input type="checkbox" name="project_985" lay-skin="primary" value="1" <%= 'checked' if @school_property&.project_985 %> title="985工程">
+ <input type="checkbox" name="project_211" lay-skin="primary" value="1" <%= 'checked' if @school_property&.project_211 %> title="211工程" >
+ <input type="checkbox" name="regular_college" lay-skin="primary" value="1" <%= 'checked' if @school_property&.regular_college %> title="本科院校">
</div>
</div>
+ <div class="layui-form-item">
+ <div class="layui-input-block">
+ <input type="checkbox" name="junior_college" lay-skin="primary" value="1" <%= 'checked' if @school_property&.junior_college %> title="大专院校">
+ <input type="checkbox" name="secondary_school" lay-skin="primary" value="1" <%= 'checked' if @school_property&.secondary_school %> title="中专院校" >
+ <input type="checkbox" name="military_school" lay-skin="primary" value="1" <%= 'checked' if @school_property&.military_school %> title="军事院校">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <div class="layui-input-block">
+ <input type="checkbox" name="enterprise" lay-skin="primary" value="1" <%= 'checked' if @school_property&.enterprise %> title="企业">
+ </div>
+ </div>
<div class="layui-inline" style="padding-left: 30px">
- <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="submits">提交
+ <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="data-reset-btn">提交
</button>
</div>
</div>
</form>
@@ -33,26 +77,16 @@
//监听提交
- form.on('submit(submits)', function (data) {
-
- var area_ids = []
- layui.each(transfer.getData('area_list'), function (i, v) {
- area_ids.push(v.value)
- })
- if (area_ids.length == 0) {
- layer.alert("请选择负责区域");
- return false;
- }
- data.field['area_ids'] = area_ids;
- request.authPut("missions/places/" + data.field.id, data.field, function (res) {
- if (res.success == false) {
+ form.on('submit(data-reset-btn)', function (data) {
+ request.authPut("missions/customers/" + <%= @school.id %>, data.field, function (res) {
+ if (res.success === false) {
layer.alert(res.msg)
} else {
- layer.closeAll();
- table.reload('place')
+ layer.closeAll(); //关闭所有层
+ table.reload('customers_table')
}
})
return false;
});
});
\ No newline at end of file