|
@@ -24,7 +24,7 @@
|
|
|
class="!w-240px"
|
|
class="!w-240px"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
|
|
|
|
|
|
+ v-for="dict in getIntDictOptions(DICT_TYPE.ORG_STATUS)"
|
|
|
:key="dict.value"
|
|
:key="dict.value"
|
|
|
:label="dict.label"
|
|
:label="dict.label"
|
|
|
:value="dict.value"
|
|
:value="dict.value"
|
|
@@ -75,7 +75,7 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column prop="status" label="状态">
|
|
<el-table-column prop="status" label="状态">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
|
|
|
|
|
|
+ <dict-tag :type="DICT_TYPE.ORG_STATUS" :value="scope.row.status" />
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -97,12 +97,30 @@
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
link
|
|
link
|
|
|
- type="danger"
|
|
|
|
|
- @click="handleDelete(scope.row.id)"
|
|
|
|
|
- v-hasPermi="['system:dept:delete']"
|
|
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="handleStatusChange(scope.row)"
|
|
|
|
|
+ v-hasPermi="['system:dept:update']"
|
|
|
|
|
+ v-if = "scope.row.status===1"
|
|
|
|
|
+ >
|
|
|
|
|
+ 启用
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ link
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="handleStatusChange(scope.row)"
|
|
|
|
|
+ v-hasPermi="['system:dept:update']"
|
|
|
|
|
+ v-if = "scope.row.status===0"
|
|
|
>
|
|
>
|
|
|
- 删除
|
|
|
|
|
|
|
+ 停用
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
+<!-- <el-button-->
|
|
|
|
|
+<!-- link-->
|
|
|
|
|
+<!-- type="danger"-->
|
|
|
|
|
+<!-- @click="handleDelete(scope.row.id)"-->
|
|
|
|
|
+<!-- v-hasPermi="['system:dept:delete']"-->
|
|
|
|
|
+<!-- >-->
|
|
|
|
|
+<!-- 删除-->
|
|
|
|
|
+<!-- </el-button>-->
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -118,6 +136,7 @@ import { handleTree } from '@/utils/tree'
|
|
|
import * as DeptApi from '@/api/system/dept'
|
|
import * as DeptApi from '@/api/system/dept'
|
|
|
import DeptForm from './DeptForm.vue'
|
|
import DeptForm from './DeptForm.vue'
|
|
|
import * as UserApi from '@/api/system/user'
|
|
import * as UserApi from '@/api/system/user'
|
|
|
|
|
+import { CommonStatusEnum } from '@/utils/constants'
|
|
|
|
|
|
|
|
defineOptions({ name: 'SystemDept' })
|
|
defineOptions({ name: 'SystemDept' })
|
|
|
|
|
|
|
@@ -188,6 +207,21 @@ const handleDelete = async (id: number) => {
|
|
|
} catch {}
|
|
} catch {}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/** 修改用户状态 */
|
|
|
|
|
+const handleStatusChange = async (row: DeptApi.DeptVO) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
|
|
|
|
|
+ // 修改状态的二次确认
|
|
|
|
|
+ const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
|
|
|
|
|
+ await message.confirm('确认要' + text + '"' + row.name + '"机构吗?')
|
|
|
|
|
+ // 发起修改状态
|
|
|
|
|
+ await DeptApi.updateDeptStatus(row.id, status)
|
|
|
|
|
+ // 刷新列表
|
|
|
|
|
+ await getList()
|
|
|
|
|
+ } catch {
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/** 初始化 **/
|
|
/** 初始化 **/
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
await getList()
|
|
await getList()
|