后台消息通知、党务管理

This commit is contained in:
彭桃 2023-01-31 16:39:11 +08:00
parent 989a61db0a
commit 8e965f92bc
32 changed files with 2238 additions and 431 deletions

View File

@ -356,5 +356,12 @@ class Api extends BaseController
return to_assign(0, '', ['data_first' => hour_document($data_first), 'data_second' => hour_document($data_second), 'data_three'=>date_document($data_three)]);
}
public function getbytype(){
$type = get_params("type");
$where['type'] = $type;
$where['status'] = 'normal';
$list = Db::table('fa_category')->where($where)->order('weigh asc,id asc')->select();
return to_assign(0, '', $list);
}
}

View File

@ -0,0 +1,152 @@
<?php
/**
* @copyright Copyright (c) 2021 勾股工作室
* @license https://opensource.org/licenses/Apache-2.0
* @link https://www.gougucms.com
*/
declare (strict_types = 1);
namespace app\admin\controller;
use app\admin\BaseController;
use app\admin\model\Notice as NoticeModel;
use app\admin\validate\NoticeValidate;
use think\exception\ValidateException;
use think\facade\Db;
use think\facade\View;
class Notice extends BaseController
{
/**
* 构造函数
*/
public function __construct()
{
$this->model = new NoticeModel();
$this->uid = get_login_admin('id');
// 获取用户信息
$this->users = Db::table('fa_szxc_information_usermsg')->where('status',1)->field('user_id,name')->select();
}
/**
* 数据列表
*/
public function datalist()
{
if (request()->isAjax()) {
$param = get_params();
$where = [];
$list = $this->model->getNoticeList($where,$param);
foreach ($list as $k =>$v){
$list[$k]['user_name'] = Db::table('fa_szxc_information_usermsg')->where('user_id',$v['user_id'])->value('name');
if($v['status'] == 1){
$list[$k]['status'] = '正常';
}else{
$list[$k]['status'] = '禁用';
}
if($v['is_read'] == 1){
$list[$k]['is_read'] = '已读';
}else{
$list[$k]['is_read'] = '未读';
}
if($v['read_time']){
$list[$k]['read_time'] = date('Y-m-d H:i:s',$v['read_time']);
}
}
return table_assign(0, '', $list);
}
else{
return view();
}
}
/**
* 添加
*/
public function add()
{
if (request()->isAjax()) {
$param = get_params();
// 检验完整性
try {
validate(NoticeValidate::class)->check($param);
} catch (ValidateException $e) {
// 验证失败 输出错误信息
return to_assign(1, $e->getError());
}
$this->model->addNotice($param);
}else{
View::assign('users', $this->users);
return view();
}
}
/**
* 编辑
*/
public function edit()
{
$param = get_params();
if (request()->isAjax()) {
// 检验完整性
try {
validate(NoticeValidate::class)->check($param);
} catch (ValidateException $e) {
// 验证失败 输出错误信息
return to_assign(1, $e->getError());
}
$this->model->editNotice($param);
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = $this->model->getNoticeById($id);
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
}
/**
* 查看信息
*/
public function read()
{
$param = get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = $this->model->getNoticeById($id);
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
/**
* 删除
* type=0,逻辑删除,默认
* type=1,物理删除
*/
public function del()
{
$param = get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$this->model->delNoticeById($id,$type);
}
}

View File

@ -0,0 +1,87 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
class Category extends BaseController
{
public function __construct()
{
$this->adminInfo = get_login_admin();
// 类型
$map[] = ['pid','=','0'];
$map[] = ['status','=','normal'];
$this->type = Db::table('fa_category')->where($map)->field('id,type,name')->select();
}
public function index()
{
if (request()->isAjax()) {
$list = Db::table('fa_category')->order('weigh asc,id asc')->select()->toArray();
foreach ($list as $k =>$v){
if($v['status'] == 'normal'){
$list[$k]['status'] = '正常';
}else{
$list[$k]['status'] = '禁用';
}
}
return to_assign(0, '', $list);
} else {
return view();
}
}
//添加
public function add()
{
$param = get_params();
if (request()->isAjax()) {
return to_assign();
} else {
$id = isset($param['id']) ? $param['id'] : 0;
$pid = isset($param['pid']) ? $param['pid'] : 0;
if($id>0){
$detail = Db::name('fa_category')->where('id',$id)->find();
View::assign('detail', $detail);
}
View::assign('id', $id);
View::assign('pid', $pid);
View::assign('type', $this->type);
return view();
}
}
//删除
public function delete()
{
$id = get_params("id");
$count = Db::name('AdminRule')->where(["pid" => $id])->count();
if ($count > 0) {
return to_assign(1, "该节点下还有子节点,无法删除");
}
if (Db::name('AdminRule')->delete($id) !== false) {
clear_cache('adminRules');
add_log('delete', $id, []);
return to_assign(0, "删除节点成功");
} else {
return to_assign(1, "删除失败");
}
}
public function getbytype(){
$type = get_params("type");
$where['type'] = $type;
$where['status'] = 'normal';
$list = Db::table('fa_category')->where($where)->order('weigh asc,id asc')->select();
return to_assign(0, '', $list);
}
}

View File

@ -1,59 +1,51 @@
<?php
namespace app\admin\controller\party;
namespace app\admin\controller\nk\party;
use app\common\controller\Backend;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
/**
* 党费清单列管理
*
* @icon fa fa-circle-o
*/
class BranchPayList extends Backend
class BranchPayList extends BaseController
{
/**
* BranchPayList模型对象
* @var \app\admin\model\party\BranchPayList
*/
protected $model = null;
public function _initialize()
/**
* 构造函数
*/
public function __construct()
{
parent::_initialize();
$this->model = new \app\admin\model\party\BranchPayList;
$this->adminInfo = get_login_admin();
$this->url=[
'/admin/nk.party.branchpaylist/index',
'/admin/nk.party.branchpaylist/add',
'/admin/nk.party.branchpaylist/edit',
'/admin/nk.party.branchpaylist/del',
'/admin/nk.party.branchpaylist/read',
];
// 获取用户信息
$this->users = Db::table('fa_szxc_information_usermsg')->where('status',1)->field('user_id,name')->select();
// 党支部
$this->party_branch = Db::table('fa_szxc_party_branch')->where('status',1)->field('id,name')->select();
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
* 数据列表
*/
public function index()
{
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax()) {
// dump();die;
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
if (request()->isAjax()) {
$params= get_params();
$where['status']=1;
if (isset($params['keywords'])){
$where[]=['title','like','%'.$params['keywords'].'%'];
}
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
//权限组信息
$getGroups = $this->auth->getGroups();
if($getGroups[0]['pid'] != 0){ //不是超级管理员
$userInfo = $this->auth->getUserinfo();
$admin_id = $userInfo['id'];
$www['admin_id'] = $admin_id;
$user_address = Db::name('szxc_information_useraddress')->where($www)->find();
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
$www['admin_id'] = $this->adminInfo['id'];
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
if ($user_address){
if($user_address['auth_range'] == 1){
$where['village'] = $user_address['village_id'];
@ -61,8 +53,6 @@ class BranchPayList extends Backend
$where['township'] = $user_address['street_id'];
}elseif ($user_address['auth_range'] == 3){
$where['county'] = $user_address['area_id'];
}elseif ($user_address['auth_range'] == 4){
}else{
$where['village'] = $user_address['village_id'];
}
@ -71,30 +61,119 @@ class BranchPayList extends Backend
}
}
$total = $this->model
->with(['usermsg','area','street','village'])
$total = Db::table('fa_szxc_party_branch_pay_list')
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->with(['usermsg','area','street','village'])
$list = Db::table('fa_szxc_party_branch_pay_list')
->withAttr('party_branch',function ($value,$data){
return Db::table('fa_szxc_party_branch')->where('id',$data['branch_id'])->value('name');
})
->withAttr('area',function ($value,$data){
return Db::table('fa_geo_area')->where('area_code',$data['county'])->value('area_name');
})
->withAttr('street',function ($value,$data){
return Db::table('fa_geo_street')->where('street_code',$data['township'])->value('street_name');
})
->withAttr('village',function ($value,$data){
return Db::table('fa_geo_village')->where('village_id',$data['village'])->value('village_name');
})
->withAttr('status',function ($value,$data){
if($value == 1){
return '正常';
}else{
return '禁用';
}
})
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->page($params['page'])
->limit($params['limit'])
->order('id desc')
->select();
$list = $list->toArray();
if ($list){
foreach ($list as $k=>$v){
$list[$k]['branch_id'] = Db::name('szxc_party_branch')->where('id',$v['branch_id'])->value('name');
}
}
$result = ['total' => $total, 'rows' => $list];
return json($result);
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}
else{
return view('nk/party/branchpaylist/index',['url'=>$this->url]);
}
}
return $this->view->fetch();
public function add(){
if (request()->isAjax()) {
$param= get_params();
$adds=Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->find();
$param['county']=$adds['area_id'];
$param['township']=$adds['street_id'];
$param['village']=$adds['village_id'];
$res=Db::table('fa_szxc_party_branch_pay_list')->strict(false)->field(true)->insertGetId($param);
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}else{
View::assign('editor', get_system_config('other','editor'));
View::assign('party_branch', $this->party_branch);
View::assign('users', $this->users);
return view();
}
}
public function edit(){
$param= get_params();
if (request()->isAjax()) {
$res=Db::table('fa_szxc_party_branch_pay_list')->where('id',$param['id'])->strict(false)->field(true)->update($param);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_branch_pay_list')->where('id',$id)->find();
View::assign('editor', get_system_config('other','editor'));
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
View::assign('party_branch', $this->party_branch);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
}
/**
* 查看信息
*/
public function read()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_branch_pay_list')->where('id',$id)->find();
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
View::assign('party_branch', $this->party_branch);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
/**
* 删除
*/
public function del()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_branch_pay_list')->where('id',$id)->update(['status'=>$type]);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}

View File

@ -1,60 +1,52 @@
<?php
namespace app\admin\controller\party;
namespace app\admin\controller\nk\party;
use app\common\controller\Backend;
use app\admin\BaseController;
use think\facade\Db;
use think\facade\View;
/**
* 党费缴纳列管理
*
* @icon fa fa-circle-o
*/
class BranchPayUser extends Backend
class BranchPayUser extends BaseController
{
/**
* BranchPayUser模型对象
* @var \app\admin\model\party\BranchPayUser
* 构造函数
*/
protected $model = null;
public function _initialize()
public function __construct()
{
parent::_initialize();
$this->model = new \app\admin\model\party\BranchPayUser;
$this->adminInfo = get_login_admin();
$this->url=[
'/admin/nk.party.branchpayuser/index',
'/admin/nk.party.branchpayuser/add',
'/admin/nk.party.branchpayuser/edit',
'/admin/nk.party.branchpayuser/del',
'/admin/nk.party.branchpayuser/read',
];
// 获取用户信息
$this->users = Db::table('fa_szxc_information_usermsg')->where('status',1)->field('user_id,name')->select();
// 党支部
$this->party_branch = Db::table('fa_szxc_party_branch')->where('status',1)->field('id,name')->select();
// 清单
$this->pay_list = Db::table('fa_szxc_party_branch_pay_list')->where('status',1)->field('id')->select();
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
* 数据列表
*/
public function index()
{
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax()) {
// dump();die;
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
if (request()->isAjax()) {
$params= get_params();
$where['status']=1;
if (isset($params['keywords'])){
$where[]=['title','like','%'.$params['keywords'].'%'];
}
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
//权限组信息
$getGroups = $this->auth->getGroups();
if($getGroups[0]['pid'] != 0){ //不是超级管理员
$userInfo = $this->auth->getUserinfo();
$admin_id = $userInfo['id'];
$www['admin_id'] = $admin_id;
$user_address = Db::name('szxc_information_useraddress')->where($www)->find();
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
$www['admin_id'] = $this->adminInfo['id'];
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
if ($user_address){
if($user_address['auth_range'] == 1){
$where['village'] = $user_address['village_id'];
@ -62,8 +54,6 @@ class BranchPayUser extends Backend
$where['township'] = $user_address['street_id'];
}elseif ($user_address['auth_range'] == 3){
$where['county'] = $user_address['area_id'];
}elseif ($user_address['auth_range'] == 4){
}else{
$where['village'] = $user_address['village_id'];
}
@ -72,30 +62,125 @@ class BranchPayUser extends Backend
}
}
$total = $this->model
->with(['usermsg','area','street','village'])
$total = Db::table('fa_szxc_party_branch_pay_user')
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->with(['usermsg','area','street','village'])
$list = Db::table('fa_szxc_party_branch_pay_user')
->withAttr('party_branch',function ($value,$data){
return Db::table('fa_szxc_party_branch')->where('id',$data['branch_id'])->value('name');
})
->withAttr('user_name',function ($value,$data){
return Db::table('fa_szxc_information_usermsg')->where('user_id',$data['user_id'])->value('name');
})
->withAttr('area',function ($value,$data){
return Db::table('fa_geo_area')->where('area_code',$data['county'])->value('area_name');
})
->withAttr('street',function ($value,$data){
return Db::table('fa_geo_street')->where('street_code',$data['township'])->value('street_name');
})
->withAttr('village',function ($value,$data){
return Db::table('fa_geo_village')->where('village_id',$data['village'])->value('village_name');
})
->withAttr('status',function ($value,$data){
if($value == 1){
return '正常';
}else{
return '禁用';
}
})
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->page($params['page'])
->limit($params['limit'])
->order('id desc')
->select();
$list = $list->toArray();
if ($list){
foreach ($list as $k=>$v){
$list[$k]['branch_id'] = Db::name('szxc_party_branch')->where('id',$v['branch_id'])->value('name');
}
}
$result = ['total' => $total, 'rows' => $list];
return json($result);
$result = ['total' => $total, 'data' => $list];
return table_assign(0, '', $result);
}
else{
return view('nk/party/branchpayuser/index',['url'=>$this->url]);
}
}
return $this->view->fetch();
public function add(){
if (request()->isAjax()) {
$param= get_params();
$adds=Db::table('fa_szxc_information_useraddress')->where('admin_id',$this->adminInfo['id'])->find();
$param['county']=$adds['area_id'];
$param['township']=$adds['street_id'];
$param['village']=$adds['village_id'];
$res=Db::table('fa_szxc_party_branch_pay_user')->strict(false)->field(true)->insertGetId($param);
if ($res){
return to_assign(0,'操作成功',['aid'=>$res]);
}
return to_assign(1, '操作失败,原因:'.$res);
}else{
View::assign('editor', get_system_config('other','editor'));
View::assign('party_branch', $this->party_branch);
View::assign('pay_list', $this->pay_list);
View::assign('users', $this->users);
return view();
}
}
public function edit(){
$param= get_params();
if (request()->isAjax()) {
$res=Db::table('fa_szxc_party_branch_pay_user')->where('id',$param['id'])->strict(false)->field(true)->update($param);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}else{
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_branch_pay_user')->where('id',$id)->find();
View::assign('editor', get_system_config('other','editor'));
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
View::assign('party_branch', $this->party_branch);
View::assign('pay_list', $this->pay_list);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
}
/**
* 查看信息
*/
public function read()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$detail = Db::table('fa_szxc_party_branch_pay_user')->where('id',$id)->find();
if (!empty($detail)) {
View::assign('detail', $detail);
View::assign('users', $this->users);
View::assign('party_branch', $this->party_branch);
View::assign('pay_list', $this->pay_list);
return view();
}
else{
throw new \think\exception\HttpException(404, '找不到页面');
}
}
/**
* 删除
*/
public function del()
{
$param= get_params();
$id = isset($param['id']) ? $param['id'] : 0;
$type = isset($param['type']) ? $param['type'] : 0;
$res = Db::table('fa_szxc_party_branch_pay_user')->where('id',$id)->update(['status'=>$type]);
if ($res){
return to_assign();
}else{
return to_assign(1, '操作失败,原因:'.$res);
}
}

View File

@ -0,0 +1,97 @@
<?php
/**
* @copyright Copyright (c) 2021 勾股工作室
* @license https://opensource.org/licenses/Apache-2.0
* @link https://www.gougucms.com
*/
namespace app\admin\model;
use think\model;
class Notice extends Model
{
/**
* 获取分页列表
* @param $where
* @param $param
*/
public function getNoticeList($where, $param)
{
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
$order = empty($param['order']) ? 'id desc' : $param['order'];
$list = self::where($where)->field('id,user_id,title,content,create_time,status,is_read,read_time')->order($order)->paginate($rows, false, ['query' => $param]);
return $list;
}
/**
* 添加数据
* @param $param
*/
public function addNotice($param)
{
$insertId = 0;
try {
$param['create_time'] = time();
$insertId = self::strict(false)->field(true)->insertGetId($param);
add_log('add', $insertId, $param);
} catch(\Exception $e) {
return to_assign(1, '操作失败,原因:'.$e->getMessage());
}
return to_assign(0,'操作成功',['aid'=>$insertId]);
}
/**
* 编辑信息
* @param $param
*/
public function editNotice($param)
{
try {
$param['update_time'] = time();
self::where('id', $param['id'])->strict(false)->field(true)->update($param);
add_log('edit', $param['id'], $param);
} catch(\Exception $e) {
return to_assign(1, '操作失败,原因:'.$e->getMessage());
}
return to_assign();
}
/**
* 根据id获取信息
* @param $id
*/
public function getNoticeById($id)
{
$info = self::where('id', $id)->find();
return $info;
}
/**
* 删除信息
* @param $id
* @return array
*/
public function delNoticeById($id,$type=0)
{
if($type==0){
//逻辑删除
try {
$param['delete_time'] = time();
self::where('id', $id)->update(['delete_time'=>time()]);
add_log('delete', $id);
} catch(\Exception $e) {
return to_assign(1, '操作失败,原因:'.$e->getMessage());
}
}
else{
//物理删除
try {
self::where('id', $id)->delete();
add_log('delete', $id);
} catch(\Exception $e) {
return to_assign(1, '操作失败,原因:'.$e->getMessage());
}
}
return to_assign();
}
}

View File

@ -0,0 +1,26 @@
<?php
/**
* @copyright Copyright (c) 2021 勾股工作室
* @license https://opensource.org/licenses/Apache-2.0
* @link https://www.gougucms.com
*/
namespace app\admin\validate;
use think\Validate;
class NoticeValidate extends Validate
{
protected $rule = [
'user_id' => 'require',
'title' => 'require',
'content' => 'require',
'status' => 'require',
];
protected $message = [
'user_id.require' => '接收人不能为空',
'title.require' => '标题不能为空',
'content.require' => '通知内容不能为空',
'status.require' => '状态不能为空',
];
}

View File

@ -0,0 +1,156 @@
{extend name="common/base" /}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">分类</h3>
{if condition="$id eq 0"}
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray-2">类型<font>*</font>
</td>
<td>
<select name="type" lay-verify="required" lay-filter="type" id="showpid" >
<option value="0">请选择</option>
{volist name="type" id="v"}
<option value="{$v.type}" >{$v.name} </option>
{/volist}
</select>
</td>
</tr>
<tr>
<td class="layui-td-gray-2">父级菜单/节点<font>*</font>
</td>
<td>
<select name="pid" lay-verify="required" lay-filter="pid" id="pidoption">
<option value="0"></option>
</select>
</td>
</tr>
</table>
{else/}
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray-2">父级菜单/节点<font>*</font>
</td>
<td>
<select name="pid" lay-verify="required" lay-reqText="请选择父级菜单/节点">
<option value="0">作为顶级节点</option>
{volist name=":set_recursion(get_admin_rule())" id="v"}
<option value="{$v.id}" {eq name="$detail.pid" value="$v.id" }selected="" {/eq}>{$v.title} </option>
{/volist}
</select>
</td>
<td class="layui-td-gray-2">左侧菜单显示<font>*</font>
</td>
<td>
<input type="radio" name="menu" value="1" title="是" {eq name="$detail.menu" value="1" } checked{/eq}>
<input type="radio" name="menu" value="2" title="不是" {eq name="$detail.menu" value="2" } checked{/eq}>
</td>
</tr>
<tr>
<td class="layui-td-gray">菜单/节点名称<font>*</font>
</td>
<td>
<input type="text" name="title" value="{$detail.title}" lay-verify="required" autocomplete="off"
placeholder="请输入菜单/节点名称" lay-reqText="请输入菜单/节点名称" class="layui-input">
</td>
<td class="layui-td-gray">操作日志名称<font>*</font>
</td>
<td>
<input type="text" name="name" value="{$detail.name}" lay-verify="required" placeholder="请输入操作日志名称"
lay-reqText="请输入操作日志名称" autocomplete="off" class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">菜单/节点URL</td>
<td>
<input type="text" name="src" value="{$detail.src}" placeholder="请输入菜单/节点URL可空" autocomplete="off"
class="layui-input">
</td>
<td class="layui-td-gray">菜单排序</td>
<td>
<input type="text" name="sort" value="{$detail.sort}" placeholder="请输入数字,越小越靠前" autocomplete="off"
class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">菜单图标</td>
<td colspan="3">
<input style="width:150px; display:inline" type="text" name="icon" value="{$detail.icon}" placeholder="请输入图标,可空" autocomplete="off" class="layui-input">
<i class="bi {$detail.icon}"></i><a href="{__GOUGU__}/icon/index.html" target="_blank" style="margin-left:10px; color:#007AFF">[查看图标]</a>
</td>
</tr>
</table>
{/if}
<div style="padding: 10px 0">
<input type="hidden" name="id" value="{$id}">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var form = layui.form,tool=layui.tool;
form.on('select(type)',function(){
$.ajax({
url: "/admin/api/getbytype",
type: 'get',
data: {
type:$('#showpid').val(),
},
success: function(e) {
if (e.code == 0) {
var html = '';
if(e.data.length>0){
$.each(e.data, function(key, value) {
html += '<option value="'+value.id+'" >'+value.name+' </option>';
});
$('#pidoption').append(html);
}else{
layer.msg('暂无数据');
}
}
}
})
});
//监听提交
form.on('submit(webform)', function (data) {
if (!data.field.menu || data.field.menu == '') {
layer.msg('请选择是否在左侧菜单显示');
return false;
}
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post("/admin/nk.category/add", data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,84 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<div class="gg-form-bar border-t border-x">
<button class="layui-btn layui-btn-sm add-menu">+ 添加</button>
</div>
<div>
<table class="layui-hide" id="treeTable" lay-filter="treeTable"></table>
</div>
</div>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool', 'treeGrid'];
function gouguInit() {
var treeGrid = layui.treeGrid,table = layui.table, tool = layui.tool;
var pageTable = treeGrid.render({
id: 'treeTable'
, elem: '#treeTable'
, idField: 'id'
, url: "/admin/nk.category/index"
, cellMinWidth: 80
, treeId: 'id'//树形id字段名称
, treeUpId: 'pid'//树形父id字段名称
, treeShowName: 'name'//以树形式显示的字段
, cols: [[
{ field: 'id', width: 80, title: 'ID号', align: 'center' }
, { field: 'weigh', width: 60, title: '排序', align: 'center' }
, { field: 'type', width: 110, title: '类型', align: 'center' }
,{field:'image',title: '菜单图标',width: 80, align: 'center' ,templet: function(d){
var html='<strong class="bi '+d.icon+'"></strong>';
return html;
}}
, { field: 'name', width: 160, title: '名称' }
, { field: 'pid', title: '父ID', width: 80, align: 'center' }
, { field: 'status', title: '状态', width: 80, align: 'center' }
, {
width: 188, title: '操作', align: 'center'
, templet: function (d) {
var html = '<span class="layui-btn-group"><button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</button>';
return html;
}
}
]]
, page: false
});
//表头工具栏事件
$('.add-menu').on('click', function () {
tool.side("/admin/nk.category/add");
return;
});
//操作按钮
treeGrid.on('tool(treeTable)', function (obj) {
console.log(obj);
if (obj.event === 'add') {
tool.side('/admin/nk.category/add?pid=' + obj.data.id);
return;
}
if (obj.event === 'edit') {
tool.side('/admin/nk.category/add?id=' + obj.data.id);
return;
}
if (obj.event === 'del') {
layer.confirm('确定要删除吗?', { icon: 3, title: '提示' }, function (index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete("/admin/nk.category/delete", { id: obj.data.id }, callback);
layer.close(index);
});
}
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -21,7 +21,7 @@
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加内容">+ 添加内容</span>
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
</div>
</script>

View File

@ -21,7 +21,7 @@
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加内容">+ 添加内容</span>
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
</div>
</script>

View File

@ -1,53 +0,0 @@
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">党组织:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-party_branch" data-rule="required" data-source="party.branch/index" data-field="name" class="form-control selectpage" name="row[branch_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pay" data-rule="required" class="form-control" step="0.01" name="row[pay]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('No_pay')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-no_pay" data-rule="required" class="form-control" step="0.01" name="row[no_pay]" type="number">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Sort')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-sort" data-rule="required" class="form-control" name="row[sort]" type="number" value="99">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-status" data-rule="required" class="form-control" name="row[status]" type="number" value="1">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -1,52 +0,0 @@
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">党组织:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-party_branch" data-rule="required" data-source="party.branch/index" data-field="name" class="form-control selectpage" name="row[branch_id]" type="text" value="{$row.branch_id}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{$row.start_time}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{$row.end_time}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pay" data-rule="required" class="form-control" step="0.01" name="row[pay]" type="number" value="{$row.pay}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('No_pay')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-no_pay" data-rule="required" class="form-control" step="0.01" name="row[no_pay]" type="number" value="{$row.no_pay}">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Sort')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-sort" data-rule="required" class="form-control" name="row[sort]" type="number" value="{$row.sort}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-status" data-rule="required" class="form-control" name="row[status]" type="number" value="{$row.status}">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -1,35 +0,0 @@
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('party/branch_pay_list/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('party/branch_pay_list/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('party/branch_pay_list/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('party/branch_pay_list/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<div class="dropdown btn-group {:$auth->check('party/branch_pay_list/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('party/branch_pay_list/edit')}"
data-operate-del="{:$auth->check('party/branch_pay_list/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,66 +0,0 @@
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('区域')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <div class="form-inline" data-toggle="cxselect" data-selects="area,street,village">-->
<!-- &lt;!&ndash; <select class="province form-control" name="row[province_code]" data-url="ajax/getaddress">&ndash;&gt;-->
<!-- &lt;!&ndash; <option value="510000"></option>&ndash;&gt;-->
<!-- &lt;!&ndash; </select>&ndash;&gt;-->
<!-- &lt;!&ndash; <select class="city form-control" name="row[city_code]" data-query-name="province" data-url="ajax/getaddress">&ndash;&gt;-->
<!-- &lt;!&ndash; <option value="510500"></option>&ndash;&gt;-->
<!-- &lt;!&ndash; </select>&ndash;&gt;-->
<!-- <select class="area form-control" name="row[county]" data-query-name="city" data-url="ajax/getaddress">-->
<!-- </select>-->
<!-- <select class="street form-control" name="row[township]" data-query-name="area" data-url="ajax/getaddress"></select>-->
<!-- <select class="village form-control" name="row[village]" data-query-name="street" data-url="ajax/getaddress"></select>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Branch_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-party_branch" data-rule="required" data-source="party.branch/index" data-field="name" class="form-control selectpage" name="row[branch_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay_list_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pay_list_id" data-rule="required" data-source="party.branchpaylist/index" data-field="id" class="form-control selectpage" name="row[pay_list_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user.usermsg/index" data-field="name" data-primary-key="user_id" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Count')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-count" data-rule="required" class="form-control" name="row[count]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pay" data-rule="required" class="form-control" step="0.01" name="row[pay]" type="number">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -1,71 +0,0 @@
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('区域')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <div class="form-inline" data-toggle="cxselect" data-selects="area,street,village">-->
<!-- &lt;!&ndash; <select class="province form-control" name="row[province_code]" data-url="ajax/getaddress">&ndash;&gt;-->
<!-- &lt;!&ndash; <option value="510000"></option>&ndash;&gt;-->
<!-- &lt;!&ndash; </select>&ndash;&gt;-->
<!-- &lt;!&ndash; <select class="city form-control" name="row[city_code]" data-query-name="province" data-url="ajax/getaddress">&ndash;&gt;-->
<!-- &lt;!&ndash; <option value="510500"></option>&ndash;&gt;-->
<!-- &lt;!&ndash; </select>&ndash;&gt;-->
<!-- <select class="area form-control" name="row[county]" data-query-name="city" data-url="ajax/getaddress">-->
<!-- <option value="{$row.county|htmlentities}"></option>-->
<!-- </select>-->
<!-- <select class="street form-control" name="row[township]" data-query-name="area" data-url="ajax/getaddress">-->
<!-- <option value="{$row.township|htmlentities}"></option>-->
<!-- </select>-->
<!-- <select class="village form-control" name="row[village]" data-query-name="street" data-url="ajax/getaddress">-->
<!-- <option value="{$row.village|htmlentities}"></option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Branch_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-party_branch" data-rule="required" data-source="party.branch/index" data-field="name" class="form-control selectpage" name="row[branch_id]" type="text" value="{$row.branch_id}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay_list_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pay_list_id" data-rule="required" data-source="party.branchpaylist/index" data-field="id" class="form-control selectpage" name="row[pay_list_id]" type="text" value="{$row.pay_list_id}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user.usermsg/index" data-field="name" data-primary-key="user_id" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{$row.start_time}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Count')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-count" data-rule="required" class="form-control" name="row[count]" type="number" value="{$row.count}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-pay" data-rule="required" class="form-control" step="0.01" name="row[pay]" type="number" value="{$row.pay}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -1,35 +0,0 @@
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('party/branch_pay_user/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('party/branch_pay_user/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('party/branch_pay_user/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('party/branch_pay_user/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<div class="dropdown btn-group {:$auth->check('party/branch_pay_user/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('party/branch_pay_user/edit')}"
data-operate-del="{:$auth->check('party/branch_pay_user/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,110 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">添加</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">党支部<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="branch_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='party_branch' id='vo'}
<option value="{$vo.id}" >{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">开始时间<font>*</font></td>
<td colspan="7">
<input type="text" name="start_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1">
</td>
</tr>
<tr>
<td class="layui-td-gray">结束时间<font>*</font></td>
<td colspan="7">
<input type="text" name="end_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1">
</td>
</tr>
<tr>
<td class="layui-td-gray">应收<font>*</font></td>
<td colspan="7">
<input type="text" name="pay" lay-verify="required" lay-reqText="请输入应收"
autocomplete="off" placeholder="请输入应收" class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">未收<font>*</font></td>
<td colspan="7">
<input type="text" name="no_pay" lay-verify="required" lay-reqText="请输入未收"
autocomplete="off" placeholder="请输入未收" class="layui-input">
</td>
</tr>
</table>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const editorType = '{$editor}';
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool,laydate = layui.laydate;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post('/admin/nk.party.branchpaylist/add', data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,120 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">编辑</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">党支部<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="branch_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='party_branch' id='vo'}
<option value="{$vo.id}" {if $detail.branch_id==$vo.id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">开始时间<font>*</font></td>
<td colspan="7">
<input type="text" name="start_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1" value="{$detail.start_time}">
</td>
</tr>
<tr>
<td class="layui-td-gray">结束时间<font>*</font></td>
<td colspan="7">
<input type="text" name="end_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1" value="{$detail.end_time}">
</td>
</tr>
<tr>
<td class="layui-td-gray">应收<font>*</font></td>
<td colspan="7">
<input type="text" name="pay" lay-verify="required" lay-reqText="请输入应收"
autocomplete="off" placeholder="请输入应收" class="layui-input" value="{$detail.pay}">
</td>
</tr>
<tr>
<td class="layui-td-gray">未收<font>*</font></td>
<td colspan="7">
<input type="text" name="no_pay" lay-verify="required" lay-reqText="请输入未收"
autocomplete="off" placeholder="请输入未收" class="layui-input" value="{$detail.no_pay}">
</td>
</tr>
</table>
<div class="pt-3">
<input type="hidden" name="id" value="{$detail.id}"/>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
//上传缩略图
var upload_thumb = layui.upload.render({
elem: '#upload_btn_thumb',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
layer.msg('上传失败');
return false;
}
//上传成功
$('#upload_box_thumb input').attr('value', res.data.filepath);
$('#upload_box_thumb img').attr('src', res.data.filepath);
}
});
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/nk.party.branchpaylist/edit", data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 17,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,164 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<form class="layui-form gg-form-bar border-t border-x">
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入标题" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
<table class="layui-hide" id="article" lay-filter="article"></table>
</div>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="is_home">
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#article',
title: '列表',
toolbar: '#toolbarDemo',
url: '{$url[0]}',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
width:80,
},{
field: 'area',
title: '区县',
align: 'center',
width:120,
},{
field: 'street',
title: '乡镇',
align: 'center',
width:180,
},{
field: 'village',
title: '街道/村',
align: 'center',
width:180,
},{
field: 'party_branch',
title: '党组织',
align: 'center',
width:160,
},{
field: 'start_time',
title: '开始月份',
align: 'center',
width:150,
},{
field: 'end_time',
title: '结束月份',
align: 'center',
width:150,
},{
field: 'pay',
title: '应收',
align: 'center',
width:120,
},{
field: 'no_pay',
title: '未收',
align: 'center',
width:120,
},{
field: 'status',
title: '状态',
align: 'center',
width:100,
},{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(article)', function(obj){
if (obj.event === 'add') {
tool.side('{$url[1]}');
return false;
}
});
//监听表格行工具事件
table.on('tool(article)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('{$url[4]}?id='+obj.data.id);
}
else if (obj.event === 'edit') {
tool.side('{$url[2]}?id='+obj.data.id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete('{$url[3]}', { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords,
cate_id: data.field.cate_id
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,81 @@
{extend name="common/base"/}
{block name="style"}
<style>
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<div class="layui-form p-4">
<h3 class="pb-3">详情</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">党支部<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="branch_id" lay-verify="required" lay-search="" disabled>
<option value="" >请选择</option>
{volist name='party_branch' id='vo'}
<option value="{$vo.id}" {if $detail.branch_id==$vo.id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">开始时间<font>*</font></td>
<td colspan="7">
<input type="text" name="start_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1" value="{$detail.start_time}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">结束时间<font>*</font></td>
<td colspan="7">
<input type="text" name="end_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1" value="{$detail.end_time}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">应收<font>*</font></td>
<td colspan="7">
<input type="text" name="pay" lay-verify="required" lay-reqText="请输入应收"
autocomplete="off" placeholder="请输入应收" class="layui-input" value="{$detail.pay}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">未收<font>*</font></td>
<td colspan="7">
<input type="text" name="no_pay" lay-verify="required" lay-reqText="请输入未收"
autocomplete="off" placeholder="请输入未收" class="layui-input" value="{$detail.no_pay}" readonly>
</td>
</tr>
</table>
</div>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
var editor = layui.tinymce;
var edit = editor.render({
selector: "#container_content",
height: 500
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,130 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">添加</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">党支部<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="branch_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='party_branch' id='vo'}
<option value="{$vo.id}" >{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">清单<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="pay_list_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='pay_list' id='vo'}
<option value="{$vo.id}" >{$vo.id}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">用户<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" >{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">开始时间<font>*</font></td>
<td colspan="7">
<input type="text" name="start_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1">
</td>
</tr>
<tr>
<td class="layui-td-gray">几个月<font>*</font></td>
<td colspan="7">
<input type="text" name="count" lay-verify="required" lay-reqText="请输入几个月"
autocomplete="off" placeholder="请输入几个月" class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">金额<font>*</font></td>
<td colspan="7">
<input type="text" name="pay" lay-verify="required" lay-reqText="请输入金额"
autocomplete="off" placeholder="请输入金额" class="layui-input">
</td>
</tr>
</table>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const editorType = '{$editor}';
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool,laydate = layui.laydate;
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post('/admin/nk.party.branchpayuser/add', data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 7,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,140 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">编辑</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">党支部<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="branch_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='party_branch' id='vo'}
<option value="{$vo.id}" {if $detail.branch_id==$vo.id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">清单<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="pay_list_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='pay_list' id='vo'}
<option value="{$vo.id}" {if $detail.pay_list_id==$vo.id} selected {/if}>{$vo.id}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">用户<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" {if $detail.user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">开始时间<font>*</font></td>
<td colspan="7">
<input type="text" name="start_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1" value="{$detail.start_time}">
</td>
</tr>
<tr>
<td class="layui-td-gray">几个月<font>*</font></td>
<td colspan="7">
<input type="text" name="count" lay-verify="required" lay-reqText="请输入几个月"
autocomplete="off" placeholder="请输入几个月" class="layui-input" value="{$detail.count}">
</td>
</tr>
<tr>
<td class="layui-td-gray">金额<font>*</font></td>
<td colspan="7">
<input type="text" name="pay" lay-verify="required" lay-reqText="请输入金额"
autocomplete="off" placeholder="请输入金额" class="layui-input" value="{$detail.pay}">
</td>
</tr>
</table>
<div class="pt-3">
<input type="hidden" name="id" value="{$detail.id}"/>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
//上传缩略图
var upload_thumb = layui.upload.render({
elem: '#upload_btn_thumb',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
layer.msg('上传失败');
return false;
}
//上传成功
$('#upload_box_thumb input').attr('value', res.data.filepath);
$('#upload_box_thumb img').attr('src', res.data.filepath);
}
});
//监听提交
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/nk.party.branchpayuser/edit", data.field, callback);
return false;
});
//日期选择
laydate.render({
elem: '#formDate',
max: 17,
showBottom: false
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,169 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<form class="layui-form gg-form-bar border-t border-x">
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入标题" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
<table class="layui-hide" id="article" lay-filter="article"></table>
</div>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="is_home">
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#article',
title: '列表',
toolbar: '#toolbarDemo',
url: '{$url[0]}',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
width:80,
},{
field: 'area',
title: '区县',
align: 'center',
width:120,
},{
field: 'street',
title: '乡镇',
align: 'center',
width:180,
},{
field: 'village',
title: '街道/村',
align: 'center',
width:180,
},{
field: 'party_branch',
title: '党组织',
align: 'center',
width:160,
},{
field: 'pay_list_id',
title: '清单id',
align: 'center',
width:100,
},{
field: 'user_name',
title: '用户',
align: 'center',
width:100,
},{
field: 'start_time',
title: '开始月份',
align: 'center',
width:150,
},{
field: 'count',
title: '几个月',
align: 'center',
width:120,
},{
field: 'pay',
title: '金额',
align: 'center',
width:100,
},{
field: 'status',
title: '状态',
align: 'center',
width:100,
},{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(article)', function(obj){
if (obj.event === 'add') {
tool.side('{$url[1]}');
return false;
}
});
//监听表格行工具事件
table.on('tool(article)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('{$url[4]}?id='+obj.data.id);
}
else if (obj.event === 'edit') {
tool.side('{$url[2]}?id='+obj.data.id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete('{$url[3]}', { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords,
cate_id: data.field.cate_id
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,81 @@
{extend name="common/base"/}
{block name="style"}
<style>
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
.layui-td-gray{
width: 110px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<div class="layui-form p-4">
<h3 class="pb-3">详情</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">党支部<font>*</font></td>
<td colspan="3">
<div class="layui-col-md6">
<select name="branch_id" lay-verify="required" lay-search="" disabled>
<option value="" >请选择</option>
{volist name='party_branch' id='vo'}
<option value="{$vo.id}" {if $detail.branch_id==$vo.id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</td>
</tr>
<tr>
<td class="layui-td-gray">开始时间<font>*</font></td>
<td colspan="7">
<input type="text" name="start_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1" value="{$detail.start_time}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">结束时间<font>*</font></td>
<td colspan="7">
<input type="text" name="end_time" id="formDate" lay-verify="required"
autocomplete="off" placeholder="请输入时间" class="layui-input" lay-key="1" value="{$detail.end_time}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">应收<font>*</font></td>
<td colspan="7">
<input type="text" name="pay" lay-verify="required" lay-reqText="请输入应收"
autocomplete="off" placeholder="请输入应收" class="layui-input" value="{$detail.pay}" readonly>
</td>
</tr>
<tr>
<td class="layui-td-gray">未收<font>*</font></td>
<td colspan="7">
<input type="text" name="no_pay" lay-verify="required" lay-reqText="请输入未收"
autocomplete="off" placeholder="请输入未收" class="layui-input" value="{$detail.no_pay}" readonly>
</td>
</tr>
</table>
</div>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool, tagpicker = layui.tagpicker,laydate = layui.laydate;
var editor = layui.tinymce;
var edit = editor.render({
selector: "#container_content",
height: 500
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -21,7 +21,7 @@
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加内容">+ 添加内容</span>
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
</div>
</script>

View File

@ -21,7 +21,7 @@
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加内容">+ 添加内容</span>
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
</div>
</script>

View File

@ -21,7 +21,7 @@
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加内容">+ 添加内容</span>
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
</div>
</script>

View File

@ -0,0 +1,79 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">新建消息通知</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray-2">接收人<font>*</font></td>
<td>
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" >{$vo.name}</option>
{/volist}
</select>
<td class="layui-td-gray-2">状态<font>*</font></td>
<td>
<input type="radio" name="status" value="1" title="正常" checked>
<input type="radio" name="status" value="0" title="禁用">
</td>
</tr>
<tr>
<td class="layui-td-gray-2">标题<font>*</font></td>
<td>
<input type="text" name="title" lay-verify="required" lay-reqText="请完善标题" value="" autocomplete="off" placeholder="请输入标题" class="layui-input">
</td>
</tr>
<tr><td class="layui-td-gray-2">通知内容<font>*</font></td>
<td colspan="5">
<textarea class="layui-textarea" id="container_content"></textarea>
</td>
</tr>
</table>
<div class="pt-3">
<input type="hidden" name="id" value="0"/>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool','tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool;
//通知内容富文本编辑器
var edit = layui.tinymce.render({
selector: '#container_content',
height: 500
});
//监听提交
form.on('submit(webform)', function (data) {
data.field.content = tinyMCE.editors['container_content'].getContent();
if (data.field.content == '') {
layer.msg('请先完善通知内容内容');
return false;
}
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/notice/add", data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,148 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<form class="layui-form gg-form-bar border-t border-x">
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
<table class="layui-hide" id="notice" lay-filter="notice"></table>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加消息通知">+ 添加消息通知</span>
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#notice',
title: '消息通知列表',
toolbar: '#toolbarDemo',
url: '/admin/notice/datalist',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
width: 80
},{
field: 'user_name',
title: '接收人',
align: 'center',
width: 100
},{
field: 'title',
title: '标题',
align: 'center',
width: 300
},{
field: 'content',
title: '通知内容',
align: 'center',
width: 600
},{
field: 'create_time',
title: '创建时间',
align: 'center',
width: 150
},{
field: 'status',
title: '状态',
align: 'center',
width: 70
},{
field: 'is_read',
title: '是否查看',
align: 'center',
width: 100
},{
field: 'read_time',
title: '查看时间',
align: 'center',
width: 150
},
{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
width: 136,
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(notice)', function(obj){
if (obj.event === 'add') {
tool.side("/admin/notice/add");
return false;
}
});
//监听表格行工具事件
table.on('tool(notice)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('/admin/notice/read?id='+obj.data.id);
}
else if (obj.event === 'edit') {
tool.side('/admin/notice/edit?id='+obj.data.id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete("/admin/notice/del", { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,86 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">编辑消息通知</h3>
<table class="layui-table layui-table-form">
<tr><td class="layui-td-gray-2">接收人<font>*</font></td>
<td>
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" {if $detail.user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</td>
<td class="layui-td-gray-2">状态<font>*</font></td>
<td>
<input type="radio" name="status" value="1" title="正常"" {eq name="$detail.status" value="1"} checked{/eq}>
<input type="radio" name="status" value="0" title="禁用" {eq name="$detail.status" value="0"} checked{/eq}>
</td>
<tr>
<td class="layui-td-gray-2">标题<font>*</font></td>
<td>
<input type="text" name="title" lay-verify="required" lay-reqText="请完善标题" autocomplete="off" placeholder="请输入标题" class="layui-input" value="{$detail.title}">
</td>
</tr>
</tr>
<tr>
<td class="layui-td-gray-2">是否查看</td>
<td>
<input type="radio" name="is_read" value="1" title="是"" {eq name="$detail.is_read" value="1"} checked{/eq}>
<input type="radio" name="is_read" value="0" title="否" {eq name="$detail.is_read" value="0"} checked{/eq}>
</td>
</tr>
<tr><td class="layui-td-gray-2">通知内容<font>*</font></td>
<td colspan="5">
<textarea class="layui-textarea" id="container_content">{$detail.content}</textarea>
</td>
</tr>
</table>
<div class="py-3">
<input type="hidden" name="id" value="{$detail.id}"/>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool','tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool;
//通知内容富文本编辑器
var edit = layui.tinymce.render({
selector: '#container_content',
height: 500
});
//监听提交
form.on('submit(webform)', function (data) {
data.field.content = tinyMCE.editors['container_content'].getContent();
if (data.field.content == '') {
layer.msg('请先完善通知内容内容');
return false;
}
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("/admin/notice/edit", data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,38 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="layui-form p-4">
<h3 class="pb-3">消息通知详情</h3>
<table class="layui-table layui-table-form">
<tr><td class="layui-td-gray-2">接收人</td>
<td>
<select name="user_id" lay-verify="required" lay-search="">
<option value="" >请选择</option>
{volist name='users' id='vo'}
<option value="{$vo.user_id}" {if $detail.user_id==$vo.user_id} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</td>
<td class="layui-td-gray-2">标题</td>
<td>{$detail.title}</td><td class="layui-td-gray-2">创建时间</td>
<td>{$detail.create_time}</td>
</tr><tr><td class="layui-td-gray-2">状态</td>
<td>
{eq name="$detail.status" value="0"}禁用{/eq}
{eq name="$detail.status" value="1"}正常{/eq}
</td><td class="layui-td-gray-2">是否查看</td>
<td>
{eq name="$detail.is_read" value="0"}否{/eq}
{eq name="$detail.is_read" value="1"}是{/eq}
</td>
<td class="layui-td-gray-2">查看时间</td>
<td>{$detail.read_time}</td>
</tr><tr><td class="layui-td-gray-2">通知内容</td>
<td colspan="5">
{$detail.content|raw}
</td>
</tr>
</table>
</div>
{/block}
<!-- /主体 -->