zs 2 éve
szülő
commit
60539e772b

+ 1 - 1
src/views/unit/applyflair/add.vue

@@ -101,7 +101,7 @@ const toBack = () => {
 // 数据选择
 const dataChange = ({ model, value }) => {
   if (model == 'studio_id') {
-    let data = studioList.value.find((i) => i.id == value);
+    let data = studioList.value.find((i) => i._id == value);
     if (data) form.value.studio_name = data.name;
   }
 };

+ 4 - 2
src/views/unit/applyflair/index.vue

@@ -111,8 +111,10 @@ const search = async (e: { skip: number; limit: number }) => {
     const { skip, limit } = e;
     let info = { limit: limit, skip: skip, ...searchForm.value, company_id: unitInfo.value._id };
     const res: IQueryResult = await applyflair.query(info);
-    tableData.value = res.data as any[];
-    total.value = res.total;
+    if (res.errcode == 0) {
+      tableData.value = res.data as any[];
+      total.value = res.total;
+    } else ElMessage({ type: 'warning', message: `${res.errmsg}` });
   } else {
     ElMessage({ type: 'warning', message: `用户未完成信息填报/信息填报未完成审核,无法查询相关信息` });
   }

+ 5 - 3
src/views/unit/builddesire/index.vue

@@ -146,8 +146,10 @@ const search = async (e: { skip: number; limit: number }) => {
     const { skip, limit } = e;
     let info = { limit: limit, skip: skip, ...searchForm.value, company_id: unitInfo.value._id };
     const res: IQueryResult = await builddesire.query(info);
-    tableData.value = res.data as any[];
-    total.value = res.total;
+    if (res.errcode == 0) {
+      tableData.value = res.data as any[];
+      total.value = res.total;
+    } else ElMessage({ type: 'warning', message: `${res.errmsg}` });
   } else {
     ElMessage({ type: 'warning', message: `用户未完成信息填报/信息填报未完成审核,无法查询相关信息` });
   }
@@ -166,7 +168,7 @@ const toAdd = () => {
   }
 };
 // 公开/不公开
-const toShow = async (data: { is_use: ''; _id: '' }) => {
+const toShow = (data: { is_use: ''; _id: '' }) => {
   form.value = data;
   dialog.value = { title: '信息管理', show: true, type: '1' };
 };

+ 3 - 1
src/views/unit/contactoffice/index.vue

@@ -16,6 +16,7 @@
 import partsSearch from '@/components/c-search.vue';
 import type { Ref } from 'vue';
 import { ref, onMounted } from 'vue';
+import { ElMessage } from 'element-plus';
 import { ContactofficeStore } from '@common/src/stores/studio/other/contactoffice'; // 联系处室
 import type { IQueryResult } from '@/util/types.util';
 const contactoffice = ContactofficeStore();
@@ -25,7 +26,8 @@ onMounted(async () => {
 });
 const search = async () => {
   const res: IQueryResult = await contactoffice.query();
-  form.value = res.data[0] as { content: string };
+  if (res.errcode == 0) form.value = res.data[0] as { content: string };
+  else ElMessage({ type: 'warning', message: `${res.errmsg}` });
 };
 </script>
 

+ 4 - 2
src/views/unit/demand/index.vue

@@ -123,8 +123,10 @@ const search = async (e: { skip: number; limit: number }) => {
     const { skip, limit } = e;
     let info = { limit: limit, skip: skip, ...searchForm.value, company_id: unitInfo.value._id };
     const res: IQueryResult = await techoldemand.query(info);
-    tableData.value = res.data as any[];
-    total.value = res.total;
+    if (res.errcode == 0) {
+      tableData.value = res.data as any[];
+      total.value = res.total;
+    } else ElMessage({ type: 'warning', message: `${res.errmsg}` });
   } else {
     ElMessage({ type: 'warning', message: `用户未完成信息填报/信息填报未完成审核,无法查询相关信息` });
   }

+ 3 - 1
src/views/unit/demand/info.vue

@@ -18,6 +18,7 @@ import demandInfo from '@/components/common/demand/info.vue';
 import { useRoute } from 'vue-router';
 import type { Ref } from 'vue';
 import { ref, onMounted } from 'vue';
+import { ElMessage } from 'element-plus';
 import { TecholdemandStore } from '@common/src/stores/studio/supplydemand/techoldemand'; // 列表
 import type { IQueryResult } from '@/util/types.util';
 const techoldemand = TecholdemandStore();
@@ -31,7 +32,8 @@ const search = async () => {
   if (route.query && route.query.id) {
     let id = route.query.id;
     const res: IQueryResult = await techoldemand.fetch(id);
-    info.value = res.data as {};
+    if (res.errcode == 0) info.value = res.data as {};
+    else ElMessage({ type: 'warning', message: `${res.errmsg}` });
   }
 };
 // 返回

+ 2 - 1
src/views/unit/scientist/add.vue

@@ -190,8 +190,9 @@ const search = async () => {
     let id = route.query.id;
     const res: IQueryResult = await scientistsettle.fetch(id);
     if (res.errcode == 0) {
-      if (res.data)
+      if (res.data) {
         form.value = res.data as { scientist_name: ''; user_id: ''; company: ''; zc: ''; fields: []; direction: []; settle_file: []; status: ''; team: [] };
+      }
     }
   } else {
     form.value = { ...data };

+ 4 - 2
src/views/unit/scientist/index.vue

@@ -100,8 +100,10 @@ const search = async (e: { skip: number; limit: number }) => {
     const { skip, limit } = e;
     let info = { limit: limit, skip: skip, ...searchForm.value, company_id: unitInfo.value._id };
     const res: IQueryResult = await scientistsettle.query(info);
-    tableData.value = res.data as any[];
-    total.value = res.total;
+    if (res.errcode == 0) {
+      tableData.value = res.data as any[];
+      total.value = res.total;
+    } else ElMessage({ type: 'warning', message: `${res.errmsg}` });
   } else {
     ElMessage({ type: 'warning', message: `用户未完成信息填报/信息填报未完成审核,无法查询相关信息` });
   }

+ 1 - 0
src/views/unit/studio/add.vue

@@ -114,6 +114,7 @@ const search = async () => {
       if (res.data) {
         res.data.team = await sarchTeam();
         form.value = res.data as { scientist_id: ''; scientistinfo_id: ''; scientist_name: ''; team: [] };
+        console.log(form.value);
       }
     }
   } else {

+ 4 - 2
src/views/unit/studio/index.vue

@@ -105,8 +105,10 @@ const search = async (e: { skip: number; limit: number }) => {
     const { skip, limit } = e;
     let info = { limit: limit, skip: skip, ...searchForm.value, company_id: unitInfo.value._id };
     const res: IQueryResult = await studio.query(info);
-    tableData.value = res.data as any[];
-    total.value = res.total;
+    if (res.errcode == 0) {
+      tableData.value = res.data as any[];
+      total.value = res.total;
+    } else ElMessage({ type: 'warning', message: `${res.errmsg}` });
   } else {
     ElMessage({ type: 'warning', message: `用户未完成信息填报/信息填报未完成审核,无法查询相关信息` });
   }

+ 3 - 3
src/views/unit/studio/parts/form-3.vue

@@ -47,12 +47,12 @@ const onChange = (e: { model: string; value: Array<[]> }) => {
 };
 // 提交
 const toSubmit = (formEl: FormInstance | undefined) => {
-  formEl.validate((valid) => {
+  if (!formEl) return;
+  formEl.validate((valid, fields) => {
     if (valid) {
       emit('toSubmit');
     } else {
-      console.log('error submit!');
-      return false;
+      console.log('error submit!', fields);
     }
   });
 };

+ 1 - 1
src/views/unit/yearreport/add.vue

@@ -101,7 +101,7 @@ const toBack = () => {
 // 数据选择
 const dataChange = ({ model, value }) => {
   if (model == 'studio_id') {
-    let data = studioList.value.find((i) => i.id == value);
+    let data = studioList.value.find((i) => i._id == value);
     if (data) form.value.studio_name = data.name;
   }
 };

+ 4 - 2
src/views/unit/yearreport/index.vue

@@ -111,8 +111,10 @@ const search = async (e: { skip: number; limit: number }) => {
     const { skip, limit } = e;
     let info = { limit: limit, skip: skip, ...searchForm.value, company_id: unitInfo.value._id };
     const res: IQueryResult = await yearreport.query(info);
-    tableData.value = res.data as any[];
-    total.value = res.total;
+    if (res.errcode == 0) {
+      tableData.value = res.data as any[];
+      total.value = res.total;
+    } else ElMessage({ type: 'warning', message: `${res.errmsg}` });
   } else {
     ElMessage({ type: 'warning', message: `用户未完成信息填报/信息填报未完成审核,无法查询相关信息` });
   }

+ 4 - 2
src/views/user/scientist/studio/index.vue

@@ -136,8 +136,10 @@ const search = async (e: { skip: number; limit: number }) => {
     const { skip, limit } = e;
     let info = { limit: limit, skip: skip, ...searchForm.value, user_id: userInfo.value.user_id };
     const res: IQueryResult = await scientistsettle.query(info);
-    tableData.value = res.data as any[];
-    total.value = res.total;
+    if (res.errcode == 0) {
+      tableData.value = res.data as any[];
+      total.value = res.total;
+    } else ElMessage({ type: 'warning', message: `${res.errmsg}` });
   } else {
     ElMessage({ type: 'warning', message: `用户未完成信息填报/信息填报未完成审核,无法查询相关信息` });
   }

+ 4 - 2
src/views/user/support/index.vue

@@ -123,8 +123,10 @@ const search = async (e: { skip: number; limit: number }) => {
     const { skip, limit } = e;
     let info = { limit: limit, skip: skip, ...searchForm.value, user_id: userInfo.value.user_id };
     const res: IQueryResult = await techolsupport.query(info);
-    tableData.value = res.data as any[];
-    total.value = res.total;
+    if (res.errcode == 0) {
+      tableData.value = res.data as any[];
+      total.value = res.total;
+    } else ElMessage({ type: 'warning', message: `${res.errmsg}` });
   } else {
     ElMessage({ type: 'warning', message: `用户未完成信息填报/信息填报未完成审核,无法查询相关信息` });
   }

+ 3 - 1
src/views/user/support/info.vue

@@ -18,6 +18,7 @@ import supportInfo from '@/components/common/support/info.vue';
 import { useRoute } from 'vue-router';
 import type { Ref } from 'vue';
 import { ref, onMounted } from 'vue';
+import { ElMessage } from 'element-plus';
 import { TecholsupportStore } from '@common/src/stores/studio/supplydemand/techolsupport'; // 列表
 import type { IQueryResult } from '@/util/types.util';
 const techolsupport = TecholsupportStore();
@@ -31,7 +32,8 @@ const search = async () => {
   if (route.query && route.query.id) {
     let id = route.query.id;
     const res: IQueryResult = await techolsupport.fetch(id);
-    info.value = res.data as {};
+    if (res.errcode == 0) info.value = res.data as {};
+    else ElMessage({ type: 'warning', message: `${res.errmsg}` });
   }
 };
 // 返回