Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
php_frq_api
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
d009d051
authored
Mar 22, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1
parent
bc1cd54d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
113 additions
and
94 deletions
app/Model/InquiryItemsReportModel.php
app/Model/QuoteModel.php
resources/views/pdf/sale.blade.php → resources/views/pdf/sale.blade2.php
app/Model/InquiryItemsReportModel.php
View file @
d009d051
...
@@ -99,8 +99,8 @@ class InquiryItemsReportModel extends Model
...
@@ -99,8 +99,8 @@ class InquiryItemsReportModel extends Model
$name
=
'sale_report_'
.
time
()
.
'.pdf'
;
$name
=
'sale_report_'
.
time
()
.
'.pdf'
;
PDF
::
loadHTML
(
$html
)
PDF
::
loadHTML
(
$html
)
//
->setPaper('a4', 'landscape') //横列
->
setPaper
(
'a4'
,
'landscape'
)
//横列
->
setPaper
(
'a4'
,
'portrait'
)
//竖列
//
->setPaper('a4', 'portrait') //竖列
->
setWarnings
(
false
)
->
setWarnings
(
false
)
->
save
(
'pdf/'
.
$name
);
->
save
(
'pdf/'
.
$name
);
...
@@ -121,7 +121,8 @@ class InquiryItemsReportModel extends Model
...
@@ -121,7 +121,8 @@ class InquiryItemsReportModel extends Model
$temp
[
"price_rmb"
]
=
@
$data
[
"price_rmb"
]
?
$data
[
"price_rmb"
]
:
0
;
$temp
[
"price_rmb"
]
=
@
$data
[
"price_rmb"
]
?
$data
[
"price_rmb"
]
:
0
;
$currency
=
@
$data
[
"currency"
]
?
$data
[
"currency"
]
:
1
;
#报价币种
$currency
=
@
$data
[
"currency"
]
?
$data
[
"currency"
]
:
1
;
#报价币种
$inquiryItem
=
(
new
InquiryItemsModel
())
->
select
(
"inquiry_id"
)
->
where
(
"id"
,
$inquiry_items_id
)
->
first
()
->
toArray
();
$InquiryItemsModel
=
new
InquiryItemsModel
();
$inquiryItem
=
$InquiryItemsModel
->
select
(
"inquiry_id"
)
->
where
(
"id"
,
$inquiry_items_id
)
->
first
()
->
toArray
();
$inquiry
=
(
new
InquiryModel
())
->
select
(
"currency"
)
->
where
(
"id"
,
$inquiryItem
[
"inquiry_id"
])
->
first
()
->
toArray
();
$inquiry
=
(
new
InquiryModel
())
->
select
(
"currency"
)
->
where
(
"id"
,
$inquiryItem
[
"inquiry_id"
])
->
first
()
->
toArray
();
$mainCurrency
=
$inquiry
[
"currency"
];
#询价币种
$mainCurrency
=
$inquiry
[
"currency"
];
#询价币种
$rate
=
(
new
CommonModel
())
->
getRate
(
"美元"
);
#获取美元汇率
$rate
=
(
new
CommonModel
())
->
getRate
(
"美元"
);
#获取美元汇率
...
@@ -137,6 +138,9 @@ class InquiryItemsReportModel extends Model
...
@@ -137,6 +138,9 @@ class InquiryItemsReportModel extends Model
(
new
QuoteModel
())
->
where
(
"id"
,
$data
[
"quote_id"
])
->
update
([
"status"
=>
$data
[
"status"
]]);
#更新报价选中
(
new
QuoteModel
())
->
where
(
"id"
,
$data
[
"quote_id"
])
->
update
([
"status"
=>
$data
[
"status"
]]);
#更新报价选中
#更新询价明细表状态
$InquiryItemsModel
->
where
(
"id"
,
$inquiry_items_id
)
->
update
([
"status"
=>
$data
[
"status"
]
==
2
?
3
:
5
]);
return
[
0
,
"成功"
];
return
[
0
,
"成功"
];
}
}
/*
/*
...
...
app/Model/QuoteModel.php
View file @
d009d051
...
@@ -671,9 +671,24 @@ class QuoteModel extends Model
...
@@ -671,9 +671,24 @@ class QuoteModel extends Model
if
(
!
$id
)
return
[
-
1
,
'参数缺失'
];
if
(
!
$id
)
return
[
-
1
,
'参数缺失'
];
try
{
try
{
$rqpConn
=
DB
::
connection
(
'rfq'
);
$res
=
$this
->
where
(
'id'
,
$id
)
->
update
([
'status'
=>
$status
,
'update_time'
=>
time
()]);
$res
=
$this
->
where
(
'id'
,
$id
)
->
update
([
'status'
=>
$status
,
'update_time'
=>
time
()]);
$quote_info
=
$this
->
find
(
$id
);
$quote_info
=
$this
->
find
(
$id
);
#更新询价明细表状态
$inquiry_items_id
=
$quote_info
[
"inquiry_items_id"
];
$sql
=
"select status from lie_quote where inquiry_items_id=
$inquiry_items_id
and status in (1,2,3) and id not in (
$id
)"
;
$has
=
$rqpConn
->
select
(
$sql
);
$check
=
1
;
if
(
$has
){
$check
=
0
;
}
if
(
$check
){
(
new
InquiryItemsModel
())
->
where
(
"id"
,
$quote_info
[
"inquiry_items_id"
])
->
update
([
"status"
=>
$status
]);
}
$data
=
[];
$data
=
[];
$data
[
'types'
]
=
1
;
$data
[
'types'
]
=
1
;
$data
[
'relation_id'
]
=
$id
;
$data
[
'relation_id'
]
=
$id
;
...
...
resources/views/pdf/sale.blade.php
→
resources/views/pdf/sale.blade
2
.php
View file @
d009d051
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
...
@@ -5,9 +6,9 @@
...
@@ -5,9 +6,9 @@
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<title>
ichunt.com--{$data['order_sn']}
</title>
<title>
ichunt.com--{$data['order_sn']}
</title>
<style
type=
"text/css"
media=
"screen"
>
<style
type=
"text/css"
media=
"screen"
>
*
{
font-family
:
"simsun"
;
font-weight
:
normal
;
margin
:
0px
;
padding
:
0px
;
}
*
{
font-family
:
"simsun"
;
font-weight
:
normal
;
margin
:
0px
;
padding
:
0px
;
}
/*.pdf-box{margin:0 auto;font-size: 14px;color:#333;width:900px;padding:50px;}*/
.pdf-box
{
margin
:
0
auto
;
font-size
:
14px
;
color
:
#333
;
padding
:
10px
;
box-sizing
:
border-box
;}
.pdf-box
{
margin
:
0
auto
;
font-size
:
14px
;
color
:
#333
;
width
:
900px
;
padding
:
50px
;
box-sizing
:
border-box
;}
.header
{
text-align
:
center
;
font-size
:
28px
;
color
:
#000
;
position
:
relative
;}
.header
{
text-align
:
center
;
font-size
:
28px
;
color
:
#000
;
position
:
relative
;}
.header
img
{
width
:
120px
;
position
:
absolute
;
left
:
60px
;
top
:
10px
;}
.header
img
{
width
:
120px
;
position
:
absolute
;
left
:
60px
;
top
:
10px
;}
.bjdx
{
background
:
#ccffff
;
font-size
:
28px
;
color
:
#0000DA
;
text-align
:
center
;}
.bjdx
{
background
:
#ccffff
;
font-size
:
28px
;
color
:
#0000DA
;
text-align
:
center
;}
...
@@ -19,102 +20,101 @@
...
@@ -19,102 +20,101 @@
.footer
{
position
:
relative
;}
.footer
{
position
:
relative
;}
.footer
.pr30
{
position
:
relative
;
left
:
80px
;}
.footer
.pr30
{
position
:
relative
;
left
:
80px
;}
.footer
.pr60
{
position
:
relative
;
left
:
107px
;}
.footer
.pr60
{
position
:
relative
;
left
:
107px
;}
.footer
img
{
position
:
absolute
;
left
:
731px
;
top
:
40px
;}
.footer
img
{
position
:
absolute
;
left
:
600px
;
top
:
40px
;}
.xhhez
{
max-width
:
150px
;
white-space
:
normal
;
word-break
:
break-all
;}
</style>
</style>
</head>
</head>
<body>
<body>
<div
class=
"pdf-box"
>
<div
class=
"pdf-box"
>
<div
class=
"header"
>
<div
class=
"header"
>
<img
src=
"https://static.ichunt.com/dist/res/home/images/new_logo.png"
style=
"float:left;"
>
<img
src=
"https://static.ichunt.com/dist/res/home/images/new_logo.png"
style=
"float:left;"
>
<p
class=
"company"
>
<p
class=
"company"
>
深圳市猎芯科技有限公司
<br/>
深圳市猎芯科技有限公司
<br/>
ICHUNT TECHNOLOGY CO.,LTD
ICHUNT TECHNOLOGY CO.,LTD
</p>
</p>
</div>
</div>
<div
class=
"bjdx"
>
报 价 单/ QUOTATION
</div>
<div
class=
"bjdx"
>
报 价 单/ QUOTATION
</div>
<div
class=
"table1"
>
<div
class=
"table1"
>
<table>
<table>
<tr>
<tr>
<td
colspan=
"2"
></td>
<td
colspan=
"2"
></td>
<td
colspan=
"2"
>
Date:
<?=
date
(
"Y-m-d"
);
?>
</td>
<td
colspan=
"2"
>
Date:2020-7-14
</td>
</tr>
</tr>
<tr>
<tr>
<td><b>
Attn
</b>
:{{ @$user["name"] }}
</td>
<td><b>
Attn
</b>
:深圳市度申科技有限公司
</td>
<td><b>
C.C
</b>
:{{ @$user["cc"] }}
</td>
<td><b>
C.C
</b>
:李美媛
</td>
<td><b>
Fax
</b>
:{{ @$user["fax"] }}
</td>
<td><b>
Fax
</b>
:
</td>
<td><b>
Tel
</b>
: {{ @$user["tel"] }}
</td>
<td><b>
Tel
</b>
: 0755-29823982
</td>
</tr>
</tr>
<tr>
<tr>
<td><b>
From
</b>
:{{ @$company["name"] }}
</td>
<td><b>
From
</b>
:深圳市猎芯科技有限公司
</td>
<td><b>
C.C
</b>
:{{ @$company["cc"] }}
</td>
<td><b>
C.C
</b>
:杨娟
</td>
<td><b>
Fax
</b>
:{{ @$company["fax"] }}
</td>
<td><b>
Fax
</b>
:18529505446
</td>
<td><b>
Tel
</b>
: {{ @$company["tel"] }}
</td>
<td><b>
Tel
</b>
: 0755-23485782-8031
</td>
</tr>
</tr>
</table>
</table>
</div>
</div>
<div
class=
"table-tips"
>
<div
class=
"table-tips"
>
很高兴为您提供我们最优惠的价格和货期,请参看如下:
<br/>
很高兴为您提供我们最优惠的价格和货期,请参看如下:
<br/>
<b>
We are pleased to quote our best price and delivery terms for your requirement as following:
</b>
<b>
We are pleased to quote our best price and delivery terms for your requirement as following:
</b>
</div>
</div>
<div
class=
"table2"
>
<div
class=
"table2"
>
<table>
<table
style=
"width:100%!important;table-layout:fixed;"
>
<tr>
<tr>
<td>
客户型号 Cust PartNo
</td>
<td>
客户型号 Cust PartNo
</td>
<td>
原厂型号 Mfr PartNo
</td>
<td
>
原厂型号 Mfr PartNo
</td>
<td>
品牌 Mfr Name
</td>
<td
>
品牌 Mfr Name
</td>
<td>
报价(RMB含税)Quoted Price (RMB with 13%VAT,freight fee to factory and import fee )
</td>
<td
>
报价(RMB含税)Quoted Price (RMB with 13%VAT,freight fee to factory and import fee )
</td>
<td>
报价(美金)QuotedPrice In USD
</td>
<td
>
报价(美金)QuotedPrice In USD
</td>
<td>
数量 Quantity
</td>
<td>
数量 Quantity
</td>
<td>
金额
</td>
<td>
货期 Std LeadTime
</td>
<td>
产品类型 Prod Type
</td>
<td>
DATE CODE
</td>
</tr>
@if(!empty($itemsArr)
&&
is_array($itemsArr))
@foreach($itemsArr as $k=>$v)
<tr>
<td>
{{ @$v["goods_name"] }}
</td>
<td>
{{ @$v["goods_name_pro"] }}
</td>
<td>
{{ @$v["brand_name"] }}
</td>
<td>
{{ @$v["price_rmb"] }}
</td>
<td>
{{ @$v["price_origin"] }}
</td>
<td>
{{ @$v["inquiry_number"] }}
</td>
<td>
{{ @$v["quote_account"] }}
</td>
<td>
{{ @$v["delivery_time"] }}
</td>
<td>
{{ @$v["class_id2_name"] }}
</td>
<td>
{{ @$v["batch"] }}
</td>
</tr>
@endforeach
@endif
<tr>
<td></td>
<td></td>
<td
colspan=
"2"
></td>
<td></td>
<td></td>
<td><b>
TOTAL:
</b></td>
<td
colspan=
"2"
><b>
{{ $quote_price_count }}
</b></td>
<td></td>
</tr>
</table>
<td>
金额
</td>
</div>
<td>
货期 Std LeadTime
</td>
<div
class=
"footer"
style=
"padding-top: 20px;"
>
<td>
产品类型 Prod Type
</td>
<img
src=
"http://api.ichunt.com/public/img/contract.png"
width=
'150'
height=
'150'
>
<td>
DATE CODE
</td>
<b
style=
"font-size: 18px;font-weight: bold;color:#000;"
>
条款和说明:
<br>
</tr>
<tr>
<td><div
class=
"xhhez"
>
TLV70712PDQNRasdasdasdasdasdsa
</div></td>
<td><div
class=
"xhhez"
>
TLV70712PDQNRasdasdasdasdasdsa
</div></td>
<td><div
class=
"xhhez"
>
TLV70712PDQNRasdasdasdasdasdsa
</div></td>
<td>
0.692
</td>
<td></td>
<td>
500
</td>
<td>
346
</td>
<td>
6-9DAYS
</td>
<td></td>
<td>
5年内
</td>
</tr>
<tr>
<td></td>
<td></td>
<td
colspan=
"2"
></td>
<td></td>
<td></td>
<td><b>
TOTAL:
</b></td>
<td
colspan=
"2"
><b>
2,431.00
</b></td>
<td></td>
</tr>
</table>
</div>
<div
class=
"footer"
style=
"padding-top: 20px;"
>
<img
src=
"./contract.png"
width=
'150'
height=
'150'
>
<b
style=
"font-size: 18px;font-weight: bold;color:#000;"
>
条款和说明:
<br>
Terms and conditions:
</b>
Terms and conditions:
</b>
<br>
1.>
<span
class=
"pr30"
>
付款方式:月结30天
</span>
<br>
1.>
<span
class=
"pr30"
>
付款方式:月结30天
</span>
<br><span
class=
"pr60"
>
Payment Terms:
</span>
<br><span
class=
"pr60"
>
Payment Terms:
</span>
<br>
2.>
<span
class=
"pr30"
>
参考货期仅供参考,需下单后以原厂回复为准。
</span>
<br>
2.>
<span
class=
"pr30"
>
参考货期仅供参考,需下单后以原厂回复为准。
</span>
<br><b
class=
"pr60"
>
Leadtime is for reference only, order actual delivery date is subjected to Supplier’s final confirmation.
</b>
<br><b
class=
"pr60"
>
Leadtime is for reference only, order actual delivery date is subjected to Supplier’s final
<br/>
confirmation.
</b>
<br>
3.>
<span
class=
"pr30"
>
所有库存均以我司确认为准。
</span>
<br>
3.>
<span
class=
"pr30"
>
所有库存均以我司确认为准。
</span>
<br><b
class=
"pr60"
>
Available to sell stock is open to all customers based on our confirmation.
</b>
<br><b
class=
"pr60"
>
Available to sell stock is open to all customers based on our confirmation.
</b>
<br>
4.>
<b
class=
"pr30"
>
Subject to ICHUNT TECHNOLOGY' terms
</b>
<br>
4.>
<b
class=
"pr30"
>
Subject to ICHUNT TECHNOLOGY' terms
</b>
</div>
</div>
</div>
</div>
</body>
</body>
</html>
</html>
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