提交 cf175255 authored 作者: fengzy's avatar fengzy

jz.php

config/cache.php merge=ours
config/admin.php merge=ours
config/session.php merge=ours
config/admin.php merge=ours
\ No newline at end of file
......@@ -19,3 +19,4 @@
/public/dist2
/public/static/uploads
/public/static/xadmin
/application/admin/view/staff/role.html
\ No newline at end of file
......@@ -47,12 +47,9 @@ class Base extends Controller
private function authCheck($user_id){
//通过uid查询roleid通过roleid查询权限列表
$permissions = StaffRoleModel::getStaffRolesById($user_id);
$permissions = explode(',',$permissions);
//获取当前访问路由
$path = Request::pathinfo() ?: '/';
if($path !== '/'){
//检测是否存在数字,如果存在数字则删除最后一个/之后的所有数据
if(preg_match('/[0-9]+/',$path)){
......
......@@ -484,13 +484,13 @@ class Basestation extends Base
public function basestation_map(Request $request){
$id= $request->get('station_name');
$db = Db::connect([
'type' => 'mysql',
'hostname' => '127.0.0.1',
'database' => 'jzdb',
'username' => 'root',
'password' => 'pvv5718J0CwhNfn4B^8^H3igPj#oiQkX',
'hostport' => '10036',
'charset' => 'utf8',
'type' => config('jz.jztype'),
'hostname' => config('jz.jzhostname'),
'database' => config('jz.jzdatabase'),
'username' => config('jz.jzusername'),
'password' => config('jz.jzpassword'),
'hostport' =>config('jz.jzhostport'),
'charset' => config('jz.jzcharset'),
]);
$data=$db->table('jz_message')->field('business_id')->where(['jz_name'=>$id])->find();
$this->assign('data',$data['business_id']);
......@@ -499,13 +499,13 @@ class Basestation extends Base
public function basestation_region(Request $request){
$db = Db::connect([
'type' => 'mysql',
'hostname' => '127.0.0.1',
'database' => 'jzdb',
'username' => 'root',
'password' => 'pvv5718J0CwhNfn4B^8^H3igPj#oiQkX',
'hostport' => '10036',
'charset' => 'utf8',
'type' => config('jz.jztype'),
'hostname' => config('jz.jzhostname'),
'database' => config('jz.jzdatabase'),
'username' => config('jz.jzusername'),
'password' => config('jz.jzpassword'),
'hostport' =>config('jz.jzhostport'),
'charset' => config('jz.jzcharset'),
]);
$data['business_id']= $request->get('station_id');
if(empty($data['business_id'])){
......
......@@ -4,7 +4,6 @@ namespace app\admin\controller;
use app\admin\model\AdminModel;
use app\admin\model\StaffModel;
use think\Config;
use think\Controller;
use think\facade\Cache;
use think\facade\Session;
......
......@@ -5,20 +5,15 @@
* Date: 2020-3-22
* Time: 19:03
*/
namespace app\admin\controller;
use app\admin\model\StaffModel;
use think\Exception;
use think\facade\Cookie;
class SingleSign {
public $instence = null;
public function __construct(){
if($this->instence === null){
$redis = new \Redis();
$res = $redis->connect(config('admin.redis_host'),config('admin.redis_port'));
if($res) $this->instence = $redis;
......@@ -30,19 +25,14 @@ class SingleSign {
public function getSid($prex = 'PHPREDIS_SESSION:'){
$sid = Cookie::get('PHPSESSID');
$sid = $prex.$sid;
$str = $this->instence->get($sid);
if(!$str) throw new Exception("session info not found");
return $str;
}
//从session中读取信息
public function getUserInfo(){
$str = $this->getSid();
$pos = stripos($str,'is_admin|b:') + 11;
$isAdmin = substr($str,$pos,1);
$user['is_admin'] = $isAdmin;
......@@ -51,7 +41,6 @@ class SingleSign {
$user['username'] = 'gonnadmin';
} else {
preg_match('/adminuser\|s\:(\d+)\:/',$str,$match);
if($match){
$pos = stripos($str,'adminuser|s:') + strlen('adminuser|s:');
$pos += strlen($match[1]) + 2;
......@@ -59,14 +48,12 @@ class SingleSign {
}
}
$pos = stripos($str,'ukey|s:10:') + 11;
$ukey = substr($str,$pos,10);
$user['ukey'] = $ukey;
preg_match('/[\x80-\xff]+/',$str,$matchb);
if($matchb) $user['name'] = $matchb[0];
return $user;
}
......
......@@ -42,9 +42,7 @@
<a title="设置数据权限" onclick="xadmin.open('数据权限配置','/staff_role_department/{$item.id}')" href="javascript:;">
<i class="layui-icon iconfont">&#xe70c;</i>
</a>
<!-- <a title="删除" onclick="member_del(this,'{$item.id}')" href="javascript:;">
<i class="layui-icon">&#xe640;</i>
</a> -->
</td>
</tr>
{/foreach}
......@@ -62,55 +60,10 @@
<script src="dist/js/md5.js"></script>
<script src="dist/js/sha1.js"></script>
<script src="dist/js/util.js"></script>
<script src="dist/js/getUserToken.js"></script>
<!--<script src="dist/js/getUserToken.js"></script>-->
<script>
layui.use(['laydate','form','upload'], function(){
var laydate = layui.laydate;
var form = layui.form;
upload = layui.upload;
//执行一个laydate实例
laydate.render({
elem: '#start' //指定元素
});
//执行一个laydate实例
laydate.render({
elem: '#end' //指定元素
});
var EmImport = upload.render({
elem: '#EmImport' ,
url: '/basestation_import',
accept:'file',
field: 'file_name',
done: function (res) {
if(res.status == 1){
layer.open({
content: res.message,
btn: ['确定'],
yes: function() {
layer.closeAll();
window.location.reload();
}
});
}
if(res.status == 0){
layer.open({
content: res.message,
btn: ['确定'],
yes: function() {
layer.closeAll();
window.location.reload();
}
});
}
else {
//layMsg(res.message,5)
return;
}
}
});
});
......
{extend name="public:form" /}
{block name="body"}
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<form class="layui-form">
</form>
</div>
<div class="layui-card-header">
<button class="layui-btn" onclick="synUser()" id="sameIsadmin"><i class="layui-icon layui-icon-refresh"></i>同步</button>
<button class="layui-btn" id="EmImport">
<i class="layui-icon iconfont">&#xe7e4;</i></button>
</div>
<div class="layui-card-body ">
<table class="layui-table layui-form">
<thead>
<tr>
<th>姓名</th>
<th>部门</th>
<th>角色权限</th>
<th>操作</th>
</thead>
<tbody>
{foreach $data as $item}
<tr>
<td>{$item.name}</td>
<td>{$item.department.name|default='广厦网络'}</td>
<td>
{volist name="$item.roles" id="role" empty="$empty"}
[{$role.title}]
{/volist}
</td>
<td class="td-manage">
<a title="设置功能权限" onclick="xadmin.open('设置功能权限','/staff_role_edit/{$item.id}')" href="javascript:;">
<i class="layui-icon">&#xe642;</i>
</a>
<a title="设置数据权限" onclick="xadmin.open('数据权限配置','/staff_role_department/{$item.id}')" href="javascript:;">
<i class="layui-icon iconfont">&#xe70c;</i>
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</body>
<script src="dist/js/api.js"></script>
<script src="dist/js/layer.js"></script>
<script src="dist/js/md5.js"></script>
<script src="dist/js/sha1.js"></script>
<script src="dist/js/util.js"></script>
<script src="dist/js/getUserToken.js"></script>
<script>
layui.use(['laydate','form','upload'], function(){
var laydate = layui.laydate;
var form = layui.form;
upload = layui.upload;
//执行一个laydate实例
laydate.render({
elem: '#start' //指定元素
});
//执行一个laydate实例
laydate.render({
elem: '#end' //指定元素
});
var EmImport = upload.render({
elem: '#EmImport' ,
url: '/basestation_import',
accept:'file',
field: 'file_name',
done: function (res) {
if(res.status == 1){
layer.open({
content: res.message,
btn: ['确定'],
yes: function() {
layer.closeAll();
window.location.reload();
}
});
}
if(res.status == 0){
layer.open({
content: res.message,
btn: ['确定'],
yes: function() {
layer.closeAll();
window.location.reload();
}
});
}
else {
//layMsg(res.message,5)
return;
}
}
});
});
/*用户-停用*/
function member_stop(obj,id){
layer.confirm('确认要停用吗?',function(index){
if($(obj).attr('title')=='启用'){
//发异步把用户状态进行更改
$(obj).attr('title','停用')
$(obj).find('i').html('&#xe62f;');
$(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用');
layer.msg('已停用!',{icon: 5,time:1000});
}else{
$(obj).attr('title','启用')
$(obj).find('i').html('&#xe601;');
$(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用');
layer.msg('已启用!',{icon: 5,time:1000});
}
});
}
/*用户-删除*/
function member_del(obj,id){
layer.confirm('确认要删除吗?',function(index){
//发异步删除数据
var url = '/staff_role_del';
$.ajax({
url: url,
method: "POST",
data: {id:id},
dataType: "json",
success: function (data) {
if(data.status == 1){
layer.msg(data.message,{icon:1,time:1000});
location.reload()
} else {
layer.alert(data.message, {
icon: 5
});
}
},
error : function (XMLHttpRequest, textStatus, errorThrow ) {
console.log('AJAX 执行删除失败...');
}
});
});
}
function delAll (argument) {
var data = tableCheck.getData();
layer.confirm('确认要删除吗?'+data,function(index){
//捉到所有被选中的,发异步进行删除
layer.msg('删除成功', {icon: 1});
$(".layui-form-checked").not('.header').parents('tr').remove();
});
}
function synUser() {
layer.confirm('确定要同步吗?', {skin: 'layui-layer-lan',btn:['取消','确认'],icon: 3, title:'提示'},
function(index,layero){
layer.close(index);
},
function(index,layero){
var indexload = layer.load(0, {
shade: [0.7,'#fff'] //0.7透明度的白色背景
});
let time = Math.round(new Date().getTime()/1000);
let app_secret = '4d8e605fa7ed546c4bcb33dee1381179';
let serverAuthenticateStaticKey= 'de5kio2f';
var temp = hex_sha1(app_secret+time+serverAuthenticateStaticKey);
var sign= hex_md5(temp);
util.ajax({
type:'get',
dataType: 'json',
url: util.interfaceUrl + interfacenName.synSuser ,
data: {
timestamp:time,
sign: sign
},
success: (res) => {
if(res.code == "200"){
setTimeout(function () {
layer.close(indexload)
},1500)
layer.msg("同步成功")
} else {
setTimeout(function () {
layer.close(indexload)
},1500)
layer.msg(res.message)
}
},
error:function (err) {
layer.msg('网络接口异常')
}
});
})
}
</script>
{/block}
\ No newline at end of file
<?php
use app\admin\model\PermissionModel;
use app\admin\model\StaffRoleModel;
use think\db;
use think\facade\Session;
function check_data(){
$user = session('user');
......@@ -341,3 +345,23 @@ function getInvoicesStatusName($statusCode,$index=0){
}
}
}
//检测元素与按钮权限
function check_ele_permission($path){
$user = Session::get('user');
//获取当前用户的所有权限id
$permissions = StaffRoleModel::getStaffRolesById($user['user_id']);
$permissions = explode(',',$permissions);
//查询$path所对应id
$permission = PermissionModel::field('id,nav_url')->get(['nav_url'=>$path]);
if(isset($permission->id)){
if(!in_array($permission->id,$permissions) || $permission == null){
return false;
}
return true;
}
return false;
}
\ No newline at end of file
......@@ -119,11 +119,39 @@ class Useage extends Base
return $this->fetch('default');
}
public function update(){
$useage_id = Request::param('useage_id');
$uModel = (new \app\em\model\Useage())->with('photo')->get(['useage_id'=>$useage_id]);
$em = (new \app\em\model\Em)->getEmUseageInfoById($uModel->em_id,false);
//基站信息
$station_info = Station::getBaseInfoById($em->station_id);
$this->assign('station',$station_info);
//当前用户
$user = Session::get('user');
$this->assign('uid',$user['user_id']);
//员工列表
$this->assign('staffs',(new Staff())->getStaffs($user['is_admin'],'','useage'));
$this->assign('em',$em);
$step = 1000000;
$uModel->repo_numb = ((int)($uModel->current_sum_numb * $step) - (int)($uModel->last_sum_numb * $step)) / $step;
$this->assign('useage',$uModel);
return $this->fetch('update');
}
//保存抄表单
public function store($useage_id = ''){
//获取表单数据
$data = Request::post();
<<<<<<< HEAD
=======
$useage_id = isset($data['useage_id']) ? $data['useage_id'] : '';
>>>>>>> 712dea449184407dd0ea2cb79857be09da1c93cd
$action = '新增';
//数据验证
$validate = new UseageGeneralInfoValidate();
......@@ -149,6 +177,10 @@ class Useage extends Base
$this->checkEnd($useage_id);
$action = '修改';
$uModel = (new \app\em\model\Useage())->get(['useage_id' => $useage_id]);
<<<<<<< HEAD
=======
$uModel->status = 1;
>>>>>>> 712dea449184407dd0ea2cb79857be09da1c93cd
}
//更新
$uModel->staff_id = $data['staff_id'];
......@@ -162,6 +194,7 @@ class Useage extends Base
if(empty($useage_id)){
$udModel = new UseageDetail(); //抄表详情模型
<<<<<<< HEAD
$udModel->type = $data['type'] == 1 ? 5 : 6;
$uModel->current_numb = $data['current_numb'];
$uModel->last_numb = $data['last_numb'];
......@@ -169,6 +202,16 @@ class Useage extends Base
$udModel = (new UseageDetail())->get(['useage_id' => $useage_id]);; //抄表详情模型
}
$udModel->current_numb = $data['current_numb'];
=======
$udModel->useage_id = $uModel->useage_id;
$udModel->type = $data['pricing_type'] == 1 ? 5 : 6;
$udModel->current_numb = $uModel->current_sum_numb;
$udModel->last_numb = $uModel->last_sum_numb;
} else {
$udModel = (new UseageDetail())->get(['useage_id' => $useage_id]); //抄表详情模型
}
$udModel->current_numb = $uModel->current_sum_numb;
>>>>>>> 712dea449184407dd0ea2cb79857be09da1c93cd
$udModel->price = $uModel->price;
$udModel->save();
......@@ -188,6 +231,11 @@ class Useage extends Base
$checkType = Request::param('checkType');
$this->verify($useage_id,$checkType); //1是通过 2是驳回
if($checkType == 2) {
<<<<<<< HEAD
=======
$res = $this->checkEnd($useage_id);
if($res !== true) return $res;
>>>>>>> 712dea449184407dd0ea2cb79857be09da1c93cd
$useage->status = 3; //3代表被驳回
$useage->save();
return json(['status'=>1,'message'=>'单据已经驳回']);
......@@ -249,6 +297,7 @@ class Useage extends Base
public function del(){
$useage_id = Request::param('uid');
<<<<<<< HEAD
$this->checkEnd($useage_id);
$useage = (new \app\em\model\Useage())->get(['useage_id'=>$useage_id]);
$useage_details = (new UseageDetail())->select(['useage_id'=>$useage_id]);
......@@ -265,6 +314,52 @@ class Useage extends Base
Db::rollback();
return json(['status'=>0,'message'=>"删除异常,单据删除失败,请联系管理员"]);
}
=======
$res = $this->checkEnd($useage_id);
if($res !== true) return $res;
//删除useage表数据
$useage = (new \app\em\model\Useage())->get(['useage_id'=>$useage_id]);
$useage->delete();
//删除明细表数据
(new UseageDetail())->where('useage_id','=',$useage_id)->delete();
return json(['status'=>1,'message'=>"删除单据成功"]);
}
/**
* 判断useage_id是否是em_id的最后一条记录
* @param $useage_id
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function checkEnd($useage_id){
$uModel = (new \app\em\model\Useage())->get(['useage_id'=>$useage_id]);
if(!$uModel) return json(['status'=>0,'message'=>"不存在的抄表单号,请联系管理员"]);
if($uModel->status == 2) return json(['status'=>0,'message'=>"已审核过的单据无法操作,请联系管理员"]);
//找出电表最后一条数据
$lastModel = (new \app\em\model\Useage())->where('em_id','=',$uModel->em_id)
->order('id desc')->find();
if($lastModel->status == 2) return json(['status'=>0,'message'=>"单号不是最新的抄表记录且最新的抄表记录已经审核无法操作,请联系管理员"]);
if($uModel->id != $lastModel->id){
return json(['status'=>0,'message'=>"抄表单号不是最新的抄表记录无法操作,请联系管理员"]);
}
return true;
}
//审核
public function verify($usage_id,$status=2){
$user = Session::get('user');
$cModel = new EmCheckBill();
$cModel->info = Request::param('refuseInfo');
$cModel->uid = $user['user_id'];
$cModel->mode = 'useage';
$cModel->mode_id = $usage_id;
$cModel->status = $status;
$cModel->save();
>>>>>>> 712dea449184407dd0ea2cb79857be09da1c93cd
}
/**
......
......@@ -45,6 +45,7 @@ class EmInvoice extends Base
->select()
->toarray();
$step = 100000;
foreach ($data as &$item){
if($item['payment_balance'] == 0){
......@@ -58,6 +59,8 @@ class EmInvoice extends Base
} else {
$item['sett_amount'] = round($item['settle_amount'] - $item['settle_balance'],3);
}
$item['repo_numb'] = ($item['current_sum_numb'] * $step - $item['last_sum_numb'] * $step ) * $item['rate'] / $step;
}
return $data;
}
......
......@@ -53,6 +53,11 @@ class Useage extends Base
foreach ($data as $k => $v){
$data[$k]['repo_numb'] = round(round($v['current_sum_numb'] - $v['last_sum_numb'],2)*$v['rate'],2);
if($v['status'] == 3){
$info = (new EmCheckBill())->field('info')->get(['mode_id'=>$v['useage_id']]);
$data[$k]['info'] = $info['info'];
}
}
return $data;
}
......
......@@ -30,7 +30,7 @@ class UseageGeneralInfoValidate extends Validate
];
protected $scene = [
's1' => 'em_id,last_numb,last_date,current_numb,current_date,photo_id,staff_id',
's1' => 'em_id,last_numb,last_date,current_numb,current_date,photo_id,staff_id,price',
's2' => 'em_id,last_numb,last_date,current_numb,current_date,photo_id,staff_id,price',
];
......
......@@ -75,7 +75,7 @@
<th lay-data="{field:'station_name',sort: true}">所属基站名</th>
<th lay-data="{templet:'#em_numb',sort: true} ">所属电表号</th>
<th lay-data="{templet: '#useage'}">抄表度数</th>
<th lay-data="{templet: '#repo_numb'}">用电量</th>
<th lay-data="{field: 'repo_numb'}">用电量</th>
<th lay-data="{templet:'#payment'}">缴费金额</th>
<th lay-data="{templet:'#settle'}">结算金额</th>
<th lay-data="{field: 'status'}">账单状态</th>
......
......@@ -205,7 +205,7 @@
</div>
{if $detail == false}
<div class="layui-form-item layui-col-md-offset4">
<a href="/em" class="layui-btn">
<a href="/useage/" class="layui-btn">
返回
</a>
<button class="layui-btn" lay-filter="save" lay-submit="">
......
......@@ -200,6 +200,17 @@
</div>
</div>
{if $useage.status < 2}
<<<<<<< HEAD
<div class="layui-form-item layui-col-md-offset4">
<button class="layui-btn" lay-filter="pass" lay-submit="">
通过
</button>
<button class="layui-btn" lay-filter="refuse" lay-submit="">
驳回
</button>
</div>
=======
{if check_ele_permission('useage/check') }
<div class="layui-form-item layui-col-md-offset4">
<button class="layui-btn" lay-filter="pass" lay-submit="">
通过
......@@ -209,6 +220,8 @@
</button>
</div>
{/if}
>>>>>>> 712dea449184407dd0ea2cb79857be09da1c93cd
{/if}
</form>
</div>
</div>
......@@ -217,13 +230,6 @@
{block name="js"}
<script>
//限制输入长度
function sliceDom(dom,len){
if(dom.value.length>len)
return dom.value = dom.value.slice(0,len)
}
//初始化Layui控件
layui.use(['form', 'layer', 'laydate', 'upload'],
function () {
......@@ -251,11 +257,15 @@
dataType: "json",
success: function (data) {
if (data.status == 1) {
layer.msg(data.message,{icon: 6,time: 2000},function(){
layer.msg(data.message,{icon: 6,time: 3000},function(){
window.location.href='/useage';
})
} else {
<<<<<<< HEAD
layer.msg(data.message || data.msg,{icon: 5,time: 1000 })
=======
layer.msg(data.message || data.msg,{icon: 5,time: 3000 })
>>>>>>> 712dea449184407dd0ea2cb79857be09da1c93cd
window.location.href='/useage';
}
}
......@@ -272,7 +282,11 @@
layer.open({
type: 1,
title:'填写驳回理由',
<<<<<<< HEAD
content: '<div class="layui-form-item><div class="layui-input-block" style="padding:15px;"><textarea placeholder="驳回理由" class="layui-textarea" id="refuseInfo" name="refuseInfo"></textarea></div>',
=======
content: '<div class="layui-form-item"><div style="padding:15px;"><textarea placeholder="驳回理由" class="layui-textarea" id="refuseInfo" name="refuseInfo"></textarea></div>',
>>>>>>> 712dea449184407dd0ea2cb79857be09da1c93cd
btn:"提交",
yes: function(){
$data.field.checkType = 2;
......@@ -284,12 +298,20 @@
dataType: "json",
success: function (data) {
if (data.status == 1) {
<<<<<<< HEAD
layer.msg(data.message,{icon: 6,time: 2000},function(){
window.location.href='/useage';
})
} else {
layer.msg(data.message || data.msg,{icon: 5,time: 1000 })
window.location.href='/useage';
=======
layer.msg(data.message,{icon: 6,time: 4000},function(){
window.location.href='/useage';
})
} else {
layer.msg(data.message || data.msg,{icon: 5,time: 5000 })
>>>>>>> 712dea449184407dd0ea2cb79857be09da1c93cd
}
}
});
......
......@@ -57,19 +57,19 @@
<table class="layui-table" lay-filter="useage" lay-data="{ url:'/useage', page:true, id:'idTest',where:{search_type:document.getElementById('search_type').value,search_text:document.getElementById('search_text').value,date_start:document.getElementById('date_start').value,date_end:document.getElementById('date_end').value,cp_date:document.getElementById('cp_date').value,status:document.getElementById('useage_status').value} }">
<thead>
<tr>
<th lay-data="{templet: '#useage_id',sort: true} ">抄表单号</th>
<th lay-data="{field:'station_name'}">所属基站名</th>
<th lay-data="{field:'em_numb'} ">所属电表号</th>
<th lay-data="{field:'last_date',sort: true}">上次日期</th>
<th lay-data="{field:'current_date',sort: true}">本次日期</th>
<th lay-data="{field:'last_sum_numb'}">上次度数</th>
<th lay-data="{field:'current_sum_numb'}">本次度数</th>
<th lay-data="{field:'repo_numb'}">用电量</th>
<th lay-data="{templet: '#status',sort: true}">状态</th>
<th lay-data="{templet: '#photo_id',sort: true}">抄表凭证</th>
<th lay-data="{fixed: 'right', align:'center', toolbar: '#barDemo'}">操作</th>
<th lay-data="{templet: '#useage_id',sort: true,width:'12%'} ">抄表单号</th>
<th lay-data="{field:'station_name',width:'12%'}">所属基站名</th>
<th lay-data="{field:'em_numb',width:'8%'} ">所属电表号</th>
<th lay-data="{field:'last_date',sort: true,width:'9%'}">上次日期</th>
<th lay-data="{field:'current_date',sort: true,width:'9%'}">本次日期</th>
<th lay-data="{field:'last_sum_numb',width:'7%'}">上次度数</th>
<th lay-data="{field:'current_sum_numb',width:'7%'}">本次度数</th>
<th lay-data="{field:'repo_numb',width:'7%'}">用电量</th>
<th lay-data="{templet: '#status',sort: true,width:'5%'}">状态</th>
<th lay-data="{templet: '#photo_id',sort: true,width:'7%'}">抄表凭证</th>
<th lay-data="{fixed: 'right', align:'center', toolbar: '#barDemo',width:'16%'}">操作</th>
</tr>
</thead>
</table>
......@@ -95,22 +95,40 @@
{{# if(d.status == 2){ }}
<span class="layui-bg-blue">已审核</span>
{{# } }}
<<<<<<< HEAD
{{# if(d.status == 3) { }}
<span class="layui-bg-orange" title="{{ d.info.info }}">被驳回</span>
{{# } }}
{{# if(d.status < 2) { }}
<span class="layui-bg-green" title="{{ d.info.info }}">未审核</span>
=======
{{# if(d.status == 3){ }}
<span class="layui-bg-orange" title="{{ d.info }}">被驳回</span>
{{# } }}
{{# if(d.status < 2){ }}
<span class="layui-bg-green">未审核</span>
>>>>>>> 712dea449184407dd0ea2cb79857be09da1c93cd
{{# } }}
</script>
{if $admin == true}
<script type="text/html" id="barDemo">
<<<<<<< HEAD
{{# if(d.status == 1 || d.status == 3){ }}
<a title="删除" class="layui-btn layui-btn-sm layui-bg-green" lay-event="update">编辑</a>
=======
{{# if(d.status == 1){ }}
<a title="审核" class="layui-btn layui-btn-sm layui-bg-green" href="/useage/{{d.useage_id}}">审核</a>
{{# } }}
{{# if(d.status == 1 || d.status == 3){ }}
<a title="编辑" class="layui-btn layui-btn-sm layui-bg-green" href="/useage_update/{{d.useage_id}}">编辑</a>
>>>>>>> 712dea449184407dd0ea2cb79857be09da1c93cd
<a title="删除" class="layui-btn layui-btn-sm layui-btn-danger" lay-event="del">删除</a>
{{# } }}
</script>
{/if}
<script>
layui.use(['laydate','form','table'], function(){
var laydate = layui.laydate,
......@@ -138,13 +156,13 @@
dataType: "json",
success: function (data) {
if(data.status == 1){
layer.msg(data.message,{icon: 6,time: 2000},function(){
layer.msg(data.message,{icon: 6,time: 4000},function(){
obj.del();
layer.close(index);
location.reload()
})
} else {
layer.msg(data.message,{icon: 5,time: 1000 })
layer.msg(data.message,{icon: 5,time: 5000 })
}
}
});
......
差异被折叠。
<?php
//配置文件
return [
//加密串
'jztype' => 'mysql',
'jzhostname' => '127.0.0.1',
'jzdatabase' => 'jzdb',
'jzusername' => 'root',
'jzpassword' => 'pvv5718J0CwhNfn4B^8^H3igPj#oiQkX',
'jzhostport' => '10036',
'jzcharset' => 'utf8',
];
......@@ -2,7 +2,7 @@ let userIdLocal = document.cookie.split('user=')[1]?(document.cookie.split('user
let temp = sessionStorage.getItem('userIdLocal')?sessionStorage.getItem('userIdLocal'):''
if(userIdLocal == '') top.location.href="http://oa.gonn.com.cn/";
if(userIdLocal == '') top.location.href="http://oa-test.gonn.tech/";
if ( temp != userIdLocal || !sessionStorage.getItem('userToken')){
sessionStorage.setItem("userIdLocal", userIdLocal)
......
......@@ -147,7 +147,11 @@ Route::get('useage/:useage_id','em/useage/detail');
Route::get('useage_add/:id','em/useage/create');
Route::post('useage_add','em/useage/store');
Route::post('useage_del','em/useage/del');
<<<<<<< HEAD
Route::post('useage_update','em/useage/update');
=======
Route::get('useage_update/:useage_id','em/useage/update');
>>>>>>> 712dea449184407dd0ea2cb79857be09da1c93cd
Route::post('upFile','em/UploadFile/upFile');
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论