Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvsuo-pc
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhilin
lvsuo-pc
Commits
06965fe7
Commit
06965fe7
authored
Dec 23, 2024
by
lizhilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
46930de9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
13 deletions
+73
-13
app/Admin/Controllers/LawyerController.php
+23
-0
app/Admin/Controllers/LawyerCostController.php
+13
-8
app/Admin/Controllers/LawyerCostListController.php
+35
-5
app/Admin/routes.php
+2
-0
No files found.
app/Admin/Controllers/LawyerController.php
View file @
06965fe7
...
...
@@ -12,6 +12,7 @@
use
Dcat\Admin\Admin
;
use
Dcat\Admin\Http\Controllers\AdminController
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Http\Request
;
class
LawyerController
extends
AdminController
{
...
...
@@ -164,4 +165,26 @@ public function destroy($id)
}
return
$res
;
}
public
function
getList
(
Request
$request
)
{
$name
=
$request
->
get
(
'q'
);
$where
=
[];
if
(
$name
)
{
$where
[
'name'
]
=
[
'like'
,
'%'
.
$name
.
'%'
];
}
$data
=
[];
$list
=
ModelLawyer
::
whereNull
(
'deleted_at'
)
->
where
(
$where
)
->
select
([
'id'
,
'number'
,
'name'
])
->
limit
(
100
)
->
get
()
->
toArray
();
foreach
(
$list
as
$item
)
{
$tmp
=
[];
$tmp
[
'id'
]
=
$item
[
'number'
];
$tmp
[
'text'
]
=
$item
[
'number'
]
.
' '
.
$item
[
'name'
];
array_push
(
$data
,
$tmp
);
}
return
$data
;
}
}
app/Admin/Controllers/LawyerCostController.php
View file @
06965fe7
...
...
@@ -3,6 +3,7 @@
namespace
App\Admin\Controllers
;
//use App\Admin\Repositories\LawyerCost;
use
App\Models\Lawyer
as
ModelLawyer
;
use
App\Admin\Repositories\Lawyer
;
use
App\Models\LawyerCost
as
ModelLawyerCost
;
use
Dcat\Admin\Form
;
...
...
@@ -209,8 +210,9 @@ protected function form()
if
(
Admin
::
user
()
->
can
(
'lawyer_cost_list_edit'
))
{
$form
->
text
(
'year'
)
->
default
(
date
(
'Y'
));
$form
->
select
(
'month'
)
->
options
(
ModelLawyerCost
::
MONTH
)
->
required
();
$form
->
text
(
'number'
)
->
required
();
$form
->
text
(
'lname'
)
->
required
();
//$form->text('number')->required();
$form
->
select
(
'number'
,
'律师姓名'
)
->
options
(
'/get-lawyer-list'
)
->
required
();
//$form->text('lname')->required();
$form
->
text
(
'basic_salary'
)
->
required
();
$form
->
text
(
'special_additional'
)
->
required
();
$form
->
text
(
'social_person_fee'
)
->
required
();
...
...
@@ -219,7 +221,7 @@ protected function form()
$form
->
text
(
'accumulation_fund_person_fee'
)
->
required
();
$form
->
text
(
'accumulation_fund_company_fee'
)
->
required
();
$form
->
text
(
'accumulation_fund'
,
'公积金'
)
->
readOnly
();
$form
->
text
(
'annual_inspection_fee'
)
->
re
adOnly
();
$form
->
text
(
'annual_inspection_fee'
)
->
re
quired
();
$form
->
text
(
'annuity'
)
->
readOnly
();
$form
->
text
(
'assistant_fee'
)
->
readOnly
();
$form
->
text
(
'office_rental_fee'
)
->
readOnly
();
...
...
@@ -229,8 +231,9 @@ protected function form()
}
else
{
$form
->
text
(
'year'
)
->
default
(
date
(
'Y'
))
->
readOnly
();
$form
->
select
(
'month'
)
->
options
(
ModelLawyerCost
::
MONTH
)
->
readOnly
();
$form
->
text
(
'number'
)
->
readOnly
();
$form
->
text
(
'lname'
)
->
readOnly
();
//$form->text('number')->readOnly();
//$form->text('lname')->readOnly();
$form
->
select
(
'number'
,
'律师姓名'
)
->
options
(
'/get-lawyer-list'
)
->
readOnly
();
$form
->
text
(
'basic_salary'
)
->
readOnly
();
$form
->
text
(
'special_additional'
)
->
readOnly
();
$form
->
text
(
'social_person_fee'
)
->
readOnly
();
...
...
@@ -239,7 +242,7 @@ protected function form()
$form
->
text
(
'accumulation_fund_person_fee'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund_company_fee'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund'
,
'公积金'
)
->
readOnly
();
$form
->
text
(
'annual_inspection_fee'
)
->
re
quired
();
$form
->
text
(
'annual_inspection_fee'
)
->
re
adOnly
();
$form
->
text
(
'annuity'
)
->
required
();
$form
->
text
(
'assistant_fee'
)
->
required
();
$form
->
text
(
'office_rental_fee'
)
->
required
();
...
...
@@ -320,7 +323,9 @@ function (Form $form, $result) {
//律师ID
$number
=
$_POST
[
'number'
]
??
0
;
$lawyer_id
=
DB
::
table
(
'lawyer'
)
->
where
(
'number'
,
$number
)
->
value
(
'id'
);
$lawyerObj
=
DB
::
table
(
'lawyer'
)
->
where
(
'number'
,
$number
)
->
first
();
$lawyer_id
=
$lawyerObj
->
id
;
$lname
=
$lawyerObj
->
name
;
$basic_salary
=
$_POST
[
'basic_salary'
]
??
0
;
$special_additional
=
$_POST
[
'special_additional'
]
??
0
;
...
...
@@ -337,7 +342,7 @@ function (Form $form, $result) {
$accumulation_fund_person_fee
=
$_POST
[
'accumulation_fund_person_fee'
]
??
0
;
$accumulation_fund
=
floatval
(
$accumulation_fund_person_fee
)
+
floatval
(
$accumulation_fund_company_fee
);
if
(
$result
)
{
DB
::
table
(
'lawyer_cost'
)
->
where
(
"id"
,
$cost_id
)
->
update
([
'lawyer_id'
=>
$lawyer_id
,
'social'
=>
$social
,
'accumulation_fund'
=>
$accumulation_fund
,
'noticket_cost'
=>
$noticket_cost
]);
DB
::
table
(
'lawyer_cost'
)
->
where
(
"id"
,
$cost_id
)
->
update
([
'lawyer_id'
=>
$lawyer_id
,
'
lname'
=>
$lname
,
'
social'
=>
$social
,
'accumulation_fund'
=>
$accumulation_fund
,
'noticket_cost'
=>
$noticket_cost
]);
}
}
);
...
...
app/Admin/Controllers/LawyerCostListController.php
View file @
06965fe7
...
...
@@ -140,8 +140,9 @@ protected function form()
if
(
Admin
::
user
()
->
can
(
'lawyer_cost_list_edit'
))
{
$form
->
text
(
'year'
)
->
default
(
date
(
'Y'
));
$form
->
select
(
'month'
)
->
options
(
ModelLawyerCost
::
MONTH
)
->
required
();
$form
->
text
(
'number'
)
->
required
();
$form
->
text
(
'lname'
)
->
required
();
//$form->text('number')->required();
//$form->text('lname')->required();
$form
->
select
(
'number'
,
'律师姓名'
)
->
options
(
'/get-lawyer-list'
)
->
required
();
$form
->
text
(
'basic_salary'
)
->
required
();
$form
->
text
(
'special_additional'
)
->
required
();
$form
->
text
(
'social_person_fee'
)
->
required
();
...
...
@@ -150,7 +151,7 @@ protected function form()
$form
->
text
(
'accumulation_fund_person_fee'
)
->
required
();
$form
->
text
(
'accumulation_fund_company_fee'
)
->
required
();
$form
->
text
(
'accumulation_fund'
,
'公积金'
)
->
readOnly
();
$form
->
text
(
'annual_inspection_fee'
)
->
re
adOnly
();
$form
->
text
(
'annual_inspection_fee'
)
->
re
quired
();
$form
->
text
(
'annuity'
)
->
readOnly
();
$form
->
text
(
'assistant_fee'
)
->
readOnly
();
$form
->
text
(
'office_rental_fee'
)
->
readOnly
();
...
...
@@ -180,7 +181,7 @@ protected function form()
$form
->
text
(
'accumulation_fund_person_fee'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund_company_fee'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund'
,
'公积金'
)
->
readOnly
();
$form
->
text
(
'annual_inspection_fee'
)
->
re
quired
();
$form
->
text
(
'annual_inspection_fee'
)
->
re
adOnly
();
$form
->
text
(
'annuity'
)
->
required
();
$form
->
text
(
'assistant_fee'
)
->
required
();
$form
->
text
(
'office_rental_fee'
)
->
required
();
...
...
@@ -193,6 +194,15 @@ protected function form()
$form
->
disableViewCheck
();
$form
->
disableDeleteButton
();
$form
->
disableViewButton
();
$form
->
disableListButton
();
$cost_id
=
$form
->
getKey
();
if
(
$cost_id
)
{
$number
=
DB
::
table
(
'lawyer_cost'
)
->
where
(
'id'
,
$cost_id
)
->
value
(
'number'
);
$form
->
tools
(
function
(
Form\Tools
$tools
)
use
(
$number
)
{
$tools
->
append
(
'<a class="btn btn-sm btn-primary" href="/lycost-list?no='
.
$number
.
'" style="color:#fff;" id="custom-list-button"><i class="feather icon-list"><span class="d-none d-sm-inline">列表</a></i></a>'
);
});
}
// $form->display('created_at');
// $form->display('updated_at');
...
...
@@ -239,11 +249,31 @@ protected function form()
JS
);
$form
->
submitted
(
function
(
Form
$form
)
{
$number
=
isset
(
$_POST
[
'number'
])
?
$_POST
[
'number'
]
:
''
;
$month
=
isset
(
$_POST
[
'month'
])
?
$_POST
[
'month'
]
:
0
;
$year
=
isset
(
$_POST
[
'year'
])
?
$_POST
[
'year'
]
:
0
;
$lawyer_id
=
DB
::
table
(
'lawyer'
)
->
where
(
'number'
,
$number
)
->
value
(
'id'
);
if
(
!
$number
||
!
$lawyer_id
)
{
$form
->
responseValidationMessages
(
'number'
,
"该律师信息不存在"
);
}
$count
=
DB
::
table
(
'lawyer_cost'
)
->
where
([
'year'
=>
$year
,
'month'
=>
$month
,
'lawyer_id'
=>
$lawyer_id
])
->
count
();
if
(
$count
>
1
)
{
$form
->
responseValidationMessages
(
'month'
,
"当前月份成本信息已存在"
);
}
});
//副表保存规格
$form
->
saved
(
function
(
Form
$form
,
$result
)
{
$cost_id
=
$form
->
getKey
();
//律师ID
$number
=
$_POST
[
'number'
]
??
0
;
$lawyerObj
=
DB
::
table
(
'lawyer'
)
->
where
(
'number'
,
$number
)
->
first
();
$lawyer_id
=
$lawyerObj
->
id
;
$lname
=
$lawyerObj
->
name
;
$basic_salary
=
$_POST
[
'basic_salary'
]
??
0
;
$special_additional
=
$_POST
[
'special_additional'
]
??
0
;
$social_company_fee
=
$_POST
[
'social_company_fee'
]
??
0
;
...
...
@@ -259,7 +289,7 @@ function (Form $form, $result) {
$accumulation_fund_person_fee
=
$_POST
[
'accumulation_fund_person_fee'
]
??
0
;
$accumulation_fund
=
floatval
(
$accumulation_fund_person_fee
)
+
floatval
(
$accumulation_fund_company_fee
);
if
(
$result
)
{
DB
::
table
(
'lawyer_cost'
)
->
where
(
"id"
,
$cost_id
)
->
update
([
'social'
=>
$social
,
'accumulation_fund'
=>
$accumulation_fund
,
'noticket_cost'
=>
$noticket_cost
]);
DB
::
table
(
'lawyer_cost'
)
->
where
(
"id"
,
$cost_id
)
->
update
([
'
lawyer_id'
=>
$lawyer_id
,
'lname'
=>
$lname
,
'
social'
=>
$social
,
'accumulation_fund'
=>
$accumulation_fund
,
'noticket_cost'
=>
$noticket_cost
]);
}
}
);
...
...
app/Admin/routes.php
View file @
06965fe7
...
...
@@ -37,6 +37,8 @@
$router
->
resource
(
'lawyer'
,
'LawyerController'
);
//律师信息
$router
->
get
(
'get-lawyer-list'
,
'LawyerController@getList'
);
//律师选择
$router
->
resource
(
'covenant'
,
'CovenantController'
);
//合同信息
$router
->
resource
(
'lawyer_cost'
,
'LawyerCostController'
);
//律师成本表
...
...
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