Browse Source

首次提交

master
zq 4 days ago
parent
commit
ba0b36b9a1
  1. 13514
      package-lock.json
  2. 0
      src/router/admin-routes.json
  3. 0
      src/router/client-routes.json
  4. 23
      src/router/index.js
  5. 409
      src/views/HomeView.vue
  6. 1754
      src/views/Register.vue
  7. 1001
      src/views/elementGroups.vue
  8. 2
      vue.config.js

13514
package-lock.json

File diff suppressed because it is too large

0
src/router/admin-routes.json

0
src/router/client-routes.json

23
src/router/index.js

@ -67,28 +67,7 @@ const routes = [
meta: {
hideBreadcrumb: true // 首页不显示面包屑
}
},
{
path: '/ui',
name: 'ui组件',
component: () => import( /* webpackChunkName: "ui" */ '../views/elementGroups.vue'),
meta: {
title: 'ui示例',
breadcrumbTitle: route => `ui ${route.params.userId}` // 自定义面包屑标题
}
},
{
path: '/super/ranking',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/Ranking.vue'),
children: [
{
path: 'checkProfit',
name: '产品毛利润排行',
component: () => import( /* webpackChunkName: "Ranking" */ '../views/super/Ranking/RankBatchList.vue'),
props: {pageTitle:'产品 - 毛利润排行', rank_type: 1, type: 'check_type'}
},
]
},
}
]
const router = new VueRouter({

409
src/views/HomeView.vue

@ -1,154 +1,28 @@
<template>
<div class="min-width pagePadding " style="background: #F5F7FA;" v-if="pageShow">
<div class="doctor-list-wrap ">
<p class="pageTitle">医生列表</p>
<el-form>
<div class="selectAllTable-wrap flex-between mt32">
<div class="left flex">
<div class="checkboxAll">
<el-checkbox @change="handleTotalCheckAllChange" v-model="allChecked"
:indeterminate="isIndeterminate">全选</el-checkbox>
</div>
<span class="totalCount">{{ totalNum }}已选{{ selectNum }}</span>
<GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px', margin: '0 26px' }"
@click="batchOperate('0')">批量禁用</GuipButton>
<GuipButton type="ignore" :btnstyle="{ width: '99px', height: '32px' }"
@click="batchOperate('1')">
批量启用</GuipButton>
</div>
<div class="right flex">
<span>搜索医生</span>
<GuipInput ref="GuipInput" style="margin:0 24px 0 12px" width="280px" height="32px"
placeholder="输入姓名" @blur="inputBlur" v-model="doctorName" />
<GuipButton @click="addDoctor" size="form">新增医生</GuipButton>
</div>
</div>
<div class="tableList mt32" v-for="(item, index) in doctorList" :key="index">
<div class="top flex-between mb24">
<div class="left left1 flex">
<el-checkbox @change="handleCheckAllChange(index)" v-model="item.checked"></el-checkbox>
<el-avatar :src="item.avator" v-if="item.avator"></el-avatar>
<span class="name">{{ item.name }}</span>
<span>{{ item.phone }}</span>
<GuipSwitch :value="Boolean(Number(item.status))" @change="onSwitchChange(item, index)" :active-value="true" :inactive-value="false"></GuipSwitch>
<GuipButton type="text" @click="editDoctor(item, index)">编辑</GuipButton>
</div>
<div class="right">
<GuipButton type="system" size="form" @click="addHospital(item)">添加医院</GuipButton>
</div>
</div>
<GuipTable :tableData="item.departs" style="width: 100%" :ref="(el) => setPopoverRef(index, el)"
@selection-change="handleSelectionChange(index, $event)" :show-header="false"
:loading="loading">
<el-table-column type="selection" width="135">
</el-table-column>
<el-table-column prop="depart_name" label="出诊医院" min-width="295">
<template slot-scope="scope">
<div class="flex cell_render">
<span>{{ scope.row.hispital_name }} {{ scope.row.depart_name }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="project_count" label="项目个数" min-width="135">
<template slot-scope="scope">
<div class="flex cell_render">
<span>{{ scope.row.project_count }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="classify_count" label="组别" min-width="135">
<template slot-scope="scope">
<div class="flex cell_render">
{{ scope.row.classify_count }}分组
</div>
</template>
</el-table-column>
<el-table-column prop="classify_count" label="套餐" min-width="165">
<template slot-scope="scope">
<div class="flex cell_render">
{{ scope.row.package_count }}套餐
</div>
</template>
</el-table-column>
<el-table-column prop="create" label="时间" min-width="250"> </el-table-column>
<el-table-column prop="stock" fixed="right" min-width="110">
<template slot-scope="scope">
<GuipSwitch :value="scope.row.status" active-value="1" inactive-value="0" @change="onSwitchChange1(scope.row)"></GuipSwitch>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" min-width="120px">
<template slot-scope="scope">
<div class="flex">
<el-button type="text" @click="handleClick(scope.row)">编辑</el-button>
</div>
</template>
</el-table-column>
</GuipTable>
</div>
</el-form>
</div>
<div class="min-width pagePadding " style="background: #F5F7FA;">
sdjkhfkdskfsdkfjlsdk
</div>
</template>
<script>
// const cityOptions = ['', '', '广', ''];
import store from '@/store';
import GuipTable from '@/components/GuipTable.vue';
// import SvgIcon from '@/components/SvgIcon.vue';
import GuipButton from '@/components/GuipButton.vue';
import GuipSwitch from '@/components/GuipSwitch.vue';
import GuipInput from '@/components/GuipInput.vue';
// import GuipTable from '@/components/GuipTable.vue';
// import GuipButton from '@/components/GuipButton.vue';
// import GuipSwitch from '@/components/GuipSwitch.vue';
// import GuipInput from '@/components/GuipInput.vue';
import { mapState } from 'vuex';
export default {
data() {
return {
list: {
approver_phone: "",
code: "",
create: "",
desc: "",
detail: "",
first_visit_audit: "",
id: "",
idcard: "",
label: "",
name: "",
phone: "",
uid: "",
departs: {}
},
tableSelections: [],//
tableData: [
{
sort: 1
}
],
popoverRefs: {},
loading: false,
switchValue: true,
checked: false,
checked1: false,
totalNum: 0,
selectNum: 0,
doctorName: '',
isIndeterminate: false,
doctorList: false,
allChecked: false,
pageShow:false
}
},
components: {
// GuipToolTip,
// SvgIcon,
GuipInput,
GuipButton,
GuipSwitch,
GuipTable,
// CustomDropdown
// GuipInput,
// GuipButton,
// GuipSwitch,
// GuipTable,
},
created() {
const { authtoken } = this.$route.query;
@ -174,264 +48,21 @@ export default {
name: this.doctorName
}).then(response => {
if (response.code == 0) {
const list = Object.values(response.data).map(item => {
return {
...item,
checked:false,
departs: item.departs ? Object.values(item.departs).flat() : []
}
})
this.doctorList = list
this.calculateTotalNum()
this.pageShow = true
}
}).catch(error => {
console.error(error, 'error')
})
},
inputBlur(val) {
console.log(val, '');
this.getInitData()
},
//
calculateTotalNum() {
this.totalNum = this.doctorList.reduce((total, doctor) => {
return total + (doctor.departs ? doctor.departs.length : 0);
}, 0);
},
handleClick(row) {
this.$router.push({
name: '医院信息',
query: { doctor_id: row.doctor_id,depart_id:row.depart_id }
})
//
},
setPopoverRef(index, el) {
if (el) {
this.popoverRefs[index] = el
}
},
//
getPopoverRef(index) {
return this.popoverRefs[index]
},
//
handlePriceClick(row, index, type) {
//
this.popoverFlag = true;
this.doctorList.forEach((item, i) => {
if (i !== index) {
item[type + 'PopoverVisible'] = false;
}
});
//
row[type + 'PopoverVisible'] = true;
row['edit_' + type] = row[type]
// row.edit_price = row.price; //
},
//
savePrice(row, type) {
if (type == 'price' && row.edit_price === '') {
this.$message.warning('价格不能为空');
return;
}
if (type == 'word' && row.word && row.editWord === '') {
this.$message.warning('字符不能为空');
return;
}
if (row.edit_word) {
row.word = row.edit_word
}
row[type] = row['edit_' + type]; //
row[type + 'PopoverVisible'] = false; //
this.$message.success('保存成功');
this.$set(this.doctorList, row)
console.log('保存价格:', this.doctorList, row.price);
//
},
//
cancelEdit(row, type) {
row[type + 'PopoverVisible'] = false;
this.popoverFlag = false
// row[type + '_popover'] = false; //
this.$Message.info('已取消编辑');
},
popshow() {
var ariaEls = document.querySelectorAll('.el-popover')
ariaEls.forEach((item) => {
item.removeAttribute('aria-hidden')
})
ariaEls = document.querySelectorAll('.el-radio__original')
ariaEls.forEach((item) => {
item.removeAttribute('aria-hidden')
})
},
onSwitchChange1(row) {
console.log(row, '------flag');
row.status = row.status == 0 ? 1 : 0;
this.$http('POST', '/api/admin/depart_mutil_option', {
depart_index_ids:row.id,
status:row.status
}).then(response => {
if (response.code == 0) {
this.$message.success(response.msg);
}else{
this.$message.error(response.msg);
// const list = Object.values(response.data).map(item => {
// return {
// ...item,
// checked:false,
// departs: item.departs ? Object.values(item.departs).flat() : []
// }
// })
// this.doctorList = list
// this.pageShow = true
}
this.getInitData()
}).catch(error => {
console.error(error, 'error')
this.$message.error('操作失败');
})
this.$set(this.doctorList, row)
},
batchOperate(status) {
console.log(this.tableSelections,'this.tableSelections----');
if(!this.tableSelections || this.tableSelections.length <= 0) {
this.$message.error('未选择要'+(status == '0' ? '禁用':'启用')+'的科室')
return;
}
var tableSelections = this.tableSelections.flat()
var depart_index_ids = '';
for(var i=0; i< tableSelections.length;i++) {
if(!depart_index_ids) {
depart_index_ids = tableSelections[i].id
continue;
}
depart_index_ids += ','+tableSelections[i].id
}
this.$http('POST', '/api/admin/depart_mutil_option', {
depart_index_ids:depart_index_ids,
status:status
}).then(response => {
if (response.code == 0) {
this.$message.success(response.msg);
}else{
this.$message.error(response.msg);
}
location.reload()
}).catch(error => {
console.error(error, 'error')
this.$message.error('操作失败');
})
},
onSwitchChange(item, index) {
item.status = item.status == 0 ? 1 : 0;
console.log(index, item, '====');
this.$set(this.doctorList, item)
this.$http('POST', '/api/admin/set_doctor_status', {
doctor_id:item.id,
status:item.status
}).then(response => {
if (response.code == 0) {
this.$message.success(response.msg);
}else{
this.$message.error(response.msg);
}
}).catch(error => {
console.error(error, 'error')
this.$message.error('操作失败');
})
},
addDoctor() {
this.$router.push({
name: '医生信息',
})
// this.$router.push({
// name: '',
// // query: {
// // doctorId: 123,
// // from: 'home'
// // }
// })
// URL/doctorInformation?doctorId=123&from=home
},
addHospital(item) {
this.$router.push({
name: '医院信息',
query: { doctor_id: item.id }
})
},
editDoctor(item) {
this.$router.push({
name: '医生信息',
query: { doctor_id: item.id}
})
},
//
handleSelectionChange(index, selection) {
//
this.doctorList[index].checked = selection.length === this.doctorList[index].departs.length;
this.tableSelections[index] = selection;
//
this.updateGlobalSelection();
},
// /
handleCheckAllChange(index) {
const table = this.doctorList[index];
const tableRef = this.getPopoverRef(index);
if (table.checked) {
//
tableRef.$refs.guiptable.toggleAllSelection();
} else {
//
tableRef.$refs.guiptable.clearSelection();
}
//
this.updateGlobalSelection();
},
//
handleTotalCheckAllChange() {
if (this.allChecked) {
//
this.doctorList.forEach((table, index) => {
if (!table.checked) {
this.doctorList[index].checked = true;
this.getPopoverRef(index).$refs.guiptable.toggleAllSelection();
}
});
} else {
//
this.doctorList.forEach((table, index) => {
if (table.checked) {
this.doctorList[index].checked = false;
this.getPopoverRef(index).$refs.guiptable.clearSelection();
}
});
}
//
this.updateGlobalSelection();
},
//
updateGlobalSelection() {
//
this.selectNum = Object.values(this.tableSelections).reduce((total, selection) => {
return total + (selection ? selection.length : 0);
}, 0);
//
const allTables = this.doctorList.length;
const checkedTables = this.doctorList.filter(table => table.checked).length;
this.allChecked = checkedTables === allTables && allTables > 0;
this.isIndeterminate = checkedTables > 0 && checkedTables < allTables;
},
}
}
</script>

1754
src/views/Register.vue

File diff suppressed because it is too large

1001
src/views/elementGroups.vue

File diff suppressed because it is too large

2
vue.config.js

@ -3,7 +3,7 @@ const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
// publicPath: '/new/',
devServer: {
port:80,
port:8000,
proxy: {
'/api': {
target: 'http://jasonyizherenxin.checkcopy.com',

Loading…
Cancel
Save