record-details.vue 12 KB

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