|
@@ -169,8 +169,8 @@
|
|
</el-container>
|
|
</el-container>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
-<script setup>
|
|
|
|
-import { onMounted, reactive, ref } from 'vue'
|
|
|
|
|
|
+<script setup name="DoctorInfoManagement">
|
|
|
|
+import { onMounted, reactive, ref } from 'vue';
|
|
import {
|
|
import {
|
|
deleteDoctor,
|
|
deleteDoctor,
|
|
getAllDoctors,
|
|
getAllDoctors,
|
|
@@ -181,135 +181,135 @@ import {
|
|
saveDoctorInfo,
|
|
saveDoctorInfo,
|
|
updateDoctorWxHomepageFlag,
|
|
updateDoctorWxHomepageFlag,
|
|
updateWxHomepageOrder,
|
|
updateWxHomepageOrder,
|
|
-} from '@/api/manage-doctor-info'
|
|
|
|
-import store from '@/store'
|
|
|
|
-import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
-import axios from 'axios'
|
|
|
|
|
|
+} from '@/api/manage-doctor-info';
|
|
|
|
+import store from '@/store';
|
|
|
|
+import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
|
+import axios from 'axios';
|
|
|
|
|
|
-const apiUrl = import.meta.env.VITE_BASE_URL
|
|
|
|
-const windowSize = store.state.app.windowSize
|
|
|
|
-const tableHeight = windowSize.h - 85
|
|
|
|
-const allTitles = ref([])
|
|
|
|
-const allMzDepts = ref([])
|
|
|
|
-const allDoctors = ref([])
|
|
|
|
-const totalSize = ref(0)
|
|
|
|
|
|
+const apiUrl = import.meta.env.VITE_BASE_URL;
|
|
|
|
+const windowSize = store.state.app.windowSize;
|
|
|
|
+const tableHeight = windowSize.h - 85;
|
|
|
|
+const allTitles = ref([]);
|
|
|
|
+const allMzDepts = ref([]);
|
|
|
|
+const allDoctors = ref([]);
|
|
|
|
+const totalSize = ref(0);
|
|
const yesOrNo = [
|
|
const yesOrNo = [
|
|
{ code: 1, name: '推荐' },
|
|
{ code: 1, name: '推荐' },
|
|
{ code: 0, name: '不推荐' },
|
|
{ code: 0, name: '不推荐' },
|
|
-]
|
|
|
|
|
|
+];
|
|
const sexCodes = [
|
|
const sexCodes = [
|
|
{ code: 1, name: '男' },
|
|
{ code: 1, name: '男' },
|
|
{ code: 2, name: '女' },
|
|
{ code: 2, name: '女' },
|
|
{ code: 9, name: '未知' },
|
|
{ code: 9, name: '未知' },
|
|
-]
|
|
|
|
|
|
+];
|
|
|
|
|
|
const queryParam = reactive({
|
|
const queryParam = reactive({
|
|
deptCode: '',
|
|
deptCode: '',
|
|
doctorName: '',
|
|
doctorName: '',
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
pageSize: 15,
|
|
pageSize: 15,
|
|
-})
|
|
|
|
|
|
+});
|
|
|
|
|
|
const handleSizeChange = (val) => {
|
|
const handleSizeChange = (val) => {
|
|
- queryParam.pageSize = val
|
|
|
|
- fetchDoctors()
|
|
|
|
-}
|
|
|
|
|
|
+ queryParam.pageSize = val;
|
|
|
|
+ fetchDoctors();
|
|
|
|
+};
|
|
const handleCurrentChange = (val) => {
|
|
const handleCurrentChange = (val) => {
|
|
- queryParam.currentPage = val
|
|
|
|
- fetchDoctors()
|
|
|
|
-}
|
|
|
|
|
|
+ queryParam.currentPage = val;
|
|
|
|
+ fetchDoctors();
|
|
|
|
+};
|
|
|
|
|
|
const resetSearch = () => {
|
|
const resetSearch = () => {
|
|
- queryParam.deptCode = queryParam.doctorName = ''
|
|
|
|
- fetchDoctors()
|
|
|
|
-}
|
|
|
|
|
|
+ queryParam.deptCode = queryParam.doctorName = '';
|
|
|
|
+ fetchDoctors();
|
|
|
|
+};
|
|
|
|
|
|
const handleSelectRec = (code, flag) => {
|
|
const handleSelectRec = (code, flag) => {
|
|
updateDoctorWxHomepageFlag(code, flag).then(() => {
|
|
updateDoctorWxHomepageFlag(code, flag).then(() => {
|
|
- const message = flag === 1 ? '已在微信服务号首页推荐此医生。' : '已取消此医生在微信服务号首页的推荐。'
|
|
|
|
- const type = flag === 1 ? 'success' : 'warning'
|
|
|
|
|
|
+ const message = flag === 1 ? '已在微信服务号首页推荐此医生。' : '已取消此医生在微信服务号首页的推荐。';
|
|
|
|
+ const type = flag === 1 ? 'success' : 'warning';
|
|
ElMessage({
|
|
ElMessage({
|
|
message,
|
|
message,
|
|
type,
|
|
type,
|
|
duration: 3000,
|
|
duration: 3000,
|
|
showClose: true,
|
|
showClose: true,
|
|
- })
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
|
|
const viewDoctor = (val) => {
|
|
const viewDoctor = (val) => {
|
|
getDoctorInfo(val.code).then((res) => {
|
|
getDoctorInfo(val.code).then((res) => {
|
|
- doctor.value = res
|
|
|
|
- edit.value = false
|
|
|
|
- drawer.value = true
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
|
|
+ doctor.value = res;
|
|
|
|
+ edit.value = false;
|
|
|
|
+ drawer.value = true;
|
|
|
|
+ });
|
|
|
|
+};
|
|
const editDoctor = (val) => {
|
|
const editDoctor = (val) => {
|
|
getDoctorInfo(val.code).then((res) => {
|
|
getDoctorInfo(val.code).then((res) => {
|
|
- doctor.value = res
|
|
|
|
- edit.value = true
|
|
|
|
- drawer.value = true
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
|
|
+ doctor.value = res;
|
|
|
|
+ edit.value = true;
|
|
|
|
+ drawer.value = true;
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
|
|
-const doctor = ref({})
|
|
|
|
|
|
+const doctor = ref({});
|
|
const editStyle = {
|
|
const editStyle = {
|
|
padding: '0 15px 15px 50px',
|
|
padding: '0 15px 15px 50px',
|
|
height: window.innerHeight + 'px',
|
|
height: window.innerHeight + 'px',
|
|
overflowY: 'scroll',
|
|
overflowY: 'scroll',
|
|
-}
|
|
|
|
-const edit = ref(true)
|
|
|
|
-const drawer = ref(false)
|
|
|
|
|
|
+};
|
|
|
|
+const edit = ref(true);
|
|
|
|
+const drawer = ref(false);
|
|
|
|
|
|
-const fileList = ref([])
|
|
|
|
|
|
+const fileList = ref([]);
|
|
|
|
|
|
const beforeAvatarUpload = (file) => {
|
|
const beforeAvatarUpload = (file) => {
|
|
- const isJPG = file.type === 'image/jpeg' || file.type === 'image/png'
|
|
|
|
- const isLt1M = file.size / 1024 / 1024 < 1
|
|
|
|
|
|
+ const isJPG = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
|
|
+ const isLt1M = file.size / 1024 / 1024 < 1;
|
|
if (!isJPG) {
|
|
if (!isJPG) {
|
|
- ElMessage.error('上传头像图片只能是 jpg 或 png 格式!')
|
|
|
|
|
|
+ ElMessage.error('上传头像图片只能是 jpg 或 png 格式!');
|
|
}
|
|
}
|
|
if (!isLt1M) {
|
|
if (!isLt1M) {
|
|
- ElMessage.error('上传头像图片大小不能超过 1MB!')
|
|
|
|
|
|
+ ElMessage.error('上传头像图片大小不能超过 1MB!');
|
|
}
|
|
}
|
|
- return isJPG && isLt1M
|
|
|
|
-}
|
|
|
|
|
|
+ return isJPG && isLt1M;
|
|
|
|
+};
|
|
|
|
|
|
-const upload = ref(null)
|
|
|
|
|
|
+const upload = ref(null);
|
|
const header = {
|
|
const header = {
|
|
token: store.state.user.token,
|
|
token: store.state.user.token,
|
|
-}
|
|
|
|
|
|
+};
|
|
const submitUpload = () => {
|
|
const submitUpload = () => {
|
|
- upload.value.submit()
|
|
|
|
-}
|
|
|
|
|
|
+ upload.value.submit();
|
|
|
|
+};
|
|
const fileSizeOutLimit = () => {
|
|
const fileSizeOutLimit = () => {
|
|
- ElMessage.error('已经选取头像,如须更换请先移除已选取的头像!')
|
|
|
|
-}
|
|
|
|
|
|
+ ElMessage.error('已经选取头像,如须更换请先移除已选取的头像!');
|
|
|
|
+};
|
|
const uploadSuccess = () => {
|
|
const uploadSuccess = () => {
|
|
- ElMessage.success('上传成功!')
|
|
|
|
-}
|
|
|
|
|
|
+ ElMessage.success('上传成功!');
|
|
|
|
+};
|
|
const uploadError = () => {
|
|
const uploadError = () => {
|
|
- ElMessage.error('上传失败!')
|
|
|
|
-}
|
|
|
|
|
|
+ ElMessage.error('上传失败!');
|
|
|
|
+};
|
|
|
|
|
|
const saveDoctor = () => {
|
|
const saveDoctor = () => {
|
|
saveDoctorInfo(doctor.value).then(() => {
|
|
saveDoctorInfo(doctor.value).then(() => {
|
|
- ElMessage.success('保存成功')
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
|
|
+ ElMessage.success('保存成功');
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
|
|
const avatarError = () => {
|
|
const avatarError = () => {
|
|
- return true
|
|
|
|
-}
|
|
|
|
|
|
+ return true;
|
|
|
|
+};
|
|
|
|
|
|
-const manageOrderDialog = ref(false)
|
|
|
|
-const recommendDoctors = ref([])
|
|
|
|
|
|
+const manageOrderDialog = ref(false);
|
|
|
|
+const recommendDoctors = ref([]);
|
|
const manageRecommendOrder = () => {
|
|
const manageRecommendOrder = () => {
|
|
getAllRecommendDoctors().then((res) => {
|
|
getAllRecommendDoctors().then((res) => {
|
|
- recommendDoctors.value = res
|
|
|
|
- manageOrderDialog.value = true
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
|
|
+ recommendDoctors.value = res;
|
|
|
|
+ manageOrderDialog.value = true;
|
|
|
|
+ });
|
|
|
|
+};
|
|
const modifyOrder = (val) => {
|
|
const modifyOrder = (val) => {
|
|
ElMessageBox.prompt('请输入新序号', '提示', {
|
|
ElMessageBox.prompt('请输入新序号', '提示', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
@@ -319,17 +319,17 @@ const modifyOrder = (val) => {
|
|
})
|
|
})
|
|
.then(({ value }) => {
|
|
.then(({ value }) => {
|
|
updateWxHomepageOrder(val.code, value).then(() => {
|
|
updateWxHomepageOrder(val.code, value).then(() => {
|
|
- val.wxHomepageOrder = value
|
|
|
|
|
|
+ val.wxHomepageOrder = value;
|
|
ElMessage({
|
|
ElMessage({
|
|
message: '保存排序成功',
|
|
message: '保存排序成功',
|
|
type: 'success',
|
|
type: 'success',
|
|
duration: 2000,
|
|
duration: 2000,
|
|
showClose: true,
|
|
showClose: true,
|
|
- })
|
|
|
|
- })
|
|
|
|
|
|
+ });
|
|
|
|
+ });
|
|
})
|
|
})
|
|
- .catch(() => {})
|
|
|
|
-}
|
|
|
|
|
|
+ .catch(() => {});
|
|
|
|
+};
|
|
|
|
|
|
const refreshWxDoctorCache = () => {
|
|
const refreshWxDoctorCache = () => {
|
|
axios('http://192.168.200.3:8805/wxserver/homepage/refreshHomePageDoctors').then((res) => {
|
|
axios('http://192.168.200.3:8805/wxserver/homepage/refreshHomePageDoctors').then((res) => {
|
|
@@ -339,12 +339,12 @@ const refreshWxDoctorCache = () => {
|
|
type: 'success',
|
|
type: 'success',
|
|
duration: 2000,
|
|
duration: 2000,
|
|
showClose: true,
|
|
showClose: true,
|
|
- })
|
|
|
|
|
|
+ });
|
|
} else {
|
|
} else {
|
|
- ElMessage.error(res.data.message)
|
|
|
|
|
|
+ ElMessage.error(res.data.message);
|
|
}
|
|
}
|
|
- })
|
|
|
|
-}
|
|
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
|
|
const beforeDelete = (row) => {
|
|
const beforeDelete = (row) => {
|
|
ElMessageBox.confirm('删除后将无法在服务号首页推荐,是否确认删除?', '提示', {
|
|
ElMessageBox.confirm('删除后将无法在服务号首页推荐,是否确认删除?', '提示', {
|
|
@@ -359,29 +359,29 @@ const beforeDelete = (row) => {
|
|
type: 'success',
|
|
type: 'success',
|
|
duration: 2000,
|
|
duration: 2000,
|
|
showClose: true,
|
|
showClose: true,
|
|
- })
|
|
|
|
- fetchDoctors()
|
|
|
|
- })
|
|
|
|
|
|
+ });
|
|
|
|
+ fetchDoctors();
|
|
|
|
+ });
|
|
})
|
|
})
|
|
- .catch(() => {})
|
|
|
|
-}
|
|
|
|
|
|
+ .catch(() => {});
|
|
|
|
+};
|
|
|
|
|
|
const fetchDoctors = () => {
|
|
const fetchDoctors = () => {
|
|
getAllDoctors(queryParam).then((res) => {
|
|
getAllDoctors(queryParam).then((res) => {
|
|
- totalSize.value = res.totalSize
|
|
|
|
- allDoctors.value = res.list
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
|
|
+ totalSize.value = res.totalSize;
|
|
|
|
+ allDoctors.value = res.list;
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
getAllTitles().then((res) => {
|
|
getAllTitles().then((res) => {
|
|
- allTitles.value = res
|
|
|
|
- })
|
|
|
|
|
|
+ allTitles.value = res;
|
|
|
|
+ });
|
|
getAllMzDept().then((res) => {
|
|
getAllMzDept().then((res) => {
|
|
- allMzDepts.value = res
|
|
|
|
- fetchDoctors()
|
|
|
|
- })
|
|
|
|
-})
|
|
|
|
|
|
+ allMzDepts.value = res;
|
|
|
|
+ fetchDoctors();
|
|
|
|
+ });
|
|
|
|
+});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|