Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
9
91isoft_vue_manage
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
杨硕
91isoft_vue_manage
Commits
96b3d3c7
Commit
96b3d3c7
authored
Jan 12, 2021
by
yf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门启用停用状态显示 --杨帆
parent
8d339325
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
31 deletions
+63
-31
index.vue
src/views/system/dept/index.vue
+63
-31
No files found.
src/views/system/dept/index.vue
View file @
96b3d3c7
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch
"
>
<el-form
v-show=
"showSearch"
ref=
"queryForm"
:model=
"queryParams"
:inline=
"true
"
>
<el-form-item
label=
"部门名称"
prop=
"deptName"
>
<el-input
v-model=
"queryParams.deptName"
...
...
@@ -38,26 +38,35 @@
</el-form>
<el-table
:data=
"deptList"
v-loading=
"Loading"
:data=
"deptList"
row-key=
"businessId"
default-expand-all
:tree-props=
"
{children: 'children', hasChildren: 'hasChildren'}"
>
<!--
<el-table-column-->
<!-- label="序号"-->
<!-- type="index"-->
<!-- width="50">-->
<!--
</el-table-column>
-->
<!--
<el-table-column-->
<!-- label="部门编号">-->
<!--
<template
v-slot:default=
"scope"
>
-->
<!--
{{
scope
.
row
.
businessId
}}
-->
<!--
</
template
>
-->
<!-- </el-table-column>-->
<!--
<el-table-column-->
<!-- label="序号"-->
<!-- type="index"-->
<!-- width="50">-->
<!--
</el-table-column>
-->
<!--
<el-table-column-->
<!-- label="部门编号">-->
<!--
<template
v-slot:default=
"scope"
>
-->
<!--
{{
scope
.
row
.
businessId
}}
-->
<!--
</
template
>
-->
<!-- </el-table-column>-->
<el-table-column
:show-overflow-tooltip=
"true"
prop=
"deptName"
label=
"部门名称"
width=
"260"
/>
<el-table-column
:show-overflow-tooltip=
"true"
prop=
"orderNum"
label=
"排序"
width=
"200"
/>
<el-table-column
:show-overflow-tooltip=
"true"
prop=
"flag"
label=
"部门状态"
:formatter=
"statusFormat"
width=
"100"
/>
<el-table-column
label=
"状态"
align=
"center"
width=
"100"
>
<
template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.flag"
active-value=
"1"
inactive-value=
"0"
@
change=
"handleStatusChange(scope.row)"
/>
</
template
>
</el-table-column>
<el-table-column
:show-overflow-tooltip=
"true"
label=
"创建时间"
align=
"center"
prop=
"createDate"
width=
"200"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
createDate
|
transformDateByFormat
(
'YYYY-MM-DD HH:mm'
)
}}
</span>
...
...
@@ -96,13 +105,13 @@
style=
"color: #49cec9"
@
click=
"handleUpdate(scope.row)"
>
修改
</el-button>
<!--
<el-switch-->
<!-- v-model="scope.row.flag"-->
<!-- v-hasPermi="['system:dept:toggle']"-->
<!-- active-value="0"-->
<!-- inactive-value="1"-->
<!-- @change="handleStatusChange(scope.row)"-->
<!-- />-->
<!--
<el-switch-->
<!-- v-model="scope.row.flag"-->
<!-- v-hasPermi="['system:dept:toggle']"-->
<!-- active-value="0"-->
<!-- inactive-value="1"-->
<!-- @change="handleStatusChange(scope.row)"-->
<!-- />-->
<el-button
v-hasPermi=
"['system:dept:add']"
size=
"mini"
...
...
@@ -156,16 +165,20 @@
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"部门状态"
>
<!-- <el-radio-group v-model="form.flag">-->
<!-- <el-radio label="0">正常</el-radio>-->
<!-- <el-radio label="1">停用</el-radio>-->
<!-- </el-radio-group>-->
<!-- <el-radio-group v-model="form.flag">-->
<!-- <el-radio label="0">正常</el-radio>-->
<!-- <el-radio label="1">停用</el-radio>-->
<!-- </el-radio-group>-->
<!-- <el-radio-group v-model="form.flag">-->
<!-- <el-radio-->
<!-- v-for="dict in statusOptions"-->
<!-- :key="dict.dictValue"-->
<!-- :label="dict.dictValue"-->
<!-- >{{dict.dictLabel}}</el-radio>-->
<!-- </el-radio-group>-->
<el-radio-group
v-model=
"form.flag"
>
<el-radio
v-for=
"dict in statusOptions"
:key=
"dict.dictValue"
:label=
"dict.dictValue"
>
{{dict.dictLabel}}
</el-radio>
<el-radio
label=
"1"
>
启用
</el-radio>
<el-radio
label=
"0"
>
停用
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
...
...
@@ -183,6 +196,8 @@
import
{
listDept
,
getDept
,
delDept
,
addDept
,
updateDept
,
listDeptExcludeChild
}
from
'@/api/system/dept'
import
Treeselect
from
'@riophae/vue-treeselect'
import
'@riophae/vue-treeselect/dist/vue-treeselect.css'
import
{
changeRoleStatus
}
from
'@/api/system/role'
import
{
updateMenu
}
from
'@/api/system/menu'
export
default
{
name
:
'Dept'
,
...
...
@@ -304,7 +319,24 @@ export default {
}
this
.
resetForm
(
'form'
)
},
// 状态修改
handleStatusChange
(
row
)
{
const
text
=
row
.
flag
===
'0'
?
'停用'
:
'启用'
this
.
$confirm
(
`“
${
row
.
deptName
}
”部门即将被
${
text
}
,是否继续?`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(
function
()
{
return
updateDept
(
row
)
}).
then
(()
=>
{
this
.
$message
({
message
:
text
+
'成功'
,
type
:
'success'
})
}).
catch
(
function
()
{
row
.
flag
=
row
.
flag
===
'0'
?
'1'
:
'0'
})
},
/** 新增按钮操作 */
handleAdd
(
row
)
{
this
.
reset
()
...
...
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