detail.vue 7.0 KB

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