scorpio vor 2 Jahren
Ursprung
Commit
baa85caf61

+ 98 - 30
src/views/home/component/params/params3.vue

@@ -1,39 +1,34 @@
 <template>
   <div class='flex flex-justify-start flex-align-center flex-col'>
-    <span class='full-width text-left bold'>{{ info.dictValue }}</span>
+    <div class='flex flex-center full-width flex-justify-between mt-10 mb-10'>
+      <span class='full-width text-left bold'>{{ info.dictValue }}</span>
+      <el-button v-if='detail.can_update' type='primary' @click='disabled = !disabled'>
+        {{ disabled ? '编 辑' : '保 存' }}
+      </el-button>
+    </div>
     <div class="mt-10 mb-10 full-width" style="width: 93%;">
       <base-button title="新增年度" icon="Plus"/>
     </div>
-    <div class='mt-10'>
+    <div class='mt-10' style='width: 80%;'>
       <el-form
           :model="form"
-          label-width='240px'
-          :disabled='true'
+          label-width='180px'
+          :disabled='disabled'
           label-position="left"
           class='form-content flex flex-col'
       >
-        <div class='flex flex-justify-start '>
-          <el-form-item label="2023年计划投资(万元)" style='flex:1'>
-            <el-input v-model="form['2023_plan_complete_investment']"/>
-          </el-form-item>
-          <el-form-item label="2023年累计投资(万元)" style='flex:1' class='ml-20'>
-            <el-input v-model="form.region"/>
-          </el-form-item>
-        </div>
-        <div class='full-width  flex'>
-          <el-form-item label="2022年计划投资(万元)" style='flex:1'>
-            <el-input v-model="form['2022_plan_complete_amount']"/>
-          </el-form-item>
-          <el-form-item label="2022年累计投资(万元)" style='flex:1' class='ml-20'>
-            <el-input v-model="form['2022_accumulated_completed_investment']"/>
-          </el-form-item>
-        </div>
-        <div class='full-width  flex'>
-          <el-form-item label="2021年计划投资(万元)" style='flex:1'>
-            <el-input v-model="form.name"/>
-          </el-form-item>
-          <el-form-item label="2021年累计投资(万元)" style='flex:1' class='ml-20'>
-            <el-input v-model="form.region"/>
+        <div class='grid'>
+          <el-form-item v-for='item in list1' :key='item' :label="item.name" style='flex:1'>
+            <el-input v-model="form.name">
+              <template #append>
+                <div class='btnSub white font-12 flex flex-center pointer' @click='inputMonth'>
+                  <el-icon :size="14">
+                    <Edit/>
+                  </el-icon>
+                  月填报
+                </div>
+              </template>
+            </el-input>
           </el-form-item>
         </div>
       </el-form>
@@ -41,7 +36,7 @@
     <div class="mt-20 mb-10 full-width" style="width: 93%;">
       <base-button title="新增年度" icon="Plus"/>
     </div>
-    <div class='mt-10'>
+    <div class='mt-10' style='width: 80%;'>
       <el-form
           :model="form"
           label-width='240px'
@@ -59,7 +54,7 @@
         </div>
         <div class='full-width  flex'>
           <el-form-item label="2022年计划纳统投资(万元)" style='flex:1'>
-            <el-input v-model="form['2022_plan_invesment']"/>
+            <el-input v-model="form.name"/>
           </el-form-item>
           <el-form-item label="2022年累计纳统投资(万元)" style='flex:1' class='ml-20'>
             <el-input v-model="form.region"/>
@@ -75,6 +70,19 @@
         </div>
       </el-form>
     </div>
+
+    <el-dialog v-model='show' title='2023年度'>
+      <div class='flex flex-center flex-wrap'>
+        <div v-for='item in data1' :key='item'>
+          <div class='bold'>{{ item.name }}</div>
+          <input class='input flex flex-center' v-model="item.num" :min="1"/>
+        </div>
+      </div>
+      <div class='mt-20 full-width flex flex-center'>
+        <el-button type='primary' plain>取 消</el-button>
+        <el-button type='primary'>保 存</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -83,21 +91,51 @@ import baseButton from '@/components/base-button.vue'
 
 export default {
   name: 'params3',
-  components: {baseButton},
+  components: { baseButton },
   props: {
     info: {
       type: Object,
       default: null
+    },
+    detail: {
+      type: Object,
+      default: null
     }
   },
-  data() {
+  data () {
     return {
+      show: false,
+      disabled: true,
+      list1: [
+        { name: '2023年计划投资(万元)', value: 300330 },
+        { name: '2022年计划投资(万元)', value: 300330 },
+        { name: '2021年计划投资(万元)', value: 300330 }
+      ],
+      data1: [
+        { name: '1月', num: 0 },
+        { name: '2月', num: 0 },
+        { name: '3月', num: 0 },
+        { name: '4月', num: 0 },
+        { name: '5月', num: 0 },
+        { name: '6月', num: 0 },
+        { name: '7月', num: 0 },
+        { name: '8月', num: 0 },
+        { name: '9月', num: 0 },
+        { name: '10月', num: 0 },
+        { name: '11月', num: 0 },
+        { name: '12月', num: 0 }
+      ],
       form: {
         name: '',
         region: '',
         type: ''
       }
     }
+  },
+  methods: {
+    inputMonth () {
+      this.show = !this.show
+    }
   }
 }
 </script>
@@ -107,4 +145,34 @@ export default {
   border: 1px solid #eeeeee;
   padding: 20px;
 }
+
+.grid {
+  display: grid;
+  grid-template-columns: auto auto;
+  grid-column-gap: 20px;
+}
+
+.input {
+  width: 120px;
+  height: 40px;
+  margin-top: 20px;
+  border: #e7e7e7 solid 1px;
+  padding: 10px;
+  border-right: none;
+}
+
+.input:last-child {
+  width: 120px;
+  height: 40px;
+  margin-top: 20px;
+  padding: 10px;
+  border-right: #e7e7e7 solid 1px;
+}
+
+.btnSub {
+  height: 25px;
+  background-color: #EDAC56;
+  border-radius: 30px;
+  padding: 0 10px;
+}
 </style>

+ 27 - 17
src/views/home/component/params/params6.vue

@@ -2,21 +2,21 @@
   <div class='flex flex-justify-start flex-align-center flex-col'>
     <div class='flex flex-center full-width flex-justify-between mt-10 mb-10'>
       <span class='full-width text-left bold'>{{ info.dictValue }}</span>
-      <el-button type='primary' @click='disabled = !disabled'>{{ disabled ? '编 辑' : '保 存' }}</el-button>
+      <el-button v-if='detail.can_update' type='primary' @click='save'>{{ disabled ? '编 辑' : '保 存' }}</el-button>
     </div>
     <div class='mt-10' style='width: 80%;'>
-      {{ keys }}
       <el-form
           :model="form"
-          label-width='140px'
           :disabled='disabled'
-          class='form-content flex flex-col'
+          class='form-content flex flex-col '
+          label-width='160px'
       >
-        <div class='grid light-green-bg' v-for='item in keys' :key='item.id'>
-          <div class='light-red-bg' style='width: 50%'>{{ item}}</div>
-<!--          <el-form-item :label="item" style='flex:1'>-->
-<!--            <el-input v-model="form.name"/>-->
-<!--          </el-form-item>-->
+        <div class='grid'>
+          <div class='flex flex-justify-end  flex-wrap mb-20' v-for='item in keys' :key='item.id'>
+            <el-form-item :label="item" style='flex:1'>
+              <el-input v-model="form[item]"/>
+            </el-form-item>
+          </div>
         </div>
       </el-form>
     </div>
@@ -39,9 +39,16 @@ export default {
   watch: {
     detail: {
       handler (val) {
-        const jsonTmp = JSON.parse(val.other)
-        val.other = jsonTmp
-        this.keys = Object.keys(jsonTmp)
+        if ((typeof val.other).toString() !== 'object') {
+          console.log('fff')
+          const jsonTmp = JSON.parse(val.other)
+          val.other = jsonTmp
+          this.keys = Object.keys(jsonTmp)
+          this.form = jsonTmp
+        } else {
+          this.keys = Object.keys(val.other)
+          this.form = val.other
+        }
       },
       immediate: true
     }
@@ -50,11 +57,13 @@ export default {
     return {
       keys: null,
       disabled: true,
-      form: {
-        name: '',
-        region: '',
-        type: ''
-      }
+      form: {}
+    }
+  },
+  methods: {
+    save () {
+      this.disabled = !this.disabled
+      console.log(this.form)
     }
   }
 }
@@ -69,5 +78,6 @@ export default {
 .grid {
   display: grid;
   grid-template-columns: auto auto;
+  margin-bottom: 50px;
 }
 </style>

+ 1 - 1
src/views/home/pro_detail.vue

@@ -19,7 +19,7 @@
           <div class='full-width padding-top' :id="`header`+(index+1)">
             <params1 v-if='item.dictKey === "1" ' :info='item' :detail='data'/>
             <params2 v-if='item.dictKey === "2" ' :info='item'/>
-            <params3 v-if='item.dictKey === "3" ' :info='item'/>
+            <params3 v-if='item.dictKey === "3" ' :info='item' :detail='data'/>
             <params4 v-if='item.dictKey === "4" ' :info='item' :detail='data'/>
             <params5 v-if='item.dictKey === "5" ' :info='item' :detail='data'/>
             <params6 v-if='item.dictKey === "6" ' :info='item' :detail='data'/>