Commit 4d796a57 authored by 何鹏程's avatar 何鹏程

修改细节

parent fd0deea4
...@@ -168,7 +168,7 @@ export default { ...@@ -168,7 +168,7 @@ export default {
this.getBarData('内存') this.getBarData('内存')
}, },
toNum(val) { toNum(val) {
return parseInt(val) || 0 return parseFloat(val) || 0
} }
} }
} }
......
<template>
<el-dialog
title="权限配置"
:visible.sync="dialogVisible"
width="500px"
@closed="closedHandler"
:close-on-click-modal="false"
>
<el-form
ref="dataForm"
:model="dataForm"
size="small"
label-width="150px"
:rules="rules"
>
<el-form-item
label="角色类型:"
prop="roleId"
>
<el-radio-group
class="radio-group-type1"
v-model="dataForm.roleId"
>
<el-radio :label="1">管理员</el-radio>
<el-radio :label="2">机构用户</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span
slot="footer"
class="dialog-footer"
>
<el-button
size="small"
@click="dialogVisible = false"
>取 消</el-button>
<el-button
type="primary"
size="small"
@click="submitForm()"
>确 定</el-button>
</span>
</el-dialog>
</template>
<script>
import { updateInsideRole } from '@/api/user'
export default {
data() {
return {
dialogVisible: false,
dataForm: {
roleId: ''
},
rules: {
roleId: [
{ required: true, message: '请选择角色类型' },
]
}
}
},
mounted() {
},
methods: {
init(userId, roleId) {
this.dialogVisible = true
this.dataForm.roleId = roleId
this.dataForm.userId = userId
},
submitForm() {
this.$refs.dataForm.validate((valid) => {
if (valid) {
const params = {
...this.dataForm
}
updateInsideRole(params).then(res => {
if (res.msg === 201) {
this.dialogVisible = false
this.$message.success('配置成功')
this.$emit('subsucc')
} else {
this.$message.error(res.content)
}
})
}
})
},
closedHandler() {
this.$refs.dataForm.resetFields()
}
}
}
</script>
<style>
</style>
\ No newline at end of file
...@@ -27,30 +27,32 @@ ...@@ -27,30 +27,32 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
prop="hospitalCode" prop="roleId"
label="角色类型" label="角色类型"
> >
<el-select <el-select
v-model="searchForm.hospitalCode" v-model="searchForm.roleId"
placeholder="请选择医院" placeholder="请选择角色类型"
style="width: 100%" style="width: 100%"
:clearable="true" :clearable="true"
> >
<el-option <el-option
v-for="item in hospitalList" label="管理员"
:label="item.hospitalName" :value="1"
:key="item.id" />
:value="item.hospitalCode" <el-option
label="机构用户"
:value="2"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
prop="materialType" prop="loginName"
label="用户名" label="用户名"
> >
<el-input <el-input
placeholder="请输入用户名" placeholder="请输入用户名"
v-model="searchForm.vehicleManager" v-model="searchForm.loginName"
/> />
</el-form-item> </el-form-item>
<div class="btns"> <div class="btns">
...@@ -118,7 +120,7 @@ ...@@ -118,7 +120,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
type="primary" type="primary"
@click="auditHandler(scope.row.id)" @click="showAuthDialog(scope.row.userId, scope.row.roleId)"
>权限配置</el-link> >权限配置</el-link>
</template> </template>
</el-table-column> </el-table-column>
...@@ -126,20 +128,29 @@ ...@@ -126,20 +128,29 @@
</table-mixin> </table-mixin>
</div> </div>
</div> </div>
<AuthDialog
ref="authDialog"
@subsucc="search"
/>
</div> </div>
</template> </template>
<script> <script>
import { tableDataMixin } from '../../common/js/mixin' import { tableDataMixin } from '../../common/js/mixin'
import { queryEmergencyHospitalList } from '@/api/common' import { queryEmergencyHospitalList } from '@/api/common'
import { updateInsideRole, queryTeamUserPageList } from '@/api/user' import { queryTeamUserPageList } from '@/api/user'
import AuthDialog from './components/authDialog.vue'
export default { export default {
name: 'expertPage', name: 'expertPage',
mixins: [tableDataMixin], mixins: [tableDataMixin],
components: {
AuthDialog
},
data() { data() {
return { return {
searchForm: { searchForm: {
hospitalCode: '', roleId: '',
materialType: '' loginName: '',
hospitalCode: ''
}, },
hospitalList: [], hospitalList: [],
tableData: { tableData: {
...@@ -168,28 +179,28 @@ export default { ...@@ -168,28 +179,28 @@ export default {
}, },
{ {
name: '单位名称', name: '单位名称',
key: 'storeCount', key: 'hospitalName',
sortable: false, sortable: false,
width: '150', width: '150',
fixed: false fixed: false
}, },
{ {
name: '辖区', name: '辖区',
key: 'storePlaceStr', key: 'areaName',
sortable: false, sortable: false,
width: '300', width: '300',
fixed: false fixed: false
}, },
{ {
name: '状态', name: '状态',
key: 'auditStatusStr', key: '',
sortable: false, sortable: false,
width: '100', width: '100',
fixed: false fixed: false
}, },
{ {
name: '注册时间', name: '注册时间',
key: 'auditStatusStr', key: '',
sortable: false, sortable: false,
width: '100', width: '100',
fixed: false fixed: false
...@@ -224,32 +235,8 @@ export default { ...@@ -224,32 +235,8 @@ export default {
} }
}) })
}, },
showSaveDialog(type = 'add', id = '') { showAuthDialog(userId, roleId) {
this.$refs.saveDialog.init(type, id) this.$refs.authDialog.init(userId, roleId)
},
auditHandler(id) {
this.$confirm('是否审批通过?', '提示', {
confirmButtonText: '通过',
cancelButtonText: '拒绝',
distinguishCancelAndClose: true,
type: 'warning'
}).then(() => {
this.auditData(id, 2)
}).catch(action => {
if (action === 'cancel') {
this.auditData(id, 3)
}
})
},
auditData(id, auditStatus) {
addOrUpdateEmergencyMedical({ id: id, auditStatus: auditStatus }).then(res => {
if (res.msg === 201) {
this.$message.success('操作成功!')
} else {
this.$message.error(res.content)
}
this.search()
})
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment