Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
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
周远喜
mes-ui
Commits
845eaf7f
Commit
845eaf7f
authored
Oct 09, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug:hanle、mesplan、userselect
parent
0f2d6281
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
681 additions
and
718 deletions
+681
-718
userSelect.vue
components/page/userSelect.vue
+403
-412
index.vue
pages/handle/index.vue
+277
-306
index.vue
pages/mesPlan/index.vue
+1
-0
No files found.
components/page/userSelect.vue
View file @
845eaf7f
<
template
>
<
template
>
<div>
<div>
<div
v-if=
"theme == 'list'"
class=
"flex fd userSelect"
>
<div
v-if=
"theme == 'list'"
class=
"flex fd userSelect"
>
<div
class=
"fg1 users"
>
<div
class=
"fg1 users"
>
<dl
v-for=
"(g, i) in group"
:key=
"i"
>
<dl
v-for=
"(g, i) in group"
:key=
"i"
>
<dt
:class=
"
{ checked: g.opened }" class="flex fc-b">
<dt
:class=
"
{ checked: g.opened }" class="flex fc-b">
<div
class=
"ib fg"
>
<div
class=
"ib fg"
>
<Checkbox
v-model=
"g.checked"
@
on-change=
"checkAll(g, i)"
>
<Checkbox
v-model=
"g.checked"
@
on-change=
"checkAll(g, i)"
>
<span
class=
"ml10"
>
{{
g
.
departmentTitle
}}
</span>
<span
class=
"ml10"
>
{{
g
.
departmentTitle
}}
</span>
</Checkbox>
</Checkbox>
<!--
<span
class=
"ml20"
>
(
<span
v-text=
"g.children | vvv"
></span>
/
{{
g
.
children
.
length
}}
人)
</span></div>
-->
<!--
<span
class=
"ml20"
>
(
<span
v-text=
"g.children | vvv"
></span>
/
{{
g
.
children
.
length
}}
人)
</span></div>
-->
<span
class=
"ml20"
>
(
{{
g
.
children
.
length
}}
人)
</span>
<span
class=
"ml20"
>
(
{{
g
.
children
.
length
}}
人)
</span>
</div>
</div>
<a
class=
"op"
@
click=
"toggle(i)"
>
<a
class=
"op"
@
click=
"toggle(i)"
>
<Icon
<Icon
:type=
"g.opened ? 'ios-arrow-up' : 'ios-arrow-down'"
size=
"24"
/>
:type=
"g.opened ? 'ios-arrow-up' : 'ios-arrow-down'"
</a>
size=
"24"
</dt>
/>
<dd
v-show=
"g.opened"
v-for=
"(li, j) in g.children"
:key=
"j"
@
click=
"checkItem(i, j, li)"
:class=
"
{ checked: li.checked }">
</a>
{{
li
.
userName
}}
</dt>
</dd>
<dd
</dl>
v-show=
"g.opened"
v-for=
"(li, j) in g.children"
:key=
"j"
@
click=
"checkItem(i, j, li)"
:class=
"
{ checked: li.checked }"
>
{{
li
.
userName
}}
</dd>
</dl>
</div>
<div
class=
"footer flex"
>
<div
v-width=
"50"
class=
"fa-m fs"
>
<span>
已选项
</span>
</div>
</div>
<div
class=
"fg"
>
<div
class=
"footer flex"
>
<dl>
<div
v-width=
"50"
class=
"fa-m fs"
>
<dd
v-for=
"(li, i) in checkedItems"
:key=
"i"
>
<span>
已选项
</span>
<div
class=
"flex"
>
</div>
<span
class=
"fg"
>
{{
li
.
userName
}}
</span>
<div
class=
"fg"
>
<a
@
click=
"removeItem(li)"
>
<dl>
<Icon
type=
"md-close"
size=
"16"
/>
<dd
v-for=
"(li, i) in checkedItems"
:key=
"i"
>
</a>
<div
class=
"flex"
>
</div>
<span
class=
"fg"
>
{{
li
.
userName
}}
</span>
</dd>
<a
@
click=
"removeItem(li)"
>
</dl>
<Icon
type=
"md-close"
size=
"16"
/>
</a>
</div>
</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
</div>
<Select
<Select
v-else
:placeholder=
"placeholder"
v-model=
"name"
@
on-change=
"change"
:multiple=
"multiple"
:departmentId=
"departmentId"
clearable
filterable
>
v-else
<Option
v-for=
"item in datas ? datas : dic"
:value=
"item.value"
:key=
"item.value"
:label=
"item.label"
>
:placeholder=
"placeholder"
<div>
v-model=
"name"
{{
item
.
label
}}
@
on-change=
"change"
<span
style=
"color: #c3c3c3"
v-if=
"item.cardNo"
>
(
{{
item
.
cardNo
}}
)
</span>
:multiple=
"multiple"
<br
/>
:departmentId=
"departmentId"
<span
style=
"color: #c3c3c3"
v-if=
"item.departmentTitle"
>
{{
clearable
filterable
>
<Option
v-for=
"item in datas ? datas : dic"
:value=
"item.value"
:key=
"item.value"
:label=
"item.label"
>
<div>
{{
item
.
label
}}
<span
style=
"color: #c3c3c3"
v-if=
"item.cardNo"
>
(
{{
item
.
cardNo
}}
)
</span
>
<br
/>
<span
style=
"color: #c3c3c3"
v-if=
"item.departmentTitle"
>
{{
item
.
departmentTitle
item
.
departmentTitle
}}
</span>
}}
</span>
</div>
</div>
</Option>
</Option>
</Select>
</Select>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
model
:
{
model
:
{
prop
:
"value"
,
prop
:
"value"
,
event
:
"on-change"
,
event
:
"on-change"
,
},
data
()
{
return
{
name
:
this
.
value
,
data
:
[],
departId
:
""
,
group
:
[],
};
},
created
()
{
// let url = `${systemUrl}/user/getfordispatch_x`
// this.$api.get(url).then((r) => {
// this.data = r.result
// })
this
.
getselectuser
();
},
props
:
{
value
:
[
String
,
Number
,
Array
],
placeholder
:
{
type
:
String
,
default
:
"请选择人员"
,
},
multiple
:
{
type
:
Boolean
,
default
:
false
,
},
theme
:
{
type
:
String
,
default
:
"select"
,
},
type
:
{
type
:
Number
,
default
:
0
,
},
departmentId
:
{
type
:
Number
,
default
:
0
,
},
},
roleTitle
:
{
data
()
{
type
:
String
,
return
{
default
:
""
,
name
:
this
.
value
,
},
data
:
[],
datas
:
{
departId
:
""
,
//自定义用户数据
group
:
[],
type
:
Array
,
default
:
null
,
},
},
methods
:
{
change
(
event
)
{
let
name
=
""
;
this
.
data
.
forEach
((
e
)
=>
{
if
(
e
.
id
==
event
)
{
name
=
e
.
label
;
}
});
this
.
$emit
(
"on-change"
,
event
,
name
);
},
// 加载人员
getselectuser
(
id
)
{
let
url
=
`
${
systemUrl
}
/user/getselectuser`
;
var
paras
=
{
// pageIndex: 1,
departmentId
:
id
,
type
:
this
.
type
,
roleTitle
:
this
.
roleTitle
,
// pageSize: 0
};
};
if
(
this
.
type
=
99
){
//开发组
paras
=
{
conditions
:[
{
fieldName
:
"UserType"
,
fieldValue
:
"2"
,
conditionalType
:
"Equal"
,
},
]
};
}
this
.
$api
.
post
(
url
,
paras
)
.
then
((
r
)
=>
{
this
.
data
=
r
.
result
;
if
(
this
.
theme
==
"list"
)
{
this
.
departmentGroup
();
}
});
},
departmentGroup
()
{
var
group
=
[];
var
users
=
this
.
$u
.
clone
(
this
.
data
);
if
(
this
.
name
&&
this
.
name
.
length
>
0
)
{
users
.
map
((
u
)
=>
{
u
.
checked
=
this
.
name
.
indexOf
(
u
.
id
)
>
-
1
;
});
}
group
=
this
.
$u
.
group
(
users
,
(
u
)
=>
{
return
u
.
departmentId
;
});
var
deps
=
[];
group
.
map
((
u
,
i
)
=>
{
deps
.
push
({
departmentTitle
:
u
[
0
].
departmentTitle
,
departmentId
:
u
[
0
].
departmentId
,
children
:
u
,
opened
:
(
i
=
0
),
checked
:
false
,
});
});
this
.
group
=
deps
;
},
toggle
(
i
)
{
this
.
group
[
i
].
opened
=
!
this
.
group
[
i
].
opened
;
// this.$set(this.group,i,this.group[i])
},
checkItem
(
i
,
j
,
item
)
{
item
.
checked
=
!
item
.
checked
;
this
.
group
[
i
][
j
]
=
item
;
this
.
$set
(
this
.
group
,
i
,
this
.
group
[
i
]);
this
.
listSetValue
();
},
},
removeItem
(
item
)
{
created
()
{
this
.
group
.
map
((
u
,
i
)
=>
{
// let url = `${systemUrl}/user/getfordispatch_x`
if
(
u
.
departmentId
==
item
.
departmentId
)
{
// this.$api.get(url).then((r) => {
u
.
children
.
map
((
p
)
=>
{
// this.data = r.result
if
(
p
.
id
==
item
.
id
)
{
// })
p
.
checked
=
false
;
this
.
getselectuser
();
}
});
this
.
$set
(
this
.
group
,
i
,
u
);
}
});
this
.
listSetValue
();
},
//list 时,设置值。
listSetValue
()
{
var
ids
=
[];
this
.
checkedItems
.
map
((
u
)
=>
{
ids
.
push
(
u
.
id
);
});
this
.
$emit
(
"on-change"
,
ids
);
},
},
checkAll
(
item
,
i
)
{
props
:
{
item
.
children
.
map
((
u
)
=>
{
value
:
[
String
,
Number
,
Array
],
u
.
checked
=
item
.
checked
;
placeholder
:
{
});
type
:
String
,
this
.
$set
(
this
.
group
,
i
,
this
.
group
[
i
]);
default
:
"请选择人员"
,
this
.
listSetValue
();
},
multiple
:
{
type
:
Boolean
,
default
:
false
,
},
theme
:
{
type
:
String
,
default
:
"select"
,
},
type
:
{
type
:
Number
,
default
:
0
,
},
departmentId
:
{
type
:
Number
,
default
:
0
,
},
roleTitle
:
{
type
:
String
,
default
:
""
,
},
datas
:
{
//自定义用户数据
type
:
Array
,
default
:
null
,
},
},
},
//获取所有的选中项
methods
:
{
getSelectItems
()
{
change
(
event
)
{
var
items
=
[];
let
name
=
""
;
if
(
this
.
theme
==
"list"
)
{
this
.
data
.
forEach
((
e
)
=>
{
this
.
checkedItems
.
map
((
u
)
=>
{
if
(
e
.
id
==
event
)
{
items
.
push
(
u
);
name
=
e
.
label
;
});
}
}
else
{
});
if
(
!
this
.
multiple
)
{
this
.
$emit
(
"on-change"
,
event
,
name
);
//单选时返回信息
},
if
(
this
.
datas
&&
this
.
datas
.
length
>
0
)
{
// 加载人员
var
item2
=
this
.
datas
.
filter
((
u
)
=>
u
.
value
==
this
.
value
);
getselectuser
(
id
)
{
if
(
item2
&&
item2
[
0
])
{
let
url
=
`
${
systemUrl
}
/user/getselectuser`
;
items
.
push
(
item2
[
0
]);
var
paras
=
{
// pageIndex: 1,
departmentId
:
id
,
type
:
this
.
type
,
roleTitle
:
this
.
roleTitle
,
// pageSize: 0
};
if
(
this
.
type
==
99
)
{
//开发组
paras
=
{
conditions
:
[{
fieldName
:
"UserType"
,
fieldValue
:
"2"
,
conditionalType
:
"Equal"
,
},
]
};
}
}
}
else
{
this
.
$api
var
item1
=
this
.
dic
.
filter
((
u
)
=>
u
.
value
==
this
.
value
);
.
post
(
url
,
paras
)
if
(
item1
&&
item1
[
0
])
{
.
then
((
r
)
=>
{
items
.
push
(
item1
[
0
]);
this
.
data
=
r
.
result
;
if
(
this
.
theme
==
"list"
)
{
this
.
departmentGroup
();
}
});
},
departmentGroup
()
{
var
group
=
[];
var
users
=
this
.
$u
.
clone
(
this
.
data
);
if
(
this
.
name
&&
this
.
name
.
length
>
0
)
{
users
.
map
((
u
)
=>
{
u
.
checked
=
this
.
name
.
indexOf
(
u
.
id
)
>
-
1
;
});
}
}
}
group
=
this
.
$u
.
group
(
users
,
(
u
)
=>
{
}
else
{
return
u
.
departmentId
;
//复选时返回
if
(
this
.
datas
&&
this
.
datas
.
length
>
0
)
{
this
.
value
.
forEach
((
v
)
=>
{
var
item3
=
this
.
dic
.
filter
((
u
)
=>
u
.
value
==
v
);
if
(
item3
&&
item3
[
0
])
{
items
.
push
(
item3
[
0
]);
}
});
});
}
else
{
var
deps
=
[];
this
.
value
.
forEach
((
v
)
=>
{
group
.
map
((
u
,
i
)
=>
{
var
item
=
this
.
dic
.
filter
((
u
)
=>
u
.
value
==
v
);
deps
.
push
({
if
(
item
&&
item
[
0
])
{
departmentTitle
:
u
[
0
].
departmentTitle
,
items
.
push
(
item
[
0
]);
departmentId
:
u
[
0
].
departmentId
,
}
children
:
u
,
opened
:
(
i
=
0
),
checked
:
false
,
});
});
});
}
this
.
group
=
deps
;
}
},
}
toggle
(
i
)
{
this
.
group
[
i
].
opened
=
!
this
.
group
[
i
].
opened
;
// this.$set(this.group,i,this.group[i])
},
checkItem
(
i
,
j
,
item
)
{
item
.
checked
=
!
item
.
checked
;
this
.
group
[
i
][
j
]
=
item
;
this
.
$set
(
this
.
group
,
i
,
this
.
group
[
i
]);
this
.
listSetValue
();
},
removeItem
(
item
)
{
this
.
group
.
map
((
u
,
i
)
=>
{
if
(
u
.
departmentId
==
item
.
departmentId
)
{
u
.
children
.
map
((
p
)
=>
{
if
(
p
.
id
==
item
.
id
)
{
p
.
checked
=
false
;
}
});
this
.
$set
(
this
.
group
,
i
,
u
);
}
});
this
.
listSetValue
();
},
//list 时,设置值。
listSetValue
()
{
var
ids
=
[];
this
.
checkedItems
.
map
((
u
)
=>
{
ids
.
push
(
u
.
id
);
});
this
.
$emit
(
"on-change"
,
ids
);
},
checkAll
(
item
,
i
)
{
item
.
children
.
map
((
u
)
=>
{
u
.
checked
=
item
.
checked
;
});
this
.
$set
(
this
.
group
,
i
,
this
.
group
[
i
]);
this
.
listSetValue
();
},
//获取所有的选中项
getSelectItems
()
{
var
items
=
[];
if
(
this
.
theme
==
"list"
)
{
this
.
checkedItems
.
map
((
u
)
=>
{
items
.
push
(
u
);
});
}
else
{
if
(
!
this
.
multiple
)
{
//单选时返回信息
if
(
this
.
datas
&&
this
.
datas
.
length
>
0
)
{
var
item2
=
this
.
datas
.
filter
((
u
)
=>
u
.
value
==
this
.
value
);
if
(
item2
&&
item2
[
0
])
{
items
.
push
(
item2
[
0
]);
}
}
else
{
var
item1
=
this
.
dic
.
filter
((
u
)
=>
u
.
value
==
this
.
value
);
if
(
item1
&&
item1
[
0
])
{
items
.
push
(
item1
[
0
]);
}
}
}
else
{
//复选时返回
if
(
this
.
datas
&&
this
.
datas
.
length
>
0
)
{
this
.
value
.
forEach
((
v
)
=>
{
var
item3
=
this
.
dic
.
filter
((
u
)
=>
u
.
value
==
v
);
if
(
item3
&&
item3
[
0
])
{
items
.
push
(
item3
[
0
]);
}
});
}
else
{
this
.
value
.
forEach
((
v
)
=>
{
var
item
=
this
.
dic
.
filter
((
u
)
=>
u
.
value
==
v
);
if
(
item
&&
item
[
0
])
{
items
.
push
(
item
[
0
]);
}
});
}
}
}
return
items
;
return
items
;
},
},
//获取所有选中项的名称
//获取所有选中项的名称
getSelectNames
()
{
getSelectNames
()
{
var
names
=
[];
var
names
=
[];
if
(
this
.
theme
==
"list"
)
{
if
(
this
.
theme
==
"list"
)
{
this
.
checkedItems
.
map
((
u
)
=>
{
this
.
checkedItems
.
map
((
u
)
=>
{
items
.
push
(
u
.
userName
);
items
.
push
(
u
.
userName
);
});
});
}
else
{
}
else
{
this
.
getSelectItems
().
forEach
((
v
)
=>
{
this
.
getSelectItems
().
forEach
((
v
)
=>
{
names
.
push
(
v
.
label
);
names
.
push
(
v
.
label
);
});
});
}
}
return
names
;
return
names
;
},
},
},
computed
:
{
dic
()
{
let
result
=
[];
this
.
data
.
forEach
((
u
)
=>
{
// result.push({
// value: u.id,
// label: u.userName
// })
(
u
.
value
=
u
.
id
),
(
u
.
label
=
u
.
userName
);
result
.
push
(
u
);
});
return
result
;
},
checkedItems
()
{
var
items
=
[];
this
.
group
.
map
((
u
)
=>
{
u
.
children
.
map
((
l
)
=>
{
if
(
l
.
checked
)
{
items
.
push
(
l
);
}
});
});
return
items
;
},
},
filters
:
{
vvv
:
(
lis
)
=>
{
return
3
;
// return lis.filter(u=>{
// return u.checked==true
// }).lenght;
},
},
},
computed
:
{
watch
:
{
dic
()
{
value
:
{
let
result
=
[];
handler
(
v
,
o
)
{
this
.
data
.
forEach
((
u
)
=>
{
this
.
name
=
v
;
// result.push({
},
// value: u.id,
deep
:
true
,
// label: u.userName
// })
(
u
.
value
=
u
.
id
),
(
u
.
label
=
u
.
userName
);
result
.
push
(
u
);
});
return
result
;
},
checkedItems
()
{
var
items
=
[];
this
.
group
.
map
((
u
)
=>
{
u
.
children
.
map
((
l
)
=>
{
if
(
l
.
checked
)
{
items
.
push
(
l
);
}
});
});
return
items
;
},
},
},
departmentId
:
{
filters
:
{
handler
(
v
,
o
)
{
vvv
:
(
lis
)
=>
{
this
.
getselectuser
(
v
);
return
3
;
},
// return lis.filter(u=>{
deep
:
true
,
// return u.checked==true
// }).lenght;
},
},
},
datas
(
v
)
{
watch
:
{
if
(
v
)
{
value
:
{
//alert(JSON.stringify(v))
handler
(
v
,
o
)
{
}
this
.
name
=
v
;
},
deep
:
true
,
},
departmentId
:
{
handler
(
v
,
o
)
{
this
.
getselectuser
(
v
);
},
deep
:
true
,
},
datas
(
v
)
{
if
(
v
)
{
//alert(JSON.stringify(v))
}
},
},
},
},
};
};
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
@import "../../assets/css/custom.less";
@import "../../assets/css/custom.less";
.userSelect {
.userSelect {
.users {
.users {
width: 100%;
width: 100%;
border: 1px solid #2680eb;
border: 1px solid #2680eb;
max-height: 420px;
max-height: 420px;
overflow: auto;
overflow: auto;
font-size: 14px;
font-size: 14px;
}
dl {
width: 100%;
margin-bottom: 2px;
dt,
dd {
list-style: none;
padding: 0 15px;
}
dt {
width: 100%;
background: rgba(38, 128, 235, 0.1);
height: 48px;
font-weight: bold;
line-height: 48px;
color: rgba(81, 90, 110, 1);
a.op {
height: 26px;
width: 26px;
text-align: center;
display: inline-block;
padding-top: -15px;
line-height: 100%;
margin-top: 12px;
}
a.op:hover {
color: white;
background: rgba(38, 128, 235, 1.5);
border-radius: 4px;
}
}
}
dt.checked {
background: rgba(38, 128, 235);
dl {
color: white;
width: 100%;
a.op {
margin-bottom: 2px;
color: white;
}
dt,
a.op:hover {
dd {
background: white;
list-style: none;
color: rgba(38, 128, 235);
padding: 0 15px;
}
}
dt {
width: 100%;
background: rgba(38, 128, 235, 0.1);
height: 48px;
font-weight: bold;
line-height: 48px;
color: rgba(81, 90, 110, 1);
a.op {
height: 26px;
width: 26px;
text-align: center;
display: inline-block;
padding-top: -15px;
line-height: 100%;
margin-top: 12px;
}
a.op:hover {
color: white;
background: rgba(38, 128, 235, 1.5);
border-radius: 4px;
}
}
dt.checked {
background: rgba(38, 128, 235);
color: white;
a.op {
color: white;
}
a.op:hover {
background: white;
color: rgba(38, 128, 235);
}
}
dd {
min-width: 120px;
line-height: 32px;
height: 36px;
border-radius: 18px;
display: inline-block;
background: rgba(38, 128, 235, 0.1);
border: 2px solid transparent;
color: @table-color;
margin: 10px;
a {
display: inline-flex;
width: 20px;
height: 20px;
border-radius: 4px;
border: 1px solid transparent;
justify-items: center;
align-items: center;
margin-top: 5px;
}
a:hover {
background: rgb(241, 14, 14);
color: white;
}
}
dd:hover {
// background: rgba(38, 128, 235, 1);
// border:1px solid rgba(38,128,235,0.1);
background: rgba(38, 128, 235, 0.1);
border: 2px solid rgba(38, 128, 235, 1);
// color: white;
cursor: pointer;
}
dd.checked {
border: 2px solid rgba(38, 128, 235, 1);
}
}
}
dd {
min-width: 120px;
.footer {
line-height: 32px;
height: 36px;
border-radius: 18px;
display: inline-block;
background: rgba(38, 128, 235, 0.1);
border: 2px solid transparent;
color: @table-color;
margin: 10px;
a {
display: inline-flex;
width: 20px;
height: 20px;
border-radius: 4px;
border: 1px solid transparent;
justify-items: center;
align-items: center;
margin-top: 5px;
margin-top: 5px;
}
min-height: 68px;
a:hover {
background: rgb(241, 14, 14);
dl {
color: white;
background: rgba(245, 246, 250, 1);
}
border: 1px solid rgba(220, 223, 230, 1);
}
opacity: 1;
dd:hover {
border-radius: 4px;
// background: rgba(38, 128, 235, 1);
min-height: 48px;
// border:1px solid rgba(38,128,235,0.1);
flex-wrap: wrap;
background: rgba(38, 128, 235, 0.1);
}
border: 2px solid rgba(38, 128, 235, 1);
// color: white;
cursor: pointer;
}
dd.checked {
border: 2px solid rgba(38, 128, 235, 1);
}
}
.footer {
margin-top: 5px;
min-height: 68px;
dl {
background: rgba(245, 246, 250, 1);
border: 1px solid rgba(220, 223, 230, 1);
opacity: 1;
border-radius: 4px;
min-height: 48px;
flex-wrap: wrap;
}
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
pages/handle/index.vue
View file @
845eaf7f
<
template
>
<
template
>
<div
class=
"myBug"
>
<div
class=
"myBug"
>
<Tabs
:animated=
"false"
@
on-click=
"tab"
value=
"3"
>
<Tabs
:animated=
"false"
@
on-click=
"tab"
value=
"3"
>
<TabPane
label=
"我发起的"
name=
"0"
></TabPane>
<TabPane
label=
"我发起的"
name=
"0"
></TabPane>
<TabPane
label=
"待我审批的"
name=
"1"
></TabPane>
<TabPane
label=
"待我审批的"
name=
"1"
></TabPane>
<TabPane
label=
"我已审批的"
name=
"2"
></TabPane>
<TabPane
label=
"我已审批的"
name=
"2"
></TabPane>
<TabPane
label=
"待办任务"
name=
"3"
>
<TabPane
label=
"待办任务"
name=
"3"
>
<Task
v-if=
"tabIndex == 4"
></Task>
<Task
v-if=
"tabIndex == 4"
></Task>
</TabPane>
</TabPane>
</Tabs>
</Tabs>
<DataGrid
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
:conditions=
"easySearch"
:high=
"false"
v-show=
"tabIndex != 4"
:height=
"gridHeight"
>
:columns=
"columns"
<template
slot=
"easySearch"
>
ref=
"grid"
<Row
style=
"line-height: 32px; width: 1000px"
>
:action=
"action"
<Col
span=
"5"
>
:conditions=
"easySearch"
<Select
v-model=
"easySearch.schemaId.value"
style=
"width: 200px"
clearable
placeholder=
"请选择审批类别"
transfer
>
:high=
"false"
<Option
value
class=
"option-text"
>
请选择审批类别
</Option>
v-show=
"tabIndex != 4"
<Option
:value=
"item.id"
:label=
"item.name"
:key=
"index"
v-for=
"(item, index) in schemaList"
></Option>
:height=
"gridHeight"
</Select>
>
</Col>
<template
slot=
"easySearch"
>
<Col
span=
"10"
>
<Row
style=
"line-height: 32px; width: 1000px"
>
<DTSearch
v-model=
"easySearch.range.value"
@
on-change=
"setTime"
type=
"date"
></DTSearch>
<Col
span=
"5"
>
</Col>
<Select
<Col
span=
"9"
>
v-model=
"easySearch.schemaId.value"
<Input
search
enter-button
placeholder=
"请输入编号"
@
on-search=
"search"
v-model=
"easySearch.keys.value"
/>
style=
"width: 200px"
</Col>
clearable
</Row>
placeholder=
"请选择审批类别"
</
template
>
transfer
>
<Option
value
class=
"option-text"
>
请选择审批类别
</Option>
<Option
:value=
"item.id"
:label=
"item.name"
:key=
"index"
v-for=
"(item, index) in schemaList"
></Option>
</Select>
</Col>
<Col
span=
"10"
>
<DTSearch
v-model=
"easySearch.range.value"
@
on-change=
"setTime"
type=
"date"
></DTSearch>
</Col>
<Col
span=
"9"
>
<Input
search
enter-button
placeholder=
"请输入编号"
@
on-search=
"search"
v-model=
"easySearch.keys.value"
/>
</Col>
</Row>
</
template
>
</DataGrid>
</DataGrid>
<!-- 审批modal -->
<!-- 审批modal -->
<Modal
<Modal
v-model=
"modalOrderExamine"
:title=
"titleOrderExamine"
footer-hide
fullscreen
@
on-cancel=
"cancelModal"
>
v-model=
"modalOrderExamine"
<iframe
width=
"100%"
id=
"mainFrame"
:height=
"iframeHeight"
frameborder=
"0"
:src=
"srcUrl"
></iframe>
:title=
"titleOrderExamine"
footer-hide
fullscreen
@
on-cancel=
"cancelModal"
>
<iframe
width=
"100%"
id=
"mainFrame"
:height=
"iframeHeight"
frameborder=
"0"
:src=
"srcUrl"
></iframe>
</Modal>
</Modal>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
Api
from
"./api"
;
import
Api
from
"./api"
;
import
Task
from
"./task"
;
import
Task
from
"./task"
;
export
default
{
export
default
{
name
:
"handle"
,
name
:
"handle"
,
components
:
{
components
:
{
Task
,
Task
,
},
},
data
()
{
data
()
{
return
{
return
{
show
:
false
,
show
:
false
,
action
:
Api
.
index
,
action
:
Api
.
index
,
easySearch
:
{
easySearch
:
{
type
:
{
op
:
"Equal"
,
value
:
1
},
// 1我发起的 2待我审批的 3 我已审批的
type
:
{
keys
:
{
op
:
"code"
,
value
:
""
},
op
:
"Equal"
,
schemaId
:
{
op
:
"Equal"
,
value
:
null
},
//审批类别
value
:
1
range
:
{
op
:
"Range"
,
value
:
null
},
},
// 1我发起的 2待我审批的 3 我已审批的
},
keys
:
{
schemaList
:
[],
op
:
"code"
,
results
:
[],
value
:
""
footerBar
:
false
,
},
modalInfo
:
false
,
schemaId
:
{
tabIndex
:
4
,
op
:
"Equal"
,
columns
:
[
value
:
null
{
},
//审批类别
key
:
"id"
,
range
:
{
width
:
80
,
op
:
"Range"
,
title
:
this
.
l
(
"id"
),
value
:
null
hide
:
true
,
},
},
},
{
schemaList
:
[],
key
:
"code"
,
results
:
[],
width
:
240
,
footerBar
:
false
,
title
:
this
.
l
(
"code"
),
modalInfo
:
false
,
},
tabIndex
:
4
,
{
columns
:
[{
title
:
this
.
l
(
"schemaId"
),
key
:
"id"
,
key
:
"schemaId"
,
width
:
80
,
hide
:
true
,
title
:
this
.
l
(
"id"
),
},
hide
:
true
,
{
},
title
:
this
.
l
(
"status"
),
{
key
:
"status"
,
key
:
"code"
,
align
:
"center"
,
width
:
240
,
width
:
120
,
title
:
this
.
l
(
"code"
),
high
:
true
,
},
code
:
"Handle.todoList.status"
,
{
},
title
:
this
.
l
(
"schemaId"
),
{
key
:
"schemaId"
,
title
:
this
.
l
(
"creatorUserId"
),
hide
:
true
,
key
:
"creatorUserId"
,
},
hide
:
true
,
{
},
title
:
this
.
l
(
"status"
),
{
key
:
"status"
,
title
:
this
.
l
(
"creator"
),
align
:
"center"
,
key
:
"creator"
,
width
:
120
,
align
:
"center"
,
high
:
true
,
},
code
:
"Handle.todoList.status"
,
{
},
title
:
this
.
l
(
"creationTime"
),
{
key
:
"creationTime"
,
title
:
this
.
l
(
"creator"
),
align
:
"center"
,
key
:
"creatorUserId"
,
},
align
:
"center"
,
{
type
:
"user"
title
:
this
.
l
(
"schemaName"
),
},
key
:
"schemaName"
,
{
},
title
:
this
.
l
(
"creationTime"
),
// {
key
:
"creationTime"
,
// title: this.l('status'),
align
:
"center"
,
// key: 'status',
},
// hide: true
{
// },
title
:
this
.
l
(
"schemaName"
),
{
key
:
"schemaName"
,
title
:
this
.
l
(
"startRecordId"
),
},
key
:
"startRecordId"
,
// {
hide
:
true
,
// title: this.l('status'),
},
// key: 'status',
{
// hide: true
title
:
this
.
l
(
"currentNodeId"
),
// },
key
:
"currentNodeId"
,
{
hide
:
true
,
title
:
this
.
l
(
"startRecordId"
),
},
key
:
"startRecordId"
,
{
hide
:
true
,
title
:
this
.
l
(
"currentNodeName"
),
},
key
:
"currentNodeName"
,
{
},
title
:
this
.
l
(
"currentNodeId"
),
{
key
:
"currentNodeId"
,
title
:
this
.
l
(
"nextNodeId"
),
hide
:
true
,
key
:
"nextNodeId"
,
},
hide
:
true
,
{
},
title
:
this
.
l
(
"currentNodeName"
),
{
key
:
"currentNodeName"
,
title
:
this
.
l
(
"nextNodeName"
),
},
key
:
"nextNodeName"
,
{
},
title
:
this
.
l
(
"nextNodeId"
),
key
:
"nextNodeId"
,
hide
:
true
,
},
{
title
:
this
.
l
(
"nextNodeName"
),
key
:
"nextNodeName"
,
},
{
title
:
"操作"
,
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
{
attrs
:
{
title
:
"操作"
,
oprate
:
"detail"
,
align
:
"center"
,
title
:
this
.
tabIndex
==
2
?
"审核"
:
"查看"
,
render
:
(
h
,
params
)
=>
{
},
return
h
(
"div"
,
{
on
:
{
class
:
"action"
click
:
()
=>
{
},
[
this
.
listInfo
(
h
(
params
.
row
.
schemaId
,
"op"
,
{
params
.
row
.
schemaName
,
attrs
:
{
params
.
row
.
code
,
oprate
:
"detail"
,
params
.
row
.
id
title
:
this
.
tabIndex
==
2
?
"审核"
:
"查看"
,
);
},
on
:
{
click
:
()
=>
{
this
.
listInfo
(
params
.
row
.
schemaId
,
params
.
row
.
schemaName
,
params
.
row
.
code
,
params
.
row
.
id
);
},
},
},
this
.
tabIndex
==
2
?
"审核"
:
"查看"
),
]);
},
},
},
},
},
this
.
tabIndex
==
2
?
"审核"
:
"查看"
],
),
codeTypeName
:
""
,
//审核类型
]);
gridHeight
:
""
,
},
//订单审核开始
},
modalOrderExamine
:
false
,
],
srcUrl
:
""
,
codeTypeName
:
""
,
//审核类型
iframeHeight
:
""
,
gridHeight
:
""
,
titleOrderExamine
:
""
,
//订单审核开始
OrderExamine
:
""
,
modalOrderExamine
:
false
,
//订单审核结束
srcUrl
:
""
,
};
iframeHeight
:
""
,
},
titleOrderExamine
:
""
,
created
()
{
OrderExamine
:
""
,
//订单审核结束
};
},
created
()
{
window
.
screenHeight
=
window
.
innerHeight
;
this
.
iframeHeight
=
window
.
screenHeight
-
58
;
this
.
gridHeight
=
window
.
screenHeight
-
260
;
},
mounted
()
{
window
.
onresize
=
()
=>
{
///浏览器窗口大小变化
return
(()
=>
{
window
.
screenHeight
=
window
.
innerHeight
;
window
.
screenHeight
=
window
.
innerHeight
;
this
.
iframeHeight
=
window
.
screenHeight
-
58
;
this
.
iframeHeight
=
window
.
screenHeight
-
58
;
this
.
gridHeight
=
window
.
screenHeight
-
260
;
this
.
gridHeight
=
window
.
screenHeight
-
260
;
})();
};
this
.
getSchema
();
},
computed
:
{},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
setTime
(
v
)
{
this
.
easySearch
.
range
.
value
=
v
;
},
//选项卡切换
tab
(
data
)
{
this
.
tabIndex
=
Number
(
data
)
+
1
;
this
.
easySearch
.
type
.
value
=
this
.
tabIndex
;
if
(
this
.
tabIndex
<
4
)
{
this
.
search
();
}
},
search
()
{
this
.
$refs
.
grid
.
easySearch
(
this
.
easySearch
);
},
//获取所以审核类型
getSchema
()
{
Api
.
getAll
().
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
schemaList
=
r
.
result
;
}
else
{
this
.
$Message
.
error
(
"加载类型失败"
);
}
});
},
},
//点击审核或查看
mounted
()
{
listInfo
(
schemaId
,
schemaName
,
code
,
id
)
{
window
.
onresize
=
()
=>
{
console
.
log
(
code
);
///浏览器窗口大小变化
let
type
=
this
.
returnType
(
schemaId
);
return
(()
=>
{
this
.
srcUrl
=
""
;
window
.
screenHeight
=
window
.
innerHeight
;
this
.
modalOrderExamine
=
true
;
this
.
iframeHeight
=
window
.
screenHeight
-
58
;
this
.
codeTypeName
=
schemaName
;
this
.
gridHeight
=
window
.
screenHeight
-
260
;
this
.
titleOrderExamine
=
this
.
codeTypeName
+
" 编号:"
+
code
;
})();
document
.
getElementById
(
"mainFrame"
).
contentWindow
.
location
.
reload
(
true
);
};
this
.
srcUrl
=
this
.
getSchema
();
"/handle/examine"
+
type
+
"?id="
+
id
+
"&statu="
+
this
.
tabIndex
;
},
},
//将schameId转为type1、2、3....
computed
:
{},
returnType
(
schemaId
)
{
async
fetch
({
console
.
log
(
schemaId
);
store
,
let
types
=
1
;
params
switch
(
schemaId
)
{
})
{
case
"123327da-42b3-41f6-b785-cf933f137a95"
:
//订单送审
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
types
=
1
;
break
;
case
"cf192e27-1e81-4000-98ee-392eeb539616"
:
//订单报价
types
=
2
;
break
;
case
"2085025d-9c38-4834-846a-8f9d2f4c8553"
:
//工艺规程
types
=
3
;
break
;
case
"0c7f3e21-0cf1-4fb0-8986-95c6fbda406e"
:
//材料消耗单
types
=
4
;
break
;
case
"56a0a52c-4d7f-45b1-8e31-860efcee5c6d"
:
//工艺数据
types
=
5
;
break
;
case
"d0cdafe3-2341-4499-a4f5-278ef0f30740"
:
//工艺更改单
types
=
6
;
break
;
case
"c2e09c9b-02a9-4188-97a6-cdb68d50a64a"
:
//不合格品审理
types
=
7
;
break
;
case
"2c921502-41a2-4fa5-b659-71d0e1e19ffc"
:
//生产调节单
types
=
8
;
break
;
case
"207b59eb-4fca-4324-b5cd-46f48a5ff21d"
:
//产品合格证
types
=
9
;
break
;
case
"00875796-7675-4c68-bd4f-47e70764dd9e"
:
//修复文件审批
types
=
10
;
break
;
case
"9ce046c3-9585-4bd5-992d-1667f60f8e8f"
:
//支撑文件审批
types
=
11
;
break
;
case
"bd2cb81a-d955-4b68-ae67-bcf7f92e8cb8"
:
//切片文件审批
types
=
12
;
break
;
case
"b6303ddc-8b5e-40a3-a51b-294657d1d913"
:
//物料审批
types
=
13
;
break
;
default
:
types
=
14
;
break
;
}
return
types
;
},
},
cancelModal
()
{
methods
:
{
this
.
search
();
setTime
(
v
)
{
},
this
.
easySearch
.
range
.
value
=
v
;
l
(
key
)
{
},
let
vkey
=
"handleList"
+
"."
+
key
;
//选项卡切换
return
this
.
$t
(
vkey
)
||
key
;
tab
(
data
)
{
this
.
tabIndex
=
Number
(
data
)
+
1
;
this
.
easySearch
.
type
.
value
=
this
.
tabIndex
;
if
(
this
.
tabIndex
<
4
)
{
this
.
search
();
}
},
search
()
{
this
.
$refs
.
grid
.
easySearch
(
this
.
easySearch
);
},
//获取所以审核类型
getSchema
()
{
Api
.
getAll
().
then
((
r
)
=>
{
if
(
r
.
success
)
{
this
.
schemaList
=
r
.
result
;
}
else
{
this
.
$Message
.
error
(
"加载类型失败"
);
}
});
},
//点击审核或查看
listInfo
(
schemaId
,
schemaName
,
code
,
id
)
{
console
.
log
(
code
);
let
type
=
this
.
returnType
(
schemaId
);
this
.
srcUrl
=
""
;
this
.
modalOrderExamine
=
true
;
this
.
codeTypeName
=
schemaName
;
this
.
titleOrderExamine
=
this
.
codeTypeName
+
" 编号:"
+
code
;
document
.
getElementById
(
"mainFrame"
).
contentWindow
.
location
.
reload
(
true
);
this
.
srcUrl
=
"/handle/examine"
+
type
+
"?id="
+
id
+
"&statu="
+
this
.
tabIndex
;
},
//将schameId转为type1、2、3....
returnType
(
schemaId
)
{
console
.
log
(
schemaId
);
let
types
=
1
;
switch
(
schemaId
)
{
case
"123327da-42b3-41f6-b785-cf933f137a95"
:
//订单送审
types
=
1
;
break
;
case
"cf192e27-1e81-4000-98ee-392eeb539616"
:
//订单报价
types
=
2
;
break
;
case
"2085025d-9c38-4834-846a-8f9d2f4c8553"
:
//工艺规程
types
=
3
;
break
;
case
"0c7f3e21-0cf1-4fb0-8986-95c6fbda406e"
:
//材料消耗单
types
=
4
;
break
;
case
"56a0a52c-4d7f-45b1-8e31-860efcee5c6d"
:
//工艺数据
types
=
5
;
break
;
case
"d0cdafe3-2341-4499-a4f5-278ef0f30740"
:
//工艺更改单
types
=
6
;
break
;
case
"c2e09c9b-02a9-4188-97a6-cdb68d50a64a"
:
//不合格品审理
types
=
7
;
break
;
case
"2c921502-41a2-4fa5-b659-71d0e1e19ffc"
:
//生产调节单
types
=
8
;
break
;
case
"207b59eb-4fca-4324-b5cd-46f48a5ff21d"
:
//产品合格证
types
=
9
;
break
;
case
"00875796-7675-4c68-bd4f-47e70764dd9e"
:
//修复文件审批
types
=
10
;
break
;
case
"9ce046c3-9585-4bd5-992d-1667f60f8e8f"
:
//支撑文件审批
types
=
11
;
break
;
case
"bd2cb81a-d955-4b68-ae67-bcf7f92e8cb8"
:
//切片文件审批
types
=
12
;
break
;
case
"b6303ddc-8b5e-40a3-a51b-294657d1d913"
:
//物料审批
types
=
13
;
break
;
default
:
types
=
14
;
break
;
}
return
types
;
},
cancelModal
()
{
this
.
search
();
},
l
(
key
)
{
let
vkey
=
"handleList"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
},
},
},
};
};
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.ivu-modal-fullscreen-no-footer .ivu-modal-body {
.ivu-modal-fullscreen-no-footer .ivu-modal-body {
padding: 0px;
padding: 0px;
}
}
</
style
>
</
style
>
pages/mesPlan/index.vue
View file @
845eaf7f
...
@@ -697,6 +697,7 @@ export default {
...
@@ -697,6 +697,7 @@ export default {
if
(
res
.
success
)
{
if
(
res
.
success
)
{
this
.
$Message
.
success
(
"订单送审成功!"
);
this
.
$Message
.
success
(
"订单送审成功!"
);
this
.
$refs
.
grid
.
load
();
this
.
$refs
.
grid
.
load
();
this
.
sendViewModal
=
false
;
}
else
{
}
else
{
this
.
$Message
.
error
(
"订单送审失败!"
);
this
.
$Message
.
error
(
"订单送审失败!"
);
}
}
...
...
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