Browse Source

合并master

admin_version1.0_2025_06_26
kuaileWu 3 weeks ago
parent
commit
ceeaa914c3
  1. 60
      src/components/Breadcrumb.vue
  2. 143
      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. 325
      src/views/AddNewTreatment.vue
  9. 8
      src/views/DoctorInformation.vue
  10. 20
      src/views/HomeView.vue
  11. 313
      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;
}
}

143
src/components/GlobalLoading1.vue

@ -1,14 +1,15 @@
<template>
<div>
<div class="content-loading-overlay" v-show="isLoading">
<div class="loading-content">
<div ref="animationContainer" class="animation-container"></div>
</div>
</div>
<div v-show="!isLoading">
<slot></slot>
</div>
</div>
<div style="height:100%">
<div class="content-loading-overlay" v-show="isLoading">
<div class="loading-content">
<div ref="animationContainer" class="animation-container"></div>
</div>
</div>
<div style="height:100%" v-show="!isLoading">
<slot></slot>
<!-- <Footer v-if="showFooter"></Footer> -->
</div>
</div>
</template>
<script>
import lottie from 'lottie-web'
@ -16,85 +17,87 @@ import { mapState } from 'vuex'
import defaultAnimation from '@/assets/loadingAni.json'
export default {
name: 'Loading',
data() {
return {
anim: null
}
},
computed: {
...mapState(['isLoading', 'loadingText'])
},
watch: {
isLoading(newVal) {
this.$nextTick(() => {
if (newVal) {
this.playAnimation()
} else {
this.stopAnimation()
}
})
}
},
methods: {
playAnimation() {
//
if (this.anim) {
this.anim.destroy()
this.anim = null
}
console.log('执行动画')
this.anim = lottie.loadAnimation({
container: this.$refs.animationContainer,
renderer: 'svg',
loop: true,
autoplay: true,
animationData: defaultAnimation
})
},
stopAnimation() {
if (this.anim) {
this.anim.stop()
name: 'Loading',
data() {
return {
anim: null
}
},
components: {
},
computed: {
...mapState(['isLoading','showFooter', 'loadingText'])
},
watch: {
isLoading(newVal) {
this.$nextTick(() => {
if (newVal) {
this.playAnimation()
} else {
this.stopAnimation()
}
})
}
},
methods: {
playAnimation() {
//
if (this.anim) {
this.anim.destroy()
this.anim = null
}
console.log('执行动画')
this.anim = lottie.loadAnimation({
container: this.$refs.animationContainer,
renderer: 'svg',
loop: true,
autoplay: true,
animationData: defaultAnimation
})
},
beforeDestroy() {
stopAnimation() {
if (this.anim) {
this.anim.destroy() //
this.anim.stop()
}
}
},
beforeDestroy() {
if (this.anim) {
this.anim.destroy() //
}
}
}
</script>
<style scoped>
.content-loading-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.8);
z-index: 1000;
/* 确保高于内容 */
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.8);
z-index: 1000;
/* 确保高于内容 */
display: flex;
justify-content: center;
align-items: center;
}
.loading-content {
text-align: center;
text-align: center;
}
.animation-container {
width: 180px;
height: 180px;
margin: 0 auto;
width: 180px;
height: 180px;
margin: 0 auto;
}
.loading-text {
margin-top: 20px;
font-size: 16px;
color: #333;
margin-top: 20px;
font-size: 16px;
color: #333;
}
</style>

2
src/components/GuipSelect.vue

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

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

5
src/router/index.js

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

325
src/views/AddNewTreatment.vue

@ -1,6 +1,6 @@
<template>
<div class="site-setting-wrap min-flex-right">
<div class="pagePadding">
<div class="site-setting-wrap min-flex-right">
<div class="pagePadding main-wrap">
<p class="pageTitle bold">新增套餐</p>
<div class="siteMessage flex-common" id="siteMessage2">
<p class="littleTitle mb32">套餐信息</p>
@ -30,13 +30,13 @@
<el-checkbox @change="handleSelectAllChange1" v-model="selectAll"
:indeterminate="isIndeterminate">全选</el-checkbox>
</div>
<span class="totalCount">{{ treatMentList.length }}已选{{ selectedCount }}</span>
<span class="totalCount">{{ projectList.length }}已选{{ selectedCount }}</span>
</div>
<div class="flex-between mb32 mt32">
<div class="tabProject flex">
<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 class="right flex">
<GuipFormItem label="搜索项目">
@ -47,22 +47,35 @@
</GuipFormItem>
</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">
<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 label="次数" min-width="150px">
<el-table-column label="次数" min-width="150px" prop="num">
<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>
</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>
<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"
:total="treatMentList.length">
</el-pagination>
</el-pagination> -->
</el-form>
</div>
</div>
@ -73,8 +86,8 @@
</GuipButton>
</div>
<GuipDialog :dialogVisible="dialogVisible" :title="'新增套餐确认'" :show-close-button="true" width="599px"
:show-cancel-button="true" @confirm="handleConfirm" @cancel="handleCancel"
@close="handleClose" confirmText="确定新增">
:show-cancel-button="true" @confirm="handleConfirm" @cancel="handleCancel" @close="handleClose"
confirmText="确定新增">
<div class="flex content">
<span>套餐名称</span>
<span>{{ siteForm.name }}套餐</span>
@ -100,6 +113,7 @@ import GuipTable from '@/components/GuipTable.vue';
import GuipDialog from '@/components/GuipDialog.vue';
import GuipInput from '@/components/GuipInput.vue';
import GuipButton from '@/components/GuipButton.vue';
import GuipSelect from '@/components/GuipSelect.vue';
export default {
//
name: '',
@ -109,12 +123,13 @@ export default {
GuipInput,
GuipDialog,
GuipButton,
GuipSelect,
GuipTable
},
data() {
return {
dialogVisible: true,
dialogVisible: false,
selectAll: false,
selectedCount: 0,
currentPage: 1,
@ -123,100 +138,152 @@ export default {
projectSearchName: '',
projectSearchId: '0',
loading: false,
treatMentList: [
{
name: '针灸1',
nums: 1,
checked: true,
group: '针灸1',
price: 9939,
id: '11'
},
{
name: '针灸2',
nums: 1,
checked: false,
group: '针灸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'
},
],
treatMentList: [],//
projectList: [],//
// {
// 27:{
// classify_name:"",
// create_time:"2025-05-29 17:09:43",
// id:"1",
// name:"",
// num:"2",
// pid:"1",
// price:"200.00",
// project_id:"27",
// sort:"1",
// status:"1",
// }
// },
selectedRows: [],
siteForm: {
name: '青春永驻套餐',
price: '99999'
create_time: "2025-05-29 17:08:29",
depart_id: "1",
doctor_id: "1",
id: "1",
name: "调理套餐",
price: "1500.00",
status: "1"
},
siteFormrules: {
name: [
{ required: true, message: '请输入站点简称', trigger: 'blur' }
{ required: true, message: '请输入套餐名称', trigger: 'blur' }
],
price: [
{ required: true, message: '请输入站点简称', trigger: 'blur' }
{ required: true, message: '请输入套餐价格', trigger: 'blur' }
],
},
projectTagData: [
{
name: '全部分类',
id: '0'
},
{
name: '针灸1',
id: '1'
},
{
name: '针灸2',
id: '11'
},
{
name: '针灸3',
id: '12'
},
{
name: '针灸4',
id: '13'
},
],
projectTagData: [],
package_id: '',
doctor_id: '',
depart_id: '',
}
},
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() {
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', '基本设置');
//
this.$nextTick(() => {
if (this.treatMentList.length >= 2) {
const defaultSelected = this.treatMentList.filter(item => item.checked === true);
defaultSelected.forEach(row => {
this.$refs.multipleTable.$refs.guiptable.toggleRowSelection(row, true);
});
this.selectedRows = defaultSelected;
this.updateSelectionState();
}
});
//
if (package_id) {
this.getInitData()
return
}
this.fetchProjectData();
},
methods: {
inputBlur(val){
//
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.$refs.multipleTable.$refs.guiptable.toggleRowSelection(item1, true);
this.selectedRows.push(item1)
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() {
},
inputBlur(val) {
//
this.$http('POST', '/supernew/ajax_get_type_batch_list', {
projectSearchId:this.projectSearchId,
search:this.projectSearchName
projectSearchId: this.projectSearchId,
search: this.projectSearchName
}).then(response => {
if (response.code == 0) {
this.dialogVisible = false;
@ -225,10 +292,10 @@ export default {
}).catch(error => {
console.error(error, 'error')
})
console.log(val,'----搜索');
console.log(val, '----搜索');
},
updateSelectionState() {
const allSelected = this.selectedRows.length === this.treatMentList.length;
const allSelected = this.selectedRows.length === this.projectList.length;
const noneSelected = this.selectedRows.length === 0;
this.selectAll = allSelected;
this.isIndeterminate = !noneSelected && !allSelected;
@ -243,7 +310,7 @@ export default {
handleSelectAllChange1(val) {
if (val) {
//
const unselectedRows = this.treatMentList.filter(
const unselectedRows = this.projectList.filter(
row => !this.selectedRows1.includes(row)
);
unselectedRows.forEach(row => {
@ -256,8 +323,60 @@ export default {
});
}
},
// /
//
//
//
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() {
this.handleCancel()
@ -286,7 +405,7 @@ export default {
console.log(this.$refs.multipleTable, 'multipleTable-');
if (val) {
//
const unselectedRows = this.treatMentList.filter(
const unselectedRows = this.projectList.filter(
row => !this.selectedRows.includes(row)
);
unselectedRows.forEach(row => {
@ -365,7 +484,6 @@ export default {
console.log(data, '---');
},
submitForm(form) {
console.log(this.$refs[form], '-----');
this.$refs[form].validate((valid) => {
console.log(this[form], '======formxinxi');
if (valid) {
@ -376,7 +494,10 @@ export default {
});
},
cancelClick() {
this.$router.push('/hosInformation')
this.$router.push({
name: '医院信息',
query: { doctor_id: this.doctor_id,depart_id:this.depart_id }
})
},
confirmClick() {
this.dialogVisible = true;
@ -385,13 +506,14 @@ export default {
}
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.siteMessage {
border-radius: 4px;
transition: all .5s;
border: 1px solid transparent;
}
.content{
.content {
margin-top: 16px;
color: #626573;
letter-spacing: 0.08em;
@ -480,6 +602,13 @@ export default {
.site-setting-wrap {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.main-wrap {
flex: 1;
}
}
#siteMessage2 {

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

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

313
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>
@ -90,9 +90,9 @@
<div class="flex-right">
<GuipFormItem column="column" label="每周出诊安排" :required="true">
<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="休息">
</GuipSelect> -->
</GuipSelect>
</div>
</GuipFormItem>
</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">
@ -153,16 +153,17 @@
</div>
<span class="totalCount">{{ projectList.length }}已选{{ selectedCount }}</span>
<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' }"
@click="batchOperate('2','project')">
@click="batchOperate(1,'project')">
批量启用</GuipButton>
</div>
</div>
<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="['tab-item point', projectSearchId == 'all'? 'active' : '']" @click="selectTag('all')">全部分类</div>
<div :class="['tab-item point', projectSearchId == item.id ? 'active' : '']" @click="selectTag(item)"
v-for="item in projectTagData" :key="item.name">{{ item.name }}</div>
</div>
@ -175,16 +176,26 @@
</GuipInput>
</div>
</div>
<GuipTable :tableData="projectList" style="width: 100%" ref="multipleTable"
@selection-change="handleSelectionChange" :loading="loading">
<GuipTable :tableData="projectList" :key="tableKey" style="width: 100%" ref="multipleTable"
@selection-change="handleSelectionChange" :loading="loading" max-height="600px">
<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="185"></el-table-column>
<el-table-column prop="price" label="项目价格" min-width="155">
<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="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">
<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>
</template>
</el-table-column>
@ -218,30 +229,34 @@
</div>
<span class="totalCount">{{ courseList.length }}已选{{ selectedCount }}</span>
<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' }"
@click="batchOperate('2','group')">
@click="batchOperate(1,'group')">
批量启用</GuipButton>
</div>
</div>
<GuipTable :tableData="courseList" style="width: 100%" ref="multipleTable1"
@selection-change="handleSelectionChange1" :loading="loading1">
<GuipTable :tableData="courseList" style="width: 100%" ref="multipleTable1" max-height="600px"
@selection-change="handleSelectionChange1" :loading="loading1" :key="tableKey1" >
<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)">
<GuipSwitch :modelValue="scope.row.status" active-value="1" inactive-value="0" @change="onSwitchChange2(scope.row)">
</GuipSwitch>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" min-width="100px">
<template slot-scope="scope">
<div class="flex">
<el-button type="text" @click="handleClick(scope.row)">编辑</el-button>
<el-button type="text" @click="handleClick1(scope.row)">编辑</el-button>
</div>
</template>
</el-table-column>
@ -253,7 +268,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>
@ -282,6 +297,7 @@ import GuipSwitch from '@/components/GuipSwitch.vue';
import GuipTable from '@/components/GuipTable.vue';
import GuipDialog from '@/components/GuipDialog.vue';
import { mapState } from 'vuex';
import { Object } from 'core-js';
export default {
//
@ -304,6 +320,8 @@ export default {
return {
doctorId: '',
dialogType: '1',
tableKey:Date.now(),
tableKey1:Date.now(),
dialogVisible: false,
dialogVisible1: false,
form1: {
@ -321,7 +339,7 @@ export default {
selectedRows1: [],//
isIndeterminate: false,
isIndeterminate1: false,
projectSearchId: '',
projectSearchId: 'all',
projectSearchName: '',
projectList: [
{
@ -354,65 +372,9 @@ export default {
name: '全部分类',
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,
selectAll1: false,
numSettingForm: {
@ -552,7 +514,10 @@ export default {
//
this.depart_id = depart_id;
this.doctor_id = doctor_id;
// this.fetchDoctorData()
this.fetchDoctorData()
this.fetchPackData()
this.fetchProjectData()
this.geHosAdress()
}
},
computed: {
@ -562,6 +527,10 @@ export default {
...mapState(['hosMenuData']) // VuexshowSidebar
},
methods: {
random() {
var randomNumber = Math.random();
return randomNumber
},
fetchDoctorData() {
this.$http('POST', '/api/admin/get_depart_info', {
depart_id: this.depart_id,
@ -577,6 +546,54 @@ 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.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) {
//
if (!val.includes(2)) {
@ -587,21 +604,24 @@ export default {
}
},
selectTag(item) {
this.projectSearchId = item.id;
if(item == 'all'){
this.projectSearchId = 'all';
}else{
this.projectSearchId = item.id;
}
//
this.getFilterProject()
// this.getFilterProject()
},
getFilterProject(){
//
this.$http('POST', '/supernew/ajax_get_type_batch_list', {
//
projectid:this.projectSearchId,
projectid:this.projectSearchId == 'all' ? '' : this.projectSearchId,
//
projectSearchName:this.projectSearchName
}).then(response => {
this.projectTagData = response.data
this.projectTagData = response.data;
}).catch(error => {
console.error(error, 'error')
})
@ -616,8 +636,40 @@ export default {
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() {
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() {
this.$Message.info('弹框已关闭');
@ -669,7 +721,7 @@ export default {
},
handleClick1(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) {
@ -725,7 +777,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,23 +788,67 @@ export default {
},
//
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'){
//
}else{
//
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
}
} else {
//
if(name == 'project'){
//
}else{
//
props.project_ids = str.join(',')
}else{
//
// selectedRows1
this.selectedRows1.forEach(item=>{
if(item.status != type){
str.push(item.id)
}
})
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'){
this.loading = true;
this.selectedRows=[]
this.fetchProjectData()
}else{
this.loading1 = true;
this.selectedRows1=[];
this.fetchPackData()
}
}
}).catch(error => {
console.error(error, 'error')
})
},
ChangeTime(type) {

Loading…
Cancel
Save