detail.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <!--
  2. * @Author: liuzl liuzl0802
  3. * @Date: 2023-01-05 16:29:01
  4. * @LastEditors: liuzhenlin
  5. * @LastEditTime: 2023-01-09 14:43:21
  6. * @Description: file content
  7. * @FilePath: \订单全流程管理系统\src\views\contract\detail.vue
  8. -->
  9. <template>
  10. <div class="details">
  11. <el-row :gutter="10">
  12. <el-col :span="16">
  13. <div class="title">
  14. <p>合同</p>
  15. <h3>
  16. {{ details.contractName }}
  17. </h3>
  18. </div>
  19. <header>
  20. <el-descriptions :colon="false" :column="6" direction="vertical">
  21. <el-descriptions-item content-class-name="my-content" label="客户名称" label-class-name="my-label">
  22. {{ details.custName }}
  23. </el-descriptions-item>
  24. <el-descriptions-item content-class-name="my-content" label="合同金额(元)" label-class-name="my-label">
  25. {{ details.contractAmount }}
  26. </el-descriptions-item>
  27. <el-descriptions-item content-class-name="my-content" label="下单时间" label-class-name="my-label">
  28. {{ details.createdTime }}
  29. </el-descriptions-item>
  30. <el-descriptions-item content-class-name="my-content" label="回款金额(元)" label-class-name="my-label">
  31. {{ details.collectedAmount }}
  32. </el-descriptions-item>
  33. <el-descriptions-item content-class-name="my-content" label="负责人" label-class-name="my-label">
  34. {{ details.inchargeName }}
  35. </el-descriptions-item>
  36. </el-descriptions>
  37. </header>
  38. <el-tabs v-model="activeName" @tab-click="handleClick">
  39. <el-tab-pane label="详细信息" name="details">
  40. <details-info :details="details" />
  41. </el-tab-pane>
  42. <el-tab-pane label="产品" name="product">
  43. <details-product :product="product" />
  44. </el-tab-pane>
  45. <el-tab-pane label="回款" name="collection">
  46. <details-collection v-if="activeName == 'collection'" :details="details" />
  47. </el-tab-pane>
  48. <el-tab-pane label="发票" name="invoice">发票</el-tab-pane>
  49. <el-tab-pane label="附件" name="enclosure">附件</el-tab-pane>
  50. </el-tabs>
  51. </el-col>
  52. </el-row>
  53. </div>
  54. </template>
  55. <script>
  56. import { mapGetters } from 'vuex'
  57. import contractApi from '@/api/contract'
  58. import DetailsInfo from './components/DetailsInfo'
  59. import DetailsProduct from './components/DetailsProduct'
  60. import DetailsCollection from './components/DetailsCollection'
  61. export default {
  62. name: 'ContractDetail',
  63. components: { DetailsInfo, DetailsProduct, DetailsCollection },
  64. data() {
  65. return {
  66. id: '',
  67. details: {},
  68. product: [],
  69. abstract: {},
  70. activeName: 'details',
  71. }
  72. },
  73. computed: {
  74. ...mapGetters({
  75. avatar: 'user/avatar',
  76. username: 'user/username',
  77. }),
  78. },
  79. mounted() {
  80. this.id = this.$route.query.id
  81. this.init()
  82. this.handleClick({ name: 'details' })
  83. },
  84. methods: {
  85. init() {
  86. Promise.all([contractApi.getDetails({ id: parseInt(this.id) })]).then(([details]) => {
  87. if (details.data) {
  88. let { product, ...data } = details.data
  89. this.product = product
  90. this.details = data
  91. }
  92. })
  93. },
  94. async handleClick() {},
  95. back() {
  96. this.$router.go(-1)
  97. },
  98. },
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. $base: '.details';
  103. #{$base} {
  104. height: calc(100vh - 60px - 50px - 12px * 2 - 40px);
  105. display: flex;
  106. padding: 20px 40px;
  107. > .el-row {
  108. flex: 1;
  109. > .el-col {
  110. height: 100%;
  111. }
  112. }
  113. .title {
  114. p,
  115. h3 {
  116. margin: 0;
  117. }
  118. p {
  119. font-size: 14px;
  120. font-weight: 400;
  121. line-height: 22px;
  122. }
  123. h3 {
  124. font-size: 24px;
  125. font-weight: 500;
  126. line-height: 36px;
  127. color: #333;
  128. display: flex;
  129. justify-content: space-between;
  130. }
  131. }
  132. header {
  133. height: 74px;
  134. background: rgba(196, 196, 196, 0.5);
  135. border-radius: 4px;
  136. display: flex;
  137. align-items: center;
  138. padding: 0 20px;
  139. margin-top: 16px;
  140. ::v-deep .el-descriptions__body {
  141. background: transparent;
  142. }
  143. ::v-deep .my-label {
  144. font-size: 14px;
  145. font-weight: 600;
  146. color: #1d66dc;
  147. }
  148. ::v-deep .my-content {
  149. font-size: 14px;
  150. font-weight: 600;
  151. color: #333;
  152. }
  153. }
  154. .el-tabs {
  155. height: calc(100% - 148px);
  156. display: flex;
  157. flex-direction: column;
  158. ::v-deep .el-tabs__content {
  159. flex: 1;
  160. .el-tab-pane {
  161. height: 100%;
  162. }
  163. }
  164. }
  165. .buttons {
  166. padding-top: 28px;
  167. text-align: right;
  168. }
  169. .records {
  170. margin: 0;
  171. padding: 10px 20px;
  172. list-style: none;
  173. height: calc(100% - 60px);
  174. overflow-y: auto;
  175. > li {
  176. display: flex;
  177. & + li {
  178. margin-top: 10px;
  179. }
  180. }
  181. .date {
  182. width: 100px;
  183. display: flex;
  184. flex-direction: column;
  185. align-items: center;
  186. h2,
  187. h3 {
  188. margin: 0;
  189. }
  190. h2 {
  191. font-size: 26px;
  192. line-height: 32px;
  193. }
  194. }
  195. .content {
  196. flex: 1;
  197. list-style: none;
  198. li {
  199. display: flex;
  200. & + li {
  201. margin-top: 10px;
  202. }
  203. }
  204. .user-avatar {
  205. font-size: 40px;
  206. }
  207. .text {
  208. flex: 1;
  209. padding-left: 20px;
  210. p {
  211. font-weight: 500;
  212. margin: 0;
  213. line-height: 20px;
  214. span {
  215. color: #1d66dc;
  216. }
  217. }
  218. p:nth-child(2) {
  219. margin-bottom: 10px;
  220. }
  221. .action {
  222. font-weight: bold;
  223. color: #333;
  224. }
  225. }
  226. }
  227. }
  228. .follow {
  229. height: 100%;
  230. padding: 10px 20px;
  231. overflow: auto;
  232. > li {
  233. display: flex;
  234. + li {
  235. margin-top: 10px;
  236. }
  237. }
  238. .date {
  239. width: 100px;
  240. display: flex;
  241. flex-direction: column;
  242. align-items: center;
  243. h2,
  244. h3 {
  245. margin: 0;
  246. }
  247. h2 {
  248. font-size: 26px;
  249. line-height: 32px;
  250. }
  251. }
  252. .content {
  253. flex: 1;
  254. list-style: none;
  255. > li {
  256. border: 1px solid rgb(215, 232, 244);
  257. background: rgb(247, 251, 254);
  258. border-radius: 4px;
  259. padding: 8px;
  260. overflow: hidden;
  261. .text-container {
  262. display: flex;
  263. }
  264. .comments {
  265. padding-left: 60px;
  266. margin-top: 10px;
  267. max-height: 190px;
  268. overflow: auto;
  269. li {
  270. display: flex;
  271. border-top: 1px solid #e3e5e7;
  272. .text {
  273. flex: 1;
  274. padding: 0 10px;
  275. p {
  276. font-weight: 500;
  277. margin: 0;
  278. line-height: 32px;
  279. }
  280. p:first-child {
  281. line-height: 30px;
  282. font-weight: bold;
  283. }
  284. p:last-child {
  285. font-size: 12px;
  286. color: #9499a0;
  287. text-align: right;
  288. }
  289. }
  290. }
  291. }
  292. + li {
  293. margin-top: 10px;
  294. }
  295. }
  296. .user-avatar {
  297. font-size: 40px;
  298. }
  299. .text {
  300. flex: 1;
  301. padding-left: 20px;
  302. padding-right: 10px;
  303. p {
  304. font-weight: 500;
  305. margin: 0;
  306. line-height: 32px;
  307. span {
  308. color: #1d66dc;
  309. }
  310. }
  311. .action {
  312. display: flex;
  313. justify-content: space-between;
  314. span:first-child {
  315. font-weight: bold;
  316. color: #333;
  317. }
  318. }
  319. .footer {
  320. display: flex;
  321. justify-content: space-between;
  322. align-items: center;
  323. }
  324. }
  325. }
  326. }
  327. .no-follow {
  328. height: 100%;
  329. width: 100%;
  330. display: flex;
  331. align-items: center;
  332. justify-content: center;
  333. font-size: 12px;
  334. color: rgba(0, 0, 0, 0.65);
  335. }
  336. }
  337. .height-enter-active,
  338. .height-leave-active {
  339. transition: all 0.5s;
  340. }
  341. .height-enter-to,
  342. .height-leave {
  343. height: 190px;
  344. }
  345. .height-enter, .height-leave-to /* .fade-leave-active below version 2.1.8 */ {
  346. height: 0;
  347. }
  348. ::v-deep .el-descriptions__table tbody {
  349. td,
  350. th {
  351. width: 25%;
  352. }
  353. }
  354. </style>