From 6369ba5c519b770b538425a658d2d4ad1dc622ae Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Mon, 26 Jan 2026 17:42:18 +0800
Subject: [PATCH] Merge branch 'master' of http://139.196.74.78:10010/r/jagzwxm/ja_web
---
applications/task-work-order/src/views/orderView/organizationalMessage/agenciesManagement/index.vue | 28 ++++++++++++++++++++++++++--
1 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/applications/task-work-order/src/views/orderView/organizationalMessage/agenciesManagement/index.vue b/applications/task-work-order/src/views/orderView/organizationalMessage/agenciesManagement/index.vue
index cb43e3e..e863da8 100644
--- a/applications/task-work-order/src/views/orderView/organizationalMessage/agenciesManagement/index.vue
+++ b/applications/task-work-order/src/views/orderView/organizationalMessage/agenciesManagement/index.vue
@@ -60,14 +60,15 @@
<el-table-column prop="remark" show-overflow-tooltip label="机构描述" />
<el-table-column prop="status" show-overflow-tooltip label="机构状态">
<template v-slot="{ row }">
- {{ row.status === 1 ? '启用' : '禁用' }}
+ {{ getDictLabel(row.status, dictObj.institutionStatus) }}
</template>
</el-table-column>
- <el-table-column label="操作" class-name="operation-btns" width="240">
+ <el-table-column label="操作" class-name="operation-btns" width="310">
<template v-slot="{ row }">
<el-link type="primary" @click="openForm('view', row)">查看</el-link>
<el-link type="primary" @click="openForm('edit', row)">编辑</el-link>
<el-link type="primary" @click="handleDelete(row)">删除</el-link>
+ <el-link type="primary" @click="toggleStatus(row)">{{row.status === 1 ? '禁用' : '启用'}}</el-link>
</template>
</el-table-column>
</el-table>
@@ -134,6 +135,7 @@
agenciesImportApi,
agenciesExportApi,
regionLazyTreeApi,
+ agenciesSubmitApi
} from './agenciesApi'
import { getDictionaryByCode } from '@/api/system/dictbiz'
import { getDictLabel } from '@ztzf/utils'
@@ -234,6 +236,28 @@
getList()
}
+// 切换机构状态
+async function toggleStatus(row) {
+ // 计算目标状态:当前为1则切换为0,当前为0则切换为1
+ const targetStatus = row.status === 1 ? 0 : 1
+ const actionText = targetStatus === 0 ? '禁用' : '启用'
+
+ await ElMessageBox.confirm(`确认${actionText}该机构吗?`, '提示', {
+ type: 'warning',
+ customClass: 'gd-confirm-custom',
+ confirmButtonClass: 'gd-confirm-button',
+ cancelButtonClass: 'gd-confirm-cancel-button',
+ })
+
+ try {
+ await agenciesSubmitApi({ ...row, status: targetStatus })
+ ElMessage.success(`${actionText}成功`)
+ getList()
+ } catch (error) {
+ ElMessage.error(`${actionText}失败`)
+ }
+}
+
// 导入机构
function handleImport() {
isShowImportView.value = true
--
Gitblit v1.9.3