@extends('admin.layout-content')

@section('header')
    <style>

    </style>
@endsection

@section('content')
    <div class="layui-container sg-create-container">
        <div class="layui-col-sm8 layui-col-sm-offset2">
            <form class="layui-form" method="POST" action="{{ $pre_uri . 'update' }}">

                {{ csrf_field() }}
                <input type="hidden" name="id" value="{{ $item->id }}">
                <input type="hidden" name="user_id" value="{{ $item->user_id }}">
                <input type="hidden" name="project_id" value="{{ $item->project_id }}">
                @include('share.layui-form-item', ['type' => 'select', 'name' => 'uid', 'label' => '用户', 'selected_id' => $item->user_id,'disable'=>true,'options' => $user_options])
                @include('share.layui-form-item', ['type' => 'select', 'name' => 'project_role_id', 'label' => '项目角色', 'selected_id' => $item->project_role_id, 'options' => $role_options])
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
                <div class="layui-form-item">
                </div>
            </form>
        </div>
    </div>
@endsection

@section('footer')
    <script>
        $(function () {
            layui.use(['form', 'laydate'], function(){
                var form = layui.form;
                var laydate = layui.laydate;

                // form.verify({
                //     integer: function (value) {
                //         var pattern = /^[1-9]\d*$/;
                //         if(!(pattern.test(value) || value === '0')) {
                //             return '组员人数必须为大于等于0的整数';
                //         }
                //     }
                // });

                laydate.render({
                    elem: '.sg-select-date'
                });
            });
        })
    </script>
@endsection