Browse Source

2023-08-24

weirenchun 2 years ago
parent
commit
9feddc1daf

+ 96 - 0
src/views/project/componens/info6.vue

@@ -0,0 +1,96 @@
+<template>
+  <wt-card
+    title="年度投资情况(单位:万元)"
+    class="mt-10"
+    :edit-btn="true"
+    @change="change"
+    @save="save"
+  >
+    <el-form class="mt-20" :disabled="disabled">
+      <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.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>
+            <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>
+            <el-input v-model="form.benefit_new_employment"></el-input>
+          </div>
+        </el-form-item>
+      </div>
+    </el-form>
+  </wt-card>
+</template>
+
+<script>
+import wtCard from '@/components/wt-card/index.vue'
+
+export default {
+  components: {
+    wtCard
+  },
+  props: {
+    info: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  watch: {
+    info: {
+      handler(val) {
+        this.form = val
+      },
+      immediate: true
+    }
+  },
+  data() {
+    return {
+      disabled: true,
+      form: {}
+    }
+  },
+  methods: {
+    save() {
+      console.log('save')
+      this.$api.project.proUpdate(this.form).then(res => {
+        if (res.code === 200) {
+          this.$message.success(res.msg)
+        } else {
+          this.$message.error(res.msg)
+        }
+      })
+    },
+    change(res) {
+      this.disabled = res
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.title {
+  width: 120px;
+  padding-right: 10px;
+  text-align: right;
+}
+
+.title-textarea {
+  width: 85px;
+  text-align: left;
+}
+
+.item {
+  width: 90%;
+}
+</style>

+ 66 - 1
src/views/project/componens/info7.vue

@@ -52,6 +52,7 @@
               placeholder="实际入库时间"
               format="YYYY-MM-DD"
               value-format="YYYY-MM-DD"
+              @change="changeStorageTime"
             />
           </div>
         </el-form-item>
@@ -177,6 +178,7 @@
               placeholder="实际开工时间"
               format="YYYY-MM-DD"
               value-format="YYYY-MM-DD"
+              @change="changeStartTime"
             />
           </div>
         </el-form-item>
@@ -205,6 +207,7 @@
               placeholder="实际竣工时间"
               format="YYYY-MM-DD"
               value-format="YYYY-MM-DD"
+              @change="changeCompletionTime"
             />
           </div>
         </el-form-item>
@@ -256,8 +259,25 @@ export default {
     }
   },
   methods: {
+    changeStorageTime(res) {
+      if (new Date().getTime() < new Date(res).getTime()) {
+        this.$message.warning('实际入库时间不能大于当前时间!')
+      }
+    },
+    changeStartTime(res) {
+      if (new Date().getTime() < new Date(res).getTime()) {
+        this.$message.warning('实际开工时间不能大于当前时间!')
+      }
+    },
+    changeCompletionTime(res) {
+      if (new Date().getTime() < new Date(res).getTime()) {
+        this.$message.warning('实际竣工时间不能大于当前时间!')
+      }
+    },
     save() {
-      console.log('save')
+      if (this.check()) {
+        return
+      }
       this.$api.project.proUpdate(this.form).then(res => {
         if (res.code === 200) {
           this.$message.success(res.msg)
@@ -266,6 +286,51 @@ export default {
         }
       })
     },
+    check() {
+      if (new Date().getTime() < new Date(this.form.storage_time).getTime()) {
+        this.$message.error('实际入库时间不能大于当前时间!')
+        return true
+      }
+      if (new Date().getTime() < new Date(this.form.start_time).getTime()) {
+        this.$message.error('实际开工时间不能大于当前时间!')
+        return true
+      }
+      if (
+        new Date().getTime() < new Date(this.form.completion_time).getTime()
+      ) {
+        this.$message.error('实际竣工时间不能大于当前时间!')
+        return true
+      }
+      if (this.form.is_storage == 1) {
+        if (this.form.storage_time == null || this.form.storage_time == '') {
+          this.$message.error('请填写入库时间!')
+          return true
+        }
+      }
+      if (this.form.is_start == 1) {
+        if (this.form.start_time == null || this.form.start_time == '') {
+          this.$message.error('请填写开工时间!')
+          return true
+        }
+      }
+      if (this.form.tags == 1) {
+        //政府投资项目 必须要有可研批复号
+        if (
+          this.form.available_approval_id == '' ||
+          this.form.available_approval_id == null
+        ) {
+          this.$message.error('请填写可研批复号!')
+          return true
+        }
+      }
+      //企业投资项目 必须要有项目代码
+      if (this.form.tags == 2) {
+        if (this.form.project_code == '' || this.form.project_code == null) {
+          this.$message.error('请填写项目代码!')
+          return true
+        }
+      }
+    },
     change(res) {
       this.disabled = res
     }

+ 13 - 1
src/views/project/index.vue

@@ -17,6 +17,7 @@
       <info3 :project-id="projectId" :stage-id="stageId" />
       <info4 :info="detail" />
       <info5 :info="detail" />
+      <info6 :info="detail" />
       <info7 :info="detail" />
     </div>
     <!--    buttom-->
@@ -47,10 +48,21 @@ import Info2 from '@/views/project/componens/info2.vue'
 import info3 from '@/views/project/componens/info3.vue'
 import Info4 from '@/views/project/componens/info4.vue'
 import Info5 from '@/views/project/componens/info5.vue'
+import Info6 from '@/views/project/componens/info6.vue'
 import Info7 from '@/views/project/componens/info7.vue'
 
 export default {
-  components: { Info2, Info1, Info4, Info5, Info7, tipsCustom, top, info3 },
+  components: {
+    Info2,
+    Info1,
+    Info4,
+    Info5,
+    Info6,
+    Info7,
+    tipsCustom,
+    top,
+    info3
+  },
   data() {
     return {
       projectId: '',