index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <div>
  3. <tips-custom>
  4. <template #title>
  5. <span class="font-24 bold">{{ detail.name }}</span>
  6. <el-tag class="ml-20">{{ detail.tagsName }}</el-tag>
  7. <el-tag class="ml-10">{{ detail.report_type_name }}</el-tag>
  8. </template>
  9. <template #default>
  10. <top
  11. :project-id="projectId"
  12. @change="changeStage"
  13. @filter="filterStage"
  14. />
  15. </template>
  16. </tips-custom>
  17. <!-- content-->
  18. {{ currentStage }}
  19. <div style="margin-bottom: 65px">
  20. <div v-if="[1, 2].includes(currentStage)">
  21. <!-- 基础信息-->
  22. <info1 :info="detail" @industry="changeIndustry" />
  23. </div>
  24. <!-- 前期要件-->
  25. <info2
  26. v-if="[2, 3].includes(currentStage)"
  27. :project-id="projectId"
  28. :stage-id="stageId"
  29. :industry="industry"
  30. />
  31. <!-- 相关合同-->
  32. <info3 :project-id="projectId" :stage-id="stageId" />
  33. <!-- 投资基本情况-->
  34. <info4 v-if="[4].includes(currentStage)" :project-id="projectId" />
  35. <!-- 建成投产后效益测算-->
  36. <info5 v-if="currentStage === 2" :info="detail" />
  37. <!-- 年度投资情况-->
  38. <info6 v-if="currentStage === 4" :project-id="projectId" />
  39. <!-- 其他信息-->
  40. <info7 v-if="[2, 4, 5].includes(currentStage)" :info="detail" />
  41. <!-- 任务列表-->
  42. <info8 v-if="user.info.type === 4" :project-id="projectId" />
  43. </div>
  44. <!-- buttom-->
  45. <div class="bottom flex flex-center flex-justify-end">
  46. <div class="padding">
  47. <el-button type="primary" plain @click="projectCancel">退 库</el-button>
  48. <el-button
  49. type="primary"
  50. v-if="detail.is_report === 0"
  51. @click="projectReport"
  52. plain
  53. >上报审核</el-button
  54. >
  55. <el-button type="primary" plain v-if="detail.report_type === 3"
  56. >上报到固定资产</el-button
  57. >
  58. <el-button type="primary" @click="nextStage">下一阶段</el-button>
  59. </div>
  60. </div>
  61. </div>
  62. </template>
  63. <route>
  64. {
  65. path: '/project',
  66. name: '项目详情',
  67. meta: { layout: 'empty','show': false}
  68. }
  69. </route>
  70. <script>
  71. import tipsCustom from '@/components/tips-custom/index.vue'
  72. import top from '@/views/project/componens/top.vue'
  73. import confing from '@/config/website.js'
  74. import Info1 from '@/views/project/componens/info1.vue'
  75. import Info2 from '@/views/project/componens/info2.vue'
  76. import info3 from '@/views/project/componens/info3.vue'
  77. import Info4 from '@/views/project/componens/info4.vue'
  78. import Info5 from '@/views/project/componens/info5.vue'
  79. import Info6 from '@/views/project/componens/info6.vue'
  80. import Info7 from '@/views/project/componens/info7.vue'
  81. import Info8 from '@/views/project/componens/info8.vue'
  82. import { useStore } from '@/store/user.js'
  83. export default {
  84. components: {
  85. Info2,
  86. Info1,
  87. Info4,
  88. Info5,
  89. Info6,
  90. Info7,
  91. tipsCustom,
  92. top,
  93. info3,
  94. Info8
  95. },
  96. setup() {
  97. const user = useStore()
  98. return { user }
  99. },
  100. data() {
  101. return {
  102. projectId: '',
  103. stageId: '',
  104. currentStage: 1,
  105. industry: null,
  106. detail: {}
  107. }
  108. },
  109. mounted() {
  110. this.projectId = this.$route.query.id
  111. this.getInfo()
  112. },
  113. methods: {
  114. getInfo() {
  115. this.$api.project.projectMapInfo(this.projectId).then(res => {
  116. if (res.code === 200) {
  117. this.detail = res.data
  118. delete this.detail._id
  119. this.stageId = res.data.stageId
  120. this.currentStage = res.data.current_stage
  121. this.detail.tagsName =
  122. this.detail.tags === 1 ? '政府投资项目' : '企业投资项目'
  123. const status = confing.reportTypes.find(
  124. ele => ele.value === this.detail.report_type
  125. )
  126. this.industry = this.detail.dict_key[0]
  127. if (status) {
  128. this.detail.report_type_name = status.label
  129. }
  130. }
  131. })
  132. },
  133. changeStage(res) {
  134. this.stageId = res
  135. },
  136. changeIndustry(industry) {
  137. this.industry = industry
  138. },
  139. filterStage(res) {
  140. this.currentStage = res
  141. },
  142. nextStage() {
  143. this.$confirm(
  144. '请检查当前阶段信息是否完善,点击确定后项目将进行下一个阶段',
  145. {
  146. confirmButtonText: '确定',
  147. cancelButtonText: '取消',
  148. type: 'warning'
  149. }
  150. ).then(res => {
  151. if (res === 'confirm') {
  152. this.currentStage = this.currentStage + 1
  153. this.detail.current_stage = this.currentStage
  154. this.update()
  155. }
  156. })
  157. },
  158. update() {
  159. this.$api.project.proUpdate(this.detail).then(res => {
  160. if (res.code === 200) {
  161. this.$message.success(res.msg)
  162. } else {
  163. this.$message.error(res.msg)
  164. }
  165. })
  166. },
  167. /**
  168. * 股室上报项目到管理员
  169. */
  170. projectReport() {
  171. this.$confirm('确认上报至管理员进行审核?').then(ele => {
  172. if (ele === 'confirm') {
  173. this.$api.project.upReportType({ id: this.projectId }).then(res => {
  174. if (res.code === 200) {
  175. this.$message.success(res.msg)
  176. } else {
  177. this.$message.error(res.msg)
  178. }
  179. })
  180. }
  181. })
  182. },
  183. /**
  184. * 管理员已经审核通过的项目,上报到固定资产
  185. */
  186. projectReportFormal() {
  187. this.$confirm('确定上报到固定资产?').then(res => {
  188. if (res === 'confirm') {
  189. this.$api.project
  190. .reportToAssets({ ids: this.projectId })
  191. .then(res => {
  192. if (res.code === 200) {
  193. this.$message.success(res.msg)
  194. } else {
  195. this.$message.error(res.msg)
  196. }
  197. })
  198. }
  199. })
  200. },
  201. /**
  202. * 项目退库
  203. */
  204. projectCancel() {
  205. console.log('rrrr')
  206. this.$prompt('请输入退库原因', '提示', {}).then(({ value }) => {
  207. if (value === null || value.length === 0) {
  208. this.$message.error('请输入退库原因')
  209. return
  210. }
  211. this.$api.project
  212. .projectCancel({ id: this.projectId, exitMsg: value })
  213. .then(res => {
  214. if (res.code === 200) {
  215. this.$message.success(res.msg)
  216. this.refreshChange()
  217. } else {
  218. this.$message.error(res.msg)
  219. }
  220. })
  221. })
  222. }
  223. }
  224. }
  225. </script>
  226. <style lang="scss" scoped>
  227. .bottom {
  228. position: fixed;
  229. bottom: 0;
  230. z-index: 3;
  231. height: 68px;
  232. width: 1300px;
  233. background-color: white;
  234. box-shadow: 0px -5px 10px rgba(52, 52, 52, 0.1);
  235. }
  236. </style>