Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
ea60ee9d
Commit
ea60ee9d
authored
Sep 17, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
费用报销-删除列表
parent
c6f12c40
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
144 additions
and
0 deletions
+144
-0
Cost.php
application/index/controller/Cost.php
+50
-0
FApplyForFeeLog.php
application/model/FApplyForFeeLog.php
+93
-0
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Cost.php
View file @
ea60ee9d
...
...
@@ -16,6 +16,7 @@ use app\index\untils\ExportExcelUntil;
use
app\model\AStore
;
use
app\model\FApplyForFee
;
use
app\model\FApplyForFeeCheck
;
use
app\model\FApplyForFeeLog
;
use
app\model\FImg
;
use
app\model\FOffice
;
use
app\model\FSettingLog
;
...
...
@@ -308,6 +309,14 @@ class Cost extends Basic
if
(
$is_ok
)
{
$check_model
=
new
FApplyForFeeCheck
();
$check_model
->
editData
([
'is_del'
=>
1
],
$this
->
params
[
'id'
],
'apply_for_id'
);
$m_log
=
new
FApplyForFeeLog
();
$log_data
[
'apply_id'
]
=
$this
->
params
[
'id'
];
$log_data
[
'agent_id'
]
=
$this
->
userId
;
$log_data
[
'name'
]
=
$this
->
userName
;
$log_data
[
'remark'
]
=
'删除费用报销'
;
$log_data
[
'type'
]
=
1
;
$m_log
->
insertData
(
$log_data
);
$code
=
200
;
$msg
=
'删除成功'
;
}
else
{
...
...
@@ -488,4 +497,44 @@ class Cost extends Basic
}
return
$this
->
response
(
200
,
''
,
$data
);
}
/**
* 删除费用报销列表
*
* @return \think\Response
*/
public
function
delCostList
()
{
if
(
!
$this
->
request
->
isAjax
())
{
return
view
(
'cost/delCost'
);
}
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$cost_service
=
new
CostService
();
$field
=
'a.id,a.count_time,a.source,a.type,a.create_time,a.agent_id,a.total_fee,a.fee_item,a.purpose,a.status,'
;
$field
.=
'b.name as agent_name,a.site_id'
;
$where
[
'is_del'
]
=
1
;
$list
=
$this
->
fee_model
->
getJoinAgentList
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$field
,
$where
);
$data
=
[];
foreach
(
$list
as
$v
)
{
$key
=
$fee_id
[]
=
$v
[
'id'
];
$data
[
$key
]
=
$v
;
$data
[
$key
][
'type_name'
]
=
$cost_service
->
getFeeType
(
$v
[
'type'
]);
$data
[
$key
][
'fee_item_name'
]
=
$cost_service
->
getFeeItem
(
$v
[
'fee_item'
]);
$data
[
$key
][
'del_name'
]
=
''
;
}
if
(
isset
(
$fee_id
))
{
$m_log
=
new
FApplyForFeeLog
();
$log_where
[
'apply_id'
]
=
[
'in'
,
$fee_id
];
$log_where
[
'type'
]
=
1
;
$log_data
=
$m_log
->
findColumn
(
'apply_id,name'
,
$log_where
);
foreach
(
$data
as
$k
=>
$v
)
{
$data
[
$k
][
'del_name'
]
=
$log_data
[
$v
[
'id'
]];
}
}
return
$this
->
response
(
200
,
''
,
$data
);
}
}
\ No newline at end of file
application/model/FApplyForFeeLog.php
0 → 100644
View file @
ea60ee9d
<?php
namespace
app\model
;
use
think\Db
;
use
think\Model
;
class
FApplyForFeeLog
extends
BaseModel
{
protected
$table
=
'f_apply_for_fee_log'
;
private
$db_
;
public
function
__construct
(
$data
=
[])
{
parent
::
__construct
(
$data
);
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* 新增数据
* @param $data
* @return mixed
*/
public
function
insertData
(
$data
)
{
return
$this
->
db_
->
insert
(
$data
);
}
/**
* 查询单条数据
* @param $field
* @param $params
* @return array|false|\PDOStatement|string|Model
*/
public
function
findByOne
(
$field
,
$params
)
{
$result
=
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
find
();
return
$result
;
}
/**
* @param $field
* @param $params
* @return array
*/
public
function
findColumn
(
$field
,
$params
)
{
return
$this
->
db_
->
where
(
$params
)
->
column
(
$field
);
}
/**
* @param $field
* @param $params
* @param string $order
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
findByOneOrder
(
$field
,
$params
,
$order
=
'id desc'
)
{
return
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
order
(
$order
)
->
find
();
}
/**
* 查询多条数据
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
selectData
(
$field
,
$params
)
{
$params
[
'is_del'
]
=
0
;
$result
=
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
select
();
return
$result
;
}
/**
* @param $data
* @return int|string
*/
public
function
insertDataAll
(
$data
)
{
return
$this
->
db_
->
insertAll
(
$data
);
}
}
application/route.php
View file @
ea60ee9d
...
...
@@ -545,6 +545,7 @@ Route::group('index', [
'getCostListFour/:check_status'
=>
[
'index/Cost/getCostList'
,
[
'method'
=>
'GET'
],
[
'check_status'
=>
3
]],
//费用报销审核二审
'getCostListFive/:check_status'
=>
[
'index/Cost/getCostList'
,
[
'method'
=>
'GET'
],
[
'check_status'
=>
4
]],
//费用报销审核三审
'getCostListSix/:check_status'
=>
[
'index/Cost/getCostList'
,
[
'method'
=>
'GET'
],
[
'check_status'
=>
5
]],
//费用报销审核行政审核
'delCostList'
=>
[
'index/Cost/delCostList'
,
[
'method'
=>
'GET'
]],
//费用报销-删除列表
'delCost'
=>
[
'index/Cost/delCost'
,
[
'method'
=>
'POST'
]],
//删除费用报销审核
'checkCostTwo/:check_status'
=>
[
'index/Cost/checkCost'
,
[
'method'
=>
'POST'
],
[
'check_status'
=>
1
]],
//费用报销审核总监
'checkCostThree/:check_status'
=>
[
'index/Cost/checkCost'
,
[
'method'
=>
'POST'
],
[
'check_status'
=>
2
]],
//费用报销审核一审
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment