Преглед на файлове

科企机构代码更换取得

guhongwei преди 3 години
родител
ревизия
4d9e1349a4

+ 22 - 17
src/layout/analysis/form-1.vue

@@ -55,7 +55,7 @@ export default {
     this.searchOther();
   },
   methods: {
-    ...adminLogin({ adminQuery: 'query' }),
+    ...adminLogin({ adminQuery: 'query', adminFetch: 'fetch' }),
     ...patentanalysis(['query', 'fetch', 'create', 'update']),
     async onSubmit(values) {
       if (values) {
@@ -72,22 +72,27 @@ export default {
       }
     },
     async searchOther() {
-      let res = await this.adminQuery({ code: 'JLKQadmin' });
-      if (this.$checkRes(res)) this.$set(this, `adminInfo`, res.data[0]);
-      let data = {
-        user_id: this.user._id,
-        user_name: this.user.name,
-        admin_id: this.adminInfo.id,
-        admin_name: this.adminInfo.name,
-        apply_name: this.user.name,
-        inventor: this.user.name,
-        contact: this.user.name,
-        phone: this.user.phone,
-        email: this.user.email,
-        questions: {},
-        status: '0',
-      };
-      this.$set(this, `form`, data);
+      let res = await this.adminQuery({ code: this.user.code });
+      if (this.$checkRes(res)) {
+        let arr = await this.adminFetch(res.data[0].pid);
+        if (this.$checkRes(arr)) {
+          this.$set(this, `adminInfo`, arr.data);
+          let data = {
+            user_id: this.user._id,
+            user_name: this.user.name,
+            admin_id: this.adminInfo.id,
+            admin_name: this.adminInfo.name,
+            apply_name: this.user.name,
+            inventor: this.user.name,
+            contact: this.user.name,
+            phone: this.user.phone,
+            email: this.user.email,
+            questions: {},
+            status: '0',
+          };
+          this.$set(this, `form`, data);
+        }
+      }
     },
   },
   computed: {

+ 6 - 3
src/layout/apply/form-1.vue

@@ -95,7 +95,7 @@ export default {
     await this.searchOther();
   },
   methods: {
-    ...adminLogin({ adminQuery: 'query' }),
+    ...adminLogin({ adminQuery: 'query', adminFetch: 'fetch' }),
     ...personal({ personalQuery: 'query' }),
     ...upload(['upload']),
     ...patentapply(['fetch', 'create', 'update']),
@@ -127,8 +127,11 @@ export default {
     // 查询其他信息
     async searchOther() {
       // 查询管理员信息
-      let res = await this.adminQuery({ code: 'JLKQadmin' });
-      if (this.$checkRes(res)) this.$set(this, `adminInfo`, res.data[0]);
+      let res = await this.adminQuery({ code: this.user.code });
+      if (this.$checkRes(res)) {
+        let arr = await this.adminFetch(res.data[0].pid);
+        if (this.$checkRes(arr)) this.$set(this, `adminInfo`, arr.data);
+      }
       // 查询机构
       res = await this.adminQuery({ role: '2', pid: this.adminInfo.id });
       if (this.$checkRes(res)) this.$set(this, `mechList`, res.data);

+ 3 - 3
src/layout/apply/form-2.vue

@@ -77,7 +77,7 @@ export default {
     await this.searchOther();
   },
   methods: {
-    ...adminLogin({ adminQuery: 'query' }),
+    ...adminLogin({ adminQuery: 'query', adminfetch: 'fetch' }),
     ...personal({ personalQuery: 'query' }),
     ...upload(['upload']),
     ...patentapply(['fetch', 'create', 'update']),
@@ -105,8 +105,8 @@ export default {
     // 查询其他信息
     async searchOther() {
       // 查询管理员信息
-      let res = await this.adminQuery({ code: 'JLKQadmin' });
-      if (this.$checkRes(res)) this.$set(this, `adminInfo`, res.data[0]);
+      let res = await this.adminfetch(this.user.pid);
+      if (this.$checkRes(res)) this.$set(this, `adminInfo`, res.data);
       // 查詢用戶
       let data = {
         user_id: this.user.id,

+ 1 - 1
src/layout/apply/mech-1.vue

@@ -86,7 +86,7 @@ export default {
     // 查询机构
     async changeStatus(type) {
       if (type == '2') {
-        let res = await this.adminQuery({ code: 'JLKQadmin' });
+        let res = await this.adminQuery({ role: '1' });
         if (this.$checkRes(res)) this.$set(this, `agentmechList`, res.data);
       } else if (type == '3') {
         let res = await this.agentmechQuery();

+ 6 - 3
src/layout/assessment/form-1.vue

@@ -92,7 +92,7 @@ export default {
     this.searchOther();
   },
   methods: {
-    ...adminLogin({ adminQuery: 'query' }),
+    ...adminLogin({ adminQuery: 'query', adminFetch: 'fetch' }),
     ...patentinfo({ patentQuery: 'query', patentFetch: 'fetch' }),
     ...patentassess(['fetch', 'create', 'update']),
     // 提交
@@ -139,8 +139,11 @@ export default {
     // 查询其他信息
     async searchOther() {
       // 查询管理员信息
-      let res = await this.adminQuery({ code: 'JLKQadmin' });
-      if (this.$checkRes(res)) this.$set(this, `adminInfo`, res.data[0]);
+      let res = await this.adminQuery({ code: this.user.code });
+      if (this.$checkRes(res)) {
+        let arr = await this.adminFetch(res.data[0].pid);
+        if (this.$checkRes(arr)) this.$set(this, `adminInfo`, arr.data);
+      }
     },
     // 查询专利信息
     async searchPatent() {

+ 5 - 3
src/layout/chatCommon/chat.vue

@@ -95,7 +95,7 @@ export default {
   },
   methods: {
     ...upload(['upload']),
-    ...adminLogin({ adminQuery: 'query' }),
+    ...adminLogin({ adminQuery: 'query', adminFetch: 'fetch' }),
     ...patentchat(['create', 'query']),
     // 查询
     async search() {
@@ -189,9 +189,11 @@ export default {
     },
     // 查询管理员
     async searchAdmin() {
-      let res = await this.adminQuery({ code: 'JLKQadmin' });
+      // 查询管理员信息
+      let res = await this.adminQuery({ code: this.user.code });
       if (this.$checkRes(res)) {
-        this.$set(this, `adminInfo`, res.data[0]);
+        let arr = await this.adminFetch(res.data[0].pid);
+        if (this.$checkRes(arr)) this.$set(this, `adminInfo`, arr.data);
       }
     },
   },

+ 1 - 1
src/layout/login/login-1.vue

@@ -73,7 +73,7 @@ export default {
     },
     // 查询其他信息
     async searchOther() {
-      let p1 = await this.query({ code: 'JLKQadmin' });
+      let p1 = await this.query({ role: '1' });
       if (this.$checkRes(p1)) {
         let p2 = await this.query({ role: '2', pid: p1.data[0].id });
         if (this.$checkRes(p2)) {

+ 4 - 3
src/views/patent/user/patent/safe/index.vue

@@ -84,7 +84,7 @@ export default {
   methods: {
     ...patentsafeg(['query', 'fetch', 'create', 'update']),
     ...patentinfo({ patentFetch: 'fetch' }),
-    ...adminLogin({ adminQuery: 'query' }),
+    ...adminLogin({ adminQuery: 'query', adminFetch: 'fetch' }),
     async search({ skip = 0, limit = this.limit, ...info } = {}) {
       let res = await this.query({ skip, limit, user_id: this.user._id, ...info });
       if (this.$checkRes(res)) {
@@ -109,9 +109,10 @@ export default {
     },
     // 查询用户
     async searchOther() {
-      let res = await this.adminQuery({ code: 'JLKQadmin' });
+      let res = await this.adminQuery({ code: this.user.code });
       if (this.$checkRes(res)) {
-        this.$set(this, `adminInfo`, res.data[0]);
+        let arr = await this.adminFetch(res.data[0].pid);
+        if (this.$checkRes(arr)) this.$set(this, `adminInfo`, arr.data);
         let data = {
           admin_id: this.adminInfo.id,
           user_id: this.user.id,