feat(F006): 企业列表更换管理员弹窗 - 姓名+手机号表单, 调 /user/enterprise/updateAdministrator 真API (原待实现占位)
This commit is contained in:
parent
c2b3473c5e
commit
b6033c65d5
@ -275,7 +275,24 @@ function exportSupplierDetail() { ElMessage.info('导出待实现') }
|
||||
|
||||
// ========== 单行操作 ==========
|
||||
function goDetail(row: Enterprise) { router.push(`/user/enterprise/detail/${row.id}`) }
|
||||
function changeAdminHandle(_row: Enterprise) { ElMessage.info('更换管理员待实现') }
|
||||
|
||||
// ========== 更换管理员 ==========
|
||||
const adminDialogVisible = ref(false)
|
||||
const adminForm = reactive({ id: '', administrator: '', administratorMobile: '' })
|
||||
function changeAdminHandle(row: Enterprise) {
|
||||
Object.assign(adminForm, { id: row.id, administrator: row.administrator || '', administratorMobile: row.administratorMobile || '' })
|
||||
adminDialogVisible.value = true
|
||||
}
|
||||
async function submitChangeAdmin() {
|
||||
if (!adminForm.administratorMobile?.trim()) { ElMessage.warning('请输入新管理员手机号'); return }
|
||||
if (!adminForm.administrator?.trim()) { ElMessage.warning('请输入新管理员姓名'); return }
|
||||
try {
|
||||
await httpPost('/user/enterprise/updateAdministrator', { ...adminForm })
|
||||
ElMessage.success('更换成功')
|
||||
adminDialogVisible.value = false
|
||||
load()
|
||||
} catch (e: any) { ElMessage.error(e?.msg || '更换失败') }
|
||||
}
|
||||
|
||||
async function handleMore(cmd: string, row: Enterprise) {
|
||||
try {
|
||||
@ -521,6 +538,22 @@ onMounted(() => load())
|
||||
<el-button type="primary" :loading="batchAuditBusy" @click="submitBatchAudit">确定提交</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 更换管理员弹窗 -->
|
||||
<el-dialog v-model="adminDialogVisible" title="更换管理员" width="420px" :close-on-click-modal="false" destroy-on-close>
|
||||
<el-form label-width="100px">
|
||||
<el-form-item label="管理员姓名" required>
|
||||
<el-input v-model="adminForm.administrator" placeholder="请输入新管理员姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" required>
|
||||
<el-input v-model="adminForm.administratorMobile" placeholder="请输入新管理员手机号" maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="adminDialogVisible=false">取消</el-button>
|
||||
<el-button type="primary" @click="submitChangeAdmin">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user