scorpio 2 жил өмнө
parent
commit
9533562db1

+ 20 - 12
src/views/invest/components/years.vue

@@ -7,14 +7,17 @@
       <div v-for='i in dash' class='flex-child-average' :key='i'>
         <div class='box' :style='`box-shadow: `+ i.box'>
           <div class="flex flex-col bold font-16 padding-14">
-            <div class='flex flex-justify-start'>
+            <div class='flex flex-justify-start flex-align-end'>
               <img :src='i.icon'/>
               <span class="grey-6 ml-5">{{ i.name }}</span>
+              <span v-if='i.index !== 2' class='font-12 grey-6 ml-10'>万元</span>
             </div>
             <div v-if="i.index !== 2" class='flex flex-align-end flex-justify-start mt-20'>
               <span class="grey" style="margin-left: 3px">¥</span>
-              <span class="ml-5 font-24 " :style='`color:` + i.color'>{{ info[i.prop] }}</span>
-              <el-icon :size="15" v-if='i.index === 0 && user.info.viewStage === 1' class='ml-10 pointer' @click='edit'>
+              <span class="ml-5 font-24 "
+                    :style='`color:` + i.color'>{{ info[i.prop] ? info[i.prop].toLocaleString() : '0' }}</span>
+              <el-icon :size="15" v-if='i.index === 0 && user.info.viewStage === 1' class='ml-10 pointer'
+                       @click='edit(i)'>
                 <Edit/>
               </el-icon>
             </div>
@@ -38,10 +41,16 @@
 import basicTab from '@/components/basic-tab/index.vue'
 import wave from '@/views/invest/components/wave.vue'
 import { useStore } from '@/store/user.js'
-import { ElMessage, ElMessageBox } from 'element-plus'
+import { ElMessageBox } from 'element-plus'
+import index from '@/views/task/Index.vue'
 
 export default {
   name: 'years',
+  computed: {
+    index () {
+      return index
+    }
+  },
   components: { basicTab, wave },
   setup () {
     const user = useStore()
@@ -77,7 +86,7 @@ export default {
         {
           icon: new URL('../../../assets/svg/invest/1.svg', import.meta.url).href,
           name: '责任目标',
-          value: 30303,
+          value: 0,
           prop: 'plan_complete_amount',
           box: '0 1px 10px 0 rgba(105, 204, 243, 0.3)',
           color: '#32B5F3',
@@ -87,7 +96,7 @@ export default {
         {
           icon: new URL('../../../assets/svg/invest/2.svg', import.meta.url).href,
           name: '累计完成投资',
-          value: 30303,
+          value: 0,
           prop: 'total_complete_amount',
           box: '0 1px 10px 0 rgba(200, 150, 230, 0.3)',
           color: '#AD46CB',
@@ -96,7 +105,7 @@ export default {
         {
           icon: new URL('../../../assets/svg/invest/3.svg', import.meta.url).href,
           name: '投资完成比例',
-          value: 30303,
+          value: 0,
           prop: 'rate',
           box: '0 1px 10px 0 rgba(236, 171, 83, 0.3)',
           color: '#EC9040',
@@ -105,7 +114,7 @@ export default {
         {
           icon: new URL('../../../assets/svg/invest/4.svg', import.meta.url).href,
           name: '计划纳统投资',
-          value: 30303,
+          value: 0,
           prop: 'total_investment_amount',
           box: '0 1px 10px 0 rgba(119, 94, 241, 0.3)',
           color: '#4F5EE7',
@@ -137,8 +146,8 @@ export default {
       this.$emit('change', index)
       this.load()
     },
-    edit () {
-      ElMessageBox.prompt('请输入年度责任目标(数字,包括小数点)', '提示', {
+    edit (item) {
+      ElMessageBox.prompt('当前责任目标为' + this.info[item.prop].toLocaleString() + '万元,请输入新的责任目标(数字,小数点)', '提示', {
         confirmButtonText: '保存',
         cancelButtonText: '取消',
         inputPattern:
@@ -146,7 +155,6 @@ export default {
         inputErrorMessage: '信息错误'
       })
         .then(({ value }) => {
-          console.log(value, this.quarter)
           let data = {}
           switch (this.quarter) {
             case 0: // 年度
@@ -170,8 +178,8 @@ export default {
           }
           this.$api.invest.savePlan(Object.assign({ deptId: this.deptId === null ? '' : this.deptId }, data)).then(res => {
             if (res.code === 200) {
-              console.log(res)
               this.$message.success(res.msg)
+              this.info[item.prop] = value
             } else {
               this.$message.error(res.msg)
             }

+ 3 - 3
src/views/invest/index.vue

@@ -13,12 +13,12 @@
         <basic-container>
           <div class='flex '>
             <div class='flex-child-average full-width flex flex-col flex-justify-start'>
-              <span class='font-16 bold full-width text-left '>投资数据统计</span>
+              <span class='font-16 bold full-width text-left '>投资数据统计 单位(万元)</span>
               <div class='full-width mt-10' style='background-color: #F7FAFD'>
                 <chart :dept-id='dept' :quarter='yearType.value === 0 ? "":yearType '/>
               </div>
 
-              <span class='font-16 bold full-width text-left mt-20'>项目入库统计</span>
+              <span class='font-16 bold full-width text-left mt-20'>项目入库统计  单位(个)</span>
               <div class='full-width mt-10' style='background-color: #F7FAFD'>
                 <chart2 :dept-id='dept' :quarter='yearType.value === 0 || yearType === "0" ? "":yearType '/>
               </div>
@@ -37,7 +37,7 @@
 
 <route>
 {
-name: '年度投资',
+name: '年度投资管理',
 }
 </route>