Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
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
罗超
confucius
Commits
2997beee
Commit
2997beee
authored
Aug 20, 2021
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
98f3dab2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
141 additions
and
10 deletions
+141
-10
chaneelcode-form.vue
src/components/enterprise/chaneelcode-form.vue
+68
-7
allmaterial.vue
src/components/enterprise/material/allmaterial.vue
+1
-1
textmaterial.vue
src/components/enterprise/material/textmaterial.vue
+1
-1
addchannelcode.vue
src/pages/enterprise/addchannelcode.vue
+71
-1
No files found.
src/components/enterprise/chaneelcode-form.vue
View file @
2997beee
...
@@ -93,10 +93,10 @@
...
@@ -93,10 +93,10 @@
<el-form-item
label=
"固定时段:"
v-if=
"peopletype==1"
>
<el-form-item
label=
"固定时段:"
v-if=
"peopletype==1"
>
<div
v-for=
"(x,y) in addMsg "
:key=
"y"
<div
v-for=
"(x,y) in addMsg "
:key=
"y"
style=
"display: flex;align-items: center;margin-top: 10px;"
>
style=
"display: flex;align-items: center;margin-top: 10px;"
>
<el-time-select
:disabled=
"
y==0"
placeholder=
"起始时间"
v-model=
"x.StartHours"
<el-time-select
:disabled=
"
x.IsDefault==1"
placeholder=
"起始时间"
v-model=
"x.StartHours"
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', }">
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', }">
</el-time-select>
</el-time-select>
<el-time-select
:disabled=
"
y==0"
placeholder=
"结束时间"
v-model=
"x.EndHours
"
<el-time-select
:disabled=
"
x.IsDefault==1"
placeholder=
"结束时间"
v-model=
"x.EndHours"
@
change=
"changeTime(y,2)
"
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', minTime: x.StartHours}">
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', minTime: x.StartHours}">
</el-time-select>
</el-time-select>
<el-select
v-model=
"x.EmpId"
placeholder=
"请选择"
@
change=
"selectPersonnel(y)"
>
<el-select
v-model=
"x.EmpId"
placeholder=
"请选择"
@
change=
"selectPersonnel(y)"
>
...
@@ -112,10 +112,10 @@
...
@@ -112,10 +112,10 @@
<el-form-item
label=
"固定时段:"
v-if=
"peopletype==2"
>
<el-form-item
label=
"固定时段:"
v-if=
"peopletype==2"
>
<div
v-for=
"(x,y) in addMsg "
:key=
"y"
>
<div
v-for=
"(x,y) in addMsg "
:key=
"y"
>
<div
style=
"display: flex;align-items: flex-start;margin-top: 10px;"
>
<div
style=
"display: flex;align-items: flex-start;margin-top: 10px;"
>
<el-time-select
:disabled=
"
y==0"
placeholder=
"起始时间"
v-model=
"x.StartHours"
@
change=
"changeTime()"
<el-time-select
:disabled=
"
x.IsDefault==1"
placeholder=
"起始时间"
v-model=
"x.StartHours"
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', }">
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', }">
</el-time-select>
</el-time-select>
<el-time-select
:disabled=
"
y==0"
placeholder=
"结束时间"
v-model=
"x.EndHours"
@
change=
"changeTime(
)"
<el-time-select
:disabled=
"
x.IsDefault==1"
placeholder=
"结束时间"
v-model=
"x.EndHours"
@
change=
"changeTime(y,2
)"
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', minTime: x.StartHours}">
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', minTime: x.StartHours}">
</el-time-select>
</el-time-select>
<div
style=
"max-width: 320px;"
>
<div
style=
"max-width: 320px;"
>
...
@@ -515,11 +515,72 @@
...
@@ -515,11 +515,72 @@
}
}
})
})
},
},
changeTime
(){
changeTime
(
index
,
type
){
console
.
log
(
'进入'
)
if
(
this
.
addMsg
[
index
].
StartHours
==
''
){
console
.
log
(
this
.
addMsg
)
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`先选择开始时间`
,
position
:
'top'
})
this
.
addMsg
[
index
].
EndHours
=
''
;
return
}
let
a
=
this
.
addMsg
[
index
].
StartHours
let
b
=
this
.
addMsg
[
index
].
EndHours
let
continuemap
=
true
this
.
addMsg
.
map
((
x
,
y
)
=>
{
if
(
continuemap
==
false
){
return
}
if
(
x
.
IsDefault
!=
1
&&
y
!=
index
){
//默认和选择自己的时候不做判断
let
bx
=
x
.
StartHours
;
let
by
=
x
.
EndHours
;
continuemap
=
this
.
checkTime
(
a
,
b
,
bx
,
by
)
if
(
continuemap
==
false
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`时间段存在冲突`
,
position
:
'top'
})
this
.
addMsg
[
index
].
StartHours
=
''
;
this
.
addMsg
[
index
].
EndHours
=
''
;
}
}
})
},
checkTime
(
a
,
b
,
x
,
y
){
var
times1
=
[],
times2
=
[];
times1
.
push
([
a
,
b
]);
times2
.
push
([
x
,
y
]);
var
flag
=
false
;
//循环比较时间段是否冲突
for
(
var
i
=
0
;
i
<
times1
.
length
;
i
++
)
{
if
(
flag
)
break
;
for
(
var
j
=
0
;
j
<
times2
.
length
;
j
++
)
{
if
(
this
.
check
(
times1
[
i
][
0
],
times1
[
i
][
1
],
times2
[
j
][
0
],
times2
[
j
][
1
])){
flag
=
true
;
break
;
}
}
}
if
(
flag
)
{
console
.
log
(
'发生冲突'
)
return
false
;
}
else
{
console
.
log
(
'没有冲突'
)
return
true
;
}
},
check
(
a
,
b
,
x
,
y
)
{
if
(
a
>=
y
||
x
>=
b
){
return
false
;
}
else
{
return
true
;
}
}
}
}
}
}
}
...
...
src/components/enterprise/material/allmaterial.vue
View file @
2997beee
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
</div>
</div>
</div>
-->
</div>
-->
<div
class=
"page-content"
>
<div
class=
"page-content"
>
<q-table
:pagination=
"msg"
:loading=
"loading"
no-data-label=
"暂无相关数据"
flat
wrap-cells=
'true'
<q-table
:pagination=
"msg"
:loading=
"loading"
no-data-label=
"暂无相关数据"
flat
:
wrap-cells=
'true'
class=
"sticky-column-table"
separator=
"none"
title=
""
:data=
"dataList"
:columns=
"columns"
class=
"sticky-column-table"
separator=
"none"
title=
""
:data=
"dataList"
:columns=
"columns"
row-key=
"name"
>
row-key=
"name"
>
...
...
src/components/enterprise/material/textmaterial.vue
View file @
2997beee
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"textmaterial"
style=
"padding: 0;margin: 0;"
>
<div
class=
"textmaterial"
style=
"padding: 0;margin: 0;"
>
<div
class=
"page-content"
>
<div
class=
"page-content"
>
<q-table
:pagination=
"msg"
:loading=
"loading"
no-data-label=
"暂无相关数据"
flat
class=
"sticky-column-table no-bottom-table"
wrap-cells=
'true'
<q-table
:pagination=
"msg"
:loading=
"loading"
no-data-label=
"暂无相关数据"
flat
class=
"sticky-column-table no-bottom-table"
:
wrap-cells=
'true'
separator=
"none"
title=
""
:data=
"dataList"
:columns=
"columns"
row-key=
"name"
>
separator=
"none"
title=
""
:data=
"dataList"
:columns=
"columns"
row-key=
"name"
>
<template
v-slot:top=
"props"
>
<template
v-slot:top=
"props"
>
<div
class=
"col-2 q-table__title"
></div>
<div
class=
"col-2 q-table__title"
></div>
...
...
src/pages/enterprise/addchannelcode.vue
View file @
2997beee
...
@@ -242,7 +242,7 @@
...
@@ -242,7 +242,7 @@
v-model=
"item.StartHours"
size=
"small"
v-model=
"item.StartHours"
size=
"small"
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', }">
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', }">
</el-time-select>
</el-time-select>
<el-time-select
:disabled=
"item.IsDefault==1"
placeholder=
"结束时间"
<el-time-select
:disabled=
"item.IsDefault==1"
placeholder=
"结束时间"
v-model=
"item.EndHours"
size=
"small"
v-model=
"item.EndHours"
size=
"small"
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', minTime: item.StartHours}">
:picker-options=
"
{ start: '00:00', step: '01:00', end: '23:00', minTime: item.StartHours}">
</el-time-select>
</el-time-select>
...
@@ -1600,6 +1600,76 @@
...
@@ -1600,6 +1600,76 @@
},
changeTime
(
index
,
minindex
,
type
){
let
list
if
(
type
==
1
){
list
=
this
.
spweeklist
[
index
].
list
}
console
.
log
(
index
,
minindex
)
if
(
this
.
addMsg
[
index
].
StartHours
==
''
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`先选择开始时间`
,
position
:
'top'
})
this
.
addMsg
[
index
].
EndHours
=
''
;
return
}
let
a
=
this
.
addMsg
[
index
].
StartHours
let
b
=
this
.
addMsg
[
index
].
EndHours
let
continuemap
=
true
this
.
addMsg
.
map
((
x
,
y
)
=>
{
if
(
continuemap
==
false
){
return
}
if
(
x
.
IsDefault
!=
1
&&
y
!=
index
){
//默认和选择自己的时候不做判断
let
bx
=
x
.
StartHours
;
let
by
=
x
.
EndHours
;
continuemap
=
this
.
checkTime
(
a
,
b
,
bx
,
by
)
if
(
continuemap
==
false
){
this
.
$q
.
notify
({
type
:
'negative'
,
message
:
`时间段存在冲突`
,
position
:
'top'
})
this
.
addMsg
[
index
].
StartHours
=
''
;
this
.
addMsg
[
index
].
EndHours
=
''
;
}
}
})
},
checkTime
(
a
,
b
,
x
,
y
){
var
times1
=
[],
times2
=
[];
times1
.
push
([
a
,
b
]);
times2
.
push
([
x
,
y
]);
var
flag
=
false
;
//循环比较时间段是否冲突
for
(
var
i
=
0
;
i
<
times1
.
length
;
i
++
)
{
if
(
flag
)
break
;
for
(
var
j
=
0
;
j
<
times2
.
length
;
j
++
)
{
if
(
this
.
check
(
times1
[
i
][
0
],
times1
[
i
][
1
],
times2
[
j
][
0
],
times2
[
j
][
1
])){
flag
=
true
;
break
;
}
}
}
if
(
flag
)
{
console
.
log
(
'发生冲突'
)
return
false
;
}
else
{
console
.
log
(
'没有冲突'
)
return
true
;
}
},
check
(
a
,
b
,
x
,
y
)
{
if
(
a
>=
y
||
x
>=
b
){
return
false
;
}
else
{
return
true
;
}
}
}
}
}
...
...
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