提交 5f7dd2fc authored 作者: chengye's avatar chengye

Merge branch 'release'

......@@ -41,46 +41,6 @@ class Copy extends Base
parent::__construct($app);
}
// public function index(){
// //区域
// $regions = Region::field('id,region_name')->select()->toArray();
// //页码
// $pageNow = Request::get('pages');
// //抄表单列表
// $user = Session::get('user');
// $map = [];
// $identity = (new Staff)->getIdentity();
// if(!$user['is_admin'] && $identity != 5){
// if(config('admin.search_area') == 1){
// $staff = StaffModel::get($user['user_id']);
// //通过员工的部门id查询 员工所在部门以及下属部门的数据范围
// $dids = (new DepartmentModel)->getNodeIds($staff->d_id);
// $cpIds = CopyModel::field('copy.id')
// ->leftJoin(['staff'],'staff.id = copy.staff_id')
// ->where('staff.d_id','in',$dids)
// ->select()
// ->toArray();
// $copyArr = [];
// foreach ($cpIds as $copy){
// $copyArr[]= $copy['id'];
// }
// if($copyArr != '')
// $map[] = ['copy.id','in',$copyArr];
// }
// }
// $list = CopyModel::list($pageNow,'',$map);
// $page = $list->render();
// $this->assign('identity',$identity);
// $this->assign('regions',$regions);
// $this->assign('page',$page);
// $this->assign('data',$list);
// return $this->fetch();
// }
public function index(){
$map=[];
//权限检测
......
......@@ -60,10 +60,10 @@ class Login extends Controller
$captcha->useNoise = true;
$captcha->imageH=0;
$captcha->imageW=0;
return $captcha->entry();
return $captcha->entry();
}
public function loginOut()
{
session(null);
......@@ -83,14 +83,14 @@ class Login extends Controller
];
return $data;
}
$status=(new StaffModel)->getStaffStatusByName($email);
if(!$status['status']==1){
$data = [
'status' => 0,
'message' => '该账户当前禁用,请联系管理员开启'
];
return $data;
}
$status=(new StaffModel)->getStaffStatusByName($email);
if(!$status['status']==1){
$data = [
'status' => 0,
'message' => '该账户当前禁用,请联系管理员开启'
];
return $data;
}
if(decrypt($passwd) == $staff->passwd->passwd){
$user = [
'name'=> $staff->name,
......@@ -117,7 +117,11 @@ class Login extends Controller
$admin = AdminModel::get(['name'=>$name,'password'=>$passwd]);
if(!$admin){
$this->error('用户名或密码错误');
$data = [
'status' => 0,
'message' => '用户名或密码错误'
];
return $data;
} else {
loginlog($admin->name,$admin->id,'管理员用户成功登录系统',1);
$user = [
......
......@@ -31,7 +31,7 @@ class Upload extends Base
$info = $this->file->validate(['ext'=>'jpg,png,gif'])
->move($this->images_dir);
} else {
$info = $this->file->validate(['ext'=>'doc,docx,xls,xlsx,ppt,pdf'])
$info = $this->file->validate(['ext'=>'jpg,png,gif,doc,docx,xls,xlsx,zip,rar,pdf'])
->move($this->files_dir);
}
......
......@@ -15,8 +15,8 @@ class LoginValidate extends Validate
protected $message = [
'name.require' => '名称必须',
'name.max' => '名称最多不能超过32个字符',
'name.token' => '非法的请求',
'password.require'=>'密码必填',
'verify.require'=>'验证码必填'
'name.token' => '非法的请求,请重新登录',
'password.require'=>'请填写密码',
'verify.require'=>'请填写验证码'
];
}
\ No newline at end of file
......@@ -10,7 +10,7 @@
<link rel="stylesheet" href="__STATIC__/xadmin/css/font.css">
<link rel="stylesheet" href="__STATIC__/xadmin/css/login.css">
<link rel="stylesheet" href="__STATIC__/xadmin/css/xadmin.css">
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="__STATIC__/xadmin/lib/layui/layui.js" charset="utf-8"></script>
</head>
<body class="login-bg">
......
<?php
/**
* Created by PhpStorm.
* User: chouchou
* Date: 2020-2-23
* Time: 23:30
*/
namespace app\em\controller;
use app\admin\controller\Upload;
use app\em\model\Base;
use think\facade\Request;
class UploadFile extends Base
{
public function upPhoto(){
$file = Request::file('cp_photo');
$upload = new Upload($file,1);
$result = $upload->upload();
if($result){
return jsonSuc('照片上传成功',$result);
} else {
return jsonErr($result);
}
}
public function upFile(){
$file = Request::file('up_file');
$upload = new Upload($file,2);
$result = $upload->upload();
if($result){
return jsonSuc('上传文件成功',$result);
} else {
return jsonErr($result);
}
}
}
\ No newline at end of file
......@@ -554,22 +554,26 @@
//渲染date类型字段
laydate.render({
elem: '#init_date', // 第一次抄表
trigger: 'click'
trigger: 'click',
format:'yyyy-MM-dd HH:mm:ss'
});
laydate.render({
elem: '#contract_confirm_date',//合同确认时间
trigger: 'click'
trigger: 'click',
format:'yyyy-MM-dd HH:mm:ss'
});
laydate.render({
elem: '#cycle_start_time',//合同确认时间
trigger: 'click'
trigger: 'click',
format:'yyyy-MM-dd HH:mm:ss'
});
laydate.render({
elem: '#cycle_finish_time',//合同确认时间
trigger: 'click'
trigger: 'click',
format:'yyyy-MM-dd HH:mm:ss'
});
......@@ -654,8 +658,9 @@
//上传电表照片
var uploadEa = upload.render({
elem: '#electric_annex_button' ,
url: '/upAnnex',
field: 'annex_file',
url: '/upFile',
field: 'up_file',
accept: 'file',
done: function (res) {
if(res.status == 1){
//将电表照片的ID填写
......
......@@ -65,8 +65,6 @@
<th lay-data="{field:'region_name',sort: true} ">区域</th>
<th lay-data="{field:'operator_name',sort: true}">运营商</th>
<th lay-data="{field:'proj_number'}">项目编号</th>
<th lay-data="{templet: '#account_id'}">账户ID</th>
<th lay-data="{templet: '#amount'}">账户余额</th>
<th lay-data="{field:'create_time',sort: true}">创建时间</th>
<th lay-data="{fixed: 'right', width:'180', align:'center', toolbar: '#barDemo'}">操作</th>
</tr>
......@@ -83,18 +81,6 @@
<script type="text/html" id="em_numb">
<a class="layui-link" href="/em_edit/{{d.id}}">{{d.em_numb}}</a>
</script>
<script type="text/html" id="account_id">
{{# if(d.account){ }}
{{d.account.account_id }}
{{# } }}
</script>
<script type="text/html" id="amount">
{{# if(d.account){ }}
{{d.account.amount }}
{{# } }}
</script>
<script type="text/html" id="barDemo">
<div class="layui-text-left">
<a title="抄表" class="layui-btn layui-btn-sm" href="/useage_add/{{d.id}}">抄表</a>
......
......@@ -131,7 +131,7 @@
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
<span class="x-red">*</span>电表水印照片
<span class="x-red">*</span>抄表凭证
</label>
<div class="layui-input-inline">
<button type="button" class="layui-btn" id="up_photo">
......@@ -238,8 +238,9 @@
//上传电表照片
var upPhoto = upload.render({
elem: '#up_photo' ,
url: '/up_photo',
field: 'cp_photo',
url: '/upFile',
field: 'up_file',
accept: 'file',
done: function (res) {
if(res.status == 1){
layMsg(res.message)
......@@ -256,8 +257,6 @@
}
}
});
});
</script>
......
......@@ -129,7 +129,7 @@
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
<span class="x-red">*</span>电表水印照片
<span class="x-red">*</span>抄表凭证
</label>
<div class="layui-input-inline">
<a href="{$useage.photo.src}" target="_blank" class="layui-btn" disabled="disabled">
......@@ -183,9 +183,7 @@
function () {
$ = layui.jquery;
var form = layui.form,
layer = layui.layer,
laydate = layui.laydate,
upload = layui.upload;
layer = layui.layer;
//消息提示
......
......@@ -129,7 +129,7 @@
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
<span class="x-red">*</span>电表水印照片
<span class="x-red">*</span>抄表凭证
</label>
<div class="layui-input-inline">
<a href="{$useage.photo.src}" target="_blank" class="layui-btn" disabled="disabled">
......@@ -203,11 +203,7 @@
function () {
$ = layui.jquery;
var form = layui.form,
layer = layui.layer,
laydate = layui.laydate,
upload = layui.upload;
layer = layui.layer;
//消息提示
function layMsg(msg,type=6,time=1000){
layer.msg(msg,{
......
......@@ -140,7 +140,7 @@
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
<span class="x-red">*</span>账单凭证
<span class="x-red">*</span>抄表凭证
</label>
<div class="layui-input-inline">
<button type="button" class="layui-btn" id="up_photo">
......@@ -239,7 +239,6 @@
laydate.render({
elem:'#current_date',
value:new Date(),
trigger:'click',
})
......@@ -267,9 +266,10 @@
//上传电表照片
var upPhoto = upload.render({
elem: '#up_photo' ,
url: '/up_photo',
field: 'cp_photo',
elem: '#up_photo' ,
url: '/upFile',
field: 'up_file',
accept: 'file',
done: function (res) {
if(res.status == 1){
layMsg(res.message)
......
差异被折叠。
......@@ -146,6 +146,8 @@ 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');
Route::post('upFile','em/UploadFile/upFile');
//账单
Route::get('invoice','em/invoice/index');
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论