Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
office-web
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
office
office-web
Commits
0bf7bf0a
Commit
0bf7bf0a
authored
May 22, 2019
by
无尘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改日权重显示
parent
a9754f08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
15 deletions
+33
-15
api.js
src/api/api.js
+17
-0
companyDaySet.vue
src/views/enterpriseApp/quota/companyDaySet.vue
+16
-15
No files found.
src/api/api.js
View file @
0bf7bf0a
...
...
@@ -145,3 +145,20 @@ export const postForm = (url, params) => {
headers
:
{}
//'content-type': 'application/x-www-form-urlencoded'multipart/form-data{"token": token}
});
};
/**
* post excel
*/
export
const
postExcel
=
(
url
,
params
)
=>
{
params
.
requestProject
=
'haoban-manage-web'
;
return
Vue
.
axios
({
method
:
'post'
,
url
:
`
${
local
}${
url
}
`
,
data
:
qs
.
stringify
(
params
),
responseType
:
'blob'
,
headers
:
{
'content-type'
:
'application/x-www-form-urlencoded'
}
//multipart/form-data{"token": token}
});
};
src/views/enterpriseApp/quota/companyDaySet.vue
View file @
0bf7bf0a
...
...
@@ -26,7 +26,7 @@
<div
class=
"day grid white-color"
v-for=
"(it, index) in myObject.empytGrids"
:key=
"index + 'empytGrids'"
></div>
</
template
>
<div
class=
"day w-p-14 selectable"
:class=
"day == 0 ? 'hide' : ''"
v-for=
"(day, index) in myObject.days"
:key=
"index"
>
<div
class=
"w-120 font-14 color-909399 day-performance"
>
{{ day.performanceDay }}
</div>
<div
class=
"w-120 font-14 color-909399 day-performance"
>
{{ day.
month +'-'+ day.
performanceDay }}
</div>
<div
class=
"target-value "
>
<el-input
class=
"w-120"
v-model=
"day.weightValue"
placeholder=
"请输入权重值"
:disabled=
"settingAble == 0"
></el-input>
</div>
...
...
@@ -115,19 +115,19 @@ export default {
* 一位数添加 0
* @param num (如:1-9)
*/
addZero
:
function
(
num
)
{
addZero
(
num
)
{
return
num
<
10
?
'0'
+
parseInt
(
num
)
:
num
;
},
// =============获取当月有多少天(下个月月初是多少)==========
getThisMonthDays
:
function
(
year
,
month
)
{
getThisMonthDays
(
year
,
month
)
{
return
new
Date
(
year
,
month
,
0
).
getDate
();
},
// =============获取当月第一周第一天是周几===========
getFirstDayOfWeek
:
function
(
year
,
month
)
{
getFirstDayOfWeek
(
year
,
month
)
{
return
new
Date
(
Date
.
UTC
(
year
,
month
-
1
,
1
)).
getDay
();
},
// =============获取当月最后一天是周几===========
getLastDayOfWeek
:
function
(
year
,
month
)
{
getLastDayOfWeek
(
year
,
month
)
{
return
new
Date
(
Date
.
UTC
(
year
,
month
-
1
,
this
.
getThisMonthDays
(
year
,
month
))).
getDay
();
},
// =============获取当年月日是周几===========
...
...
@@ -135,8 +135,8 @@ export default {
return
new
Date
(
year
,
month
-
1
,
day
).
getDay
();
},
//====================计算当前年月空的几天 =============
calculateEmptyGrids
:
function
(
year
,
month
)
{
const
firstDayOfWeek
=
this
.
getFirstDayOfWeek
(
year
,
month
);
async
calculateEmptyGrids
(
year
,
month
)
{
const
firstDayOfWeek
=
await
this
.
getFirstDayOfWeek
(
year
,
month
);
let
empytGrids
=
[];
if
(
firstDayOfWeek
>
0
)
{
for
(
let
i
=
0
;
i
<
firstDayOfWeek
;
i
++
)
{
...
...
@@ -146,8 +146,8 @@ export default {
return
empytGrids
;
},
//====================计算当前年月最后几天空的几天 =============
calculateLastEmptyGrids
:
function
(
year
,
month
)
{
const
lastDayOfWeek
=
this
.
getLastDayOfWeek
(
year
,
month
);
async
calculateLastEmptyGrids
(
year
,
month
)
{
const
lastDayOfWeek
=
await
this
.
getLastDayOfWeek
(
year
,
month
);
let
lastEmpytGrids
=
[];
if
(
lastDayOfWeek
>=
0
)
{
for
(
let
i
=
0
;
i
<
6
-
lastDayOfWeek
;
i
++
)
{
...
...
@@ -156,13 +156,13 @@ export default {
}
return
lastEmpytGrids
;
},
calculateDays
:
function
(
year
,
month
)
{
async
calculateDays
(
year
,
month
)
{
let
that
=
this
;
let
myObject
=
{};
//月对象
myObject
[
'year'
]
=
year
;
myObject
[
'month'
]
=
that
.
addZero
(
month
);
myObject
[
'month'
]
=
await
that
.
addZero
(
month
);
//计算当前年月空的几天
let
empytGrids
=
that
.
calculateEmptyGrids
(
year
,
month
);
let
empytGrids
=
await
that
.
calculateEmptyGrids
(
year
,
month
);
if
(
empytGrids
.
length
>
0
)
{
myObject
[
'hasEmptyGrid'
]
=
true
;
myObject
[
'empytGrids'
]
=
empytGrids
;
...
...
@@ -171,7 +171,7 @@ export default {
myObject
[
'empytGrids'
]
=
[];
}
// 最后空格
let
lastEmpytGrids
=
that
.
calculateLastEmptyGrids
(
year
,
month
);
let
lastEmpytGrids
=
await
that
.
calculateLastEmptyGrids
(
year
,
month
);
if
(
lastEmpytGrids
.
length
>
0
)
{
myObject
[
'hasLastEmptyGrid'
]
=
true
;
myObject
[
'lastEmpytGrids'
]
=
lastEmpytGrids
;
...
...
@@ -180,7 +180,7 @@ export default {
myObject
[
'lastEmpytGrids'
]
=
[];
}
let
days
=
[];
let
thisMonthDays
=
that
.
getThisMonthDays
(
year
,
month
);
//这个月有多少天
let
thisMonthDays
=
await
that
.
getThisMonthDays
(
year
,
month
);
//这个月有多少天
for
(
let
i
=
1
;
i
<=
thisMonthDays
;
i
++
)
{
let
day
=
{};
/* 判断权重值 */
...
...
@@ -201,8 +201,9 @@ export default {
}
}
day
[
'performanceDay'
]
=
i
;
//
that.addZero(i);
day
[
'performanceDay'
]
=
that
.
addZero
(
i
);
day
[
'date'
]
=
year
+
'-'
+
that
.
addZero
(
month
)
+
'-'
+
that
.
addZero
(
i
);
day
[
'month'
]
=
that
.
addZero
(
month
);
days
.
push
(
day
);
}
myObject
[
'days'
]
=
days
;
...
...
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