Merge pull request 'master' (#40) from master into prod
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/40
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<baseTitle :title="'用户信息录入'"></baseTitle>
|
<div v-loading="loading">
|
||||||
<fvForm :schema="schame" @getInstance="getInstance" :rules="rules"></fvForm>
|
<baseTitle :title="'用户信息录入'"></baseTitle>
|
||||||
<div class="oper-page-btn">
|
<fvForm :schema="schame" @getInstance="getInstance" :rules="rules"></fvForm>
|
||||||
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
<div class="oper-page-btn">
|
||||||
<el-button type="primary" @click="handleBack">返回</el-button>
|
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||||
|
<el-button type="primary" @click="handleBack">返回</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -21,6 +23,7 @@ const cacheStore = useCacheStore();
|
|||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const form = ref(null)
|
const form = ref(null)
|
||||||
|
const loading = ref(false)
|
||||||
|
|
||||||
const localData = reactive({
|
const localData = reactive({
|
||||||
subCompanyIdOpt: [],
|
subCompanyIdOpt: [],
|
||||||
@@ -185,6 +188,10 @@ const getInfo = async () => {
|
|||||||
if(!route.query.id) return
|
if(!route.query.id) return
|
||||||
// 获取详情数据
|
// 获取详情数据
|
||||||
const { data } = await getUserDetail(route.query.id)
|
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)
|
form.value.setValues(data)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -221,11 +228,13 @@ const handleBack = () => {
|
|||||||
history.back()
|
history.back()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(async ()=>{
|
||||||
|
loading.value = true
|
||||||
|
await init()
|
||||||
if(!route.query.isAdd) {
|
if(!route.query.isAdd) {
|
||||||
getInfo()
|
await getInfo()
|
||||||
}
|
}
|
||||||
init()
|
loading.value = false
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -119,8 +119,14 @@ const tableConfig = reactive({
|
|||||||
currentRender: ({row, index}) => {
|
currentRender: ({row, index}) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<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>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user