record-details.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. <template>
  2. <view class="container qualifications" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0' }">
  3. <view class="remarks-content">
  4. <view class="list-view-title">
  5. <view class="list-view-h1">
  6. 沟通情况:
  7. <template v-if="remarksParams.communicationSituation === 0">
  8. <text>已沟通</text>
  9. <text v-if="remarksParams.communicationMethods === 1"> (电话) </text>
  10. <text v-if="remarksParams.communicationMethods === 2"> (微信) </text>
  11. <text v-if="remarksParams.communicationMethods ==='1,2' || remarksParams.communicationMethods ==='2,1'"> (电话,微信) </text>
  12. </template>
  13. <template v-else>
  14. <text> 联系不上 </text>
  15. </template>
  16. </view>
  17. </view>
  18. <view class="list-view-title">
  19. <view class="list-view-h1"
  20. >咨询人:<text>{{ remarksParams.questionMan }}</text></view
  21. >
  22. </view>
  23. <view class="list-view-title">
  24. <view class="list-view-h1"
  25. >咨询类别:{{ remarksParams.consultBack ? remarksParams.consultBack : '无' }}</view
  26. >
  27. </view>
  28. <view class="list-view-title" v-if="remarksParams.customerSource">
  29. <view class="list-view-h1">
  30. 客户来源:
  31. <text>{{ remarksParams.customerSource | sourceActionsFilters }}</text>
  32. </view>
  33. </view>
  34. <view class="list-view-title" v-if="remarksParams.customerGender">
  35. <view class="list-view-h1">
  36. 客户性别:
  37. <text>{{ remarksParams.customerGender | genderActionsFilters }}</text>
  38. </view>
  39. </view>
  40. <view class="list-view-title" v-if="remarksParams.customerAge">
  41. <view class="list-view-h1">
  42. 客户年龄:
  43. <text>{{ remarksParams.customerAge }}</text>
  44. </view>
  45. </view>
  46. <view class="list-view-title" v-if="remarksParams.groupAddition">
  47. <view class="list-view-h1">
  48. 加群情况:
  49. <text>{{ remarksParams.groupAddition | additiveActionsFilters }}</text>
  50. </view>
  51. </view>
  52. <view class="list-view-title" v-if="remarksParams.productName"> <view class="list-view-h1">咨询商品:</view> </view>
  53. <view class="tui-remarks-content" v-if="remarksParams.productName">
  54. <view class="tui-remarks-goods">
  55. <view class="goods-image"> <image :src="remarksParams.mainImage" mode=""></image> </view>
  56. <view class="goods-main">
  57. <view class="name"> {{ remarksParams.productName }} </view>
  58. <view class="shop"> 供应商:{{ remarksParams.shopName }} </view>
  59. </view>
  60. </view>
  61. </view>
  62. <template v-if="labelsList.length>0">
  63. <view class="list-view-title"> <view class="list-view-h1">标签记录:</view> </view>
  64. <view class="tui-remarks-content">
  65. <text class="tui-remarks-span" v-for="(label, labelIndex) in labelsList" :key="labelIndex">
  66. {{ label.label }}
  67. </text>
  68. </view>
  69. </template>
  70. <view class="list-view-title" v-if="remarksParams.status">
  71. <view class="list-view-h1"
  72. >关联报备:<text>{{ remarksParams.reportText }}</text></view
  73. >
  74. </view>
  75. <view class="tui-remarks-content" v-if="remarksParams.status">
  76. <view class="tui-remarks-text">
  77. <view
  78. class="txt"
  79. :class="{
  80. reviewed: remarksParams.status == 1,
  81. approved: remarksParams.status == 2,
  82. failed: remarksParams.status == 3
  83. }"
  84. >{{ remarksParams.status | statusFilters }}</view
  85. >
  86. <view class="txm" v-if="remarksParams.auditText">{{ remarksParams.auditText }}</view>
  87. </view>
  88. </view>
  89. <view class="list-view-title">
  90. <view class="list-view-h1"
  91. >价格敏感度:<text>{{ remarksParams.pinceSensitve | pinceFilters }}</text>
  92. </view>
  93. </view>
  94. <view class="list-view-title">
  95. <view class="list-view-h1"
  96. >意向程度:<text>{{ remarksParams.satisfied | intenActionsFilters }}</text></view
  97. >
  98. </view>
  99. <view class="list-view-title">
  100. <view class="list-view-h1"
  101. >跟进状态:<text>{{ remarksParams.followup | followupFilters }}</text></view
  102. >
  103. </view>
  104. <view class="list-view-title">
  105. <view class="list-view-h1"
  106. >额外说明:<text>{{ remarksParams.extra ? remarksParams.extra : '无' }}</text></view
  107. >
  108. </view>
  109. <view class="list-view-title" v-if="remarksParams.imageList.length > 0">
  110. <view class="list-view-h1">图片</view>
  111. </view>
  112. <view class="list-view-upload clearfix" v-if="remarksParams.imageList.length > 0">
  113. <view class="photo-item" v-for="(image, imageIndex) in remarksParams.imageList" :key="imageIndex">
  114. <image
  115. :src="image"
  116. mode="aspectFill"
  117. @click.stop="previewImg(remarksParams.imageList, imageIndex)"
  118. ></image>
  119. </view>
  120. </view>
  121. <view class="list-view-title" v-if="remarksParams.fileList.length > 0">
  122. <view class="list-view-h1">文件</view>
  123. </view>
  124. <view
  125. class="list-view"
  126. v-for="(file, fileIndex) in remarksParams.fileList"
  127. :key="fileIndex"
  128. v-if="remarksParams.fileList.length > 0"
  129. >
  130. <view class="list-view-text">
  131. <view class="input">{{ file.fileName }}</view>
  132. <view class="delbtn" @click.stop="previewFile(file)">预览</view>
  133. <!-- <view class="delbtn down" @click.stop="previewFile(file)">下载</view> -->
  134. </view>
  135. </view>
  136. </view>
  137. </view>
  138. </template>
  139. <script>
  140. import { mapState, mapMutations } from 'vuex'
  141. import authorize from '@/common/config/authorize.js'
  142. import { uploadFileImage, uploadFilePdfDocDocx } from '@/services/public.js'
  143. var isPreviewImg
  144. export default {
  145. data() {
  146. return {
  147. isIphoneX: this.$store.state.isIphoneX,
  148. productActions: [],
  149. remarksParams: {},
  150. remarksId: 0,
  151. categorys: '产品,二手,耗材',
  152. labelsList:[]
  153. }
  154. },
  155. onLoad(option) {
  156. console.log(option)
  157. this.remarksId = option.remarksId
  158. this.getUserRemarksVisitDetail()
  159. },
  160. filters: {
  161. statusFilters(value) {
  162. // 订单来源
  163. const map = {
  164. 1: '报备待审核',
  165. 2: '报备审核通过',
  166. 3: '报备审核未通过'
  167. }
  168. return map[value]
  169. },
  170. followupFilters(value) {
  171. // 订单来源
  172. const map = {
  173. 1: '跟进中',
  174. 2: '跟进完成',
  175. 3: '已放弃'
  176. }
  177. return map[value]
  178. },
  179. pinceFilters(value) {
  180. // 意向
  181. const map = {
  182. 1: '敏感',
  183. 2: '适中',
  184. 3: '不敏感',
  185. 4: '不明确'
  186. }
  187. return map[value]
  188. },
  189. intenActionsFilters(value) {
  190. // 意向
  191. const map = {
  192. 1: '意向强烈',
  193. 2: '意向一般',
  194. 3: '意向平淡',
  195. 4: '随便看看'
  196. }
  197. return map[value]
  198. },
  199. sourceActionsFilters(value) {
  200. // 客户来源
  201. const map = {
  202. 0: '搜素引擎',
  203. 1: '小程序',
  204. 2: '公众号',
  205. 3: '小红书',
  206. 4: '微博',
  207. 5: '搜狐',
  208. 7: '抖音',
  209. 8: '视频号',
  210. 9: '朋友推荐',
  211. 6: '其他',
  212. }
  213. return map[value]
  214. },
  215. genderActionsFilters(value) {
  216. // 客户性别
  217. const map = {
  218. 0: '男',
  219. 1: '女'
  220. }
  221. return map[value]
  222. },
  223. additiveActionsFilters(value) {
  224. // 加群情况
  225. const map = {
  226. 0: '已加群',
  227. 1: '未加群'
  228. }
  229. return map[value]
  230. }
  231. },
  232. methods: {
  233. ...mapMutations(['login']),
  234. async getUserRemarksVisitDetail() {
  235. //备注详情
  236. try{
  237. const res = await this.UserService.getUserRemarksVisitDetail({ remarksId: this.remarksId })
  238. this.remarksParams = res.data
  239. this.labelsList = [...this.remarksParams.remarks,...this.remarksParams.stateKeyword,...this.remarksParams.trendsKeyword]
  240. }catch(error){
  241. this.$util.msg(error.msg, 2000)
  242. }
  243. },
  244. previewImg(image, index) {
  245. //顶部商品图片预览
  246. isPreviewImg = true
  247. let previewUrls = image
  248. uni.previewImage({
  249. current: index, //图片索引
  250. urls: previewUrls, //必须是http图片,本地图片无效
  251. longPressActions: ''
  252. })
  253. },
  254. previewFile(file) {
  255. //预览文件
  256. this.openDocument(file)
  257. },
  258. openDocument(file) {
  259. // 打开文档
  260. uni.showLoading({
  261. title: '加载中'
  262. })
  263. // 获取文件后缀
  264. const index = file.fileName.lastIndexOf('.')
  265. const suffix = file.fileName.substring(index + 1)
  266. // 下载文件
  267. uni.downloadFile({
  268. url: file.fileUrl,
  269. success(res) {
  270. const filePath = res.tempFilePath
  271. console.log(filePath)
  272. // 打开文件
  273. uni.openDocument({
  274. filePath: filePath,
  275. fileType: suffix,
  276. success(res) {
  277. uni.showToast({
  278. icon: 'success',
  279. title: '打开成功',
  280. duration: 1200
  281. })
  282. uni.hideLoading()
  283. },
  284. fail(err) {
  285. if (err.errMsg.indexOf('fail filetype not supported')) {
  286. uni.showModal({
  287. content: '不支持的文件预览',
  288. cancelColor: '#666',
  289. confirmColor: '#FF5B00'
  290. })
  291. }
  292. uni.hideLoading()
  293. }
  294. })
  295. },
  296. fail(err) {
  297. uni.showToast({
  298. title: JSON.stringify(err),
  299. icon: 'none',
  300. duration: 5000
  301. })
  302. uni.hideLoading()
  303. }
  304. })
  305. }
  306. },
  307. onShow() {}
  308. }
  309. </script>
  310. <style lang="scss">
  311. page {
  312. height: auto;
  313. background: #ffffff;
  314. }
  315. .remarks-content {
  316. width: 100%;
  317. height: auto;
  318. box-sizing: border-box;
  319. padding: 0 24rpx;
  320. padding-bottom: 80rpx;
  321. .list-view-title {
  322. width: 100%;
  323. height: auto;
  324. margin-bottom: 16rpx;
  325. margin-top: 40rpx;
  326. .list-view-h1 {
  327. line-height: 40rpx;
  328. font-size: $font-size-30;
  329. color: #333333;
  330. text-align: left;
  331. font-weight: bold;
  332. text {
  333. color: #666666;
  334. font-weight: normal;
  335. }
  336. }
  337. }
  338. .tui-remarks-content {
  339. width: 100%;
  340. height: auto;
  341. margin-bottom: 24rpx;
  342. .tui-remarks-text{
  343. width: 100%;
  344. box-sizing: border-box;
  345. background-color: #F7F7F7;
  346. padding: 26rpx;
  347. border-radius: 6rpx;
  348. .txt{
  349. line-height: 36rpx;
  350. color: #0DB26D;
  351. font-size: 26rpx;
  352. &.reviewed{
  353. color: #FF5B00;
  354. }
  355. &.approved{
  356. color: #0DB26D;
  357. }
  358. &.failed{
  359. color: #F94B4B;
  360. }
  361. }
  362. .txm{
  363. line-height: 36rpx;
  364. color: #666666;
  365. font-size: 26rpx;
  366. }
  367. }
  368. .tui-remarks-goods{
  369. width: 100%;
  370. height: 180rpx;
  371. box-sizing: border-box;
  372. background-color: #F7F7F7;
  373. padding: 26rpx;
  374. border-radius: 6rpx;
  375. .goods-image{
  376. width: 128rpx;
  377. height: 128rpx;
  378. float: left;
  379. image{
  380. width: 128rpx;
  381. height: 128rpx;
  382. display: block;
  383. border-radius: 4rpx;
  384. }
  385. }
  386. .goods-main{
  387. width: 522rpx;
  388. height: 128rpx;
  389. box-sizing: border-box;
  390. padding: 0 32rpx;
  391. float: right;
  392. .name{
  393. width: 100%;
  394. height: 60rpx;
  395. box-sizing: border-box;
  396. line-height: 60rpx;
  397. color: #333333;
  398. text-overflow: ellipsis;
  399. overflow: hidden;
  400. display: -webkit-box;
  401. -webkit-line-clamp: 1;
  402. line-clamp: 1;
  403. -webkit-box-orient: vertical;
  404. font-size: 26rpx;
  405. }
  406. .shop{
  407. line-height: 60rpx;
  408. color: #999999;
  409. font-size: 26rpx;
  410. }
  411. }
  412. }
  413. .tui-remarks-span {
  414. height: 48rpx;
  415. line-height: 48rpx;
  416. text-align: center;
  417. padding: 0 20rpx;
  418. background-color: #f7f7f7;
  419. font-size: $font-size-26;
  420. color: #666666;
  421. border-radius: 25rpx;
  422. display: inline-block;
  423. margin-right: 24rpx;
  424. margin-bottom: 24rpx;
  425. &:nth-child(4n) {
  426. margin-right: none;
  427. }
  428. }
  429. }
  430. .list-view {
  431. width: 100%;
  432. height: auto;
  433. margin-top: 20rpx;
  434. .list-view-text {
  435. width: 100%;
  436. float: left;
  437. .input {
  438. width: 500rpx;
  439. height: 50rpx;
  440. box-sizing: border-box;
  441. line-height: 50rpx;
  442. color: #333333;
  443. text-overflow: ellipsis;
  444. overflow: hidden;
  445. display: -webkit-box;
  446. -webkit-line-clamp: 1;
  447. line-clamp: 1;
  448. -webkit-box-orient: vertical;
  449. float: left;
  450. font-size: 26rpx;
  451. }
  452. .delbtn {
  453. width: 96rpx;
  454. height: 44rpx;
  455. border-radius: 8rpx;
  456. font-size: $font-size-24;
  457. color: #FF5B00;
  458. line-height: 44rpx;
  459. text-align: center;
  460. float: left;
  461. &.down {
  462. color: #1890f9;
  463. }
  464. }
  465. }
  466. }
  467. .list-view-upload {
  468. width: 100%;
  469. height: auto;
  470. .photo-item {
  471. display: inline-block;
  472. width: 112rpx;
  473. height: 112rpx;
  474. margin: 10rpx 0;
  475. margin-right: 25rpx;
  476. border-radius: 10rpx;
  477. border: 1px solid #f5f5f5;
  478. position: relative;
  479. float: left;
  480. image {
  481. width: 112rpx;
  482. height: 112rpx;
  483. border-radius: 10rpx;
  484. }
  485. }
  486. .photo-list {
  487. width: 100%;
  488. height: 116rpx;
  489. overflow: hidden;
  490. white-space: nowrap;
  491. display: flex;
  492. align-items: flex-start;
  493. }
  494. }
  495. }
  496. </style>