Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
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
ximai
mes-ui
Commits
2827262b
Commit
2827262b
authored
Mar 18, 2025
by
tanjunxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 用户管理工作单元选择优化
parent
c020d3ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
26 deletions
+36
-26
worker.vue
src/views/system/user/profile/worker.vue
+24
-20
workunitSelect.vue
src/views/system/user/profile/workunitSelect.vue
+12
-6
No files found.
src/views/system/user/profile/worker.vue
View file @
2827262b
...
...
@@ -44,6 +44,7 @@
<workunitSelect
ref=
"WorkunitSelect"
:userId=
"userId"
:acId=
"acId"
@
onSelected=
"onworkunitSelected"
></workunitSelect>
</el-form-item>
...
...
@@ -84,6 +85,7 @@ export default {
workstationworkerList
:
[],
// 弹出层标题
title
:
""
,
acId
:
""
,
// 是否显示弹出层
open
:
false
,
// 查询参数
...
...
@@ -180,30 +182,31 @@ export default {
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
onworkunitSelected
(
rows
){
// console.log(45456, rows
);
onworkunitSelected
(
rows
,
type
){
console
.
log
(
45456
,
rows
,
type
);
if
(
rows
!=
undefined
&&
rows
!=
null
)
{
rows
.
forEach
((
item
)
=>
{
})
;
this
.
sForm
=
rows
.
map
(
item
=>
{
return
{
...
this
.
form
,
workunitId
:
item
.
workunitId
,
workunitName
:
item
.
workunitName
,
}
})
// this.form.workunitId = row.workunitId;
// this.form.workunitName = row.workunitName
;
this
.
form
.
workunitId
=
(
rows
.
map
(
item
=>
item
.
workunitId
)).
join
(
","
);
this
.
form
.
workunitName
=
(
rows
.
map
(
item
=>
item
.
workunitName
)).
join
(
","
);
//
console.log(111111, this.sForm);
//
console.log(111111, this.form);
if
(
type
)
{
this
.
form
.
workunitId
=
rows
.
workunitId
;
this
.
form
.
workunitName
=
rows
.
workunitName
;
}
else
{
this
.
sForm
=
rows
.
map
(
item
=>
{
return
{
...
this
.
form
,
workunitId
:
item
.
workunitId
,
workunitName
:
item
.
workunitName
,
}
})
this
.
form
.
workunitId
=
(
rows
.
map
(
item
=>
item
.
workunitId
)).
join
(
","
)
;
this
.
form
.
workunitName
=
(
rows
.
map
(
item
=>
item
.
workunitName
)).
join
(
","
);
}
console
.
log
(
111111
,
this
.
sForm
);
console
.
log
(
111111
,
this
.
form
);
}
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
reset
();
this
.
acId
=
""
;
this
.
open
=
true
;
this
.
title
=
this
.
$t
(
'common.add_workunit'
);
},
...
...
@@ -211,6 +214,7 @@ export default {
handleUpdate
(
row
)
{
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
this
.
acId
=
id
getWorkunituser
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
...
...
@@ -221,8 +225,8 @@ export default {
submitForm
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
null
)
{
updateWorkunituser
(
this
.
sF
orm
).
then
(
response
=>
{
if
(
this
.
title
!=
this
.
$t
(
'common.add_workunit'
)
)
{
updateWorkunituser
(
this
.
f
orm
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
this
.
$t
(
'common.edit_success'
));
this
.
open
=
false
;
this
.
getList
();
...
...
src/views/system/user/profile/workunitSelect.vue
View file @
2827262b
...
...
@@ -58,8 +58,8 @@
@
selection-change=
"handleSelectionChange"
height=
"500px"
>
<el-table-column
type=
"selection"
width=
"50"
align=
"center"
/>
<
!--
<el-table-column
width=
"55"
align=
"center"
>
<el-table-column
type=
"selection"
width=
"50"
align=
"center"
v-if=
"!acId"
/>
<
el-table-column
width=
"55"
align=
"center"
v-else
>
<template
v-slot=
"scope"
>
<el-radio
v-model=
"selectedWorkunitId"
...
...
@@ -68,7 +68,7 @@
>
{{
""
}}
</el-radio
>
</
template
>
</el-table-column>
-->
</el-table-column>
<el-table-column
:label=
"$t('common.workstation_name')"
width=
"180"
prop=
"workstationName"
/>
<el-table-column
:label=
"$t('common.workunit_code')"
...
...
@@ -114,6 +114,10 @@
type
:
Number
|
undefined
,
default
:
undefined
,
},
//外部传入的工单过滤信息
acId
:
{
type
:
String
|
Number
,
default
:
""
,
},
},
data
()
{
return
{
...
...
@@ -160,7 +164,7 @@
this
.
queryParams
.
workstationName
=
this
.
workstationName
;
this
.
queryParams
.
userId
=
this
.
userId
;
this
.
queryParams
.
workstationId
=
this
.
workstationId
;
this
.
getList
();
this
.
resetQuery
();
},
immediate
:
true
}
...
...
@@ -184,6 +188,8 @@
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
queryParams
.
pageNum
=
1
;
this
.
queryParams
.
pageSize
=
10
;
this
.
resetForm
(
"queryForm"
);
this
.
handleQuery
();
},
...
...
@@ -210,7 +216,7 @@
handleRowDbClick
(
row
)
{
if
(
row
)
{
this
.
selectedRows
=
row
;
this
.
$emit
(
"onSelected"
,
this
.
selectedRows
);
this
.
$emit
(
"onSelected"
,
this
.
selectedRows
,
this
.
acId
?
1
:
0
);
this
.
showFlag
=
false
;
}
},
...
...
@@ -224,7 +230,7 @@
});
return
;
}
this
.
$emit
(
"onSelected"
,
this
.
selectedRows
);
this
.
$emit
(
"onSelected"
,
this
.
selectedRows
,
this
.
acId
?
1
:
0
);
this
.
showFlag
=
false
;
},
},
...
...
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