|
|
@ -40,7 +40,13 @@ |
|
|
|
</a-form> |
|
|
|
{{ addId }} |
|
|
|
</a-modal> |
|
|
|
<a-modal :visible="visible2" title="修改部门信息" @cancel="visible2 = false" @ok="handleOk"> </a-modal> |
|
|
|
<a-modal :visible="editDepartmentVisible" title="aaa" @cancel="editDepartmentVisible = false" @ok="editDepartment"> |
|
|
|
<a-form :form="form" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"> |
|
|
|
<a-form-item label="部门名称"> |
|
|
|
<a-input v-model="departmentName" placeholder="部门名称" /> |
|
|
|
</a-form-item> |
|
|
|
</a-form> |
|
|
|
</a-modal> |
|
|
|
<a-modal :visible="visible1" title="添加成员" @cancel="visible1 = false" @ok="handleOk"> |
|
|
|
添加成员 |
|
|
|
{{ addId }} |
|
|
@ -76,14 +82,15 @@ |
|
|
|
关联角色信息 |
|
|
|
{{ changeRoleId }} |
|
|
|
</a-modal> |
|
|
|
<a-modal :visible="positionModal" title="修改职位信息" @cancel="positionModal = false" @ok="handleOk"> |
|
|
|
修改职位信息 |
|
|
|
<a-modal :visible="positionModal" title="修改职位信息" @cancel="positionModal = false" @ok="editPosition"> |
|
|
|
<a-form :form="form" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"> |
|
|
|
<a-form-item label="职位名称"> |
|
|
|
<a-input v-model="positionName" placeholder="职位名称" /> |
|
|
|
</a-form-item> |
|
|
|
</a-form> |
|
|
|
|
|
|
|
<span v-if="positionInfo">{{ positionInfo.pname }}</span> |
|
|
|
</a-modal> |
|
|
|
<a-modal :visible="departmentModal" title="修改部门信息" @cancel="departmentModal = false" @ok="handleOk"> |
|
|
|
修改部门信息 |
|
|
|
<span v-if="departmentInfo">{{ departmentInfo.departmentName }}</span> |
|
|
|
</a-modal> |
|
|
|
<!-- 添加部门/职位 --> |
|
|
|
<a-modal :visible="visibleAddPosition" title="添加部门/职位" @cancel="visibleAddPosition = false" @ok="addPosition"> |
|
|
|
<a-form :form="form" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }"> |
|
|
@ -106,7 +113,7 @@ |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { mapState } from 'vuex'; |
|
|
|
import { queryHospitalInfo, editHospitalInfo, queryHospitalById, addDepartment, addPosition } from 'config/api'; |
|
|
|
import { queryHospitalInfo, editHospitalInfo, queryHospitalById, addDepartment, addPosition, updateDepartment, updatePosition } from 'config/api'; |
|
|
|
import TreeNode from './TreeNode.vue'; |
|
|
|
|
|
|
|
export default { |
|
|
@ -126,6 +133,7 @@ export default { |
|
|
|
positionModal: false, |
|
|
|
departmentModal: false, |
|
|
|
visibleAddPosition: false, |
|
|
|
editDepartmentVisible: false, |
|
|
|
addId: '', |
|
|
|
hospitalName: '', |
|
|
|
areaId: [], |
|
|
@ -158,13 +166,51 @@ export default { |
|
|
|
// 显示修改部门的modal框 |
|
|
|
editDepartmentModal(item) { |
|
|
|
this.departmentInfo = item; |
|
|
|
this.departmentModal = true; |
|
|
|
// this.departmentModal = true; |
|
|
|
this.editDepartmentVisible = true; |
|
|
|
this.departmentName = this.departmentInfo.departmentName; |
|
|
|
}, |
|
|
|
//修改部门信息 |
|
|
|
async editDepartment() { |
|
|
|
try { |
|
|
|
const params = { param: {did: this.departmentInfo.did , departmentName: this.departmentName}}; |
|
|
|
const res = await updateDepartment(params); |
|
|
|
const { code, msg, data} = res.data; |
|
|
|
if (code === 200) { |
|
|
|
this.editDepartmentVisible = false; |
|
|
|
this.$message.success('修改成功'); |
|
|
|
this.getHospitalInfo(); |
|
|
|
}else { |
|
|
|
this.$message.warning(msg); |
|
|
|
} |
|
|
|
}catch (e) { |
|
|
|
this.$message.warning(e); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 显示修改职位modal框 |
|
|
|
editPositionModal(item) { |
|
|
|
this.positionInfo = item; |
|
|
|
this.positionName = this.positionInfo.pname; |
|
|
|
this.positionModal = true; |
|
|
|
}, |
|
|
|
// 修改职位信息 |
|
|
|
async editPosition() { |
|
|
|
try { |
|
|
|
const params = { param: {positionId: this.positionInfo.pid, positionName: this.positionName}}; |
|
|
|
const res = await updatePosition(params); |
|
|
|
const {code, msg, data} = res.data; |
|
|
|
if (code === 200) { |
|
|
|
this.$message.success('修改成功'); |
|
|
|
this.positionModal = false; |
|
|
|
this.getHospitalInfo(); |
|
|
|
}else { |
|
|
|
this.$message.warning(msg) |
|
|
|
} |
|
|
|
}catch (e) { |
|
|
|
this.$message.error(e); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 显示关联角色modal框 |
|
|
|
changeRole(id) { |
|
|
|
this.changeRoleId = id; |
|
|
@ -185,7 +231,7 @@ export default { |
|
|
|
this.$message.warning(msg); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.$message.warning(error); |
|
|
|
this.$message.warning(e); |
|
|
|
} |
|
|
|
} else { |
|
|
|
try { |
|
|
@ -200,7 +246,7 @@ export default { |
|
|
|
this.$message.warning(msg); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.$message.warning(error); |
|
|
|
this.$message.warning(e); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
@ -309,7 +355,7 @@ export default { |
|
|
|
const res = await queryHospitalInfo(params); |
|
|
|
const { code, msg, data } = res.data; |
|
|
|
if (code === 200) { |
|
|
|
console.log(data); |
|
|
|
// console.log(data); |
|
|
|
this.treeData = data; |
|
|
|
} else { |
|
|
|
console.error(msg); |
|
|
|