<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增待审核')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-sendback-add">
            <input name="id" id="id"  type="hidden"  th:value="${id}" />
            <div class="form-group">
                <label class="col-sm-1 control-label">退回原因：</label>
                <div class="col-sm-8">
                  <textarea class="form-control" id="returnReason" name="returnReason" rows="3"
                                                          style="resize:none" required ></textarea>
                </div>
            </div>
            <label class="col-sm-1 control-label">快捷选择：</label>
            <div class="form-group">
                <div class="col-sm-8">
                    <select  id="se" class="form-control"  name="sel">
                        <option>请选择</option>
                        <optgroup  th:each="dict:${easy}">
                            <option  th:tips="${dict}" th:text="${dict}"></option>
                        </optgroup>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-1 control-label">常用语添加：</label>
                <div class="col-sm-8">
                    <input class="form-control" type="text" name="add" id="add"  >
                    <a class="btn btn-success btn-xs '  + '" href="javascript:void(0)" th:onclick="add()" >添加</a>
                </div>
            </div>
        </form>
    </div>
    <th: th:include="include :: footer" />

    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">

        var oSelect = document.getElementById("se");
        var oInput = document.getElementById("returnReason");
        if(oSelect.value=="请选择"){
            oInput.value="";
        }else{
            oInput.value = oSelect.value;
        }

        oSelect.onchange = function(e) {
            var opt = this.options[this.options.selectedIndex];
                oInput.value = oInput.value+opt.getAttribute("tips");
        };

        function add() {
            $.operate.save("/system/gtgsyw/addeasy", $('#form-sendback-add').serialize());
           /* $.operate.saveTab("/system/gtgsyw/addeasy", $('#form-sendback-add').serialize());*/
        }

        function submitHandler() {
            var id =$("#id").val();
            var prefix="/system/gtgsyw";
            if ($.validate.form()) {
                $.operate.save(prefix + "/send/"+id, $('#form-sendback-add').serialize());
                closeItem();
                $.modal.msgReload()
            }
        }


    </script>
</body>
</html>
