pinina数据持久化
This commit is contained in:
parent
df6f3a3b2c
commit
75a18cf3ed
@ -24,6 +24,7 @@
|
||||
"js-cookie": "^3.0.5",
|
||||
"npm": "^9.6.6",
|
||||
"pinia": "^2.0.36",
|
||||
"pinia-plugin-persistedstate": "^3.1.0",
|
||||
"spinkit": "^2.0.1",
|
||||
"terser": "^5.19.1",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
|
||||
@ -53,6 +53,13 @@ export function getDoctorDetail(id){
|
||||
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',
|
||||
@ -66,4 +73,17 @@ export function getDoctorDetail(id){
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ const handleLogout = () => {
|
||||
onOk:async() => {
|
||||
const store = useUserStore();
|
||||
await store.userLogut();
|
||||
window.sessionStorage.removeItem('token');
|
||||
window.localStorage.removeItem('token');
|
||||
clearLocalStorage();
|
||||
proxy.$router.push('/login');
|
||||
},
|
||||
|
||||
@ -6,6 +6,7 @@ import { Message, Modal, Notification } from '@arco-design/web-vue';
|
||||
import '@arco-design/web-vue/dist/arco.css';
|
||||
import router from './router/';
|
||||
import { parseTime } from '@/utils/parseTime';
|
||||
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
|
||||
|
||||
// Directive
|
||||
import permission from '@/directive/permission/permission';
|
||||
@ -30,6 +31,7 @@ app.config.globalProperties.parseTime = parseTime;
|
||||
for(const name in ArcoIconModules){
|
||||
app.component(name,ArcoIconModules[name])
|
||||
}
|
||||
pinia.use(piniaPluginPersistedstate);
|
||||
app.use(Loading)
|
||||
app.use(ArcoVue);
|
||||
app.use(router);
|
||||
|
||||
@ -71,7 +71,7 @@ router.beforeEach(async (to, from, next) => {
|
||||
|
||||
// 获取系统配置信息
|
||||
await store.getSysConfig();
|
||||
console.log(permissionStore.addRouters.length)
|
||||
console.log(permissionStore.addRouters.length,store.token)
|
||||
// 判断用户Token是否获取
|
||||
if (to.name !== 'login' && !store.token) {
|
||||
next({ name: 'login' });
|
||||
|
||||
@ -71,4 +71,12 @@ export const usePermissionStore = defineStore('permisson', {
|
||||
this.menuList = [];
|
||||
}
|
||||
},
|
||||
// persist: {
|
||||
// // 修改存储中使用的键名称,默认为当前 Store的 id
|
||||
// key: 'permession',
|
||||
// // 修改为 sessionStorage,默认为 localStorage
|
||||
// // storage: window.sessionStorage,
|
||||
// // 按需持久化,默认不写会存储全部
|
||||
// //paths: ['token'],
|
||||
// }
|
||||
});
|
||||
|
||||
@ -8,11 +8,11 @@ import { getAppConfig } from '@/api/admin/login';
|
||||
export const useUserStore = defineStore('user', {
|
||||
state: () => {
|
||||
return {
|
||||
token: window.sessionStorage.getItem('token') || '',
|
||||
uid: window.sessionStorage.getItem('uid') || '',
|
||||
token: window.localStorage.getItem('token') || '',
|
||||
uid: window.localStorage.getItem('uid') || '',
|
||||
sysConfig: getLocalStorage('sysConfig'),
|
||||
buttonPermissions:[],
|
||||
userInfo:window.sessionStorage.getItem('manage-userInfo')?JSON.parse(window.sessionStorage.getItem('manage-userInfo')):''
|
||||
userInfo:window.localStorage.getItem('manage-userInfo')?JSON.parse(window.localStorage.getItem('manage-userInfo')):''
|
||||
}
|
||||
},
|
||||
// getters: {
|
||||
@ -22,27 +22,12 @@ export const useUserStore = defineStore('user', {
|
||||
setInfo(token,user) {
|
||||
this.token = token;
|
||||
this.userInfo=user;
|
||||
window.sessionStorage.setItem('token', token);
|
||||
window.localStorage.setItem('token', token);
|
||||
window.localStorage.setItem('uid',user.user_id);
|
||||
window.sessionStorage.setItem('manage-userInfo',JSON.stringify(user));
|
||||
window.localStorage.setItem('manage-userInfo',JSON.stringify(user));
|
||||
},
|
||||
// async getUserInfo() {
|
||||
// try {
|
||||
// const res = await getInfo();
|
||||
// // window.sessionStorage.setItem('uid', res.data.userId);
|
||||
// this.userInfo = res.data;
|
||||
|
||||
|
||||
|
||||
// } catch (err) {
|
||||
// console.error(err);
|
||||
// }
|
||||
// },
|
||||
async getSysConfig() {
|
||||
try {
|
||||
// const res = await getAppConfig();
|
||||
// setLocalStorage('sysConfig', res.data);
|
||||
//res.data;
|
||||
let data={sys_app_logo: "https://doc-image.zhangwj.com/img/go-admin.png", sys_app_name: "互联网医院后台管理"};
|
||||
setLocalStorage('sysConfig', data);
|
||||
this.sysConfig =data
|
||||
@ -61,5 +46,13 @@ export const useUserStore = defineStore('user', {
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
persist: {
|
||||
// 修改存储中使用的键名称,默认为当前 Store的 id
|
||||
key: 'token',
|
||||
// 修改为 localStorage,默认为 localStorage
|
||||
//storage: window.localStorage,
|
||||
// 按需持久化,默认不写会存储全部
|
||||
paths: ['token'],
|
||||
}
|
||||
})
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<a-button v-has="'admin:sysDept:edit'" type="text" @click="handleUpdate(record)"><icon-edit /> 修改</a-button>
|
||||
<a-button v-has="'admin:sysDept:add'" type="text" @click="handleAdd(record)"><icon-plus /> 新增</a-button>
|
||||
<a-button v-has="'admin:sysDept:add'" type="text" @click="handleAdd(record,'addson')"><icon-plus /> 新增</a-button>
|
||||
<a-button v-has="'admin:sysDept:remove'" type="text" @click="() => { deleteVisible = true; deleteData = [record.dept_id]; }"><icon-delete /> 删除</a-button>
|
||||
</template>
|
||||
</a-table>
|
||||
@ -57,7 +57,7 @@
|
||||
<a-form :model="modalForm" :rules="rules" ref="modalFormRef">
|
||||
<a-form-item field="parent_id" label="上级部门">
|
||||
<a-tree-select
|
||||
:disabled="(modalForm.parent_id && modalForm.parent_id==0)?true:false"
|
||||
:disabled="((modalForm.parent_id && modalForm.parent_id==0) || modalSatus=='addson')?true:false"
|
||||
v-model="modalForm.parent_id"
|
||||
:data="tableData"
|
||||
:field-names="{ key: 'dept_id', title: 'dept_name' }"
|
||||
@ -99,13 +99,14 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, onMounted, getCurrentInstance, nextTick, watch } from 'vue';
|
||||
import { reactive, ref, onMounted, getCurrentInstance, nextTick, watch,watchEffect } from 'vue';
|
||||
import { getDept, addDept, removeDept, updateDept } from '@/api/admin/sys-dept';
|
||||
|
||||
// Akiraka 20230210 删除数据
|
||||
const deleteData = ref([])
|
||||
// Akiraka 20230210 删除对话框
|
||||
const deleteVisible = ref(false)
|
||||
const deleteVisible = ref(false);
|
||||
const modalSatus = ref("add");
|
||||
// Akiraka 20230210 监听删除事件
|
||||
watch(() => deleteVisible.value ,(value) => {
|
||||
if ( value == false ) {
|
||||
@ -124,7 +125,19 @@ const queryForm = reactive({});
|
||||
const modalForm = reactive({
|
||||
status: 1,
|
||||
});
|
||||
// const parent_id=ref('');
|
||||
// watch(()=>modalForm.parent_id,()=>{
|
||||
// parent_id.value=modalForm.parent_id == 0?'无':modalForm.parent_id
|
||||
|
||||
// })
|
||||
// const parent_id=computed(()=>{
|
||||
|
||||
// if(modalForm.parent_id ==0){
|
||||
// return '无'
|
||||
// }else{
|
||||
// return modalForm.parent_id
|
||||
// }
|
||||
// })
|
||||
// rules
|
||||
const rules = {
|
||||
parent_id: [{ required: true, message: '请选择上级部门' }],
|
||||
@ -171,23 +184,43 @@ const handleResetQuery = () => {
|
||||
}
|
||||
|
||||
// 新增
|
||||
const handleAdd = ({ dept_id, dept_status = 2 } = {}) => {
|
||||
const handleAdd = ({ parent_id, dept_status = 2,dept_id } = {},type='') => {
|
||||
modalVisible.value = true;
|
||||
modalTitle.value = '新增部门';
|
||||
|
||||
if (dept_id){
|
||||
Object.assign(modalForm, {parent_id: dept_id, dept_status});
|
||||
modalSatus.value="add";
|
||||
let id=''
|
||||
if(type=='addson'){
|
||||
id=dept_id;
|
||||
modalSatus.value="addson";
|
||||
}else{
|
||||
modalSatus.value="add";
|
||||
id=parent_id;
|
||||
}
|
||||
if (parent_id || dept_id){
|
||||
Object.assign(modalForm, {parent_id: id, dept_status,dept_id});
|
||||
};
|
||||
|
||||
};
|
||||
const disabledSelect=(id,arr)=>{
|
||||
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if(arr[i].dept_id==id){
|
||||
arr[i].disabled=true;
|
||||
break;
|
||||
}
|
||||
if(arr[i].children){
|
||||
disabledSelect(id,arr[i].children);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 修改
|
||||
const handleUpdate = async (record) => {
|
||||
modalVisible.value = true;
|
||||
modalTitle.value = '修改部门信息';
|
||||
|
||||
modalSatus.value="edit";
|
||||
//await nextTick();
|
||||
const { parent_id, dept_name, leader, phone, email, dept_status, dept_id } = record;
|
||||
|
||||
disabledSelect(dept_id,tableData.value);
|
||||
Object.assign(modalForm,{
|
||||
parent_id,
|
||||
dept_name,
|
||||
@ -221,7 +254,7 @@ const handleBeforeOk = (done) => {
|
||||
proxy.$refs.modalFormRef.validate(async (err) => {
|
||||
if (!err) {
|
||||
let res;
|
||||
if (Reflect.has(modalForm, 'dept_id')) {
|
||||
if (modalSatus.value=="edit") {
|
||||
const { code, message } = await updateDept(modalForm, modalForm.dept_id);
|
||||
if (code == 200 ) {
|
||||
proxy.$notification.success('修改成功');
|
||||
@ -229,7 +262,10 @@ const handleBeforeOk = (done) => {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
} else {
|
||||
const { code, message } = await addDept(modalForm);
|
||||
const { code, message } = await addDept({
|
||||
parent_id:modalForm.parent_id,
|
||||
dept_name:modalForm.dept_name
|
||||
});
|
||||
if (code == 200 ) {
|
||||
proxy.$notification.success('新增成功');
|
||||
} else {
|
||||
|
||||
@ -596,8 +596,6 @@
|
||||
})
|
||||
modalForm.cur_doctor_expertise = arr;
|
||||
}
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
};
|
||||
const changeReason=(value)=>{
|
||||
@ -656,8 +654,6 @@
|
||||
if (code == 200) {
|
||||
tableData.value = data.data;
|
||||
Object.assign(pager, { total: data.total, page: data.page, page_size: data.page_size });
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
};
|
||||
|
||||
@ -682,9 +678,7 @@
|
||||
const { data, code, message } = res;
|
||||
if (code == 200) {
|
||||
departmentData.value = data;
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
//切换小眼睛
|
||||
@ -698,8 +692,6 @@
|
||||
});
|
||||
if (code == 200) {
|
||||
id_card_num.value = data;
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
};
|
||||
const hospitalData = ref([]);
|
||||
@ -709,8 +701,6 @@
|
||||
const { data, code, message } = res;
|
||||
if (code == 200) {
|
||||
hospitalData.value = data;
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
});
|
||||
|
||||
@ -722,8 +712,6 @@
|
||||
const { data, code, message } = res;
|
||||
if (code == 200) {
|
||||
expertiseData.value = data;
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -734,10 +722,11 @@
|
||||
const {code,message,data}= await checkDoctor(modalCheckForm,modalForm.doctor_id);
|
||||
if (code == 200) {
|
||||
proxy.$notification.success("提交成功");
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
getDoctorInfo(pager);
|
||||
modalVisible.value=false;
|
||||
}
|
||||
done();
|
||||
|
||||
} else {
|
||||
console.log(valid)
|
||||
proxy.$message.error('表单校验失败');
|
||||
@ -772,9 +761,10 @@
|
||||
},modalForm.doctor_id);
|
||||
if (code == 200) {
|
||||
proxy.$notification.success("审核通过");
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
getDoctorInfo(pager);
|
||||
modalVisible.value=false;
|
||||
}
|
||||
|
||||
}else{
|
||||
modalCheckForm.iden_auth_status=3;
|
||||
modalCheckVisible.value=true;
|
||||
|
||||
@ -189,9 +189,9 @@
|
||||
<a-col :span="12">
|
||||
<a-form-item field="hospital.hospital_name" label="医院名称:">
|
||||
<a-space direction="vertical" size="large">
|
||||
<a-select allow-search placeholder="请选择所在医院" v-model="modalForm.hospital.hospital_name" :loading="loading" @change="changeHospital" @search="handleHospitalList" >
|
||||
<a-option v-for="item in hospitalData" :key="item.hospital_id" :value="item.hospital_id"
|
||||
:label="item.hospital_name"></a-option>
|
||||
<a-select :style="{width:'400px'}" allow-search placeholder="请选择所在医院" v-model="modalForm.hospital.hospital_name" :loading="loading" @change="changeHospital" @search="handleHospitalList" >
|
||||
<a-option size="large" style="max-width:500px" v-for="item in hospitalData" :key="item.hospital_id" :value="item.hospital_id"
|
||||
:label="item.hospital_name+'—'+item.province+item.city+item.county"></a-option>
|
||||
</a-select>
|
||||
</a-space>
|
||||
<!-- <a-input v-model="modalForm.hospital.hospital_name" placeholder="请输入医院名称" /> -->
|
||||
@ -311,6 +311,53 @@
|
||||
</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="doctor_bank_card.province_id" label="开户银行所在地:">
|
||||
<a-space size="large" style="margin-right: 12px;">
|
||||
省<a-select v-model="modalForm.doctor_bank_card.province_id">
|
||||
<a-option v-for="item in provinceData" :key="item.area_id" :value="Number(item.area_id)"
|
||||
:label="item.area_name">{{item.area_name}}</a-option>
|
||||
</a-select>
|
||||
</a-space>
|
||||
<a-space size="large" style="margin-right: 12px;">
|
||||
市<a-select v-model="modalForm.doctor_bank_card.city_id">
|
||||
<a-option v-for="item in cityData" :key="item.area_id" :value="Number(item.area_id)"
|
||||
:label="item.area_name">{{item.area_name}}</a-option>
|
||||
</a-select>
|
||||
</a-space>
|
||||
<a-space size="large">
|
||||
区<a-select v-model="modalForm.doctor_bank_card.county_id">
|
||||
<a-option v-for="item in countryData" :key="item.area_id" :value="Number(item.area_id)"
|
||||
:label="item.area_name">{{item.area_name}}</a-option>
|
||||
</a-select>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item field="doctor_bank_card.bank_id" label="开户银行:">
|
||||
<a-space size="large" >
|
||||
<a-select v-model="modalForm.doctor_bank_card.bank_id" :style="{width:'220px'}">
|
||||
<a-option v-for="item in bankData" :key="item.bank_id" :value="item.bank_id"
|
||||
:label="item.bank_name"></a-option>
|
||||
</a-select>
|
||||
</a-space>
|
||||
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item field="bank_card_code" label="银行卡号:">
|
||||
<a-input v-model="modalForm.bank_card_code" placeholder="请输入银行卡号" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<div class="titlebox">
|
||||
<div class="bar"></div>
|
||||
<div class="name">医师证件</div>
|
||||
@ -453,7 +500,7 @@
|
||||
<a-col :span="24">
|
||||
<a-form-item field="" label="" no-style>
|
||||
<a-space v-if="modalSatus!='detail'" style="margin-right: 8px;">
|
||||
<a-button type="primary" @click="handleSubmit">保存</a-button>
|
||||
<a-button type="primary" @click="()=>okVisible=true">保存</a-button>
|
||||
</a-space>
|
||||
<!-- <a-space v-if="modalSatus=='edit'">
|
||||
<a-button type="primary" status="warning">拉黑</a-button>
|
||||
@ -468,12 +515,18 @@
|
||||
<DeleteModal :data="deleteData" :visible="deleteVisible" :apiDelete="removeDoctor"
|
||||
@deleteVisibleChange="() => deleteVisible = false" />
|
||||
<!-- Akiraka 20230223 删除与批量删除 结束 -->
|
||||
<a-modal v-model:visible="okVisible" :modal-style="{width:'320px'}" body-class="okmodal" @ok="handleSubmit" @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 { getDoctorList, addDoctor, removeDoctor, updateDoctor, getDoctorDetail, departmentList, decryptCard, hospitalList, expertiseList } from '@/api/doctor/list';
|
||||
import { getDoctorList, addDoctor, removeDoctor, updateDoctor, getDoctorDetail, departmentList, decryptCard, hospitalList, expertiseList,areaList,bankList,decryptBank} from '@/api/doctor/list';
|
||||
import { ossSign, ossUpload } from '@/api/oss';
|
||||
import dayjs from 'dayjs'
|
||||
// Akiraka 20230210 删除数据
|
||||
@ -481,6 +534,8 @@
|
||||
// Akiraka 20230210 删除对话框
|
||||
const deleteVisible = ref(false)
|
||||
// Akiraka 20230210 监听删除事件
|
||||
const okVisible=ref(false);
|
||||
|
||||
watch(() => deleteVisible.value, (value) => {
|
||||
if (value == false) {
|
||||
getDoctorInfo(pager);
|
||||
@ -492,6 +547,7 @@
|
||||
const { proxy } = getCurrentInstance();
|
||||
const currentPage = ref(1);
|
||||
const loading = ref(false);
|
||||
|
||||
// Pager
|
||||
const pager = {
|
||||
total: 0,
|
||||
@ -506,6 +562,12 @@
|
||||
hospital: {},
|
||||
user_doctor_info: {
|
||||
|
||||
},
|
||||
doctor_bank_card:{
|
||||
bank_card_province_id:'',
|
||||
bank_card_city_id:'',
|
||||
bank_card_county_id:'',
|
||||
bank_id:''
|
||||
},
|
||||
user: {},
|
||||
doctor_id: '',
|
||||
@ -520,7 +582,8 @@
|
||||
sign_image: '',
|
||||
card_num: null,
|
||||
cur_doctor_expertise: [],
|
||||
avatar: 'https://img.applets.igandanyiyuan.com/basic/file/doctor_avatar.png'
|
||||
avatar: 'https://img.applets.igandanyiyuan.com/basic/file/doctor_avatar.png',
|
||||
bank_card_code:'',
|
||||
});
|
||||
|
||||
//const doctor_expertise=ref([]);
|
||||
@ -836,10 +899,9 @@
|
||||
data.doctor_expertise.forEach((item) => {
|
||||
arr.push(item.expertise_id)
|
||||
})
|
||||
handleDecryptBank();
|
||||
modalForm.cur_doctor_expertise = arr;
|
||||
}
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
};
|
||||
// 修改
|
||||
@ -850,6 +912,7 @@
|
||||
const { code, data, message } = await getDoctorDetail(record.doctor_id);
|
||||
if (code == 200) {
|
||||
Object.assign(modalForm, data);
|
||||
handleDecryptBank();
|
||||
if(!data.user_doctor_info){
|
||||
data.user_doctor_info={};
|
||||
modalForm.user_doctor_info={};
|
||||
@ -874,8 +937,6 @@
|
||||
})
|
||||
modalForm.cur_doctor_expertise = arr;
|
||||
}
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
//await nextTick();
|
||||
|
||||
@ -934,14 +995,17 @@
|
||||
card_num: modalForm.card_num,
|
||||
doctor_expertise: modalForm.cur_doctor_expertise,
|
||||
is_platform_deep_cooperation: modalForm.is_platform_deep_cooperation,
|
||||
is_sys_diagno_cooperation: modalForm.is_sys_diagno_cooperation
|
||||
is_sys_diagno_cooperation: modalForm.is_sys_diagno_cooperation,
|
||||
bank_card_code: modalForm.bank_card_code,
|
||||
bank_card_province_id:modalForm.doctor_bank_card,
|
||||
bank_card_city_id:modalForm.doctor_bank_card.bank_card_city_id,
|
||||
bank_card_county_id:modalForm.doctor_bank_card.bank_card_county_id,
|
||||
bank_id:modalForm.doctor_bank_card.bank_id
|
||||
}
|
||||
if (!modalForm.doctor_id) {
|
||||
const { code, message } = await addDoctor(modalData);
|
||||
if (code == 200) {
|
||||
proxy.$notification.success('新增成功');
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
} else {
|
||||
if(oldFrontImg.value && !modalForm.id_card_front){
|
||||
@ -956,16 +1020,32 @@
|
||||
proxy.$notification.error("请上传医师手写签名照片");
|
||||
return false
|
||||
};
|
||||
|
||||
if(modalForm.id_card_front && modalForm.id_card_back && modalForm.sign_image){
|
||||
if(modalForm.doctor_bank_card){
|
||||
if(!modalForm.doctor_bank_card.province_id || !modalForm.doctor_bank_card.city_id || !modalForm.doctor_bank_card.county_id){
|
||||
proxy.$notification.error("请选择开户银行所在地省市区信息");
|
||||
return false
|
||||
};
|
||||
if(!modalForm.doctor_bank_card.bank_id){
|
||||
proxy.$notification.error("请选择开户银行");
|
||||
return false
|
||||
};
|
||||
|
||||
};
|
||||
if(!modalForm.bank_card_code){
|
||||
proxy.$notification.error("请输入银行卡号");
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
const { code, message } = await updateDoctor(modalData, modalForm.doctor_id);
|
||||
if (code == 200) {
|
||||
proxy.$notification.success('更新成功');
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
}
|
||||
//done();
|
||||
//getDoctorInfo(pager);
|
||||
getDoctorInfo(pager);
|
||||
modalVisible.value = false;
|
||||
} else {
|
||||
console.log(valid)
|
||||
proxy.$message.error('表单校验失败');
|
||||
@ -1019,8 +1099,6 @@
|
||||
if (code == 200) {
|
||||
tableData.value = data.data;
|
||||
Object.assign(pager, { total: data.total, page: data.page, page_size: data.page_size });
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1042,9 +1120,7 @@
|
||||
const { data, code, message } = res;
|
||||
if (code == 200) {
|
||||
departmentData.value = data;
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
//切换小眼睛
|
||||
@ -1058,8 +1134,6 @@
|
||||
});
|
||||
if (code == 200) {
|
||||
id_card_num.value = data;
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
};
|
||||
const hospitalData = ref([]);
|
||||
@ -1077,9 +1151,7 @@
|
||||
|
||||
hospitalData.value =data;
|
||||
loading.value = false;
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@ -1090,11 +1162,55 @@
|
||||
const { data, code, message } = res;
|
||||
if (code == 200) {
|
||||
expertiseData.value = data;
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
})
|
||||
}
|
||||
const provinceData=ref([]);
|
||||
const cityData=ref([]);
|
||||
const countryData=ref([]);
|
||||
//获取区域列表
|
||||
const handelAreaList=(area_id='',parent_id='',area_type)=>{
|
||||
areaList({
|
||||
area_id,
|
||||
area_type,
|
||||
parent_id
|
||||
}).then((res)=>{
|
||||
const { data, code, message } = res;
|
||||
if (code == 200) {
|
||||
if(area_type==2){
|
||||
provinceData.value = data;
|
||||
handelAreaList('',data[0].area_id,3)
|
||||
}
|
||||
|
||||
if(area_type==3){
|
||||
cityData.value=data;
|
||||
handelAreaList('',data[0].area_id,4)
|
||||
};
|
||||
if(area_type==4){
|
||||
countryData.value=data;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleDecryptBank=()=>{
|
||||
decryptBank(modalForm.doctor_id).then((res)=>{
|
||||
const { data, code, message } = res;
|
||||
if(code==200){
|
||||
modalForm.bank_card_code=data;
|
||||
}
|
||||
})
|
||||
}
|
||||
const bankData=ref([])
|
||||
const handleBankList=()=>{
|
||||
bankList().then((res)=>{
|
||||
const { data, code, message } = res;
|
||||
if(code==200){
|
||||
bankData.value=data;
|
||||
}
|
||||
})
|
||||
}
|
||||
// 重置搜索
|
||||
const handleResetQuery = () => {
|
||||
proxy.$refs.queryFormRef.resetFields();
|
||||
@ -1122,8 +1238,6 @@
|
||||
modalForm.avatar = host + "/" + dir + time + filename;
|
||||
});
|
||||
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
}
|
||||
//上传前验证
|
||||
@ -1137,6 +1251,8 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
const handleOk=()=>{
|
||||
}
|
||||
//上传文件
|
||||
const onChangeFile = (fileList) => {
|
||||
|
||||
@ -1147,6 +1263,9 @@
|
||||
handleHospitalList();
|
||||
getDepartmentList();
|
||||
handlExpertiseList();
|
||||
handelAreaList("","",2);
|
||||
handleBankList();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -1154,7 +1273,9 @@
|
||||
.action {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.okmodal div{
|
||||
text-align: center;
|
||||
}
|
||||
.hospital_name {
|
||||
width: 140px;
|
||||
white-space: nowrap;
|
||||
|
||||
@ -390,9 +390,7 @@
|
||||
})
|
||||
modalForm.cur_doctor_expertise = arr;
|
||||
}
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//开启服务处理
|
||||
@ -444,8 +442,6 @@
|
||||
if (code == 200) {
|
||||
tableData.value = data.data;
|
||||
Object.assign(pager, { total: data.total, page: data.page, page_size: data.page_size });
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
};
|
||||
|
||||
@ -470,9 +466,7 @@
|
||||
const { data, code, message } = res;
|
||||
if (code == 200) {
|
||||
departmentData.value = data;
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
//切换小眼睛
|
||||
@ -486,8 +480,6 @@
|
||||
});
|
||||
if (code == 200) {
|
||||
id_card_num.value = data;
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
};
|
||||
const hospitalData = ref([]);
|
||||
@ -497,8 +489,6 @@
|
||||
const { data, code, message } = res;
|
||||
if (code == 200) {
|
||||
hospitalData.value = data;
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
});
|
||||
|
||||
@ -510,8 +500,6 @@
|
||||
const { data, code, message } = res;
|
||||
if (code == 200) {
|
||||
expertiseData.value = data;
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -525,10 +513,11 @@
|
||||
},modalForm.doctor_id);
|
||||
if (code == 200) {
|
||||
proxy.$notification.success("提交成功");
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
modalVisible.value=false;
|
||||
}
|
||||
done();
|
||||
getDoctorInfo(pager);
|
||||
|
||||
} else {
|
||||
console.log(valid)
|
||||
proxy.$message.error('表单校验失败');
|
||||
@ -539,15 +528,15 @@
|
||||
//审核
|
||||
const handleCheck= async(type)=>{
|
||||
if(type=="ok"){
|
||||
|
||||
const {code,message,data}= await checkDoctor({
|
||||
multi_point_status:1
|
||||
},modalForm.doctor_id);
|
||||
if (code == 200) {
|
||||
proxy.$notification.success("审核通过");
|
||||
} else {
|
||||
proxy.$notification.error(message);
|
||||
}
|
||||
modalVisible.value=false;
|
||||
};
|
||||
getDoctorInfo(pager);
|
||||
|
||||
}else{
|
||||
modalCheckVisible.value=true;
|
||||
}
|
||||
|
||||
@ -153,9 +153,7 @@ const handleLogin = () => {
|
||||
// proxy.$router.push(path);
|
||||
// loading.value = false;
|
||||
// },500);
|
||||
} else {
|
||||
proxy.$message.error(`登陆失败:${message}`);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
// 登录失败 重新获取验证码
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user