Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
frontend
/
qqxb-self-service
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
70e36a68
authored
Jun 23, 2020
by
cocomilk2012
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
工资条列表页
工资条详情页接口报错
parent
59acd45e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
197 additions
and
243 deletions
src/servicesImpl/employee/employeeImpl.ts
src/utils/method.ts
src/views/Home.vue
src/views/PaySlips.vue
src/servicesImpl/employee/employeeImpl.ts
View file @
70e36a68
...
...
@@ -274,8 +274,8 @@ class EmployeeService implements EmployeeInterface {
public
getSalaryInfo
(
params
:
any
):
Promise
<
any
>
{
let
url
=
urls
.
employeeUrl
+
`/api/user/dispatch/companies/
${
params
.
idNo
}
/employee/
${
params
.
spId
}
/payroll`
;
return
request
.
get
(
url
,
params
,
this
.
header
);
`/api/user/dispatch/companies/
${
params
.
spId
}
/employee/
${
params
.
idNo
}
/payroll`
;
return
request
.
get
(
url
,
{},
this
.
header
,
false
);
}
/**
...
...
src/utils/method.ts
View file @
70e36a68
import
http
from
'./http'
;
import
{
GetCommonPms
}
from
'@/utils/public'
;
class
Request
{
/**
* GET 请求
* @param url 请求链接
* @param params 请求参数
* @param headers 请求头信息
*/
public
get
(
url
:
string
,
params
:
any
=
{},
headers
:
any
=
{}):
Promise
<
any
>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
http
.
get
(
`
${
url
}
?
${
GetCommonPms
()}
`
,
{
params
:
params
,
headers
:
headers
}));
/**
* GET 请求
* @param url 请求链接
* @param params 请求参数
* @param headers 请求头信息
*/
public
get
(
url
:
string
,
params
:
any
=
{},
headers
:
any
=
{},
special
:
boolean
=
false
):
Promise
<
any
>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
http
.
get
(
`
${
url
}
?
${
GetCommonPms
(
special
)}
`
,
{
params
:
params
,
headers
:
headers
,
})
}
);
});
}
/**
*
* POST 请求
* @param url 请求链接
* @param params 请求参数
* @param headers 请求头信息
*/
public
post
(
url
:
string
,
params
:
any
=
{},
headers
:
any
=
{},
special
:
boolean
=
false
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
http
.
post
(
`
${
url
}
?
${
GetCommonPms
(
special
)}
`
,
params
,
{
headers
:
headers
}));
/**
*
* POST 请求
* @param url 请求链接
* @param params 请求参数
* @param headers 请求头信息
*/
public
post
(
url
:
string
,
params
:
any
=
{},
headers
:
any
=
{},
special
:
boolean
=
false
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
http
.
post
(
`
${
url
}
?
${
GetCommonPms
(
special
)}
`
,
params
,
{
headers
:
headers
,
})
}
);
});
}
/**
*
* PUT 请求
* @param url 请求链接
* @param params 请求参数
* @param headers 请求头信息
*/
public
put
(
url
:
string
,
params
:
any
=
{},
headers
:
any
=
{})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
http
.
put
(
`
${
url
}
?
${
GetCommonPms
()}
`
,
params
,
{
headers
:
headers
})
);
});
}
/**
*
* PUT 请求
* @param url 请求链接
* @param params 请求参数
* @param headers 请求头信息
*/
public
put
(
url
:
string
,
params
:
any
=
{},
headers
:
any
=
{})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
http
.
put
(
`
${
url
}
?
${
GetCommonPms
()}
`
,
params
,
{
headers
:
headers
}));
/**
*
* DELETE 请求
* @param url 请求链接
* @param params 请求参数
* @param headers 请求头信息
*/
public
delete
(
url
:
string
,
params
:
any
=
{},
headers
:
any
=
{})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
http
.
delete
(
`
${
url
}
?
${
GetCommonPms
()}
`
,
{
params
:
params
,
headers
:
headers
,
})
}
/**
*
* DELETE 请求
* @param url 请求链接
* @param params 请求参数
* @param headers 请求头信息
*/
public
delete
(
url
:
string
,
params
:
any
=
{},
headers
:
any
=
{})
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
http
.
delete
(
`
${
url
}
?
${
GetCommonPms
()}
`
,
{
params
:
params
,
headers
:
headers
}));
})
}
);
});
}
}
export
default
new
Request
();
\ No newline at end of file
export
default
new
Request
();
src/views/Home.vue
deleted
100644 → 0
View file @
59acd45e
<
template
>
<div
class=
"home"
>
<img
alt=
"Vue logo"
src=
"../assets/logo.png"
/>
</div>
</
template
>
<
script
lang=
"ts"
>
import
Vue
from
"vue"
;
import
{
Component
}
from
"vue-property-decorator"
;
import
{
formatDate
,
CheckPlatform
}
from
"@/utils/public"
;
@
Component
({
name
:
"Home"
,
components
:
{}
})
export
default
class
Home
extends
Vue
{
private
list
:
any
=
[];
created
()
{
this
.
$server
.
EmployeeService
.
getUserInfo
({}).
then
(
res
=>
{
console
.
log
(
res
);
});
}
}
</
script
>
\ No newline at end of file
src/views/PaySlips.vue
View file @
70e36a68
<
template
>
<div
class=
"main main-paySlips"
>
<
div
class=
"slips-top"
></div
>
<div
class=
"slips-mid"
>
<
!--
<div
class=
"slips-top"
></div>
--
>
<
!--
<
div
class=
"slips-mid"
>
<ul
id=
"select"
>
<li>
<div
class=
"select-head"
>
...
...
@@ -17,25 +17,37 @@
<li
class=
"option-item"
optionVal=
"2019"
>
2019
</li>
</ul>
<div
ref=
"chart"
style=
"height: 20rem;width: 100%"
></div>
</div>
</div>
-->
<div
class=
"slips-bottom"
>
<h3>
收入记录
</h3>
<hr
/>
<div
class=
"box2"
id=
"main-content"
>
<div
class=
"child"
>
<span
class=
"year font1"
>
year
</span>
<div
class=
"child"
v-for=
"(itemY, indexY) in obj"
:key=
"indexY"
>
<span
class=
"year font1"
>
{{
itemY
.
year
}}
</span>
<div
class=
"data"
>
<div
class=
"month-list"
>
<div
class=
"month-list"
v-for=
"(itemM, indexM) in itemY.list"
:key=
"indexM"
>
<div
class=
"month"
>
<span
class=
"font1"
>
month
月
</span>
<span
class=
"font1"
>
{{
Number
(
itemM
.
month
)
}}
月
</span>
<span></span>
<span
class=
"font1"
>
sum
</span>
<span
class=
"font1"
>
{{
(
itemM
.
sum
?
itemM
.
sum
:
0
).
toFixed
(
2
)
}}
</span>
</div>
<div
class=
"slary"
>
<div
class=
"slary"
v-for=
"(itemD, indexD) in itemM.list"
:key=
"indexD"
>
<a
href
class=
"detail"
>
<span
class=
"font2"
>
工资 |
abbr_name
</span>
<span
class=
"font2"
>
工资 |
{{
itemD
.
abbrName
}}
</span>
<span></span>
<span
class=
"font2"
>
current_real_wage
</span>
<span
class=
"font2"
>
{{
Number
(
itemD
.
currentRealWage
).
toFixed
(
2
)
}}
</span>
</a>
</div>
</div>
...
...
@@ -48,7 +60,6 @@
<
script
lang=
"ts"
>
import
"../assets/css/labor.css"
;
import
echarts
from
"echarts"
;
import
Vue
from
"vue"
;
import
{
Button
}
from
"vant"
;
import
{
Component
}
from
"vue-property-decorator"
;
...
...
@@ -59,31 +70,56 @@ import { Component } from "vue-property-decorator";
}
})
export
default
class
PaySlips
extends
Vue
{
private
obj
:
any
=
{};
private
obj
:
any
=
[];
private
data
:
any
=
[];
private
cur_year_list
:
any
=
[
"2020"
,
"2021"
,
"2022"
,
"2023"
,
"2024"
,
"2025"
,
"2026"
,
"2027"
,
"2028"
,
"2029"
];
private
getSalaryInfo
():
void
{
let
params
=
{
edId
:
this
.
$route
.
query
.
ed_id
spId
:
this
.
$route
.
query
.
sp_id
,
idNo
:
"330881199511043934"
//localStorage.getItem("id_no")
};
this
.
$server
.
EmployeeService
.
getSalaryInfo
(
params
)
.
then
(
res
=>
{
console
.
log
(
"res="
+
JSON
.
stringify
(
res
)
+
"工资条信息"
);
this
.
obj
=
res
;
this
.
data
=
res
;
this
.
changeData
();
console
.
log
(
"obj="
,
JSON
.
stringify
(
this
.
obj
));
})
.
catch
(
error
=>
{});
}
// @ts-ignore
private
changeData
()
{
this
.
cur_year_list
.
forEach
((
item
:
any
)
=>
{
let
arr
:
any
=
[];
arr
=
this
.
transData
(
this
.
data
,
item
);
if
(
arr
)
{
this
.
obj
.
push
(...
arr
);
}
});
}
private
transData
(
data
:
any
,
cur_year
:
any
)
{
let
columnData
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
];
let
obj
=
[];
let
yearList
=
[];
for
(
const
item
in
data
)
{
if
(
data
.
hasOwnProperty
(
item
))
{
const
element
=
data
[
item
];
if
(
element
.
pay
_t
ime
)
{
const
year
=
element
.
pay
_t
ime
.
substr
(
0
,
4
);
if
(
element
.
pay
T
ime
)
{
const
year
=
element
.
pay
T
ime
.
substr
(
0
,
4
);
if
(
year
==
cur_year
)
{
yearList
.
push
(
year
);
}
...
...
@@ -104,9 +140,9 @@ export default class PaySlips extends Vue {
const
oy
=
yObj
.
year
;
const
set
=
new
Set
();
for
(
const
item
of
data
)
{
const
iy
=
item
.
pay
_t
ime
.
substr
(
0
,
4
);
const
iy
=
item
.
pay
T
ime
.
substr
(
0
,
4
);
if
(
oy
===
iy
)
{
const
month
=
item
.
pay
_t
ime
.
substr
(
5
,
2
);
const
month
=
item
.
pay
T
ime
.
substr
(
5
,
2
);
set
.
add
(
month
);
}
}
...
...
@@ -123,10 +159,10 @@ export default class PaySlips extends Vue {
const
month
=
m
.
month
;
let
sum
=
0
;
for
(
const
item
of
data
)
{
if
(
item
.
pay
_t
ime
.
indexOf
(
month
)
>
-
1
)
{
if
(
item
.
pay
T
ime
.
indexOf
(
month
)
>
-
1
)
{
// @ts-ignore
m
.
list
.
push
(
item
);
sum
+=
item
.
current
_real_w
age
;
sum
+=
item
.
current
RealW
age
;
}
}
let
mon
=
parseInt
(
month
);
...
...
@@ -140,143 +176,73 @@ export default class PaySlips extends Vue {
}
private
init
()
{
// @ts-ignore
option
.
series
[
1
].
data
=
columnData
;
// @ts-ignore
myChart
.
setOption
(
option
);
// @ts-ignore
myChart
.
dispatchAction
({
type
:
"highlight"
,
seriesIndex
:
0
,
dataIndex
:
12
});
this
.
getSalaryInfo
();
// this.obj = [
// {
// year: "2020",
// list: [
// {
// month: "06",
// sum: null,
// list: [
// {
// no: "GZ20200608160345451651972",
// currentIncome: 650000,
// abbrName: "1022服务商Q",
// cardNo: "330881199511043934",
// currentRealWage: 500000,
// payTime: "2020-06-08"
// }
// ]
// }
// ]
// },
// {
// year: "2021",
// list: [
// {
// month: "06",
// sum: null,
// list: [
// {
// no: "GZ20200608160345451651972",
// currentIncome: 650000,
// abbrName: "1022服务商Q",
// cardNo: "330881199511043934",
// currentRealWage: 500000,
// payTime: "2020-06-08"
// }
// ]
// },
// {
// month: "07",
// sum: null,
// list: [
// {
// no: "GZ20200608160345451651972",
// currentIncome: 650000,
// abbrName: "1022服务商Q",
// cardNo: "330881199511043934",
// currentRealWage: 500000,
// payTime: "2020-06-08"
// },
// {
// no: "GZ20200608160345451651972",
// currentIncome: 650000,
// abbrName: "1022服务商Q",
// cardNo: "330881199511043934",
// currentRealWage: 500000,
// payTime: "2020-06-08"
// }
// ]
// }
// ]
// }
// ];
}
created
()
{
var
myChart
=
echarts
.
init
(
this
.
$refs
.
chart
as
HTMLCanvasElement
);
var
dataAxis
=
[
"01"
,
"02"
,
"03"
,
"04"
,
"05"
,
"06"
,
"07"
,
"08"
,
"09"
,
"10"
,
"11"
,
"12"
];
var
columnData
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
10000
];
var
yMax
=
15000
;
var
dataShadow
=
[];
var
date
=
new
Date
();
var
cur_year
=
date
.
getFullYear
();
for
(
var
i
=
0
;
i
<
columnData
.
length
;
i
++
)
{
dataShadow
.
push
(
yMax
);
}
const
option
:
any
=
{
xAxis
:
{
offset
:
10
,
name
:
"元"
,
nameLocation
:
"start"
,
nameTextStyle
:
{
padding
:
[
45
,
-
10
,
0
,
0
]
},
data
:
dataAxis
,
axisLabel
:
{
inside
:
false
,
textStyle
:
{
color
:
"#BABFC2"
}
},
axisTick
:
{
show
:
false
},
axisLine
:
{
show
:
false
},
z
:
10
},
yAxis
:
{
name
:
"月/"
,
nameLocation
:
"start"
,
nameTextStyle
:
{
padding
:
[
2
,
55
,
0
,
0
]
},
axisLine
:
{
show
:
false
},
splitLine
:
{
// grid 分割线设置
show
:
false
},
axisTick
:
{
show
:
false
},
axisLabel
:
{
textStyle
:
{
color
:
"#BABFC2"
}
}
},
grid
:
{
bottom
:
"30%"
,
top
:
"10%"
,
width
:
"82%"
,
left
:
"15%"
},
series
:
[
{
type
:
"bar"
,
itemStyle
:
{
normal
:
{
color
:
"rgba(0,0,0,0.05)"
}
},
barGap
:
"-100%"
,
barCategoryGap
:
"40%"
,
data
:
dataShadow
,
animation
:
false
},
{
type
:
"bar"
,
barWidth
:
8
,
itemStyle
:
{
normal
:
{
barBorderRadius
:
[
50
,
50
,
0
,
0
],
color
:
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
0
,
1
,
[
{
offset
:
0
,
color
:
"#33CD8B"
},
{
offset
:
0.5
,
color
:
"#22BD7A"
},
{
offset
:
1
,
color
:
"#22BD7A"
}
])
},
emphasis
:
{
barBorderRadius
:
[
50
,
50
,
0
,
0
],
color
:
new
echarts
.
graphic
.
LinearGradient
(
0
,
0
,
0
,
1
,
[
{
offset
:
0
,
color
:
"#33CD8B"
},
{
offset
:
0.5
,
color
:
"#22BD7A"
},
{
offset
:
1
,
color
:
"#22BD7A"
}
]),
label
:
{
show
:
true
,
position
:
"top"
,
rich
:
{},
textStyle
:
{
color
:
"#FFFFFF"
},
backgroundColor
:
{
image
:
"../assets/images/echart_backgorund.png"
},
padding
:
[
10
,
12
,
12
,
8
]
}
}
},
data
:
columnData
}
]
};
this
.
init
();
}
}
...
...
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