record-details.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  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. 6: '其他'
  209. }
  210. return map[value]
  211. },
  212. genderActionsFilters(value) {
  213. // 客户性别
  214. const map = {
  215. 0: '男',
  216. 1: '女'
  217. }
  218. return map[value]
  219. },
  220. additiveActionsFilters(value) {
  221. // 加群情况
  222. const map = {
  223. 0: '已加群',
  224. 1: '未加群'
  225. }
  226. return map[value]
  227. }
  228. },
  229. methods: {
  230. ...mapMutations(['login']),
  231. async getUserRemarksVisitDetail() {
  232. //备注详情
  233. try{
  234. const res = await this.UserService.getUserRemarksVisitDetail({ remarksId: this.remarksId })
  235. this.remarksParams = res.data
  236. this.labelsList = [...this.remarksParams.remarks,...this.remarksParams.stateKeyword,...this.remarksParams.trendsKeyword]
  237. }catch(error){
  238. this.$util.msg(error.msg, 2000)
  239. }
  240. },
  241. previewImg(image, index) {
  242. //顶部商品图片预览
  243. isPreviewImg = true
  244. let previewUrls = image
  245. uni.previewImage({
  246. current: index, //图片索引
  247. urls: previewUrls, //必须是http图片,本地图片无效
  248. longPressActions: ''
  249. })
  250. },
  251. previewFile(file) {
  252. //预览文件
  253. this.openDocument(file)
  254. },
  255. openDocument(file) {
  256. // 打开文档
  257. uni.showLoading({
  258. title: '加载中'
  259. })
  260. // 获取文件后缀
  261. const index = file.fileName.lastIndexOf('.')
  262. const suffix = file.fileName.substring(index + 1)
  263. // 下载文件
  264. uni.downloadFile({
  265. url: file.fileUrl,
  266. success(res) {
  267. const filePath = res.tempFilePath
  268. console.log(filePath)
  269. // 打开文件
  270. uni.openDocument({
  271. filePath: filePath,
  272. fileType: suffix,
  273. success(res) {
  274. uni.showToast({
  275. icon: 'success',
  276. title: '打开成功',
  277. duration: 1200
  278. })
  279. uni.hideLoading()
  280. },
  281. fail(err) {
  282. if (err.errMsg.indexOf('fail filetype not supported')) {
  283. uni.showModal({
  284. content: '不支持的文件预览',
  285. cancelColor: '#666',
  286. confirmColor: '#FF5B00'
  287. })
  288. }
  289. uni.hideLoading()
  290. }
  291. })
  292. },
  293. fail(err) {
  294. uni.showToast({
  295. title: JSON.stringify(err),
  296. icon: 'none',
  297. duration: 5000
  298. })
  299. uni.hideLoading()
  300. }
  301. })
  302. }
  303. },
  304. onShow() {}
  305. }
  306. </script>
  307. <style lang="scss">
  308. page {
  309. height: auto;
  310. background: #ffffff;
  311. }
  312. .remarks-content {
  313. width: 100%;
  314. height: auto;
  315. box-sizing: border-box;
  316. padding: 0 24rpx;
  317. padding-bottom: 80rpx;
  318. .list-view-title {
  319. width: 100%;
  320. height: auto;
  321. margin-bottom: 16rpx;
  322. margin-top: 40rpx;
  323. .list-view-h1 {
  324. line-height: 40rpx;
  325. font-size: $font-size-30;
  326. color: #333333;
  327. text-align: left;
  328. font-weight: bold;
  329. text {
  330. color: #666666;
  331. font-weight: normal;
  332. }
  333. }
  334. }
  335. .tui-remarks-content {
  336. width: 100%;
  337. height: auto;
  338. margin-bottom: 24rpx;
  339. .tui-remarks-text{
  340. width: 100%;
  341. box-sizing: border-box;
  342. background-color: #F7F7F7;
  343. padding: 26rpx;
  344. border-radius: 6rpx;
  345. .txt{
  346. line-height: 36rpx;
  347. color: #0DB26D;
  348. font-size: 26rpx;
  349. &.reviewed{
  350. color: #FF5B00;
  351. }
  352. &.approved{
  353. color: #0DB26D;
  354. }
  355. &.failed{
  356. color: #F94B4B;
  357. }
  358. }
  359. .txm{
  360. line-height: 36rpx;
  361. color: #666666;
  362. font-size: 26rpx;
  363. }
  364. }
  365. .tui-remarks-goods{
  366. width: 100%;
  367. height: 180rpx;
  368. box-sizing: border-box;
  369. background-color: #F7F7F7;
  370. padding: 26rpx;
  371. border-radius: 6rpx;
  372. .goods-image{
  373. width: 128rpx;
  374. height: 128rpx;
  375. float: left;
  376. image{
  377. width: 128rpx;
  378. height: 128rpx;
  379. display: block;
  380. border-radius: 4rpx;
  381. }
  382. }
  383. .goods-main{
  384. width: 522rpx;
  385. height: 128rpx;
  386. box-sizing: border-box;
  387. padding: 0 32rpx;
  388. float: right;
  389. .name{
  390. width: 100%;
  391. height: 60rpx;
  392. box-sizing: border-box;
  393. line-height: 60rpx;
  394. color: #333333;
  395. text-overflow: ellipsis;
  396. overflow: hidden;
  397. display: -webkit-box;
  398. -webkit-line-clamp: 1;
  399. line-clamp: 1;
  400. -webkit-box-orient: vertical;
  401. font-size: 26rpx;
  402. }
  403. .shop{
  404. line-height: 60rpx;
  405. color: #999999;
  406. font-size: 26rpx;
  407. }
  408. }
  409. }
  410. .tui-remarks-span {
  411. height: 48rpx;
  412. line-height: 48rpx;
  413. text-align: center;
  414. padding: 0 20rpx;
  415. background-color: #f7f7f7;
  416. font-size: $font-size-26;
  417. color: #666666;
  418. border-radius: 25rpx;
  419. display: inline-block;
  420. margin-right: 24rpx;
  421. margin-bottom: 24rpx;
  422. &:nth-child(4n) {
  423. margin-right: none;
  424. }
  425. }
  426. }
  427. .list-view {
  428. width: 100%;
  429. height: auto;
  430. margin-top: 20rpx;
  431. .list-view-text {
  432. width: 100%;
  433. float: left;
  434. .input {
  435. width: 500rpx;
  436. height: 50rpx;
  437. box-sizing: border-box;
  438. line-height: 50rpx;
  439. color: #333333;
  440. text-overflow: ellipsis;
  441. overflow: hidden;
  442. display: -webkit-box;
  443. -webkit-line-clamp: 1;
  444. line-clamp: 1;
  445. -webkit-box-orient: vertical;
  446. float: left;
  447. font-size: 26rpx;
  448. }
  449. .delbtn {
  450. width: 96rpx;
  451. height: 44rpx;
  452. border-radius: 8rpx;
  453. font-size: $font-size-24;
  454. color: #FF5B00;
  455. line-height: 44rpx;
  456. text-align: center;
  457. float: left;
  458. &.down {
  459. color: #1890f9;
  460. }
  461. }
  462. }
  463. }
  464. .list-view-upload {
  465. width: 100%;
  466. height: auto;
  467. .photo-item {
  468. display: inline-block;
  469. width: 112rpx;
  470. height: 112rpx;
  471. margin: 10rpx 0;
  472. margin-right: 25rpx;
  473. border-radius: 10rpx;
  474. border: 1px solid #f5f5f5;
  475. position: relative;
  476. float: left;
  477. image {
  478. width: 112rpx;
  479. height: 112rpx;
  480. border-radius: 10rpx;
  481. }
  482. }
  483. .photo-list {
  484. width: 100%;
  485. height: 116rpx;
  486. overflow: hidden;
  487. white-space: nowrap;
  488. display: flex;
  489. align-items: flex-start;
  490. }
  491. }
  492. }
  493. </style>