Browse Source

补充交互逻辑

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

6
src/components/Header.vue

@ -4,8 +4,8 @@
<img src="../assets/header-logo.png" alt="">
</div>
<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">
<div class="right-item flex el-dropdown-link">
<img class="right-item-icon" src="../assets/header-icon.png" alt="">
@ -45,7 +45,7 @@
.header-right {
width: 362px;
justify-content: space-between;
justify-content: flex-end;
.el-dropdown-link {
cursor: pointer;
}

1
src/components/SetLeftMenu.vue

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

1
src/components/SliderMenu.vue

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

4
src/views/AddNewTreatment.vue

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

8
src/views/DoctorInformation.vue

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

20
src/views/HomeView.vue

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

123
src/views/HosInformation.vue

@ -47,13 +47,13 @@
</div>
</GuipFormItem>
<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">
<el-checkbox :label="2" >医生名片基础功能不可取消</el-checkbox>
<el-checkbox :label="0">患者预约</el-checkbox>
</div>
<el-checkbox :label="1">项目计数</el-checkbox>
</el-checkbox-group>
</el-checkbox-group> -->
</GuipFormItem>
<GuipFormItem column="column" class="" label="就诊提醒">
<div slot="formRight" class="desc">就诊前的注意事项非必填</div>
@ -141,8 +141,8 @@
<div class=" mb32 flex-between">
<span class="littleTitle">项目列表</span>
<div class="flex-between" style="gap:10px">
<GuipButton size="table" type="ignore">新增分组</GuipButton>
<GuipButton size="table" type="primary">新增项目</GuipButton>
<GuipButton size="table" type="ignore" @click="addNewGroup">新增分组</GuipButton>
<GuipButton size="table" type="primary" @click="addNewProject">新增项目</GuipButton>
</div>
</div>
<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="price" 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">
<template slot-scope="scope">
<GuipSwitch :modelValue="scope.row.status" @change="onSwitchChange1(scope.row)">
@ -228,10 +228,14 @@
<GuipTable :tableData="courseList" style="width: 100%" ref="multipleTable1"
@selection-change="handleSelectionChange1" :loading="loading1">
<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="price" 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="name" label="套餐名称" min-width="225"></el-table-column>
<el-table-column prop="price" label="套餐价格" min-width="125"></el-table-column>
<el-table-column prop="group" label="套餐内容" min-width="125">
<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">
<template slot-scope="scope">
<GuipSwitch :modelValue="scope.row.status" @change="onSwitchChange2(scope.row)">
@ -253,7 +257,7 @@
</el-form>
</div>
<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">
<BatchProject v-if="dialogType == '1'" :projectTagData="projectTagData" @getproTag="getProTagData" />
</GuipDialog>
@ -387,32 +391,7 @@ export default {
id: '213'
},
],
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'
},
],
courseList: [],
selectAll: false,
selectAll1: false,
numSettingForm: {
@ -552,7 +531,9 @@ export default {
//
this.depart_id = depart_id;
this.doctor_id = doctor_id;
// this.fetchDoctorData()
this.fetchDoctorData()
this.fetchPackData()
this.geHosAdress()
}
},
computed: {
@ -577,6 +558,45 @@ export default {
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) {
//
if (!val.includes(2)) {
@ -619,6 +639,12 @@ export default {
addNewSetMenu() {
this.$router.push('/addNewTreatment')
},
addNewGroup(){
this.dialogVisible1 = true
},
addNewProject(){
this.dialogVisible = true
},
handleClose() {
this.$Message.info('弹框已关闭');
this.dialogVisible = false;
@ -725,7 +751,8 @@ export default {
//
handleSelectionChange1(rows) {
this.selectedRows = rows;
console.log(rows,'1=====');
this.selectedRows1 = rows;
//
const allSelected = rows.length === this.courseList.length;
const noneSelected = rows.length === 0;
@ -735,16 +762,19 @@ export default {
},
//
batchOperate(type,name) {
if (type == '1') {
//
let url= '/api/admin/project_package_mutil_option';
let props = {}
if (type == '1') {//
//
if(name == 'project'){
//
}else{
// selectedRows1
//
}
} else {
//
if(name == 'project'){
//
}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) {

Loading…
Cancel
Save