Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
Jz-Php
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
PHP
Jz-Php
Commits
4e77c807
提交
4e77c807
authored
4月 28, 2020
作者:
chengye
提交者:
wangkr
4月 29, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成抄表的驳回,修改操作
上级
4025d265
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
69 行增加
和
37 行删除
+69
-37
Useage.php
application/em/controller/Useage.php
+47
-13
Useage.php
application/em/model/Useage.php
+6
-1
UseageGeneralInfoValidate.php
application/em/validate/UseageGeneralInfoValidate.php
+1
-1
default.html
application/em/view/useage/default.html
+1
-1
detail.html
application/em/view/useage/detail.html
+5
-13
index.html
application/em/view/useage/index.html
+8
-7
update.html
application/em/view/useage/update.html
+0
-0
admin.php
route/admin.php
+1
-1
没有找到文件。
application/em/controller/Useage.php
浏览文件 @
4e77c807
...
...
@@ -119,11 +119,35 @@ 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
=
''
){
public
function
store
(){
//获取表单数据
$data
=
Request
::
post
();
$useage_id
=
isset
(
$data
[
'useage_id'
])
?
$data
[
'useage_id'
]
:
''
;
$action
=
'新增'
;
//数据验证
$validate
=
new
UseageGeneralInfoValidate
();
...
...
@@ -149,6 +173,7 @@ class Useage extends Base
$this
->
checkEnd
(
$useage_id
);
$action
=
'修改'
;
$uModel
=
(
new
\app\em\model\Useage
())
->
get
([
'useage_id'
=>
$useage_id
]);
$uModel
->
status
=
1
;
}
//更新
$uModel
->
staff_id
=
$data
[
'staff_id'
];
...
...
@@ -162,13 +187,14 @@ class Useage extends Base
if
(
empty
(
$useage_id
)){
$udModel
=
new
UseageDetail
();
//抄表详情模型
$udModel
->
type
=
$data
[
'type'
]
==
1
?
5
:
6
;
$uModel
->
current_numb
=
$data
[
'current_numb'
];
$uModel
->
last_numb
=
$data
[
'last_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
=
(
new
UseageDetail
())
->
get
([
'useage_id'
=>
$useage_id
]);
//抄表详情模型
}
$udModel
->
current_numb
=
$
data
[
'current_numb'
]
;
$udModel
->
current_numb
=
$
uModel
->
current_sum_numb
;
$udModel
->
price
=
$uModel
->
price
;
$udModel
->
save
();
...
...
@@ -188,6 +214,8 @@ class Useage extends Base
$checkType
=
Request
::
param
(
'checkType'
);
$this
->
verify
(
$useage_id
,
$checkType
);
//1是通过 2是驳回
if
(
$checkType
==
2
)
{
$res
=
$this
->
checkEnd
(
$useage_id
);
if
(
$res
!==
true
)
return
$res
;
$useage
->
status
=
3
;
//3代表被驳回
$useage
->
save
();
return
json
([
'status'
=>
1
,
'message'
=>
'单据已经驳回'
]);
...
...
@@ -249,15 +277,20 @@ class Useage extends Base
public
function
del
(){
$useage_id
=
Request
::
param
(
'uid'
);
$this
->
checkEnd
(
$useage_id
);
$res
=
$this
->
checkEnd
(
$useage_id
);
if
(
$res
!==
true
)
return
$res
;
$useage
=
(
new
\app\em\model\Useage
())
->
get
([
'useage_id'
=>
$useage_id
]);
$useage_details
=
(
new
UseageDetail
())
->
select
([
'useage_id'
=>
$useage_id
]);
Db
::
startTrans
();
try
{
$useage
->
delete
();
$useage_details
->
delete
();
if
(
!
empty
(
$useage_details
)){
foreach
(
$useage_details
as
$u
){
$u
->
delete
();
}
}
Db
::
commit
();
return
json
([
'status'
=>
1
,
'message'
=>
"删除单据成功"
]);
}
catch
(
\Exception
$e
)
{
...
...
@@ -278,15 +311,16 @@ class Useage extends Base
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'
=>
"已审核过的单据无法
编辑
,请联系管理员"
]);
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
(
$lastModel
->
status
==
2
)
return
json
([
'status'
=>
0
,
'message'
=>
"单号不是最新的抄表记录且最新的抄表记录已经审核无法
操作
,请联系管理员"
]);
if
(
$uModel
->
id
!=
$lastModel
->
id
){
return
json
([
'status'
=>
0
,
'message'
=>
"抄表单号不是最新的抄表记录
,无法修改
,请联系管理员"
]);
return
json
([
'status'
=>
0
,
'message'
=>
"抄表单号不是最新的抄表记录
无法操作
,请联系管理员"
]);
}
return
true
;
}
...
...
application/em/model/Useage.php
浏览文件 @
4e77c807
...
...
@@ -53,8 +53,13 @@ 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
;
return
$data
;
}
public
function
getCopyListCount
(
$map
){
$data
=
self
::
alias
(
'ue'
)
...
...
application/em/validate/UseageGeneralInfoValidate.php
浏览文件 @
4e77c807
...
...
@@ -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'
,
];
...
...
application/em/view/useage/default.html
浏览文件 @
4e77c807
...
...
@@ -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=
""
>
...
...
application/em/view/useage/detail.html
浏览文件 @
4e77c807
...
...
@@ -217,13 +217,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 +244,11 @@
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
status
==
1
)
{
layer
.
msg
(
data
.
message
,{
icon
:
6
,
time
:
2
000
},
function
(){
layer
.
msg
(
data
.
message
,{
icon
:
6
,
time
:
3
000
},
function
(){
window
.
location
.
href
=
'/useage'
;
})
}
else
{
layer
.
msg
(
data
.
message
||
data
.
msg
,{
icon
:
5
,
time
:
1
000
})
layer
.
msg
(
data
.
message
||
data
.
msg
,{
icon
:
5
,
time
:
3
000
})
window
.
location
.
href
=
'/useage'
;
}
}
...
...
@@ -272,7 +265,7 @@
layer
.
open
({
type
:
1
,
title
:
'填写驳回理由'
,
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>'
,
btn
:
"提交"
,
yes
:
function
(){
$data
.
field
.
checkType
=
2
;
...
...
@@ -284,12 +277,11 @@
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
status
==
1
)
{
layer
.
msg
(
data
.
message
,{
icon
:
6
,
time
:
2
000
},
function
(){
layer
.
msg
(
data
.
message
,{
icon
:
6
,
time
:
4
000
},
function
(){
window
.
location
.
href
=
'/useage'
;
})
}
else
{
layer
.
msg
(
data
.
message
||
data
.
msg
,{
icon
:
5
,
time
:
1000
})
window
.
location
.
href
=
'/useage'
;
layer
.
msg
(
data
.
message
||
data
.
msg
,{
icon
:
5
,
time
:
5000
})
}
}
});
...
...
application/em/view/useage/index.html
浏览文件 @
4e77c807
...
...
@@ -95,18 +95,19 @@
{{
#
if
(
d
.
status
==
2
){
}}
<
span
class
=
"layui-bg-blue"
>
已审核
<
/span
>
{{
#
}
}}
{{
#
if
(
d
.
status
==
3
)
{
}}
<
span
class
=
"layui-bg-orange"
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"
title
=
"{{ d.info.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
||
d
.
status
==
3
){
}}
<
a
title
=
"
删除"
class
=
"layui-btn layui-btn-sm layui-bg-green"
lay
-
event
=
"update
"
>
编辑
<
/a
>
<
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>
...
...
@@ -138,13 +139,13 @@
dataType
:
"json"
,
success
:
function
(
data
)
{
if
(
data
.
status
==
1
){
layer
.
msg
(
data
.
message
,{
icon
:
6
,
time
:
2
000
},
function
(){
layer
.
msg
(
data
.
message
,{
icon
:
6
,
time
:
4
000
},
function
(){
obj
.
del
();
layer
.
close
(
index
);
location
.
reload
()
})
}
else
{
layer
.
msg
(
data
.
message
,{
icon
:
5
,
time
:
1
000
})
layer
.
msg
(
data
.
message
,{
icon
:
5
,
time
:
5
000
})
}
}
});
...
...
application/em/view/useage/update.html
0 → 100644
浏览文件 @
4e77c807
差异被折叠。
点击展开。
route/admin.php
浏览文件 @
4e77c807
...
...
@@ -147,7 +147,7 @@ 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
(
'useage_update
'
,
'em/useage/update'
);
Route
::
get
(
'useage_update/:useage_id
'
,
'em/useage/update'
);
Route
::
post
(
'upFile'
,
'em/UploadFile/upFile'
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论