123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- {include file="common/header"/}
- <style>
- .upload-wrap {
- position: relative;
- display: inline-block;
- overflow: hidden;
- border: 1px solid #2d78f4;
- border-radius: 3px;
- }
- .upload-wrap .file-ele {
- position: absolute;
- top: 0;
- right: 0;
- opacity: 0;
- height: 100%;
- width: 100%;
- cursor: pointer;
- }
- .upload-wrap .file-open {
- width: 90px;
- height: 30px;
- line-height: 30px;
- text-align: center;
- color: #fff;
- background: #3385ff;
- }
- </style>
- <div class="LM-container">
- <div class="LM-main">
- <fieldset class="layui-elem-field layui-field-title">
- <legend>开盘控制</legend>
- <blockquote class="layui-elem-quote">
- <div class="LM-table">
- </div>
- </blockquote>
- </fieldset>
- <table class="layui-table" id="list" lay-filter="list">
- </table>
- </div>
- </div>
- <script type="text/html" id="status">
- <input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="正常|禁止" lay-filter="status" {{ d.status== 0 ? 'checked' : '' }}>
- </script>
- {include file="common/footer"/}
- <script src="/static/plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
- <script>
- layui.use(['form', 'table'], function () {
- var $ = layui.jquery,
- form = layui.form,
- table = layui.table;
- var tableIn = table.render({
- elem: '#list',
- url: '{:url("quotation")}',
- method: 'post',
- title: '开盘控制',
- loading: true,
- toolbar: '#toolbar', //开启头部工具栏,并为其绑定左侧模板
- defaultToolbar: ['filter', 'exports', 'print', "excel", { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
- title: '提示'
- , layEvent: 'LAYTABLE_TIPS'
- , icon: 'layui-icon-tips'
- }],
- cols: [[
- // {checkbox: true, fixed: true},
- {field: 'id', title: '星期几', width: 120, fixed: true, sort: true},
- {field: 'status', title: '状态', width: 120, templet: '#status'},
- {field: 'stat', title: '开始时间', width: 120, edit:"text"},
- {field: 'end', title: '结束时间', width: 120, edit:"text"},
- ]],
- limits: [10, 15, 20, 25, 50, 100],
- limit: 10,
- page: true
- });
- //监听单元格编辑
- table.on('edit(list)', function(obj){
- var value = obj.value //得到修改后的值
- ,data = obj.data //得到所在行所有键值
- ,field = obj.field; //得到字段
- let da={
- id:data.id,
- field:field,
- value:value
- }
- $.post("{:url('quotation_update_data')}", da, function (res) {
- if (res.code ==200) {
- layer.msg(res.msg, {time: 1000, icon: 1});
- } else {
- tableIn.reload()
- layer.msg(res.msg, {time: 1000, icon: 2});
- }
- },"json");
- });
- form.on('switch(status)', function (data) {
- // 修改状态
- loading = layer.load(1, {shade: [0.1, '#fff']});
- $.post("{:url('quotation_update')}", {id: data.value}, function (res) {
- layer.close(loading);
- if (res.code == 200) {
- layer.msg(res.msg, {time: 1000, icon: 1});
- } else {
- layer.msg(res.msg, {time: 1000, icon: 2});
- }
- }, "json");
- });
- table.on('tool(list)', function (obj) {
- var data = obj.data;
- let event = obj.event;
- });
- });
- </script>
|