소스 검색

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

scorpioyq 2 년 전
부모
커밋
7dcd68defa
5개의 변경된 파일152개의 추가작업 그리고 32개의 파일을 삭제
  1. 12 14
      src/views/home/component/dash.vue
  2. 11 7
      src/views/project/componens/info1.vue
  3. 1 0
      src/views/project/componens/info3.vue
  4. 3 1
      src/views/project/componens/top.vue
  5. 125 10
      src/views/project/index.vue

+ 12 - 14
src/views/home/component/dash.vue

@@ -186,7 +186,15 @@
           </div>
         </div>
       </template>
-
+      <template #dict_key="{ row }">
+        <el-tag>
+          {{
+            typeof row.dict_key === 'object'
+              ? row.dict_key.map(ele => ele.title).join('/')
+              : ''
+          }}
+        </el-tag>
+      </template>
       <template #plan_commencement_time-header="{ column }">
         <div class="flex flex-center">
           <div class="mr-5">{{ (column || {}).label }}</div>
@@ -491,13 +499,8 @@ export default {
           {
             label: '行业分类',
             prop: 'dict_key',
-            width: 120,
-            dicUrl:
-              '/api/blade-system/dict-biz/dictionary?code=industry-classification',
-            props: {
-              label: 'dictValue',
-              value: 'dictKey'
-            }
+            width: 200,
+            slot: true
           },
           {
             label: '是否入库',
@@ -550,11 +553,6 @@ export default {
             prop: 'report_time',
             width: 120
           },
-          {
-            label: '认定时间',
-            prop: 'year',
-            width: 120
-          },
           {
             label: '项目状态',
             prop: 'report_type',
@@ -1038,7 +1036,7 @@ export default {
       }
     },
     changeIndustry(list) {
-      this.projectForm.dictKey = JSON.stringify(list)
+      this.projectForm.dictKey = list
     }
   }
 }

+ 11 - 7
src/views/project/componens/info1.vue

@@ -1,5 +1,10 @@
 <template>
-  <wt-card title="基础信息" :edit-btn="true" @edit="change" @save="save">
+  <wt-card
+    title="基础信息"
+    :edit-btn="form.can_update"
+    @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">
@@ -63,7 +68,7 @@
             <span class="title">责任单位:</span>
             <el-select
               v-model="form.responsible_unit"
-              placeholder="请选择项目标签"
+              placeholder="请选择责任单位"
               class="full-width"
             >
               <el-option
@@ -100,7 +105,7 @@
             <span class="title">所属行业:</span>
             <industry-picker
               :placeholder="
-                form.dict_key
+                form.dict_key && typeof form.dict_key === 'object'
                   ? form.dict_key.map(ele => ele.title).join('/')
                   : ''
               "
@@ -131,7 +136,7 @@
           <div class="flex flex-center full-width item">
             <span class="title">民间投资项目:</span>
             <el-select
-              v-model="form.social_investment"
+              v-model="form.industrial_investment"
               placeholder="是否民间投资项目"
               class="full-width"
             >
@@ -148,7 +153,7 @@
           <div class="flex flex-center full-width item">
             <span class="title">获得资金支持:</span>
             <el-select
-              v-model="form.social_investment"
+              v-model="form.is_funded_project"
               placeholder="是否获得资金支持"
               class="full-width"
             >
@@ -314,7 +319,6 @@ export default {
         value: this.form.competent_unit
       }
       this.deptDic.push(local)
-      console.log(this.deptDic)
       this.$api.system
         .getDeptLazy({ parentId: this.form.competent_unit, deptCategory: 3 })
         .then(res => {
@@ -348,7 +352,7 @@ export default {
       }
       this.$api.project.proUpdate(this.form).then(res => {
         if (res.code === 200) {
-          console.log(res)
+          this.$message.success(res.msg)
         }
       })
     },

+ 1 - 0
src/views/project/componens/info3.vue

@@ -20,6 +20,7 @@
         <template #menu-left>
           <div class="flex flex-center">
             <filepicker
+              v-if="form.can_update"
               btn-text="新增合同"
               :project-id="projectId"
               @submit="selection"

+ 3 - 1
src/views/project/componens/top.vue

@@ -11,7 +11,7 @@
       >
         <el-option
           v-for="item in stages"
-          :key="item.id"
+          :key="item"
           :label="item.name"
           :value="item.id"
         />
@@ -66,6 +66,8 @@ export default {
         })
     },
     changeStage(res) {
+      const tmp = this.stages.find(ele => ele.id === res)
+      this.$emit('filter', tmp.sort)
       this.$api.project
         .changeStage({ projectId: this.projectId, stageId: res })
         .then(res => {

+ 125 - 10
src/views/project/index.vue

@@ -7,26 +7,55 @@
         <el-tag class="ml-10">{{ detail.report_type_name }}</el-tag>
       </template>
       <template #default>
-        <top :project-id="projectId" @change="changeStage" />
+        <top
+          :project-id="projectId"
+          @change="changeStage"
+          @filter="filterStage"
+        />
       </template>
     </tips-custom>
     <!--    content-->
+    {{ currentStage }}
     <div style="margin-bottom: 65px">
-      <info1 :info="detail" @industry="changeIndustry" />
-      <info2 :project-id="projectId" :stage-id="stageId" :industry="industry" />
+      <div v-if="[1, 2].includes(currentStage)">
+        <!--        基础信息-->
+        <info1 :info="detail" @industry="changeIndustry" />
+      </div>
+      <!--      前期要件-->
+      <info2
+        v-if="[2, 3].includes(currentStage)"
+        :project-id="projectId"
+        :stage-id="stageId"
+        :industry="industry"
+      />
+      <!--      相关合同-->
       <info3 :project-id="projectId" :stage-id="stageId" />
-      <info4 :project-id="projectId" />
-      <info5 :info="detail" />
-      <info6 :project-id="projectId" />
-      <info7 :info="detail" />
+      <!--      投资基本情况-->
+      <info4 v-if="[4].includes(currentStage)" :project-id="projectId" />
+      <!--      建成投产后效益测算-->
+      <info5 v-if="currentStage === 2" :info="detail" />
+      <!--      年度投资情况-->
+      <info6 v-if="currentStage === 4" :project-id="projectId" />
+      <!--      其他信息-->
+      <info7 v-if="[2, 4, 5].includes(currentStage)" :info="detail" />
+      <!--      任务列表-->
       <info8 v-if="user.info.type === 4" :project-id="projectId" />
     </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>
+        <el-button type="primary" plain @click="projectCancel">退 库</el-button>
+        <el-button
+          type="primary"
+          v-if="detail.is_report === 0"
+          @click="projectReport"
+          plain
+          >上报审核</el-button
+        >
+        <el-button type="primary" plain v-if="detail.report_type === 3"
+          >上报到固定资产</el-button
+        >
+        <el-button type="primary" @click="nextStage">下一阶段</el-button>
       </div>
     </div>
   </div>
@@ -75,6 +104,7 @@ export default {
     return {
       projectId: '',
       stageId: '',
+      currentStage: 1,
       industry: null,
       detail: {}
     }
@@ -90,6 +120,7 @@ export default {
           this.detail = res.data
           delete this.detail._id
           this.stageId = res.data.stageId
+          this.currentStage = res.data.current_stage
           this.detail.tagsName =
             this.detail.tags === 1 ? '政府投资项目' : '企业投资项目'
           const status = confing.reportTypes.find(
@@ -107,6 +138,90 @@ export default {
     },
     changeIndustry(industry) {
       this.industry = industry
+    },
+    filterStage(res) {
+      this.currentStage = res
+    },
+    nextStage() {
+      this.$confirm(
+        '请检查当前阶段信息是否完善,点击确定后项目将进行下一个阶段',
+        {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }
+      ).then(res => {
+        if (res === 'confirm') {
+          this.currentStage = this.currentStage + 1
+          this.detail.current_stage = this.currentStage
+          this.update()
+        }
+      })
+    },
+    update() {
+      this.$api.project.proUpdate(this.detail).then(res => {
+        if (res.code === 200) {
+          this.$message.success(res.msg)
+        } else {
+          this.$message.error(res.msg)
+        }
+      })
+    },
+    /**
+     * 股室上报项目到管理员
+     */
+    projectReport() {
+      this.$confirm('确认上报至管理员进行审核?').then(ele => {
+        if (ele === 'confirm') {
+          this.$api.project.upReportType({ id: this.projectId }).then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+            } else {
+              this.$message.error(res.msg)
+            }
+          })
+        }
+      })
+    },
+    /**
+     * 管理员已经审核通过的项目,上报到固定资产
+     */
+    projectReportFormal() {
+      this.$confirm('确定上报到固定资产?').then(res => {
+        if (res === 'confirm') {
+          this.$api.project
+            .reportToAssets({ ids: this.projectId })
+            .then(res => {
+              if (res.code === 200) {
+                this.$message.success(res.msg)
+              } else {
+                this.$message.error(res.msg)
+              }
+            })
+        }
+      })
+    },
+    /**
+     * 项目退库
+     */
+    projectCancel() {
+      console.log('rrrr')
+      this.$prompt('请输入退库原因', '提示', {}).then(({ value }) => {
+        if (value === null || value.length === 0) {
+          this.$message.error('请输入退库原因')
+          return
+        }
+        this.$api.project
+          .projectCancel({ id: this.projectId, exitMsg: value })
+          .then(res => {
+            if (res.code === 200) {
+              this.$message.success(res.msg)
+              this.refreshChange()
+            } else {
+              this.$message.error(res.msg)
+            }
+          })
+      })
     }
   }
 }