details.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. <!--
  2. * @Author: liuzhenlin 461480418@qq.ocm
  3. * @Date: 2023-01-12 11:57:48
  4. * @LastEditors: liuzhenlin
  5. * @LastEditTime: 2023-02-28 10:21:59
  6. * @Description: file content
  7. * @FilePath: \oms\pages\distributor\details.vue
  8. -->
  9. <template>
  10. <view class="home">
  11. <view class="nav">
  12. <view :style="{ paddingTop }">
  13. <view class="title" :style="[{ height }, { lineHeight: height }]">
  14. <view class="back" @click="goBack()">
  15. <u-icon name="arrow-left" color="#ffffff" size="22"></u-icon>
  16. </view>
  17. <text>经销商详情</text>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="main">
  22. <view class="main-top">
  23. <view class="customer-box">
  24. <view class="header flex1">
  25. <view class="name flex_l">
  26. <image class="img" src="../../static/images/menu1.png" mode="scaleToFill" />
  27. <text>{{ distrInfo.distName }}</text>
  28. </view>
  29. <view class="date">{{ parseTime(distrInfo.createdTime, '{y}-{m}-{d} {h}:{i}') }}</view>
  30. </view>
  31. <view class="info">
  32. <view class="info-item">
  33. <u-row>
  34. <u-col span="7">
  35. <view class="flex_l">
  36. <view class="info-label">客户编码:</view>
  37. <text class="info-txt">{{ distrInfo.distCode }}</text>
  38. </view>
  39. </u-col>
  40. <u-col span="5">
  41. <view class="flex_l">
  42. <view class="info-label">负责人:</view>
  43. <text class="info-txt">{{ distrInfo.distBoss }}</text>
  44. </view>
  45. </u-col>
  46. </u-row>
  47. </view>
  48. <view class="info-item">
  49. <u-row justify="space-between">
  50. <u-col span="7">
  51. <view class="flex_l">
  52. <view class="info-label">销售人:</view>
  53. <text class="info-txt">{{ distrInfo.belongSale }}</text>
  54. </view>
  55. </u-col>
  56. <u-col span="5">
  57. <view class="flex_l">
  58. <view class="info-label">归属省份:</view>
  59. <text class="info-txt">{{ distrInfo.provinceDesc }}</text>
  60. </view>
  61. </u-col>
  62. </u-row>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="tabs">
  67. <u-tabs
  68. @change="changeTabs"
  69. :current="curTabIndex"
  70. :scrollable="false"
  71. :list="list"
  72. :activeStyle="{
  73. color: '#3E7EF8',
  74. fontWeight: 'bold',
  75. }"
  76. :inactiveStyle="{
  77. color: '#969696',
  78. }"></u-tabs>
  79. </view>
  80. </view>
  81. <view class="data-list">
  82. <!-- 跟进记录 -->
  83. <follow-records v-if="curTabIndex == 0" ref="follow" :customerId="customerId"></follow-records>
  84. <!-- 详情 -->
  85. <distr-detail v-if="curTabIndex == 1" :detail="distrInfo"></distr-detail>
  86. </view>
  87. </view>
  88. </view>
  89. </template>
  90. <script>
  91. import distrApi from '../../api/base/distr'
  92. import to from 'await-to-js'
  93. import distrDetail from './components/distrDetail'
  94. import followRecords from './components/followRecords'
  95. export default {
  96. name: 'omsIndex',
  97. components: { distrDetail, followRecords },
  98. data() {
  99. return {
  100. openBtnWidth: false,
  101. curTabIndex: 0,
  102. fllowList: [], //跟进数据
  103. list: [
  104. {
  105. name: '活动记录',
  106. index: 0,
  107. },
  108. {
  109. name: '详细信息',
  110. index: 1,
  111. },
  112. ],
  113. height: '',
  114. paddingTop: '',
  115. distrInfo: {},
  116. distrId: 0, //客户id
  117. }
  118. },
  119. onLoad(option) {
  120. this.distrId = parseInt(option.id)
  121. },
  122. created() {
  123. const navData = uni.getMenuButtonBoundingClientRect()
  124. this.height = navData.height + 'px'
  125. this.paddingTop = navData.top + 'px'
  126. },
  127. onShow() {
  128. this.getDistrDetail()
  129. },
  130. methods: {
  131. async getDistrDetail() {
  132. const [err, res] = await to(distrApi.getEntity({ id: this.distrId }))
  133. if (err) return
  134. if (res && res.code == 200) {
  135. console.log(res)
  136. this.distrInfo = res.data.list
  137. }
  138. },
  139. // 改变tab
  140. changeTabs(data) {
  141. console.log(data)
  142. this.curTabIndex = data.index
  143. },
  144. goBack() {
  145. uni.navigateBack({
  146. //关闭当前页面,返回上一页面或多级页面。
  147. delta: 1,
  148. })
  149. },
  150. },
  151. }
  152. </script>
  153. <style>
  154. page {
  155. background: #f2f3f5;
  156. }
  157. </style>
  158. <style lang="scss" scoped>
  159. .home {
  160. padding-top: 200rpx;
  161. .nav {
  162. position: absolute;
  163. left: 0;
  164. top: 0;
  165. width: 100%;
  166. height: 356rpx;
  167. background: #3e7ef8;
  168. border-radius: 0 0 31rpx 31rpx;
  169. .title {
  170. position: relative;
  171. text-align: center;
  172. font-size: 32rpx;
  173. font-weight: bold;
  174. color: #ffffff;
  175. .back {
  176. position: absolute;
  177. top: 0;
  178. bottom: 0;
  179. margin: auto;
  180. left: 70rpx;
  181. display: flex;
  182. }
  183. }
  184. }
  185. .main {
  186. position: absolute;
  187. width: 100%;
  188. height: calc(100vh - 200rpx);
  189. overflow: hidden;
  190. padding-bottom: 64rpx;
  191. .main-top {
  192. padding: 0 32rpx;
  193. }
  194. .customer-box {
  195. width: 100%;
  196. background: #ffffff;
  197. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  198. border-radius: 32rpx;
  199. padding: 22rpx 38rpx 68rpx 40rpx;
  200. .header {
  201. .name {
  202. .img {
  203. width: 46rpx;
  204. height: 46rpx;
  205. border-radius: 50%;
  206. margin-right: 8rpx;
  207. }
  208. text {
  209. font-size: 28rpx;
  210. font-weight: bold;
  211. color: #323232;
  212. }
  213. }
  214. .date {
  215. font-size: 24rpx;
  216. color: #3e7ef8;
  217. }
  218. }
  219. .info {
  220. .info-item {
  221. margin-top: 18rpx;
  222. .info-label {
  223. width: 116rpx;
  224. text-align: left;
  225. font-size: 24rpx;
  226. color: #646464;
  227. }
  228. .info-txt {
  229. flex: 1;
  230. font-size: 24rpx;
  231. color: #323232;
  232. }
  233. }
  234. }
  235. }
  236. .data-list {
  237. margin-top: 16rpx;
  238. width: 100%;
  239. height: calc(100vh - 532rpx);
  240. background: #ffffff;
  241. padding: 32rpx;
  242. overflow: auto;
  243. padding-bottom: 145rpx;
  244. .status1 {
  245. color: #4096fb;
  246. background: rgba(64, 150, 251, 0.2);
  247. }
  248. .status2 {
  249. background: rgba(255, 184, 60, 0.2);
  250. color: #ffb83c;
  251. }
  252. .status3 {
  253. color: #fe6936;
  254. background: rgba(254, 105, 54, 0.2);
  255. }
  256. }
  257. }
  258. .fixed-btn-group {
  259. position: fixed;
  260. display: flex;
  261. justify-content: space-around;
  262. align-items: center;
  263. width: 90rpx;
  264. height: 90rpx;
  265. bottom: 50rpx;
  266. right: 50rpx;
  267. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  268. border-radius: 20px;
  269. transition: all 0.2s;
  270. background: #fff;
  271. .btn {
  272. width: 60rpx;
  273. height: 60rpx;
  274. background: #3e7ef8;
  275. border-radius: 50%;
  276. margin: 10rpx;
  277. font-size: 26rpx;
  278. font-weight: bold;
  279. color: #ffffff;
  280. }
  281. }
  282. }
  283. </style>