Sha256: 2da62f79dc795b8c28c77d3890bfb33ae6e565e6af00ce7768ad25860c497f3f

Contents?: true

Size: 1.76 KB

Versions: 3

Compression:

Stored size: 1.76 KB

Contents

<%#= Gon::Base.render_data %>
<form class="layui-form " action="">
  <div class="layui-form-item" style="padding: 25px">
    <div class="layui-form-item">
      <label class="layui-form-label required">负责区域</label>
      <div class="layui-input-block">
        <div id="area_edit" class="demo-transfer"></div>
      </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>
    </div>
  </div>
</form>


<script>

    layui.use(['form', 'table', 'upload', 'laytpl', 'request', 'selectInput', 'transfer'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            transfer = layui.transfer,
            laytpl = layui.laytpl,
            request = layui.request,
            $ = layui.$;

        form.render();

        // 当前弹出层,防止ID被覆盖
        var parentIndex = layer.index;




        //监听提交
        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) {
                    layer.alert(res.msg)
                } else {
                    layer.closeAll();
                    table.reload('place')
                }
            })
            return false;
        });
    });
</script>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
educode_sales-0.6.1 app/views/educode_sales/customers/edit.html.erb
educode_sales-0.6.0 app/views/educode_sales/customers/edit.html.erb
educode_sales-0.5.9 app/views/educode_sales/customers/edit.html.erb