Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
d7b9155c
Commit
d7b9155c
authored
Jan 25, 2021
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打印功能优化
parent
1d858546
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
63 additions
and
58 deletions
+63
-58
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Model/printOrder_model/printOrderModel.swift
...nessPlatform/Model/printOrder_model/printOrderModel.swift
+2
-0
GeliBusinessPlatform/ViewController/工作中心/WorkItemCollectionViewCell.swift
...form/ViewController/工作中心/WorkItemCollectionViewCell.swift
+2
-2
GeliBusinessPlatform/ViewController/工作中心/WorkItemCollectionViewCell.xib
...atform/ViewController/工作中心/WorkItemCollectionViewCell.xib
+5
-5
GeliBusinessPlatform/ViewController/打印订单/PrintListMgVc.swift
GeliBusinessPlatform/ViewController/打印订单/PrintListMgVc.swift
+45
-34
GeliBusinessPlatform/ViewController/打印订单/PrintViewController.swift
...essPlatform/ViewController/打印订单/PrintViewController.swift
+5
-13
GeliBusinessPlatform/ViewController/打印订单/print_bottom_cell.xib
...usinessPlatform/ViewController/打印订单/print_bottom_cell.xib
+3
-3
GeliBusinessPlatform/ViewController/订单详情/OrderDViewController.swift
...ssPlatform/ViewController/订单详情/OrderDViewController.swift
+1
-1
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
d7b9155c
No preview for this file type
GeliBusinessPlatform/Model/printOrder_model/printOrderModel.swift
View file @
d7b9155c
...
...
@@ -43,6 +43,7 @@ class printOrder_data_res_model: Mappable {
var
district_id
:
Int
?
// 区id(order_res)
var
province
:
String
?
//省
var
address_str
:
String
?
//详细地址
var
city
:
String
?
//市
var
district
:
String
?
//区
var
mobile
:
String
?
//手机
...
...
@@ -66,6 +67,7 @@ class printOrder_data_res_model: Mappable {
mobile
<-
map
[
"mobile"
]
consignee
<-
map
[
"consignee"
]
address_str
<-
map
[
"address_str"
]
}
}
...
...
GeliBusinessPlatform/ViewController/工作中心/WorkItemCollectionViewCell.swift
View file @
d7b9155c
...
...
@@ -22,9 +22,9 @@ class WorkItemCollectionViewCell: UICollectionViewCell {
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
if
itemNameLbl
.
text
!.
count
>
5
{
btm_margin
.
constant
=
0
btm_margin
.
constant
=
1
}
else
{
btm_margin
.
constant
=
9
btm_margin
.
constant
=
10
}
}
...
...
GeliBusinessPlatform/ViewController/工作中心/WorkItemCollectionViewCell.xib
View file @
d7b9155c
...
...
@@ -12,23 +12,23 @@
<placeholder
placeholderIdentifier=
"IBFilesOwner"
id=
"-1"
userLabel=
"File's Owner"
/>
<placeholder
placeholderIdentifier=
"IBFirstResponder"
id=
"-2"
customClass=
"UIResponder"
/>
<collectionViewCell
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
id=
"gTV-IL-0wX"
customClass=
"WorkItemCollectionViewCell"
customModule=
"TestClass"
customModuleProvider=
"target"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"100"
height=
"
91
"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"100"
height=
"
100
"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<view
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"100"
height=
"
91
"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"100"
height=
"
100
"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<subviews>
<imageView
clipsSubviews=
"YES"
userInteractionEnabled=
"NO"
contentMode=
"scaleAspectFit"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"pg3-lh-kp9"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"100"
height=
"
91
"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"100"
height=
"
100
"
/>
</imageView>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"item名称"
textAlignment=
"center"
lineBreakMode=
"tailTruncation"
numberOfLines=
"0"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"nZJ-9s-cJg"
>
<rect
key=
"frame"
x=
"0.0"
y=
"
77
.5"
width=
"100"
height=
"13.5"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"
86
.5"
width=
"100"
height=
"13.5"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"11"
/>
<color
key=
"textColor"
name=
"标题字颜色"
/>
<nil
key=
"highlightedColor"
/>
</label>
<imageView
clipsSubviews=
"YES"
userInteractionEnabled=
"NO"
contentMode=
"scaleAspectFit"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
image=
"bianji"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"qfI-0k-kQG"
>
<rect
key=
"frame"
x=
"27.5"
y=
"
8.5
"
width=
"45"
height=
"45"
/>
<rect
key=
"frame"
x=
"27.5"
y=
"
13
"
width=
"45"
height=
"45"
/>
<constraints>
<constraint
firstAttribute=
"width"
constant=
"45"
id=
"AKt-O2-9tI"
/>
<constraint
firstAttribute=
"height"
constant=
"45"
id=
"mL5-ZO-3vy"
/>
...
...
GeliBusinessPlatform/ViewController/打印订单/PrintListMgVc.swift
View file @
d7b9155c
...
...
@@ -43,7 +43,7 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
pc
.
printInfo
=
printInfo
pc
.
delegate
=
self
if
userName
!
=
"不二制油"
{
//普通
if
userName
=
=
"不二制油"
{
//普通
let
dic
=
[
"user_token"
:
UserToken
as
Any
,
"order_id"
:
order_id
as
Any
,
"remittance_account"
:
""
as
Any
,
...
...
@@ -67,27 +67,31 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
}
else
{
let
vc
=
viewControllers
[
selectIndex
]
if
vc
.
FM_str
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请输入汇款账户"
),
delay
:
1.2
)
return
}
if
vc
.
dzStr
.
count
==
0
&&
vc
.
type
!=
1
{
HUD
.
flash
(
.
label
(
"请选择区域"
),
delay
:
1.2
)
return
}
if
vc
.
detail_adr_str
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写地址"
),
delay
:
1.2
)
return
}
if
vc
.
phone_str
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写电话"
),
delay
:
1.2
)
return
}
if
vc
.
consignee_str
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写联系人"
),
delay
:
1.2
)
return
if
selectIndex
!=
0
{
if
vc
.
FM_str
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请输入汇款账户"
),
delay
:
1.2
)
return
}
if
vc
.
dzStr
.
count
==
0
&&
vc
.
type
!=
1
{
HUD
.
flash
(
.
label
(
"请选择区域"
),
delay
:
1.2
)
return
}
if
vc
.
detail_adr_str
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写地址"
),
delay
:
1.2
)
return
}
if
vc
.
phone_str
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写电话"
),
delay
:
1.2
)
return
}
if
vc
.
consignee_str
.
count
==
0
{
HUD
.
flash
(
.
label
(
"请填写联系人"
),
delay
:
1.2
)
return
}
}
var
dic
:
Dictionary
<
String
,
Any
>
=
Dictionary
()
print
(
"change == "
,
selectIndex
)
if
vc
.
isChange
{
dic
=
[
"user_token"
:
UserToken
as
Any
,
"order_id"
:
order_id
as
Any
,
...
...
@@ -97,7 +101,8 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
"district_id"
:
vc
.
areaDict
[
"area_id"
]
as
Any
,
"mobile"
:
vc
.
phone_str
as
Any
,
"consignee"
:
vc
.
consignee_str
as
Any
,
"print_type"
:
selectIndex
as
Any
"address_str"
:
vc
.
detail_adr_str
as
Any
,
"print_type"
:
vc
.
type
as
Any
]
}
else
{
dic
=
[
"user_token"
:
UserToken
as
Any
,
...
...
@@ -108,7 +113,8 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
"district_id"
:
""
as
Any
,
"mobile"
:
vc
.
phone_str
as
Any
,
"consignee"
:
vc
.
consignee_str
as
Any
,
"print_type"
:
selectIndex
as
Any
"address_str"
:
vc
.
detail_adr_str
as
Any
,
"print_type"
:
vc
.
type
as
Any
]
}
printUrl
(
dic
)
{
(
data
)
in
...
...
@@ -117,24 +123,28 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
let
url
=
URL
(
string
:
urlStr
!
)
let
request
=
URLRequest
.
init
(
url
:
url
!
,
cachePolicy
:
.
reloadRevalidatingCacheData
,
timeoutInterval
:
10
)
self
.
web_vc
.
wkWebView
.
load
(
request
)
HUD
.
flash
(
.
progress
)
HUD
.
flash
(
.
progress
,
delay
:
1.2
)
self
.
isAlreadyClick
=
true
}
failture
:
{
(
err
)
in
}
}
}
var
isAlreadyClick
=
false
func
webView
(
_
webView
:
WKWebView
,
didFinish
navigation
:
WKNavigation
!
){
print
(
"页面加载完成..."
)
HUD
.
hide
()
let
formatter
=
webView
.
viewPrintFormatter
()
pc
.
printFormatter
=
formatter
formatter
.
startPage
=
0
pc
.
present
(
animated
:
true
)
{
(
printer
,
result
,
err
)
in
print
(
result
)
if
isAlreadyClick
{
isAlreadyClick
=
false
delay
(
0.5
)
{
[
self
]
in
let
formatter
=
webView
.
viewPrintFormatter
()
pc
.
printFormatter
=
formatter
formatter
.
startPage
=
0
pc
.
present
(
animated
:
true
)
{
(
printer
,
result
,
err
)
in
print
(
result
)
}
}
}
}
@IBOutlet
weak
var
contentV
:
UIView
!
...
...
@@ -155,7 +165,9 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
if
printData
?
.
consignee
!=
nil
{
vc
.
consignee_str
=
(
printData
?
.
consignee
)
!
}
if
printData
?
.
address_str
!=
nil
{
vc
.
detail_adr_str
=
(
printData
?
.
address_str
)
!
}
}
}
}
...
...
@@ -202,7 +214,7 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
self
.
view
.
addSubview
(
navbar
)
SetTopFrameView
(
view
:
contentV
,
btmView
:
self
.
view
)
if
userName
!
=
"不二制油"
{
if
userName
=
=
"不二制油"
{
normal_type_btn
.
isHidden
=
false
}
else
{
normal_type_btn
.
isHidden
=
true
...
...
@@ -241,7 +253,6 @@ class PrintListMgVc: BaseViewController, PagingViewControllerDelegate,UIPrintInt
guard
let
item
=
pagingItem
as?
PagingIndexItem
else
{
return
}
if
selectIndex
!=
item
.
index
{
selectIndex
=
item
.
index
}
}
}
...
...
GeliBusinessPlatform/ViewController/打印订单/PrintViewController.swift
View file @
d7b9155c
...
...
@@ -126,26 +126,17 @@ class PrintViewController: BaseViewController,UITableViewDelegate,UITableViewDat
return
genderLbl
}
var
tempProvince_select
=
0
//临时省id
var
tempCity_select
=
0
//临时市id
var
tempArea_select
=
0
//临时区id
var
tempProvince_select
=
-
1
//临时省id
var
tempCity_select
=
-
1
//临时市id
var
tempArea_select
=
-
1
//临时区id
var
isChange
=
false
// var province_id = ""
// var city_id = ""
// var area_id = ""
@objc
func
adrSelectFinish
(
sender
:
UIButton
){
var
proName
=
""
var
cityName
=
""
var
areaName
=
""
let
proDict
=
addressArray
[
provinceIndex
]
as!
Dictionary
<
String
,
Any
>
var
cityDict
:
Dictionary
<
String
,
Any
>
=
Dictionary
()
var
areaDict
:
Dictionary
<
String
,
Any
>
=
Dictionary
()
cityDict
[
"area_id"
]
=
""
areaDict
[
"area_id"
]
=
""
cityDict
[
"area_name"
]
=
""
...
...
@@ -358,7 +349,7 @@ class PrintViewController: BaseViewController,UITableViewDelegate,UITableViewDat
list_view
.
separatorStyle
=
.
none
list_view
.
showsVerticalScrollIndicator
=
false
getIndex
()
if
userName
=
=
"不二制油"
{
if
userName
!
=
"不二制油"
{
get_location_id
()
}
}
...
...
@@ -406,6 +397,7 @@ class PrintViewController: BaseViewController,UITableViewDelegate,UITableViewDat
"district_id"
:
areaDict
[
"area_id"
]
as
Any
,
"mobile"
:
phone_str
as
Any
,
"consignee"
:
consignee_str
as
Any
,
"address_str"
:
detail_adr_str
as
Any
,
"print_type"
:
type
as
Any
]
...
...
GeliBusinessPlatform/ViewController/打印订单/print_bottom_cell.xib
View file @
d7b9155c
...
...
@@ -175,7 +175,7 @@
<color
key=
"textColor"
name=
"灰色字体颜色"
/>
<nil
key=
"highlightedColor"
/>
</label>
<textField
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"left"
contentVerticalAlignment=
"center"
placeholder=
"请填写地址"
textAlignment=
"natural"
minimumFontSize=
"17"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"jiF-F7-HDQ"
>
<textField
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"left"
contentVerticalAlignment=
"center"
placeholder=
"请填写地址"
textAlignment=
"natural"
minimumFontSize=
"17"
clearButtonMode=
"whileEditing"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"jiF-F7-HDQ"
>
<rect
key=
"frame"
x=
"15"
y=
"219.5"
width=
"283.5"
height=
"34"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"34"
id=
"zWI-Fs-mcz"
/>
...
...
@@ -209,7 +209,7 @@
<color
key=
"textColor"
name=
"灰色字体颜色"
/>
<nil
key=
"highlightedColor"
/>
</label>
<textField
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"left"
contentVerticalAlignment=
"center"
placeholder=
"请填写电话"
textAlignment=
"natural"
minimumFontSize=
"17"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"1EG-8Y-For"
>
<textField
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"left"
contentVerticalAlignment=
"center"
placeholder=
"请填写电话"
textAlignment=
"natural"
minimumFontSize=
"17"
clearButtonMode=
"whileEditing"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"1EG-8Y-For"
>
<rect
key=
"frame"
x=
"15"
y=
"297.5"
width=
"283.5"
height=
"34"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"34"
id=
"gzm-O4-gYm"
/>
...
...
@@ -243,7 +243,7 @@
<color
key=
"textColor"
name=
"灰色字体颜色"
/>
<nil
key=
"highlightedColor"
/>
</label>
<textField
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"left"
contentVerticalAlignment=
"center"
placeholder=
"请填写联系人"
textAlignment=
"natural"
minimumFontSize=
"17"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"SHz-wb-OzF"
>
<textField
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"left"
contentVerticalAlignment=
"center"
placeholder=
"请填写联系人"
textAlignment=
"natural"
minimumFontSize=
"17"
clearButtonMode=
"whileEditing"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"SHz-wb-OzF"
>
<rect
key=
"frame"
x=
"15"
y=
"375.5"
width=
"283.5"
height=
"34"
/>
<constraints>
<constraint
firstAttribute=
"height"
constant=
"34"
id=
"ojX-2U-wGA"
/>
...
...
GeliBusinessPlatform/ViewController/订单详情/OrderDViewController.swift
View file @
d7b9155c
...
...
@@ -1368,7 +1368,7 @@ class OrderDViewController: BaseViewController,UITableViewDelegate,UITableViewDa
}
break
case
"打印"
:
// orderId = 12
445
// orderId = 12
599
printOrder
([
"user_token"
:
UserToken
as
Any
,
"order_id"
:
orderId
as
Any
])
{
[
self
]
(
data
)
in
let
d
=
data
as!
printOrder_model
let
vc
=
PrintListMgVc
()
...
...
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