zs hace 1 año
padre
commit
0bed3f2810

+ 5 - 11
src/views/acccount/information/index.vue

@@ -7,9 +7,6 @@
             <template #role>
               <el-option v-for="i in roleList" :key="i._id" :label="i.name" :value="i._id"></el-option>
             </template>
-            <template #region>
-              <el-option v-for="i in regionList" :key="i._id" :label="i.name" :value="i._id"></el-option>
-            </template>
           </cForm>
         </el-col>
       </el-col>
@@ -25,15 +22,17 @@ import { ref, reactive, onMounted } from 'vue';
 import { ElMessage } from 'element-plus';
 import type { FormRules } from 'element-plus';
 // 接口
-import { AdminStore } from '@/stores/users/admin';
+import { AdminStore } from '@/stores/users/admin'; // 管理员
+import { DoctorStore } from '@/stores/users/doctor'; //医生
+import { NurseStore } from '@/stores/users/nurse'; //护士
 import { RoleStore } from '@/stores/basic/role'; // 角色
-import { RegionStore } from '@/stores/basic/region'; // 区域
 import { DictDataStore } from '@/stores/basic/dictData'; // 字典表
 import type { IQueryResult } from '@/util/types.util';
 const adminAxios = AdminStore();
+const doctorAxios = DoctorStore();
+const nurseAxios = NurseStore();
 const dictAxios = DictDataStore();
 const roleAxios = RoleStore();
-const regionAxios = RegionStore();
 let user: Ref<any> = ref(store.state.user);
 // 加载中
 const loading: Ref<any> = ref(false);
@@ -44,7 +43,6 @@ let fields: Ref<any[]> = ref([
   { label: '姓名', model: 'name' },
   { label: '手机号', model: 'phone' },
   { label: '角色', model: 'role', type: 'select' },
-  { label: '区域', model: 'region', type: 'select' }
 ]);
 const rules = reactive<FormRules>({
   name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
@@ -53,7 +51,6 @@ const rules = reactive<FormRules>({
 });
 // 字典表
 const roleList: Ref<any> = ref([]);
-const regionList: Ref<any> = ref([]);
 const statusList: Ref<any> = ref([]);
 // 请求
 onMounted(async () => {
@@ -88,9 +85,6 @@ const searchOther = async () => {
   // 状态
   res = await dictAxios.query({ type: 'exam_status', is_use: '0' });
   if (res.errcode == '0') statusList.value = res.data;
-  // 区域
-  res = await regionAxios.query({ is_use: '0' });
-  if (res.errcode == '0') regionList.value = res.data;
 };
 // 返回上一页
 const toBack = () => {

+ 8 - 1
src/views/acccount/updatepd/index.vue

@@ -19,8 +19,12 @@ import { ElMessage } from 'element-plus';
 import { useRouter } from 'vue-router';
 // 接口
 import { AdminStore } from '@/stores/users/admin'; // 管理员
+import { DoctorStore } from '@/stores/users/doctor'; //医生
+import { NurseStore } from '@/stores/users/nurse'; //护士
 import type { IQueryResult } from '@/util/types.util';
 const adminAxios = AdminStore();
+const doctorAxios = DoctorStore();
+const nurseAxios = NurseStore();
 // 加载中
 const loading: Ref<any> = ref(false);
 // 路由
@@ -55,7 +59,10 @@ onMounted(async () => {
 // 提交保存
 const toSave = async (data: any) => {
   let user: any = store.state.user;
-  let res: IQueryResult = await adminAxios.rp({ _id: user._id, password: data.password });
+  let res: IQueryResult;
+  if (user.type == '0') await adminAxios.rp({ _id: user._id, password: data.password }); //管理员
+  else if (user.type == '1') await doctorAxios.rp({ _id: user._id, password: data.password }); //医生
+  else res = await nurseAxios.rp({ _id: user._id, password: data.password }); //护士
   if (res.errcode == '0') {
     ElMessage({ type: 'success', message: '修改密码成功' });
     // 退出登录

+ 7 - 6
src/views/login/index.vue

@@ -50,9 +50,9 @@ import { useRouter } from 'vue-router';
 import { siteInfo } from '@/layout/site';
 
 // 接口
-import { AdminStore } from '@/stores/users/admin';
-import { DoctorStore } from '@/stores/users/doctor';
-import { NurseStore } from '@/stores/users/nurse';
+import { AdminStore } from '@/stores/users/admin'; // 管理员
+import { DoctorStore } from '@/stores/users/doctor'; //医生
+import { NurseStore } from '@/stores/users/nurse'; //护士
 import type { IQueryResult } from '@/util/types.util';
 const adminAxios = AdminStore();
 const doctorAxios = DoctorStore();
@@ -106,9 +106,10 @@ const toSave = async (formEl: FormInstance) => {
 };
 const toLogin = async (data: formData) => {
   let res: IQueryResult;
-  if (data.type == '0') res = await adminAxios.login(data); //管理员
-  else if (data.type == '1') res = await doctorAxios.login(data); //医生
-  else res = await nurseAxios.login(data); //护士
+  const form = { account: data.account, password: data.password };
+  if (data.type == '0') res = await adminAxios.login(form); //管理员
+  else if (data.type == '1') res = await doctorAxios.login(form); //医生
+  else res = await nurseAxios.login(form); //护士
   if (res.errcode == '0') {
     loading.value = true;
     ElMessage({ message: `登录成功`, type: 'success' });

+ 1 - 1
vite.config.ts

@@ -19,7 +19,7 @@ export default defineConfig(({ mode }) => {
           changeOrigin: true
         },
         '/follow/v1/api': {
-          target: 'http://192.168.1.113:14001',
+          target: 'http://192.168.1.113:8890',
           changeOrigin: true,
           ws: false
         }