Browse Source

合并master

admin_version1.0_2025_06_26
kuaileWu 3 weeks ago
parent
commit
ceeaa914c3
  1. 50
      src/components/Breadcrumb.vue
  2. 9
      src/components/GlobalLoading1.vue
  3. 2
      src/components/GuipSelect.vue
  4. 6
      src/components/Header.vue
  5. 1
      src/components/SetLeftMenu.vue
  6. 1
      src/components/SliderMenu.vue
  7. 5
      src/router/index.js
  8. 309
      src/views/AddNewTreatment.vue
  9. 8
      src/views/DoctorInformation.vue
  10. 20
      src/views/HomeView.vue
  11. 299
      src/views/HosInformation.vue

50
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,14 +111,17 @@ 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;
} }

9
src/components/GlobalLoading1.vue

@ -1,12 +1,13 @@
<template> <template>
<div> <div style="height:100%">
<div class="content-loading-overlay" v-show="isLoading"> <div class="content-loading-overlay" v-show="isLoading">
<div class="loading-content"> <div class="loading-content">
<div ref="animationContainer" class="animation-container"></div> <div ref="animationContainer" class="animation-container"></div>
</div> </div>
</div> </div>
<div v-show="!isLoading"> <div style="height:100%" v-show="!isLoading">
<slot></slot> <slot></slot>
<!-- <Footer v-if="showFooter"></Footer> -->
</div> </div>
</div> </div>
</template> </template>
@ -22,8 +23,10 @@ export default {
anim: null anim: null
} }
}, },
components: {
},
computed: { computed: {
...mapState(['isLoading', 'loadingText']) ...mapState(['isLoading','showFooter', 'loadingText'])
}, },
watch: { watch: {
isLoading(newVal) { isLoading(newVal) {

2
src/components/GuipSelect.vue

@ -18,7 +18,7 @@ export default {
props: { props: {
value: [String, Number, Array], value: [String, Number, Array],
options: { options: {
type: Array, type: [Array,Object],
default: () => [] default: () => []
}, },
// //

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) {

5
src/router/index.js

@ -45,8 +45,9 @@ const routes = [
path: '/addNewTreatment', path: '/addNewTreatment',
component: () => import( /* webpackChunkName: "addNewTreatment" */ '../views/AddNewTreatment.vue'), component: () => import( /* webpackChunkName: "addNewTreatment" */ '../views/AddNewTreatment.vue'),
name: '新增套餐', name: '新增套餐',
children: [ meta: {
] hideBreadcrumb: true // 首页不显示面包屑
}
}, },
{ {
path: '/ui', path: '/ui',

309
src/views/AddNewTreatment.vue

@ -1,6 +1,6 @@
<template> <template>
<div class="site-setting-wrap min-flex-right"> <div class="site-setting-wrap min-flex-right">
<div class="pagePadding"> <div class="pagePadding main-wrap">
<p class="pageTitle bold">新增套餐</p> <p class="pageTitle bold">新增套餐</p>
<div class="siteMessage flex-common" id="siteMessage2"> <div class="siteMessage flex-common" id="siteMessage2">
<p class="littleTitle mb32">套餐信息</p> <p class="littleTitle mb32">套餐信息</p>
@ -30,13 +30,13 @@
<el-checkbox @change="handleSelectAllChange1" v-model="selectAll" <el-checkbox @change="handleSelectAllChange1" v-model="selectAll"
:indeterminate="isIndeterminate">全选</el-checkbox> :indeterminate="isIndeterminate">全选</el-checkbox>
</div> </div>
<span class="totalCount">{{ treatMentList.length }}已选{{ selectedCount }}</span> <span class="totalCount">{{ projectList.length }}已选{{ selectedCount }}</span>
</div> </div>
<div class="flex-between mb32 mt32"> <div class="flex-between mb32 mt32">
<div class="tabProject flex"> <div class="tabProject flex">
<div :class="['tab-item ', projectSearchId == item.id ? 'active' : '']" <div :class="['tab-item ', projectSearchId == item.id ? 'active' : '']"
v-for="item in projectTagData" :key="item.name">{{ item.name }}</div> v-for="item in Object.values(projectTagData)" :key="item.name">{{ item.name }}</div>
</div> </div>
<div class="right flex"> <div class="right flex">
<GuipFormItem label="搜索项目"> <GuipFormItem label="搜索项目">
@ -47,22 +47,35 @@
</GuipFormItem> </GuipFormItem>
</div> </div>
</div> </div>
<GuipTable :tableData="treatMentList" style="width: 100%" ref="multipleTable" <GuipTable :tableData="sortedProjectList" style="width: 100%" ref="multipleTable" max-height="600px"
@selection-change="handleSelectionChange" :loading="loading"> @selection-change="handleSelectionChange" :loading="loading">
<el-table-column type="selection" label="选择" width="150"></el-table-column> <el-table-column type="selection" label="选择" width="150"></el-table-column>
<el-table-column prop="name" label="项目名称" min-width="150"></el-table-column> <el-table-column prop="name" label="项目名称" min-width="150"></el-table-column>
<el-table-column label="次数" min-width="150px"> <el-table-column label="次数" min-width="150px" prop="num">
<template slot-scope="scope"> <template slot-scope="scope">
<GuipInput width="120px" v-model="scope.row.nums" @change="changeNums(scope.row)" /> <GuipInput width="90%" v-if="package_id && scope.row.num" v-model="scope.row.num"
@change="changeNums(scope.row)" />
<GuipInput width="90%" v-else v-model="scope.row.unit_num"
@change="changeNums(scope.row)" />
</template>
</el-table-column>
<el-table-column prop="price" label="项目价格" min-width="150">
<template slot-scope="scope">
<GuipInput width="90%" v-model="scope.row.price" @change="changePrice(scope.row)" />
</template>
</el-table-column>
<el-table-column prop="classify_id" label="分类" min-width="150">
<template slot-scope="scope">
<GuipSelect width="90%" v-model="scope.row.classify_id"
@change="changeClassify(scope.row)" prop="classify_id" :options="projectTagData"
valueKey="id" labelKey="name" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="price" label="项目价格" min-width="150"></el-table-column>
<el-table-column prop="group" label="分类" min-width="150"></el-table-column>
</GuipTable> </GuipTable>
<el-pagination background @size-change='handleSizeChange' @current-change='handleCurrentChange' <!-- <el-pagination background @size-change='handleSizeChange' @current-change='handleCurrentChange'
:current-page="currentPage" :page-size=pageSize layout="prev, pager, next,jumper" :current-page="currentPage" :page-size=pageSize layout="prev, pager, next,jumper"
:total="treatMentList.length"> :total="treatMentList.length">
</el-pagination> </el-pagination> -->
</el-form> </el-form>
</div> </div>
</div> </div>
@ -73,8 +86,8 @@
</GuipButton> </GuipButton>
</div> </div>
<GuipDialog :dialogVisible="dialogVisible" :title="'新增套餐确认'" :show-close-button="true" width="599px" <GuipDialog :dialogVisible="dialogVisible" :title="'新增套餐确认'" :show-close-button="true" width="599px"
:show-cancel-button="true" @confirm="handleConfirm" @cancel="handleCancel" :show-cancel-button="true" @confirm="handleConfirm" @cancel="handleCancel" @close="handleClose"
@close="handleClose" confirmText="确定新增"> confirmText="确定新增">
<div class="flex content"> <div class="flex content">
<span>套餐名称</span> <span>套餐名称</span>
<span>{{ siteForm.name }}套餐</span> <span>{{ siteForm.name }}套餐</span>
@ -100,6 +113,7 @@ import GuipTable from '@/components/GuipTable.vue';
import GuipDialog from '@/components/GuipDialog.vue'; import GuipDialog from '@/components/GuipDialog.vue';
import GuipInput from '@/components/GuipInput.vue'; import GuipInput from '@/components/GuipInput.vue';
import GuipButton from '@/components/GuipButton.vue'; import GuipButton from '@/components/GuipButton.vue';
import GuipSelect from '@/components/GuipSelect.vue';
export default { export default {
// //
name: '', name: '',
@ -109,12 +123,13 @@ export default {
GuipInput, GuipInput,
GuipDialog, GuipDialog,
GuipButton, GuipButton,
GuipSelect,
GuipTable GuipTable
}, },
data() { data() {
return { return {
dialogVisible: true, dialogVisible: false,
selectAll: false, selectAll: false,
selectedCount: 0, selectedCount: 0,
currentPage: 1, currentPage: 1,
@ -123,95 +138,147 @@ export default {
projectSearchName: '', projectSearchName: '',
projectSearchId: '0', projectSearchId: '0',
loading: false, loading: false,
treatMentList: [ treatMentList: [],//
{ projectList: [],//
name: '针灸1', // {
nums: 1, // 27:{
checked: true, // classify_name:"",
group: '针灸1', // create_time:"2025-05-29 17:09:43",
price: 9939, // id:"1",
id: '11' // name:"",
}, // num:"2",
{ // pid:"1",
name: '针灸2', // price:"200.00",
nums: 1, // project_id:"27",
checked: false, // sort:"1",
group: '针灸1', // status:"1",
price: 199, // }
id: '12' // },
},
{
name: '针灸1',
nums: 1,
checked: true,
group: '针灸1',
price: 9939,
id: '111'
},
{
name: '针灸2',
nums: 1,
checked: false,
group: '针灸1',
price: 199,
id: '122'
},
],
selectedRows: [], selectedRows: [],
siteForm: { siteForm: {
name: '青春永驻套餐', create_time: "2025-05-29 17:08:29",
price: '99999' depart_id: "1",
doctor_id: "1",
id: "1",
name: "调理套餐",
price: "1500.00",
status: "1"
}, },
siteFormrules: { siteFormrules: {
name: [ name: [
{ required: true, message: '请输入站点简称', trigger: 'blur' } { required: true, message: '请输入套餐名称', trigger: 'blur' }
], ],
price: [ price: [
{ required: true, message: '请输入站点简称', trigger: 'blur' } { required: true, message: '请输入套餐价格', trigger: 'blur' }
], ],
}, },
projectTagData: [ projectTagData: [],
{ package_id: '',
name: '全部分类', doctor_id: '',
id: '0' depart_id: '',
},
{
name: '针灸1',
id: '1'
},
{
name: '针灸2',
id: '11'
},
{
name: '针灸3',
id: '12'
},
{
name: '针灸4',
id: '13'
},
],
} }
}, },
computed: { computed: {
...mapState(['pageTitle']) // VuexshowSidebar ...mapState(['pageTitle']),
sortedProjectList() {
return [...this.projectList].sort((a, b) => {
// sort
if (a.sort && !b.sort) return -1;
if (!a.sort && b.sort) return 1;
// sortsort
if (a.sort && b.sort) return a.sort - b.sort;
// sort
return 0;
});
}
}, },
mounted() { mounted() {
const { package_id, doctor_id, depart_id } = this.$route.query; // doctorId
this.package_id = package_id;
this.depart_id = depart_id;
this.doctor_id = doctor_id;
store.commit('SET_PAGETITLE', '基本设置'); store.commit('SET_PAGETITLE', '基本设置');
// //
if (package_id) {
this.getInitData()
return
}
this.fetchProjectData();
},
methods: {
//
getInitData() {
this.$http('POST', '/api/admin/get_project_package_info', {
depart_id: this.depart_id,
doctor_id: this.doctor_id,
package_id: this.package_id
}).then(response => {
if (response.code == 0) {
this.siteForm = { ...response.data }
if (response.data?.project_list) {
this.treatMentList = Object.values(response.data.project_list)
this.fetchProjectData()
}
}
}).catch(error => {
console.error(error, 'error')
})
},
fetchProjectData() {
this.$http('POST', '/api/admin/get_project_list', {
depart_id: this.depart_id,
doctor_id: this.doctor_id
}).then(response => {
if (response.code == 0) {
this.projectTagData = response.data.classify;//
this.projectList = Object.values(response.data.list).map(item => {
return {
...item,
checked: false
}
});//
if (this.package_id) {//
this.treatMentList.forEach(item => {
this.projectList.forEach(item1 => {
if (item.project_id == item1.id) {
item1.checked = true;
item1.num = item.num;
item1.sort = item.sort;
//
this.$nextTick(() => { this.$nextTick(() => {
if (this.treatMentList.length >= 2) { this.$refs.multipleTable.$refs.guiptable.toggleRowSelection(item1, true);
const defaultSelected = this.treatMentList.filter(item => item.checked === true); this.selectedRows.push(item1)
defaultSelected.forEach(row => {
this.$refs.multipleTable.$refs.guiptable.toggleRowSelection(row, true);
});
this.selectedRows = defaultSelected;
this.updateSelectionState(); this.updateSelectionState();
}
}); });
}
})
})
// this.$nextTick(() => {
// if (this.projectList.length >= 2) {
// const defaultSelected = this.projectList.filter(item => item.checked === true);
// defaultSelected.forEach(row => {
// this.$refs.multipleTable.$refs.guiptable.toggleRowSelection(row, true);
// });
// this.selectedRows = defaultSelected;
// this.updateSelectionState();
// }
// });
}
}
}).catch(error => {
console.error(error, 'error')
})
},
changeChecked() {
}, },
methods: {
inputBlur(val) { inputBlur(val) {
// //
this.$http('POST', '/supernew/ajax_get_type_batch_list', { this.$http('POST', '/supernew/ajax_get_type_batch_list', {
@ -228,7 +295,7 @@ export default {
console.log(val, '----搜索'); console.log(val, '----搜索');
}, },
updateSelectionState() { updateSelectionState() {
const allSelected = this.selectedRows.length === this.treatMentList.length; const allSelected = this.selectedRows.length === this.projectList.length;
const noneSelected = this.selectedRows.length === 0; const noneSelected = this.selectedRows.length === 0;
this.selectAll = allSelected; this.selectAll = allSelected;
this.isIndeterminate = !noneSelected && !allSelected; this.isIndeterminate = !noneSelected && !allSelected;
@ -243,7 +310,7 @@ export default {
handleSelectAllChange1(val) { handleSelectAllChange1(val) {
if (val) { if (val) {
// //
const unselectedRows = this.treatMentList.filter( const unselectedRows = this.projectList.filter(
row => !this.selectedRows1.includes(row) row => !this.selectedRows1.includes(row)
); );
unselectedRows.forEach(row => { unselectedRows.forEach(row => {
@ -256,8 +323,60 @@ export default {
}); });
} }
}, },
// /
//
//
//
changeNums(row) { changeNums(row) {
console.log(row.nums, '====row.nums'); if (row.sort) {
this.editorProjectInfo({ num: row.num, project_id: row.id })
} else {
this.changeSelectStatus(row)
}
},
//
changeClassify(row) {
if (row.sort) {
this.editorProjectInfo({ classify_id: row.classify_id, project_id: row.id })
} else {
this.changeSelectStatus(row)
}
},
//
changePrice(row) {
if (row.sort) {
this.editorProjectInfo({ price: row.price, project_id: row.id })
} else {
this.changeSelectStatus(row)
}
},
changeSelectStatus(row) {
this.$refs.multipleTable.$refs.guiptable.toggleRowSelection(row, true);
row.checked = true
// selectedRows
if (!this.selectedRows.includes(row)) {
this.selectedRows.push(row);
}
//
this.updateSelectionState();
},
//
editorProjectInfo(props) {
//
this.$http('POST', '/api/admin/edit_project', {
...props,
depart_id: this.depart_id,
doctor_id: this.doctor_id,
}).then(response => {
if (response.code == 0) {
this.$Message.success('修改成功')
this.getInitData()
}
}).catch(error => {
console.error(error, 'error')
})
}, },
handleClose() { handleClose() {
this.handleCancel() this.handleCancel()
@ -286,7 +405,7 @@ export default {
console.log(this.$refs.multipleTable, 'multipleTable-'); console.log(this.$refs.multipleTable, 'multipleTable-');
if (val) { if (val) {
// //
const unselectedRows = this.treatMentList.filter( const unselectedRows = this.projectList.filter(
row => !this.selectedRows.includes(row) row => !this.selectedRows.includes(row)
); );
unselectedRows.forEach(row => { unselectedRows.forEach(row => {
@ -365,7 +484,6 @@ export default {
console.log(data, '---'); console.log(data, '---');
}, },
submitForm(form) { submitForm(form) {
console.log(this.$refs[form], '-----');
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
console.log(this[form], '======formxinxi'); console.log(this[form], '======formxinxi');
if (valid) { if (valid) {
@ -376,7 +494,10 @@ export default {
}); });
}, },
cancelClick() { cancelClick() {
this.$router.push('/hosInformation') this.$router.push({
name: '医院信息',
query: { doctor_id: this.doctor_id,depart_id:this.depart_id }
})
}, },
confirmClick() { confirmClick() {
this.dialogVisible = true; this.dialogVisible = true;
@ -385,12 +506,13 @@ export default {
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.siteMessage { .siteMessage {
border-radius: 4px; border-radius: 4px;
transition: all .5s; transition: all .5s;
border: 1px solid transparent; border: 1px solid transparent;
} }
.content { .content {
margin-top: 16px; margin-top: 16px;
color: #626573; color: #626573;
@ -480,6 +602,13 @@ export default {
.site-setting-wrap { .site-setting-wrap {
width: 100%; width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.main-wrap {
flex: 1;
}
} }
#siteMessage2 { #siteMessage2 {

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

@ -239,7 +239,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) {
@ -392,30 +395,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;

299
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>
@ -90,9 +90,9 @@
<div class="flex-right"> <div class="flex-right">
<GuipFormItem column="column" label="每周出诊安排" :required="true"> <GuipFormItem column="column" label="每周出诊安排" :required="true">
<div class="flex weekPlan" slot="formDom"> <div class="flex weekPlan" slot="formDom">
<!-- <GuipSelect v-for="day in weekDays" :key="day.id" v-model="form.worktimes[day.id].plan" <GuipSelect v-for="day in weekDays" :key="day.id" v-model="form.worktimes[day.id].plan"
:options="options_weekPlan" @change="weekChange()" :label="day.name" placeholder="休息"> :options="options_weekPlan" @change="weekChange()" :label="day.name" placeholder="休息">
</GuipSelect> --> </GuipSelect>
</div> </div>
</GuipFormItem> </GuipFormItem>
</div> </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">
@ -153,16 +153,17 @@
</div> </div>
<span class="totalCount">{{ projectList.length }}已选{{ selectedCount }}</span> <span class="totalCount">{{ projectList.length }}已选{{ selectedCount }}</span>
<GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px', margin: '0 26px' }" <GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px', margin: '0 26px' }"
@click="batchOperate('1','project')">批量禁用</GuipButton> @click="batchOperate(0,'project')">批量禁用</GuipButton>
<GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px' }" <GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px' }"
@click="batchOperate('2','project')"> @click="batchOperate(1,'project')">
批量启用</GuipButton> 批量启用</GuipButton>
</div> </div>
</div> </div>
<div class="flex-between mb32 mt32"> <div class="flex-between mb32 mt32">
<div class="tabProject scroll-container"> <div class="tabProject scroll-container" v-if="Object.values(projectTagData).length > 0">
<div class="overTab scroll-list"> <div class="overTab scroll-list">
<div :class="['tab-item point', projectSearchId == 'all'? 'active' : '']" @click="selectTag('all')">全部分类</div>
<div :class="['tab-item point', projectSearchId == item.id ? 'active' : '']" @click="selectTag(item)" <div :class="['tab-item point', projectSearchId == item.id ? 'active' : '']" @click="selectTag(item)"
v-for="item in projectTagData" :key="item.name">{{ item.name }}</div> v-for="item in projectTagData" :key="item.name">{{ item.name }}</div>
</div> </div>
@ -175,16 +176,26 @@
</GuipInput> </GuipInput>
</div> </div>
</div> </div>
<GuipTable :tableData="projectList" style="width: 100%" ref="multipleTable" <GuipTable :tableData="projectList" :key="tableKey" style="width: 100%" ref="multipleTable"
@selection-change="handleSelectionChange" :loading="loading"> @selection-change="handleSelectionChange" :loading="loading" max-height="600px">
<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="185"></el-table-column>
<el-table-column prop="price" label="项目价格" min-width="125"></el-table-column> <el-table-column prop="price" label="项目价格" min-width="155">
<el-table-column prop="group" label="分组" min-width="125"></el-table-column> <template slot-scope="scope">
<el-table-column prop="time" label="添加时间" min-width="225"></el-table-column> <GuipInput width="90%" v-model="scope.row.price" @change="changePrice(scope.row)" />
</template>
</el-table-column>
<el-table-column prop="classify_id" label="分组" min-width="155">
<template slot-scope="scope">
<GuipSelect width="90%" v-model="scope.row.classify_id"
@change="changeClassify(scope.row)" prop="classify_id" :options="projectTagData"
valueKey="id" labelKey="name" />
</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="onSwitchChange1(scope.row)"> <GuipSwitch :modelValue="scope.row.status" active-value="1" inactive-value="0" @change="onSwitchChange1(scope.row)">
</GuipSwitch> </GuipSwitch>
</template> </template>
</el-table-column> </el-table-column>
@ -218,30 +229,34 @@
</div> </div>
<span class="totalCount">{{ courseList.length }}已选{{ selectedCount }}</span> <span class="totalCount">{{ courseList.length }}已选{{ selectedCount }}</span>
<GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px', margin: '0 26px' }" <GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px', margin: '0 26px' }"
@click="batchOperate('1','group')">批量禁用</GuipButton> @click="batchOperate(0,'group')">批量禁用</GuipButton>
<GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px' }" <GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px' }"
@click="batchOperate('2','group')"> @click="batchOperate(1,'group')">
批量启用</GuipButton> 批量启用</GuipButton>
</div> </div>
</div> </div>
<GuipTable :tableData="courseList" style="width: 100%" ref="multipleTable1" <GuipTable :tableData="courseList" style="width: 100%" ref="multipleTable1" max-height="600px"
@selection-change="handleSelectionChange1" :loading="loading1"> @selection-change="handleSelectionChange1" :loading="loading1" :key="tableKey1" >
<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" active-value="1" inactive-value="0" @change="onSwitchChange2(scope.row)">
</GuipSwitch> </GuipSwitch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" min-width="100px"> <el-table-column label="操作" fixed="right" min-width="100px">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex"> <div class="flex">
<el-button type="text" @click="handleClick(scope.row)">编辑</el-button> <el-button type="text" @click="handleClick1(scope.row)">编辑</el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -253,7 +268,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>
@ -282,6 +297,7 @@ import GuipSwitch from '@/components/GuipSwitch.vue';
import GuipTable from '@/components/GuipTable.vue'; import GuipTable from '@/components/GuipTable.vue';
import GuipDialog from '@/components/GuipDialog.vue'; import GuipDialog from '@/components/GuipDialog.vue';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import { Object } from 'core-js';
export default { export default {
// //
@ -304,6 +320,8 @@ export default {
return { return {
doctorId: '', doctorId: '',
dialogType: '1', dialogType: '1',
tableKey:Date.now(),
tableKey1:Date.now(),
dialogVisible: false, dialogVisible: false,
dialogVisible1: false, dialogVisible1: false,
form1: { form1: {
@ -321,7 +339,7 @@ export default {
selectedRows1: [],// selectedRows1: [],//
isIndeterminate: false, isIndeterminate: false,
isIndeterminate1: false, isIndeterminate1: false,
projectSearchId: '', projectSearchId: 'all',
projectSearchName: '', projectSearchName: '',
projectList: [ projectList: [
{ {
@ -354,65 +372,9 @@ export default {
name: '全部分类', name: '全部分类',
id: '0' id: '0'
}, },
{
name: '针灸1',
id: '1'
},
{
name: '针灸2',
id: '11'
},
{
name: '针灸3',
id: '12'
},
{
name: '针灸4',
id: '13'
},
{
name: '针灸12',
id: '21'
},
{
name: '针灸22',
id: '211'
},
{
name: '针灸32',
id: '212'
},
{
name: '针灸42',
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, selectAll: false,
selectAll1: false, selectAll1: false,
numSettingForm: { numSettingForm: {
@ -552,7 +514,10 @@ 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.fetchProjectData()
this.geHosAdress()
} }
}, },
computed: { computed: {
@ -562,6 +527,10 @@ export default {
...mapState(['hosMenuData']) // VuexshowSidebar ...mapState(['hosMenuData']) // VuexshowSidebar
}, },
methods: { methods: {
random() {
var randomNumber = Math.random();
return randomNumber
},
fetchDoctorData() { fetchDoctorData() {
this.$http('POST', '/api/admin/get_depart_info', { this.$http('POST', '/api/admin/get_depart_info', {
depart_id: this.depart_id, depart_id: this.depart_id,
@ -577,6 +546,54 @@ 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.loading1 = false
this.$nextTick(()=>{
this.courseList = response.data.list;
this.tableKey1 = Date.now(); //
})
}
}).catch(error => {
console.error(error, 'error')
})
},
//
fetchProjectData() {
this.$http('POST', '/api/admin/get_project_list', {
depart_id: this.depart_id,
doctor_id: this.doctor_id
}).then(response => {
if(response.code == 0){
this.loading = false
this.$nextTick(()=>{
this.projectTagData = response.data.classify;//
this.projectList = Object.values(response.data.list);//
this.tableKey = Date.now(); //
// this.$set('projectList',Object.values(response.data.list))
// this.$set('projectTagData',response.data.classify)
})
}
}).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)) {
@ -587,21 +604,24 @@ export default {
} }
}, },
selectTag(item) { selectTag(item) {
if(item == 'all'){
this.projectSearchId = 'all';
}else{
this.projectSearchId = item.id; this.projectSearchId = item.id;
}
// //
this.getFilterProject() // this.getFilterProject()
}, },
getFilterProject(){ getFilterProject(){
// //
this.$http('POST', '/supernew/ajax_get_type_batch_list', { this.$http('POST', '/supernew/ajax_get_type_batch_list', {
// //
projectid:this.projectSearchId, projectid:this.projectSearchId == 'all' ? '' : this.projectSearchId,
// //
projectSearchName:this.projectSearchName projectSearchName:this.projectSearchName
}).then(response => { }).then(response => {
this.projectTagData = response.data this.projectTagData = response.data;
}).catch(error => { }).catch(error => {
console.error(error, 'error') console.error(error, 'error')
}) })
@ -616,8 +636,40 @@ export default {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
//
changePrice(row) {
if (row.sort) {
this.editorProjectInfo({ price: row.price, project_id: row.id })
}
},
//
changeClassify(row) {
if (row.sort) {
this.editorProjectInfo({ classify_id: row.classify_id, project_id: row.id })
}
},
editorProjectInfo(props) {
this.$http('POST', '/api/admin/edit_project', {
...props,
depart_id: this.depart_id,
doctor_id: this.doctor_id,
}).then(response => {
if (response.code == 0) {
this.$Message.success('修改成功')
this.getInitData()
}
}).catch(error => {
console.error(error, 'error')
})
},
addNewSetMenu() { addNewSetMenu() {
this.$router.push('/addNewTreatment') this.$router.push(`/addNewTreatment?doctor_id=${this.doctor_id}&depart_id${this.depart_id}`)
},
addNewGroup(){
this.dialogVisible1 = true
},
addNewProject(){
this.dialogVisible = true
}, },
handleClose() { handleClose() {
this.$Message.info('弹框已关闭'); this.$Message.info('弹框已关闭');
@ -669,7 +721,7 @@ export default {
}, },
handleClick1(row) { handleClick1(row) {
console.log(row); console.log(row);
this.$router.push(`/addNewTreatment?id=${row.id}`) this.$router.push(`/addNewTreatment?package_id=${row.id}&doctor_id=${this.doctor_id}&depart_id=${this.depart_id}`)
// //
}, },
handleClick(row) { handleClick(row) {
@ -725,7 +777,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,23 +788,67 @@ export default {
}, },
// //
batchOperate(type,name) { batchOperate(type,name) {
if (type == '1') { //
let url= '/api/admin/project_package_mutil_option';
let props = {
status:type,
depart_id:this.depart_id,
doctor_id:this.doctor_id
}
let str = []
// //
if(name == 'project'){ if(name == 'project'){
// //
url='/api/admin/project_mutil_option';
// selectedRows
console.log(this.selectedRows,'----09999888');
this.selectedRows.forEach(item=>{
if(item.status != type){
str.push(item.id)
}
})
if(str.length == 0){
this.$message.error('请重新选择!')
return
}
props.project_ids = str.join(',')
}else{ }else{
// //
// selectedRows1
this.selectedRows1.forEach(item=>{
if(item.status != type){
str.push(item.id)
} }
})
} else { if(str.length == 0){
// this.$message.error('请重新选择!')
return
}
props.package_ids = str.join(',')
}
// console.log(url,props);
this.changePackData(url,props,name)
},
//
changePackData(url,params,name) {
this.$http('POST',url , {
...params
}).then(response => {
if(response.code == 0){
this.$Message.success('操作成功')
if(name == 'project'){ if(name == 'project'){
// this.loading = true;
this.selectedRows=[]
this.fetchProjectData()
}else{ }else{
// this.loading1 = true;
this.selectedRows1=[];
this.fetchPackData()
} }
} }
}).catch(error => {
console.error(error, 'error')
})
}, },
ChangeTime(type) { ChangeTime(type) {

Loading…
Cancel
Save