Forráskód Böngészése

同步获取企业基本信息

liuxiangqi 1 éve%!(EXTRA string=óta)
szülő
commit
2d8427d055

+ 25 - 29
src/views/enterprise/project/components/EntBasic.vue

@@ -72,7 +72,7 @@
             <el-cascader
                 v-model="form.industryArray"
                 :options="options"
-                @change="handleChange" :disabled="disabledVisible" style="width: 310px;"></el-cascader>
+                :disabled="disabledVisible" style="width: 310px;"></el-cascader>
           </el-form-item>
         </el-col>
         <el-col :span="12">
@@ -296,34 +296,43 @@ export default {
     this.form.id = this.$route.query.id || undefined;
     this.form.entId = this.$route.query.entId || undefined;
     if(this.form.id) {
-      this.getData()
+      this.getData().then(res => {
+        this.getEntData()
+      })
     }
     if(this.userType == 'ENT_ADMIN') {
       this.disabledVisible = false
     }else {
       this.disabledVisible = true
     }
-    setTimeout(() => {        // 加延时
-      this.getEntData()
-    }, 500);
   },
   methods: {
-    handleChange(e) {
-      console.log(e)
-    },
-    getEntData() {
+    async getEntData() {
       listEntUserApi().then(res => {
-        this.form.entName = res.data.entName
-        this.form.linkName = res.data.linkName
-        this.form.linkPhone = res.data.linkPhone
-        this.form.linkMobile = res.data.linkMobile
-        this.form.techFlag = res.data.techFlag
+        console.log(this.form, "this.form")
+        if(!this.form.entName) {
+          this.form.entName = res.data.entName
+        }
+        if(!this.form.linkName) {
+          this.form.linkName = res.data.linkName
+        }
+        if(!this.form.linkPhone) {
+          console.log("this.form.linkPhone")
+          this.form.linkPhone = res.data.linkPhone
+        }
+        if(!this.form.linkMobile) {
+          this.form.linkMobile = res.data.linkMobile
+        }
+        if(!this.form.techFlag) {
+          this.form.techFlag = res.data.techFlag
+        }
       })
     },
-    getData() {
+    async getData() {
       getProjectInfoApi(this.form.id).then(res => {
         let obj = res.data.entProject || {}
         this.form = obj || {}
+        // if(obj.)
         this.form.fileName = '高新证书'
         let arr = ['电子信息']
         this.$set(this.form, 'techScopeArray', arr)
@@ -331,23 +340,14 @@ export default {
           let industryArray = this.form.industry.split(',') || [];
           this.$set(this.form, 'industryArray', industryArray);
         }
-
         if(obj.techScope) {
           this.form.techScopeArray = obj.techScope.split(',') || ['电子信息']
         }
-
         if(obj.projectStartDate) {
           this.$set(this.form, 'projectTime',[obj.projectStartDate,obj.projectEndDate])
-          // this.form.projectTime = []
-          // this.form.projectTime[0] = obj.projectStartDate
-          // this.form.projectTime[1] = obj.projectEndDate
         }
-
         if(obj.techStartDate) {
           this.$set(this.form, 'lisenceTime',[obj.techStartDate,obj.techEndDate])
-          // this.form.lisenceTime = []
-          // this.form.lisenceTime[0] = obj.techStartDate
-          // this.form.lisenceTime[1] = obj.techEndDate
         }
         if(obj.techFlag == 1) {
           this.techVisible = true
@@ -424,8 +424,4 @@ export default {
     }
   }
 };
-</script>
-
-<style rel="stylesheet/scss" lang="scss">
-
-</style>
+</script>

+ 21 - 15
src/views/enterprise/project/components/FinBasic.vue

@@ -307,19 +307,29 @@ export default {
     this.form.id = this.$route.query.id || undefined;
     this.form.entId = this.$route.query.entId || undefined;
     if(this.form.id) {
-      this.getData()
-      this.getEntData()
+      this.getData().then(res => {
+        this.getEntData()
+      })
     }
   },
   methods: {
-    getEntData() {
+    async getEntData() {
       listEntUserApi().then(res => {
-        this.form.entName = res.data.entName
-        this.form.linkName = res.data.linkName
-        this.form.linkPhone = res.data.linkPhone
-        this.form.linkMobile = res.data.linkMobile
-        this.form.techFlag = res.data.techFlag
-        // this.$set(this.form, 'entName', res.data.entName)
+        if(!this.form.entName) {
+          this.form.entName = res.data.entName
+        }
+        if(!this.form.linkName) {
+          this.form.linkName = res.data.linkName
+        }
+        if(!this.form.linkPhone) {
+          this.form.linkPhone = res.data.linkPhone
+        }
+        if(!this.form.linkMobile) {
+          this.form.linkMobile = res.data.linkMobile
+        }
+        if(!this.form.techFlag) {
+          this.form.techFlag = res.data.techFlag
+        }
       })
     },
     //同步技术资料
@@ -345,7 +355,7 @@ export default {
         }
       })
     },
-    getData() {
+    async getData() {
       getProjectInfoApi(this.form.id).then(res => {
         let obj = res.data.finProject || {}
         this.techId = res.data.techProject.id
@@ -453,8 +463,4 @@ export default {
     }
   }
 };
-</script>
-
-<style rel="stylesheet/scss" lang="scss">
-
-</style>
+</script>

+ 21 - 17
src/views/enterprise/project/components/TechBasic.vue

@@ -301,11 +301,10 @@ export default {
       this.disabledVisible = true
     }
     if(this.form.id) {
-      this.getData()
+      this.getData().then(res => {
+        this.getEntData()
+      })
     }
-    setTimeout(() => {        // 加延时
-      this.getEntData()
-    }, 500);
   },
   methods: {
     synSubmit() {
@@ -318,21 +317,30 @@ export default {
         }
       })
     },
-    getEntData() {
+    async getEntData() {
       listEntUserApi().then(res => {
-        this.form.entName = res.data.entName
-        this.form.linkName = res.data.linkName
-        this.form.linkPhone = res.data.linkPhone
-        this.form.linkMobile = res.data.linkMobile
-        this.form.techFlag = res.data.techFlag
+        if(!this.form.entName) {
+          this.form.entName = res.data.entName
+        }
+        if(!this.form.linkName) {
+          this.form.linkName = res.data.linkName
+        }
+        if(!this.form.linkPhone) {
+          this.form.linkPhone = res.data.linkPhone
+        }
+        if(!this.form.linkMobile) {
+          this.form.linkMobile = res.data.linkMobile
+        }
+        if(!this.form.techFlag) {
+          this.form.techFlag = res.data.techFlag
+        }
       })
     },
-    getData() {
+    async getData() {
       getProjectInfoApi(this.form.id).then(res => {
         let obj = res.data.techProject || {}
         this.form = obj || {}
         this.adminId = res.data.entProject.id
-
         this.form.fileName = '高新证书'
         let arr = ['电子信息']
         this.$set(this.form, 'techScopeArray', arr)
@@ -428,8 +436,4 @@ export default {
     }
   }
 };
-</script>
-
-<style rel="stylesheet/scss" lang="scss">
-
-</style>
+</script>