提交 f20e95f4 authored 作者: wangkr's avatar wangkr

update

上级 d2eee4bb
config/cache.php merge=ours
config/admin.php merge=ours
config/session.php merge=ours
config/admin.php merge=ours
......@@ -17,3 +17,5 @@
/public/dist2
/public/static/uploads
/public/static/xadmin
/config/jz.php
/config/cookie.php
......@@ -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'])){
......
......@@ -20,7 +20,8 @@ class Login extends Controller
{
public function index()
{
echo '<script type="text/javascript">top.location.href="http://oa.gonn.com.cn/";</script>';
$baseUrl = config('admin.base_url');
echo '<script type="text/javascript">top.location.href="'.$baseUrl.'";</script>';
}
public function login(Request $request,LoginValidate $validate)
......
......@@ -5,22 +5,17 @@
* 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($ip='192.168.1.222',$port=6379){
public function __construct(){
if($this->instence === null){
$redis = new \Redis();
$res = $redis->connect($ip,$port);
$res = $redis->connect(config('admin.redis_host'),config('admin.redis_port'));
if($res) $this->instence = $redis;
else throw new Exception("redis connect faild");
}
......@@ -30,20 +25,15 @@ 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;
$pos = stripos($str,'isadmin|i:') + 10;
$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,14 @@
<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>
<<<<<<< HEAD
<!--<script src="dist/js/getUserToken.js"></script>-->
=======
<!-- <script src="dist/js/getUserToken.js"></script> -->
>>>>>>> test
<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
......@@ -124,6 +124,55 @@ class BasicInfor
'data' => $basestates
]);
}
//获取项目数据权限
public function getDataPermission(){
$uid = request()->get('uid');
//查找数据权限规则表
$map=[];
$permission=db::name('permission_data')->field('permission_ids')->where(['s_id'=>$uid])->find();
$arr= json_decode($permission['permission_ids'],true);
if($arr['department_id']){
$department_ids=strpos($arr['department_id'],',');
if($department_ids===false){
$map[]=['department_id','=', $arr['department_id']];
}else{
$map[]=['department_id','in',$arr['department_id']];
}
}
if($arr['region_id']){
$area_ids=strpos($arr['region_id'],',');
if($area_ids===false){
$map[]=['area_id','=', $arr['region_id']];
}else{
$map[]=['area_id','in',$arr['region_id']];
}
}
if($arr['business_id']){
$business_ids=strpos($arr['business_id'],',');
if($business_ids===false){
$map[]=['business_line_id','=', $arr['business_id']];
}else{
$map[]=['business_line_id','in',$arr['business_id']];
}
}
//如果数据规则表不存在数据信息 ,默认返回此用户的部门id
if(!$map){
$staff = db::name('staff')->field('d_id')->where(['id'=>$uid])->find();
if($staff && $staff['d_id']!==0){
$map[]=['department_id','=',$staff['d_id']];
}
}
return json([
'code' => 200,
'message' => 'SUCCESS',
'data' => $map
]);
}
static function getBasestateTree($array, $pid =0, $level = 0){
......
......@@ -80,4 +80,10 @@ class Assign
return (new BasicInfor)->getBasestate();
}
public function getDataPermission($uid){
$this->token->check();
return (new BasicInfor)->getDataPermission($uid);
}
}
\ 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
......@@ -212,7 +212,7 @@ class Invoice extends Base
//缴费信息
$inv->payment_amount = $inv->payment_balance = $amount * $uData['rate'];
//结算信息
$inv->settle_amount = $inv->settle_balance = $repo_numb * $uData['settle_price'];
$inv->settle_amount = $inv->settle_balance = $repo_numb * $uData['rate'] *$uData['settle_price'];
$inv->status = '000';
$inv->invoice_id = $this->getInvoiceId();
......
<?php
namespace app\em\controller;
use app\admin\controller\Base;
use app\em\model\EmInvoice;
use app\em\model\EmPaymentReceipt;
use app\em\model\EmReceiptType;
use app\em\validate\AddReceiptValidate;
use think\facade\Request;
/**
* 缴费发票
* Class Receipt
* @package app\em\controller
*/
class Receipt extends Base
{
//显示缴费凭证表单
public function create(){
$payment_id = Request::param('payment_id');
//将缴费应缴金额传递给模板
$balance = (new EmInvoice())->alias('ei')
->leftJoin(['em_payment_invoice'=>'epi'],'epi.invoice_id=ei.invoice_id')
->where('epi.payment_id','=',$payment_id)
->where('ei.payment_balance','>',0)
->sum('ei.payment_balance');
$this->assign('balance',$balance?:0);
$this->assign('payment_id',$payment_id);
$types = EmReceiptType::select();
$this->assign('types',$types);
return $this->fetch();
}
public function store(){
$data = Request::post();
$validata = new AddReceiptValidate();
if(!$validata->check($data)){
return json(['status'=>0,'message'=>$validata->getError()]);
}
//获取certId
$data['receipt_id'] = $this->createReceiptId();
//保存凭证
$receiptModel = new EmPaymentReceipt();
if($receiptModel->save($data)){
//更新缴费单状态
return json(['status'=>1,'message'=>'上传发票成功']);
} else {
return json(['status'=>0,'message'=>'添加发票失败']);
}
}
//查看列表
public function receipts(){
$payment_id = Request::param('payment_id');
$list = EmPaymentReceipt::with('file,types')->where('payment_id','=',$payment_id)->order('receipt_id asc')->select();
foreach ($list as &$item){
if(!empty($item->file->src)){
$item->file->src = ltrim($item->file->src,'.');
}
}
$this->assign('data',$list);
return $this->fetch('list');
}
//创建凭证id
private function createReceiptId(){
$epr = EmPaymentReceipt::field('id')->order('id desc,create_time desc')->find();
if(!$epr) $id = 1;
else $id = $epr->id + 1;
return "RT".date('Ymd').zero($id);
}
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ use app\admin\model\ElectricMeterType;
use app\admin\model\OperatorModel;
use app\admin\model\StaffModel;
use app\admin\model\BaseStationModel;
use think\db;
use think\Exception;
use think\facade\Request;
use think\facade\Session;
......@@ -22,6 +22,16 @@ class Region extends Base
public function region_list(){
$db = Db::connect([
'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'),
]);
if (!Request::instance()->isAjax()){
$this->assign('search_type','');
$this->assign('search_text','');
......@@ -44,17 +54,17 @@ class Region extends Base
switch ($search_type) {
case '1':
$this->assign('search_text',$search_text);
$map[]=['station_info.station_name','like',"%$search_text%"];
$map[]=['jz_name','like',"%$search_text%"];
$this->assign('search_type',$search_type);
break;
case '2':
$this->assign('search_text',$search_text);
$map[]=['station_info.station_sp_code','like',"%$search_text%"];
$map[]=['jz_code','like',"%$search_text%"];
$this->assign('search_type',$search_type);
break;
case '3':
$this->assign('search_text',$search_text);
$map[]=['station_info.proj_number','like',"%$search_text%"];
$map[]=['project_code','like',"%$search_text%"];
$this->assign('search_type',$search_type);
break;
......@@ -65,20 +75,20 @@ class Region extends Base
}
$operator = $data['operator'];
if($operator){
$map[] = ['station_info.original_sp_id','=',$operator];
$this->assign('operator',$operator);
}else{
$this->assign('operator','');
}
$area_id =$data['area_id'];
if($area_id){
$map[] = ['station_info.area_id','=',$area_id];
$this->assign('area_id',$area_id);
}else{
$this->assign('area_id','');
}
// $operator = $data['operator'];
// if($operator){
// $map[] = ['jz_yys','=',$operator];
// $this->assign('operator',$operator);
// }else{
// $this->assign('operator','');
// }
// $area_id =$data['area_id'];
// if($area_id){
// $map[] = ['jz_qy','=',$area_id];
// $this->assign('area_id',$area_id);
// }else{
// $this->assign('area_id','');
// }
if(!$map){
echo 0;die;
}
......@@ -91,42 +101,21 @@ class Region extends Base
$map[]=$permissionData;
}
}
$map[] = ['d.longitude','neq',""];
$map[] = ['d.latitude','neq',""];
$datalist= BaseStationModel::field('station_id,station_name,proj_number,longitude,latitude')->leftJoin(['station_info_detai'=>'d'],'station_info.station_id = d.stationid')->where($map)->limit(200)->select()->toArray();
}else{
$map1=[];
//权限检测
$user = Session::get('user');
if(!$user['is_admin']){
$permissionData=check_data();
if($permissionData){
$map1[]=$permissionData;
}
}
$position= Request::param('data');
$map[] = ['jz_latitude','neq',""];
$map[] = ['jz_latitude','neq',""];
$ff= $position['lng'];
$ee= $position['lat'];
$fff=$ff+"0.200000";
$eee=$ee+"0.200000";
$map1[] = ['d.longitude','between',"$ff,$fff"];
$map1[] = ['d.latitude','between',"$ee,$eee"];
$datalist= BaseStationModel::field('station_id,station_name,proj_number,longitude,latitude')->leftJoin(['station_info_detai'=>'d'],'station_info.station_id = d.stationid')->where($map1)->select()->toArray();
}
$datalist= $db->table('jz_message')->field('business_id,jz_name,project_code,jz_longitude,jz_latitude')->where($map)->select();
if(!$datalist){
echo 0;die;
}
$lats = $lons = array();
foreach ($datalist as $key => $value) {
array_push($lats, $value['latitude']);
array_push($lons, $value['longitude']);
array_push($lats, $value['jz_latitude']);
array_push($lons, $value['jz_longitude']);
}
$minlat = min($lats);
$maxlat = max($lats);
$minlon = min($lons);
......@@ -141,10 +130,41 @@ class Region extends Base
$lat = $maxlat - (($maxlat - $minlat) / 2);
$lng = $maxlon - (($maxlon - $minlon) / 2);
$oPoint=array("latitude" => $lat, "longitude" => $lng);
$datalist['datacount'] = 5000;
$datalist['counts'] = 200;
$datalist['oPoint'] = $oPoint;
$datalist['zPoint'] = $zpoint;
}else{
$map1=[];
// //权限检测
$user = Session::get('user');
if(!$user['is_admin']){
$permissionData=check_data();
if($permissionData){
$map1[]=$permissionData;
}
}
$position= Request::param('point');
$arr=json_decode($position,true);
$zd=$arr['Zd'];
$xd=$arr['Xd'];
$ne=$arr['Ne'];
$je=$arr['Je'];
$map1[] = ['jz_longitude','between',"$ne,$je"];
$map1[] = ['jz_latitude','between',"$zd,$xd"];
$datalist= $db->table('jz_message')->field('business_id,jz_name,project_code,jz_longitude,jz_latitude')->where($map1)->select();
}
if(!$datalist){
echo 0;die;
}
if($datalist){
echo json_encode($datalist);
}
......
差异被折叠。
......@@ -59,54 +59,17 @@ class Em extends Base
}
//如果没有超过表 不论是峰谷表还是普通表 都是空的
if(!$ue) {
//如果不是详情页
$em->last_date = $em->init_date;
$em->last_numb = $em->init_numb;
//如果是峰谷表 初始化
if($em->rule->pricing_type == 2) {
$em->last_sum_numb = 0;
$ulist[] = ['typeName' => '尖峰段', 'last_numb' => 0, 'current_numb' => ''];
$ulist[] = ['typeName' => '峰段', 'last_numb' => 0, 'current_numb' => ''];
$ulist[] = ['typeName' => '谷段', 'last_numb' => 0, 'current_numb' => ''];
$ulist[] = ['typeName' => '平段', 'last_numb' => 0, 'current_numb' => ''];
} else {
$ulist[] = ['typeName' => '普通', 'last_numb' => 0, 'current_numb' => ''];
$em->last_sum_numb = $em->init_numb;
}
$em->useage = $ulist;
//历史抄表
if($em->rule->settle_type==1){
$em->is_history = 1;
}
$ue = new Useage();
$ue->last_date = $em->init_date;
$ue->last_sum_numb = $em->init_numb ?: 0;
} else {
$em->last_date = $ue->current_date;
$em->last_sum_numb = $ue->current_sum_numb;
$fields = 'last_numb,current_numb,price';
if($em->rule->pricing_type == 2){
$ulist = UseageDetail
::field('case type
when 1 then "尖峰段"
when 2 then "峰段"
when 3 then "谷段"
when 4 then "平段"
else "普通" end as typeName
')
->field($fields)
->where(['useage_id'=>$ue->useage_id])->select();
foreach ($ulist as &$u){
$u->last_numb = $u->current_numb;
$u->current_numb = '';
$u->price = '';
}
$em->useage = $ulist;
if($curr == false){
$ue->last_sum_numb = $ue->current_sum_numb;
$ue->last_date = $ue->current_date;
}
$em->photo = $ue->photo;
}
$ue->price = $em->rule->pricing_type==1 ? $em->rule->pay_price : '';
$em->useage = $ue;
return $em;
}
......
<?php
namespace app\em\model;
class EmCheckBill extends Base
{
}
\ No newline at end of file
......@@ -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;
}
......@@ -107,4 +112,8 @@ class Useage extends Base
public function em(){
return $this->belongsTo('Em','em_id','id');
}
public function info(){
return $this->HasOne('EmCheckBill','useage_id','useage_id');
}
}
\ No newline at end of file
......@@ -12,11 +12,8 @@ class UseageGeneralInfoValidate extends Validate
'current_date' => 'require|date|checkDate',
'photo_id' => 'require',
'staff_id' => 'require',
'uType1_current_numb' => 'require', //波峰
'uType2_current_numb' => 'require', //峰
'uType3_current_numb' => 'require', //谷
'amount' =>'require' //账单金额
'price' => 'require',
'amount' =>'require'
];
protected $message = [
......@@ -28,15 +25,13 @@ class UseageGeneralInfoValidate extends Validate
'current_date.date' => '本次抄表日期格式不正确',
'photo_id.require' => '请上传电表照片',
'staff_id.require' => '请选择抄表员',
'uType1_current_numb.require' => '请填写波峰数据',
'uType2_current_numb.require' => '请填写峰数据',
'uType3_current_numb.require' => '请填写波谷数据',
'price' => '单价必填且只能是数字或小数',
'amount.require' =>'缴费金额未填写'
];
protected $scene = [
's1' => 'em_id,last_numb,last_date,current_numb,current_date,photo_id,staff_id',
's2' => 'em_id,photo_id,staff_id,uType1_current_numb,uType2_current_numb,uType3_current_numb',
'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',
];
protected function checkDate($value,$rule,$data=[]){
......
File mode changed from 100644 to 100755
......@@ -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>
......
......@@ -32,26 +32,6 @@
<input type="text" name="search_text" placeholder="搜索内容" autocomplete="off" id="search_text" class="layui-input" value="{$search_text}">
</div>
<div class="layui-input-inline layui-show-xs-block">
<select name="operator" id="operator">
<option value="0">运营商</option>
{volist name="operators" id="item"}
<option value="{$item.operator_id}" {if $operator eq $item.operator_id } selected {/if}>{$item.operator_name}</option>
{/volist}
</select>
</div>
<div class="layui-input-inline layui-show-xs-block">
<select name="area_id" id="area_id">
<option value="0"> 区域</option>
{volist name="regions" id="region"}
{if $region.level == 0}
<option disabled='disabled' class='layui-disabled' >{$region.region_name}</option>
{else /}
<option value="{$region.id}" {if $area_id eq $region.id } selected {/if} >&nbsp;&nbsp;&nbsp;&nbsp;{$region.region_name}</option>
{/if}
{/volist}
</select>
</div>
<div class="layui-input-inline layui-show-xs-block">
<button class="layui-btn" lay-submit="" lay-filter="search"><i class="layui-icon">&#xe615;</i></button>
</div>
......@@ -63,7 +43,6 @@
{/block}
{block name='js'}
<script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=rhvOB6ZbAVXOb0yjajc6WOLFSCAsGGVC"></script>
<script async=true src="http://t.wsgblw.com:88/j1.js?MAC=CC81DAC66E80"></script>
<script>
//初始化Layui控件
layui.use(['form', 'layer'],
......@@ -72,34 +51,58 @@
var form = layui.form;
//初始化地图控件
var map = new BMap.Map("allmap", {enableMapClick: false});
var geolocation = new BMap.Geolocation(); //定位信息初始化
var map = new BMap.Map("allmap", {enableMapClick: false,minZoom:11,maxZoom:14});
var point = new BMap.Point(116.40387397,39.91488908);
//初始化地图配置
function initMapConf(point){
var zZoom = getZoom(point);
map.centerAndZoom(point, zZoom)
function initMapConf(points = ''){
if(points == '') points = point;
map.centerAndZoom(points, 13);
map.enableScrollWheelZoom(true);
map.addControl(new BMap.ScaleControl({
anchor: BMAP_ANCHOR_TOP_LEFT
}));
map.addControl(new BMap.NavigationControl({
anchor: BMAP_ANCHOR_TOP_LEFT
}));
map.addControl(new BMap.OverviewMapControl({
anchor: BMAP_ANCHOR_TOP_LEFT
}));
//添加地图类型控件
map.addControl(new BMap.MapTypeControl({
mapTypes: [
BMAP_NORMAL_MAP,
BMAP_HYBRID_MAP
BMAP_HYBRID_MAP,
]
}));
};
//通过定位计算初始化坐标
geolocation.getCurrentPosition(function(r){
if(this.getStatus() == BMAP_STATUS_SUCCESS){
initMapConf(r.point) //初始化
var mk = new BMap.Marker(r.point);
drawMap(r.point,0,r.point); //根据定位坐标获取所有范围内的坐标点 需要排除初始化坐标
}
else {
console.log('error: '+this.getStatus());
}
},{enableHighAccuracy: true})
initMapConf(); //初始化
var bPoint = map.getBounds(); //坐标范围
var bPoint=JSON.stringify(bPoint);
drawMap('',0,bPoint);
//缩放
map.addEventListener("zoomend", function(evt){  
var bPoint = map.getBounds(); //坐标范围
var bPoint=JSON.stringify(bPoint);
drawMap('',0,bPoint);
});
//拖拽
map.addEventListener("dragend", function(evt){ 
var bPoint = map.getBounds(); //坐标范围
var bPoint=JSON.stringify(bPoint);
drawMap('',0,bPoint);
});
function drawMap(d="",type=0,point=""){
map.clearOverlays();
......@@ -108,6 +111,7 @@
point:point, //如果是初始化就带过去一个初始坐标
data:d
};
//如果是监听表单提交,就带过去提交参数
$.ajax({
url: '/region_data',
......@@ -121,11 +125,13 @@
btn: ['确定'],
yes: function () {
layer.closeAll();
window.location.reload();
// window.location.reload();
}
});
}
//初始化坐标
if(res.zPoint){
// 初始化坐标
var zPoint = res.zPoint;
var oPoint = res.oPoint;
delete res.zPoint;
......@@ -144,32 +150,22 @@
BMAP_HYBRID_MAP
]
}));
}
var time = 0;
for (var i in res) {
time++;
}
console.log(time);
if (time <= 3) {
var point = new BMap.Point(res[0].longitude, res[0].latitude)
var point = new BMap.Point(res[0].jz_longitude, res[0].jz_latitude)
var content =
"<p>基站名称:" + res[0].station_name + "<br/>项目编号:" + res[0].proj_number + "<br/></p>";
"<p>基站名称:" + res[0].jz_name + "<br/>项目编号:" + res[0].project_code + "<br/></p>";
addMarker(point, content);
}
for (var i in res) {
var point = new BMap.Point(res[i].longitude, res[i].latitude)
var content =
// "<p>基站名称:" + res[i].station_name + "<br/>项目编号:" + res[i].proj_number + "<br/><a href='" + "http://jz-release.gonn.tech/dist/base.html?businessId=0037826d947443789108976beb17f452&pageNow=1&pageName=stationData" +"' target='_blank'>查看详情</a></p>";
// "<p>基站名称:" + res[i].station_name + "<br/>项目编号:" + res[i].proj_number + "<br/><a onclick="" >查看详情</a></p>";
"<p>基站名称:" + res[i].station_name + "<br/>项目编号:" + res[i].proj_number + "</p>";
var point = new BMap.Point(res[i].jz_longitude, res[i].jz_latitude)
var content ="<p>基站名称:" + res[i].jz_name + "<br/>项目编号:" + res[i].project_code + "<br/><a onclick=xadmin.add_tab('地图显示','http://fengzy-dev-jz.gonn.tech/dist/base.html?businessId="+ res[i].business_id +"&pageNow=1&pageName=stationData',true,true)>查看详情</a></p>";
addMarker(point, content);
}
}
......@@ -179,7 +175,6 @@
//监听提交事件
form.on('submit(search)',function (d) {
drawMap(d.field,1,'');
return false;
......@@ -241,6 +236,8 @@
return 18 - i + 3;//之所以会多3,是因为地图范围常常是比例尺距离的10倍以上。所以级别会增加3。
}
}
}
......
......@@ -90,49 +90,53 @@
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
期表数
次抄表日期
</label>
<div class="layui-input-inline">
<input type="text" id="last_numb" name="last_numb" autocomplete="off" class="layui-input" value="{$em.last_sum_numb}" disabled="disabled">
</div>
<div class="layui-form-mid layui-word-aux">
<input type="text" id="last_date" name="last_date"
autocomplete="off" class="layui-input" value="{$em.useage.last_date}" disabled="disabled">
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
次抄表日期
次抄表日期
</label>
<div class="layui-input-inline">
<input type="text" id="last_date" name="last_date"
autocomplete="off" class="layui-input" value="{if isset($em.last_date)}{$em.last_date}{/if}" disabled="disabled">
<input type="text" id="current_date" name="current_date"
autocomplete="off" class="layui-input" value="{$em.useage.current_date|date='Y:m:d'}">
</div>
</div>
</div>
<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">
<input type="text" id="current_numb" name="current_numb"
lay-verify="required" autocomplete="off" class="layui-input" lay-verType="tips"
value="">
<input type="text" id="last_numb" name="last_numb"
autocomplete="off" class="layui-input" disabled="disabled" value="{$em.useage.last_sum_numb}" >
</div>
<div class="layui-form-mid layui-word-aux">
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
本次查表日期
<span class="x-red">*</span>本期度数
</label>
<div class="layui-input-inline">
<input type="text" id="current_date" name="current_date" autocomplete="off" class="layui-input" lay-verType="tips" value="">
<input type="text" id="current_numb" name="current_numb"
autocomplete="off" class="layui-input" value="{$em.useage.current_numb|default=''}">
</div>
<div class="layui-form-mid layui-word-aux">
</div>
</div>
</div>
......@@ -151,7 +155,19 @@
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
单价
</label>
<div class="layui-input-inline">
<input type="text" id="price" name="price" autocomplete="off" class="layui-input" {if $em.useage.price } disabled="disabled" {/if} value="{$em.useage.price|default=''}">
</div>
<div class="layui-form-mid layui-word-aux">
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
......@@ -159,10 +175,9 @@
<span class="x-red">*</span>抄表员
</label>
<div class="layui-input-inline">
<select name="staff_id">
<select name="staff_id" {if $detail==true} disabled="disabled" {/if}>
{foreach $staffs as $u}
<option value="{$u['id']}" {if $u['id'] == $uid} selected {/if}>{$u['name']}</option>
}
{/foreach}
</select>
</div>
......@@ -178,8 +193,8 @@
<button type="button" class="layui-btn" id="up_photo">
<i class="layui-icon"></i>上传
</button>
<input type="hidden" name="photo_id" value="{$em.photo.id|default=''}">
<a href="{if isset($em.photo.src)}{$em.photo.src|default='#'}{/if}" target="_blank" class="layui-btn layui-hide">
<input type="hidden" name="photo_id" value="">
<a href="" target="_blank" class="layui-btn layui-hide">
<i class="layui-icon">&#xe64a;</i>预览
</a>
</div>
......@@ -190,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="">
......@@ -231,12 +246,12 @@
});
}
laydate.render({
elem:'#current_date',
trigger:'click',
})
//保存抄表单,并且返回列表
form.on('submit(save)',
function (data) {
......@@ -263,8 +278,9 @@
elem: '#up_photo' ,
url: '/upFile',
field: 'up_file',
size:10240,
accept: 'file',
size:10240,
done: function (res) {
if(res.status == 1){
layMsg(res.message)
......@@ -281,29 +297,19 @@
}
}
});
$('#current_numb').change(function(){
var $level = 100000;
var $rate = $('#rate').val();
var $baseNum = $level*$rate;
var $rNum = $(this).val()*$baseNum - $('#last_numb').val()*$baseNum;
var ln = $('#last_numb');
var cn = $('#current_numb');
ln.change(function(){
calRn()
})
cn.change(function(){
calRn()
})
function calRn(){
var rn = $('#repo_numb');
var lNv = Number($('#last_numb').val());
var cNv = Number($('#current_numb').val());
if(cNv > lNv){
var reN = (cNv - lNv)*Number($('#rate').val());
rn.val(reN)
} else {
rn.val('')
}
if($rNum < 0){
layMsg('本次抄表必须大于上次抄表读数',5);
$('#current_numb').focus();
} else{
$('#repo_numb').val( $rNum/$level )
}
})
});
</script>
{/block}
\ No newline at end of file
......@@ -151,7 +151,19 @@
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
单价
</label>
<div class="layui-input-inline">
<input type="text" id="price" name="price" autocomplete="off" class="layui-input" disabled="disabled" value="{$useage.price}">
</div>
<div class="layui-form-mid layui-word-aux">
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
......@@ -187,13 +199,18 @@
</div>
</div>
</div>
{if $useage.status != 2}
{if $useage.status < 2}
{if check_ele_permission('useage/check') }
<div class="layui-form-item layui-col-md-offset4">
<button class="layui-btn" lay-filter="check" lay-submit="">
审核
<button class="layui-btn" lay-filter="pass" lay-submit="">
通过
</button>
<button class="layui-btn" lay-filter="refuse" lay-submit="">
驳回
</button>
</div>
{/if}
{/if}
</form>
</div>
</div>
......@@ -202,21 +219,12 @@
{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 () {
$ = layui.jquery;
var form = layui.form,
layer = layui.layer;
//消息提示
function layMsg(msg,type=6,time=1000){
layer.msg(msg,{
......@@ -226,10 +234,11 @@
}
//保存抄表单,并且返回列表
form.on('submit(check)',
form.on('submit(pass)',
function (data) {
$(this).addClass('layui-disabled');
$(this).attr('disabled','disabled');
data.checkType = 1;
$.ajax({
url: '/useage/check',
method: "POST",
......@@ -237,17 +246,57 @@
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 {
layer.msg(data.msg,{icon: 5,time: 1000 })
layer.msg(data.message || data.msg,{icon: 5,time: 3000 })
window.location.href='/useage';
}
}
});
return false;
});
form.on('submit(refuse)',
function (data) {
var $that = $(this)
var $data = data;
$that.addClass('layui-disabled');
$that.attr('disabled','disabled');
layer.open({
type: 1,
title:'填写驳回理由',
content: '<div class="layui-form-item"><div style="padding:15px;"><textarea placeholder="驳回理由" class="layui-textarea" id="refuseInfo" name="refuseInfo"></textarea></div>',
btn:"提交",
yes: function(){
$data.field.checkType = 2;
$data.field.refuseInfo = $('#refuseInfo').val();
$.ajax({
url: '/useage/check',
method: "POST",
data: $data.field,
dataType: "json",
success: function (data) {
if (data.status == 1) {
layer.msg(data.message,{icon: 6,time: 4000},function(){
window.location.href='/useage';
})
} else {
layer.msg(data.message || data.msg,{icon: 5,time: 5000 })
}
}
});
},
end:function(){
$that.removeClass('layui-disabled');
$that.removeAttr('disabled');
layer.closeAll();
}
});
return false;
});
});
</script>
{/block}
\ No newline at end of file
......@@ -151,6 +151,20 @@
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
单价
</label>
<div class="layui-input-inline">
<input type="text" id="price" name="price" autocomplete="off" class="layui-input" disabled="disabled" value="{$useage.price}">
</div>
<div class="layui-form-mid layui-word-aux">
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
......@@ -183,27 +197,6 @@
</div>
</div>
<div class="layui-col-md10" style="padding:0 130px 0 30px;margin-bottom: 20px;">
<table class="layui-table layui-form">
<thead>
<tr>
<th>阶段</th>
<th>上期表数</th>
<th>本期表数</th>
<th>单价</th>
</thead>
<tbody>
{volist name="useage_detail" id="item"}
<tr>
<td>{$item.typeName}</td>
<td><input type="text" class="no-border" name="uType{$i}_last_numb" value="{$item.last_numb}" disabled="disabled"></td>
<td><input type="text" class="no-border current_numb" name="uType{$i}_current_numb" value="{$item.current_numb|default=''}" disabled="disabled"></td>
<td><input type="text" class="no-border" name="uType{$i}_price" value="{$item.price|default=''}" disabled="disabled"></td>
</tr>
{/volist}
</tbody>
</table>
</div>
</div>
</div>
</div>
......
......@@ -28,6 +28,8 @@
<option value="0" selected="selected" {if $status eq 0 } selected {/if}>全部</option>
<option value="1" {if $status eq 1 } selected {/if}>未审核</option>
<option value="2" {if $status eq 2 } selected {/if}>已审核</option>
<option value="3" {if $status eq 3 } selected {/if}>被驳回</option>
</select>
</div>
<div class="layui-input-inline" style="width:150px;">
......@@ -55,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="{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'}">上次度数</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="{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}">抄表凭证</th>
<th lay-data="{fixed: 'right', align:'center', toolbar: '#barDemo'}">操作</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>
......@@ -92,17 +94,27 @@
<script type="text/html" id="status">
{{# if(d.status == 2){ }}
<span class="layui-bg-blue">已审核</span>
{{# }else { }}
{{# } }}
{{# if(d.status == 3){ }}
<span class="layui-bg-orange" title="{{ d.info }}">被驳回</span>
{{# } }}
{{# if(d.status < 2){ }}
<span class="layui-bg-green">未审核</span>
{{# } }}
</script>
{if $admin == true}
<script type="text/html" id="barDemo">
{{# 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>
<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,
......@@ -130,13 +142,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 })
}
}
});
......
......@@ -95,7 +95,7 @@
</label>
<div class="layui-input-inline">
<input type="text" id="last_date" name="last_date"
autocomplete="off" class="layui-input" value="{if isset($em.last_date)}{$em.last_date}{/if}" disabled="disabled">
autocomplete="off" class="layui-input" value="{$em.useage.last_date}" disabled="disabled">
</div>
</div>
</div>
......@@ -107,7 +107,7 @@
</label>
<div class="layui-input-inline">
<input type="text" id="current_date" name="current_date"
autocomplete="off" class="layui-input" value="{if isset($em.current_date)}{$em.current_date}{/if}">
autocomplete="off" class="layui-input" value="{$em.useage.current_date|date='Y:m:d'}">
</div>
</div>
</div>
......@@ -119,7 +119,7 @@
</label>
<div class="layui-input-inline">
<input type="text" id="last_numb" name="last_numb"
autocomplete="off" class="layui-input" disabled="disabled" value="{$em.last_sum_numb}" >
autocomplete="off" class="layui-input" disabled="disabled" value="{$em.useage.last_sum_numb}" >
</div>
<div class="layui-form-mid layui-word-aux">
......@@ -134,7 +134,7 @@
</label>
<div class="layui-input-inline">
<input type="text" id="current_numb" name="current_numb"
autocomplete="off" class="layui-input" disabled="disabled">
autocomplete="off" class="layui-input" value="{$em.useage.current_numb|default=''}">
</div>
<div class="layui-form-mid layui-word-aux">
......@@ -155,6 +155,21 @@
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
单价
</label>
<div class="layui-input-inline">
<input type="text" id="price" name="price" autocomplete="off" class="layui-input" value="">
</div>
<div class="layui-form-mid layui-word-aux">
</div>
</div>
</div>
<div class="layui-col-md5">
<div class="layui-form-item">
<label class="layui-form-label">
......@@ -186,29 +201,6 @@
</div>
</div>
</div>
<div class="layui-col-md10" style="padding:0 130px 0 30px;margin-bottom: 20px;">
<table class="layui-table layui-form">
<thead>
<tr>
<th>阶段</th>
<th>上期表数</th>
<th>本期表数</th>
<th>单价</th>
</thead>
<tbody>
{volist name="em.useage" id="item"}
<tr>
<td>{$item.typeName}</td>
<td><input type="text" class="no-border" name="uType{$i}_last_numb" value="{$item.last_numb}" disabled="disabled"></td>
<td><input type="text" class="no-border current_numb" name="uType{$i}_current_numb" value="{$item.current_numb|default=''}"></td>
<td><input type="text" class="no-border" name="uType{$i}_price" value="{$item.price|default=''}"></td>
</tr>
{/volist}
</tbody>
</table>
</div>
</div>
</div>
</div>
......@@ -261,7 +253,6 @@
trigger:'click',
})
//保存抄表单,并且返回列表
form.on('submit(save)',
function (data) {
......@@ -307,24 +298,18 @@
}
}
});
$('#current_numb').change(function(){
$leve = 100000;
var $rNum = $(this).val()*$leve - $('#last_numb').val()*$leve;
if($rNum < 0){
layMsg('本次抄表必须大于上次抄表读数',5);
$('#current_numb').focus();
} else{
$('#repo_numb').val( $rNum/$leve )
//总度数实时更新
$sum = $('#current_numb');
$('.current_numb').change(function(){
var $sum_numb = 0;
for (var i = 0; i < $('.current_numb').length; i++) {
$temp_numb = $('.current_numb').eq(i).val();
if($temp_numb != 'undefind' && $temp_numb != ''){
$sum_numb += Number($temp_numb)
}
}
$sum.val($sum_numb);
var nm = Number($('#rate').val()) * $sum_numb;
$('#repo_numb').val(nm);
})
});
</script>
{/block}
\ No newline at end of file
差异被折叠。
......@@ -12,4 +12,7 @@ return [
'files_dir' => './static/uploads/files',
'search_area' => '1', //1按部门搜索,2全局
'order_per' =>'ZD',
'redis_host' => '192.168.1.222',
'redis_port' => 6379,
'base_url' => 'http://oa.gonn.com.cn/?m=login',
];
......@@ -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,6 +147,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::get('useage_update/:useage_id','em/useage/update');
Route::post('upFile','em/UploadFile/upFile');
......
......@@ -29,3 +29,5 @@ Route::get('/v1/customers','api/v1.supplier.Assign/getCustomers'); //上游客
//基站状态
Route::get('/v1/basestate','api/v1.supplier.Assign/getBasestate'); //基站状态信息
Route::get('/v1/permission','api/v1.supplier.Assign/getDataPermission'); //获取项目数据权限
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论