app/views/educode_sales/customers/edit.html.erb in educode_sales-0.9.25 vs app/views/educode_sales/customers/edit.html.erb in educode_sales-0.9.26
- old
+ new
@@ -1,6 +1,6 @@
-<form class="layui-form layuimini-form " id="custom_data" data-required="true" action="">
+<div class="layui-form layuimini-form " id="custom_data" data-required="true">
<div class="layui-form-item" style="padding: 25px">
<div class="layui-inline">
<label class="layui-form-label required">客户:</label>
<div class="layui-input-block" style="width: 500px;">
<input type="text" name="name" required lay-verify="required" value="<%=@school.name %>" placeholder="请输入客户" autocomplete="off"
@@ -28,11 +28,11 @@
<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">学校性质:</label>
+ <label class="layui-form-label required">学校性质:</label>
<div class="layui-input-block">
<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>
@@ -52,11 +52,11 @@
<div class="layui-inline" style="padding-left: 120px">
<button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="data-reset-btn">提交
</button>
</div>
</div>
-</form>
+</div>
<script>
layui.use(['form', 'table', 'upload', 'laytpl', 'request', 'selectInput', 'transfer'], function () {
@@ -337,9 +337,16 @@
//监听提交
form.on('submit(data-reset-btn)', function (data) {
data.field.province = $("#province option:selected").text(); //获取选中的项
data.field.city = $("#city option:selected").text(); //获取选中的项
+ if (data.field.enterprise == undefined && data.field.junior_college == undefined &&
+ data.field.military_school == undefined && data.field.project_211 == undefined && data.field.project_985 == undefined
+ && data.field.regular_college == undefined && data.field.secondary_school == undefined) {
+ layer.alert("请选择学校性质");
+ return false;
+ }
+
request.authPut("missions/customers/" + <%= @school.id %>, data.field, function (res) {
if (res.success === false) {
layer.alert(res.msg)
} else {
layer.closeAll(); //关闭所有层
\ No newline at end of file