|
|
@@ -56,13 +56,27 @@
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
<el-form-item label-width="10" style="margin-left: 10px">
|
|
|
- <el-button type="primary" @click="getData" size="mini">筛选</el-button>
|
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增医生</el-button>
|
|
|
+ <el-button type="primary" @click="getData" size="mini"
|
|
|
+ >筛选</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ @click="handleAdd"
|
|
|
+ >新增医生</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
- <el-table v-loading="loading" :data="list" style="width: 100%; margin-top: 10px" height="50vh">
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="list"
|
|
|
+ style="width: 100%; margin-top: 10px"
|
|
|
+ height="50vh"
|
|
|
+ >
|
|
|
<el-table-column align="center" prop="name" label="名称" />
|
|
|
<!-- <el-table-column label="图片">
|
|
|
<template slot-scope="scope">
|
|
|
@@ -72,18 +86,23 @@
|
|
|
</el-table-column>-->
|
|
|
<el-table-column align="center" prop="phone" label="手机号" />
|
|
|
<el-table-column label="医生类型">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.role==1">大医生</span>
|
|
|
- <span v-if="scope.row.role==2">中医生</span>
|
|
|
- <span v-if="scope.row.role==3">小医生</span>
|
|
|
- </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.role == 1">大医生</span>
|
|
|
+ <span v-if="scope.row.role == 2">中医生</span>
|
|
|
+ <span v-if="scope.row.role == 3">小医生</span>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column align="center" prop="parent_name" label="带教医生" />
|
|
|
<el-table-column align="center" prop="hospital_name" label="医院" />
|
|
|
<el-table-column align="center" prop="ctime" label="创建时间" />
|
|
|
<el-table-column align="center" prop="date" label="操作" width="320">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="edit(scope.row.id)" size="mini" type="warning">编辑</el-button>
|
|
|
- <el-button @click="del(scope.row.id)" size="mini" type="danger">删除</el-button>
|
|
|
+ <el-button @click="edit(scope.row.id)" size="mini" type="warning"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="del(scope.row.id)" size="mini" type="danger"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -97,20 +116,6 @@
|
|
|
<!-- 新增医生 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="名称" prop="name">
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="form.name"
|
|
|
- placeholder="请输入名称"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="手机号" prop="phone">
|
|
|
- <el-input
|
|
|
- clearable
|
|
|
- v-model="form.phone"
|
|
|
- placeholder="请输入手机号"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="医生类型" prop="role">
|
|
|
<el-select
|
|
|
v-model="form.role"
|
|
|
@@ -125,6 +130,40 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="带教医生" prop="parent_id" v-if="form.role == 3">
|
|
|
+ <el-select
|
|
|
+ v-model="form.parent_id"
|
|
|
+ placeholder="请输入医生姓名"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ :remote-method="remoteMethod"
|
|
|
+ size="mini"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in doctorList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="名称" prop="name">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.name"
|
|
|
+ placeholder="请输入名称"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="手机号" prop="phone">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.phone"
|
|
|
+ placeholder="请输入手机号"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="医院" prop="hospital_name">
|
|
|
<el-input
|
|
|
clearable
|
|
|
@@ -157,13 +196,13 @@
|
|
|
import Page from "../../components/Page";
|
|
|
export default {
|
|
|
components: {
|
|
|
- Page
|
|
|
+ Page,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
queryParams: {
|
|
|
- page: 1
|
|
|
+ page: 1,
|
|
|
},
|
|
|
form: {},
|
|
|
form1: {},
|
|
|
@@ -172,25 +211,25 @@ export default {
|
|
|
total: 0,
|
|
|
title: "新增用户",
|
|
|
open: false,
|
|
|
- stockList: [],
|
|
|
- rules: {}
|
|
|
+ doctorList: [],
|
|
|
+ rules: {},
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
del(id) {
|
|
|
this.$confirm("确认删除?", "提示", {
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
}).then(() => {
|
|
|
this.$api
|
|
|
.delDoctorInfo({
|
|
|
- id: id
|
|
|
+ id: id,
|
|
|
})
|
|
|
- .then(res => {
|
|
|
- if(!res.data.code){
|
|
|
- this.$msgSuccess("删除成功")
|
|
|
+ .then((res) => {
|
|
|
+ if (!res.data.code) {
|
|
|
+ this.$msgSuccess("删除成功");
|
|
|
this.getData();
|
|
|
- }else{
|
|
|
- this.$msgError(res.data.message)
|
|
|
+ } else {
|
|
|
+ this.$msgError(res.data.message);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
@@ -204,7 +243,7 @@ export default {
|
|
|
},
|
|
|
getData() {
|
|
|
this.loading = true;
|
|
|
- this.$api.getDoctorsList(this.queryParams).then(res => {
|
|
|
+ this.$api.getDoctorsList(this.queryParams).then((res) => {
|
|
|
this.list = res.data.data.list;
|
|
|
this.total = res.data.data.total;
|
|
|
this.loading = false;
|
|
|
@@ -219,35 +258,19 @@ export default {
|
|
|
this.title = "编辑医生";
|
|
|
this.$api
|
|
|
.getDoctorInfo({
|
|
|
- id: id
|
|
|
+ id: id,
|
|
|
})
|
|
|
- .then(res => {
|
|
|
+ .then((res) => {
|
|
|
this.form = res.data.data;
|
|
|
this.open = true;
|
|
|
});
|
|
|
},
|
|
|
- handleAvatarSuccess(res, file) {
|
|
|
- this.form.img = res.data.url;
|
|
|
- },
|
|
|
- beforeAvatarUpload(file) {
|
|
|
- return;
|
|
|
- const isJPG = file.type === "image/jpeg";
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
-
|
|
|
- if (!isJPG) {
|
|
|
- this.$message.error("上传头像图片只能是 JPG 格式!");
|
|
|
- }
|
|
|
- if (!isLt2M) {
|
|
|
- this.$message.error("上传头像图片大小不能超过 2MB!");
|
|
|
- }
|
|
|
- return isJPG && isLt2M;
|
|
|
- },
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.id != null) {
|
|
|
- this.$api.editDoctorInfo(this.form).then(res => {
|
|
|
+ this.$api.editDoctorInfo(this.form).then((res) => {
|
|
|
if (res.data.code == 0) {
|
|
|
this.msgSuccess("成功!");
|
|
|
this.open = false;
|
|
|
@@ -257,7 +280,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- this.$api.addDoctorInfo(this.form).then(res => {
|
|
|
+ this.$api.addDoctorInfo(this.form).then((res) => {
|
|
|
if (res.data.code == 0) {
|
|
|
this.msgSuccess("成功!");
|
|
|
this.open = false;
|
|
|
@@ -272,23 +295,23 @@ export default {
|
|
|
},
|
|
|
remoteMethod(query) {
|
|
|
if (query !== "") {
|
|
|
- this.loading = true;
|
|
|
+ // this.loading = true;
|
|
|
this.$api
|
|
|
- .getStockSearchList({
|
|
|
- name: query
|
|
|
+ .getDoctorsSearchList({
|
|
|
+ name: query,
|
|
|
})
|
|
|
- .then(res => {
|
|
|
- this.stockList = res.data.data;
|
|
|
- this.$set(this.stockList, res.data.data);
|
|
|
- this.loading = false;
|
|
|
+ .then((res) => {
|
|
|
+ this.doctorList = res.data.data;
|
|
|
+ this.$set(this.doctorList, res.data.data);
|
|
|
+ // this.loading = false;
|
|
|
});
|
|
|
} else {
|
|
|
- this.stockList = [];
|
|
|
+ this.doctorList = [];
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
this.getData();
|
|
|
- }
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|