detail.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <view class="page">
  3. <view class="content">
  4. <view class="head"> <view class="title"> 项目详情 </view></view>
  5. <view class="main">
  6. <view class="list">
  7. <view class="detail">
  8. <span class="subTitle">项目名称:</span>
  9. <span class="detailContent">{{ currentProject.project_name }}</span>
  10. </view>
  11. <view class="detail" v-if="currentProject.TypeInfo">
  12. <span class="subTitle">项目类别:</span>
  13. <span class="detailContent">{{
  14. currentProject.TypeInfo.name
  15. }}</span>
  16. </view>
  17. <view class="detail">
  18. <span class="subTitle">流程:</span>
  19. <span class="detailContent">{{
  20. currentProject.FlowInfo.name
  21. }}</span>
  22. </view>
  23. <view v-if="currentProject.type_id != 7">
  24. <view class="detail" v-if="currentProject.IndustryInfo">
  25. <span class="subTitle">行业名称:</span>
  26. <span class="detailContent">
  27. {{ currentProject.IndustryInfo.name }}
  28. </span>
  29. </view>
  30. <view class="detail" v-if="currentProject.location">
  31. <span class="subTitle">项目地区:</span>
  32. <span class="detailContent">
  33. {{
  34. `${currentProject.location}(${currentProject.location_code})`
  35. }}
  36. </span>
  37. </view>
  38. <view class="detail" v-if="currentProject.name">
  39. <span class="subTitle">项目简称:</span>
  40. <span class="detailContent">{{ currentProject.name }}</span>
  41. </view>
  42. <view class="detail" v-if="currentProject.version">
  43. <span class="subTitle">项目批次:</span>
  44. <span class="detailContent">{{ currentProject.version }}期</span>
  45. </view>
  46. </view>
  47. <view class="detail">
  48. <span class="subTitle">状态:</span>
  49. <span class="detailContent">
  50. {{ status[currentProject.project_status] }}
  51. </span>
  52. </view>
  53. <view class="detail">
  54. <span class="subTitle">节点:</span>
  55. <span class="detailContent">
  56. {{ `${currentProject.NodeInfo.node}(` }}
  57. <span v-if="currentProject.audit_status == 0">待提交</span>
  58. <span
  59. v-if="currentProject.audit_status == 1"
  60. :style="{ color: '#1890ff' }"
  61. >
  62. 审核中
  63. </span>
  64. <span
  65. v-if="currentProject.audit_status == 2"
  66. :style="{ color: '#f5222d' }"
  67. >
  68. 审核拒绝
  69. </span>
  70. <span
  71. v-if="currentProject.audit_status == 3"
  72. :style="{ color: '#a0d911' }"
  73. >
  74. 审核通过
  75. </span>
  76. <span>)</span>
  77. </span>
  78. </view>
  79. <view class="detail" v-if="currentProject.audit_status == 2">
  80. <span class="subTitle">拒绝原因:</span>
  81. <span class="detailContent">
  82. {{ currentProject.audit_comment }}
  83. </span>
  84. </view>
  85. <view class="detail" v-if="currentProject.AuthorUser">
  86. <span class="subTitle">售前项目经理:</span>
  87. <span class="detailContent">{{
  88. currentProject.AuthorUser.CName
  89. }}</span>
  90. </view>
  91. <view class="detail" v-if="currentProject.AuthorDepInfo">
  92. <span class="subTitle">所属部门:</span>
  93. <span class="detailContent">
  94. {{ currentProject.AuthorDepInfo.Name }}
  95. </span>
  96. </view>
  97. <view class="detail">
  98. <span class="subTitle">项目编号:</span>
  99. <span class="detailContent">
  100. {{ currentProject.project_full_code }}
  101. </span>
  102. </view>
  103. <view class="authDetail">
  104. <view class="authTitle">审核详情:</view>
  105. <view>
  106. <uni-steps
  107. :options="nodeList.list"
  108. :active="nodeList.currentIndex"
  109. direction="column"
  110. />
  111. </view>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. <view class="footer" ref="footer">
  117. <view class="footer_text" @click="showEdit"> 操作 </view>
  118. <edit
  119. :project="currentProject"
  120. :user="user"
  121. :auth="auth"
  122. :flowList="flowList"
  123. :depRole="depRole"
  124. :isDetail="true"
  125. />
  126. </view>
  127. </view>
  128. </template>
  129. <script>
  130. import { mapState } from "vuex";
  131. import { queryFlow, queryUserDetail } from "@/services/project";
  132. import edit from "./edit.vue";
  133. export default {
  134. components: {
  135. edit,
  136. },
  137. data() {
  138. return {
  139. auth: false,
  140. status: ["售前", "转执行", "转运营", "转质保"],
  141. flowList: [],
  142. depRole: [],
  143. user: {},
  144. };
  145. },
  146. computed: {
  147. ...mapState(["currentProject", "depUserTree"]),
  148. nodeList() {
  149. if (!this.flowList) return [];
  150. let flowInfo = this.flowList.find(
  151. (item) => item.id == this.currentProject.flow_id
  152. );
  153. if (!flowInfo) return [];
  154. let currentIndex = flowInfo.Nodes.findIndex(
  155. (item) => item.id == this.currentProject.node_id
  156. );
  157. return {
  158. currentIndex,
  159. list: flowInfo.Nodes.map((item) => ({
  160. title: item.node,
  161. desc: `审批人:${this.getAudits(item)}`,
  162. })),
  163. };
  164. },
  165. },
  166. onLoad(options) {
  167. this.auth = Boolean(options.auth);
  168. this.init();
  169. },
  170. methods: {
  171. async init() {
  172. this.user = uni.getStorageSync("user");
  173. let res;
  174. res = await queryFlow();
  175. this.flowList = res.data;
  176. res = await queryUserDetail(this.user);
  177. let depId = this.user.DepId;
  178. let dep = res.data.Dep.find((item) => item.ID == depId);
  179. this.depRole = dep.Role;
  180. },
  181. getAudits(nodeInfo) {
  182. switch (nodeInfo.id) {
  183. case 11:
  184. return "执行项目经理";
  185. case 12:
  186. return "运营经理";
  187. case 13:
  188. return "执行项目经理";
  189. case 14:
  190. return "质保经理";
  191. default:
  192. return (nodeInfo.NodeAudits || [])
  193. .map((item) => item.AuthorRoleInfo.Name)
  194. .join(",");
  195. }
  196. },
  197. showEdit(){
  198. console.log(this.$refs.footer);
  199. console.log(this.$refs.footer.$el.clientHeight);
  200. }
  201. },
  202. };
  203. </script>
  204. <style lang="less" scoped>
  205. .content {
  206. display: flex;
  207. flex-wrap: wrap;
  208. }
  209. .main {
  210. width: 100%;
  211. }
  212. .head {
  213. width: calc(100% - 60rpx);
  214. padding: 40rpx;
  215. position: fixed;
  216. background: url("~@/static/app-plus/menu-title-bg.png") no-repeat center;
  217. background-size: 100% 100%;
  218. background-color: #fff;
  219. display: flex;
  220. justify-content: space-between;
  221. align-items: center;
  222. .title {
  223. font: 18px bold;
  224. color: #fff;
  225. }
  226. }
  227. .list {
  228. margin: 0 5%;
  229. padding-top: 130rpx;
  230. }
  231. .detail {
  232. width: 100%;
  233. padding: 15px 0;
  234. font-size: 28rpx;
  235. border-bottom: 1rpx solid #eee;
  236. display: flex;
  237. justify-items: space-between;
  238. .subTitle {
  239. width: 40%;
  240. }
  241. .detailContent {
  242. text-align: end;
  243. width: 60%;
  244. }
  245. }
  246. .authDetail {
  247. width: 100%;
  248. font-size: 28rpx;
  249. border-bottom: 1rpx solid #eee;
  250. margin-bottom: 60px;
  251. .authTitle {
  252. padding: 20rpx 0;
  253. margin: 10rpx 0;
  254. }
  255. }
  256. .footer {
  257. width: 100%;
  258. position: fixed;
  259. top: calc(100vh - 50px);
  260. left: 0;
  261. }
  262. .footer_text {
  263. text-align: center;
  264. line-height: 50px;
  265. color: white;
  266. display: block;
  267. font-size: 18px;
  268. background: #5b78bf;
  269. flex: 0 0 auto;
  270. }
  271. ::v-deep {
  272. .card-wrapper {
  273. padding: 10rpx 0;
  274. background: #fff;
  275. }
  276. }
  277. </style>