Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
Jz-Php
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
PHP
Jz-Php
Commits
14f65b58
提交
14f65b58
authored
4月 27, 2020
作者:
chengye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
测试中
上级
0848d942
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
102 行增加
和
9 行删除
+102
-9
Useage.php
application/em/controller/Useage.php
+25
-1
EmCheckBill.php
application/em/model/EmCheckBill.php
+10
-0
Useage.php
application/em/model/Useage.php
+5
-0
detail.html
application/em/view/useage/detail.html
+50
-5
index.html
application/em/view/useage/index.html
+11
-3
admin.php
route/admin.php
+1
-0
没有找到文件。
application/em/controller/Useage.php
浏览文件 @
14f65b58
...
...
@@ -4,6 +4,7 @@
*/
namespace
app\em\controller
;
use
app\admin\controller\Base
;
use
app\em\model\EmCheckBill
;
use
app\em\model\Staff
;
use
app\em\model\Station
;
use
app\em\model\UseageDetail
;
...
...
@@ -181,7 +182,16 @@ class Useage extends Base
$useage_id
=
Request
::
param
(
'useage_id'
);
$useage
=
\app\em\model\Useage
::
get
([
'useage_id'
=>
$useage_id
]);
if
(
$useage
->
status
==
2
)
return
json
([
'status'
=>
0
,
'message'
=>
'该抄表单已经生成了账单'
]);
if
(
$useage
->
status
==
2
)
return
json
([
'status'
=>
0
,
'message'
=>
'单据已经审核过,不能再次审核'
]);
//如果是驳回则记录驳回状态
$checkType
=
Request
::
param
(
'checkType'
);
$this
->
verify
(
$useage_id
,
$checkType
);
//1是通过 2是驳回
if
(
$checkType
==
2
)
{
$useage
->
status
=
3
;
//3代表被驳回
$useage
->
save
();
return
json
([
'status'
=>
1
,
'message'
=>
'单据已经驳回'
]);
}
$inv
=
(
new
Invoice
())
->
createInvoice
(
$useage_id
);
$useage
->
status
=
2
;
...
...
@@ -278,4 +288,17 @@ class Useage extends Base
return
json
([
'status'
=>
0
,
'message'
=>
"抄表单号不是最新的抄表记录,无法修改,请联系管理员"
]);
}
}
//审核
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
();
}
}
\ No newline at end of file
application/em/model/EmCheckBill.php
0 → 100644
浏览文件 @
14f65b58
<?php
namespace
app\em\model
;
class
EmCheckBill
extends
Base
{
}
\ No newline at end of file
application/em/model/Useage.php
浏览文件 @
14f65b58
...
...
@@ -107,4 +107,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
application/em/view/useage/detail.html
浏览文件 @
14f65b58
...
...
@@ -199,10 +199,13 @@
</div>
</div>
</div>
{if $useage.status
!=
2}
{if $useage.status
<
2
}
<
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}
...
...
@@ -235,12 +238,12 @@
});
}
//保存抄表单,并且返回列表
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"
,
...
...
@@ -253,12 +256,53 @@
})
}
else
{
layer
.
msg
(
data
.
message
||
data
.
msg
,{
icon
:
5
,
time
:
1000
})
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 class="layui-input-block" 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
:
2000
},
function
(){
window
.
location
.
href
=
'/useage'
;
})
}
else
{
layer
.
msg
(
data
.
message
||
data
.
msg
,{
icon
:
5
,
time
:
1000
})
window
.
location
.
href
=
'/useage'
;
}
}
});
},
end
:
function
(){
$that
.
removeClass
(
'layui-disabled'
);
$that
.
removeAttr
(
'disabled'
);
layer
.
closeAll
();
}
});
return
false
;
});
});
</script>
{/block}
\ No newline at end of file
application/em/view/useage/index.html
浏览文件 @
14f65b58
...
...
@@ -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;"
>
...
...
@@ -92,13 +94,19 @@
<script
type=
"text/html"
id=
"status"
>
{{
#
if
(
d
.
status
==
2
){
}}
<
span
class
=
"layui-bg-blue"
>
已审核
<
/span
>
{{
#
}
else
{
}}
<
span
class
=
"layui-bg-green"
>
未审核
<
/span
>
{{
#
}
}}
{{
#
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
>
{{
#
}
}}
</script>
{if $admin == true}
<script
type=
"text/html"
id=
"barDemo"
>
{{
#
if
(
d
.
status
==
1
){
}}
{{
#
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-btn-danger"
lay
-
event
=
"del"
>
删除
<
/a
>
{{
#
}
}}
</script>
...
...
route/admin.php
浏览文件 @
14f65b58
...
...
@@ -147,6 +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
::
post
(
'upFile'
,
'em/UploadFile/upFile'
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论