| | |
| | | <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> |
| | |
| | | agenciesImportApi, |
| | | agenciesExportApi, |
| | | regionLazyTreeApi, |
| | | agenciesSubmitApi |
| | | } from './agenciesApi' |
| | | import { getDictionaryByCode } from '@/api/system/dictbiz' |
| | | import { getDictLabel } from '@ztzf/utils' |
| | |
| | | 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 |