scorpio 2 gadi atpakaļ
vecāks
revīzija
70222fd8b9

+ 5 - 3
src/components/tips-custom/index.vue

@@ -13,9 +13,11 @@
         @click="$router.back()"
         v-if="nav.menus[nav.menus.length - 1].meta.back !== undefined"
       ></el-button>
-      <span class="ml-10 tools font-24">{{
-        nav.menus[nav.menus.length - 1].name
-      }}</span>
+      <slot name="title">
+        <span class="ml-10 tools font-24">{{
+          nav.menus[nav.menus.length - 1].name
+        }}</span>
+      </slot>
     </div>
     <slot />
   </div>

+ 2 - 2
src/views/home/component/dash.vue

@@ -711,8 +711,8 @@ export default {
         window.open(routeData.href, '_blank')
       } else if (type === 'view') {
         const routeData = this.$router.resolve({
-          path: '/home/pro_detail',
-          query: { id: this.form.id, projectStage: this.form.project_stage }
+          path: '/project',
+          query: { id: this.form.id }
         })
         window.open(routeData.href, '_blank')
       }

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

@@ -15,7 +15,7 @@
 
 <route>
 {
-path: '/project',
+path: '/projects',
 name: '项目管理',
 meta: {keepAlive: true,show: false}
 }

+ 71 - 0
src/views/project/componens/top.vue

@@ -0,0 +1,71 @@
+<template>
+  <div>
+    <div class="white-bg border radius-5 picker flex flex-center">
+      <span class="padding">项目阶段:</span>
+      <el-select
+        class="padding-right"
+        style="width: 200px"
+        clearable
+        v-model="stage"
+      >
+        <el-option
+          v-for="item in stages"
+          :key="item.id"
+          :label="item.name"
+          :value="item.id"
+        />
+      </el-select>
+    </div>
+  </div>
+</template>
+
+<script>
+import confing from '@/config/website.js'
+
+export default {
+  props: {
+    projectId: {
+      required: true,
+      type: String,
+      default: ''
+    }
+  },
+  watch: {
+    projectId: {
+      handler(val) {
+        if (val.length > 0) {
+          this.getStage()
+        }
+      },
+      immediate: true
+    }
+  },
+  data() {
+    return {
+      stages: [],
+      stage: ''
+    }
+  },
+  methods: {
+    /**
+     * 获取项目阶段
+     */
+    getStage() {
+      this.$api.project
+        .includeStage({ projectId: this.projectId })
+        .then(res => {
+          if (res.code === 200) {
+            this.stages = res.data
+            this.stage = this.stages.find(ele => ele.isLastSelect === 1).id
+          }
+        })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+:deep(.el-input__wrapper) {
+  box-shadow: none;
+}
+</style>

+ 84 - 0
src/views/project/index.vue

@@ -0,0 +1,84 @@
+<template>
+  <div>
+    <tips-custom>
+      <template #title>
+        <span class="font-24 bold">{{ detail.name }}</span>
+        <el-tag class="ml-20">{{ detail.tagsName }}</el-tag>
+        <el-tag class="ml-10">{{ detail.report_type_name }}</el-tag>
+      </template>
+      <template #default>
+        <top :project-id="projectId" />
+      </template>
+    </tips-custom>
+    <!--    content-->
+    <div>
+      <el-card>
+        <div style="height: 4200px"></div>
+      </el-card>
+    </div>
+    <!--    buttom-->
+    <div class="bottom flex flex-center flex-justify-end">
+      <div class="padding">
+        <el-button type="primary" plain>退 库</el-button>
+        <el-button type="primary" plain>上报审核</el-button>
+        <el-button type="primary">上报到固定资产</el-button>
+      </div>
+    </div>
+  </div>
+</template>
+
+<route>
+{
+path: '/project',
+name: '项目详情',
+meta: { layout: 'empty','show': false}
+}
+</route>
+
+<script>
+import tipsCustom from '@/components/tips-custom/index.vue'
+import top from '@/views/project/componens/top.vue'
+import confing from '@/config/website.js'
+
+export default {
+  components: { tipsCustom, top },
+  data() {
+    return {
+      projectId: '',
+      detail: {}
+    }
+  },
+  mounted() {
+    this.projectId = this.$route.query.id
+    this.getInfo()
+  },
+  methods: {
+    getInfo() {
+      this.$api.project.projectMapInfo(this.projectId).then(res => {
+        if (res.code === 200) {
+          this.detail = res.data
+          this.detail.tagsName =
+            this.detail.tags === 1 ? '政府投资项目' : '企业投资项目'
+          const status = confing.reportTypes.find(
+            ele => ele.value === this.detail.report_type
+          )
+          if (status) {
+            this.detail.report_type_name = status.label
+          }
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.bottom {
+  position: fixed;
+  bottom: 0;
+  height: 66px;
+  width: 1300px;
+  background-color: white;
+  box-shadow: 0px -5px 10px rgba(52, 52, 52, 0.1);
+}
+</style>