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
bf41f245
Commit
bf41f245
authored
Apr 07, 2025
by
liuyingkang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入优化
parent
f2a0519c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
18 deletions
+19
-18
app/Admin/Controllers/CovenantController.php
+17
-17
app/Models/Covenant.php
+1
-1
app/Models/Lawyer.php
+1
-0
public/excelTemplate/合同信息导入模版.xlsx
+0
-0
No files found.
app/Admin/Controllers/CovenantController.php
View file @
bf41f245
...
@@ -32,23 +32,23 @@ protected function grid()
...
@@ -32,23 +32,23 @@ protected function grid()
{
{
return
Grid
::
make
(
ModelsCovenant
::
with
([
'lawyer'
]),
function
(
Grid
$grid
)
{
return
Grid
::
make
(
ModelsCovenant
::
with
([
'lawyer'
]),
function
(
Grid
$grid
)
{
//
工具栏
//
//工具栏【有用再打开】
$grid
->
tools
(
function
(
Grid\Tools
$tools
)
{
//
$grid->tools(function (Grid\Tools $tools) {
$tools
->
append
(
Modal
::
make
()
//
$tools->append(Modal::make()
// 大号弹窗
//
// 大号弹窗
->
lg
()
//
->lg()
// 弹窗标题
//
// 弹窗标题
->
title
(
'上传文件'
)
//
->title('上传文件')
// 按钮
//
// 按钮
->
button
(
'<button class="btn btn-primary"><i class="feather icon-upload"></i> 导入数据</button>'
)
//
->button('<button class="btn btn-primary"><i class="feather icon-upload"></i> 导入数据</button>')
// 弹窗内容
//
// 弹窗内容
->
body
(
ImportExcel
::
make
()
->
payload
([
'className'
=>
ModelsCovenant
::
class
])));
//
->body(ImportExcel::make()->payload(['className' => ModelsCovenant::class])));
// 下载导入模板
//
// 下载导入模板
$tools
->
append
(
DownloadTemplateExcel
::
make
()
->
setKey
(
'ModelsCovenant'
));
//
$tools->append(DownloadTemplateExcel::make()->setKey('ModelsCovenant'));
});
//
});
$grid
->
model
()
->
orderBy
(
'
id
'
,
'DESC'
);
$grid
->
model
()
->
orderBy
(
'
sign_at
'
,
'DESC'
);
//$grid->column('id')->sortable();
//$grid->column('id')->sortable();
$grid
->
column
(
'number'
);
$grid
->
column
(
'number'
);
$grid
->
column
(
'cname'
)
->
width
(
200
);
$grid
->
column
(
'cname'
)
->
width
(
200
);
...
...
app/Models/Covenant.php
View file @
bf41f245
...
@@ -92,7 +92,7 @@ public static function CreateImportData($item): array
...
@@ -92,7 +92,7 @@ public static function CreateImportData($item): array
$principal_id
=
Principal
::
getIdByName
(
$principal
);
$principal_id
=
Principal
::
getIdByName
(
$principal
);
// 合同类型,默认其他
// 合同类型,默认其他
$ctype
=
array_search
(
$result
[
7
],
self
::
CTYPE
)
?:
8
;
$ctype
=
array_search
(
$result
[
2
],
self
::
CTYPE
)
?:
8
;
$number
=
$result
[
3
];
$number
=
$result
[
3
];
$case_reason
=
$result
[
4
];
$case_reason
=
$result
[
4
];
...
...
app/Models/Lawyer.php
View file @
bf41f245
...
@@ -248,6 +248,7 @@ public static function getIdByName($title = '')
...
@@ -248,6 +248,7 @@ public static function getIdByName($title = '')
}
else
{
}
else
{
$id
=
self
::
insertGetId
([
$id
=
self
::
insertGetId
([
'name'
=>
$title
,
'name'
=>
$title
,
'wtype'
=>
2
,
'number'
=>
mt_rand
(
10000
,
99999
),
'number'
=>
mt_rand
(
10000
,
99999
),
'created_at'
=>
date
(
'Y-m-d H:i:s'
),
'created_at'
=>
date
(
'Y-m-d H:i:s'
),
'updated_at'
=>
date
(
'Y-m-d H:i:s'
),
'updated_at'
=>
date
(
'Y-m-d H:i:s'
),
...
...
public/excelTemplate/合同信息导入模版.xlsx
View file @
bf41f245
No preview for this file type
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