From c1c5e1891b616f426b40f0242e4b27ae1a4c64f6 Mon Sep 17 00:00:00 2001
From: zq <136432190602163.com>
Date: Wed, 25 Jun 2025 18:39:48 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E5=88=97=E8=A1=A8=E6=B8=B2?=
=?UTF-8?q?=E6=9F=93=E3=80=81=E6=B7=BB=E5=8A=A0=E4=BA=A4=E4=BA=92=E9=80=BB?=
=?UTF-8?q?=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/DoctorInformation.vue | 60 +++++++++++---
src/views/HomeView.vue | 179 ++++++++++++++++++++++++++++------------
2 files changed, 174 insertions(+), 65 deletions(-)
diff --git a/src/views/DoctorInformation.vue b/src/views/DoctorInformation.vue
index 110e4bd..3e0ff8e 100644
--- a/src/views/DoctorInformation.vue
+++ b/src/views/DoctorInformation.vue
@@ -25,11 +25,14 @@
default-text-color="#23242B" hover-text-color="#006AFF" />
支持png、jpg格式,尺寸32PX*32PX
-->
-
+
-
+
+
+
支持png、jpg格式,尺寸32PX*32PX
@@ -59,7 +62,7 @@
:options="groupOptions" label="初诊是否审批" required prop="first_visit_audit"
@change="radioChange" />
+ v-model="siteForm.approver_phone" prop="approver_phone" placeholder="请输入" />
@@ -76,13 +79,19 @@
default-text-color="#23242B" hover-text-color="#006AFF" @click="btnClick" />
审批人微信二维码,大小2M以内
-->
-
+
+
+
+
+
审批人微信二维码,大小2M以内
+
@@ -142,6 +151,7 @@ export default {
fileList: [
// { name: 'image.jpeg', url: 'http://jasonyizherenxin.checkcopy.com/user_avatar/1.png?v=93940df0b596961c42de23ef1f2d3257' }
],
+ fileList1:[],
options_payword: [{
value: '选项1',
label: '黄金糕'
@@ -160,7 +170,7 @@ export default {
}],
groupOptions: [
{ label: '需审批', value: '1' },
- { label: '不需审批', value: '2' },
+ { label: '不需审批', value: '0' },
],
formData: null,
siteForm: {
@@ -241,6 +251,12 @@ export default {
url: response.data.avator
}];
}
+ if (response.data.avator) {
+ this.fileList = [{
+ name: 'avator',
+ url: response.data.avator
+ }];
+ }
}
}).catch(error => {
console.error(error, 'error')
@@ -320,11 +336,15 @@ export default {
},
submitForm(form) {
let props = {};
+ let url = {
+ siteForm:'/api/admin/get_doctor_baseinfo',
+ siteForm1:'/api/admin/set_doctor_desc',
+ siteForm2:'',
+ }
if (form == 'siteForm') {
this.$refs[form].validate((valid) => {
if (valid) {
props = {
- did: this.doctorId,
name: this.siteForm.doctor_name,
idcard: this.siteForm.idcard,
avatar_file: this.siteForm.avator,
@@ -334,17 +354,26 @@ export default {
return false;
}
});
- } else {
+ } else if(form == 'siteForm1') {
props = {
- did: this.doctorId,
desc: form.doctor_desc,
detail: form.doctor_detail,
label: form.label
}
+ }else{
+ props = {
+ first_visit_audit: form.first_visit_audit,
+ approver_phone: form.approver_phone,
+ approver_wechat: form.approver_wechat
+ }
}
- this.$http('POST', '/supernew/ajax_get_type_batch_list', props).then(response => {
+ if(this.doctorId){
+ props.did = this.doctorId;
+ }
+ this.$http('POST', url[form], props).then(response => {
if (response.code == 0) {
this.$Message.success('修改成功')
+ this.fetchDoctorData()
}
}).catch(error => {
console.error(error, 'error')
@@ -360,7 +389,7 @@ export default {
label: this.oldForm.label,
}
- } else {
+ } else if(type== 'siteForm') {
this.siteForm = {
...this.siteForm,
name: this.oldForm.name,
@@ -368,6 +397,13 @@ export default {
avatar_file: this.oldForm.avatar_file,
phone: this.oldForm.phone
}
+ }else {
+ this.siteForm = {
+ ...this.siteForm,
+ first_visit_audit: this.oldForm.first_visit_audit,
+ approver_phone: this.oldForm.approver_phone,
+ approver_wechat: this.oldForm.approver_wechat
+ }
}
},
confirmClick(type) {
@@ -383,7 +419,9 @@ export default {
transition: all .5s;
border: 1px solid transparent;
}
-
+.uploadImg{
+ width: 150px;
+}
.special-form-item {
.el-form-item__label {
margin-bottom: 12px;
diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue
index 6783119..ecf923e 100644
--- a/src/views/HomeView.vue
+++ b/src/views/HomeView.vue
@@ -1,5 +1,5 @@
-
+
基础信息
医生列表
@@ -7,7 +7,8 @@
- 全选
+ 全选
共{{ totalNum }}条,已选{{ selectNum }}条
搜索医生
+ placeholder="输入姓名" @blur="inputBlur" v-model="doctorName" />
新增医生
@@ -30,54 +31,53 @@
{{ item.name }}
{{ item.phone }}
-
+
- 编辑
+ 编辑
添加医院
-
+
-
+
- {{ scope.row.hos[0] }}项
- ( 等{{ scope.row.hos.length }}个 )
+ {{ scope.row.depart_name }}
-
+
- {{ scope.row.nums }}项
+ {{ scope.row.project_count }}项
-
+
- {{ scope.row.group }}分组
+ {{ scope.row.classify_count }}分组
-
+
- {{ scope.row.setMenu }}分组
+ {{ scope.row.classify_count }}分组
-
+
-
-
+
@@ -106,7 +106,69 @@ import { mapState } from 'vuex';
export default {
data() {
return {
- tableSelections:[],//已选中数据
+ list: {
+ approver_phone: "18888888888",
+ code: "en4b1v",
+ create: "2025-05-19 16:20:58",
+ desc: "擅长运用麦粒灸治疗疑难杂症,特别是恶性肿瘤的治疗,显著改善患者免疫状态。",
+ detail: "北京中医药大学中医临床特聘专家,师从师怀堂和谢锡亮两大中医泰斗,从事针灸临床50余年,善治免疫系统及其它病症如:各种肿瘤癌症,血小板减少或增多,白细胞减少,经常性感冒、支气管哮喘、过敏性紫癜、妇女尿失禁、夜尿增多,痤疮,急慢性肠炎、痛风、颈椎管狭窄、颈肩腰腿痛、疲劳综合征、失眠,及小儿夜啼、厌食和发育不良等症。",
+ first_visit_audit: "1",
+ id: "1",
+ idcard: "510322197808271433",
+ label: "",
+ name: "张小琪",
+ phone: "18888888888",
+ uid: "46",
+ departs: {
+ 1: [
+ {
+ classify_count: 3,
+ create: "2025-05-29 16:37:28",
+ depart_id: "1",
+ depart_name: "中医科",
+ doctor_id: "1",
+ hid: "1",
+ hispital_name: "武丽娜中医针灸",
+ id: "1",
+ is_fixed: "1",
+ project_count: 24,
+ status: "1",
+ type: "0"
+ }
+ ],
+ 2: [
+ {
+ classify_count: 3,
+ create: "2025-05-29 16:37:28",
+ depart_id: "12",
+ depart_name: "中医科",
+ doctor_id: "1",
+ hid: "1",
+ hispital_name: "武丽娜中医针灸",
+ id: "1",
+ is_fixed: "1",
+ project_count: 24,
+ status: "1",
+ type: "0"
+ },
+ {
+ classify_count: 3,
+ create: "2025-05-29 16:37:28",
+ depart_id: "11",
+ depart_name: "中医科",
+ doctor_id: "1",
+ hid: "1",
+ hispital_name: "武丽娜中医针灸",
+ id: "1",
+ is_fixed: "1",
+ project_count: 24,
+ status: "1",
+ type: "0"
+ },
+ ]
+ }
+ },
+ tableSelections: [],//已选中数据
tableData: [
{
sort: 1
@@ -119,7 +181,7 @@ export default {
checked1: false,
totalNum: 0,
selectNum: 0,
- doctorName:'',
+ doctorName: '',
isIndeterminate: false,
doctorList: [
{
@@ -216,11 +278,10 @@ export default {
},
created() {
store.commit('SET_PAGENAME', '医生管理'); // 登录页面不显示侧边栏
- this.calculateTotalNum()
},
- mounted(){
- store.commit('SET_CUSTOMIZE', false);
- store.commit('SET_SLIDER_MENU','menuData');
+ mounted() {
+ store.commit('SET_CUSTOMIZE', false);
+ store.commit('SET_SLIDER_MENU', 'menuData');
this.getInitData()
},
render() {
@@ -232,30 +293,37 @@ export default {
},
methods: {
// 初始化请求
- getInitData(){
- // this.$store.dispatch('showLoading')
+ getInitData() {
this.$http('POST', '/api/admin/doctor_depart_list', {
}).then(response => {
- if (response.code == 0) {
- this.doctorList = response.data
- this.$store.dispatch('hideLoading')
+ if (response.code == 0 && Object.values(response.data).length > 0) {
+ const list = Object.values(response.data).map(item => {
+ return {
+ ...item,
+ checked:false,
+ departs: item.departs ? Object.values(item.departs).flat() : []
+ }
+ })
+ this.doctorList = list
+ console.log(list,this.doctorList,'this.doctorList====');
+ this.calculateTotalNum()
}
}).catch(error => {
console.error(error, 'error')
})
},
- inputBlur(val){
- console.log(val,'');
+ inputBlur(val) {
+ console.log(val, '');
this.getInitData()
},
- // 计算总条数
- calculateTotalNum() {
+ // 计算总条数
+ calculateTotalNum() {
this.totalNum = this.doctorList.reduce((total, doctor) => {
- return total + (doctor.list ? doctor.list.length : 0);
+ return total + (doctor.departs ? doctor.departs.length : 0);
}, 0);
},
- handleClick(row){
+ handleClick(row) {
console.log(row);
// 跳转编辑页面
},
@@ -328,18 +396,19 @@ export default {
},
batchOperate(type) {
// this.tableSelections
+ console.log(this.tableSelections,'this.tableSelections----');
if (type == '1') {
// 禁用
- this.getInitData()
+ // this.getInitData()
} else {
// 启用
}
},
- onSwitchChange(item,index) {
- item.status = item.status == 0 ? 1 : 0;
- console.log(index,item,'====');
+ onSwitchChange(item, index) {
+ item.status = item.status == 0 ? 1 : 0;
+ console.log(index, item, '====');
this.$set(this.doctorList, item)
// let depart_ids = ''
@@ -369,14 +438,14 @@ export default {
// // }
// })
-// 生成的URL:/doctorInformation?doctorId=123&from=home
-
+ // 生成的URL:/doctorInformation?doctorId=123&from=home
+
},
addHospital(item) {
// this.$router.push(`/hosInformation?doctorId=${item.id}`)
this.$router.push({
- name: '医院信息',
- query: { doctorId: item.id }
+ name: '医院信息',
+ query: { doctorId: item.id }
})
},
editDoctor(item) {
@@ -396,19 +465,20 @@ export default {
},
// 单个表格的选择变化
handleSelectionChange(index, selection) {
+ console.log(index,selection,'=====');
// 更新当前表格的选中状态
- this.doctorList[index].checked = selection.length === this.doctorList[index].list.length;
+ this.doctorList[index].checked = selection.length === this.doctorList[index].departs.length;
this.tableSelections[index] = selection;
-
+
// 更新全局状态
this.updateGlobalSelection();
},
-
+
// 单个表格的全选/取消
handleCheckAllChange(index) {
const table = this.doctorList[index];
const tableRef = this.getPopoverRef(index);
-
+
if (table.checked) {
// 全选当前表格
tableRef.$refs.guiptable.toggleAllSelection();
@@ -416,11 +486,11 @@ export default {
// 取消当前表格全选
tableRef.$refs.guiptable.clearSelection();
}
-
+
// 更新全局状态
this.updateGlobalSelection();
},
-
+
// 总全选控制
handleTotalCheckAllChange() {
if (this.allChecked) {
@@ -440,22 +510,22 @@ export default {
}
});
}
-
+
// 更新全局状态
this.updateGlobalSelection();
},
-
+
// 更新全局选中状态
updateGlobalSelection() {
// 计算总选中数
this.selectNum = Object.values(this.tableSelections).reduce((total, selection) => {
return total + (selection ? selection.length : 0);
}, 0);
-
+
// 计算总全选状态
const allTables = this.doctorList.length;
const checkedTables = this.doctorList.filter(table => table.checked).length;
-
+
this.allChecked = checkedTables === allTables && allTables > 0;
this.isIndeterminate = checkedTables > 0 && checkedTables < allTables;
},
@@ -515,6 +585,7 @@ export default {
}
}
+
::v-deep .el-form-item {
margin-bottom: 0 !important;
}