添加test打包命令以及oss上传

This commit is contained in:
zoujiandong 2023-07-07 17:58:39 +08:00
parent 8e656552b9
commit 3b666aa539
5 changed files with 579 additions and 437 deletions

2
.env.test Normal file
View File

@ -0,0 +1,2 @@
BASE_URL= "https://vue3.go-admin.dev"
VITE_BASE_URL= "http://dev.hospital.admin.api.igandanyiyuan.com"

View File

@ -5,6 +5,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"test": "vite --mode=test build",
"preview": "vite preview"
},
"dependencies": {

View File

@ -40,3 +40,23 @@ export function getDoctorDetail(id){
method: 'get'
})
}
export function departmentList(){ //获取科室列表
return request({
url:'/admin/department/custom/list',
method: 'get'
})
}
export function decryptCard(user_id){
return request({
url:'/decrypt/card/'+user_id,
method: 'get'
})
}
export function hospitalList(params){ //获取医院地址列表
return request({
url:'/admin/hospital/list',
method: 'get',
params
})
}

18
src/api/oss.js Normal file
View File

@ -0,0 +1,18 @@
import request from '../utils/request'
export function ossSign(params){
return request({
url:"/sign/oss",
method: 'get',
params
})
}
export function ossUpload(url,data){
return request({
url,
method: 'post',
data,
header:{
'Content-Type': 'multipart/form-data'
}
})
}

View File

@ -12,11 +12,7 @@
<a-input v-model="queryForm.hospital_name" placeholder="请输入所属医院" @press-enter="handleQuery" />
</a-form-item>
<a-form-item field="inquiry_service" label="服务类型">
<a-select
v-model="queryForm.inquiry_service"
placeholder="请选择服务类型"
:style="{ width: '182px' }"
>
<a-select v-model="queryForm.inquiry_service" placeholder="请选择服务类型" :style="{ width: '182px' }">
<!-- 1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 -->
<a-option :value="1">专家问诊</a-option>
<a-option :value="2">快速问诊</a-option>
@ -25,11 +21,7 @@
</a-select>
</a-form-item>
<a-form-item field="multi_point_status" label="认&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;证">
<a-select
v-model="queryForm.multi_point_status"
placeholder="请选择多点认证状态"
:style="{ width: '180px' }"
>
<a-select v-model="queryForm.multi_point_status" placeholder="请选择多点认证状态" :style="{ width: '180px' }">
<!-- 医生多点执业认证状态0:未认证 1:认证通过 2:审核中 3:认证失败 -->
<a-option :value="0">未认证</a-option>
<a-option :value="1">认证通过</a-option>
@ -51,22 +43,17 @@
<div class="action">
<a-space>
<a-button v-has="'admin:sysDoctor:add'" type="primary" @click="handleAdd"><icon-plus /> 新增 </a-button>
<a-button v-has="'admin:sysDoctor:remove'" type="primary" status="danger" @click="() => { deleteVisible = true; }"><icon-delete /> 批量删除 </a-button>
<a-button v-has="'admin:sysDoctor:remove'" type="primary" status="danger"
@click="() => { deleteVisible = true; }"><icon-delete /> 批量删除 </a-button>
</a-space>
</div>
<!-- table -->
<a-table
:columns="columns"
:scroll="{ x: 2000 }"
:data="tableData"
<a-table :columns="columns" :scroll="{ x: 2000 }" :data="tableData"
:pagination="{ 'show-total': true, 'show-jumper': true, 'show-page-size': true, total: pager.total, current: currentPage }"
:row-selection="{ type: 'checkbox', showCheckedAll: true }"
row-key="doctor_id"
@selection-change="(selection) => {deleteData = selection;}"
@page-change="handlePageChange"
@page-size-change="handlepage_sizeChange"
>
:row-selection="{ type: 'checkbox', showCheckedAll: true }" row-key="doctor_id"
@selection-change="(selection) => {deleteData = selection;}" @page-change="handlePageChange"
@page-size-change="handlepage_sizeChange">
<template #doctor_id="{record,rowIndex}">
<div>{{(rowIndex+1)+(pager.page-1)*10}}</div>
</template>
@ -103,129 +90,140 @@
</template>
<template #action="{ record }">
<a-space>
<a-button v-has="'admin:sysDoctor:detail'" type="text" @click="handleDetail(record)"><icon-edit />详情</a-button>
<a-button v-has="'admin:sysDoctor:detail'" type="text"
@click="handleDetail(record)"><icon-edit />详情</a-button>
<a-button v-has="'admin:sysDoctor:edit'" type="text" @click="handleUpdate(record)"><icon-edit /> 修改</a-button>
<a-button v-has="'admin:sysDoctor:remove'" type="text" @click="() => { deleteVisible = true; deleteData = [record.doctor_id]; }"><icon-delete /> 删除</a-button>
<a-button v-has="'admin:sysDoctor:remove'" type="text"
@click="() => { deleteVisible = true; deleteData = [record.doctor_id]; }"><icon-delete /> 删除</a-button>
</a-space>
</template>
</a-table>
<!-- Modal -->
<a-modal
v-model:visible="modalVisible"
fullscreen
:title="modalTitle"
title-align="start"
:footer="false"
@before-ok="handleSubmit"
@close="() => {$refs.modalFormRef.resetFields(); modalForm.doctor_id = null;}"
>
<a-modal v-model:visible="modalVisible" fullscreen :title="modalTitle" title-align="start" :footer="false"
@before-ok="handleSubmit" @close="() => {$refs.modalFormRef.resetFields(); modalForm.doctor_id = null;}">
<div class="titlebox">
<div class="bar"></div>
<div class="name">医生信息</div>
</div>
<a-form :model="modalForm" :rules="rules" ref="modalFormRef" :auto-label-width="true">
<a-form-item field="user_name" label="医生头像">
<a-form :model="modalForm" :disabled="modalSatus=='detail'" :rules="rules" ref="modalFormRef"
:auto-label-width="true">
<a-form-item field="avatar" label="医生头像:">
<a-space size="large">
<a-avatar :size="80" :shape="circle" imageUrl="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp">
<a-avatar :size="80" :imageUrl="modalForm.avatar">
</a-avatar>
</a-space>
<a-upload action="/" />
<a-upload action="/" :fileList="file ? [file] : []" class="upload" :auto-upload="false" @change="onChangeFile"
accept="image/png, image/jpeg" @before-upload="beforeUpload" :show-file-list="false"
v-if="modalSatus!='detail'" />
</a-form-item>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item field="user_name" label="医生名字">
<a-form-item field="user_name" label="医生名字">
{{modalForm.user_name}}
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item field="user_name" label="身份证号">
<!-- {{modalForm.user_doctor_info.card_num_mask}} -->
<a-form-item field="idCard" label="身份证号:">
<div class="box" v-show="!showEye">
<div>{{modalForm.user_doctor_info.card_num_mask}}</div>
<icon-eye-invisible class="eye" @click="()=>{showEye=true}" />
</div>
<div class="box" v-show="showEye">
<div>{{id_card_num}}</div>
<icon-eye class="eye" @click="()=>{showEye=false}" />
</div>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item field="user_name" label="联系电话">
{{modalForm.user_name}}
<a-form-item field="mobile" label="联系电话">
{{modalForm.user.mobile}}
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item field="user_name" label="多点执业">
<!-- {{modalForm.user_doctor_info.card_num_mask}} -->
<a-form-item field="multi_point_status" label="多点执业:">
<span v-if="modalForm.multi_point_status==1">可处方</span>
<span v-else>不可处方</span>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item field="user_name" label="医院地址">
<a-input v-model="queryForm.dept_name" placeholder="请输入部门名称" />
<a-form-item field="address" label="医院地址">
<a-input v-model="modalForm.hospital.address" placeholder="请输入医院地址" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item field="user_name" label="医院名称">
<a-input v-model="queryForm.dept_name" placeholder="请输入部门名称" />
<a-form-item field="hospital_name" label="医院名称">
<a-input v-model="modalForm.hospital.hospital_name" placeholder="请输入医院名称" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item field="user_name" label="所在科室">
<a-input v-model="queryForm.dept_name" placeholder="请输入部门名称" />
<a-form-item field="department_custom_id" label="所在科室:">
<a-select placeholder="请选择所在科室" v-model="modalForm.department_custom_id">
<a-option v-for="item in departmentData" :key="item.department_custom_id"
:value="item.department_custom_id"
:label="item.department_custom_name">{{item.department_custom_name}}</a-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item field="user_name" label="科室名称">
<a-input v-model="queryForm.dept_name" placeholder="请输入部门名称" />
<a-form-item field="department_custom_name" label="科室名称">
<a-input v-model="modalForm.department_custom_name" placeholder="请输入科室名称" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-form-item field="user_name" label="职 称">
<a-input v-model="queryForm.dept_name" placeholder="请输入部门名称" />
<a-form-item field="doctor_title" label="职 称 ">
<a-input v-model="doctor_title_name" placeholder="请输入职称" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item field="user_name" label="科室电话">
<a-input v-model="queryForm.dept_name" placeholder="请输入部门名称" />
<a-form-item field="department_custom_mobile" label="科室电话">
<a-input v-model="modalForm.department_custom_mobile" placeholder="请输入科室电话" />
</a-form-item>
</a-col>
</a-row>
<!-- <a-row :gutter="24">
<a-col :span="24">
<a-form-item field="license_cert_num" label="执业证编码:">
<a-input v-model="modalForm.license_cert.license_cert_num" placeholder="请输入部门名称" />
</a-form-item>
</a-col>
</a-row> -->
<a-row :gutter="24">
<a-col :span="24">
<a-form-item field="user_name" label="执业证编码">
<a-input v-model="queryForm.dept_name" placeholder="请输入部门名称" />
<a-form-item field="qualification_cert_num" label="资格证编码:">
<a-input v-model="modalForm.user_doctor_info.qualification_cert_num" placeholder="请输入部门名称" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<a-form-item field="user_name" label="资格证编码">
<a-input v-model="queryForm.dept_name" placeholder="请输入部门名称" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<a-form-item field="user_name" label="专长">
<a-form-item field="user_name" label="专长:">
<a-textarea v-model="modalForm.remark" placeholder="请输入备注内容" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<a-form-item field="user_name" label="擅长信息">
<a-textarea v-model="modalForm.remark" placeholder="请输入备注内容" />
<a-form-item field="be_good_at" label="擅长信息:">
<a-textarea v-model="modalForm.be_good_at" placeholder="请输入备注内容" />
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<a-form-item field="user_name" label="个人简介">
<a-textarea v-model="modalForm.remark" placeholder="请输入备注内容" />
<a-form-item field="brief_introduction" label="个人简介">
<a-textarea v-model="modalForm.brief_introduction" placeholder="请输入备注内容" />
</a-form-item>
</a-col>
</a-row>
@ -236,93 +234,93 @@
</div>
<a-row :gutter="24" style="margin-top: 35px;">
<a-col :span="4">
<a-form-item field="" label="状态">
<a-switch checked-color="#14C9C9" />
<a-form-item field="" label="状态:">
<a-space size="large">
<a-switch checked-color="#14C9C9" :checked-value="1" :unchecked-value="0"
v-model="modalForm.is_recommend" style="cursor: not-allowed!important;" />
</a-space>
</a-form-item>
</a-col>
<a-col :span="20"><div>理由平台合作</div></a-col>
<a-col :span="20" v-if="modalForm.is_recommend==1">
<div>理由平台合作</div>
</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-row :gutter="24" style="margin-top: 35px;"
v-if="modalForm.user_doctor_info.license_cert && modalForm.user_doctor_info.license_cert.length>0">
<a-col :span="24">
<a-form-item field="" label="" no-style>
<div class="titletip">医师执业证<span>(点击图片查看大图)</span></div>
<a-image-preview-group infinite>
<a-space>
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/cd7a1aaea8e1c5e3d26fe2591e561798.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/6480dbc69be1b5de95010289787d64f1.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/0265a04fddbd77a19602a15d9d55d797.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/24e0dd27418d2291b65db1b21aa62254.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image v-for="item in modalForm.user_doctor_info.license_cert" show-loader :src="item" />
</a-space>
</a-image-preview-group>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24" style="margin-top: 35px;">
<a-row :gutter="24" style="margin-top: 35px;"
v-if="modalForm.user_doctor_info.qualification_cert && modalForm.user_doctor_info.qualification_cert.length>0">
<a-col :span="24">
<a-form-item field="" label="" no-style>
<div class="titletip">医师资格证<span>(点击图片查看大图)</span></div>
<a-image-preview-group infinite>
<a-space>
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/cd7a1aaea8e1c5e3d26fe2591e561798.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/6480dbc69be1b5de95010289787d64f1.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/0265a04fddbd77a19602a15d9d55d797.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/24e0dd27418d2291b65db1b21aa62254.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image v-for="item in modalForm.user_doctor_info.license_cert" show-loader :src="item" />
</a-space>
</a-image-preview-group>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24" style="margin-top: 35px;">
<a-row :gutter="24" style="margin-top: 35px;"
v-if="modalForm.user_doctor_info.work_cert && modalForm.user_doctor_info.work_cert.length>0">
<a-col :span="24">
<a-form-item field="" label="" no-style>
<div class="titletip">医师职称证<span>(点击图片查看大图)</span></div>
<a-image-preview-group infinite>
<a-space>
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/cd7a1aaea8e1c5e3d26fe2591e561798.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/6480dbc69be1b5de95010289787d64f1.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/0265a04fddbd77a19602a15d9d55d797.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/24e0dd27418d2291b65db1b21aa62254.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image v-for="item in modalForm.user_doctor_info.work_cert" show-loader :src="item" />
</a-space>
</a-image-preview-group>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24" style="margin-top: 35px;">
<a-row :gutter="24" style="margin-top: 35px;"
v-if="modalForm.user_doctor_info.id_card_front || modalForm.user_doctor_info.id_card_back ">
<a-col :span="24">
<a-form-item field="" label="" no-style>
<div class="titletip">医师身份证<span>(点击图片查看大图)</span></div>
<a-image-preview-group infinite>
<a-space>
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/cd7a1aaea8e1c5e3d26fe2591e561798.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/6480dbc69be1b5de95010289787d64f1.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/0265a04fddbd77a19602a15d9d55d797.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/24e0dd27418d2291b65db1b21aa62254.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image
v-for="item in [modalForm.user_doctor_info.id_card_front,modalForm.user_doctor_info.id_card_back]"
show-loader :src="item" v-show="item" />
</a-space>
</a-image-preview-group>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24" style="margin-top: 35px;">
<a-row :gutter="24" style="margin-top: 35px;" v-if="modalForm.user_doctor_info.sign_image">
<a-col :span="24">
<a-form-item field="" label="" no-style>
<div class="titletip">医师手写签名<span>(点击图片查看大图)</span></div>
<a-image-preview-group infinite>
<a-space>
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/cd7a1aaea8e1c5e3d26fe2591e561798.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/6480dbc69be1b5de95010289787d64f1.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/0265a04fddbd77a19602a15d9d55d797.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/24e0dd27418d2291b65db1b21aa62254.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image v-for="item in [modalForm.user_doctor_info.sign_image]" show-loader :src="item"
v-show="item" />
</a-space>
</a-image-preview-group>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24" style="margin-top: 35px;">
<!-- <a-row :gutter="24" style="margin-top: 35px;">
<a-col :span="24">
<a-form-item field="" label="" no-style>
<div class="titletip">医师云证书<span>(点击图片查看大图)</span></div>
@ -336,23 +334,21 @@
</a-image-preview-group>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24" style="margin-top: 35px;">
</a-row> -->
<a-row :gutter="24" style="margin-top: 35px;" v-if="modalForm.qr_code">
<a-col :span="24">
<a-form-item field="" label="" no-style>
<div class="titletip">医师二维码<span>(点击图片查看大图)</span></div>
<a-image-preview-group infinite>
<a-space>
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/cd7a1aaea8e1c5e3d26fe2591e561798.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/6480dbc69be1b5de95010289787d64f1.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/0265a04fddbd77a19602a15d9d55d797.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image show-loader src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/24e0dd27418d2291b65db1b21aa62254.png~tplv-uwbnlip3yd-webp.webp" width="200" />
<a-image v-for="item in [modalForm.qr_code]" show-loader :src="item" v-show="item" width="200" />
</a-space>
</a-image-preview-group>
</a-form-item>
</a-col>
</a-row>
<a-divider />
</a-form>
<div class="titlebox">
<div class="bar"></div>
<div class="name">操作</div>
@ -361,41 +357,28 @@
<a-col :span="24">
<a-form-item field="" label="" no-style>
<a-space>
<a-button type="primary">保存</a-button>
<a-button type="primary" status="success" v-if="modalSatus=='detail'">启用</a-button>
<a-button type="primary" status="danger" v-if="modalSatus=='detail'">禁用</a-button>
<a-button type="primary" v-if="modalSatus=='edit'">保存</a-button>
<a-button type="primary" status="warning">拉黑</a-button>
<a-button type="primary" status="danger">删除</a-button>
<a-button type="primary" status="danger" v-if="modalSatus=='edit'">删除</a-button>
</a-space>
</a-form-item>
</a-col>
</a-row>
<!-- <a-form-item field="status" label="医生状态">
<a-radio-group v-model="modalForm.status">
<a-radio :value="2"> 正常 </a-radio>
<a-radio :value="1"> 停用 </a-radio>
</a-radio-group>
</a-form-item>
<a-form-item field="remark" label="备注">
<a-textarea v-model="modalForm.remark" placeholder="请输入备注内容" />
</a-form-item> -->
</a-form>
</a-modal>
<!-- Akiraka 20230223 删除与批量删除 开始 -->
<DeleteModal
:data="deleteData"
:visible="deleteVisible"
:apiDelete="removeDoctor"
@deleteVisibleChange="() => deleteVisible = false"
/>
<DeleteModal :data="deleteData" :visible="deleteVisible" :apiDelete="removeDoctor"
@deleteVisibleChange="() => deleteVisible = false" />
<!-- Akiraka 20230223 删除与批量删除 结束 -->
</div>
</template>
<script setup>
import { reactive, ref, getCurrentInstance, onMounted, nextTick, watch } from 'vue';
import { getDoctorList, addDoctor, removeDoctor, updateDoctor } from '@/api/doctor/list';
import { parseTime } from '@/utils/parseTime';
import { reactive, ref, getCurrentInstance, onMounted, nextTick, watch, computed } from 'vue';
import { getDoctorList, addDoctor, removeDoctor, updateDoctor, getDoctorDetail, departmentList, decryptCard, hospitalList } from '@/api/doctor/list';
import { ossSign, ossUpload } from '@/api/oss';
// Akiraka 20230210
const deleteData = ref([])
// Akiraka 20230210
@ -405,8 +388,9 @@
if (value == false) {
getDoctorInfo(pager);
}
})
});
const file = ref();
const { proxy } = getCurrentInstance();
const currentPage = ref(1);
@ -421,10 +405,23 @@
inquiry_service: ''
});
const modalForm = reactive({
sort: 0,
hospital: {},
user_doctor_info: {},
user: {},
doctor_id: '',
user_id: '',
status: 1,
});
watch(() => modalForm.user_id, (value) => {
if (value) {
handelDecryptCard(value);
}
});
const doctor_title_name = computed(() => {
let obj = { 1: '主任医师', 2: '主任中医师', 3: '副主任医师', 4: '副主任中医师', 5: '主治医师', 6: '住院医师' };
return obj[modalForm.doctor_title]
})
// Rules
const rules = {
user_name: [{ required: true, message: '请输入医生名字' }]
@ -455,24 +452,40 @@
// Table Data
const tableData = ref([]);
//
const modalSatus = ref('add');
//
// Satus
const handleAdd = () => {
modalVisible.value = true;
modalTitle.value = '新增医生';
modalSatus.value = 'add';
};
//
const handleDetail = () => {
const handleDetail = async (record) => {
modalVisible.value = true;
modalTitle.value = '医生详情';
modalSatus.value = 'detail';
const { code, data, message } = await getDoctorDetail(record.doctor_id);
if (code == 200) {
Object.assign(modalForm, data);
} else {
proxy.$notification.error(message);
}
};
//
const handleUpdate = async (record) => {
modalVisible.value = true;
modalTitle.value = '修改医生';
modalSatus.value = 'edit';
const { code, data, message } = await getDoctorDetail(record.doctor_id);
if (code == 200) {
Object.assign(modalForm, data);
} else {
proxy.$notification.error(message);
}
//await nextTick();
await nextTick();
Object.assign(modalForm, record);
};
//
const filterService = (record) => {
@ -497,7 +510,6 @@
str += ',' + item
}
})
return str ? str : "暂无"
}
// Modal ok
@ -591,15 +603,87 @@
getDoctorInfo(params);
};
const departmentData = ref([]);
//
const getDepartmentList = () => {
const { data, code, message } = departmentList();
if (code == 200) {
departmentData.value = data;
} else {
proxy.$notification.error(message);
}
};
//
const showEye = ref(false);
const id_card_num = ref('');
//
const handelDecryptCard = () => {
const { data, code, message } = decryptCard();
if (code == 200) {
id_card_num.value = data;
} else {
proxy.$notification.error(message);
}
};
//
const handleHospitalList = () => {
const { data, code, message } = hospitalList();
if (code == 200) {
//id_card_num.value = data;
} else {
proxy.$notification.error(message);
}
}
//
const handleResetQuery = () => {
proxy.$refs.queryFormRef.resetFields();
getDoctorInfo(queryForm);
}
//oss
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 formData = new FormData();
formData.append('OSSAccessKeyId',access_id);
formData.append('policy', policy);
formData.append('signature', signature);
formData.append('key',dir+filename);
formData.append('file',File,filename);
ossUpload(host,formData).then((res)=>{
console.log(res);
});
} else {
proxy.$notification.error(message);
}
}
//
const beforeUpload = (file) => {
return new Promise((resolve, reject) => {
if (file.size >= 10 * 1024 * 1024) {
proxy.$notification.error("图片大小不能超过10M");
reject('cancel')
} else {
resolve(true)
}
});
};
//
const onChangeFile = (fileList) => {
console.log(fileList)
getOssSign(1, fileList[0].file);
}
onMounted(() => {
getDoctorInfo(pager);
handleHospitalList();
getDepartmentList();
});
</script>
@ -607,18 +691,35 @@
.action {
margin-bottom: 12px;
}
.hospital_name {
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.headImg {
margin-right: 20px;
border-radius: 50%;
}
.arco-form-item-layout-horizontal:first-child {
align-items: center;
}
</style>
.upload {
margin-left: 20px;
}
.eye {
margin-left: 20px;
cursor: pointer;
font-size: 18px;
}
.box {
display: flex;
align-items: center;
}
</style>