This commit is contained in:
zoujiandong 2024-06-12 17:28:55 +08:00
parent 500a9d578d
commit 80121827e1
11 changed files with 183 additions and 268 deletions

2
components.d.ts vendored
View File

@ -21,8 +21,10 @@ declare module '@vue/runtime-core' {
CouponDetail: typeof import('./src/components/couponDetail.vue')['default']
DeleteModal: typeof import('./src/components/DeleteModal.vue')['default']
DoctorModal: typeof import('./src/components/doctorModal.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElTree: typeof import('element-plus/es')['ElTree']
FamilyModal: typeof import('./src/components/familyModal.vue')['default']
GiveCouponModal: typeof import('./src/components/giveCouponModal.vue')['default']
HospitalDetailModal: typeof import('./src/components/hospitalDetailModal.vue')['default']

View File

@ -132,7 +132,7 @@
<a-col :span="24">
<a-form-item field="" label="" no-style>
<a-space >
<a-button type="primary" @click="handleSubmit" v-has="'admin:sysDoctorconfigList:save'">保存</a-button>
<a-button type="primary" @click="handleSubmit" v-has="'admin:sysHealthconfigList:save'">保存</a-button>
</a-space>
</a-form-item>
</a-col>

View File

@ -103,7 +103,7 @@
<a-col :span="24">
<a-form-item field="" label="" no-style>
<a-space >
<a-button type="primary" @click="handleSubmit" v-has="'admin:sysDoctorconfigList:save'">保存</a-button>
<a-button type="primary" @click="handleSubmit" v-has="'admin:sysHealthList:save'">保存</a-button>
</a-space>
</a-form-item>
</a-col>

View File

@ -146,7 +146,7 @@
<a-button
type="primary"
@click="handleSubmit"
v-has="'admin:sysDoctorconfigList:save'"
v-has="'admin:sysVisitconfigList:save'"
>保存</a-button
>
</a-space>

View File

@ -137,7 +137,7 @@
<a-col :span="24">
<a-form-item field="" label="" no-style>
<a-space >
<a-button type="primary" @click="handleSubmit">保存</a-button>
<a-button type="primary" @click="handleSubmit" v-has="'admin:sysHospitalList:save'">保存</a-button>
</a-space>
</a-form-item>
</a-col>

View File

@ -4,6 +4,7 @@ import App from './App.vue';
import ArcoVue from '@arco-design/web-vue';
import { Message, Modal, Notification } from '@arco-design/web-vue';
import '@arco-design/web-vue/dist/arco.css';
import 'element-plus/dist/index.css'
import router from './router/';
import { parseTime } from '@/utils/parseTime';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

View File

@ -1,116 +1,85 @@
<template>
<div class="app-container">
<a-form :model="queryForm" ref="queryFormRef" layout="inline">
<a-form-item field="hospital_name" label="医院名称">
<a-input :style="{ width: '182px' }" v-model="queryForm.hospital_name" placeholder="请输入药品名称或通用名" @press-enter="handleQuery" />
</a-form-item>
<a-form-item field="hospital_level_name" label="医院等级">
<a-select v-model="queryForm.hospital_level_name" placeholder="请选择医院等级" :style="{ width: '182px' }">
<a-option value="一级">一级</a-option>
<a-option value="二级">二级</a-option>
<a-option value="三级">三级</a-option>
</a-select>
</a-form-item>
<a-form-item field="province_id" label="省份">
<a-select v-model="queryForm.province_id" placeholder="请选择省份" :style="{ width: '182px' }" @change="changeProvice">
<a-option v-for="item in provinceData" :key="item.area_id" :value="Number(item.area_id)"
:label="item.area_name">{{ item.area_name}}</a-option>
</a-select>
</a-form-item>
<a-form-item field="city_id" label="城市">
<a-select v-model="queryForm.city_id" placeholder="请选择城市" :style="{ width: '182px' }" @change="changeCity">
<a-option v-for="item in cityData" :key="item.area_id" :value="Number(item.area_id)"
:label="item.area_name">{{ item.area_name}}</a-option>
</a-select>
</a-form-item>
<a-form-item field="county_id" label="区县">
<a-select v-model="queryForm.county_id" placeholder="请选择区县" :style="{ width: '182px' }">
<a-option v-for="item in countryData" :key="item.area_id" :value="Number(item.area_id)"
:label="item.area_name">{{ item.area_name}}</a-option>
</a-select>
</a-form-item>
<a-form-item>
<a-space>
<a-button type="primary" @click="handleQuery"><icon-search /> 搜索</a-button>
<a-button @click="handleResetQuery"><icon-loop /> 重置</a-button>
</a-space>
</a-form-item>
</a-form>
<a-divider />
<!-- action -->
<div class="action">
<a-space>
<a-button v-has="'admin:platformMedinceList:selectExport'" type="primary" @click="handleAdd"><icon-plus /> 添加 </a-button>
<!-- <a-button v-has="'admin:platformMedinceList:searchExport'" type="primary" @click="handlExport(1)"><icon-export /> 当前搜索全部导出</a-button>
<a-button v-has="'admin:platformMedinceList:allExport'" type="primary" @click="handlExport(3)"><icon-export /> 全部导出</a-button> -->
</a-space>
</div>
<!-- table -->
<!-- :row-selection="{ type: 'checkbox', showCheckedAll: true }" -->
<a-table :columns="columns" :data="tableData"
:scroll="{ x: 1600 }"
:pagination="{ 'show-total': true, 'show-jumper': true, 'show-page-size': true, total: pager.total, current: currentPage }"
row-key="hospital_id" @selection-change="(selection) => {deleteData = selection;console.log(selection)}"
@page-change="handlePageChange" @page-size-change="handlepage_sizeChange">
<template #doctor_id="{record,rowIndex}">
<div>{{(rowIndex+1)+(pager.page-1)*pager.page_size}}</div>
<el-tree
style="max-width: 600px"
accordion
lazy
:default-expanded-keys="expandKey"
:key="key"
ref="tree"
:load="loadNode"
:props="defaultProps"
node-key="id"
@node-click="handleNodeClick"
>
<template #default="{ node, data }">
<span class="custom-tree-node" >
<span>{{ node.label }}</span>
<span >
<icon-plus-circle-fill v-has="'admin:sysArea:add'" @click="append(data)" title="添加" style="margin-left: 8px;font-size: 16px;color:#165DFF" v-if="node.level!=3"/>
<icon-edit title="修改" v-has="'admin:sysArea:edit'" @click="edit(node, data)" style="margin-left: 8px;font-size: 16px;color:#165DFF"/>
</span>
</span>
</template>
<template #action="{ record }">
<a-space>
<a-button v-has="'admin:platformMedinceList:detail'" type="text"
@click="handleDetail(record)"><icon-book />详情</a-button>
<!-- <a-button v-has="'admin:platformMedinceList:edit'" type="text" @click="handleUpdate(record)"><icon-edit />
修改</a-button> -->
<!-- <a-button v-has="'admin:platformMedinceList:remove'" type="text"
@click="() => { deleteVisible = true; deleteData = [record.doctor_id]; }"><icon-delete /> 删除</a-button> -->
</a-space>
</template>
</a-table>
</el-tree>
<hospitalDetailModal ref="hospitalChild" :modalVisible="modalVisible" :modalForm="modalForm" :id="modalForm.hospital_id" @freshDetail="handleQuery" @familyVisibleChange="()=>{modalVisible=false,modalForm.hospital_id=''}"></hospitalDetailModal>
<!-- Akiraka 20230223 删除与批量删除 开始 -->
<!-- <DeleteModal :data="deleteData" :visible="deleteVisible" :apiDelete="removeFamily"
@deleteVisibleChange="() => deleteVisible = false" /> -->
<!-- Akiraka 20230223 删除与批量删除 结束 -->
<a-modal v-model:visible="okVisible" :modal-style="{width:'320px'}" body-class="okmodal"
@cancel="()=>okVisible=false">
<a-modal v-model:visible="okVisible" :modal-style="{width:'420px'}" body-class="okmodal" @ok="handleConfirm"
@cancel="handleClose" >
<template #title>
提示
{{ title }}
</template>
<div>确定保存当前信息</div>
<a-form :model="form" :rules="rules" ref="modalFormRef" size="medium" label-align="left" auto-label-width>
<a-form-item field="area_name" label="名称" >
<a-textarea v-model.trim="form.area_name" allow-clear placeholder="请输入名称"></a-textarea>
</a-form-item>
<a-form-item field="label" label="上级名称" v-if="title=='添加区域'">
<a-input v-model="form.label" disabled placeholder="请输入级名称" size="large" class="input-demo" />
</a-form-item>
</a-form>
<template #footer>
<a-button @click="handleClose"><template #icon><icon-close /></template>取消</a-button>
<a-button type="primary" @click="handleConfirm"><template #icon><icon-check /></template>确认</a-button>
</template>
</a-modal>
</div>
</template>
<script setup>
import { reactive, ref, getCurrentInstance, onMounted, nextTick, watch, computed } from 'vue';
import { getHospitalList,getHospitalDetail,getAreaList} from '@/api/basic/list';
import { downloadFile } from '@/utils/downloadFile';
import {getAreaList,addArea,updateArea} from '@/api/basic/list';
import { Message } from '@arco-design/web-vue';
// Akiraka 20230210
const deleteData = ref([])
const key = ref(1);
// Akiraka 20230210
const deleteVisible = ref(false)
// Akiraka 20230210
const okVisible = ref(false);
const tree=ref(null);
const hospitalChild=ref(null);
const current=reactive({});
watch(() => deleteVisible.value, (value) => {
if (value == false) {
getMedinceInfo(pager);
getMedinceInfo(pageaer);
}
});
const file = ref();
const expandKey=ref([]);
const title=ref('');
const { proxy } = getCurrentInstance();
const currentPage = ref(1);
const defaultProps = {
children: 'children',
label: 'label',
isLeaf:'isLeaf'
}
const handleNodeClick = (data) => {
}
// Pager
const pager = {
total: 0,
@ -121,205 +90,148 @@
const queryForm = reactive({
});
const modalForm = reactive({
const form = reactive({
});
const provinceData = ref([]);
const cityData = ref([]);
const countryData = ref([]);
const rules= reactive({
area_name: [{ required: true, message: '请输入名称' }]
});
let id = 1000;
const append=(data)=>{
console.log(data);
title.value="添加区域";
okVisible.value=true;
form.parent_id=data.id;
form.label=data.label;
current.label=data.label;
current.id=data.id;
current.parent_id=data.parent_id;
current.level=data.level;
form.area_name='';
// console.log(data)
// const newChild = { id: id++, label: 'testtest', children: [] };
// tree.value.append(newChild,data.id)
};
const edit=(node,data)=>{
console.log(data);
title.value="修改区域";
form.parent_id=node.data.id;
form.area_name=node.data.label;
okVisible.value=true;
current.id=data.id;
current.parent_id=data.parent_id;
}
//
const handelAreaList = (area_id = '', parent_id = '', area_type) => {
const handelAreaList = (area_id = '', parent_id = '', area_type,resolve) => {
getAreaList({
area_id,
area_type,
parent_id
}).then((res) => {
const { data, code, message } = res;
if (code == 200) {
if (area_type == 2) {
provinceData.value = data;
let result=data.map(item=>{
return {
level:0,
label:item.area_name,
id:item.area_id,
parent_id:item.parent_id
}
});
resolve(result);
}
if (area_type == 3) {
cityData.value = data;
let result=data.map(item=>{
return {
label:item.area_name,
level:1,
id:item.area_id,
parent_id:item.parent_id
}
});
resolve(result);
};
if (area_type == 4) {
countryData.value = data;
let result=data.map(item=>{
return {
isLeaf: true,
level:2,
label:item.area_name,
id:item.area_id,
parent_id:item.parent_id
}
});
console.log(result)
resolve(result);
};
}
})
}
//
const changeProvice = (value) => {
queryForm.city_id = '';
queryForm.county_id = '';
handelAreaList('', value, 3);
};
//
const changeCity = (value) => {
queryForm.county_id = '';
handelAreaList("", value, 4);
const handleConfirm=()=>{
proxy.$refs.modalFormRef.validate(async(valid) => {
if (!valid) {
let type=null;
if(current.level==0){
type=3
}else if(current.level==1){
type=4
}
let {code,data}= title.value=="添加区域"?await addArea({
area_name:form.area_name,
parent_id:form.parent_id,
area_type:type
}):await updateArea(form.parent_id,{
area_name:form.area_name
})
if(code==200){
if(title.value=="添加区域"){
Message.success("添加成功");
}else{
Message.success("修改成功");
//tree.value.updateKeyChildren(form.parent_id,{id:form.parent_id,label:form.area_name,children: [] })
}
key.value= key.value+1;
okVisible.value=false;
setTimeout(()=>{
expandKey.value=[current.parent_id,current.id]
// tree.value.setCurrentKey(current.id,true);
},1000)
}
}
})
}
const handleClose=()=>{
okVisible.value=false;
}
const loadNode=(node, resolve)=>{
if (node.level === 0) {
handelAreaList("", "", 2,resolve);
}else if(node.level === 1){
handelAreaList("", node.data.id, 3,resolve);
}else if(node.level === 2){
handelAreaList("", node.data.id, 4,resolve);
}else{
resolve([])
}
}
// Modal
const modalVisible = ref(false);
const modalTitle = ref('默认标题');
// Batch Del List
let batchList = [];
// Table Columns
const columns = [
{ title: '编号', dataIndex: 'doctor_id', slotName: 'doctor_id', width: '90' },
{ title: '医院名字', dataIndex: 'hospital_name',width:200 },
{ title: '省份', dataIndex: 'province',width:200 },
{ title: '城市', dataIndex: 'city', slotName: 'product_price',width: 150 },
{ title: '区县', dataIndex: 'county',width:200 },
{ title: '地址', dataIndex: 'address',width:200 },
{ title: '创建时间', dataIndex: 'created_at',width:200 },
{ title: '操作', slotName: 'action', fixed: "right", width: 180 },
];
// Table Data
const tableData = ref([]);
//
const modalSatus = ref('add');
// Satus
const handleAdd = () => {
modalVisible.value = true;
modalTitle.value = '新增患者';
modalForm.hospital_id ='';
modalForm.hospital_name='',
modalForm.hospital_status=1,
modalForm.hospital_level_name='',
modalForm.post_code='',
modalForm.tele_phone='',
modalForm.province_id='',
modalForm.city_id='',
modalForm.county_id='',
modalForm.address='',
modalForm.desc=''
};
//
const handleDetail = async (record) => {
const { code, data, message } = await getHospitalDetail(record.hospital_id)
hospitalChild.value.getData();
if (code == 200) {
Object.assign(modalForm, data);
modalVisible.value = true;
}
};
//
const handleBatchDelete = () => {
if (batchList.length !== 0) {
proxy.$modal.warning({
title: '提示',
content: '是否批量删除以下选中的数据?',
hideCancel: false,
onOk: async () => {
const res = await removeFamily({ ids: batchList });
proxy.$message.success(res.message);
getMedinceInfo(pager);
},
onCancel: () => {
proxy.$message.info('已取消批量删除数据');
},
});
} else {
proxy.$message.error('请勾选需要删除的数据!');
}
};
/**
* 分页改变
* @param {Number} [page]
*/
const handlePageChange = (page) => {
pager.page = page;
//
currentPage.value = page;
getMedinceInfo({ ...pager, ...queryForm });
};
//
const handlepage_sizeChange = (page_size) => {
pager.page_size = page_size;
getMedinceInfo({ ...pager, ...queryForm });
};
//
const getMedinceInfo = async (params = {}) => {
const { data, code, message } = await getHospitalList(params);
if (code == 200) {
tableData.value = data.data;
Object.assign(pager, { total: data.total, page: data.page, page_size: data.page_size });
}
};
//
const handleQuery = async () => {
pager.page = 1;
const params = {
page: pager.page,
page_size: pager.page_size,
...queryForm,
};
getMedinceInfo(params);
};
//
const handleResetQuery = () => {
proxy.$refs.queryFormRef.resetFields();
getMedinceInfo(queryForm);
}
const handlExport=async(type)=>{
proxy.$loading.show();
let fromData=null;
if(type==1){
fromData={
type,
...queryForm
}
}else if(type==2){
if(deleteData.value.length==0){
proxy.$message.warning('请勾选数据');
proxy.$loading.hide();
return false;
};
let id='';
deleteData.value.forEach((item)=>{
if(id){
id+=","+item
}else{
id=item;
}
})
fromData={
type,
id
}
}else if(type==3){
fromData={
type
}
}
const {code,data}=await exportFamily(fromData);
if(code==200){
downloadFile(data,'就诊人列表');
}
proxy.$loading.hide();
}
onMounted(() => {
getMedinceInfo(pager);
handelAreaList("", "", 2);
});
</script>
<style lang="scss" scoped>

View File

@ -45,7 +45,7 @@
<!-- action -->
<div class="action">
<a-space>
<a-button v-has="'admin:platformMedinceList:selectExport'" type="primary" @click="handleAdd"><icon-plus /> 添加 </a-button>
<a-button v-has="'admin:sysHospitalList:add'" type="primary" @click="handleAdd"><icon-plus /> 添加 </a-button>
<!-- <a-button v-has="'admin:platformMedinceList:searchExport'" type="primary" @click="handlExport(1)"><icon-export /> 当前搜索全部导出</a-button>
<a-button v-has="'admin:platformMedinceList:allExport'" type="primary" @click="handlExport(3)"><icon-export /> 全部导出</a-button> -->
</a-space>
@ -64,7 +64,7 @@
</template>
<template #action="{ record }">
<a-space>
<a-button v-has="'admin:platformMedinceList:detail'" type="text"
<a-button v-has="'admin:sysHospitalList:detail'" type="text"
@click="handleDetail(record)"><icon-book />详情</a-button>
<!-- <a-button v-has="'admin:platformMedinceList:edit'" type="text" @click="handleUpdate(record)"><icon-edit />
修改</a-button> -->

View File

@ -3,7 +3,7 @@
<!-- action -->
<div class="action">
<a-space>
<a-button v-has="'admin:sysDoctorconfigList:add'" type="primary" @click="handleAdd"><icon-plus /> 新增 </a-button>
<a-button v-has="'admin:sysHealthList:add'" type="primary" @click="handleAdd"><icon-plus /> 新增 </a-button>
<!-- <a-button v-has="'admin:sysFamilyList:remove'" type="primary" status="danger"><icon-delete /> 批量删除 </a-button> -->
</a-space>
</div>
@ -35,7 +35,7 @@
<template #action="{ record }">
<a-space>
<a-button v-has="'admin:sysDoctorconfigList:edit'" type="text"
<a-button v-has="'admin:sysHealthList:edit'" type="text"
@click="handleDetail(record)"><icon-edit />修改</a-button>
<!-- <a-button v-has="'admin:sysFamilyList:edit'" type="text" @click="handleUpdate(record)"><icon-edit />
修改</a-button> -->

View File

@ -3,7 +3,7 @@
<!-- action -->
<div class="action">
<a-space>
<a-button v-has="'admin:sysDoctorconfigList:add'" type="primary" @click="handleAdd"><icon-plus /> 新增 </a-button>
<a-button v-has="'admin:sysHealthconfigList:add'" type="primary" @click="handleAdd"><icon-plus /> 新增 </a-button>
<!-- <a-button v-has="'admin:sysFamilyList:remove'" type="primary" status="danger"><icon-delete /> 批量删除 </a-button> -->
</a-space>
</div>
@ -37,7 +37,7 @@
</template>
<template #action="{ record }">
<a-space>
<a-button v-has="'admin:sysDoctorconfigList:edit'" type="text"
<a-button v-has="'admin:sysHealthconfigList:edit'" type="text"
@click="handleDetail(record)"><icon-edit />修改</a-button>
<!-- <a-button v-has="'admin:sysFamilyList:edit'" type="text" @click="handleUpdate(record)"><icon-edit />
修改</a-button> -->

View File

@ -3,7 +3,7 @@
<!-- action -->
<div class="action">
<a-space>
<a-button v-has="'admin:sysDoctorconfigList:add'" type="primary" @click="handleAdd"><icon-plus /> 新增 </a-button>
<a-button v-has="'admin:sysVisitconfigList:add'" type="primary" @click="handleAdd"><icon-plus /> 新增 </a-button>
<!-- <a-button v-has="'admin:sysFamilyList:remove'" type="primary" status="danger"><icon-delete /> 批量删除 </a-button> -->
</a-space>
</div>
@ -40,7 +40,7 @@
</template> -->
<template #action="{ record }">
<a-space>
<a-button v-has="'admin:sysDoctorconfigList:edit'" type="text"
<a-button v-has="'admin:sysVisitconfigList:edit'" type="text"
@click="handleDetail(record)"><icon-edit />修改</a-button>
<!-- <a-button v-has="'admin:sysFamilyList:edit'" type="text" @click="handleUpdate(record)"><icon-edit />
修改</a-button> -->