detail.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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" :style="authStyle">
  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" :style="editStyle" v-show="canEdit">
  117. <view class="footer_text" @click="showEdit"> 操作 </view>
  118. <edit
  119. ref="footer"
  120. :project="currentProject"
  121. :user="user"
  122. :auth="auth"
  123. :flowList="flowList"
  124. :depRole="depRole"
  125. :isDetail="true"
  126. @canEdit="canEdit = $event"
  127. />
  128. </view>
  129. </view>
  130. </template>
  131. <script>
  132. import { mapState } from "vuex";
  133. import { queryFlow, queryUserDetail } from "@/services/project";
  134. import edit from "./edit.vue";
  135. export default {
  136. components: {
  137. edit,
  138. },
  139. data() {
  140. return {
  141. auth: false,
  142. canEdit: false,
  143. status: ["售前", "转执行", "转运营", "转质保"],
  144. flowList: [],
  145. depRole: [],
  146. user: {},
  147. editClick: false,
  148. editStyle: {
  149. top: "calc(100vh - 50px)",
  150. },
  151. authStyle: {
  152. "margin-bottom": "60px",
  153. },
  154. };
  155. },
  156. computed: {
  157. ...mapState(["currentProject", "depUserTree"]),
  158. nodeList() {
  159. if (!this.flowList) return [];
  160. let flowInfo = this.flowList.find(
  161. (item) => item.id == this.currentProject.flow_id
  162. );
  163. if (!flowInfo) return [];
  164. let currentIndex = flowInfo.Nodes.findIndex(
  165. (item) => item.id == this.currentProject.node_id
  166. );
  167. return {
  168. currentIndex,
  169. list: flowInfo.Nodes.map((item) => ({
  170. title: item.node,
  171. desc: `审批人:${this.getAudits(item)}`,
  172. })),
  173. };
  174. },
  175. },
  176. onLoad(options) {
  177. this.auth = Boolean(options.auth);
  178. this.init();
  179. },
  180. methods: {
  181. async init() {
  182. this.user = uni.getStorageSync("user");
  183. let res;
  184. res = await queryFlow();
  185. this.flowList = res.data;
  186. res = await queryUserDetail(this.user);
  187. let depId = this.user.DepId;
  188. let dep = res.data.Dep.find((item) => item.ID == depId);
  189. this.depRole = dep.Role;
  190. },
  191. getAudits(nodeInfo) {
  192. switch (nodeInfo.id) {
  193. case 11:
  194. return "执行项目经理";
  195. case 12:
  196. return "运营经理";
  197. case 13:
  198. return "执行项目经理";
  199. case 14:
  200. return "质保经理";
  201. default:
  202. return (nodeInfo.NodeAudits || [])
  203. .map((item) => item.AuthorRoleInfo.Name)
  204. .join(",");
  205. }
  206. },
  207. showEdit() {
  208. this.editClick = !this.editClick;
  209. this.editStyle.top = this.editClick
  210. ? `calc(100vh - 50px - ${this.$refs.footer.$el.clientHeight}px)`
  211. : "calc(100vh - 50px)";
  212. this.authStyle["margin-bottom"] = this.editClick
  213. ? `calc(60px + ${this.$refs.footer.$el.clientHeight}px)`
  214. : "60px";
  215. },
  216. },
  217. };
  218. </script>
  219. <style lang="less" scoped>
  220. .content {
  221. display: flex;
  222. flex-wrap: wrap;
  223. }
  224. .main {
  225. width: 100%;
  226. }
  227. .head {
  228. width: calc(100% - 60rpx);
  229. padding: 40rpx;
  230. position: fixed;
  231. background: url("~@/static/app-plus/menu-title-bg.png") no-repeat center;
  232. background-size: 100% 100%;
  233. background-color: #fff;
  234. display: flex;
  235. justify-content: space-between;
  236. align-items: center;
  237. .title {
  238. font: 18px bold;
  239. color: #fff;
  240. }
  241. }
  242. .list {
  243. margin: 0 5%;
  244. padding-top: 130rpx;
  245. }
  246. .detail {
  247. width: 100%;
  248. padding: 20rpx 0;
  249. font-size: 28rpx;
  250. border-bottom: 1rpx solid #eee;
  251. display: flex;
  252. justify-items: space-between;
  253. .subTitle {
  254. width: 40%;
  255. }
  256. .detailContent {
  257. text-align: end;
  258. width: 60%;
  259. }
  260. }
  261. .authDetail {
  262. width: 100%;
  263. font-size: 28rpx;
  264. transition: margin-bottom 0.5s;
  265. .authTitle {
  266. padding: 10rpx 0;
  267. margin: 10rpx 0;
  268. }
  269. }
  270. .footer {
  271. width: 100%;
  272. position: fixed;
  273. left: 0;
  274. transition: top 0.5s;
  275. }
  276. .footer_text {
  277. text-align: center;
  278. line-height: 50px;
  279. color: white;
  280. display: block;
  281. font-size: 18px;
  282. background: #5b78bf;
  283. flex: 0 0 auto;
  284. }
  285. ::v-deep {
  286. .card-wrapper {
  287. padding: 10rpx 0;
  288. background: #fff;
  289. }
  290. }
  291. </style>