Browse Source

补充交互逻辑

count_down
zq 2 months ago
parent
commit
33b48520d6
  1. 60
      src/components/Breadcrumb.vue
  2. 6
      src/components/Header.vue
  3. 1
      src/components/SetLeftMenu.vue
  4. 1
      src/components/SliderMenu.vue
  5. 4
      src/views/AddNewTreatment.vue
  6. 8
      src/views/DoctorInformation.vue
  7. 20
      src/views/HomeView.vue
  8. 123
      src/views/HosInformation.vue

60
src/components/Breadcrumb.vue

@ -10,7 +10,6 @@
> >
<template v-if="index !== breadcrumbs.length - 1"> <template v-if="index !== breadcrumbs.length - 1">
<router-link :to="item.path">{{ item.title }}</router-link> <router-link :to="item.path">{{ item.title }}</router-link>
<!-- <span class="separator">/</span> -->
<img class="separator" src="@/assets/separator.png" alt=""> <img class="separator" src="@/assets/separator.png" alt="">
</template> </template>
<template v-else> <template v-else>
@ -21,45 +20,67 @@
</nav> </nav>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'Breadcrumb', name: 'Breadcrumb',
computed: { computed: {
breadcrumbs() { breadcrumbs() {
if (this.$route.meta.hideBreadcrumb) return [] if (this.$route.meta.hideBreadcrumb) return [];
const crumbs = [] const crumbs = [];
let currentRoute = this.$route let currentRoute = this.$route;
// //
while (currentRoute) { while (currentRoute) {
crumbs.unshift({ //
// const matchedRoute = this.$router.options.routes.find(
// r => r.name === currentRoute.name
// );
//
const routeWithParams = {
path: currentRoute.path, path: currentRoute.path,
query: currentRoute.query,
params: currentRoute.params
};
crumbs.unshift({
path: routeWithParams,
title: this.getTitle(currentRoute) title: this.getTitle(currentRoute)
}) });
// meta.breadcrumbParent // meta.breadcrumbParent
if (currentRoute.meta.breadcrumbParent) { if (currentRoute.meta.breadcrumbParent) {
currentRoute = this.$router.options.routes.find( currentRoute = this.$router.options.routes.find(
r => r.name === currentRoute.meta.breadcrumbParent r => r.name === currentRoute.meta.breadcrumbParent
) );
// $route
if (currentRoute) {
currentRoute = {
...currentRoute,
path: currentRoute.path,
query: this.$route.query, //
params: this.$route.params, //
meta: currentRoute.meta || {}
};
}
} else { } else {
currentRoute = null currentRoute = null;
} }
} }
return crumbs return crumbs;
} }
}, },
methods: { methods: {
getTitle(route) { getTitle(route) {
return typeof route.meta.title === 'function' return typeof route.meta.title === 'function'
? route.meta.title(route) ? route.meta.title(route)
: route.meta.title || route.name : route.meta.title || route.name;
} }
} }
} };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
/* 保持之前的样式不变 */ /* 保持之前的样式不变 */
@ -68,10 +89,12 @@ export default {
background-color: #f5f5f5; background-color: #f5f5f5;
border-radius: 4px; border-radius: 4px;
} }
.home-icon{
.home-icon {
width: 16px; width: 16px;
height: 16px; height: 16px;
} }
.breadcrumb { .breadcrumb {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@ -88,15 +111,18 @@ export default {
height: 100%; height: 100%;
cursor: pointer; cursor: pointer;
} }
.router-link-active{
.router-link-active {
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.breadcrumb-item a { .breadcrumb-item a {
color: #626573; color: #626573;
text-decoration: none; text-decoration: none;
&:hover{
&:hover {
color: #006AFF; color: #006AFF;
} }
} }

6
src/components/Header.vue

@ -4,8 +4,8 @@
<img src="../assets/header-logo.png" alt=""> <img src="../assets/header-logo.png" alt="">
</div> </div>
<div class="header-right flex"> <div class="header-right flex">
<div class="right-item">权限设置</div> <!-- <div class="right-item">权限设置</div>
<div class="right-item">岗位设置</div> <div class="right-item">岗位设置</div> -->
<el-dropdown trigger="click"> <el-dropdown trigger="click">
<div class="right-item flex el-dropdown-link"> <div class="right-item flex el-dropdown-link">
<img class="right-item-icon" src="../assets/header-icon.png" alt=""> <img class="right-item-icon" src="../assets/header-icon.png" alt="">
@ -45,7 +45,7 @@
.header-right { .header-right {
width: 362px; width: 362px;
justify-content: space-between; justify-content: flex-end;
.el-dropdown-link { .el-dropdown-link {
cursor: pointer; cursor: pointer;
} }

1
src/components/SetLeftMenu.vue

@ -51,7 +51,6 @@ export default {
this.scrollContainer = document.querySelector('.main-content') || this.scrollContainer = document.querySelector('.main-content') ||
document.getElementById('main-content') || document.getElementById('main-content') ||
window; window;
console.log(this.scrollContainer,'this.scrollContainer---');
if (this.scrollContainer) { if (this.scrollContainer) {
this.scrollContainer.addEventListener('scroll', this.handleScroll); this.scrollContainer.addEventListener('scroll', this.handleScroll);
this.calculateFloorOffsets(); this.calculateFloorOffsets();

1
src/components/SliderMenu.vue

@ -105,7 +105,6 @@ export default {
updateCurrentMenu() { updateCurrentMenu() {
const result = this.findMenuItemByPath(this.menuData, this.$route.path); const result = this.findMenuItemByPath(this.menuData, this.$route.path);
this.currentMenuItem = result?.item; this.currentMenuItem = result?.item;
console.log(this.currentMenuItem,'currentMenuItem==');
}, },
findMenuItemByPath(menuItems, targetPath, parent = null) { findMenuItemByPath(menuItems, targetPath, parent = null) {
for (const item of menuItems) { for (const item of menuItems) {

4
src/views/AddNewTreatment.vue

@ -172,10 +172,6 @@ export default {
}, },
projectTagData: [ projectTagData: [
{ {
name: '全部分类',
id: '0'
},
{
name: '针灸1', name: '针灸1',
id: '1' id: '1'
}, },

8
src/views/DoctorInformation.vue

@ -229,11 +229,11 @@ export default {
...mapState(['pageTitle']) // VuexshowSidebar ...mapState(['pageTitle']) // VuexshowSidebar
}, },
mounted() { mounted() {
const doctorId = this.$route.query.doctorId; // id const doctor_id = this.$route.query.doctor_id; // id
this.doctorId = doctorId; this.doctorId = doctor_id;
if (doctorId) { if (doctor_id) {
// //
this.fetchDoctorData(doctorId); this.fetchDoctorData(doctor_id);
} }
}, },
methods: { methods: {

20
src/views/HomeView.vue

@ -324,7 +324,10 @@ export default {
}, 0); }, 0);
}, },
handleClick(row) { handleClick(row) {
console.log(row); this.$router.push({
name: '医院信息',
query: { doctor_id: row.doctor_id,depart_id:row.depart_id }
})
// //
}, },
setPopoverRef(index, el) { setPopoverRef(index, el) {
@ -442,30 +445,19 @@ export default {
}, },
addHospital(item) { addHospital(item) {
// this.$router.push(`/hosInformation?doctorId=${item.id}`)
this.$router.push({ this.$router.push({
name: '医院信息', name: '医院信息',
query: { doctorId: item.id } query: { doctor_id: item.doctor_id }
}) })
}, },
editDoctor(item) { editDoctor(item) {
// this.$router.push(`/doctorInformation`)
this.$router.push({ this.$router.push({
name: '医生信息', name: '医生信息',
query: { doctorId: item.id } query: { doctor_id: item.id}
}) })
// this.$router.push({
// name: '',
// query: {
// doctorId: item.id,
// }
// })
// this.$router.push(`/doctorInformation?doctorId=${item.id}`)
}, },
// //
handleSelectionChange(index, selection) { handleSelectionChange(index, selection) {
console.log(index,selection,'=====');
// //
this.doctorList[index].checked = selection.length === this.doctorList[index].departs.length; this.doctorList[index].checked = selection.length === this.doctorList[index].departs.length;
this.tableSelections[index] = selection; this.tableSelections[index] = selection;

123
src/views/HosInformation.vue

@ -47,13 +47,13 @@
</div> </div>
</GuipFormItem> </GuipFormItem>
<GuipFormItem column="column" class="mb24" label="使用功能"> <GuipFormItem column="column" class="mb24" label="使用功能">
<el-checkbox-group slot="formDom" v-model="form.type" @change="validateSelection" class="checkboxGroup"> <!-- <el-checkbox-group slot="formDom" v-model="form.type" @change="validateSelection" class="checkboxGroup">
<div class="flex"> <div class="flex">
<el-checkbox :label="2" >医生名片基础功能不可取消</el-checkbox> <el-checkbox :label="2" >医生名片基础功能不可取消</el-checkbox>
<el-checkbox :label="0">患者预约</el-checkbox> <el-checkbox :label="0">患者预约</el-checkbox>
</div> </div>
<el-checkbox :label="1">项目计数</el-checkbox> <el-checkbox :label="1">项目计数</el-checkbox>
</el-checkbox-group> </el-checkbox-group> -->
</GuipFormItem> </GuipFormItem>
<GuipFormItem column="column" class="" label="就诊提醒"> <GuipFormItem column="column" class="" label="就诊提醒">
<div slot="formRight" class="desc">就诊前的注意事项非必填</div> <div slot="formRight" class="desc">就诊前的注意事项非必填</div>
@ -141,8 +141,8 @@
<div class=" mb32 flex-between"> <div class=" mb32 flex-between">
<span class="littleTitle">项目列表</span> <span class="littleTitle">项目列表</span>
<div class="flex-between" style="gap:10px"> <div class="flex-between" style="gap:10px">
<GuipButton size="table" type="ignore">新增分组</GuipButton> <GuipButton size="table" type="ignore" @click="addNewGroup">新增分组</GuipButton>
<GuipButton size="table" type="primary">新增项目</GuipButton> <GuipButton size="table" type="primary" @click="addNewProject">新增项目</GuipButton>
</div> </div>
</div> </div>
<div class="selectAllTable-wrap flex-between mt32"> <div class="selectAllTable-wrap flex-between mt32">
@ -181,7 +181,7 @@
<el-table-column prop="name" label="项目名称" min-width="225"></el-table-column> <el-table-column prop="name" label="项目名称" min-width="225"></el-table-column>
<el-table-column prop="price" label="项目价格" min-width="125"></el-table-column> <el-table-column prop="price" label="项目价格" min-width="125"></el-table-column>
<el-table-column prop="group" label="分组" min-width="125"></el-table-column> <el-table-column prop="group" label="分组" min-width="125"></el-table-column>
<el-table-column prop="time" label="添加时间" min-width="225"></el-table-column> <el-table-column prop="create_time" label="添加时间" min-width="225"></el-table-column>
<el-table-column prop="status" label="状态" min-width="125"> <el-table-column prop="status" label="状态" min-width="125">
<template slot-scope="scope"> <template slot-scope="scope">
<GuipSwitch :modelValue="scope.row.status" @change="onSwitchChange1(scope.row)"> <GuipSwitch :modelValue="scope.row.status" @change="onSwitchChange1(scope.row)">
@ -228,10 +228,14 @@
<GuipTable :tableData="courseList" style="width: 100%" ref="multipleTable1" <GuipTable :tableData="courseList" style="width: 100%" ref="multipleTable1"
@selection-change="handleSelectionChange1" :loading="loading1"> @selection-change="handleSelectionChange1" :loading="loading1">
<el-table-column type="selection" label="选择" width="80"></el-table-column> <el-table-column type="selection" label="选择" width="80"></el-table-column>
<el-table-column prop="name" label="项目名称" min-width="225"></el-table-column> <el-table-column prop="name" label="套餐名称" min-width="225"></el-table-column>
<el-table-column prop="price" label="项目价格" min-width="125"></el-table-column> <el-table-column prop="price" label="套餐价格" min-width="125"></el-table-column>
<el-table-column prop="group" label="分组" min-width="125"></el-table-column> <el-table-column prop="group" label="套餐内容" min-width="125">
<el-table-column prop="time" label="添加时间" min-width="225"></el-table-column> <template slot-scope="scope">
{{ scope.row.project_classify_num }},{{ scope.row.project_num_count }}
</template>
</el-table-column>
<el-table-column prop="create_time" label="添加时间" min-width="225"></el-table-column>
<el-table-column prop="status" label="状态" min-width="125"> <el-table-column prop="status" label="状态" min-width="125">
<template slot-scope="scope"> <template slot-scope="scope">
<GuipSwitch :modelValue="scope.row.status" @change="onSwitchChange2(scope.row)"> <GuipSwitch :modelValue="scope.row.status" @change="onSwitchChange2(scope.row)">
@ -253,7 +257,7 @@
</el-form> </el-form>
</div> </div>
<GuipDialog :dialogVisible="dialogVisible" :title="dialogTitle" :show-close-button="true" width="762" <GuipDialog :dialogVisible="dialogVisible" :title="dialogTitle" :show-close-button="true" width="762"
type="center" :show-cancel-button="true" @confirm="handleConfirm" @cancel="handleCancel" :show-cancel-button="true" @confirm="handleConfirm" @cancel="handleCancel"
@close="handleClose" @dialogVisibleChange="dialogVisibleChange"> @close="handleClose" @dialogVisibleChange="dialogVisibleChange">
<BatchProject v-if="dialogType == '1'" :projectTagData="projectTagData" @getproTag="getProTagData" /> <BatchProject v-if="dialogType == '1'" :projectTagData="projectTagData" @getproTag="getProTagData" />
</GuipDialog> </GuipDialog>
@ -387,32 +391,7 @@ export default {
id: '213' id: '213'
}, },
], ],
courseList: [ courseList: [],
{
name: '针灸',
price: '88',
group: '针灸1',
time: '2077 - 12 - 20',
status: true,
id: '1'
},
{
name: '拔罐',
price: '188',
group: '针灸2',
time: '2077 - 12 - 20',
status: true,
id: '2'
},
{
name: '火刺',
price: '55',
group: '针灸1',
time: '2077 - 12 - 20',
status: true,
id: '3'
},
],
selectAll: false, selectAll: false,
selectAll1: false, selectAll1: false,
numSettingForm: { numSettingForm: {
@ -552,7 +531,9 @@ export default {
// //
this.depart_id = depart_id; this.depart_id = depart_id;
this.doctor_id = doctor_id; this.doctor_id = doctor_id;
// this.fetchDoctorData() this.fetchDoctorData()
this.fetchPackData()
this.geHosAdress()
} }
}, },
computed: { computed: {
@ -577,6 +558,45 @@ export default {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
//
fetchPackData() {
this.$http('POST', '/api/admin/get_project_packagelist', {
depart_id: this.depart_id,
doctor_id: this.doctor_id
}).then(response => {
if(response.code == 0){
this.courseList = response.data.list
}
console.log(this.courseList,'courseList=');
}).catch(error => {
console.error(error, 'error')
})
},
//
fetchProjectData() {
this.$http('POST', '/api/admin/get_project_packagelist', {
depart_id: this.depart_id,
doctor_id: this.doctor_id
}).then(response => {
if(response.code == 0){
this.courseList = response.data
}
}).catch(error => {
console.error(error, 'error')
})
},
geHosAdress() {
this.$http('POST', '/api/admin/search_hoispital', {
keyword: this.doctor_id,
}).then(response => {
console.log(response.data,'===data');
}).catch(error => {
console.error(error, 'error')
})
},
validateSelection(val) { validateSelection(val) {
// //
if (!val.includes(2)) { if (!val.includes(2)) {
@ -619,6 +639,12 @@ export default {
addNewSetMenu() { addNewSetMenu() {
this.$router.push('/addNewTreatment') this.$router.push('/addNewTreatment')
}, },
addNewGroup(){
this.dialogVisible1 = true
},
addNewProject(){
this.dialogVisible = true
},
handleClose() { handleClose() {
this.$Message.info('弹框已关闭'); this.$Message.info('弹框已关闭');
this.dialogVisible = false; this.dialogVisible = false;
@ -725,7 +751,8 @@ export default {
// //
handleSelectionChange1(rows) { handleSelectionChange1(rows) {
this.selectedRows = rows; console.log(rows,'1=====');
this.selectedRows1 = rows;
// //
const allSelected = rows.length === this.courseList.length; const allSelected = rows.length === this.courseList.length;
const noneSelected = rows.length === 0; const noneSelected = rows.length === 0;
@ -735,16 +762,19 @@ export default {
}, },
// //
batchOperate(type,name) { batchOperate(type,name) {
if (type == '1') { //
let url= '/api/admin/project_package_mutil_option';
let props = {}
if (type == '1') {//
// //
if(name == 'project'){ if(name == 'project'){
// //
}else{ }else{
// selectedRows1
// //
} }
} else { } else {
//
if(name == 'project'){ if(name == 'project'){
// //
}else{ }else{
@ -752,6 +782,19 @@ export default {
} }
} }
this.changePackData(url,props)
},
//
changePackData(url,params) {
this.$http('POST',url , {
...params
}).then(response => {
let data = response.data
console.log(data);
}).catch(error => {
console.error(error, 'error')
})
}, },
ChangeTime(type) { ChangeTime(type) {

Loading…
Cancel
Save