Merge pull request 'uesr' (#39) from uesr into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/39
This commit is contained in:
wenhua
2024-03-27 06:22:28 +00:00
2 changed files with 25 additions and 10 deletions

View File

@@ -1,9 +1,11 @@
<template>
<baseTitle :title="'用户信息录入'"></baseTitle>
<fvForm :schema="schame" @getInstance="getInstance" :rules="rules"></fvForm>
<div class="oper-page-btn">
<el-button type="primary" @click="handleSubmit">提交</el-button>
<el-button type="primary" @click="handleBack">返回</el-button>
<div v-loading="loading">
<baseTitle :title="'用户信息录入'"></baseTitle>
<fvForm :schema="schame" @getInstance="getInstance" :rules="rules"></fvForm>
<div class="oper-page-btn">
<el-button type="primary" @click="handleSubmit">提交</el-button>
<el-button type="primary" @click="handleBack">返回</el-button>
</div>
</div>
</template>
@@ -21,6 +23,7 @@ const cacheStore = useCacheStore();
const route = useRoute()
const form = ref(null)
const loading = ref(false)
const localData = reactive({
subCompanyIdOpt: [],
@@ -185,6 +188,10 @@ const getInfo = async () => {
if(!route.query.id) return
// 获取详情数据
const { data } = await getUserDetail(route.query.id)
if(data.subCompanyId) {
const res = await getDeptOpt({subCompanyId: data.subCompanyId})
localData.departmentIdOpt = res.data
}
form.value.setValues(data)
}
@@ -221,11 +228,13 @@ const handleBack = () => {
history.back()
}
onMounted(()=>{
onMounted(async ()=>{
loading.value = true
await init()
if(!route.query.isAdd) {
getInfo()
await getInfo()
}
init()
loading.value = false
})
</script>

View File

@@ -119,8 +119,14 @@ const tableConfig = reactive({
currentRender: ({row, index}) => {
return (
<div>
<el-button type="primary" link onClick={()=>handleEdit(row)}>编辑</el-button>
<el-button type="danger" link onClick={()=>handleDel(row)}>删除</el-button>
{
row.userType == 0 ?
'--' :
<div>
<el-button type="primary" link onClick={()=>handleEdit(row)}>编辑</el-button>
<el-button type="danger" link onClick={()=>handleDel(row)}>删除</el-button>
</div>
}
</div>
)
}