123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="keywords" content="">
- <meta name="description" content="">
- <title>字典新增</title>
- <link rel="stylesheet" href="../../../component/pear/css/pear.css">
- <style>
- .layui-form {padding-right: 10px;}
- </style>
- </head>
- <body>
- <form class="layui-form" lay-filter="edit">
- <input type="hidden" name="id">
- <div class="main-container">
- <div class="layui-form-item">
- <label class="layui-form-label layui-required">字典名称:</label>
- <div class="layui-input-block">
- <input type="text" name="name" lay-verify="required"
- class="layui-input" placeholder="" autocomplete="off" >
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label layui-required">字典编码:</label>
- <div class="layui-input-block">
- <input type="text" name="type" lay-verify="required"
- class="layui-input" placeholder="" autocomplete="off">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label layui-required">字典描述:</label>
- <div class="layui-input-block">
- <textarea name="remark" class="layui-textarea"></textarea>
- </div>
- </div>
- </div>
- <div class="bottom">
- <div class="button-container">
- <button type="submit" class="pear-btn pear-btn-primary"
- lay-submit="" lay-filter="save">提 交</button>
- <button type="button" class="pear-btn"
- onclick="parent.layer.closeAll();">关 闭</button>
- </div>
- </div>
- </form>
- <script src="../../../component/layui/layui.js"></script>
- <script src="../../../component/pear/pear.js"></script>
- <script>
- layui.use(['request', 'form', 'popup', 'common'], function () {
- var $ = layui.jquery,
- request = layui.request,
- form = layui.form,
- popup = layui.popup;
- var MODULE_PATH = "/system/dict/v1/";
- layer.ready(function() {
- var id = request.getQueryString("id");
- if (id) {
- request.httpGet(MODULE_PATH + id, function (result) {
- form.val('edit', result.data);
- });
- }
- });
- form.on('submit(save)', function (data) {
- request.http({
- url: MODULE_PATH,
- type: data.field.id? 'put': 'post',
- data: data.field,
- success: function (result) {
- if (result.success) {
- parent.layui.popup.success(result.msg, function () {
- parent.layer.close(parent.layer.getFrameIndex(window.name));
- parent.refresh();
- })
- } else {
- parent.layui.popup.failure(result.msg);
- }
- }
- });
- return false;
- });
- })
- </script>
- </body>
- </html>
|