Преглед на файлове

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

# Conflicts:
#	src/views/project/index.vue
scorpioyq преди 2 години
родител
ревизия
0a93607504

+ 48 - 59
src/components/area-picker/index.vue

@@ -2,77 +2,66 @@
   <div class="full-width">
     <div>
       <el-cascader
+        :placeholder="placeholder"
         clearable
         class="full-width"
-        v-model="value"
-        :options="dic"
+        v-model="area"
+        :options="areaDic"
+        filterable
+        @change="changeArea"
       />
     </div>
   </div>
 </template>
-
 <script>
 export default {
+  props: {
+    placeholder: {
+      type: String,
+      default: ''
+    }
+  },
   data() {
     return {
-      treeOption: {
-        nodeKey: 'id',
-        lazy: true,
-        addBtn: false,
-        menu: false,
-        size: 'small',
-        props: {
-          labelText: '标题',
-          label: 'title',
-          value: 'value',
-          children: 'children'
-        }
-      },
       form: {},
-      dic: [
-        {
-          value: 'guide',
-          label: 'Guide',
-          children: [
-            {
-              value: 'disciplines',
-              label: 'Disciplines',
-              children: [
-                {
-                  value: 'consistency',
-                  label: 'Consistency'
-                },
-                {
-                  value: 'feedback',
-                  label: 'Feedback'
-                },
-                {
-                  value: 'efficiency',
-                  label: 'Efficiency'
-                },
-                {
-                  value: 'controllability',
-                  label: 'Controllability'
-                }
-              ]
-            },
-            {
-              value: 'navigation',
-              label: 'Navigation',
-              children: [
-                {
-                  value: 'side nav',
-                  label: 'Side Navigation'
-                },
-                {
-                  value: 'top nav',
-                  label: 'Top Navigation'
-                }
-              ]
-            }
-          ]
+      areaDic: [],
+      area: ''
+    }
+  },
+  mounted() {
+    this.getArea()
+  },
+  methods: {
+    getArea() {
+      const tmp = localStorage.getItem('area')
+      if (tmp) {
+        this.areaDic = JSON.parse(tmp)
+        return
+      }
+      this.$api.common.region({ code: '' }).then(res => {
+        if (res.code === 200) {
+          const list = res.data.filter(ele => ele.key !== '111111')
+          this.areaDic = list.map(item => this.mapTree(item))
+          localStorage.setItem('area', JSON.stringify(this.areaDic))
         }
-      ]
+      })
+    },
+    mapTree(item) {
+      const haveChildren =
+        Array.isArray(item.children) && item.children.length > 0
+      return {
+        key: item,
+        value: item,
+        label: item.title,
+        children: haveChildren ? item.children.map(i => this.mapTree(i)) : []
+      }
+    },
+    changeArea(res) {
+      const tmps = res.map(ele => {
+        return { key: ele.key, title: ele.title }
+      })
+      console.log(this.area)
+      this.$emit('change', tmps)
     }
   }
 }

+ 3 - 2
src/components/wt-card/index.vue

@@ -37,11 +37,12 @@ export default {
   },
   methods: {
     change() {
-      this.btnText = this.btnText === '编 辑' ? '保 存' : '编 辑'
-      this.$emit('change', this.btnText === '编 辑')
       if (this.btnText === '保 存') {
         this.$emit('save')
       }
+      console.log('fff')
+      this.btnText = this.btnText === '编 辑' ? '保 存' : '编 辑'
+      this.$emit('edit', this.btnText === '编 辑')
     }
   }
 }

+ 0 - 1
src/views/home/component/params/params1.vue

@@ -436,7 +436,6 @@ export default {
             if (tmp) {
               this.form.dict_value = tmp.dictValue
             }
-            console.log(tmp)
           }
         })
     },

+ 37 - 6
src/views/project/componens/info1.vue

@@ -1,5 +1,5 @@
 <template>
-  <wt-card title="基础信息" :edit-btn="true" @change="change" @save="save">
+  <wt-card title="基础信息" :edit-btn="true" @edit="change" @save="save">
     <el-form class="mt-20" :disabled="disabled">
       <div class="flex flex-justify-center" v-watermark="{ text: '33' }">
         <el-form-item class="full-width flex-child-average">
@@ -25,7 +25,16 @@
         <el-form-item class="full-width flex-child-average">
           <div class="flex flex-center full-width item">
             <span class="title">地区:</span>
-            <area-picker />
+            <area-picker
+              :placeholder="
+                form.province_name +
+                '/' +
+                form.city_name +
+                '/' +
+                form.district_name
+              "
+              @change="changeArea"
+            />
           </div>
         </el-form-item>
       </div>
@@ -45,7 +54,10 @@
         <el-form-item class="full-width flex-child-average">
           <div class="flex flex-center full-width item">
             <span class="title">责任领导:</span>
-            <el-input placeholder="请输入责任领导"></el-input>
+            <el-input
+              placeholder="请输入责任领导"
+              v-model="form.responsible_leader"
+            ></el-input>
           </div>
         </el-form-item>
       </div>
@@ -53,7 +65,10 @@
         <el-form-item class="full-width flex-child-average">
           <div class="flex flex-center full-width item">
             <span class="title">联系电话:</span>
-            <el-input placeholder="请输入责任领导联系电话"></el-input>
+            <el-input
+              placeholder="请输入责任领导联系电话"
+              v-model="form.responsible_leader_phone"
+            ></el-input>
           </div>
         </el-form-item>
         <el-form-item class="full-width flex-child-average">
@@ -93,7 +108,8 @@
             <span class="title-textarea">建设规模:</span>
             <el-input
               type="textarea"
-              placeholder="请输入建设规模"
+              placeholder="请输入建设规模(250 个字以内)"
+              v-model="form.construction_scale"
               :rows="5"
             ></el-input>
           </div>
@@ -108,8 +124,10 @@
             <span class="title-textarea">建设内容:</span>
             <el-input
               type="textarea"
-              placeholder="请输入建设内容"
+              placeholder="请输入建设内容(250 个字以内)"
+              :maxlength="250"
               :rows="5"
+              v-model="form.construction_content"
             ></el-input>
           </div>
         </el-form-item>
@@ -152,9 +170,22 @@ export default {
   methods: {
     save() {
       console.log('save')
+      this.$api.project.proUpdate(this.form).then(res => {
+        if (res.code === 200) {
+          console.log(res)
+        }
+      })
     },
     change(res) {
       this.disabled = res
+    },
+    changeArea(list) {
+      this.form.province_code = list[0].key
+      this.form.province_name = list[0].title
+      this.form.city_code = list[1].key
+      this.form.city_name = list[1].title
+      this.form.district_code = list[2].key
+      this.form.district_name = list[2].title
     }
   }
 }

+ 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>

+ 280 - 9
src/views/project/componens/info7.vue

@@ -1,32 +1,220 @@
 <template>
   <wt-card
-    title="建成投产后效益测算"
+    title="其他信息"
     class="mt-10"
     :edit-btn="true"
     @change="change"
     @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>
-            <el-input v-model="form.benefit_annual_output"></el-input>
+            <span class="title">是否入库:</span>
+            <div class="full-width">
+              <el-select
+                v-model="form.is_storage"
+                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 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>
+            <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-input v-model="form.benefit_new_employment"></el-input>
+            <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>
+            </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>
+            </div>
+          </div>
+        </el-form-item>
+      </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">
+              <el-select
+                v-model="form.is_start"
+                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 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>
+      </div>
     </el-form>
   </wt-card>
 </template>
@@ -56,13 +244,40 @@ export default {
   },
   data() {
     return {
+      yesOrNo: [
+        {
+          label: '否',
+          value: 0
+        },
+        {
+          label: '是',
+          value: 1
+        }
+      ],
       disabled: true,
       form: {}
     }
   },
   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)
@@ -71,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
     }
@@ -79,8 +339,19 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.body_title {
+  margin-left: 5%;
+  margin-bottom: 10px;
+  width: 90%;
+  text-align: left;
+}
+
+.start {
+  margin-top: 20px;
+}
+
 .title {
-  width: 120px;
+  width: 240px;
   padding-right: 10px;
   text-align: right;
 }

+ 3 - 0
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" />
       <info8 :project-id="projectId" />
     </div>
@@ -48,6 +49,7 @@ 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'
 import Info8 from '@/views/project/componens/info8.vue'
 
@@ -57,6 +59,7 @@ export default {
     Info1,
     Info4,
     Info5,
+    Info6,
     Info7,
     tipsCustom,
     top,