10.29 ,互医

This commit is contained in:
zoujiandong 2024-10-29 17:24:35 +08:00
parent 561aace7f9
commit 933936bfa0
9 changed files with 1763 additions and 14 deletions

5
components.d.ts vendored
View File

@ -15,8 +15,13 @@ declare module '@vue/runtime-core' {
AddInquiryConfigModal: typeof import('./src/components/addInquiryConfigModal.vue')['default']
AddSysconfigModal: typeof import('./src/components/addSysconfigModal.vue')['default']
AddVisitConfigModal: typeof import('./src/components/addVisitConfigModal.vue')['default']
ArticleModal: typeof import('./src/components/articleModal.vue')['default']
ArticleOriginModal: typeof import('./src/components/articleOriginModal.vue')['default']
AtticleModal: typeof import('./src/components/atticleModal.vue')['default']
ChatRecord: typeof import('./src/components/chatRecord.vue')['default']
ClassifyModal: typeof import('./src/components/classifyModal.vue')['default']
ConfirmModal: typeof import('./src/components/confirmModal.vue')['default']
copy: typeof import('./src/components/hospitalDetailModal copy.vue')['default']
CouponDetail: typeof import('./src/components/couponDetail.vue')['default']
DeleteModal: typeof import('./src/components/DeleteModal.vue')['default']
DoctorModal: typeof import('./src/components/doctorModal.vue')['default']

View File

@ -1,30 +1,43 @@
import request from '../../utils/request'
const url = '/admin/article/science/page';
export function getList(params){//获取列表-分页
export function getArticleList(data){//获取列表-分页
return request({
url:'/admin/article/science/page',
method: 'get',
params
method: 'post',
data
})
};
export function getMedinceDetail(id){//获取详情
export function getClassifyList(data){//获取基础分类列表-分页
return request({
url:'/admin/basic/article/class/page',
method: 'post',
data
})
};
export function getArticleDetail(id){//获取详情
return request({
url:`${url}/${id}`,
url:`/admin/article/science/${id}`,
method: 'get'
})
};
export function getSysMedinceList(data){//获取商品列表-分页-系统
export function getClassifyDetail(id){//获取基础分类详情
return request({
url:'/admin/product/page',
url:`/admin/basic/article/class/${id}`,
method: 'get'
})
};
export function getArticleOriginList(data){//获取科普文章来源列表-分页
return request({
url:'/admin/article/science/source/page',
method: 'post',
data
})
};
export function getSysMedinceDetail(id){//商品详情-系统
export function getArticleOriginDetail(id){//商品详情-系统
return request({
url:`/admin/product/${id}`,
url:`/admin/article/science/source/${id}`,
method: 'get'
})
};
@ -35,6 +48,20 @@ export function getMedinceDetail(id){//获取详情
data
})
};
export function addClassify(data){//新增基础分类
return request({
url:`/admin/basic/article/class`,
method: 'post',
data
})
};
export function addArticleOrigin(data){//新增科普文章来源
return request({
url:`/admin/article/science/source`,
method: 'post',
data
})
};
export function editArticle(id,data){//修改商品-系统
return request({
url:`/admin/article/science/${id}`,
@ -42,6 +69,20 @@ export function getMedinceDetail(id){//获取详情
data
})
}
export function editClassify(id,data){//修改基础分类
return request({
url:`/admin/basic/article/class/${id}`,
method: 'put',
data
})
}
export function editArticleOrigin(id,data){//修改科普文章来源
return request({
url:`/admin/article/science/source/${id}`,
method: 'put',
data
})
}
export function editArticleStatus(id,data){//操作状态
return request({
url:`/admin/article/science/status/${id}`,
@ -51,15 +92,29 @@ export function getMedinceDetail(id){//获取详情
}
export function setTop(id,data){//置顶
return request({
url:`/admin/article/science/status/${id}`,
url:`/admin/article/science/top/${id}`,
method: 'put',
data:data
})
}
export function getList(params){//获取商品列表-平台
export function getList(params){//获取科普文章来源列表 无分页
return request({
url:`/admin/product/platform/list`,
url:`/admin/article/science/source/list`,
method: 'get',
params
})
}
export function getAllClassifyList(data){//获取基础分类列表-无分页
return request({
url:`/admin/basic/article/class/list`,
method: 'post',
data
})
}
export function getAllOriginList(params){//获取基础分类列表-无分页
return request({
url:`/admin/article/science/source/list`,
method: 'get',
params
})

View File

@ -0,0 +1,281 @@
<template>
<!-- Modal -->
<a-modal v-model:visible="modalVisible" fullscreen :title="title" title-align="start" :footer="false"
@cancel="handleClose">
<div class="titlebox">
<div class="bar"></div>
<div class="name">文章信息</div>
</div>
<a-form :model="modalForm" ref="modalFormRef" :auto-label-width="true" :rules="rules">
<a-row :gutter="24" style="margin-top: 35px">
<a-col :span="12">
<a-form-item field="article_title" label="文章标题:">
<a-input v-model="modalForm.article_title" placeholder="请输入文章标题" :style="{ width: '250px' }"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item field="article_status" label="文章状态:">
<a-select v-model="modalForm.article_status" placeholder="请选择文章状态" :style="{ width: '182px' }">
<a-option :value="1">正常</a-option>
<a-option :value="2">禁用</a-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item field="is_top" label="是否置顶:">
<a-select v-model="modalForm.is_top" placeholder="请选择是否置顶" :style="{ width: '182px' }">
<a-option :value="1"></a-option>
<a-option :value="0"></a-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item field="source_id" label="文章来源:">
<a-select v-model="modalForm.source_id" placeholder="请选择文章来源"
:style="{ width: '200px' }">
<a-option size="large" style="max-width:500px" v-for="item in originList" :key="item.source_id"
:value="item.source_id" :label="item.source_name">
{{ item.source_name }}
</a-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item field="article_url" label="文章地址:">
<a-input v-model="modalForm.article_url" placeholder="请输入文章地址" :style="{ width: '250px' }"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item field="article_image" label="文章图片:">
<a-space size="large">
<a-image fit="cover" width="80" height="80" class="headImg" :src="modalForm.article_image">
</a-image>
</a-space>
<a-upload action="/" :fileList="file ? [file] : []" class="upload" :auto-upload="false"
@change="onChangeFile" accept="image/*" @before-upload="beforeUpload" :show-file-list="false"
/>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item field="article_science_class" label="文章分类:">
<a-select multiple value-key="basic_class_name" v-model="modalForm.article_science_class" placeholder="请选择文章分类"
:style="{ width: '300px' }">
<a-option size="large" style="max-width:500px" v-for="item in classifyList" :key="item.basic_class_id"
:value="item" :label="item.basic_class_name">
{{ item.basic_class_name }}
</a-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-divider />
</a-form>
<div class="titlebox">
<div class="bar"></div>
<div class="name">操作</div>
</div>
<a-row :gutter="24" style="margin-top: 35px">
<a-col :span="24">
<a-form-item field="" label="" no-style>
<a-space>
<a-button type="primary" @click="handleSubmit" v-has="'admin:sysArticleList:save'">保存</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-modal>
</template>
<script setup>
import { ref, toRefs, watch, getCurrentInstance } from 'vue';
import { getAllClassifyList, addArticle, editArticle,getAllOriginList } from '@/api/kepu/list';
import { ossSign, ossUpload } from '@/api/oss';
import dayjs from 'dayjs'
const { proxy } = getCurrentInstance();
const file = ref();
const props = defineProps({
//
modalVisible: {
type: Boolean,
default: false,
},
id: {
type: String,
default: '',
},
modalForm: {
type: Object,
},
});
const title = ref('');
const emits = defineEmits(['familyVisibleChange', 'freshDetail']);
const { modalVisible, modalForm } = toRefs(props);
const classifyList = ref([]);
const originList = ref([]);
//
const handelAllList = (value) => {
console.log(value);
getAllClassifyList({
basic_class_name: value
}).then((res) => {
const { data, code, message } = res;
if (code == 200) {
classifyList.value = data
}
});
};
const handelOriginAllList = (value) => {
getAllOriginList({
basic_class_name: value
}).then((res) => {
const { data, code, message } = res;
if (code == 200) {
originList.value = data
}
});
};
watch(
() => props.id,
() => {
if (props.id) {
title.value = '编辑文章信息';
} else {
title.value = '修改文章信息';
}
},
{ immediate: true }
);
const rules = {
article_title: [{ required: true, message: '请输入文章标题' }],
article_status: [{ required: true, message: '请选择文章状态' }],
is_top: [{ required: true, message: '请选择是否置顶' }],
article_url: [{ required: true, message: '请输入文章地址' }],
article_image: [{ required: true, message: '请上传文章图片' }],
source_id: [{ required: true, message: '请选择文章来源' }],
article_science_class: [{ type:'array',required: true, message: '请选择文章分类' }],
};
const handleSubmit = () => {
proxy.$refs.modalFormRef.validate(async (valid) => {
let data = null;
let {
article_title,
article_status,
is_top,
article_image,
source_id,
article_url,
article_science_class
} = modalForm.value;
if (!valid) {
if (props.id) {
console.log( article_science_class)
data = await editArticle(props.id, {
article_title,
article_status,
is_top,
article_image,
source_id,
article_url,
article_science_class
});
} else {
data = await addArticle({
article_title,
article_status,
is_top,
article_image,
source_id,
article_url,
article_science_class
});
}
if (data.code == 200) {
props.id
? proxy.$message.success('修改成功')
: proxy.$message.success('添加成功');
emits('freshDetail');
}
handleClose();
emits('freshDetail');
} else {
console.log(valid);
proxy.$message.error('表单校验失败');
//done(false);
}
});
};
const onChangeFile = (fileList) => {
getOssSign(4, fileList[0].file);
}
const beforeUpload = (file, type) => {
return new Promise((resolve, reject) => {
if (file.size >= 10 * 1024 * 1024) {
proxy.$notification.error("图片大小不能超过10M");
reject('cancel')
} else {
resolve(true)
}
});
};
const getOssSign = async (scene, File) => {
const { data, code, message } = await ossSign({
user_type: 4,
scene,
});
if (code == 200) {
let { access_id, dir, policy, signature, host } = data;
//let index = File.lastIndexOf("/");
let filename = File.name;
let time = dayjs().format("YYYYMMDDHHmmss")
let formData = new FormData();
formData.append('OSSAccessKeyId', access_id);
formData.append('policy', policy);
formData.append('signature', signature);
formData.append('key', dir + time + filename);
formData.append('success_action_status', 200);
formData.append('file', File, filename);
ossUpload(host, formData).then((res) => {
console.log(host + "/" + dir + time + filename)
modalForm.value.article_image = host + "/" + dir + time + filename;
proxy.$refs.modalFormRef.validateField(['article_image'],(valid) => {})
});
}
}
// Akiraka 20230210
const handleClose = () => {
proxy.$refs.modalFormRef.resetFields();
emits('familyVisibleChange', false);
};
const getData = () => {
handelOriginAllList();
handelAllList();
};
defineExpose({
getData,
});
</script>
<style scoped>
.row {
display: flex;
}
.upload{
margin-left: 10px;
}
</style>

View File

@ -0,0 +1,182 @@
<template>
<!-- Modal -->
<a-modal v-model:visible="modalVisible" fullscreen :title="title" title-align="start" :footer="false"
@cancel="handleClose">
<div class="titlebox">
<div class="bar"></div>
<div class="name">文章来源信息</div>
</div>
<a-form :model="modalForm" ref="modalFormRef" :auto-label-width="true" :rules="rules">
<a-row :gutter="24" style="margin-top: 35px">
<a-col :span="12">
<a-form-item field="source_name" label="来源名称:">
<a-input v-model="modalForm.source_name" placeholder="请输入来源名称" :style="{ width: '250px' }"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item field="source_image" label="来源图片:" :validate-trigger="['change', 'blur']">
<a-space size="large">
<a-image fit="cover" width="80" height="80" class="headImg" :src="modalForm.source_image">
</a-image>
</a-space>
<a-upload action="/" :fileList="file ? [file] : []" class="upload" :auto-upload="false"
@change="onChangeFile" accept="image/*" @before-upload="beforeUpload" :show-file-list="false"
/>
<a-input v-model="modalForm.source_image" :style="{width:'320px',opacity:0}" placeholder="Please enter something" allow-clear />
</a-form-item>
</a-col>
</a-row>
<a-divider />
</a-form>
<div class="titlebox">
<div class="bar"></div>
<div class="name">操作</div>
</div>
<a-row :gutter="24" style="margin-top: 35px">
<a-col :span="24">
<a-form-item field="" label="" no-style>
<a-space>
<a-button type="primary" @click="handleSubmit" v-has="'admin:sysArticleList:save'">保存</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-modal>
</template>
<script setup>
import { ref, toRefs, watch, getCurrentInstance } from 'vue';
import { addArticleOrigin, editArticleOrigin } from '@/api/kepu/list';
import { ossSign, ossUpload } from '@/api/oss';
import dayjs from 'dayjs'
const { proxy } = getCurrentInstance();
const file = ref();
const props = defineProps({
//
modalVisible: {
type: Boolean,
default: false,
},
id: {
type: String,
default: '',
},
modalForm: {
type: Object,
},
});
const title = ref('');
const emits = defineEmits(['familyVisibleChange', 'freshDetail']);
const { modalVisible, modalForm } = toRefs(props);
//
watch(
() => props.id,
() => {
if (props.id) {
title.value = '编辑来源图片';
} else {
title.value = '修改来源图片';
}
},
{ immediate: true }
);
const rules = {
source_name: [{ required: true, message: '请输入来源名称', }],
source_image: [{ required: true, message: '请上传来源图片'}],
};
const handleSubmit = () => {
proxy.$refs.modalFormRef.validate(async (valid) => {
let data = null;
let {
source_image,
source_name
} = modalForm.value;
if (!valid) {
if (props.id) {
data = await editArticleOrigin(props.id, {
source_image,
source_name
});
} else {
data = await addArticleOrigin({
source_image,
source_name
});
}
if (data.code == 200) {
props.id
? proxy.$message.success('修改成功')
: proxy.$message.success('添加成功');
emits('freshDetail');
}
handleClose();
emits('freshDetail');
} else {
console.log(valid);
proxy.$message.error('表单校验失败');
//done(false);
}
});
};
const onChangeFile = (fileList) => {
getOssSign(4, fileList[0].file);
}
const beforeUpload = (file, type) => {
return new Promise((resolve, reject) => {
if (file.size >= 10 * 1024 * 1024) {
proxy.$notification.error("图片大小不能超过10M");
reject('cancel')
} else {
resolve(true)
}
});
};
const getOssSign = async (scene, File) => {
const { data, code, message } = await ossSign({
user_type: 4,
scene,
});
if (code == 200) {
let { access_id, dir, policy, signature, host } = data;
//let index = File.lastIndexOf("/");
let filename = File.name;
let time = dayjs().format("YYYYMMDDHHmmss")
let formData = new FormData();
formData.append('OSSAccessKeyId', access_id);
formData.append('policy', policy);
formData.append('signature', signature);
formData.append('key', dir + time + filename);
formData.append('success_action_status', 200);
formData.append('file', File, filename);
ossUpload(host, formData).then((res) => {
console.log(host + "/" + dir + time + filename)
modalForm.value.source_image = host + "/" + dir + time + filename;
proxy.$refs.modalFormRef.validateField(['source_image'],(valid) => {})
});
}
}
// Akiraka 20230210
const handleClose = () => {
proxy.$refs.modalFormRef.resetFields();
emits('familyVisibleChange', false);
};
</script>
<style scoped>
.row {
display: flex;
}
.upload{
margin-left: 10px;
}
</style>

View File

@ -0,0 +1,149 @@
<template>
<!-- Modal -->
<a-modal
v-model:visible="modalVisible"
fullscreen
:title="title"
title-align="start"
:footer="false"
@cancel="handleClose"
>
<div class="titlebox">
<div class="bar"></div>
<div class="name">分类信息</div>
</div>
<a-form
:model="modalForm"
ref="modalFormRef"
:auto-label-width="true"
:rules="rules"
>
<a-row :gutter="24" style="margin-top: 35px">
<a-col :span="12">
<a-form-item field="basic_class_name" label="分类名称:">
<a-input
v-model="modalForm.basic_class_name"
placeholder="请输入分类名称"
:style="{ width: '250px' }"
></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item field="basic_class_sort" label="分类序号:">
<a-input-number
:min="0"
:style="{ width: '180px' }"
v-model="modalForm.basic_class_sort"
placeholder="输入分类序号"
mode="button"
/>
</a-form-item>
</a-col>
</a-row>
<a-divider />
</a-form>
<div class="titlebox">
<div class="bar"></div>
<div class="name">操作</div>
</div>
<a-row :gutter="24" style="margin-top: 35px">
<a-col :span="24">
<a-form-item field="" label="" no-style>
<a-space>
<a-button
type="primary"
@click="handleSubmit"
v-has="'admin:sysClassifyList:save'"
>保存</a-button
>
</a-space>
</a-form-item>
</a-col>
</a-row>
</a-modal>
</template>
<script setup>
import { ref, toRefs, watch, getCurrentInstance } from 'vue';
import { addClassify, editClassify } from '@/api/kepu/list';
const { proxy } = getCurrentInstance();
const props = defineProps({
//
modalVisible: {
type: Boolean,
default: false,
},
id: {
type: String,
default: '',
},
modalForm: {
type: Object,
},
});
const title = ref('');
const emits = defineEmits(['familyVisibleChange', 'freshDetail']);
const { modalVisible, modalForm } = toRefs(props);
watch(
() => props.id,
() => {
if (props.id) {
title.value = '编辑分类';
} else {
title.value = '添加分类';
}
},
{ immediate: true }
);
const rules = {
basic_class_name: [{ required: true, message: '请输入分类名称' }],
basic_class_sort: [{ required: true, message: '请输入分类序号' }],
};
const handleSubmit = () => {
proxy.$refs.modalFormRef.validate(async (valid) => {
let data = null;
let {
basic_class_name,
basic_class_sort
} = modalForm.value;
if (!valid) {
if (props.id) {
data = await updateClassify(props.id, {
basic_class_name,
basic_class_sort
});
} else {
data = await addClassify({
basic_class_name,
basic_class_sort
});
}
if (data.code == 200) {
props.id
? proxy.$message.success('修改成功')
: proxy.$message.success('添加成功');
emits('freshDetail');
}
handleClose();
emits('freshDetail');
} else {
console.log(valid);
proxy.$message.error('表单校验失败');
//done(false);
}
});
};
// Akiraka 20230210
const handleClose = () => {
proxy.$refs.modalFormRef.resetFields();
emits('familyVisibleChange', false);
};
</script>
<style scoped>
.row {
display: flex;
}
</style>

View File

@ -9,7 +9,7 @@
<component :is="menu.icon" v-if="menu.icon"/>
</template>
<template #title>
<div v-if="menu.menu_title=='医生配置'" style="margin-left:-16px;">{{ menu.menu_title }}</div>
<div v-if="menu.menu_title=='医生配置' || menu.menu_title=='科普文章管理'" style="margin-left:-16px;">{{ menu.menu_title }}</div>
<span v-else>{{ menu.menu_title }}</span>
</template>
<sub-menu :menuList="menu.children" />

View File

@ -0,0 +1,382 @@
<template>
<div class="app-container">
<a-form :model="queryForm" ref="queryFormRef" layout="inline">
<a-form-item field="article_title" label="文章标题">
<a-input :style="{ width: '182px' }" v-model="queryForm.article_title" placeholder="请输入文章标题" @press-enter="handleQuery" />
</a-form-item>
<a-form-item field="article_status" label="文章状态">
<a-select v-model="queryForm.article_status" placeholder="请选择文章状态" :style="{ width: '182px' }">
<a-option :value="2">禁用</a-option>
<a-option :value="1">正常</a-option>
</a-select>
</a-form-item>
<a-form-item field="is_top" label="是否置顶">
<a-select v-model="queryForm.is_top" placeholder="请选择是否置顶" :style="{ width: '182px' }">
<a-option :value="0"></a-option>
<a-option :value="1"></a-option>
</a-select>
</a-form-item>
<!-- <a-form-item field="is_top" label="修改shi'jshijianian">
<a-select v-model="queryForm.is_top" placeholder="请选择是否置顶" :style="{ width: '182px' }">
<a-option :value="0"></a-option>
<a-option :value="1"></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:sysArticleList: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>
</div>
<!-- table -->
<!-- :row-selection="{ type: 'checkbox', showCheckedAll: true }" -->
<a-table :columns="columns" :data="tableData"
:scroll="{ x: 1200 }"
: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>
</template>
<template #source_name="{record}">
<div>{{record.article_science_source.source_name}}</div>
</template>
<template #source_image="{record}">
<a-image
width="50"
height="50"
fit="cover"
:src="record.article_science_source.source_image"
/>
</template>
<template #article_science_class="{record}">
<div>{{record.article_science_class?record.article_science_class:'——'}}</div>
</template>
<template #article_status="{record}">
<div>{{record.article_status==1?'正常':'禁用'}}</div>
</template>
<template #is_top="{record}">
<div>{{record.is_top==1?'是':'否'}}</div>
</template>
<template #created_at="{record}">
<div>{{parseTime(record.created_at)}}</div>
</template>
<template #action="{ record }">
<a-space>
<a-button v-has="'admin:sysArticleList:detail'" type="text"
@click="handleDetail(record)"><icon-book />详情</a-button>
<!-- <a-button v-has="'admin:sysArticleList: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>
<articleModal ref="hospitalChild" :modalVisible="modalVisible" :modalForm="modalForm" :id="modalForm.article_id" @freshDetail="handleQuery" @familyVisibleChange="()=>{modalVisible=false,modalForm.article_id=''}"></articleModal>
<!-- 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">
<template #title>
提示
</template>
<div>确定保存当前信息</div>
</a-modal>
</div>
</template>
<script setup>
import { reactive, ref, getCurrentInstance, onMounted, nextTick, watch, computed } from 'vue';
import { getArticleList,getArticleDetail} from '@/api/kepu/list';
import { downloadFile } from '@/utils/downloadFile';
import { parseTime } from '@/utils/parseTime';
// Akiraka 20230210
const deleteData = ref([])
// Akiraka 20230210
const deleteVisible = ref(false)
// Akiraka 20230210
const okVisible = ref(false);
const hospitalChild=ref(null);
watch(() => deleteVisible.value, (value) => {
if (value == false) {
getMedinceInfo(pager);
}
});
const { proxy } = getCurrentInstance();
const currentPage = ref(1);
// Pager
const pager = {
total: 0,
page: 1,
page_size: 10,
};
// form
const queryForm = reactive({
});
const modalForm = reactive({
});
const provinceData = ref([]);
const cityData = ref([]);
const countryData = ref([]);
// 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: 'article_title',width:200 },
{ title: '文章分类', dataIndex: 'article_science_class',slotName: 'article_science_class',width:100 },
{ title: '文章来源', dataIndex: 'source_name', slotName: 'source_name',width: 120 },
{ title: '文章图片', dataIndex: 'source_image',slotName: 'source_image',width:120 },
{ title: '状态', dataIndex: 'article_status',slotName: 'article_status',width:80 },
{ title: '是否置顶', dataIndex: 'is_top',slotName: 'is_top',width:100 },
{ title: '创建时间', dataIndex: 'created_at',slotName: '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;
hospitalChild.value.getData();
};
//
const handleDetail = async (record) => {
const { code, data, message } = await getArticleDetail(record.article_id)
if (code == 200) {
Object.assign(modalForm, data);
modalVisible.value = true;
}
hospitalChild.value.getData(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 getArticleList(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;
if(!queryForm.province_id){
delete queryForm.province_id;
}
if(!queryForm.city_id){
delete queryForm.city_id;
}
if(!queryForm.county_id){
delete queryForm.county_id;
}
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);
});
</script>
<style lang="scss" scoped>
.action {
margin-bottom: 12px;
}
.okmodal div {
text-align: center;
}
.hospital_name {
width: 140px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.headImg {
margin-right: 20px;
border-radius: 50%;
width: 80px;
height: 80px;
}
.arco-form-item-layout-horizontal:first-child,
.arco-form-item-layout-horizontal:nth-child(2) {
align-items: center;
}
.cellbox{
margin-top: 35px;
}
.cellbox .cell{
width:50%;
border-bottom:1px dashed #efefef;
margin-bottom: 20px;
}
.cellbox .cell:first-child{
border: none;
}
.cell{
.arco-form-item{
margin-bottom: 10px;
}
}
.box {
display: flex;
align-items: center;
}
.cert .arco-form-item-label-col {
flex: 0 0 8px !important;
}
.red {
display: inline-block;
margin-right: 5px;
font-size: 14px;
color: red;
margin-top: 5px;
}
.cardNum {
width: 148px;
}
.codbox{
display: flex;
align-items: center;
}
.reason{
width:250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>

View File

@ -0,0 +1,352 @@
<template>
<div class="app-container">
<a-form :model="queryForm" ref="queryFormRef" layout="inline">
<a-form-item field="source_name" label="来源名称">
<a-input :style="{ width: '182px' }" v-model="queryForm.source_name" placeholder="请输入来源名称"
@press-enter="handleQuery" />
</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>
<a-divider />
<!-- action -->
<div class="action">
<a-space>
<a-button v-has="'admin:sysArticleOriginList: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>
</div>
<!-- table -->
<!-- :row-selection="{ type: 'checkbox', showCheckedAll: true }" -->
<a-table :columns="columns" :data="tableData"
:pagination="{ 'show-total': true, 'show-jumper': true, 'show-page-size': true, total: pager.total, current: currentPage }"
row-key="source_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>
</template>
<template #source_image="{ record }">
<a-image width="50" height="50" fit="cover" :src="record.source_image" />
</template>
<template #created_at="{record}">
<div>{{parseTime(record.created_at)}}</div>
</template>
<template #action="{ record }">
<a-space>
<a-button v-has="'admin:sysArticleOriginList: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>
<articleOriginModal ref="hospitalChild" :modalVisible="modalVisible" :modalForm="modalForm"
:id="modalForm.source_id" @freshDetail="handleQuery"
@familyVisibleChange="() => { modalVisible = false, modalForm.source_id = '' }">
</articleOriginModal>
<!-- 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">
<template #title>
提示
</template>
<div>确定保存当前信息</div>
</a-modal>
</div>
</template>
<script setup>
import { reactive, ref, getCurrentInstance, onMounted, nextTick, watch, computed } from 'vue';
import { getArticleOriginList, getArticleOriginDetail } from '@/api/kepu/list';
import { downloadFile } from '@/utils/downloadFile';
import { parseTime } from '@/utils/parseTime';
// Akiraka 20230210
const deleteData = ref([])
// Akiraka 20230210
const deleteVisible = ref(false)
// Akiraka 20230210
const okVisible = ref(false);
const hospitalChild = ref(null);
watch(() => deleteVisible.value, (value) => {
if (value == false) {
getMedinceInfo(pager);
}
});
const file = ref();
const { proxy } = getCurrentInstance();
const currentPage = ref(1);
// Pager
const pager = {
total: 0,
page: 1,
page_size: 10,
};
// form
const queryForm = reactive({
});
const modalForm = reactive({
});
// 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: 'source_name', width: 200 },
{ title: '来源图片', dataIndex: 'source_image', slotName: 'source_image', width: 200 },
{ title: '创建时间', dataIndex: 'created_at',slotName: '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.source_id = '';
};
//
const handleDetail = async (record) => {
const { code, data, message } = await getArticleOriginDetail(record.source_id)
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 getArticleOriginList(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;
if (!queryForm.province_id) {
delete queryForm.province_id;
}
if (!queryForm.city_id) {
delete queryForm.city_id;
}
if (!queryForm.county_id) {
delete queryForm.county_id;
}
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);
});
</script>
<style lang="scss" scoped>
.action {
margin-bottom: 12px;
}
.okmodal div {
text-align: center;
}
.hospital_name {
width: 140px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.headImg {
margin-right: 20px;
border-radius: 50%;
width: 80px;
height: 80px;
}
.arco-form-item-layout-horizontal:first-child,
.arco-form-item-layout-horizontal:nth-child(2) {
align-items: center;
}
.cellbox {
margin-top: 35px;
}
.cellbox .cell {
width: 50%;
border-bottom: 1px dashed #efefef;
margin-bottom: 20px;
}
.cellbox .cell:first-child {
border: none;
}
.cell {
.arco-form-item {
margin-bottom: 10px;
}
}
.box {
display: flex;
align-items: center;
}
.cert .arco-form-item-label-col {
flex: 0 0 8px !important;
}
.red {
display: inline-block;
margin-right: 5px;
font-size: 14px;
color: red;
margin-top: 5px;
}
.cardNum {
width: 148px;
}
.codbox {
display: flex;
align-items: center;
}
.reason {
width: 250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>

View File

@ -0,0 +1,343 @@
<template>
<div class="app-container">
<a-form :model="queryForm" ref="queryFormRef" layout="inline">
<a-form-item field="basic_class_name " label="分类名称">
<a-input :style="{ width: '182px' }" v-model="queryForm.basic_class_name " placeholder="请输入分类名称" @press-enter="handleQuery" />
</a-form-item>
<a-form-item field="order.basic_class_sort" label="分类排序">
<a-select v-model="queryForm.order.basic_class_sort" placeholder="请选择分类排序" :style="{ width: '182px' }">
<a-option value="asc">正序</a-option>
<a-option value="desc">倒序</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:sysClassifyList: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>
</div>
<!-- table -->
<!-- :row-selection="{ type: 'checkbox', showCheckedAll: true }" -->
<a-table :columns="columns" :data="tableData"
: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>
</template>
<template #basic_class_name="{record}">
<div>{{record.basic_class_name}}</div>
</template>
<template #created_at="{record}">
<div>{{parseTime(record.created_at)}}</div>
</template>
<template #action="{ record }">
<a-space>
<a-button v-has="'admin:sysClassifyList:detail'" type="text"
@click="handleDetail(record)"><icon-book />详情</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>
<classifyModal ref="hospitalChild" :modalVisible="modalVisible" :modalForm="modalForm" :id="modalForm.basic_class_id" @freshDetail="handleQuery" @familyVisibleChange="()=>{modalVisible=false,modalForm.basic_class_id=''}"></classifyModal>
<!-- 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">
<template #title>
提示
</template>
<div>确定保存当前信息</div>
</a-modal>
</div>
</template>
<script setup>
import { reactive, ref, getCurrentInstance, onMounted, nextTick, watch, computed } from 'vue';
import { getClassifyList,getClassifyDetail} from '@/api/kepu/list';
import { downloadFile } from '@/utils/downloadFile';
import { parseTime } from '@/utils/parseTime';
// Akiraka 20230210
const deleteData = ref([])
// Akiraka 20230210
const deleteVisible = ref(false)
// Akiraka 20230210
const okVisible = ref(false);
const hospitalChild=ref(null);
watch(() => deleteVisible.value, (value) => {
if (value == false) {
getMedinceInfo(pager);
}
});
const file = ref();
const { proxy } = getCurrentInstance();
const currentPage = ref(1);
// Pager
const pager = {
total: 0,
page: 1,
page_size: 10,
};
// form
const queryForm = reactive({
order:{
basic_class_sort:''
}
});
const modalForm = reactive({
});
// 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: 'basic_class_name',width:200 },
{ title: '排序', dataIndex: 'basic_class_sort',width:100 },
{ title: '创建时间', dataIndex: 'created_at',slotName: '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;
modalForm.basic_class_id ='';
};
//
const handleDetail = async (record) => {
const { code, data, message } = await getClassifyDetail(record.basic_class_id)
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 getClassifyList(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;
if(!queryForm.province_id){
delete queryForm.province_id;
}
if(!queryForm.city_id){
delete queryForm.city_id;
}
if(!queryForm.county_id){
delete queryForm.county_id;
}
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);
});
</script>
<style lang="scss" scoped>
.action {
margin-bottom: 12px;
}
.okmodal div {
text-align: center;
}
.hospital_name {
width: 140px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.headImg {
margin-right: 20px;
border-radius: 50%;
width: 80px;
height: 80px;
}
.arco-form-item-layout-horizontal:first-child,
.arco-form-item-layout-horizontal:nth-child(2) {
align-items: center;
}
.cellbox{
margin-top: 35px;
}
.cellbox .cell{
width:50%;
border-bottom:1px dashed #efefef;
margin-bottom: 20px;
}
.cellbox .cell:first-child{
border: none;
}
.cell{
.arco-form-item{
margin-bottom: 10px;
}
}
.box {
display: flex;
align-items: center;
}
.cert .arco-form-item-label-col {
flex: 0 0 8px !important;
}
.red {
display: inline-block;
margin-right: 5px;
font-size: 14px;
color: red;
margin-top: 5px;
}
.cardNum {
width: 148px;
}
.codbox{
display: flex;
align-items: center;
}
.reason{
width:250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>