liuxiangqi пре 1 година
родитељ
комит
f31332df61

+ 5 - 0
src/router/index.js

@@ -129,6 +129,11 @@ export const constantRoutes = [
         component: (resolve) => require(['@/views/enterprise/project/edit'], resolve),
         name: 'editProject',
         meta: { title: '修改项目信息'}
+      },{
+        path: 'editYear',
+        component: (resolve) => require(['@/views/enterprise/project/edit'], resolve),
+        name: 'editYear',
+        meta: {title: '修改年度基本信息'}
       }
     ]
   }, {

+ 28 - 35
src/views/enterprise/project/components/year-edit.vue

@@ -180,7 +180,7 @@
             <span>{{scope.row.projectStartDate}} - {{scope.row.projectEndDate}}</span>
           </template>
         </el-table-column>
-        <el-table-column label="研发人员数" prop="projectName" align="center"/>
+        <el-table-column label="研发人员数" prop="techPersons" align="center"/>
       </el-table>
       <template v-if="type == 'year' || type == 'update'">
         <el-row :gutter="40" v-if="!disabledVisible">
@@ -372,9 +372,9 @@ export default {
     }
     //获取年度信息
     if(this.type == 'year') {
-      this.getEntData()
-      // let years= new Date().getFullYear();
-      // this.handleYear(years)
+      // this.getEntData()
+      let years= new Date().getFullYear();
+      this.handleYear(years)
     }
     if(this.type == 'update') {
       this.yearVisible = true
@@ -467,7 +467,9 @@ export default {
     //根据企业id获取年度信息
     getYearData(projectYear) {
       getYearDataApi(projectYear, this.entId).then(res => {
-        this.form = res.data
+        // this.form = res.data
+        this.form = Object.assign({}, this.form, res.data)
+        this.$set(this.form, 'projectYear', res.data.projectYear)
         this.form.fileName = '高新证书'
         if(this.form.techStartDate && this.form.techEndDate) {
           this.form.licenseTime = this.form.techStartDate + ' 至 ' + this.form.techEndDate
@@ -526,38 +528,29 @@ export default {
             this.form.techStartDate = ""
             this.form.techEndDate = ""
           }
-          let _self = this;
-          this.$confirm('是否确认保存?', "警告", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          }).then(function() {
-            if(_self.type == 'year') {
-              yearApi(_self.form).then(res => {
-                _self.$alert('企业加计年度企业基本信息保存成功', '提示', {
-                  confirmButtonText: '确定',
-                  callback: action => {
-                    _self.loading = false
-                    // _self.$store.dispatch("tagsView/delView", _self.$route);
-                    _self.$router.go(-1);
-                  }
-                })
+          if(this.type == 'year') {
+            yearApi(this.form).then(res => {
+              this.$alert('企业加计年度企业基本信息保存成功', '提示', {
+                confirmButtonText: '确定',
+                callback: action => {
+                  this.loading = false
+                  // this.$store.dispatch("tagsView/delView", this.$route);
+                  this.$router.go(-1);
+                }
               })
-            } else {
-              yearUpdateApi(_self.form).then(res => {
-                _self.$alert('企业加计年度企业基本信息保存成功', '提示', {
-                  confirmButtonText: '确定',
-                  callback: action => {
-                    _self.loading = false
-                    // _self.$store.dispatch("tagsView/delView", _self.$route);
-                    _self.$router.go(-1);
-                  }
-                })
+            })
+          } else {
+            yearUpdateApi(this.form).then(res => {
+              this.$alert('企业加计年度企业基本信息保存成功', '提示', {
+                confirmButtonText: '确定',
+                callback: action => {
+                  this.loading = false
+                  // this.$store.dispatch("tagsView/delView", this.$route);
+                  this.$router.go(-1);
+                }
               })
-            }
-          }).catch(() => {
-              _self.loading = false
-          });
+            })
+          }
         }
       })
     }

+ 1 - 1
src/views/enterprise/project/index.vue

@@ -253,7 +253,7 @@
       },
       //添加年度信息 type用来区分tab页是否可以切换
       handleYear() {
-        this.$router.push({name: 'editProject', query: {type: 'year'}})
+        this.$router.push({name: 'editYear', query: {type: 'year'}})
       },
       // 查看
       handleView(row) {

+ 8 - 8
src/views/index.vue

@@ -120,12 +120,12 @@
         </h1>
       </div>
       <el-table v-loading="loading" :data="list" border>
-        <el-table-column label="申报年度" prop="projectYear"></el-table-column>
-        <el-table-column label="企业名称" prop="entName" align="center" width="180"/>
+        <el-table-column label="申报年度" prop="projectYear" width="90"></el-table-column>
+        <el-table-column label="企业名称" prop="entName" align="center"/>
         <el-table-column label="职工数" prop="totoalPersons" align="center" width="180" />
-        <el-table-column label="销售收入" prop="sales"></el-table-column>
-        <el-table-column label="研发收入" prop="techInvest"></el-table-column>
-        <el-table-column label="占销售收入比例" prop="techRate"></el-table-column>
+        <el-table-column label="销售收入" prop="sales" width="90"></el-table-column>
+        <el-table-column label="研发收入" prop="techInvest" width="90"></el-table-column>
+        <el-table-column label="占销售收入比例" prop="techRate" width="90"></el-table-column>
         <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width" fixed="right">
           <template slot-scope="scope">
             <!-- <template v-if="!roleTypeFlag && (scope.row.reportState == 1 || scope.row.reportState == 2)"> -->
@@ -148,13 +148,13 @@
       </div>
 
       <el-table v-loading="loading" :data="declareList" border>
+        <el-table-column label="项目名称" prop="projectName" align="center"/>
         <el-table-column label="申报年度" prop="projectYear"></el-table-column>
         <el-table-column label="项目起止时间" align="center">
           <template slot-scope="scope">
             <span>{{scope.row.projectStartDate}} - {{scope.row.projectEndDate}}</span>
           </template>
         </el-table-column>
-        <el-table-column label="项目名称" prop="projectName" align="center"/>
       </el-table>
     </template>
 
@@ -223,11 +223,11 @@ export default {
     },
     //添加年度信息 type用来区分tab页是否可以切换
     handleYear() {
-      this.$router.push({name: 'editProject', query: {type: 'year'}})
+      this.$router.push({name: 'editYear', query: {type: 'year'}})
     },
     //编辑
     handleEdit(row) {
-      this.$router.push({name: 'editProject', query: {year: row.projectYear, entId: row.entId, type: 'update', activeName: '1', source: 'add'}})
+      this.$router.push({name: 'editYear', query: {year: row.projectYear, entId: row.entId, type: 'update', activeName: '1', source: 'add'}})
     },
     getDeclareList() {
       this.loading = true;