字典更新

This commit is contained in:
zoujiandong 2023-10-27 17:34:06 +08:00
parent d46b581067
commit 5f40cb7d41
3 changed files with 235 additions and 10 deletions

View File

@ -32,4 +32,18 @@ export function applyCA(id){//申请证书
method: 'post',
data
})
}
}
export function getCA(){//获取云证书数据
return request({
url:'/admin/ca/cert/hospital',
method: 'get'
})
}
export function updateHospitalCA(){//更新证书
return request({
url:'/admin/ca/cert/hospital/renew',
method: 'put',
})
}

View File

@ -0,0 +1,210 @@
<template>
<div class="app-container">
<!-- table -->
<a-table :columns="columns" :data="tableData"
: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 #cert_application_time="{ record }">
<div><span >{{ parseTime(record.cert_application_time,'{y}-{m}-{d}')}}</span>-<span>{{parseTime(record.cert_expire_time,'{y}-{m}-{d}')}}</span></div>
</template>
<template #cert_name="{ record }">
<div>肝胆相照互联网医院签章</div>
</template>
<template #action="{ record }">
<a-space>
<a-button v-has="'admin:sysFamilyList:detail'" type="text"
@click="handleUpdateCA(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>
<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 { getCA,updateHospitalCA} from '@/api/doctor/ca';
import { parseTime } from '@/utils/parseTime';
import { Message } from '@arco-design/web-vue';
const okVisible = ref(false);
const file = ref();
const { proxy } = getCurrentInstance();
const currentPage = ref(1);
const queryForm = reactive({
});
const modalForm = reactive({
});
const pager = {
total: 1,
page: 1,
page_size: 10,
};
// Modal
const modalVisible = ref(false);
const modalTitle = ref('默认标题');
// Table Columns
const columns = [
{ title: '编号', dataIndex: 'doctor_id', slotName: 'doctor_id', width: '90' },
{ title: '名称', dataIndex: 'cert_name',slotName:'cert_name'},
{ title: '有效期', dataIndex: 'cert_application_time',slotName:'cert_application_time'},
{ title: '操作', slotName: 'action', fixed: "right", width: 180 },
];
// Table Data
const tableData = ref([]);
const handleUpdateCA=(record)=>{
updateHospitalCA().then(data=>{
let result=data.data;
if(result.code==200){
Message.success('证书更新成功');
}
})
}
/**
* 分页改变
* @param {Number} [page]
*/
const handlePageChange = (page) => {
pager.page = page;
//
currentPage.value = page;
getCAInfo({ ...pager, ...queryForm });
};
//
const handlepage_sizeChange = (page_size) => {
pager.page_size = page_size;
getCAInfo({ ...pager, ...queryForm });
};
//
const getCAInfo = async (params = {}) => {
const { data, code, message } = await getCA(params);
if (code == 200) {
tableData.value =[data];
}
};
//
const handleQuery = async () => {
pager.page = 1;
const params = {
page: pager.page,
page_size: pager.page_size,
...queryForm,
};
getCAInfo(params);
};
//
const handleResetQuery = () => {
proxy.$refs.queryFormRef.resetFields();
getCAInfo(queryForm);
}
onMounted(() => {
getCAInfo(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

@ -626,6 +626,7 @@
import { updateCA,removeCA,updateSign,applySign } from '@/api/doctor/ca';
import { ossSign, ossUpload } from '@/api/oss';
import { parseTime } from '@/utils/parseTime';
import { Message } from '@arco-design/web-vue';
import dayjs from 'dayjs'
// Akiraka 20230210
const deleteData = ref([])
@ -1133,7 +1134,7 @@
oldBackImg.value = id_card_back;
oldSignImg.value = sign_image;
if (modalForm.iden_auth_status == 2) {
proxy.$message.warning('正在审核中,暂时不能修改');
Message.warning('正在审核中,暂时不能修改');
}
if (data.doctor_expertise && data.doctor_expertise.length > 0) {
let arr = [];
@ -1150,7 +1151,7 @@
updateCA(modalForm.user_doctor_info.user_id).then(data=>{
let result=data.data;
if(result.code==200){
proxy.$message.success('证书更新成功');
Message.success('证书更新成功');
}
})
}
@ -1158,7 +1159,7 @@
removeCA(modalForm.user_doctor_info.user_id).then(data=>{
let result=data.data;
if(result.code==200){
proxy.$message.success('证书注销成功');
Message.success('证书注销成功');
}
})
}
@ -1169,7 +1170,7 @@
}).then(data=>{
let result=data.data;
if(result.code==200){
proxy.$message.success('签章申请成功');
Message.success('签章申请成功');
}
})
}
@ -1177,7 +1178,7 @@
updateSign(modalForm.user_doctor_info.user_id).then(data=>{
let result=data.data;
if(result.code==200){
proxy.$message.success('签章更新成功');
Message.success('签章更新成功');
}
})
}
@ -1327,7 +1328,7 @@
} else {
console.log(valid)
proxy.$message.error('表单校验失败');
Message.error('表单校验失败');
//done(false);
}
});
@ -1357,15 +1358,15 @@
hideCancel: false,
onOk: async () => {
const res = await removeDoctor({ ids: batchList });
proxy.$message.success(res.message);
Message.success(res.message);
getDoctorInfo(pager);
},
onCancel: () => {
proxy.$message.info('已取消批量删除数据');
Message.info('已取消批量删除数据');
},
});
} else {
proxy.$message.error('请勾选需要删除的数据!');
Message.error('请勾选需要删除的数据!');
}
};