Merge branch 'dev'

This commit is contained in:
zoujiandong 2023-09-26 09:36:40 +08:00
commit 2b99a4b6f2
12 changed files with 1320 additions and 1349 deletions

26
src/api/patient/family.js Normal file
View File

@ -0,0 +1,26 @@
import request from '../../utils/request'
const url = '/admin/patient/family';
export function getFamilyList(params){
return request({
url:'/admin/patient/family',
method: 'get',
params
})
}
export function getFamilyDetail(id){
return request({
url:'/admin/patient/family/'+id,
method: 'get'
})
}
export function decryptMobile(params){
return request({
url:'/decrypt/mobile',
method: 'get',
params
})
}

View File

@ -10,80 +10,16 @@ export function getPatientList(params){
params
})
}
export function addPatient(data) {
return request({
url,
method: 'post',
data
})
}
export function removePatient(data) {
return request({
url,
method: 'delete',
data
})
}
export function updatePatient(data, id) {
return request({
url: `${url}/${id}`,
method: 'put',
data
})
}
export function getPatientDetail(id){
return request({
url:'/admin/doctor/'+id,
url:'/admin/patient/'+id,
method: 'get'
})
}
export function departmentList(){ //获取科室列表
export function changeStatus(id,data){
return request({
url:'/basic/department/custom/list',
method: 'get'
url:'/admin/patient/status/'+id,
method: 'put',
data
})
}
export function decryptCard(params){
return request({
url:'/decrypt/card/num',
method: 'get',
params
})
}
export function decryptBank(doctor_id){
return request({
url:'/decrypt/bank/'+doctor_id,
method: 'get'
})
}
export function hospitalList(params){ //获取医院地址列表
return request({
url:'/basic/hospital/list',
method: 'get',
params
})
}
export function expertiseList(){ //获取专长列表
return request({
url:'/basic/expertise/list',
method: 'get'
})
}
export function bankList(){ //获取银行列表
return request({
url:'/basic/bank/list',
method: 'get'
})
}
export function areaList(params){ //获取银行列表
return request({
url:'/basic/area/list',
method: 'get',
params
})
}
}

View File

@ -0,0 +1,18 @@
import request from '../../utils/request'
const url = '/admin/prescription';
export function getPrescriptionList(params){
return request({
url:'/admin/prescription',
method: 'get',
params
})
}
export function getPrescriptionDetail(id){
return request({
url:'/admin/prescription/'+id,
method: 'get'
})
}

View File

@ -0,0 +1,193 @@
<template>
<!-- Modal -->
<a-modal v-model:visible="modalVisible" fullscreen 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">
<a-row :gutter="24" style="margin-top: 35px;">
<a-col :span="12">
<a-form-item field="avatar" label="真实姓名:">
<span>{{modalForm.card_name}} {{modalForm.sex==1?'男,':'女,'}}{{modalForm.age
}}</span>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item field="idCard" label="身份证号:" >
<div class="box" v-show="!showEye ">
<div class="cardNum">{{modalForm.id_number_mask}}</div>
<icon-eye-invisible class="eye" @click="handelDecryptCard(modalForm.user.user_id,modalForm.family_id)" />
</div>
<div class="box" v-show="showEye">
<div class="cardNum">{{id_card_num}}</div>
<icon-eye class="eye" @click="()=>{showEye=false}" />
</div>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24" v-if="modalForm.mobile_mask">
<a-col :span="12">
<a-form-item field="idCard" label="手机号码:" >
<div class="box" v-show="!family_Eye">
<div class="cardNum">{{modalForm.mobile_mask}}</div>
<icon-eye-invisible class="eye" @click="handleDecryptMobile(modalForm.user.user_id,modalForm.family_id)" />
</div>
<div class="box" v-show="family_Eye">
<div class="cardNum">{{family_mobile}}</div>
<icon-eye class="eye" @click="()=>{family_Eye=false}" />
</div>
</a-form-item>
</a-col>
</a-row>
<a-divider />
<div class="titlebox">
<div class="bar"></div>
<div class="name">所属账号</div>
</div>
<a-row :gutter="24" style="margin-top: 35px;">
<a-col :span="12">
<a-form-item field="avatar" label="账号用户名:">
<span>{{modalForm.user.user_name}}</span>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item field="idCard" label="账号电话:" >
<div class="box" v-show="!count_Eye">
<div class="cardNum">{{modalForm.user.mobile}}</div>
<icon-eye-invisible class="eye" @click="handleDecryptMobile(modalForm.user.user_id)" />
</div>
<div class="box" v-show="count_Eye">
<div class="cardNum">{{count_mobile}}</div>
<icon-eye class="eye" @click="()=>{count_Eye=false}" />
</div>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item field="idCard" label="与就诊人关系:" >
<span v-if="modalForm.relation">{{formatRelation(modalForm.relation)}}</span>
<span v-else>-</span>
</a-form-item>
</a-col>
</a-row>
<a-divider />
<!-- <div class="titlebox">
<div class="bar"></div>
<div class="name">病例信息</div>
</div>
<a-row :gutter="24" style="margin-top: 35px;">
<a-col :span="12">
</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" status="danger" @click="">禁用</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row> -->
</a-modal>
</template>
<script setup>
import {ref,toRefs} from 'vue';
import {decryptCard} from '@/api/doctor/list';
import {decryptMobile} from '@/api/patient/family';
import {formatRelation} from "@/utils/format"
const props = defineProps({
//
modalVisible: {
type: Boolean,
default: false,
},
modalForm: {
type: Object,
},
});
const emits = defineEmits(['familyVisibleChange']);
const {modalVisible,modalForm} = toRefs(props);
//
const showEye = ref(false);
const id_card_num = ref('');
//
const handelDecryptCard = async (user_id,family_id) => {
showEye.value = true;
const { data, code, message } = await decryptCard({
user_id,
family_id
});
if (code == 200) {
id_card_num.value = data;
}
};
//
const count_Eye= ref(false);
const family_Eye= ref(false);
const count_mobile=ref('');
const family_mobile=ref('')
const handleDecryptMobile=async(user_id,family_id='')=>{
let dataObj=null;
if(family_id){
dataObj={ user_id,family_id}
family_Eye.value=true
}else{
dataObj={ user_id,family_id};
count_Eye.value=true
}
const { data, code, message } = await decryptMobile(dataObj);
if(code==200){
if(family_id){
family_mobile.value=data
}else{
count_mobile.value=data;
}
}
}
// Akiraka 20230210
const handleClose = () => {
emits('familyVisibleChange', false);
};
</script>
<style scoped>
.cardNum {
width: 150px;
}
.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;
}
.box {
display: flex;
align-items: center;
}
.cert .arco-form-item-label-col {
flex: 0 0 8px !important;
}
</style>

View File

@ -40,28 +40,17 @@ const {isVisible,title,id,api} = toRefs(props);
// Akiraka 20230210
const handleClose = () => {
emits('closeChangeOk',false);
// alert(flag)
}
// Akiraka 20230210 =>
const handleConfirm = async () => {
const {code}=api.value(id.value);
if(code==200){
const data=title.value=="确定启用吗?"?await api.value(id.value,{status:1}):await api.value(id.value);
if(data.code==200){
Message.success("成功");
proxy.$refs.modalFormRef.resetFields();
//proxy.$refs.modalFormRef.resetFields();
}else{
proxy.$notification.error(response.message);
}
emits('closeChangeOk',true);
// api.value(id.value).then(response => {
// // Akiraka 20230210
// if(response.code==200){
// Message.success("");
// proxy.$refs.modalFormRef.resetFields();
// }else{
// proxy.$notification.error(response.message);
// }
// emits('closeChangeOk',true);
// })
}
</script>

View File

@ -1,13 +1,26 @@
<template>
<a-table :columns="columns" :data="data" :pagination="pagination">
<template #url="{ record }" wx:if="record.url">
<template #url="{ record }" >
<a :href="record.url" target="_blank">查看处方</a>
</template>
<template #code="{record,rowIndex}" >
<div>{{(rowIndex+1)}}</div>
</template>
<template #relation="{record}" >
<div>{{formatRelation(record.relation)}}</div>
</template>
<template #action="{ record }">
<a-space>
<a-button type="text"
@click="handleDetail(record)"><icon-book />详情</a-button>
</a-space>
</template>
</a-table>
</template>
<script setup>
import { watch,toRefs } from 'vue';
import {toRefs } from 'vue';
import {formatRelation} from "@/utils/format"
const props = defineProps({
//
data: {
@ -22,8 +35,9 @@ const props = defineProps({
}
});
const { data, columns,pagination} = toRefs(props);
// watch(()=>props.data,(value)=>{
// data.value=value;
// },{immediate:true})
const { data,columns,pagination} = toRefs(props);
const emits = defineEmits(['handleFamilyDetail']);
const handleDetail=(record)=>{
emits('handleFamilyDetail',record.family_id)
}
</script>

View File

@ -61,3 +61,12 @@ export const formatDoctorTitle=(val)=>{
return ''
}
}
export const formatRelation=(val)=>{
//与患者关系1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他
let data={1:'本人', 2:'父母', 3:'爱人', 4:'子女',5:'亲戚',6:'其他'}
if(val){
return data[val]
}else{
return ''
}
}

View File

@ -19,10 +19,14 @@ service.interceptors.request.use(
// Store 必须在拦截器内部导入,在外部导入会显示 Pinia 未初始化
const store = useUserStore();
// 设置请求头部 Authorization
// if(config.method=="put"){
// config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
// }
if (store.token) {
config.headers['Authorization'] = 'Bearer ' + store.token;
//config.headers['Content-Type'] = 'multipart/form-data'
}
return config;
},
(error) => {

View File

@ -123,6 +123,9 @@
<div class="ta-patient" :title="record.patient_name">{{record.patient_name}}({{record.patient_sex==1?'男,':'女,'}}{{record.patient_age}})</div>
</template>
<template #inquiry_type="{ record }">
{{ formatInquiryType(record.inquiry_type) }}
</template>
<template #pay_time="{ record }">
{{ parseTime(record.pay_time) }}
</template>
@ -516,6 +519,7 @@ const columns = [
{ title: '联系电话', dataIndex: 'patient_mobile',width: 130 },
{ title: '订单金额', dataIndex: 'amount_total',slotName:'amount_total',width:100 },
{ title: '实付金额', dataIndex: 'payment_amount_total',slotName:'payment_amount_total',width:100 },
{ title: '服务类型', dataIndex: 'inquiry_type',slotName:'inquiry_type',width:100 },
{ title: '支付方式', dataIndex: 'inquiry_pay_channel',slotName: 'inquiry_pay_channel'},
{ title: '订单状态', dataIndex: 'inquiry_status', slotName:'inquiry_status' },
{ title: '支付时间', dataIndex: 'pay_time', slotName: 'pay_time',width:200 },

View File

@ -0,0 +1,348 @@
<template>
<div class="app-container">
<a-form :model="queryForm" ref="queryFormRef" layout="inline">
<a-form-item field="user_name" label="账号名字">
<a-input :style="{ width: '182px' }" v-model="queryForm.user_name" placeholder="请输入账号或者姓名" @press-enter="handleQuery" />
</a-form-item>
<a-form-item field="mobile" label="电话号码">
<a-input :style="{ width: '182px' }" v-model="queryForm.mobile" placeholder="请输入电话号码" @press-enter="handleQuery" />
</a-form-item>
<!-- <a-form-item field="status" label="启用状态">
<a-select v-model="queryForm.status" placeholder="请选择启用状态" :style="{ width: '182px' }">
<a-option :value="0">禁用</a-option>
<a-option :value="1">正常</a-option>
<a-option :value="2">删除</a-option>
</a-select>
</a-form-item> -->
<a-form-item field="create_range_time" label="创建时间范围">
<a-range-picker
style="width: 260px"
v-model="queryForm.create_range_time"
/>
</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:sysFamilyList: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> -->
<!-- table -->
<a-table :columns="columns" :data="tableData"
:row-selection="{ type: 'checkbox', showCheckedAll: true }"
:pagination="{ 'show-total': true, 'show-jumper': true, 'show-page-size': true, total: pager.total, current: currentPage }"
row-key="doctor_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)*10}}</div>
</template>
<template #status="{ record }">
<!-- 状态0:禁用 1:正常 2:删除 -->
<a-tag v-if="record.status == 0" color="#ffb400">禁用</a-tag>
<a-tag v-else-if="record.status == 1" color="green">正常</a-tag>
<a-tag v-else color="red">删除</a-tag>
</template>
<template #is_platform_deep_cooperation="{ record }">
<a-tag v-if="record.is_platform_deep_cooperation == 0" color="gray"></a-tag>
<a-tag v-else color="green"></a-tag>
</template>
<template #disable_reason="{record}">
<div class="reason" v-if="record.disable_reason" :title="record.disable_reason">{{ record.disable_reason }}</div>
<div v-else>-</div>
</template>
<template #relation="{record}">
<div>{{formatRelation(record.relation)}}</div>
</template>
<template #action="{ record }">
<a-space>
<a-button v-has="'admin:sysFamilyList:detail'" type="text"
@click="handleDetail(record)"><icon-book />详情</a-button>
<!-- <a-button v-has="'admin:sysFamilyList:edit'" type="text" @click="handleUpdate(record)"><icon-edit />
修改</a-button> -->
<!-- <a-button v-has="'admin:sysFamilyList:remove'" type="text"
@click="() => { deleteVisible = true; deleteData = [record.doctor_id]; }"><icon-delete /> 删除</a-button> -->
</a-space>
</template>
</a-table>
<familyModal :modalVisible="modalVisible" :modalForm="modalForm" @familyVisibleChange="()=>{modalVisible=false}"></familyModal>
<!-- 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 { getFamilyList,getFamilyDetail} from '@/api/patient/family';
import {formatRelation} from "@/utils/format"
// Akiraka 20230210
const deleteData = ref([])
// Akiraka 20230210
const deleteVisible = ref(false)
// Akiraka 20230210
const okVisible = ref(false);
watch(() => deleteVisible.value, (value) => {
if (value == false) {
getFamilyInfo(pager);
}
});
const file = ref();
const { proxy } = getCurrentInstance();
const currentPage = ref(1);
const family_data=ref([]);
const family_columns=ref([{
title: '编号',
dataIndex: 'code',
slotName:'code'
},{
title: '就诊人姓名',
dataIndex: 'card_name_mask',
},{
title: '身份证号',
dataIndex: 'id_number_mask',
},{
title: '与账号关系',
dataIndex: 'relation',
slotName:'relation'
},{
title: '添加时间',
dataIndex: 'created_at',
slotName:'created_at'
}, { title: '操作', slotName: 'action'}])
// Pager
const pager = {
total: 0,
page: 1,
page_size: 10,
};
// form
const queryForm = reactive({
});
const modalForm = reactive({
user:{},
avatar: 'https://img.applets.igandanyiyuan.com/basic/file/patient_avatar.png',
});
watch(() => queryForm.create_range_time,
(value) => {
if (value) {
let [startTime, endTime] = value;
queryForm.created_at = startTime + '&' + endTime;
} else {
queryForm.created_at = '';
}
}
);
// 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: 'card_name',width:200 },
{ title: '所属账号', dataIndex: 'user_name', width:200 },
{ title: '账号电话', dataIndex: 'mobile_mask',width:200 },
{ title: '与账号关系', dataIndex: 'relation', slotName: 'relation',width: 150 },
// { title: '', dataIndex: 'status', slotName: 'status' },
{ title: '操作', slotName: 'action', fixed: "right", width: 180 },
];
// Table Data
const tableData = ref([]);
//
const modalSatus = ref('add');
// Satus
const handleAdd = () => {
modalVisible.value = true;
modalTitle.value = '新增患者';
modalSatus.value = 'add';
modalForm.patient_id = null;
};
//
const handleDetail = async (record) => {
const { code, data, message } = await getFamilyDetail(record.family_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);
getFamilyInfo(pager);
},
onCancel: () => {
proxy.$message.info('已取消批量删除数据');
},
});
} else {
proxy.$message.error('请勾选需要删除的数据!');
}
};
/**
* 分页改变
* @param {Number} [page]
*/
const handlePageChange = (page) => {
pager.page = page;
//
currentPage.value = page;
getFamilyInfo({ ...pager, ...queryForm });
};
//
const handlepage_sizeChange = (page_size) => {
pager.page_size = page_size;
getFamilyInfo({ ...pager, ...queryForm });
};
//
const getFamilyInfo = async (params = {}) => {
const { data, code, message } = await getFamilyList(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,
};
getFamilyInfo(params);
};
//
const handleResetQuery = () => {
proxy.$refs.queryFormRef.resetFields();
getFamilyInfo(queryForm);
}
onMounted(() => {
getFamilyInfo(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>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,425 @@
<template>
<div class="app-container">
<a-form :model="queryForm" ref="queryFormRef" layout="inline">
<a-form-item field="prescription_code" label="处方编号">
<a-input :style="{ width: '182px' }" v-model="queryForm.prescription_code" placeholder="请输入处方编号" @press-enter="handleQuery" />
</a-form-item>
<a-form-item field="inquiry_no" label="问诊编号">
<a-input :style="{ width: '182px' }" v-model="queryForm.inquiry_no" placeholder="请输入问诊订单编号" @press-enter="handleQuery" />
</a-form-item>
<a-form-item field="order_product_no" label="药品编号">
<a-input :style="{ width: '182px' }" v-model="queryForm.order_product_no" placeholder="请输入药品订单编号" @press-enter="handleQuery" />
</a-form-item>
<a-form-item field="doctor_name" label="医生姓名">
<a-input :style="{ width: '182px' }" v-model="queryForm.doctor_name" placeholder="请输入医生姓名" @press-enter="handleQuery" />
</a-form-item>
<a-form-item field="patient_name" label="患者姓名">
<a-input :style="{ width: '182px' }" v-model="queryForm.patient_name" placeholder="请输入患者姓名" @press-enter="handleQuery" />
</a-form-item>
<a-form-item field="mobile" label="电话号码">
<a-input :style="{ width: '182px' }" v-model="queryForm.mobile" placeholder="请输入医生或者患者电话号码" @press-enter="handleQuery" />
</a-form-item>
<a-form-item field="prescription_status" label="处方状态">
<a-select
v-model="queryForm.prescription_status"
placeholder="请选择处方状态"
:style="{ width: '182px' }"
>
<!-- 处方状态1:待审核 2:待使用 3:已失效 4:已使用 -->
<a-option value="1">待审核</a-option>
<a-option value="2">待使用</a-option>
<a-option value="3">已失效</a-option>
<a-option value="4">已使用</a-option>
</a-select>
</a-form-item>
<a-form-item field="pharmacist_audit_status" label="审核状态">
<a-select
v-model="queryForm.pharmacist_audit_status"
placeholder="请选择审核状态"
:style="{ width: '182px' }"
>
<!-- 0:审核中 1:审核成功 2:审核驳回 -->
<a-option value="0">审核中</a-option>
<a-option value="1">审核成功</a-option>
<a-option value="2">审核驳回</a-option>
</a-select>
</a-form-item>
<a-row>
<a-form-item field="pharmacist_verify_range_time" label="审核时间范围">
<a-range-picker
style="width: 330px"
v-model="queryForm.pharmacist_verify_range_time"
/>
</a-form-item>
<a-form-item field="create_range_time" label="开具时间范围">
<a-range-picker
style="width: 330px"
v-model="queryForm.create_range_time"
/>
</a-form-item>
<a-form-item field="expired_range_time" label="过期时间范围">
<a-range-picker
style="width: 330px"
v-model="queryForm.expired_range_time"
/>
</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-row>
</a-form>
<a-divider />
<!-- action -->
<div class="action">
<a-space>
<a-button v-has="'admin:sysPrescriptionList:add'" type="primary" @click="handleAdd"><icon-plus /> 新增 </a-button>
<!-- <a-button v-has="'admin:sysPrescriptionList:remove'" type="primary" status="danger"><icon-delete /> 批量删除 </a-button> -->
</a-space>
</div>
<!-- table -->
<a-table :columns="columns" :data="tableData"
:scroll="{ x: 1400 }"
:row-selection="{ type: 'checkbox', showCheckedAll: true }"
:pagination="{ 'show-total': true, 'show-jumper': true, 'show-page-size': true, total: pager.total, current: currentPage }"
row-key="doctor_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)*10}}</div>
</template>
<template #prescription_status="{ record }">
<span>{{formatPrescriptionStatus(record.prescription_status)}}</span>
</template>
<template #is_platform_deep_cooperation="{ record }">
<a-tag v-if="record.is_platform_deep_cooperation == 0" color="gray"></a-tag>
<a-tag v-else color="green"></a-tag>
</template>
<template #doctor_name="{record}">
<div class="doctor_name" :title="record.doctor_name">{{ record.doctor_name }}</div>
</template>
<template #pharmacist_name="{record}">
<div class="doctor_name" :title="record.pharmacist_name">{{record.pharmacist_name}}</div>
</template>
<template #patient_name="{record}">
<div class="doctor_name" :title="record.patient_name">{{record.patient_name}}({{
record.patient_sex == 1 ? '男,' : '女,'
}}{{ record.patient_age }})</div>
</template>
<template #order_prescription_icd="{record}">
<div class="doctor_name" :title="record.order_prescription_icd">{{record.order_prescription_icd}}</div>
</template>
<template #action="{ record }">
<a-space>
<a-button v-has="'admin:sysPrescriptionList:detail'" type="text"
@click="handleDetail(record)"><icon-book />详情</a-button>
<!-- <a-button v-has="'admin:sysPrescriptionList:edit'" type="text" @click="handleUpdate(record)"><icon-edit />
修改</a-button> -->
<!-- <a-button v-has="'admin:sysPrescriptionList:remove'" type="text"
@click="() => { deleteVisible = true; deleteData = [record.doctor_id]; }"><icon-delete /> 删除</a-button> -->
</a-space>
</template>
</a-table>
<familyModal :modalVisible="modalVisible" :modalForm="modalForm" @familyVisibleChange="()=>{modalVisible=false}"></familyModal>
<!-- Akiraka 20230223 删除与批量删除 开始 -->
<!-- <DeleteModal :data="deleteData" :visible="deleteVisible" :apiDelete="removePrescription"
@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 { getPrescriptionList,getPrescriptionDetail} from '@/api/prescription/list';
import {formatPrescriptionStatus} from "@/utils/format"
// Akiraka 20230210
const deleteData = ref([])
// Akiraka 20230210
const deleteVisible = ref(false)
// Akiraka 20230210
const okVisible = ref(false);
watch(() => deleteVisible.value, (value) => {
if (value == false) {
getPrescriptionInfo(pager);
}
});
const file = ref();
const { proxy } = getCurrentInstance();
const currentPage = ref(1);
const family_data=ref([]);
const family_columns=ref([{
title: '编号',
dataIndex: 'code',
slotName:'code'
},{
title: '就诊人姓名',
dataIndex: 'card_name_mask',
},{
title: '身份证号',
dataIndex: 'id_number_mask',
},{
title: '与账号关系',
dataIndex: 'relation',
slotName:'relation'
},{
title: '添加时间',
dataIndex: 'created_at',
slotName:'created_at'
}, { title: '操作', slotName: 'action'}])
// Pager
const pager = {
total: 0,
page: 1,
page_size: 10,
};
// form
const queryForm = reactive({
});
const modalForm = reactive({
user:{},
avatar: 'https://img.applets.igandanyiyuan.com/basic/file/patient_avatar.png',
});
// Modal
const modalVisible = ref(false);
const modalTitle = ref('默认标题');
watch(() => queryForm.pharmacist_verify_range_time,
(value) => {
if (value) {
let [startTime, endTime] = value;
queryForm.pharmacist_verify_time = startTime + '&' + endTime;
} else {
queryForm.pharmacist_verify_time = '';
}
}
);
watch(() => queryForm.create_range_time,
(value) => {
if (value) {
let [startTime, endTime] = value;
queryForm.doctor_created_time = startTime + '&' + endTime;
} else {
queryForm.doctor_created_time = '';
}
}
);
watch(() => queryForm.expired_range_time,
(value) => {
if (value) {
let [startTime, endTime] = value;
queryForm.expired = startTime + '&' + endTime;
} else {
queryForm.expired = '';
}
}
);
// Batch Del List
let batchList = [];
// Table Columns
const columns = [
{ title: '编号', dataIndex: 'doctor_id', slotName: 'doctor_id', width: '90' },
{ title: '处方编号', dataIndex: 'order_prescription_id',width:180 },
{ title: '医生姓名', dataIndex: 'doctor_name',slotName: 'doctor_name', width: 150 },
{ title: '药师姓名', dataIndex: 'pharmacist_name',slotName:'pharmacist_name' },
{ title: '就诊人', dataIndex: 'patient_name', slotName: 'patient_name',width:180 },
{ title: '就诊人联系电话', dataIndex: 'mobile',width:130 },
{ title: '诊断', dataIndex: 'order_prescription_icd',slotName: 'order_prescription_icd' },
{ title: '处方状态', dataIndex: 'prescription_status',slotName:'prescription_status' },
{ title: '开方时间', dataIndex: 'created_at',slotName:'created_at',width:180 },
{ title: '操作', slotName: 'action', fixed: "right", width: 120 },
];
// Table Data
const tableData = ref([]);
//
const modalSatus = ref('add');
// Satus
const handleAdd = () => {
modalVisible.value = true;
modalTitle.value = '新增患者';
modalSatus.value = 'add';
modalForm.patient_id = null;
};
//
const handleDetail = async (record) => {
const { code, data, message } = await getPrescriptionDetail(record.family_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 removePrescription({ ids: batchList });
proxy.$message.success(res.message);
getPrescriptionInfo(pager);
},
onCancel: () => {
proxy.$message.info('已取消批量删除数据');
},
});
} else {
proxy.$message.error('请勾选需要删除的数据!');
}
};
/**
* 分页改变
* @param {Number} [page]
*/
const handlePageChange = (page) => {
pager.page = page;
//
currentPage.value = page;
getPrescriptionInfo({ ...pager, ...queryForm });
};
//
const handlepage_sizeChange = (page_size) => {
pager.page_size = page_size;
getPrescriptionInfo({ ...pager, ...queryForm });
};
//
const getPrescriptionInfo = async (params = {}) => {
const { data, code, message } = await getPrescriptionList(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,
};
getPrescriptionInfo(params);
};
//
const handleResetQuery = () => {
proxy.$refs.queryFormRef.resetFields();
//getPrescriptionInfo(queryForm);
currentPage.value=1;
//getProductInfo(queryForm);
handleQuery();
}
onMounted(() => {
getPrescriptionInfo(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;
}
.doctor_name{
max-width:250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>