details.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  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}') }}</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.openBtnWidth = false
  129. this.getDistrDetail()
  130. },
  131. methods: {
  132. async getDistrDetail() {
  133. const [err, res] = await to(distrApi.getEntity({ id: this.distrId }))
  134. if (err) return
  135. if (res && res.code == 200) {
  136. this.distrInfo = res.data.list
  137. }
  138. },
  139. // 改变tab
  140. changeTabs(data) {
  141. this.curTabIndex = data.index
  142. },
  143. goBack() {
  144. uni.navigateBack({
  145. //关闭当前页面,返回上一页面或多级页面。
  146. delta: 1,
  147. })
  148. },
  149. },
  150. }
  151. </script>
  152. <style>
  153. page {
  154. background: #f2f3f5;
  155. }
  156. </style>
  157. <style lang="scss" scoped>
  158. .home {
  159. padding-top: 200rpx;
  160. .nav {
  161. position: absolute;
  162. left: 0;
  163. top: 0;
  164. width: 100%;
  165. height: 356rpx;
  166. background: #3e7ef8;
  167. border-radius: 0 0 31rpx 31rpx;
  168. .title {
  169. position: relative;
  170. text-align: center;
  171. font-size: 32rpx;
  172. font-weight: bold;
  173. color: #ffffff;
  174. .back {
  175. position: absolute;
  176. top: 0;
  177. bottom: 0;
  178. margin: auto;
  179. left: 70rpx;
  180. display: flex;
  181. }
  182. }
  183. }
  184. .main {
  185. position: absolute;
  186. width: 100%;
  187. height: calc(100vh - 200rpx);
  188. overflow: hidden;
  189. padding-bottom: 64rpx;
  190. .main-top {
  191. padding: 0 32rpx;
  192. }
  193. .customer-box {
  194. width: 100%;
  195. background: #ffffff;
  196. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  197. border-radius: 32rpx;
  198. padding: 22rpx 38rpx 68rpx 40rpx;
  199. .header {
  200. .name {
  201. .img {
  202. width: 46rpx;
  203. height: 46rpx;
  204. border-radius: 50%;
  205. margin-right: 8rpx;
  206. }
  207. text {
  208. font-size: 28rpx;
  209. font-weight: bold;
  210. color: #323232;
  211. }
  212. }
  213. .date {
  214. font-size: 24rpx;
  215. color: #3e7ef8;
  216. }
  217. }
  218. .info {
  219. .info-item {
  220. margin-top: 18rpx;
  221. .info-label {
  222. width: 116rpx;
  223. text-align: left;
  224. font-size: 24rpx;
  225. color: #646464;
  226. }
  227. .info-txt {
  228. flex: 1;
  229. font-size: 24rpx;
  230. color: #323232;
  231. }
  232. }
  233. }
  234. }
  235. .data-list {
  236. margin-top: 16rpx;
  237. width: 100%;
  238. height: calc(100vh - 532rpx);
  239. background: #ffffff;
  240. padding: 32rpx;
  241. overflow: auto;
  242. padding-bottom: 145rpx;
  243. .status1 {
  244. color: #4096fb;
  245. background: rgba(64, 150, 251, 0.2);
  246. }
  247. .status2 {
  248. background: rgba(255, 184, 60, 0.2);
  249. color: #ffb83c;
  250. }
  251. .status3 {
  252. color: #fe6936;
  253. background: rgba(254, 105, 54, 0.2);
  254. }
  255. }
  256. }
  257. .fixed-btn-group {
  258. position: fixed;
  259. display: flex;
  260. justify-content: space-around;
  261. align-items: center;
  262. width: 90rpx;
  263. height: 90rpx;
  264. bottom: 50rpx;
  265. right: 50rpx;
  266. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  267. border-radius: 20px;
  268. transition: all 0.2s;
  269. background: #fff;
  270. .btn {
  271. width: 60rpx;
  272. height: 60rpx;
  273. background: #3e7ef8;
  274. border-radius: 50%;
  275. margin: 10rpx;
  276. font-size: 26rpx;
  277. font-weight: bold;
  278. color: #ffffff;
  279. }
  280. }
  281. }
  282. </style>