Browse Source

修改文本框、公共样式、交互

admin_version1.0_2025_06_26
zq 4 weeks ago
parent
commit
5a142cb9cd
  1. 28
      src/App.vue
  2. 15
      src/components/GuipTextarea.vue
  3. 13
      src/components/HoverButton.vue
  4. 287
      src/components/SetLeftMenu.vue
  5. 4
      src/components/SliderMenu.vue
  6. 2
      src/router/index.js
  7. 177
      src/store/index.js
  8. 7076
      src/style/theme/index.css
  9. 107
      src/views/DoctorInformation.vue
  10. 186
      src/views/HomeView.vue
  11. 66
      src/views/HosInformation.vue

28
src/App.vue

@ -8,7 +8,7 @@
<div class="bg"></div>
</el-header>
<el-container :class="(showHeader ? 'short-container' : '')">
<SliderMenu v-if="showSidebar" :menuData="menuData"></SliderMenu>
<SliderMenu v-if="showSidebar" :menuData="slidermenu" :customize="customize"></SliderMenu>
<el-container>
<!-- 面包屑导航 -->
<Breadcrumb />
@ -34,43 +34,21 @@ import Header from './components/Header.vue';
import Breadcrumb from './components/Breadcrumb.vue';
// import loadingAnimation from '@/assets/loadingAni.json' // JSON
import GlobalLoading from '@/components/GlobalLoading1.vue'
// import ContentWithLoading from '@/components/ContentWithLoading'
export default {
data() {
return {
isCollapse: true,
// menuData: [
// {
// index: '1',
// title: '1',
// icon: 'el-icon-location',
// children: [
// { index: '1-1', title: '1-1', path: '/' },
// { index: '1-2', title: 'ui', path: '/ui' }
// ]
// },
// {
// index: '2',
// title: '2',
// icon: 'el-icon-menu',
// children: [
// { index: '2-1', title: '2-1', path: '/about' },
// { index: '2-2', title: 'main', path: '/franchise' }
// ]
// }
// ]
};
},
components: {
GlobalLoading,
// ContentWithLoading,
SliderMenu,
// Footer,
Header,
Breadcrumb
},
computed: {
...mapState(['menuData','showSidebar', 'showFooter', 'showHeader']) // VuexshowSidebar
...mapState(['hosMenuData','slidermenu','customize','showSidebar', 'showFooter', 'showHeader']) // VuexshowSidebar
},
mounted() {
window.addEventListener('beforeunload', this.clearStorage);
@ -94,7 +72,6 @@ export default {
</script>
<style lang="scss" scoped>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
font-family: Microsoft YaHei UI;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@ -126,6 +103,7 @@ export default {
}
::v-deep .el-header {
width: 100%;
height: 62px;
overflow: hidden;
position: relative;

15
src/components/GuipTextarea.vue

@ -1,5 +1,6 @@
<template>
<el-form-item :label="label" :prop="prop" :rules="rules">
<el-form-item :label="label" :prop="prop" :rules="rules" :class="[{ 'column': column }]" :required="required">
<p v-if="desc" class="desc_right">{{ desc }}</p>
<el-input
type="textarea"
v-bind="$attrs"
@ -27,6 +28,10 @@ export default {
type: String,
default: '100%'
},
desc: {
type: String,
default: ''
},
// '100px' '100%'
height: {
type: String,
@ -42,6 +47,10 @@ export default {
type: String,
default: ''
},
column: {
type: String,
default: ''
},
// prop
prop: {
type: String,
@ -51,6 +60,10 @@ export default {
rules: {
type: [Object, Array],
default: () => []
},
required:{
type: Boolean,
default: false
}
},
data() {

13
src/components/HoverButton.vue

@ -4,9 +4,8 @@
:class="{ 'hover-effect': hoverEffect }"
@mouseenter="isHovered = true"
@mouseleave="isHovered = false"
@click="$emit('click')"
@click.stop
type="normal"
@click="handleClick"
type="button"
>
<!-- 图片/图标部分 -->
<div class="button-icon">
@ -82,6 +81,14 @@
return {
isHovered: false
}
},
methods:{
handleClick(e) {
// console.log(e,'----000999');
e.preventDefault();
e.stopPropagation();
this.$emit('click', e);
}
}
}
</script>

287
src/components/SetLeftMenu.vue

@ -1,15 +1,16 @@
<template>
<aside class="sidebar">
<ul>
<li v-for="(item, index) in menuList" :key="item.path">
<div :class="[$route.path == item.path ? 'active' : '', 'flex', $route.path == item.path ? curIndex = index : '']"
@click="gotoPath(item.path,index)">
<SvgIcon1 :iconPath="require(`@/assets/${item.img}`)" defaultColor="#8A9099" :size="16"
activeColor="#006AFF" :isActive="$route.path == item.path" />
<span class="title_text" >{{ item.name }}</span>
<li v-for="(item, index) in menuList" :key="item.path + random()">
<div
:class="[($route.path == item.path) || (item.noToPath && curIndex == index) ? 'active' : '', 'flex', ($route.path == item.path) ? curIndex = index : '']"
@click="gotoPath(item, index)">
<SvgIcon1 :iconPath="require(`@/assets/${item.img}`)" defaultColor="#8A9099" :size="16" activeColor="#006AFF"
:isActive="($route.path == item.path || (item.noToPath && curIndex == index))" />
<span class="title_text">{{ item.name }}</span>
</div>
<p :class="['flex', activeFloor == item1.desc ? 'curActive' : '']"
v-for="(item1) in item.list" @click="setActiveCur(item1.desc,item)" :key="item1.name">{{ item1.name }}</p>
<p :class="['flex', activeFloor == item1.desc ? 'curActive' : '']" v-for="(item1) in item.list"
@click="setActiveCur(item1.desc, item)" :key="item1.name">{{ item1.name }}</p>
</li>
</ul>
</aside>
@ -17,7 +18,6 @@
<script>
import SvgIcon1 from '@/components/SvgIcon1.vue';
// :class="[$route.path != item.path ? 'not-point' : '', 'flex', activeFloor == item1.desc ? 'curActive' : '']"
import { mapState } from 'vuex';
import store from '../store';
export default {
@ -42,149 +42,139 @@ export default {
activeFloor: null,
curIndex: 0,
scrollLock: false,
// menuList: [
// {
// name: '',
// path: '/siteSetting/siteBaseSetting',
// img: require('@/assets/site/sitebase.svg'),
// imgActive: require('@/assets/site/sitebase_active.svg'),
// list: [
// {
// name: '',
// desc: 'siteMessage1'
// },
// {
// name: '',
// desc: 'siteMessage2'
// },
// {
// name: '',
// desc: 'siteMessage3'
// },
// ]
// },
// {
// name: '',
// path: '/siteSetting/sitePersonalization',
// img: require('@/assets/site/gexinghua.svg'),
// imgActive: require('@/assets/site/sitebase_active.svg'),
// list: [
// {
// name: '',
// desc: 'siteMessage4'
// },
// {
// name: '',
// desc: 'siteMessage5'
// },
// {
// name: '',
// desc: 'siteMessage6'
// },
// {
// name: '',
// desc: 'siteMessage7'
// },
// {
// name: '',
// desc: 'siteMessage8'
// },
// ]
// },
// {
// name: '',
// path: '/siteSetting/siteH5',
// img: require('@/assets/site/siteh5.svg'),
// imgActive: require('@/assets/site/sitebase_active.svg'),
// list: [
// {
// name: 'H5',
// desc: 'siteMessage9'
// },
// {
// name: '',
// desc: 'siteMessage10'
// },
// ]
// },
// {
// name: '广',
// path: '/siteSetting/siteSem',
// img: require('@/assets/site/sitesem.svg'),
// imgActive: require('@/assets/site/sitebase_active.svg'),
// list: [
// {
// name: 'SEO',
// desc: 'siteMessage11'
// },
// {
// name: 'SEM',
// desc: 'siteMessage12'
// },
// {
// name: '访',
// desc: 'siteMessage13'
// },
// ]
// }
// ]
}
},
mounted() {
// console.log(this.curIndex,'this.curIndex');
this.activeFloor = this.menuList[this.curIndex]['list'][0]['desc'];
this.calculateFloorOffsets();
this.activeFloor = this.menuList[this.curIndex]?.list?.[0]?.desc;
this.$nextTick(() => {
// console.log(this.$parent.$refs.scrollContainer, 'this.$refs.scrollContainer--');
this.$parent.$refs.scrollContainer.addEventListener('scroll', this.handleScroll);
})
//
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();
} else {
console.error('未找到滚动容器');
}
});
},
watch: {
'$route'(to, from) {
console.log(to, from);
//
this.$nextTick(() => {
this.calculateFloorOffsets();
this.handleScroll(); //
});
}
},
beforeDestroy() {
if (this.scrollContainer) {
this.scrollContainer.removeEventListener('scroll', this.handleScroll);
}
},
created() {
// console.log(this.$parent.$refs.scrollContainer,'this.$refs.sc--rollContainer--');
},
computed: {
...mapState(['pageTitle']) // VuexshowSidebar
},
beforeDestroy() {
this.$parent.$refs.scrollContainer.removeEventListener('scroll', this.handleScroll);
...mapState(['pageTitle']) // VuexshowSidebar
},
methods: {
random() {
var randomNumber = Math.random();
return randomNumber
},
// calculateFloorOffsets() {
// this.menuList.forEach(item => {
// item.list.forEach(every => {
// const el = document.getElementById(every.desc);
// if (el) {
// every.offsetTop = el.offsetTop;
// }
// })
// });
// },
// handleScroll() {
// if (this.scrollLock) return
// const scrollContainer = this.$parent.$refs.scrollContainer;
// const scrollHeight = scrollContainer.scrollTop;
// let activeFloor = this.menuList[this.curIndex]['list'][0]['desc'];
// this.menuList[this.curIndex]['list'].forEach(item => {
// if (scrollHeight + 72 >= item.offsetTop) {
// activeFloor = item.desc; // ID
// } else {
// return false; //
// }
// });
// this.activeFloor = activeFloor; //
// },
calculateFloorOffsets() {
this.menuList.forEach(item => {
item.list.forEach(every => {
item.list?.forEach(every => {
const el = document.getElementById(every.desc);
if (el) {
every.offsetTop = el.offsetTop;
//
every.offsetTop = el.getBoundingClientRect().top + window.pageYOffset;
}
})
});
});
},
handleScroll() {
if (this.scrollLock) return
const scrollContainer = this.$parent.$refs.scrollContainer;
const scrollHeight = scrollContainer.scrollTop;
let activeFloor = this.menuList[this.curIndex]['list'][0]['desc'];
this.menuList[this.curIndex]['list'].forEach(item => {
if (scrollHeight + 72 >= item.offsetTop) {
activeFloor = item.desc; // ID
} else {
return false; //
if (this.scrollLock || !this.menuList[this.curIndex]?.list) return;
const scrollPosition = this.getScrollPosition();
let activeFloor = null;
//
for (let i = this.menuList[this.curIndex].list.length - 1; i >= 0; i--) {
const item = this.menuList[this.curIndex].list[i];
if (scrollPosition + 100 >= (item.offsetTop || 0)) { // 100
activeFloor = item.desc;
break;
}
});
this.activeFloor = activeFloor; //
}
if (activeFloor && this.activeFloor !== activeFloor) {
this.activeFloor = activeFloor;
}
},
setActiveCur(dom,item) {
if(this.$route.path != item.path){
this.$router.push(item.path)
store.commit('SET_PAGETITLE', item.name);
getScrollPosition() {
if (this.scrollContainer === window) {
return window.pageYOffset || document.documentElement.scrollTop;
}
setTimeout(()=>{
this.activeFloor = dom;
this.setHighActive(dom)
},500)
return this.scrollContainer.scrollTop;
},
gotoPath(path,index) {
if(this.$route.path != path){
// setActiveCur(dom, item) {
// if (this.$route.path != item.path) {
// this.$router.push(item.path)
// store.commit('SET_PAGETITLE', item.name);
// }
// setTimeout(() => {
// this.activeFloor = dom;
// this.setHighActive(dom)
// }, 500)
// },
// setHighActive(dom) {
// this.scrollLock = true;
// const ele = document.getElementById(dom)
// if (!ele) return
// ele.classList.add('ceshi')
// ele.scrollIntoView({ behavior: 'smooth', block: 'start' })
// setTimeout(() => {
// ele.classList.remove('ceshi')
// }, 1000)
// }
gotoPath(item, index) {
let path = item.path;
if (!path) {
this.curIndex = index;
return
}
if (this.$route.path != path) {
this.curIndex = index
this.scrollLock = false;
this.handleScroll()
@ -197,15 +187,31 @@ export default {
activeArea(type) {
console.log(type);
},
setHighActive(dom) {
setActiveCur(dom, item) {
if (item.path && this.$route.path !== item.path) {
this.$router.push(item.path);
store.commit('SET_PAGETITLE', item.name);
}
this.scrollLock = true;
const ele = document.getElementById(dom)
if(!ele)return
ele.classList.add('ceshi')
ele.scrollIntoView({ behavior: 'smooth', block: 'start' })
setTimeout(() => {
ele.classList.remove('ceshi')
}, 1000)
this.activeFloor = dom;
this.$nextTick(() => {
this.setHighActive(dom);
setTimeout(() => {
this.scrollLock = false;
}, 1000);
});
},
setHighActive(dom) {
const ele = document.getElementById(dom);
if (ele) {
ele.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
}
}
}
@ -213,7 +219,7 @@ export default {
<style scoped lang="scss">
.sidebar {
width: 158px;
min-width: 158px;
padding: 21px;
box-sizing: border-box;
background: #FFFFFF;
@ -223,7 +229,8 @@ export default {
.ceshi {
// animation: fadeInOut 2s infinite;
}
.title_text{
.title_text {
margin-left: 6px;
}

4
src/components/SliderMenu.vue

@ -26,7 +26,7 @@
{{ subItem.title }}
</el-menu-item>
</el-submenu>
<el-menu-item v-else :index="item.index" :key="item.index" @click="handleSelect(item.index, [item.index], item)">
<el-menu-item v-else :index="item.index" :key="item.index+'a'" @click="handleSelect(item.index, [item.index], item)">
<div class="flex">
<SvgIcon1 :iconPath="require(`@/assets/menu/${item.icon}.svg`)" defaultColor="#8A9099"
activeColor="#006AFF" :isActive="item.index == currentMenuItem?.index" />
@ -38,7 +38,6 @@
</el-menu>
<SetLeftMenu v-else :menuList="menuData"/>
<!-- <div v-else>---akjshdjka</div> -->
</transition>
</template>
@ -73,6 +72,7 @@ export default {
},
watch: {
"$route.path"() {
if(this.customize)return
this.updateCurrentMenu();
},
},

2
src/router/index.js

@ -7,7 +7,7 @@ import HomeView from '../views/HomeView.vue';
Vue.use(VueRouter)
const whiteSlideList = [ '/ui', '/hosInformation']; //侧边导航白名单
const whiteHeaderList = ['/','/doctorInformation', 'hosInformation','/addNewTreatment'
const whiteHeaderList = ['/','/doctorInformation', '/hosInformation','/addNewTreatment'
]; //头部导航白名单
const whiteFooterList = ['/','/doctorInformation' ,'/hosInformation','/addNewTreatment'
]; //底部白名单

177
src/store/index.js

@ -13,130 +13,54 @@ export default new Vuex.Store({
pageTitle: '一般新文献', //页面标题
addServiceList: [], //选中的服务
isLoading: false, //页面loading
rankMenuData: [{
index: '1',
title: '总利润',
icon: 'Totalprofit',
children: [{
index: '1-1',
title: '年排行',
path: '/super/ranking/yearProfit'
},
{
index: '1-2',
title: '月排行',
path: '/super/ranking/monthProfit'
}
]
},
{
index: '2',
title: '产品',
icon: 'Totalprofit1',
children: [{
index: '2-1',
title: '毛利润排行',
path: '/super/ranking/checkProfit'
},
{
index: '2-2',
title: '订单数排行',
path: '/super/ranking/checkOrdernum'
},
{
index: '2-3',
title: '退单数排行',
path: '/super/ranking/checkRefund'
},
{
index: '2-4',
title: '负毛利排行',
path: '/super/ranking/loss'
}
]
},
{
index: '3',
title: '代理商',
icon: 'Totalprofit2',
children: [{
index: '3-1',
title: '毛利润排行',
path: '/super/ranking/agentProfit'
},
{
index: '3-2',
title: '充值排行',
path: '/super/ranking/agentRecharge'
},
{
index: '3-3',
title: '新加盟',
path: '/super/ranking/agentNew'
}
]
},
{
index: '4',
title: '设置',
icon: 'Totalprofit3',
children: [{
index: '4-1',
title: '采购价',
path: '/super/ranking/purchase'
},
{
index: '4-2',
title: '阶段采购',
path: '/super/ranking/stagePurchase'
}
]
},
],
menuData: [
{
index: '1',
title: '首页',
path:'/',
icon: 'home',
},
{
index: '2',
title: '订单列表',
icon: 'orderList',
children: [{
index: '2-1',
title: '子级菜单2-1',
path: '/'
},
{
index: '2-2',
title: 'ui页面',
path: '/ui'
}
]
},
{
index: '3',
title: '父级菜单2',
icon: 'Totalprofit',
children: [{
index: '3-1',
title: '子级菜单3-1',
path: '/about'
},
{
index: '3-2',
title: '加盟耶main',
path: '/franchise'
}
]
}
],
customize: false, //页面loading
slidermenu:[],
hosMenuData:[{
name: '医院信息',
path: '',
noToPath:true,
img: 'menu/Totalprofit.svg',
imgActive: require('@/assets/menu/Totalprofit.svg'),
list: [
{
name: '基础信息',
desc: 'siteMessage1'
},
{
name: '出诊时间',
desc: 'siteMessage2'
},
{
name: '放号设置',
desc: 'siteMessage3'
}
]
},{
name: '项目管理',
path: '',
noToPath:true,
img: 'menu/Totalprofit1.svg',
imgActive: require('@/assets/menu/Totalprofit.svg'),
list: [
{
name: '项目列表',
desc: 'siteMessage4'
},
{
name: '疗程套餐',
desc: 'siteMessage5'
},
]
}],
pageName:'医生管理'
},
actions: {
SET_CUSTOMIZE({
commit
}) {
commit('SET_CUSTOMIZE');
},
SET_PAGENAME({
commit
}) {
@ -182,12 +106,25 @@ export default new Vuex.Store({
}) {
commit('HIDE_LOADING')
},
SET_SLIDER_MENU({
commit
}) {
commit('SET_SLIDER_MENU')
},
},
mutations: {
SET_SLIDER_MENU(state,type){
state.slidermenu = state[type]
},
SHOW_LOADING(state) {
state.isLoading = true
// state.loadingText = text || '加载中...'
},
SET_CUSTOMIZE(state,show) {
console.log(show,'show--');
state.customize = show
// state.loadingText = text || '加载中...'
},
HIDE_LOADING(state) {
state.isLoading = false
},

7076
src/style/theme/index.css

File diff suppressed because it is too large

107
src/views/DoctorInformation.vue

@ -16,7 +16,7 @@
</div>
</template>
<div class="qqCode-wrap right">
<el-upload class="avatar-uploader upload-demo" accept=".jpg,.png" :multiple="false"
<!-- <el-upload class="avatar-uploader upload-demo" accept=".jpg,.png" :multiple="false"
action="https://jsonplaceholder.typicode.com/posts/" :file-list="fileList" :on-change="handleFileChange" :auto-upload="false"
:before-upload="beforeAvatarUpload">
<hover-button slot="trigger" button-text="重新上传"
@ -24,6 +24,14 @@
:hover-icon="require('../assets/upLoad_active.svg')"
default-text-color="#23242B" hover-text-color="#006AFF" />
<div slot="tip" class="el-upload__tip desc">支持pngjpg格式尺寸32PX*32PX</div>
</el-upload> -->
<el-upload ref="upload" class="avatar-uploader" :auto-upload="false" accept=".jpg,.png" action="#" :file-list="fileList" :multiple="false" :http-request="customUpload">
<template #trigger>
<hover-button button-text="重新上传" :default-icon="require('../assets/upLoad_grey.svg')"
:hover-icon="require('../assets/upLoad_active.svg')"
default-text-color="#23242B" hover-text-color="#006AFF" @click="btnClick" />
</template>
<div slot="tip" class="el-upload__tip desc">支持pngjpg格式尺寸32PX*32PX</div>
</el-upload>
</div>
</el-form-item>
@ -47,25 +55,34 @@
<el-form :model="siteForm" :rules="siteFormrules2" ref="siteForm2">
<div class="flex-wrap">
<div class="flex-left">
<GuipRadio v-model="siteForm.first_visit_audit" class="mb12" column="column" :options="groupOptions"
label="初诊是否审批" required prop="first_visit_audit" @change="radioChange" />
<GuipRadio v-model="siteForm.first_visit_audit" class="mb12" column="column"
:options="groupOptions" label="初诊是否审批" required prop="first_visit_audit"
@change="radioChange" />
<GuipInput ref="GuipInput" column="column" label="审批人电话" desc="审批人电话、微信,至少填写一项"
v-model="siteForm.approve_phone" prop="approve_phone" placeholder="请输入" />
</div>
<div class="flex-line"></div>
<div class="flex-right">
<GuipFormItem column="column" label="审批人微信" >
<GuipFormItem column="column" label="审批人微信">
<span class="desc" slot="formRight">审批人电话微信至少填写一项</span>
<div class="qqCode-wrap right" slot="formDom">
<el-upload class="avatar-uploader upload-demo" accept=".jpg,.png" :multiple="false"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview" :on-remove="handleRemove"
:on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
<!-- <el-upload class="avatar-uploader upload-demo" accept=".jpg,.png" :multiple="false"
action="https://jsonplaceholder.typicode.com/posts/" :on-preview="handlePreview"
:on-remove="handleRemove" :on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<hover-button button-text="微信二维码"
:default-icon="require('../assets/upLoad_grey.svg')"
:hover-icon="require('../assets/upLoad_active.svg')"
default-text-color="#23242B" hover-text-color="#006AFF" @click="btnClick" />
<div slot="tip" class="el-upload__tip desc">审批人微信二维码大小2M以内</div>
</el-upload> -->
<el-upload ref="upload1" class="avatar-uploader" :auto-upload="false" action="#" :multiple="false" :http-request="customUpload">
<template #trigger>
<hover-button button-text="重新上传" :default-icon="require('../assets/upLoad_grey.svg')"
:hover-icon="require('../assets/upLoad_active.svg')"
default-text-color="#23242B" hover-text-color="#006AFF" @click="handleUploadClick" />
</template>
<div slot="tip" class="el-upload__tip desc">审批人微信二维码大小2M以内</div>
</el-upload>
</div>
</GuipFormItem>
@ -81,11 +98,8 @@
<div class="flex-left">
<GuipInput column="column" v-model="siteForm.doctor_desc" prop="doctor_desc" label="一句话介绍"
width="100%" height="56px" placeholder="请输入描述内容" maxlength="14" show-word-limit />
<GuipFormItem column="column" class="" label="详细介绍">
<GuipTextarea slot="formDom" v-model="siteForm.doctor_detail" prop="doctor_detail"
width="100%" height="86px" autosize placeholder="请输入描述内容" maxlength="不限"
show-word-limit />
</GuipFormItem>
<GuipTextarea label="详细介绍" column="column" v-model="siteForm.doctor_detail" prop="doctor_detail"
width="100%" autosize placeholder="请输入描述内容" maxlength="不限" show-word-limit />
</div>
<div class="flex-line"></div>
<div class="flex-right">
@ -157,13 +171,13 @@ export default {
doctor_desc: '',
doctor_detail: '',
label: '',
first_visit_audit:'1',
approve_phone:''
first_visit_audit: '1',
approve_phone: ''
},
oldForm: {},
siteFormrules2: {
first_visit_audit: [
{ required: true, message: '请选择初诊审批设置', trigger: 'change'}
{ required: true, message: '请选择初诊审批设置', trigger: 'change' }
]
},
siteFormrules: {
@ -219,8 +233,8 @@ export default {
}).then(response => {
if (response.code == 0) {
let obj = JSON.parse(JSON.stringify(this.siteForm))
this.oldForm = { ...obj,...response.data }
this.siteForm = { ...this.siteForm,...response.data }
this.oldForm = { ...obj, ...response.data }
this.siteForm = { ...this.siteForm, ...response.data }
if (response.data.avator) {
this.fileList = [{
name: 'avator',
@ -232,7 +246,23 @@ export default {
console.error(error, 'error')
})
},
btnClick() {
handleUploadClick(e) {
console.log(e,'------e====');
e.preventDefault();
this.$refs.upload.$el.querySelector('input[type="file"]').click();
},
btnClick(e) {
console.log(e,'------e====');
e.preventDefault();
this.$refs.upload1.$el.querySelector('input[type="file"]').click();
},
customUpload(params) {
//
const formData = new FormData();
console.log(params.file,'-222----');
formData.append('file', params.file);
// this.$http.post('/api/upload', formData).then()
},
handleRemove(file, fileList) {
console.log(file, fileList);
@ -257,7 +287,7 @@ export default {
});
},
handleFileChange(file, fileList) {
console.log(file,fileList,'======file');
console.log(file, fileList, '======file');
this.siteForm.avator = fileList.length ? 'uploaded' : '';
this.$refs.siteForm.validateField('avator');
this.fileList = fileList
@ -276,7 +306,7 @@ export default {
this.imageUrl1 = URL.createObjectURL(file.raw);
},
beforeAvatarUpload(file) {
console.log(file,'=====file');
console.log(file, '=====file');
const isJPG = file.type === 'image/jpeg' || file.type === 'image/png';
const isLt2M = file.size / 1024 / 1024 < 2;
@ -289,40 +319,36 @@ export default {
return isJPG && isLt2M;
},
submitForm(form) {
let props = {};
if (form == 'siteForm') {
this.$refs[form].validate((valid) => {
if (valid) {
this.$http('POST', '/supernew/ajax_get_type_batch_list', {
props = {
did: this.doctorId,
name: this.siteForm.doctor_name,
idcard: this.siteForm.idcard,
avatar_file: this.siteForm.avator,
phone: this.siteForm.phone
}).then(response => {
if (response.code == 0) {
this.$Message.success('修改成功')
}
}).catch(error => {
console.error(error, 'error')
})
}
} else {
return false;
}
});
} else {
this.$http('POST', '/supernew/ajax_get_type_batch_list', {
props = {
did: this.doctorId,
desc: form.doctor_desc,
detail: form.doctor_detail,
label: form.label
}).then(response => {
if (response.code == 0) {
this.$Message.success('修改成功')
}
}).catch(error => {
console.error(error, 'error')
})
}
}
this.$http('POST', '/supernew/ajax_get_type_batch_list', props).then(response => {
if (response.code == 0) {
this.$Message.success('修改成功')
}
}).catch(error => {
console.error(error, 'error')
})
},
cancelClick(type) {
// siteForm
@ -357,11 +383,13 @@ export default {
transition: all .5s;
border: 1px solid transparent;
}
.special-form-item {
.el-form-item__label{
.el-form-item__label {
margin-bottom: 12px;
}
.custom-label{
.custom-label {
gap: 6px;
}
}
@ -375,6 +403,7 @@ export default {
display: flex;
width: 100%;
justify-content: flex-start;
.labelImg {
opacity: .7;
margin-left: 8px;

186
src/views/HomeView.vue

@ -29,7 +29,7 @@
<el-avatar :src="item.avatar"></el-avatar>
<span class="name">{{ item.name }}</span>
<span>{{ item.phone }}</span>
<GuipSwitch :modelValue="item.status" @change="onSwitchChange(item,index)">
<GuipSwitch :modelValue="Boolean(item.status)" @change="onSwitchChange(item,index)">
</GuipSwitch>
<GuipButton type="text" @click="editDoctor(item,index)">编辑</GuipButton>
</div>
@ -120,85 +120,85 @@ export default {
doctorName:'',
isIndeterminate: false,
doctorList: [
// {
// id: 10,
// checked: false,
// name: '',
// idcard: '532524198711223615',
// desc: '',
// detail: '',
// tag: '',
// phone: '17785748373',
// avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
// status: true,
// list: [
// {
// hos: [
// ' ',
// ' ',
// ],
// time: '2054 - 10 - 03',
// status: true,
// group: '2',
// setMenu: '4',
// nums: '88',
// checked: false,
// },
// ]
// },
// {
// id: 10,
// checked: false,
// name: '',
// idcard: '532524198711223615',
// desc: '',
// detail: '',
// tag: '',
// phone: '17785748373',
// avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
// status: false,
// list: [
// {
// hos: [
// ' ',
// ' ',
// ],
// time: '2054 - 10 - 03',
// status: true,
// group: '2',
// setMenu: '4',
// nums: '88',
// checked: false,
// },
// {
// hos: [
// ' ',
// ' ',
// ],
// time: '2054 - 10 - 03',
// status: true,
// group: '2',
// setMenu: '4',
// nums: '88',
// checked: false,
// },
// ]
// },
// {
// id: 10,
// checked: false,
// name: '',
// idcard: '532524198711223615',
// desc: '',
// detail: '',
// tag: '',
// phone: '17785748373',
// avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
// status: false,
// list: [
{
id: 10,
checked: false,
name: '一二',
idcard: '532524198711223615',
desc: '就哈哈哈哈,嗷跳舞',
detail: '拉开是金德拉克撒娇了大数据连接拉萨。。。',
tag: '专业',
phone: '17785748373',
avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
status: 0,
list: [
{
hos: [
'第三人民医院 针灸科',
'第一人民医院 中医科',
],
time: '2054 - 10 - 03',
status: true,
group: '2',
setMenu: '4',
nums: '88',
checked: false,
},
]
},
{
id: 10,
checked: false,
name: '一二',
idcard: '532524198711223615',
desc: '就哈哈哈哈,嗷跳舞',
detail: '拉开是金德拉克撒娇了大数据连接拉萨。。。',
tag: '专业',
phone: '17785748373',
avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
status: 1,
list: [
{
hos: [
'第三人民医院 针灸科',
'第一人民医院 中医科',
],
time: '2054 - 10 - 03',
status: true,
group: '2',
setMenu: '4',
nums: '88',
checked: false,
},
{
hos: [
'第三人民医院 针灸科',
'第一人民医院 中医科',
],
time: '2054 - 10 - 03',
status: true,
group: '2',
setMenu: '4',
nums: '88',
checked: false,
},
]
},
{
id: 10,
checked: false,
name: '一二',
idcard: '532524198711223615',
desc: '就哈哈哈哈,嗷跳舞',
detail: '拉开是金德拉克撒娇了大数据连接拉萨。。。',
tag: '专业',
phone: '17785748373',
avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
status: 1,
list: [
// ]
// },
]
},
],
allChecked: false,
}
@ -228,7 +228,7 @@ export default {
methods: {
//
getInitData(){
this.$store.dispatch('showLoading')
// this.$store.dispatch('showLoading')
this.$http('POST', '/api/admin/doctor_depart_list', {
}).then(response => {
if (response.code == 0) {
@ -333,18 +333,24 @@ export default {
}
},
onSwitchChange(item,index) {
console.log(index, '====');
item.status = item.status == 0 ? 1 : 0;
console.log(index,item,'====');
this.$set(this.doctorList, item)
// let depart_ids = ''
//
this.$http('POST', '/supernew/ajax_get_type_batch_list', {
id:item.id
}).then(response => {
if (response.code == 0) {
this.doctorList = response.data
}
// this.$http('POST', '/api/admin/depart_mutil_option', {
// doctor_id:item.id,
// depart_ids:'',
// status:''
// }).then(response => {
// if (response.code == 0) {
// this.doctorList = response.data
// }
}).catch(error => {
console.error(error, 'error')
})
// }).catch(error => {
// console.error(error, 'error')
// })
},
addDoctor() {
this.$router.push(`/doctorInformation`)

66
src/views/HosInformation.vue

@ -47,12 +47,12 @@
</div>
</GuipFormItem>
<GuipFormItem column="column" class="mb24" label="使用功能">
<el-checkbox-group slot="formDom" v-model="form.type" class="checkboxGroup">
<el-checkbox-group slot="formDom" v-model="form.type" @change="validateSelection" class="checkboxGroup">
<div class="flex">
<el-checkbox label="医生名片(基础功能不可取消)" value="2"></el-checkbox>
<el-checkbox label="患者预约" value="0"></el-checkbox>
<el-checkbox :label="2" >医生名片基础功能不可取消</el-checkbox>
<el-checkbox :label="0">患者预约</el-checkbox>
</div>
<el-checkbox label="项目计数" value="1"></el-checkbox>
<el-checkbox :label="1">项目计数</el-checkbox>
</el-checkbox-group>
</GuipFormItem>
<GuipFormItem column="column" class="" label="就诊提醒">
@ -66,7 +66,7 @@
<GroupFormBtns @cancel="cancelClick" @confirm="submitForm('siteForm')" />
</div>
<div class="siteMessage flex-common mt12" id="siteMessage3">
<div class="siteMessage flex-common mt12" id="siteMessage2">
<p class="littleTitle mb32">出诊时间</p>
<el-form :model="form" :rules="siteFormrules1" ref="siteForm1">
<div class="flex-wrap">
@ -100,7 +100,7 @@
</el-form>
<GroupFormBtns @cancel="cancelClick" @confirm="submitForm('siteForm1')" />
</div>
<div class="siteMessage flex-common mt12" id="siteMessage4">
<div class="siteMessage flex-common mt12" id="siteMessage3">
<p class="littleTitle mb32">放号设置</p>
<el-form :model="form" :rules="numSettingFormRule" ref="numSettingForm">
<div class="flex-wrap">
@ -136,7 +136,7 @@
<GroupFormBtns @cancel="cancelClick" @confirm="submitForm('numSettingForm')" />
</div>
<!-- <p class="pageTitle bold">项目管理</p> -->
<div class="siteMessage flex-common mt12" id="siteMessage5">
<div class="siteMessage flex-common mt12" id="siteMessage4">
<el-form>
<div class=" mb32 flex-between">
<span class="littleTitle">项目列表</span>
@ -166,8 +166,8 @@
v-for="item in projectTagData" :key="item.name">{{ item.name }}</div>
</div>
<div class="right flex">
<span>搜索项目</span>
<GuipInput slot="formDom" ref="GuipInput" column="column" v-model="projectSearchName"
<span style="margin-right: 16px;">搜索项目</span>
<GuipInput ref="GuipInput" column="column" width="280px" v-model="projectSearchName"
prop="company_name" placeholder="请输入">
<img src="@/assets/input_search_ic.svg" slot="suffix" @click="handleClear" />
</GuipInput>
@ -200,7 +200,7 @@
</el-pagination>
</el-form>
</div>
<div class="siteMessage flex-common mt12" id="siteMessage6">
<div class="siteMessage flex-common mt12" id="siteMessage5">
<el-form>
<div class=" mb32 flex-between">
<span class="littleTitle">疗程套餐</span>
@ -270,6 +270,7 @@
<script>
import GuipFormItem from '@/components/GuipFormItem.vue';
import BatchProject from '@/components/BatchProject.vue';
import store from '@/store';
import GuipButton from '@/components/GuipButton.vue';
import GuipInput from '@/components/GuipInput.vue';
import GuipTextarea from '@/components/GuipTextarea.vue';
@ -280,6 +281,7 @@ import GuipTable from '@/components/GuipTable.vue';
import GuipDialog from '@/components/GuipDialog.vue';
// import GuipRadio from '@/components/GuipRadio.vue';
// import HoverButton from '@/components/HoverButton.vue';
import { mapState } from 'vuex';
export default {
//
@ -372,6 +374,22 @@ export default {
name: '针灸4',
id: '13'
},
{
name: '针灸1',
id: '21'
},
{
name: '针灸2',
id: '211'
},
{
name: '针灸3',
id: '212'
},
{
name: '针灸4',
id: '213'
},
],
courseList: [
{
@ -528,19 +546,24 @@ export default {
},
}
},
created(){
store.commit('SET_CUSTOMIZE', true);
store.commit('SET_SLIDER_MENU','hosMenuData');
},
mounted() {
const { depart_id, doctor_id } = this.$route.query; // doctorId
if (doctor_id && depart_id) {
//
this.depart_id = depart_id;
this.doctor_id = doctor_id;
this.fetchDoctorData()
// this.fetchDoctorData()
}
},
computed: {
selectedCount() {
return this.selectedRows.length;
}
},
...mapState(['hosMenuData']) // VuexshowSidebar
},
methods: {
fetchDoctorData() {
@ -549,6 +572,7 @@ export default {
doctor_id: this.doctor_id
}).then(response => {
this.form = { ...this.form, ...response.data,
type:response.type ? [Number(response.type)] : [2],
'morning_worktime':response.data.morning_worktime.split('-'),
'afternoon_worktime':response.data.afternoon_worktime.split('-')
}
@ -557,6 +581,15 @@ export default {
console.error(error, 'error')
})
},
validateSelection(val) {
//
if (!val.includes(2)) {
this.$nextTick(() => {
this.form.type = [...val, 2];
this.$message.warning('基础功能不可取消');
});
}
},
selectTag(item) {
this.projectSearchId = item.id
},
@ -773,6 +806,11 @@ export default {
}
break;
case 'siteForm':
props={
is_fixed:this.form.is_fixed,
type:form.type,
notice:form.notice
}
break;
case 'numSettingForm':
props={
@ -782,10 +820,6 @@ export default {
treat_expire:form.treat_expire,
}
break;
// case 'numSettingForm':
// break;
// case 'numSettingForm':
// break;
}
this.updateHosInfo(props)
} else {

Loading…
Cancel
Save