Browse Source

2023-08-24

weirenchun 2 years ago
parent
commit
a7256616ac

+ 16 - 0
src/api/project/index.js

@@ -359,6 +359,22 @@ export default {
       params,
       'post'
     )
+  },
+  //获取项目年度投资
+  projectAnnualInvestment(params) {
+    return fetch(
+      '/blade-project-manage-v2/project-dispatch/v2/project-annual-investment',
+      params
+    )
+  },
+  //新增或修改年度投资
+  submitAnnualInvestment(params) {
+    return fetch(
+      '/blade-project-manage-v2/project-dispatch/v2/submit-annual-investment',
+      params,
+      'post',
+      'json'
+    )
   }
 }
 

+ 1 - 1
src/views/project/componens/info4.vue

@@ -3,7 +3,7 @@
     title="投资基本情况"
     class="mt-10"
     :edit-btn="true"
-    @change="change"
+    @edit="change"
     @save="save"
   >
     <el-form class="mt-20" :disabled="disabled">

+ 1 - 1
src/views/project/componens/info5.vue

@@ -3,7 +3,7 @@
     title="建成投产后效益测算"
     class="mt-10"
     :edit-btn="true"
-    @change="change"
+    @edit="change"
     @save="save"
   >
     <el-form class="mt-20" :disabled="disabled">

+ 150 - 40
src/views/project/componens/info6.vue

@@ -2,31 +2,104 @@
   <wt-card
     title="年度投资情况(单位:万元)"
     class="mt-10"
-    :edit-btn="true"
+    :edit-btn="false"
     @change="change"
     @save="save"
   >
-    <el-form class="mt-20" :disabled="disabled">
-      <div class="flex flex-justify-center">
-        <el-form-item class="full-width flex-child-average">
-          <div class="flex flex-center full-width item">
-            <span class="title">年产值:</span>
-            <el-input v-model="form.benefit_annual_output"></el-input>
-          </div>
-        </el-form-item>
-        <el-form-item class="full-width flex-child-average">
-          <div class="flex flex-center full-width item">
-            <span class="title">年税收:</span>
-            <el-input v-model="form.benefit_annual_tax"></el-input>
-          </div>
-        </el-form-item>
-        <el-form-item class="full-width flex-child-average">
-          <div class="flex flex-center full-width item">
-            <span class="title">新增就业人数:</span>
-            <el-input v-model="form.benefit_new_employment"></el-input>
-          </div>
-        </el-form-item>
+    <el-form class="mt-20">
+      <div style="width: 99%; text-align: left" class="mt-20 ml-10">
+        <span class="title">年份:</span>
+        <el-select v-model="selectYear" @change="changeYear">
+          <el-option
+            v-for="item in years"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
       </div>
+
+      <table>
+        <thead>
+          <tr>
+            <th>类型</th>
+            <th>1-2月</th>
+            <th>3月</th>
+            <th>4月</th>
+            <th>5月</th>
+            <th>6月</th>
+            <th>7月</th>
+            <th>8月</th>
+            <th>9月</th>
+            <th>10月</th>
+            <th>11月</th>
+            <th>12月</th>
+            <th>合计</th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr>
+            <th>计划投资</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+          </tr>
+          <tr>
+            <th>累计投资</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+          </tr>
+          <tr>
+            <th>计划纳统投资</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+          </tr>
+          <tr>
+            <th>累计纳统投资</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+            <th>1</th>
+          </tr>
+        </tbody>
+      </table>
     </el-form>
   </wt-card>
 </template>
@@ -39,40 +112,63 @@ export default {
     wtCard
   },
   props: {
-    info: {
-      type: Object,
-      default: () => {
-        return {}
-      }
+    projectId: {
+      required: true,
+      type: String,
+      default: ''
     }
   },
   watch: {
-    info: {
+    projectId: {
       handler(val) {
-        this.form = val
+        this.initYear()
+        if (val.length > 0) {
+          this.getList()
+        }
       },
       immediate: true
     }
   },
   data() {
     return {
+      years: [],
+      years2: [],
+      selectYear: new Date().getFullYear(),
       disabled: true,
       form: {}
     }
   },
   methods: {
+    changeYear(res) {
+      this.$message.warning(res)
+    },
+    getList() {
+      // this.$api.project.projectAnnualInvestment(this.projectId).then(res => {
+      this.$api.project
+        .projectAnnualInvestment({ projectId: 111 })
+        .then(res => {
+          if (res.code === 200) {
+            console.log(res.data())
+          }
+        })
+    },
+    initYear() {
+      this.years.length = 0
+      const year = new Date().getFullYear()
+      for (let i = 2017; i <= year + 1; i++) {
+        const item = { label: i, value: i }
+        this.years.push(item)
+      }
+      this.years.reverse()
+    },
     save() {
-      console.log('save')
-      this.$api.project.proUpdate(this.form).then(res => {
+      this.$api.project.submitAnnualInvestment(this.form).then(res => {
         if (res.code === 200) {
           this.$message.success(res.msg)
         } else {
           this.$message.error(res.msg)
         }
       })
-    },
-    change(res) {
-      this.disabled = res
     }
   }
 }
@@ -80,17 +176,31 @@ export default {
 
 <style lang="scss" scoped>
 .title {
-  width: 120px;
+  width: 60px;
   padding-right: 10px;
-  text-align: right;
+  text-align: center;
+}
+
+table {
+  width: 98%;
+  margin: 1%;
+  margin-top: 20px;
+}
+
+thead {
+  background: #d7d7d7;
 }
 
-.title-textarea {
-  width: 85px;
-  text-align: left;
+tr {
+  display: flex;
+  height: 40px;
 }
 
-.item {
-  width: 90%;
+th {
+  height: 40px;
+  flex: 1;
+  text-align: center;
+  line-height: 40px;
+  border: 1px solid #9c9c9c;
 }
 </style>

+ 1 - 1
src/views/project/componens/info7.vue

@@ -3,7 +3,7 @@
     title="其他信息"
     class="mt-10"
     :edit-btn="true"
-    @change="change"
+    @edit="change"
     @save="save"
   >
     <el-form class="mt-20" :disabled="disabled">

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

@@ -17,7 +17,7 @@
       <info3 :project-id="projectId" :stage-id="stageId" />
       <info4 :info="detail" />
       <info5 :info="detail" />
-      <info6 :info="detail" />
+      <info6 :project-id="projectId" />
       <info7 :info="detail" />
       <info8 :project-id="projectId" />
     </div>