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

修改细节

parent fd0deea4
......@@ -168,7 +168,7 @@ export default {
this.getBarData('内存')
},
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 @@
</el-select>
</el-form-item>
<el-form-item
prop="hospitalCode"
prop="roleId"
label="角色类型"
>
<el-select
v-model="searchForm.hospitalCode"
placeholder="请选择医院"
v-model="searchForm.roleId"
placeholder="请选择角色类型"
style="width: 100%"
:clearable="true"
>
<el-option
v-for="item in hospitalList"
:label="item.hospitalName"
:key="item.id"
:value="item.hospitalCode"
label="管理员"
:value="1"
/>
<el-option
label="机构用户"
:value="2"
/>
</el-select>
</el-form-item>
<el-form-item
prop="materialType"
prop="loginName"
label="用户名"
>
<el-input
placeholder="请输入用户名"
v-model="searchForm.vehicleManager"
v-model="searchForm.loginName"
/>
</el-form-item>
<div class="btns">
......@@ -118,7 +120,7 @@
<template slot-scope="scope">
<el-link
type="primary"
@click="auditHandler(scope.row.id)"
@click="showAuthDialog(scope.row.userId, scope.row.roleId)"
>权限配置</el-link>
</template>
</el-table-column>
......@@ -126,20 +128,29 @@
</table-mixin>
</div>
</div>
<AuthDialog
ref="authDialog"
@subsucc="search"
/>
</div>
</template>
<script>
import { tableDataMixin } from '../../common/js/mixin'
import { queryEmergencyHospitalList } from '@/api/common'
import { updateInsideRole, queryTeamUserPageList } from '@/api/user'
import { queryTeamUserPageList } from '@/api/user'
import AuthDialog from './components/authDialog.vue'
export default {
name: 'expertPage',
mixins: [tableDataMixin],
components: {
AuthDialog
},
data() {
return {
searchForm: {
hospitalCode: '',
materialType: ''
roleId: '',
loginName: '',
hospitalCode: ''
},
hospitalList: [],
tableData: {
......@@ -168,28 +179,28 @@ export default {
},
{
name: '单位名称',
key: 'storeCount',
key: 'hospitalName',
sortable: false,
width: '150',
fixed: false
},
{
name: '辖区',
key: 'storePlaceStr',
key: 'areaName',
sortable: false,
width: '300',
fixed: false
},
{
name: '状态',
key: 'auditStatusStr',
key: '',
sortable: false,
width: '100',
fixed: false
},
{
name: '注册时间',
key: 'auditStatusStr',
key: '',
sortable: false,
width: '100',
fixed: false
......@@ -224,32 +235,8 @@ export default {
}
})
},
showSaveDialog(type = 'add', id = '') {
this.$refs.saveDialog.init(type, id)
},
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()
})
showAuthDialog(userId, roleId) {
this.$refs.authDialog.init(userId, roleId)
}
}
}
......
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