Browse Source

消毒预警

hzd 4 days ago
parent
commit
2d129296d5

+ 100 - 0
application/admin/controller/DisinfectionAlarm.php

@@ -0,0 +1,100 @@
+<?php
+
+namespace app\admin\controller;
+use think\App;
+use think\Db;
+
+class DisinfectionAlarm extends Auth {
+    public function __construct(App $app = null) {
+        parent::__construct($app);
+        $this->model = new \app\common\model\DailyForm();
+    }
+    public function index() {
+        if (request()->isAjax()) {
+            //分页参数
+            $length = input('rows', 10, 'intval');   //每页条数
+            $page = input('page', 1, 'intval');      //第几页
+            $start = ($page - 1) * $length;     //分页开始位置
+            //排序
+            $sortRow = input('sidx', 'id', 'trim');      //排序列
+            $sort = input('sord', 'asc', 'trim');        //排序方式
+            $order = $sortRow . ' ' . $sort . ' ,id desc';
+            $title = input('title', '', 'trim');
+            if ($title) {
+                $map[] = ['b.title', 'like', '%' . $title . '%'];
+            }
+            $enable = input('enable', '', 'trim');
+            if ($enable != '') {
+                $map[] = ['a.enable', '=', $enable];
+            }
+            $map[] = ['a.org_id', '=', $this->orgId];
+//            $map[] = ['del', '=', 0];
+            $map = empty($map) ? true : $map;
+            //数据查询
+            $lists = Db::name('disinfection_alarm')
+                ->alias('a')
+                ->join('disinfection_device b','a.device_id = b.id')
+                ->field('a.*,b.title,b.sn')
+                ->where($map)->limit($start, $length)->order($order)->select();
+
+            //数据返回
+            $totalCount = Db::name('disinfection_alarm')
+                ->alias('a')
+                ->join('disinfection_device b','a.device_id = b.id')
+                ->where($map)->count();
+            $totalPage = ceil($totalCount / $length);
+            $result['page'] = $page;
+            $result['total'] = $totalPage;
+            $result['records'] = $totalCount;
+            $result['rows'] = $lists;
+            return json($result);
+        }
+        else {
+            $this->assign('meta_title', '预警记录');
+            return $this->fetch();
+        }
+    }
+    /**
+     * 新增/编辑
+     */
+    public function add($id = 0) {
+        if (request()->isPost()) {
+            $model = $this->model;
+            $res = $model->updates();
+            if ($res) {
+                $this->success('操作成功', url('index'));
+            }
+            else {
+                $this->error($model->getError());
+            }
+        }
+        else {
+            $meta_title = '新增';
+            if ($id) {
+                $info = Db::name('disinfection_alarm')->where('id', $id)->find();
+                $this->assign('info', $info);
+                $meta_title = '编辑';
+            }
+            $this->assign('meta_title', $meta_title);
+            return $this->fetch();
+        }
+    }
+    /**
+     * 删除记录
+     * @param int $id
+     */
+    public function del($id = 0) {
+        if (!$id) {
+            $this->error('参数错误');
+        }
+        $res = Db::name('disinfection_alarm')->delete($id);
+        if ($res) {
+//            model('ActionLog')->addlog(is_login(),27,'任务工作项:删除',['id' => $id],cur_org_id());
+            $this->success('删除成功');
+        }
+        else {
+            $this->error('删除失败');
+        }
+    }
+
+}

+ 87 - 0
application/admin/controller/DisinfectionDevice.php

@@ -0,0 +1,87 @@
+<?php
+
+namespace app\admin\controller;
+use think\App;
+use think\Db;
+
+class DisinfectionDevice extends Auth {
+    public function __construct(App $app = null) {
+        parent::__construct($app);
+        $this->model = new \app\common\model\DisinfectionDevice();
+    }
+    public function index() {
+        if (request()->isAjax()) {
+            //分页参数
+            $length = input('rows', 10, 'intval');   //每页条数
+            $page = input('page', 1, 'intval');      //第几页
+            $start = ($page - 1) * $length;     //分页开始位置
+            //排序
+            $sortRow = input('sidx', 'id', 'trim');      //排序列
+            $sort = input('sord', 'asc', 'trim');        //排序方式
+            $order = $sortRow . ' ' . $sort . ' ,id desc';
+            $title = input('title', '', 'trim');
+            if ($title) {
+                $map[] = ['title', 'like', '%' . $title . '%'];
+            }
+            $map[] = ['org_id', '=', $this->orgId];
+            $map = empty($map) ? true : $map;
+            //数据查询
+            $lists = Db::name('disinfection_device')
+                ->where($map)->limit($start, $length)->order($order)->select();
+            //数据返回
+            $totalCount = Db::name('disinfection_device')->where($map)->count();
+            $totalPage = ceil($totalCount / $length);
+            $result['page'] = $page;
+            $result['total'] = $totalPage;
+            $result['records'] = $totalCount;
+            $result['rows'] = $lists;
+            return json($result);
+        }
+        else {
+            $this->assign('meta_title', '设备列表');
+            return $this->fetch();
+        }
+    }
+    /**
+     * 新增/编辑
+     */
+    public function add($id = 0) {
+        if (request()->isPost()) {
+            $model = $this->model;
+            $res = $model->updates();
+            if ($res) {
+                $this->success('操作成功', url('index'));
+            }
+            else {
+                $this->error($model->getError());
+            }
+        }
+        else {
+            $meta_title = '新增设备';
+            if ($id) {
+                $info = Db::name('disinfection_device')->where('id', $id)->find();
+                $this->assign('info', $info);
+                $meta_title = '编辑设备';
+            }
+            $this->assign('meta_title', $meta_title);
+            return $this->fetch();
+        }
+    }
+    /**
+     * 删除记录
+     * @param int $id
+     */
+    public function del($id = 0) {
+        if (!$id) {
+            $this->error('参数错误');
+        }
+        $res = Db::name('disinfection_device')->delete($id);
+        if ($res) {
+            $this->success('删除成功');
+        }
+        else {
+            $this->error('删除失败');
+        }
+    }
+
+}

+ 96 - 0
application/admin/controller/DisinfectionTodo.php

@@ -0,0 +1,96 @@
+<?php
+
+namespace app\admin\controller;
+use think\App;
+use think\Db;
+
+class DisinfectionTodo extends Auth {
+    public function __construct(App $app = null) {
+        parent::__construct($app);
+        $this->model = new \app\common\model\DailyForm();
+    }
+    public function index() {
+        if (request()->isAjax()) {
+            //分页参数
+            $length = input('rows', 10, 'intval');   //每页条数
+            $page = input('page', 1, 'intval');      //第几页
+            $start = ($page - 1) * $length;     //分页开始位置
+            //排序
+            $sortRow = input('sidx', 'sort', 'trim');      //排序列
+            $sort = input('sord', 'asc', 'trim');        //排序方式
+            $order = $sortRow . ' ' . $sort . ' ,id desc';
+            $title = input('content', '', 'trim');
+            if ($title) {
+                $map[] = ['content', 'like', '%' . $title . '%'];
+            }
+            $enable = input('enable', '', 'trim');
+            if ($enable != '') {
+                $map[] = ['enable', '=', $enable];
+            }
+            $map[] = ['org_id', '=', $this->orgId];
+//            $map[] = ['del', '=', 0];
+            $map = empty($map) ? true : $map;
+            //数据查询
+            $lists = Db::name('disinfection_todo')
+                ->where($map)->limit($start, $length)->order($order)->select();
+            foreach ($lists as $k=>$v){
+                $lists[$k]['user_name'] = Db::name('user')->where('id',$v['user_id'])->value('real_name');
+            }
+            //数据返回
+            $totalCount = Db::name('disinfection_todo')->where($map)->count();
+            $totalPage = ceil($totalCount / $length);
+            $result['page'] = $page;
+            $result['total'] = $totalPage;
+            $result['records'] = $totalCount;
+            $result['rows'] = $lists;
+            return json($result);
+        }
+        else {
+            $this->assign('meta_title', '预警工单');
+//            $this->assign('m_name', '工作项');
+            return $this->fetch();
+        }
+    }
+    /**
+     * 新增/编辑
+     */
+    public function add($id = 0) {
+        if (request()->isPost()) {
+            $model = $this->model;
+            $res = $model->updates();
+            if ($res) {
+                $this->success('操作成功', url('index'));
+            }
+            else {
+                $this->error($model->getError());
+            }
+        }
+        else {
+            $meta_title = '新增';
+            if ($id) {
+                $info = Db::name('disinfection_todo')->where('id', $id)->find();
+                $this->assign('info', $info);
+                $meta_title = '编辑';
+            }
+            $this->assign('meta_title', $meta_title);
+            return $this->fetch();
+        }
+    }
+    /**
+     * 删除记录
+     * @param int $id
+     */
+    public function del($id = 0) {
+        if (!$id) {
+            $this->error('参数错误');
+        }
+        $res = Db::name('disinfection_todo')->delete($id);
+        if ($res) {
+//            model('ActionLog')->addlog(is_login(),27,'任务工作项:删除',['id' => $id],cur_org_id());
+            $this->success('删除成功');
+        }
+        else {
+            $this->error('删除失败');
+        }
+    }
+}

+ 54 - 0
application/admin/view/disinfection_alarm/add.html

@@ -0,0 +1,54 @@
+{extend name="common/common2" /}
+{block name="main"}
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-content">
+                <form method="post" action="{:url('add')}" class="form-horizontal">
+                    <input type="hidden" name="id" value="{$info['id']|default='0'}">
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">工作项名称<span class="text-danger">*</span></label>
+                        <div class="col-sm-6">
+                            <input type="text" class="form-control" name="content" value="{$info.content|default=''}">
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">图片</label>
+                        <div class="col-sm-6">
+                            {:widget_view('common/upimg',['name'=>'img','multi'=>0,'val'=>isset($info)?$info['img']:''])}
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">状态</label>
+                        <div class="col-sm-6">
+                            <label class="cr-inline">
+                                <input type="radio" value="1" name="enable">正常&nbsp;&nbsp;
+                            </label>
+                            <label class="cr-inline">
+                                <input type="radio" value="0" name="enable">禁用
+                            </label>
+                        </div>
+                    </div>
+
+                    <div class="hr-line-dashed"></div>
+                    <div class="form-group">
+                        <div class="col-sm-6 col-sm-offset-2">
+                            <button class="btn btn-primary ajax-post" target-form="form-horizontal" data-layer="1"  type="submit">确 定</button>
+                            <button  class="btn cancel-btn btn-default" type="button">取 消</button>
+                        </div>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>
+{/block}
+{block name="script"}
+<script>
+    $(document).ready(function(){
+        formSetValue("enable", {$info.enable|default=1});
+    });
+</script>
+{/block}

+ 99 - 0
application/admin/view/disinfection_alarm/index.html

@@ -0,0 +1,99 @@
+{extend name="common/common2" /}
+{block name="main"}
+
+<div class="ibox">
+    <div class="ibox-content">
+        <div class="row">
+            <div class="col-xs-3">
+<!--                <a href="javascript:;" url="{:url('add')}" data-title="新增" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">新增</a>-->
+            </div>
+            <div class="col-xs-9" style="text-align: right;">
+                <form class="form-inline" id="form-search" action="{:url('index')}">
+                    <div class="input-group">
+                        <input type="text" class="form-control" name="title" placeholder="位置">
+                    </div>
+<!--                    <div class="input-group">-->
+<!--                        <select name="enable" class="form-control">-->
+<!--                            <option value="">选择状态</option>-->
+<!--                            <option value="0">禁用</option>-->
+<!--                            <option value="1">正常</option>-->
+<!--                        </select>-->
+<!--                    </div>-->
+                    <div class="input-group">
+                        <span class="input-group-btn">
+                            <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
+                        </span>&nbsp;
+                        <span class="input-group-btn">
+                            <button class="btn-sm btn-warning " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
+                        </span>
+                    </div>
+                </form>
+            </div>
+        </div>
+
+    </div>
+    <div class="ibox-content">
+        <div class="jqGrid_wrapper">
+            <table id="table" style="border-collapse: collapse"></table>
+            <div id="pager"></div>
+        </div>
+    </div>
+</div>
+{/block}
+{block name="script"}
+<script>
+    $(function () {
+
+        $(window).bind("resize",function(){
+            var width=$(".jqGrid_wrapper").width();
+            $("#table").setGridWidth(width);
+        });
+
+        $.jgrid.defaults.styleUI="Bootstrap";
+        $("#table").jqGrid({
+            url:"{:url('index')}",
+            datatype: "json",
+            colModel:[
+                {label:'编号',name:'sn',index:'sn', width:40,sortable: false},
+                {label:'位置',name:'title',index:'title', width:60,sortable: false},
+                {label:'预警信息',name:'content',index:'content', width:60,sortable: false},
+
+                {label:'状态',name:'status',index:'status',width:50,editable: false,sortable: false,formatter:function (a,b,c){
+                        if(a == 0){
+                            return '<span class="label label-danger" title="未处理">未处理</span>';
+                        } else{
+                            return '<span class="label label-success" title="已处理">已处理</span>';
+                        }
+                    }},
+                {label:'创建时间',name:'create_time',index:'create_time',width:60,editable: false,sortable: false},
+
+                // {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
+                //         var editurl = "{:url('add',[],'')}/id/"+c.id;
+                //         var delurl = "{:url('del',[],'')}/id/"+c.id;
+                //         var btn = '<a url="'+editurl+'" href="javascript:;" data-title="编辑" onclick="layer_open(this,1)"><span class="label label-primary" title="编辑">编辑</span></a>&nbsp;';
+                //         btn += '<a href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
+                //         return btn;
+                //     }},
+            ],
+            rowNum:10,
+            rowList:[10,20,30,50,100],
+            pager: '#pager',
+            sortname: 'id',
+            viewrecords: true,
+            autowidth:true,
+            mtype: 'post',
+            height: 'auto',
+            emptyrecords: "暂无数据",
+            sortorder: "desc",
+            caption:"{$meta_title}",
+            loadComplete: function (xhr) {
+                if(xhr.code==0){
+                    layer.msg(xhr.msg);
+                    return false;
+                }
+            },
+        });
+    });
+
+</script>
+{/block}

+ 54 - 0
application/admin/view/disinfection_device/add.html

@@ -0,0 +1,54 @@
+{extend name="common/common2" /}
+{block name="main"}
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-content">
+                <form method="post" action="{:url('add')}" class="form-horizontal">
+                    <input type="hidden" name="id" value="{$info['id']|default='0'}">
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">工作项名称<span class="text-danger">*</span></label>
+                        <div class="col-sm-6">
+                            <input type="text" class="form-control" name="content" value="{$info.content|default=''}">
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">图片</label>
+                        <div class="col-sm-6">
+                            {:widget_view('common/upimg',['name'=>'img','multi'=>0,'val'=>isset($info)?$info['img']:''])}
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">状态</label>
+                        <div class="col-sm-6">
+                            <label class="cr-inline">
+                                <input type="radio" value="1" name="enable">正常&nbsp;&nbsp;
+                            </label>
+                            <label class="cr-inline">
+                                <input type="radio" value="0" name="enable">禁用
+                            </label>
+                        </div>
+                    </div>
+
+                    <div class="hr-line-dashed"></div>
+                    <div class="form-group">
+                        <div class="col-sm-6 col-sm-offset-2">
+                            <button class="btn btn-primary ajax-post" target-form="form-horizontal" data-layer="1"  type="submit">确 定</button>
+                            <button  class="btn cancel-btn btn-default" type="button">取 消</button>
+                        </div>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>
+{/block}
+{block name="script"}
+<script>
+    $(document).ready(function(){
+        formSetValue("enable", {$info.enable|default=1});
+    });
+</script>
+{/block}

+ 108 - 0
application/admin/view/disinfection_device/index.html

@@ -0,0 +1,108 @@
+{extend name="common/common2" /}
+{block name="main"}
+
+<div class="ibox">
+    <div class="ibox-content">
+        <div class="row">
+            <div class="col-xs-3">
+<!--                <a href="javascript:;" url="{:url('add')}" data-title="新增" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">新增</a>-->
+            </div>
+            <div class="col-xs-9" style="text-align: right;">
+                <form class="form-inline" id="form-search" action="{:url('index')}">
+                    <div class="input-group">
+                        <input type="text" class="form-control" name="title" placeholder="位置">
+                    </div>
+<!--                    <div class="input-group">-->
+<!--                        <select name="enable" class="form-control">-->
+<!--                            <option value="">选择状态</option>-->
+<!--                            <option value="0">禁用</option>-->
+<!--                            <option value="1">正常</option>-->
+<!--                        </select>-->
+<!--                    </div>-->
+                    <div class="input-group">
+                        <span class="input-group-btn">
+                            <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
+                        </span>&nbsp;
+                        <span class="input-group-btn">
+                            <button class="btn-sm btn-warning " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
+                        </span>
+                    </div>
+                </form>
+            </div>
+        </div>
+
+    </div>
+    <div class="ibox-content">
+        <div class="jqGrid_wrapper">
+            <table id="table" style="border-collapse: collapse"></table>
+            <div id="pager"></div>
+        </div>
+    </div>
+</div>
+{/block}
+{block name="script"}
+<script>
+    $(function () {
+
+        $(window).bind("resize",function(){
+            var width=$(".jqGrid_wrapper").width();
+            $("#table").setGridWidth(width);
+        });
+
+        $.jgrid.defaults.styleUI="Bootstrap";
+        $("#table").jqGrid({
+            url:"{:url('index')}",
+            datatype: "json",
+            colModel:[
+                {label:'编号',name:'sn',index:'sn', width:40,sortable: false},
+                {label:'位置',name:'title',index:'title', width:60,sortable: false},
+                {label:'备注',name:'remark',index:'remark', width:60,sortable: false},
+
+                {label:'状态',name:'status',index:'status',width:50,editable: false,sortable: false,formatter:function (a,b,c){
+                        if(a == 0){
+                            return '<span class="label label-danger" title="离线">离线</span>';
+                        } else{
+                            return '<span class="label label-success" title="在线">在线</span>';
+                        }
+                    }},
+                {label:'环境状态',name:'status2',index:'status2',width:50,editable: false,sortable: false,formatter:function (a,b,c){
+                        if(a == 0){
+                            return '<span class="label label-danger" title="异常">异常</span>';
+                        }else if(a == 1){
+                            return '<span class="label label-warning" title="中等">中等</span>';
+                        } else{
+                            return '<span class="label label-success" title="正常">正常</span>';
+                        }
+                    }},
+                {label:'创建时间',name:'create_time',index:'create_time',width:60,editable: false,sortable: false},
+
+                // {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
+                //         var editurl = "{:url('add',[],'')}/id/"+c.id;
+                //         var delurl = "{:url('del',[],'')}/id/"+c.id;
+                //         var btn = '<a url="'+editurl+'" href="javascript:;" data-title="编辑" onclick="layer_open(this,1)"><span class="label label-primary" title="编辑">编辑</span></a>&nbsp;';
+                //         btn += '<a href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
+                //         return btn;
+                //     }},
+            ],
+            rowNum:10,
+            rowList:[10,20,30,50,100],
+            pager: '#pager',
+            sortname: 'id',
+            viewrecords: true,
+            autowidth:true,
+            mtype: 'post',
+            height: 'auto',
+            emptyrecords: "暂无数据",
+            sortorder: "desc",
+            caption:"{$meta_title}",
+            loadComplete: function (xhr) {
+                if(xhr.code==0){
+                    layer.msg(xhr.msg);
+                    return false;
+                }
+            },
+        });
+    });
+
+</script>
+{/block}

+ 54 - 0
application/admin/view/disinfection_todo/add.html

@@ -0,0 +1,54 @@
+{extend name="common/common2" /}
+{block name="main"}
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-content">
+                <form method="post" action="{:url('add')}" class="form-horizontal">
+                    <input type="hidden" name="id" value="{$info['id']|default='0'}">
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">工作项名称<span class="text-danger">*</span></label>
+                        <div class="col-sm-6">
+                            <input type="text" class="form-control" name="content" value="{$info.content|default=''}">
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">图片</label>
+                        <div class="col-sm-6">
+                            {:widget_view('common/upimg',['name'=>'img','multi'=>0,'val'=>isset($info)?$info['img']:''])}
+                        </div>
+                    </div>
+
+                    <div class="form-group">
+                        <label class="col-sm-2 control-label">状态</label>
+                        <div class="col-sm-6">
+                            <label class="cr-inline">
+                                <input type="radio" value="1" name="enable">正常&nbsp;&nbsp;
+                            </label>
+                            <label class="cr-inline">
+                                <input type="radio" value="0" name="enable">禁用
+                            </label>
+                        </div>
+                    </div>
+
+                    <div class="hr-line-dashed"></div>
+                    <div class="form-group">
+                        <div class="col-sm-6 col-sm-offset-2">
+                            <button class="btn btn-primary ajax-post" target-form="form-horizontal" data-layer="1"  type="submit">确 定</button>
+                            <button  class="btn cancel-btn btn-default" type="button">取 消</button>
+                        </div>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>
+{/block}
+{block name="script"}
+<script>
+    $(document).ready(function(){
+        formSetValue("enable", {$info.enable|default=1});
+    });
+</script>
+{/block}

+ 98 - 0
application/admin/view/disinfection_todo/index.html

@@ -0,0 +1,98 @@
+{extend name="common/common2" /}
+{block name="main"}
+
+<div class="ibox">
+    <div class="ibox-content">
+        <div class="row">
+            <div class="col-xs-3">
+<!--                <a href="javascript:;" url="{:url('add')}" data-title="新增" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">新增</a>-->
+            </div>
+            <div class="col-xs-9" style="text-align: right;">
+                <form class="form-inline" id="form-search" action="{:url('index')}">
+                    <div class="input-group">
+                        <input type="text" class="form-control" name="sn" placeholder="编号">
+                    </div>
+<!--                    <div class="input-group">-->
+<!--                        <select name="enable" class="form-control">-->
+<!--                            <option value="">选择状态</option>-->
+<!--                            <option value="0">禁用</option>-->
+<!--                            <option value="1">正常</option>-->
+<!--                        </select>-->
+<!--                    </div>-->
+                    <div class="input-group">
+                        <span class="input-group-btn">
+                            <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
+                        </span>&nbsp;
+                        <span class="input-group-btn">
+                            <button class="btn-sm btn-warning " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
+                        </span>
+                    </div>
+                </form>
+            </div>
+        </div>
+
+    </div>
+    <div class="ibox-content">
+        <div class="jqGrid_wrapper">
+            <table id="table" style="border-collapse: collapse"></table>
+            <div id="pager"></div>
+        </div>
+    </div>
+</div>
+{/block}
+{block name="script"}
+<script>
+    $(function () {
+
+        $(window).bind("resize",function(){
+            var width=$(".jqGrid_wrapper").width();
+            $("#table").setGridWidth(width);
+        });
+
+        $.jgrid.defaults.styleUI="Bootstrap";
+        $("#table").jqGrid({
+            url:"{:url('index')}",
+            datatype: "json",
+            colModel:[
+                {label:'编号',name:'sn',index:'sn', width:40,sortable: false},
+                {label:'执行人',name:'user_name',index:'user_name', width:60,sortable: false},
+                {label:'汇报内容',name:'content',index:'content', width:60,sortable: false},
+                {label:'状态',name:'status',index:'status',width:50,editable: false,sortable: false,formatter:function (a,b,c){
+                        if(a == 0){
+                            return '<span class="label label-danger" title="未处理">未处理</span>';
+                        } else{
+                            return '<span class="label label-success" title="已处理">已处理</span>';
+                        }
+                    }},
+                {label:'时间',name:'create_time',index:'create_time',width:60,editable: false,sortable: false},
+
+                // {label:'操作',width:60,sortable: false,formatter: function (a, b, c) {
+                //         var editurl = "{:url('add',[],'')}/id/"+c.id;
+                //         var delurl = "{:url('del',[],'')}/id/"+c.id;
+                //         var btn = '<a url="'+editurl+'" href="javascript:;" data-title="编辑" onclick="layer_open(this,1)"><span class="label label-primary" title="编辑">编辑</span></a>&nbsp;';
+                //         btn += '<a href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
+                //         return btn;
+                //     }},
+            ],
+            rowNum:10,
+            rowList:[10,20,30,50,100],
+            pager: '#pager',
+            sortname: 'id',
+            viewrecords: true,
+            autowidth:true,
+            mtype: 'post',
+            height: 'auto',
+            emptyrecords: "暂无数据",
+            sortorder: "desc",
+            caption:"{$meta_title}",
+            loadComplete: function (xhr) {
+                if(xhr.code==0){
+                    layer.msg(xhr.msg);
+                    return false;
+                }
+            },
+        });
+    });
+
+</script>
+{/block}

+ 77 - 0
application/common/model/DisinfectionAlarm.php

@@ -0,0 +1,77 @@
+<?php
+namespace app\common\model;
+use think\Db;
+class DisinfectionAlarm extends Base {
+    protected $createTime = 'create_time';
+    protected $updateTime = 'update_time';
+    public $table = 'disinfection_alarm';
+    protected $validateName = 'DisinfectionAlarm';
+    public function updates(){
+        $data = request()->post();
+        $data['org_id'] =cur_org_id();
+        $result = validate($this->validateName)->check($data,[],'');
+        if(true !== $result){
+            $this->error = validate($this->validateName)->getError();
+            return false;
+        }
+//        $data['img'] = isset($data['img'])?$data['img']:'';
+        $id = $data['id'];
+        unset($data['id']);
+        if($id > 0){
+            $data['update_time'] = date('Y-m-d H:i:s');
+            $ret = $this->allowField(true)->save($data,['id'=>$id]);
+        }else{
+            $data['create_time'] = date('Y-m-d H:i:s');
+            $ret = $this->allowField(true)->save($data);
+        }
+        if(!$ret){
+            $this->error = '操作失败';
+            return false;
+        }
+//        $name = '任务工作项';
+//        $content = $name.':新增';
+//        if($id > 0){
+//            $content = $name.':编辑';
+//            $data['id'] = $id;
+//        }else{
+//            $data['id'] = $this->id;
+//        }
+//        model('ActionLog')->addlog(is_login(),27,$content,$data,cur_org_id());
+
+        return true;
+    }
+
+    /**
+     * 获取检查项列表
+     *
+     * @author wst
+     * @date   2021/9/6 15:00
+     * @return array
+     */
+    public function list(){
+        $where['del']=0;
+        $where['enable']=1;
+        $where['org_id']=cur_org_id();
+        $dailyForm=$this->field('id,content as title')->where($where)->select()->toArray();
+        return $dailyForm;
+    }
+    /**
+     * 根据id获取检查项列表
+     *
+     * @author wst
+     * @date   2021/9/6 15:00
+     * @return array
+     */
+    public function getByIdList($id){
+        $dailyForm = Db::name('daily_form')
+            ->where('enable',1)
+            ->where('del',0)
+            ->whereIn('id',explode(',',$id))
+            ->select();
+        $ids = [];
+        foreach ($dailyForm as $k=>$v){
+            $ids[$k]=(string)$v['id'];
+        }
+        return $ids;
+    }
+}

+ 77 - 0
application/common/model/DisinfectionDevice.php

@@ -0,0 +1,77 @@
+<?php
+namespace app\common\model;
+use think\Db;
+class DisinfectionDevice extends Base {
+    protected $createTime = 'create_time';
+    protected $updateTime = 'update_time';
+    public $table = 'disinfection_device';
+    protected $validateName = 'DisinfectionDevice';
+    public function updates(){
+        $data = request()->post();
+        $data['org_id'] =cur_org_id();
+        $result = validate($this->validateName)->check($data,[],'');
+        if(true !== $result){
+            $this->error = validate($this->validateName)->getError();
+            return false;
+        }
+//        $data['img'] = isset($data['img'])?$data['img']:'';
+        $id = $data['id'];
+        unset($data['id']);
+        if($id > 0){
+            $data['update_time'] = date('Y-m-d H:i:s');
+            $ret = $this->allowField(true)->save($data,['id'=>$id]);
+        }else{
+            $data['create_time'] = date('Y-m-d H:i:s');
+            $ret = $this->allowField(true)->save($data);
+        }
+        if(!$ret){
+            $this->error = '操作失败';
+            return false;
+        }
+//        $name = '任务工作项';
+//        $content = $name.':新增';
+//        if($id > 0){
+//            $content = $name.':编辑';
+//            $data['id'] = $id;
+//        }else{
+//            $data['id'] = $this->id;
+//        }
+//        model('ActionLog')->addlog(is_login(),27,$content,$data,cur_org_id());
+
+        return true;
+    }
+
+    /**
+     * 获取检查项列表
+     *
+     * @author wst
+     * @date   2021/9/6 15:00
+     * @return array
+     */
+    public function list(){
+        $where['del']=0;
+        $where['enable']=1;
+        $where['org_id']=cur_org_id();
+        $dailyForm=$this->field('id,content as title')->where($where)->select()->toArray();
+        return $dailyForm;
+    }
+    /**
+     * 根据id获取检查项列表
+     *
+     * @author wst
+     * @date   2021/9/6 15:00
+     * @return array
+     */
+    public function getByIdList($id){
+        $dailyForm = Db::name('daily_form')
+            ->where('enable',1)
+            ->where('del',0)
+            ->whereIn('id',explode(',',$id))
+            ->select();
+        $ids = [];
+        foreach ($dailyForm as $k=>$v){
+            $ids[$k]=(string)$v['id'];
+        }
+        return $ids;
+    }
+}

+ 77 - 0
application/common/model/DisinfectionTodo.php

@@ -0,0 +1,77 @@
+<?php
+namespace app\common\model;
+use think\Db;
+class DisinfectionTodo extends Base {
+    protected $createTime = 'create_time';
+    protected $updateTime = 'update_time';
+    public $table = 'disinfection_todo';
+    protected $validateName = 'DisinfectionTodo';
+    public function updates(){
+        $data = request()->post();
+        $data['org_id'] =cur_org_id();
+        $result = validate($this->validateName)->check($data,[],'');
+        if(true !== $result){
+            $this->error = validate($this->validateName)->getError();
+            return false;
+        }
+//        $data['img'] = isset($data['img'])?$data['img']:'';
+        $id = $data['id'];
+        unset($data['id']);
+        if($id > 0){
+            $data['update_time'] = date('Y-m-d H:i:s');
+            $ret = $this->allowField(true)->save($data,['id'=>$id]);
+        }else{
+            $data['create_time'] = date('Y-m-d H:i:s');
+            $ret = $this->allowField(true)->save($data);
+        }
+        if(!$ret){
+            $this->error = '操作失败';
+            return false;
+        }
+//        $name = '任务工作项';
+//        $content = $name.':新增';
+//        if($id > 0){
+//            $content = $name.':编辑';
+//            $data['id'] = $id;
+//        }else{
+//            $data['id'] = $this->id;
+//        }
+//        model('ActionLog')->addlog(is_login(),27,$content,$data,cur_org_id());
+
+        return true;
+    }
+
+    /**
+     * 获取检查项列表
+     *
+     * @author wst
+     * @date   2021/9/6 15:00
+     * @return array
+     */
+    public function list(){
+        $where['del']=0;
+        $where['enable']=1;
+        $where['org_id']=cur_org_id();
+        $dailyForm=$this->field('id,content as title')->where($where)->select()->toArray();
+        return $dailyForm;
+    }
+    /**
+     * 根据id获取检查项列表
+     *
+     * @author wst
+     * @date   2021/9/6 15:00
+     * @return array
+     */
+    public function getByIdList($id){
+        $dailyForm = Db::name('daily_form')
+            ->where('enable',1)
+            ->where('del',0)
+            ->whereIn('id',explode(',',$id))
+            ->select();
+        $ids = [];
+        foreach ($dailyForm as $k=>$v){
+            $ids[$k]=(string)$v['id'];
+        }
+        return $ids;
+    }
+}

+ 49 - 0
application/common/validate/DisinfectionAlarm.php

@@ -0,0 +1,49 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\common\validate;
+
+use think\Db;
+use think\Validate;
+
+class DisinfectionAlarm extends Validate
+{
+    /**
+     * 定义验证规则
+     * 格式:'字段名' =>  ['规则1','规则2'...]
+     *
+     * @var array
+     */
+    protected $rule = [
+        'device_id|设备'  =>  'require',
+
+    ];
+
+    /**
+     * 定义错误信息
+     * 格式:'字段名.规则名' =>  '错误信息'
+     *
+     * @var array
+     */
+    protected $message = [
+    ];
+
+    protected function checkUnique($value, $rule, $data=[]){
+        if(isset($data['id']) && $data['id'] > 0){
+            $ret = Db::name('daily_form')
+                ->where('del',0)
+                ->where('content',$data['content'])
+                ->where('org_id',$data['org_id'])
+                ->where('id','<>',$data['id'])
+                ->find();
+        }else{
+            $ret = Db::name('daily_form')
+                ->where('del',0)
+                ->where('content',$data['content'])
+                ->where('org_id',$data['org_id'])
+                ->find();
+        }
+
+        return $ret?'名称已被使用':true;
+    }
+}

+ 49 - 0
application/common/validate/DisinfectionDevice.php

@@ -0,0 +1,49 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\common\validate;
+
+use think\Db;
+use think\Validate;
+
+class DisinfectionDevice extends Validate
+{
+    /**
+     * 定义验证规则
+     * 格式:'字段名' =>  ['规则1','规则2'...]
+     *
+     * @var array
+     */
+    protected $rule = [
+        'title|地址'  =>  'require',
+
+    ];
+
+    /**
+     * 定义错误信息
+     * 格式:'字段名.规则名' =>  '错误信息'
+     *
+     * @var array
+     */
+    protected $message = [
+    ];
+
+    protected function checkUnique($value, $rule, $data=[]){
+        if(isset($data['id']) && $data['id'] > 0){
+            $ret = Db::name('daily_form')
+                ->where('del',0)
+                ->where('content',$data['content'])
+                ->where('org_id',$data['org_id'])
+                ->where('id','<>',$data['id'])
+                ->find();
+        }else{
+            $ret = Db::name('daily_form')
+                ->where('del',0)
+                ->where('content',$data['content'])
+                ->where('org_id',$data['org_id'])
+                ->find();
+        }
+
+        return $ret?'名称已被使用':true;
+    }
+}

+ 49 - 0
application/common/validate/DisinfectionTodo.php

@@ -0,0 +1,49 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\common\validate;
+
+use think\Db;
+use think\Validate;
+
+class DisinfectionTodo extends Validate
+{
+    /**
+     * 定义验证规则
+     * 格式:'字段名' =>  ['规则1','规则2'...]
+     *
+     * @var array
+     */
+    protected $rule = [
+        'sn|编号'  =>  'require',
+
+    ];
+
+    /**
+     * 定义错误信息
+     * 格式:'字段名.规则名' =>  '错误信息'
+     *
+     * @var array
+     */
+    protected $message = [
+    ];
+
+    protected function checkUnique($value, $rule, $data=[]){
+        if(isset($data['id']) && $data['id'] > 0){
+            $ret = Db::name('daily_form')
+                ->where('del',0)
+                ->where('content',$data['content'])
+                ->where('org_id',$data['org_id'])
+                ->where('id','<>',$data['id'])
+                ->find();
+        }else{
+            $ret = Db::name('daily_form')
+                ->where('del',0)
+                ->where('content',$data['content'])
+                ->where('org_id',$data['org_id'])
+                ->find();
+        }
+
+        return $ret?'名称已被使用':true;
+    }
+}

BIN
public/uploads/phsign/34c7e9a845d99fe2ca4434686f60adb1.jpeg


BIN
public/uploads/phsign/35e7252deb7de7157e9ec069aa48708b.jpeg


BIN
vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/CSS/4.17.0,84a9cb681804f68773a2a36419faffda843c1870,1.ser


BIN
vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer/URI/4.17.0,3478238e680361cd87bf880f5b3cc50a1e7abc6c,1.ser