details.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. <!--
  2. * @Author: wanglj 471442253@qq.com
  3. * @Date: 2022-12-26 09:30:47
  4. * @LastEditors: liuzhenlin
  5. * @LastEditTime: 2023-06-03 10:51:58
  6. * @Description: file content
  7. * @FilePath: \订单全流程管理系统\src\views\customer\inviteTenders\details.vue
  8. -->
  9. <template>
  10. <div class="detail">
  11. <div>
  12. <div>
  13. <div class="title">
  14. <p>招标</p>
  15. <h3>
  16. {{ detail.title }}
  17. <div>
  18. <el-button @click="handleFollow">添加跟进</el-button>
  19. </div>
  20. </h3>
  21. </div>
  22. <header>
  23. <el-descriptions :colon="false" :column="5" direction="vertical">
  24. <el-descriptions-item content-class-name="my-content" label="招标产品名称" label-class-name="my-label">
  25. {{ detail.productName }}
  26. </el-descriptions-item>
  27. <el-descriptions-item content-class-name="my-content" label="发布日期" label-class-name="my-label">
  28. {{ parseTime(detail.publishedTime, '{y}-{m}-{d}') }}
  29. </el-descriptions-item>
  30. <el-descriptions-item content-class-name="my-content" label="状态" label-class-name="my-label">
  31. {{ selectDictLabel(bidStatus, detail.status) }}
  32. </el-descriptions-item>
  33. <el-descriptions-item content-class-name="my-content" label="预算" label-class-name="my-label">
  34. {{ detail.budget }}
  35. </el-descriptions-item>
  36. <el-descriptions-item content-class-name="my-content" label="产品线" label-class-name="my-label">
  37. {{ selectDictLabel(productLineOptions, detail.productLine) }}
  38. </el-descriptions-item>
  39. </el-descriptions>
  40. <el-descriptions :colon="false" :column="4" direction="vertical">
  41. <el-descriptions-item content-class-name="my-content" label="客户名称" label-class-name="my-label">
  42. {{ detail.cuctName }}
  43. </el-descriptions-item>
  44. <el-descriptions-item content-class-name="my-content" label="信息分类" label-class-name="my-label">
  45. {{ bidInfoTypeOptions[detail.infoType] }}
  46. </el-descriptions-item>
  47. <el-descriptions-item content-class-name="my-content" label="中标单位" label-class-name="my-label">
  48. {{ detail.bidder }}
  49. </el-descriptions-item>
  50. <el-descriptions-item content-class-name="my-content" label="创建招标日期" label-class-name="my-label">
  51. {{ parseTime(detail.biddingTime, '{y}-{m}-{d}') }}
  52. </el-descriptions-item>
  53. </el-descriptions>
  54. </header>
  55. <el-tabs v-model="activeName" @tab-click="handleClick">
  56. <el-tab-pane label="跟进记录" name="follow">
  57. <ul v-if="followList.length" class="follow">
  58. <li v-for="(date, index) in followList" :key="index">
  59. <div class="date">
  60. <h2>{{ date.followDay.split('-')[2] }}</h2>
  61. <h3>
  62. {{ date.followDay.split('-').splice(0, 2).join('.') }}
  63. </h3>
  64. </div>
  65. <ul class="content">
  66. <li v-for="(item, idx) in date.followupList" :key="idx">
  67. <!-- <el-avatar class="user-avatar"
  68. :src="avatar" />-->
  69. <div class="text-container">
  70. <vab-icon class="user-avatar" icon="account-circle-fill" />
  71. <div class="text">
  72. <p class="action">
  73. <span>{{ item.createdName }} 跟进({{ formatType(item.followType) }})</span>
  74. <span>
  75. <vab-icon icon="time-line" />
  76. {{ item.followDate }}
  77. </span>
  78. </p>
  79. <p>{{ item.followContent }}</p>
  80. <div class="footer">
  81. <p>
  82. 来自客户:
  83. <span>{{ item.custName }}</span>
  84. </p>
  85. <div>
  86. <el-button icon="el-icon-edit" size="mini" @click="postComments(item)">发表评论</el-button>
  87. <el-button size="mini" @click="showDetail(item)">
  88. <vab-icon icon="arrow-right-circle-fill" />
  89. 详情
  90. </el-button>
  91. <!-- <el-button size="mini" @click="showComment(item)">评论({{ item.commentNumber }})</el-button>-->
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. <transition name="height">
  97. <ul class="comments">
  98. <li v-for="comment in item.comments" :key="comment.id">
  99. <vab-icon class="user-avatar" icon="account-circle-fill" />
  100. <div class="text">
  101. <p>{{ comment.createdName }}</p>
  102. <p>{{ comment.content }}</p>
  103. <p>{{ comment.createdTime }}</p>
  104. </div>
  105. </li>
  106. </ul>
  107. </transition>
  108. </li>
  109. </ul>
  110. </li>
  111. </ul>
  112. <div v-else class="no-follow">暂无跟进记录</div>
  113. </el-tab-pane>
  114. </el-tabs>
  115. </div>
  116. </div>
  117. <!-- 跟进详情 -->
  118. <FollowDetail ref="followDetail" />
  119. <!-- 添加跟进记录 -->
  120. <follow-add ref="follow-add" @fetch-data="handleClick({ name: 'follow' })" />
  121. </div>
  122. </template>
  123. <script>
  124. import follow from '@/api/customer/follow'
  125. import to from 'await-to-js'
  126. import FollowDetail from '../components/FollowDetail.vue'
  127. import bidApi from '@/api/customer/bid'
  128. import FollowAdd from '@/views/proj/business/components/FollowAdd'
  129. export default {
  130. name: 'CustomerDetail',
  131. components: {
  132. FollowDetail,
  133. FollowAdd,
  134. },
  135. data() {
  136. return {
  137. id: '',
  138. detail: {
  139. custCode: '', //客户编码
  140. abbrName: '', //助记名
  141. level: '', //客户级别
  142. indusTry: '', //客户类型
  143. custStatus: '', //客户状态
  144. followUpDate: '', //最后跟进时间
  145. },
  146. activeName: 'follow',
  147. followList: [],
  148. bidInfoTypeOptions: {},
  149. productLineOptions: [],
  150. bidStatus: [],
  151. }
  152. },
  153. mounted() {
  154. this.id = this.$route.query.id
  155. this.init()
  156. this.handleClick({ name: 'follow' })
  157. this.getOptions()
  158. },
  159. methods: {
  160. // 添加跟进记录
  161. handleFollow() {
  162. this.followup = {
  163. targetId: this.detail.id,
  164. targetType: '60',
  165. targetName: this.detail.cuctName,
  166. custId: this.detail.custId,
  167. custName: this.detail.cuctName,
  168. }
  169. this.$refs['follow-add'].showEdit(this.followup)
  170. },
  171. // 发表评论
  172. postComments(row) {
  173. this.$PostComment({ form: row, visible: true })
  174. .then(() => {
  175. this.handleClick({ name: 'follow' })
  176. })
  177. .catch(() => {})
  178. },
  179. getOptions() {
  180. this.getDicts('bid_info_type').then((response) => {
  181. this.bidInfoTypeOptions = {}
  182. response.data.values.filter((i) => {
  183. this.bidInfoTypeOptions[i.key] = i.value
  184. })
  185. })
  186. this.getDicts('sys_product_line').then((response) => {
  187. this.productLineOptions = response.data.values || []
  188. })
  189. this.getDicts('bid_status').then((response) => {
  190. this.bidStatus = response.data.values || []
  191. })
  192. },
  193. async init() {
  194. const [err, res] = await to(bidApi.get({ id: parseInt(this.id) }))
  195. if (err) return
  196. if (res.code == 200) {
  197. this.detail = res.data
  198. }
  199. },
  200. async handleClick(tab) {
  201. let err, res
  202. if (tab.name == 'follow') {
  203. let params = {
  204. targetId: '' + this.id,
  205. targetType: '60',
  206. DaysBeforeToday: 99999,
  207. }
  208. ;[err, res] = await to(follow.getListByDay(params))
  209. if (err) return
  210. this.followList = res.data.list || []
  211. }
  212. },
  213. formatType(val) {
  214. let str = ''
  215. if (val == 10) str = '电话'
  216. else if (val == 20) str = '邮件'
  217. else if (val == 30) str = '拜访'
  218. return str
  219. },
  220. // 跟进记录详情
  221. showDetail(row) {
  222. this.$refs.followDetail.init({ ...row })
  223. },
  224. // 展开评论
  225. showComment(row) {
  226. if (!row.comments.length) return this.$message.warning('暂无评论')
  227. row.showComment = !row.showComment
  228. this.$forceUpdate()
  229. },
  230. },
  231. }
  232. </script>
  233. <style lang="scss" scoped>
  234. $base: '.detail';
  235. #{$base} {
  236. height: calc(100vh - 60px - 12px * 2 - 40px);
  237. display: flex;
  238. padding: 20px 40px;
  239. > .el-row {
  240. flex: 1;
  241. width: 100%;
  242. > .el-col {
  243. height: 100%;
  244. }
  245. }
  246. .title {
  247. p,
  248. h3 {
  249. margin: 0;
  250. }
  251. p {
  252. font-size: 14px;
  253. font-weight: 400;
  254. line-height: 22px;
  255. }
  256. h3 {
  257. font-size: 24px;
  258. font-weight: 500;
  259. line-height: 36px;
  260. color: #333;
  261. display: flex;
  262. justify-content: space-between;
  263. }
  264. }
  265. header {
  266. height: 74px;
  267. background: rgba(196, 196, 196, 0.5);
  268. border-radius: 4px;
  269. display: flex;
  270. align-items: center;
  271. padding: 0 20px;
  272. margin-top: 16px;
  273. ::v-deep .el-descriptions__body {
  274. background: transparent;
  275. }
  276. ::v-deep .my-label {
  277. font-size: 14px;
  278. font-weight: 600;
  279. color: #1d66dc;
  280. }
  281. ::v-deep .my-content {
  282. font-size: 14px;
  283. font-weight: 600;
  284. color: #333;
  285. white-space: nowrap;
  286. overflow: hidden;
  287. text-overflow: ellipsis;
  288. }
  289. }
  290. .el-tabs {
  291. height: calc(100% - 148px);
  292. display: flex;
  293. flex-direction: column;
  294. ::v-deep .el-tabs__content {
  295. flex: 1;
  296. .el-tab-pane {
  297. height: 100%;
  298. .el-descriptions {
  299. table-layout: fixed;
  300. .is-bordered {
  301. table-layout: fixed;
  302. }
  303. }
  304. }
  305. }
  306. }
  307. .buttons {
  308. padding-top: 28px;
  309. text-align: right;
  310. }
  311. .records {
  312. margin: 0;
  313. padding: 10px 20px;
  314. list-style: none;
  315. height: calc(100% - 60px);
  316. overflow-y: auto;
  317. > li {
  318. display: flex;
  319. & + li {
  320. margin-top: 10px;
  321. }
  322. }
  323. .date {
  324. width: 100px;
  325. display: flex;
  326. flex-direction: column;
  327. align-items: center;
  328. h2,
  329. h3 {
  330. margin: 0;
  331. }
  332. h2 {
  333. font-size: 26px;
  334. line-height: 32px;
  335. }
  336. }
  337. .content {
  338. flex: 1;
  339. list-style: none;
  340. li {
  341. display: flex;
  342. & + li {
  343. margin-top: 10px;
  344. }
  345. }
  346. .user-avatar {
  347. font-size: 40px;
  348. }
  349. .text {
  350. flex: 1;
  351. padding-left: 20px;
  352. p {
  353. font-weight: 500;
  354. margin: 0;
  355. line-height: 20px;
  356. span {
  357. color: #1d66dc;
  358. }
  359. }
  360. p:nth-child(2) {
  361. margin-bottom: 10px;
  362. }
  363. .action {
  364. font-weight: bold;
  365. color: #333;
  366. }
  367. }
  368. }
  369. }
  370. .follow {
  371. height: 100%;
  372. padding: 10px 20px;
  373. overflow: auto;
  374. > li {
  375. display: flex;
  376. + li {
  377. margin-top: 10px;
  378. }
  379. }
  380. .date {
  381. width: 100px;
  382. display: flex;
  383. flex-direction: column;
  384. align-items: center;
  385. h2,
  386. h3 {
  387. margin: 0;
  388. }
  389. h2 {
  390. font-size: 26px;
  391. line-height: 32px;
  392. }
  393. }
  394. .content {
  395. flex: 1;
  396. list-style: none;
  397. > li {
  398. border: 1px solid rgb(215, 232, 244);
  399. background: rgb(247, 251, 254);
  400. border-radius: 4px;
  401. padding: 8px;
  402. overflow: hidden;
  403. .text-container {
  404. display: flex;
  405. }
  406. .comments {
  407. padding-left: 60px;
  408. margin-top: 10px;
  409. max-height: 190px;
  410. overflow: auto;
  411. li {
  412. display: flex;
  413. border-top: 1px solid #e3e5e7;
  414. .text {
  415. flex: 1;
  416. padding: 0 10px;
  417. p {
  418. font-weight: 500;
  419. margin: 0;
  420. line-height: 32px;
  421. }
  422. p:first-child {
  423. line-height: 30px;
  424. font-weight: bold;
  425. }
  426. p:last-child {
  427. font-size: 12px;
  428. color: #9499a0;
  429. text-align: right;
  430. }
  431. }
  432. }
  433. }
  434. + li {
  435. margin-top: 10px;
  436. }
  437. }
  438. .user-avatar {
  439. font-size: 40px;
  440. }
  441. .text {
  442. flex: 1;
  443. padding-left: 20px;
  444. padding-right: 10px;
  445. p {
  446. font-weight: 500;
  447. margin: 0;
  448. line-height: 32px;
  449. span {
  450. color: #1d66dc;
  451. }
  452. }
  453. .action {
  454. display: flex;
  455. justify-content: space-between;
  456. span:first-child {
  457. font-weight: bold;
  458. color: #333;
  459. }
  460. }
  461. .footer {
  462. display: flex;
  463. justify-content: space-between;
  464. align-items: center;
  465. }
  466. }
  467. }
  468. }
  469. .no-follow {
  470. height: 100%;
  471. width: 100%;
  472. display: flex;
  473. align-items: center;
  474. justify-content: center;
  475. font-size: 12px;
  476. color: rgba(0, 0, 0, 0.65);
  477. }
  478. }
  479. .height-enter-active,
  480. .height-leave-active {
  481. transition: all 0.5s;
  482. }
  483. .height-enter-to,
  484. .height-leave {
  485. height: 190px;
  486. }
  487. .height-enter, .height-leave-to /* .fade-leave-active below version 2.1.8 */ {
  488. height: 0;
  489. }
  490. </style>