|
@@ -44,16 +44,10 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- icon="el-icon-search"
|
|
|
- size="mini"
|
|
|
- @click="handleQuery"
|
|
|
+ <el-button type="primary" size="btn" @click="handleQuery"
|
|
|
>搜索</el-button
|
|
|
>
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
- >重置</el-button
|
|
|
- >
|
|
|
+ <el-button size="btr" @click="resetQuery">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
@@ -115,6 +109,7 @@
|
|
|
v-loading="loading"
|
|
|
:data="examineList"
|
|
|
@selection-change="handleSelectionChange"
|
|
|
+ :header-cell-style="{ background: '#003C69', color: 'white' }"
|
|
|
>
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="人员类别" align="center" prop="id" />
|
|
@@ -157,20 +152,41 @@
|
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改人员体检信息对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
+ <el-dialog
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="open"
|
|
|
+ width="500px"
|
|
|
+ append-to-body
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-form-item label="单位" prop="unitId">
|
|
|
- <el-input v-model="form.unitId" placeholder="请输入单位" />
|
|
|
+ <treeselect
|
|
|
+ v-model="form.unitId"
|
|
|
+ placeholder="请输入单位"
|
|
|
+ :options="deptOptions"
|
|
|
+ @select="shuxing"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="姓名" prop="peopleId">
|
|
|
- <el-input v-model="form.peopleId" placeholder="请输入姓名" />
|
|
|
+ <el-select v-model="form.peopleId" placeholder="请输入姓名">
|
|
|
+ <el-option
|
|
|
+ class="input_xiala"
|
|
|
+ v-for="(item, i) in renYuan"
|
|
|
+ :key="i"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ @click.native="xingMing(item.name)"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="工作岗位" prop="job">
|
|
|
<el-input v-model="form.job" placeholder="请输入工作岗位" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="人员类别" prop="classId">
|
|
|
+ <!-- <el-form-item label="人员类别" prop="classId">
|
|
|
<el-input v-model="form.classId" placeholder="请输入人员类别" />
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -188,10 +204,17 @@ import {
|
|
|
addExamine,
|
|
|
updateExamine,
|
|
|
exportExamine,
|
|
|
+ getDept,
|
|
|
+ getZhuChiRen,
|
|
|
} from "@/api/medicalhealth/examine";
|
|
|
-
|
|
|
+// 导入树形结构
|
|
|
+import Treeselect from "@riophae/vue-treeselect";
|
|
|
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
export default {
|
|
|
name: "Examine",
|
|
|
+ components: {
|
|
|
+ Treeselect,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
@@ -227,12 +250,25 @@ export default {
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {},
|
|
|
+ // 树形单位
|
|
|
+ deptOptions: [],
|
|
|
+ // 人员列表
|
|
|
+ renYuan: [],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 点击人员触发
|
|
|
+ xingMing(name){
|
|
|
+ },
|
|
|
+ /** 查询部门下拉树结构 */
|
|
|
+ getTreeselect() {
|
|
|
+ getDept().then((response) => {
|
|
|
+ this.deptOptions = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 查询人员体检信息列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -276,6 +312,7 @@ export default {
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
+ this.getTreeselect();
|
|
|
this.reset();
|
|
|
this.open = true;
|
|
|
this.title = "添加人员体检信息";
|
|
@@ -283,6 +320,7 @@ export default {
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
|
+ this.getTreeselect();
|
|
|
const id = row.id || this.ids;
|
|
|
getExamine(id).then((response) => {
|
|
|
this.form = response.data;
|
|
@@ -290,19 +328,30 @@ export default {
|
|
|
this.title = "修改人员体检信息";
|
|
|
});
|
|
|
},
|
|
|
+ // 点击单位触发
|
|
|
+ shuxing(data) {
|
|
|
+ this.form.unitId = data.id;
|
|
|
+ this.getRenYuan(this.form.unitId);
|
|
|
+ },
|
|
|
+ // 获取人员
|
|
|
+ getRenYuan(id) {
|
|
|
+ getZhuChiRen(id).then((res) => {
|
|
|
+ this.renYuan = res.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.id != null) {
|
|
|
updateExamine(this.form).then((response) => {
|
|
|
- this.msgSuccess("修改成功");
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
addExamine(this.form).then((response) => {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
@@ -323,7 +372,7 @@ export default {
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
},
|
|
@@ -348,3 +397,43 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
+<style scoped>
|
|
|
+/* 对话框背景颜色 */
|
|
|
+::v-deep .el-dialog {
|
|
|
+ background: #004d86 !important;
|
|
|
+}
|
|
|
+::v-deep .el-textarea__inner {
|
|
|
+ width: 920px;
|
|
|
+ height: 104px;
|
|
|
+ margin: auto;
|
|
|
+}
|
|
|
+::v-deep .el-dialog__header {
|
|
|
+ border-bottom: 1px solid #718a9d;
|
|
|
+}
|
|
|
+::v-deep .el-dialog__title {
|
|
|
+ color: #fff;
|
|
|
+ font: 18px;
|
|
|
+}
|
|
|
+::v-deep .el-input__inner {
|
|
|
+ /* width: 200px !important;
|
|
|
+ height: 36px; */
|
|
|
+ background: transparent;
|
|
|
+ color: #fff;
|
|
|
+ border: 1px solid white !important;
|
|
|
+}
|
|
|
+/*调整表单间距 */
|
|
|
+::v-deep .el-form-item__content {
|
|
|
+ width: 200px;
|
|
|
+}
|
|
|
+::v-deep .el-dialog__body {
|
|
|
+ margin-left: 70px !important;
|
|
|
+}
|
|
|
+/* 单位框背景颜色 */
|
|
|
+::v-deep .vue-treeselect__control {
|
|
|
+ background: #004d86 !important;
|
|
|
+}
|
|
|
+/* 单位下拉菜单选中字体颜色 */
|
|
|
+::v-deep .vue-treeselect__single-value {
|
|
|
+ color: #fff !important;
|
|
|
+}
|
|
|
+</style>
|