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

Merge remote-tracking branch 'origin/develop' into develop

scorpio преди 2 години
родител
ревизия
1078a1d456
променени са 2 файла, в които са добавени 31 реда и са изтрити 24 реда
  1. 27 20
      src/views/project/componens/info4.vue
  2. 4 4
      src/views/project/componens/info5.vue

+ 27 - 20
src/views/project/componens/info4.vue

@@ -5,7 +5,7 @@
     :edit-btn="true"
     @edit="change"
     @save="save"
-    @on-load="getFundsList(this.type)"
+    @on-load="getFundsList"
   >
     <div
       class="full-width text-right main-color pointer"
@@ -19,12 +19,14 @@
       </el-dialog>
     </div>
     <div style="display: flex; align-items: center">
-      <el-button-group>
-        <el-button type="primary" @click="getFundsList(1)">到位资金</el-button>
-        <el-button type="primary" @click="getFundsList(2)"
-          >筹措资金<i class="el-icon-arrow-right el-icon--right"></i
-        ></el-button>
-      </el-button-group>
+      <el-tabs
+        v-model="type"
+        class="ml-20 demo-tabs"
+        @tab-change="getFundsList"
+      >
+        <el-tab-pane label="到位资金" name="1"></el-tab-pane>
+        <el-tab-pane label="筹措资金" name="2"></el-tab-pane>
+      </el-tabs>
       <div style="margin-left: 20px">
         * 点击对应按钮,查看到位资金、筹措资金详情
       </div>
@@ -138,7 +140,6 @@
     </el-form>
   </wt-card>
 </template>
-
 <script>
 import wtCard from '@/components/wt-card/index.vue'
 import info from '@/views/funds/component/info.vue'
@@ -158,8 +159,8 @@ export default {
   watch: {
     projectId: {
       handler(val) {
-        if (val.length > 0) {
-          this.getFundsList(1)
+        if (this.type === '1') {
+          this.getFundsList()
         }
       },
       immediate: true
@@ -167,12 +168,12 @@ export default {
   },
   data() {
     return {
-      canUpdate: false,
+      canUpdate: true,
       show: false,
       styleObject: {
         visibility: 'visible'
       },
-      type: 1,
+      type: '1',
       disabled: true,
       data: {},
       totalZC: 0,
@@ -189,8 +190,8 @@ export default {
     }
   },
   methods: {
-    getFundsList(type) {
-      if (type === 1) {
+    getFundsList() {
+      if (this.type === '1') {
         this.disabled = true
       } else {
         if (this.canUpdate) {
@@ -200,7 +201,6 @@ export default {
         }
       }
 
-      this.type = type
       this.totalDF = 0
       this.totalZC = 0
       this.t1 = 0
@@ -212,16 +212,16 @@ export default {
       this.t7 = 0
       this.t8 = 0
       this.t9 = 0
-      if (type === 2) {
+      if (this.type === '2') {
         this.styleObject.visibility = 'hidden'
       } else {
         this.styleObject.visibility = 'visible'
       }
       this.$api.funds
-        .fundsList({ projectId: this.projectId, type: type })
+        .fundsList({ projectId: this.projectId, type: this.type })
         .then(res => {
           if (res.code === 200) {
-            if (type === 1) {
+            if (this.type === '1') {
               res.data.forEach(item => {
                 this.t1 = this.t1 + (item.investmentOfCentralBudget - 0)
                 this.t2 = this.t2 + (item.bankLoans - 0)
@@ -283,10 +283,11 @@ export default {
         })
     },
     save() {
-      if (this.type == 2) {
+      if (this.type === '2') {
         this.$api.funds.fundsSaveOrUpdate(this.data).then(res => {
           if (res.code === 200) {
             this.$message.success(res.msg)
+            this.getFundsList()
           } else {
             this.$message.error(res.msg)
           }
@@ -297,7 +298,7 @@ export default {
     },
     change(res) {
       this.canUpdate = res
-      if (this.type === 2) {
+      if (this.type === '2') {
         this.disabled = res
       }
     },
@@ -339,4 +340,10 @@ export default {
 .input {
   width: 50%;
 }
+.demo-tabs > .el-tabs__content {
+  padding: 32px;
+  color: #6b778c;
+  font-size: 32px;
+  font-weight: 600;
+}
 </style>

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

@@ -10,19 +10,19 @@
       <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>
+            <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>
+            <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>
+            <span class="title">新增就业人数(人):</span>
             <el-input v-model="form.benefit_new_employment"></el-input>
           </div>
         </el-form-item>
@@ -79,7 +79,7 @@ export default {
 
 <style lang="scss" scoped>
 .title {
-  width: 120px;
+  width: 210px;
   padding-right: 10px;
   text-align: right;
 }