Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e8785642
authored
Jul 21, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
打印供应商
parent
92788d77
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
198 additions
and
4 deletions
app/Http/Controllers/SupplierController.php
app/Http/Services/DepartmentService.php
app/Http/Services/SupplierService.php
app/Model/DepartmentModel.php
resources/views/iframe.blade.php
resources/views/script/PrintSupplierScript.blade.php
resources/views/web/PrintSupplier.blade.php
resources/views/web/SupplierDetail.blade.php
app/Http/Controllers/SupplierController.php
View file @
e8785642
...
...
@@ -179,7 +179,7 @@ class SupplierController extends Controller
//获取最后一条非分配渠道员的日志
$logModel
=
new
LogModel
();
$auditContent
=
$logModel
->
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'action'
,
'!='
,
'分配渠道开发员'
)
->
where
(
'action'
,
'!='
,
''
)
->
where
(
'action'
,
'!='
,
''
)
->
where
(
'type'
,
'!='
,
3
)
->
orderBy
(
'id'
,
'desc'
)
->
first
();
if
(
!
empty
(
$auditContent
))
{
...
...
@@ -278,9 +278,20 @@ class SupplierController extends Controller
{
$supplierId
=
$request
->
get
(
'supplier_id'
);
$supplierModel
=
new
SupplierChannelModel
();
$supplier
=
$supplierModel
->
where
(
'supplier_id'
,
$supplierId
)
->
first
()
->
toArray
();
$supplier
=
$supplierModel
->
where
(
'supplier_id'
,
$supplierId
)
->
first
()
->
toArray
();
$this
->
data
[
'supplier'
]
=
$supplier
;
return
$this
->
view
(
'加入黑名单'
);
}
//导出供应商详情表格
public
function
PrintSupplier
(
$request
)
{
$supplierService
=
new
SupplierService
();
$supplierId
=
$request
->
get
(
'supplier_id'
);
$printData
=
$supplierService
->
getSupplierPrintData
(
$supplierId
);
// dd($printData);
$this
->
data
[
'printData'
]
=
$printData
;
return
$this
->
view
(
'打印供应商详情'
);
}
}
\ No newline at end of file
app/Http/Services/DepartmentService.php
View file @
e8785642
...
...
@@ -3,6 +3,7 @@
namespace
App\Http\Services
;
use
App\Model\UserInfoModel
;
use
DB
;
//部门数据服务
...
...
app/Http/Services/SupplierService.php
View file @
e8785642
...
...
@@ -7,6 +7,7 @@ use App\Http\Transformers\SupplierTransformer;
use
App\Model\LogModel
;
use
App\Model\RedisModel
;
use
App\Model\SupplierAddressModel
;
use
App\Model\SupplierAttachmentModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierContactModel
;
use
Illuminate\Support\Facades\DB
;
...
...
@@ -414,4 +415,28 @@ class SupplierService
}
return
$result
;
}
//获取打印需要的数据
public
function
getSupplierPrintData
(
$supplierId
)
{
$supplierModel
=
new
SupplierChannelModel
();
$supplier
=
$supplierModel
->
where
(
'supplier_id'
,
$supplierId
)
->
first
()
->
toArray
();
$transformer
=
new
SupplierTransformer
();
$supplier
=
$transformer
->
transformInfo
(
$supplier
);
$printData
=
$supplier
;
$printData
[
'apply_name'
]
=
request
()
->
user
->
name
;
$printData
[
'apply_time'
]
=
date
(
'Y-m-d H:i:s'
,
time
());
$contactModel
=
new
SupplierContactModel
();
$contact
=
$contactModel
->
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'supplier_consignee'
,
'!='
,
''
)
->
first
();
$contact
=
!
empty
(
$contact
)
?
$contact
->
toArray
()
:
[];
$printData
[
'contact'
]
=
$contact
;
$attachmentModel
=
new
SupplierAttachmentModel
();
$hasAgreement
=
$attachmentModel
->
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'quality_assurance_agreement'
)
?
'已签'
:
'未签'
;
$printData
[
'has_agreement'
]
=
$hasAgreement
;
$adminUserService
=
new
AdminUserService
();
$user
=
$adminUserService
->
getAdminUserInfo
(
request
()
->
user
->
userId
);
$printData
[
'department_name'
]
=
$user
[
'department_name'
];
return
$printData
;
}
}
\ No newline at end of file
app/Model/DepartmentModel.php
0 → 100644
View file @
e8785642
<?php
namespace
App\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
DepartmentModel
extends
Model
{
protected
$table
=
'department'
;
protected
$primaryKey
=
'departmentId'
;
public
$timestamps
=
false
;
}
resources/views/iframe.blade.php
View file @
e8785642
...
...
@@ -17,7 +17,7 @@
</head>
<style>
html
*
{
font-size
:
12px
!important
;
font-size
:
12px
;
}
input
:focus
,
textarea
:focus
{
...
...
resources/views/script/PrintSupplierScript.blade.php
0 → 100644
View file @
e8785642
<script>
</script>
\ No newline at end of file
resources/views/web/PrintSupplier.blade.php
0 → 100644
View file @
e8785642
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xml:lang=
"en"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html;charset=UTF-8"
>
<title>
Document
</title>
</head>
<style>
td
{
height
:
35px
;
}
/*.title-td {*/
/* width: 20%;*/
/*}*/
</style>
<body>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md3"
>
</div>
<div
class=
"layui-col-md6"
style=
"text-align: center"
>
<div
class=
"layui-row"
style=
"margin-bottom: 5px"
>
<div
class=
"layui-col-md12"
><span
style=
"font-size: 20px;font-weight: bold;"
>
新供应商引入申请单
</span></div>
<div
style=
"text-align: right"
>
申请部门 : {{$printData['department_name']}}
</div>
</div>
<table
border=
"1"
style=
"width: 100%;"
>
<tr>
<td
width=
"20%"
colspan=
"1"
>
申请人
</td>
<td
width=
"30%"
colspan=
"2"
>
{{$printData['apply_name']}}
</td>
<td
width=
"20%"
colspan=
"1"
>
申请时间
</td>
<td
width=
"30%"
colspan=
"2"
>
{{$printData['apply_time']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商名*
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['supplier_name']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商英文名
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['supplier_name_en']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商性质
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['supplier_group_name']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
行业地位
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
></td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
主要产品线品牌
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['main_brand_names']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
3-5家主要客户
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['main_customers']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
资信调查情况
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['credit_investigation']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商注册地址
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['supplier_address']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商办公/发货地址*
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['shipping_address']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商法人代表
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['legal_representative']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商营业税号
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['tax_number']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商成立时间*
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['established_time']}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
付款币别
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['currency_name']?:''}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商付款方式
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['pay_type_name']?:''}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
付款时间
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
???
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
供应商到票时间*
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
???
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
账期详情*
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
???
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
业务负责人
</td>
<td
width=
"20%"
colspan=
"1"
>
{{array_get($printData['contact'],'supplier_consignee','')}}
</td>
<td
width=
"10%"
colspan=
"1"
>
电话
</td>
<td
width=
"20%"
colspan=
"1"
>
{{array_get($printData['contact'],'supplier_telephone','')}}
</td>
<td
width=
"10%"
colspan=
"1"
>
邮箱
</td>
<td
width=
"20%"
colspan=
"1"
>
{{array_get($printData['contact'],'supplier_email','')}}
</td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
业务跟进人
</td>
<td
width=
"20%"
colspan=
"1"
></td>
<td
width=
"10%"
colspan=
"1"
>
电话
</td>
<td
width=
"20%"
colspan=
"1"
></td>
<td
width=
"10%"
colspan=
"1"
>
邮箱
</td>
<td
width=
"20%"
colspan=
"1"
></td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
业务/技术跟进人
</td>
<td
width=
"20%"
colspan=
"1"
></td>
<td
width=
"10%"
colspan=
"1"
>
电话
</td>
<td
width=
"20%"
colspan=
"1"
></td>
<td
width=
"10%"
colspan=
"1"
>
邮箱
</td>
<td
width=
"20%"
colspan=
"1"
></td>
</tr>
<tr>
<td
width=
"20%"
colspan=
"1"
>
品质保证协议
</td>
<td
width=
"80%"
colspan=
"5"
style=
"text-align: left;padding-left: 20px"
>
{{$printData['has_agreement']}}
</td>
</tr>
</table>
</div>
<div
class=
"layui-col-md3"
>
</div>
<script>
window
.
print
();
</script>
</div>
</body>
</html>
\ No newline at end of file
resources/views/web/SupplierDetail.blade.php
View file @
e8785642
...
...
@@ -78,7 +78,8 @@
</button>
@endif
@endif
<a
href=
"/supplier/print"
style=
"margin-bottom: 25px;margin-top: 5px"
class=
"layui-btn layui-btn"
>
打印
</a>
<a
href=
"/supplier/PrintSupplier?view=iframe&supplier_id={{$supplier['supplier_id']}}"
target=
"_blank"
style=
"margin-bottom: 25px;margin-top: 5px"
class=
"layui-btn layui-btn"
>
打印
</a>
</div>
</div>
<div
class=
"layui-card-body"
style=
"margin-top: 140px"
>
...
...
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