scorpio 2 anni fa
parent
commit
cd5f1930cb

+ 12 - 9
src/views/home/component/dash.vue

@@ -45,7 +45,7 @@
                @selection-change="selectionChange"
                @on-load="onLoad">
       <template #menu="{row}">
-        <el-button v-if='user.info.viewStage !== 0' icon="Upload" type='primary' text @click="track(row)"> {{
+        <el-button v-if='user.info.viewStage !== 1' icon="Upload" type='primary' text @click="track(row)"> {{
             row.isReport === 1 ? "已经上报" : "项目上报"
           }}
         </el-button>
@@ -193,6 +193,8 @@ export default {
       data: [],
       form: {},
       option: {
+        menuType: 'menu',
+        menuBtnTitle: '操作',
         refreshBtn: false,
         tip: false,
         lazy: true,
@@ -205,12 +207,10 @@ export default {
         addBtn: false,
         delBtn: true,
         border: true,
-        index: true,
         reserveSelection: true,
         align: 'center',
         viewBtn: true,
         viewBtnText: '详情',
-        menuWidth: 380,
         dialogClickModal: false,
         column: [
           {
@@ -218,13 +218,14 @@ export default {
             prop: 'name',
             addDisplay: false,
             editDisplay: false,
-            width: 480
+            fixed: true,
+            minWidth: 200
           },
           {
             label: '项目情况',
             prop: 'project_stage',
             type: 'select',
-            width: 180,
+            width: 120,
             dicUrl: '/api/blade-system/dict-biz/dictionary?code=project-situation',
             props: {
               label: 'dictValue',
@@ -234,7 +235,7 @@ export default {
           {
             label: '项目总投资(万元)',
             prop: 'total_amount',
-            width: 180,
+            width: 120,
             type: 'number',
             precision: 2,
             formatter: (val, value, label) => {
@@ -243,8 +244,7 @@ export default {
           },
           {
             label: '责任单位',
-            prop: 'create_dept_name',
-            width: 180
+            prop: 'create_dept_name'
           },
           {
             label: '子项目数量',
@@ -295,7 +295,10 @@ export default {
           {
             label: '创建时间',
             prop: 'create_time',
-            width: 180
+            width: 120,
+            formatter: (val, value, label) => {
+              return value.substring(0, 10)
+            }
           }]
       },
       page: {

+ 27 - 10
src/views/home/component/params/params3.vue

@@ -23,13 +23,13 @@
               <div class='flex-child-average full-width  flex flex-center'>
                 <span style='width: 320px'>{{ item.year }}年度计划投资(万元)</span>
                 <el-input v-model='item.value' @change='change(item)'></el-input>
-                <div class='btnSub pointer'>月填报</div>
+                <div class='btnSub pointer' @click='showMonth(item,1)'>月填报</div>
               </div>
               <div style='width: 20px'></div>
               <div class='flex-child-average full-width  flex flex-center'>
                 <span style='width: 380px'>{{ item.year }}年度累计投资(万元)</span>
                 <div class='disable-input' @change='change(item)'>{{ item.value2 }}</div>
-                <div class='btnSub pointer' @click='showMonth(item)'>月填报</div>
+                <div class='btnSub pointer' @click='showMonth(item,2)'>月填报</div>
               </div>
             </div>
           </div>
@@ -59,7 +59,7 @@
               <div class='flex-child-average full-width  flex flex-center'>
                 <span style='width: 440px'>{{ item.year }}年度累计纳统投资(万元)</span>
                 <div class='disable-input' @change='change(item)'>{{ item.value2 }}</div>
-                <div class='btnSub pointer' @click='showMonth(item)'>月填报</div>
+                <div class='btnSub pointer' @click='showMonth(item,2)'>月填报</div>
               </div>
             </div>
           </div>
@@ -69,9 +69,10 @@
 
     <el-dialog v-model='show' :title='current ? current.year + "年度" : ""'>
       <div class='flex flex-center flex-wrap'>
-        <div v-for='item in current.months' :key='item'>
+        <div v-for='item in current.editType === 1 ? current.planMonths : current.months' :key='item'>
           <div class='bold mb-10 mt-10'>{{ item.name }}月</div>
-          <input :disabled='!detail.can_update' class='input flex flex-center' v-model="item.value" :min="1" @change='changeMonth(item)'/>
+          <input :disabled='!detail.can_update' class='input flex flex-center' v-model="item.value" :min="1"
+                 @change='changeMonth(item)'/>
         </div>
       </div>
       <div class='mt-20 full-width flex text-left red'>* 请按月份进行填报,单位:万元</div>
@@ -137,6 +138,7 @@ export default {
           code2: lastYear + '_total_complete_amount',
           value: '',
           value1: '',
+          planMonths: months,
           months
         }
         this.list1.push(item)
@@ -159,6 +161,7 @@ export default {
           code2: lastYear + '_total_investment_amount',
           value: '',
           value1: '',
+          planMonths: months,
           months
         }
         this.list2.push(item)
@@ -170,8 +173,10 @@ export default {
         keys.forEach(sub => {
           const tmp = Number.parseInt(sub.substring(0, 4))
           const months = []
+          const planMonths = []
           for (let i = 1; i <= 12; i++) {
             months.push({ index: i, name: i, value: this.form[tmp + '_' + i + '_month_complete_amount'] })
+            planMonths.push({ index: i, name: i, value: this.form[tmp + '_' + i + '_month_plan_complete_amount'] })
           }
 
           const item = {
@@ -181,6 +186,7 @@ export default {
             year: tmp,
             value: this.detail[tmp + '_plan_complete_amount'],
             value2: this.detail[tmp + '_total_complete_amount'],
+            planMonths,
             months
           }
           this.list1.push(item)
@@ -192,8 +198,10 @@ export default {
         keysInvestment.forEach(sub => {
           const tmp = Number.parseInt(sub.substring(0, 4))
           const months = []
+          const planMonths = []
           for (let i = 1; i <= 12; i++) {
             months.push({ index: i, name: i, value: this.form[tmp + '_' + i + '_month_investment_amount'] })
+            planMonths.push({ index: i, name: i, value: this.form[tmp + '_' + i + '_month_plan_investment_amount'] })
           }
           const item = {
             type: 2,
@@ -201,7 +209,9 @@ export default {
             code2: tmp + '_total_investment_amount',
             year: tmp,
             value: this.detail[tmp + '_plan_investment_amount'],
-            value2: this.detail[tmp + '_total_investment_amount']
+            value2: this.detail[tmp + '_total_investment_amount'],
+            planMonths,
+            months
           }
           this.list2.push(item)
         })
@@ -225,18 +235,25 @@ export default {
         }
       })
     },
-    showMonth (item) {
-      this.show = !this.show
+    showMonth (item, type) {
       this.current = item
+      this.current.editType = type
+      this.show = !this.show
     },
     changeMonth (res) {
-      const code = this.current.year + '_' + res.name + (this.current.type === 1 ? '_month_complete_amount' : '_month_investment_amount')
+      let code = this.current.year + '_' + res.name + (this.current.type === 1 ? '_month_complete_amount' : '_month_investment_amount')
+      if (this.current.editType === 1) {
+        code = this.current.year + '_' + res.name + (this.current.type === 1 ? '_month_plan_complete_amount' : '_month_pla_investment_amount')
+      }
       this.form[code] = res.value
       const tmp = this.current.months.map(sub => Number.parseInt(sub.value))
       const sum = tmp.reduce((accumulator, value) => {
         return accumulator + (value || 0)
       }, 0)
-      const codeParent = this.current.year + (this.current.type === 1 ? '_total_complete_amount' : '_total_investment_amount')
+      let codeParent = this.current.year + (this.current.type === 1 ? '_total_complete_amount' : '_total_investment_amount')
+      if (this.current.editType === 1) {
+        codeParent = this.current.year + (this.current.type === 1 ? '_total_plan_complete_amount' : '_total_plan_investment_amount')
+      }
       console.log(sum)
       this.form[codeParent] = sum
       this.current.value2 = sum