Browse Source

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

weirenchun 2 years ago
parent
commit
5a39162999
2 changed files with 214 additions and 252 deletions
  1. 14 66
      src/views/project/componens/info6.vue
  2. 200 186
      src/views/project/componens/info7.vue

+ 14 - 66
src/views/project/componens/info6.vue

@@ -6,9 +6,9 @@
     @edit="change"
     @save="save"
   >
-    <el-form class="mt-20" :disabled="disabled">
-      <div style="width: 1300px; text-align: left" class="mt-20 ml-10">
-        <span class="title">年份:</span>
+    <el-form>
+      <div class="ml-10 text-left">
+        <span class="title full-width">年份:</span>
         <el-select v-model="selectYear" @change="changeYear">
           <el-option
             v-for="item in years"
@@ -43,7 +43,7 @@
             <th>{{ allPlanInvestment }}</th>
           </tr>
           <tr>
-            <th>累计投资</th>
+            <th style="width: 100px">累计投资</th>
             <th v-for="item in month">
               <el-input
                 class="th-input"
@@ -111,12 +111,7 @@ export default {
   },
   data() {
     return {
-      allPlanInvestment: 0,
-      allTotalInvestment: 0,
-      allPlanNtInvestment: 0,
-      allTotalNtInvestment: 0,
-      updateItem: [],
-      data: [],
+      updateItem: {},
       month: [
         { month: '1-2' },
         { month: '3' },
@@ -128,7 +123,8 @@ export default {
         { month: '9' },
         { month: '10' },
         { month: '11' },
-        { month: '12' }
+        { month: '12' },
+        { month: '合计' }
       ],
       years: [],
       years2: [],
@@ -138,10 +134,6 @@ export default {
   },
   methods: {
     changeYear(res) {
-      this.allPlanInvestment = 0
-      this.allTotalInvestment = 0
-      this.allPlanNtInvestment = 0
-      this.allTotalNtInvestment = 0
       this.getList()
     },
     getList() {
@@ -152,7 +144,6 @@ export default {
         })
         .then(res => {
           if (res.code === 200) {
-            this.data = res.data
             this.month.map(monthItem => {
               const sub = res.data.find(ele => ele.month === monthItem.month)
               if (sub) {
@@ -170,15 +161,6 @@ export default {
                 monthItem.updateTime = sub.updateTime
                 monthItem.updateUser = sub.updateUser
                 monthItem.year = sub.year
-
-                this.allTotalNtInvestment =
-                  this.allTotalNtInvestment + (sub.totalNtInvestment - 0)
-                this.allPlanInvestment =
-                  this.allPlanInvestment + (sub.planInvestment - 0)
-                this.allTotalInvestment =
-                  this.allTotalInvestment + (sub.totalInvestment - 0)
-                this.allPlanNtInvestment =
-                  this.allPlanNtInvestment + (sub.planNtInvestment - 0)
               } else {
                 monthItem.planInvestment = 0
                 monthItem.planNtInvestment = 0
@@ -200,48 +182,14 @@ export default {
       }
       this.years.reverse()
     },
-    AddUpdateItem(item) {
-      const sub = this.updateItem.find(ele => ele.month === item.month)
-      if (sub) {
-        console.log('这个已经在更新列表中!')
-      } else {
-        this.updateItem.push(item)
-      }
-
-      const index = this.data.findIndex(ele => ele.month === item.month)
-      if (index != -1) {
-        this.data.splice(this.data.indexOf(index), 1)
-      }
-      this.data.push(item)
-      //重新计算合计
-      this.allPlanInvestment = 0
-      this.allTotalInvestment = 0
-      this.allPlanNtInvestment = 0
-      this.allTotalNtInvestment = 0
-      this.data.forEach(ele => {
-        this.allTotalNtInvestment =
-          this.allTotalNtInvestment + (ele.totalNtInvestment - 0)
-        this.allPlanInvestment =
-          this.allPlanInvestment + (ele.planInvestment - 0)
-        this.allTotalInvestment =
-          this.allTotalInvestment + (ele.totalInvestment - 0)
-        this.allPlanNtInvestment =
-          this.allPlanNtInvestment + (ele.planNtInvestment - 0)
+    saveOrUpdate(item) {
+      this.$api.project.submitAnnualInvestment(item).then(res => {
+        if (res.code === 200) {
+          this.$message.success(res.msg)
+        } else {
+          this.$message.error(res.msg)
+        }
       })
-    },
-    change(res) {
-      this.disabled = res
-    },
-    save() {
-      this.$api.project
-        .batchSubmitAnnualInvestment(this.updateItem)
-        .then(res => {
-          if (res.code === 200) {
-            this.$message.success(res.msg)
-          } else {
-            this.$message.error(res.msg)
-          }
-        })
     }
   }
 }

+ 200 - 186
src/views/project/componens/info7.vue

@@ -7,17 +7,17 @@
     @save="save"
   >
     <el-form class="mt-20" :disabled="disabled">
-      <div class="body_title">入库信息</div>
-      <!--    入库信息    -->
-      <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>
-            <div class="full-width">
+      <div class="body_title bold">入库信息</div>
+      <div class="flex flex-center flex-justify-start">
+        <!--    入库信息 1   -->
+        <div class="flex flex-col">
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title">是否入库:</span>
               <el-select
                 v-model="form.is_storage"
                 placeholder="是否入库"
-                class="full-width"
+                class="wd"
               >
                 <el-option
                   v-for="item in yesOrNo"
@@ -27,123 +27,131 @@
                 />
               </el-select>
             </div>
-          </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-date-picker
-              v-model="form.plan_storage_time"
-              type="date"
-              style="width: 100%"
-              placeholder="计划入库时间"
-              format="YYYY-MM-DD"
-              value-format="YYYY-MM-DD"
-            />
-          </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-date-picker
-              v-model="form.storage_time"
-              type="date"
-              style="width: 100%"
-              placeholder="实际入库时间"
-              format="YYYY-MM-DD"
-              value-format="YYYY-MM-DD"
-              @change="changeStorageTime"
-            />
-          </div>
-        </el-form-item>
-      </div>
-
-      <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.project_code"></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.regulatory_platform_code"></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>
-            <div class="full-width">
-              <el-select
-                v-model="form.is_provincial_key"
-                placeholder="是否纳入省重点项目"
-                class="full-width"
-              >
-                <el-option
-                  v-for="item in yesOrNo"
-                  :key="item.label"
-                  :label="item.label"
-                  :value="item.value"
-                />
-              </el-select>
+          </el-form-item>
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title">项目代码:</span>
+              <el-input
+                v-model="form.project_code"
+                placeholder="项目代码"
+                class="wd"
+              ></el-input>
             </div>
-          </div>
-        </el-form-item>
-      </div>
-
-      <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.available_approval_id"></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-date-picker
-              v-model="form.available_approval_date"
-              type="date"
-              style="width: 100%"
-              placeholder="可研批复时间"
-              format="YYYY-MM-DD"
-              value-format="YYYY-MM-DD"
-            />
-          </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>
-            <div class="full-width">
-              <el-select
-                v-model="form.is_provincial_level_construction"
-                placeholder="是否纳入省集中开工"
-                class="full-width"
-              >
-                <el-option
-                  v-for="item in yesOrNo"
-                  :key="item.label"
-                  :label="item.label"
-                  :value="item.value"
-                />
-              </el-select>
+          </el-form-item>
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title">可研批复号:</span>
+              <el-input
+                v-model="form.available_approval_id"
+                placeholder="可研批复号"
+                class="wd"
+              ></el-input>
+            </div>
+          </el-form-item>
+        </div>
+        <!--    入库信息 2   -->
+        <div class="flex flex-col ml-20">
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title1">计划入库时间:</span>
+              <el-date-picker
+                v-model="form.plan_storage_time"
+                type="date"
+                placeholder="计划入库时间"
+                format="YYYY-MM-DD"
+                value-format="YYYY-MM-DD"
+                style="width: 260px"
+              />
+            </div>
+          </el-form-item>
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title1">监管平台代码:</span>
+              <el-input
+                v-model="form.regulatory_platform_code"
+                placeholder="监管平台代码"
+                class="wd"
+              ></el-input>
+            </div>
+          </el-form-item>
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title1">可研批复时间:</span>
+              <el-date-picker
+                style="width: 260px"
+                v-model="form.available_approval_date"
+                type="date"
+                placeholder="可研批复时间"
+                format="YYYY-MM-DD"
+                value-format="YYYY-MM-DD"
+              />
             </div>
-          </div>
-        </el-form-item>
+          </el-form-item>
+        </div>
+        <!--    入库信息 3   -->
+        <div class="flex flex-col ml-20">
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title2">实际入库时间:</span>
+              <el-date-picker
+                v-model="form.storage_time"
+                type="date"
+                placeholder="实际入库时间"
+                format="YYYY-MM-DD"
+                value-format="YYYY-MM-DD"
+                style="width: 100%"
+                @change="changeStorageTime"
+              />
+            </div>
+          </el-form-item>
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title2">是否纳入省集中开工:</span>
+              <div class="full-width">
+                <el-select
+                  v-model="form.is_provincial_level_construction"
+                  placeholder="是否纳入省集中开工"
+                  class="full-width"
+                >
+                  <el-option
+                    v-for="item in yesOrNo"
+                    :key="item.label"
+                    :label="item.label"
+                    :value="item.value"
+                  />
+                </el-select>
+              </div>
+            </div>
+          </el-form-item>
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title2 nowrap">是否纳入省重点项目:</span>
+              <div class="full-width">
+                <el-select v-model="form.is_provincial_key" style="width: 100%">
+                  <el-option
+                    v-for="item in yesOrNo"
+                    :key="item.label"
+                    :label="item.label"
+                    :value="item.value"
+                  />
+                </el-select>
+              </div>
+            </div>
+          </el-form-item>
+        </div>
       </div>
 
       <!--    开工信息    -->
-      <div class="body_title start">开工信息</div>
-      <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>
-            <div class="full-width">
+      <div class="body_title bold">开工信息</div>
+      <div class="flex flex-center flex-justify-start">
+        <div class="flex flex-col">
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title">是否开工:</span>
               <el-select
                 v-model="form.is_start"
                 placeholder="是否开工"
-                class="full-width"
+                class="wd"
               >
                 <el-option
                   v-for="item in yesOrNo"
@@ -153,67 +161,66 @@
                 />
               </el-select>
             </div>
-          </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-date-picker
-              v-model="form.plan_commencement_time"
-              type="date"
-              style="width: 100%"
-              placeholder="计划开工时间"
-              format="YYYY-MM-DD"
-              value-format="YYYY-MM-DD"
-            />
-          </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-date-picker
-              v-model="form.start_time"
-              type="date"
-              style="width: 100%"
-              placeholder="实际开工时间"
-              format="YYYY-MM-DD"
-              value-format="YYYY-MM-DD"
-              @change="changeStartTime"
-            />
-          </div>
-        </el-form-item>
-      </div>
-      <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-date-picker
-              v-model="form.plan_completion_time"
-              type="date"
-              style="width: 100%"
-              placeholder="计划竣工时间"
-              format="YYYY-MM-DD"
-              value-format="YYYY-MM-DD"
-            />
-          </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-date-picker
-              v-model="form.completion_time"
-              type="date"
-              style="width: 100%"
-              placeholder="实际竣工时间"
-              format="YYYY-MM-DD"
-              value-format="YYYY-MM-DD"
-              @change="changeCompletionTime"
-            />
-          </div>
-        </el-form-item>
-        <el-form-item class="full-width flex-child-average">
-          <div class="flex flex-center full-width item"></div>
-        </el-form-item>
+          </el-form-item>
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title">计划竣工时间:</span>
+              <el-date-picker
+                v-model="form.plan_completion_time"
+                type="date"
+                style="width: 260px"
+                placeholder="计划竣工时间"
+                format="YYYY-MM-DD"
+                value-format="YYYY-MM-DD"
+              />
+            </div>
+          </el-form-item>
+        </div>
+        <div class="flex flex-col ml-20">
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title">计划开工时间:</span>
+              <el-date-picker
+                v-model="form.plan_commencement_time"
+                type="date"
+                style="width: 260px"
+                placeholder="计划开工时间"
+                format="YYYY-MM-DD"
+                value-format="YYYY-MM-DD"
+              />
+            </div>
+          </el-form-item>
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title">实际竣工时间:</span>
+              <el-date-picker
+                v-model="form.completion_time"
+                type="date"
+                style="width: 260px"
+                placeholder="实际竣工时间"
+                format="YYYY-MM-DD"
+                value-format="YYYY-MM-DD"
+                @change="changeCompletionTime"
+              />
+            </div>
+          </el-form-item>
+        </div>
+        <div class="flex flex-col ml-20" style="margin-bottom: 46px">
+          <el-form-item>
+            <div class="flex flex-center">
+              <span class="title2">实际开工时间:</span>
+              <el-date-picker
+                v-model="form.start_time"
+                type="date"
+                style="width: 100%"
+                placeholder="实际开工时间"
+                format="YYYY-MM-DD"
+                value-format="YYYY-MM-DD"
+                @change="changeStartTime"
+              />
+            </div>
+          </el-form-item>
+        </div>
       </div>
     </el-form>
   </wt-card>
@@ -340,20 +347,27 @@ export default {
 
 <style lang="scss" scoped>
 .body_title {
-  margin-left: 5%;
   margin-bottom: 10px;
   width: 90%;
   text-align: left;
 }
 
-.start {
-  margin-top: 20px;
+.title {
+  width: 110px;
+  text-align: right;
+  margin-right: 10px;
+}
+
+.title1 {
+  width: 110px;
+  text-align: right;
+  margin-right: 10px;
 }
 
-.title {
-  width: 240px;
-  padding-right: 10px;
+.title2 {
+  width: 200px;
   text-align: right;
+  margin-right: 10px;
 }
 
 .title-textarea {
@@ -361,7 +375,7 @@ export default {
   text-align: left;
 }
 
-.item {
-  width: 90%;
+.wd {
+  width: 260px;
 }
 </style>