| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>放号设置编辑</title>
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <link rel="stylesheet" href="/static/public/layui/css/layui.css" media="all">
- <link rel="stylesheet" href="/static/public/font-awesome/css/font-awesome.min.css" media="all"/>
- <link rel="stylesheet" href="/static/admin/css/admin.css" media="all">
- <script src="/static/public/layui/layui.js"></script>
- <script src="/static/public/jquery/jquery.min.js"></script>
- </head>
- <style>
- .layui-upload-img {
- cursor: pointer;
- width: 150px;
- height: 150px;
- background: url('/static/public/images/uploadimg.jpg');
- background-size: contain;
- border-radius: 2px;
- border-width: 1px;
- border-style: solid;
- border-color: #e6e6e6;
- }
- .layui-form-label{
- width: 90px;
- }
- </style>
- <body style="padding:10px;">
- <div class="tplay-body-div">
- <div style="margin-top: 20px;"></div>
- <form class="layui-form" id="publish" method="post" lay-filter="myform">
- <div class="layui-form-item">
- <label class="layui-form-label">工作日</label>
- <div class="layui-input-block">
- <input type="checkbox" name="weeks[1]" title="周一">
- <input type="checkbox" name="weeks[2]" title="周二">
- <input type="checkbox" name="weeks[3]" title="周三">
- <input type="checkbox" name="weeks[4]" title="周四">
- <input type="checkbox" name="weeks[5]" title="周五" checked>
- <input type="checkbox" name="weeks[6]" title="周六">
- <input type="checkbox" name="weeks[7]" title="周日">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">上午时段</label>
- <div class="layui-input-inline" style="width:350px;">
- <input type="text" name="morning_time_periods[]" placeholder="请输入,格式如:08:00 - 12:00" autocomplete="off"
- class="layui-input test-item" value="">
- </div>
- <div class="layui-inline" style="margin-top: 5px;">
- <div class="layui-btn-group">
- <button type="button"
- class="layui-btn layui-btn-primary layui-btn-sm createinput"
- lay-filter="createinput"><i class="layui-icon"></i></button>
- </div>
- </div>
- <!--<div class="layui-inline">-->
- <!--<div class="layui-input-inline" style="width:350px;">-->
- <!--<input type="checkbox" name="show_morning" title="显示" checked>-->
- <!--</div>-->
- <!--</div>-->
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">下午时段</label>
- <div class="layui-input-inline" style="width:350px;">
- <input type="text" name="afternoon_time_periods[]" placeholder="请输入,格式如:14:00 - 18:00" autocomplete="off"
- class="layui-input test-item" value="">
- </div>
- <div class="layui-inline" style="margin-top: 5px;">
- <div class="layui-btn-group">
- <button type="button"
- class="layui-btn layui-btn-primary layui-btn-sm createinput2"
- lay-filter="createinput"><i class="layui-icon"></i></button>
- </div>
- </div>
- <!--<div class="layui-inline">-->
- <!--<div class="layui-input-inline" style="width:350px;">-->
- <!--<input type="checkbox" name="show_afternoon" title="显示" checked>-->
- <!--</div>-->
- <!--</div>-->
- </div>
- <input type="hidden" name="pid" value="{$Request.param.pid}">
- {notempty name="$data"}
- <input type="hidden" name="id" value="{$data.id}">
- {/notempty}
- <div class="layui-form-item">
- <div class="layui-input-block">
- <button class="layui-btn" lay-submit lay-filter="admin">立即提交</button>
- </div>
- </div>
- </form>
- <div id="create_input" style="display:none">
- <div class="layui-form-item">
- <label class="layui-form-label"></label>
- <div class="layui-input-inline" style="width:350px;">
- <input type="text" name="morning_time_periods[]" placeholder="请输入,格式如:08:00 - 12:00" autocomplete="off"
- class="layui-input test-item" value="">
- </div>
- <div class="layui-inline" style="margin-top: 5px;">
- <div class="layui-btn-group">
- <button type="button"
- class="layui-btn layui-btn-primary layui-btn-sm createinput"
- lay-filter="createinput"><i class="layui-icon"></i></button>
- <button type="button"
- class="layui-btn layui-btn-primary layui-btn-sm deleteinput"
- lay-filter="deleteinput"><i class="layui-icon"></i></button>
- </div>
- </div>
- </div>
- </div>
- <div id="create_input2" style="display:none">
- <div class="layui-form-item">
- <label class="layui-form-label"></label>
- <div class="layui-input-inline" style="width:350px;">
- <input type="text" name="afternoon_time_periods[]" placeholder="请输入,格式如:14:00 - 18:00" autocomplete="off"
- class="layui-input test-item" value="">
- </div>
- <div class="layui-inline" style="margin-top: 5px;">
- <div class="layui-btn-group">
- <button type="button"
- class="layui-btn layui-btn-primary layui-btn-sm createinput2"
- lay-filter="createinput"><i class="layui-icon"></i></button>
- <button type="button"
- class="layui-btn layui-btn-primary layui-btn-sm deleteinput"
- lay-filter="deleteinput"><i class="layui-icon"></i></button>
- </div>
- </div>
- </div>
- </div>
- <script>
- layui.use(['layer', 'form', 'laydate','element'], function () {
- var layer = layui.layer,
- $ = layui.jquery,
- form = layui.form;
- var laydate = layui.laydate;
- $(window).on('load', function () {
- form.on('submit(admin)', function (data) {
- //获取表单区域所有值
- var data = form.val("myform");
- if (data['weeks[1]'] == null && data['weeks[2]'] == null && data['weeks[3]'] == null && data['weeks[4]'] == null && data['weeks[5]'] == null && data['weeks[6]'] == null && data['weeks[7]'] == null) {
- layer.msg('请选择排号的工作日');
- return false;
- }
- $.ajax({
- url: "{:url('publish')}",
- data: $('#publish').serialize(),
- type: 'post',
- dataType: 'json',
- async: false,
- success: function (res) {
- if (res.code == 1) {
- layer.alert(res.msg, function (index) {
- location.href = "{:url('admin/appointment/publish')}?pid=" + res.data.pid;
- })
- } else {
- layer.msg(res.msg);
- }
- }
- })
- return false;
- });
- });
- });
- function createinput(ele) {
- var parent = ele.parent().parent().parent();
- parent.after($('#create_input').prop("innerHTML"));
- init()
- }
- function createinput2(ele) {
- var parent = ele.parent().parent().parent();
- parent.after($('#create_input2').prop("innerHTML"));
- init()
- }
- function deleteinput(ele) {
- if(ele.parent().parent().next().text() == "")
- ele.parent().parent().parent().remove();
- }
- function init() {
- $('.createinput').off("click").click(function () {
- createinput($(this))
- })
- $('.createinput2').off("click").click(function () {
- createinput2($(this))
- })
- $('.deleteinput').off("click").click(function () {
- deleteinput($(this))
- })
- }
- $(function () {
- init()
- })
- </script>
- </div>
- </body>
- </html>
|