details.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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>{{ distType == '10' ? '经销商' : '代理商' }}</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="6">
  35. <view class="flex_l">
  36. <view class="info-label">{{ distType == '10' ? '经销商' : '代理商' }}编码:</view>
  37. <text class="info-txt">{{ distrInfo.distCode }}</text>
  38. </view>
  39. </u-col>
  40. <u-col span="6">
  41. <view class="flex_l">
  42. <view class="info-label">现有销售人数:</view>
  43. <text class="info-txt">{{ distrInfo.saleNum }}</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="6">
  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="6">
  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. v-if="curTabIndex >= 0"
  69. @change="changeTabs"
  70. :current="curTabIndex"
  71. :scrollable="false"
  72. :list="list"
  73. :activeStyle="{
  74. color: '#3E7EF8',
  75. fontWeight: 'bold',
  76. }"
  77. :inactiveStyle="{
  78. color: '#969696',
  79. }"></u-tabs>
  80. </view>
  81. </view>
  82. <view class="data-list">
  83. <!-- 跟进记录 -->
  84. <follow-records
  85. v-if="curTabIndex == 0"
  86. ref="follow"
  87. :targetId="distrId"
  88. :targetType="distType"></follow-records>
  89. <!-- 详情 -->
  90. <distr-detail v-if="curTabIndex == 1" :detail="distrInfo"></distr-detail>
  91. </view>
  92. <!-- 新增按钮 -->
  93. <view class="fixed-btn-group" :style="{ width: openBtnWidth ? '180rpx' : '90rpx' }">
  94. <view class="flex1" v-if="openBtnWidth">
  95. <view class="btn center" @click="openFollow()">跟</view>
  96. </view>
  97. <view class="btn center" @click="openBtnWidth = !openBtnWidth">
  98. <u-icon name="plus" color="#fff" size="20"></u-icon>
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. </template>
  104. <script>
  105. import distrApi from '../../api/base/distr'
  106. import to from 'await-to-js'
  107. import distrDetail from './components/distrDetail'
  108. import followRecords from './components/followRecords'
  109. export default {
  110. name: 'omsIndex',
  111. components: { distrDetail, followRecords },
  112. data() {
  113. return {
  114. openBtnWidth: false,
  115. curTabIndex: -1,
  116. fllowList: [], //跟进数据
  117. list: [
  118. {
  119. name: '跟进记录',
  120. index: 0,
  121. },
  122. {
  123. name: '详细信息',
  124. index: 1,
  125. },
  126. ],
  127. height: '',
  128. paddingTop: '',
  129. distrInfo: {},
  130. distrId: 0, //客户id
  131. distType: '10',
  132. }
  133. },
  134. onLoad(option) {
  135. this.distrId = parseInt(option.id)
  136. this.distType = option.distrType
  137. },
  138. created() {
  139. const navData = uni.getMenuButtonBoundingClientRect()
  140. this.height = navData.height + 'px'
  141. this.paddingTop = navData.top + 'px'
  142. },
  143. onShow() {
  144. this.curTabIndex = 0
  145. this.openBtnWidth = false
  146. this.getDistrDetail()
  147. },
  148. onHide() {
  149. this.curTabIndex = -1
  150. },
  151. methods: {
  152. async getDistrDetail() {
  153. const [err, res] = await to(distrApi.getEntity({ id: this.distrId }))
  154. if (err) return
  155. if (res && res.code == 200) {
  156. this.distrInfo = res.data.list
  157. }
  158. },
  159. // 改变tab
  160. changeTabs(data) {
  161. this.curTabIndex = data.index
  162. },
  163. // 打开转移
  164. openFollow() {
  165. let targetType = '' + (parseInt(this.distrInfo.distType) + 40)
  166. // this.$store.commit('setDetails', this.projectData)
  167. uni.navigateTo({
  168. //保留当前页面,跳转到应用内的某个页面
  169. url: '/pages/publicPages/follow?targetType=' + targetType + '&id=' + this.distrInfo.id,
  170. })
  171. },
  172. goBack() {
  173. uni.navigateBack({
  174. //关闭当前页面,返回上一页面或多级页面。
  175. delta: 1,
  176. })
  177. },
  178. },
  179. }
  180. </script>
  181. <style>
  182. page {
  183. background: #f2f3f5;
  184. }
  185. </style>
  186. <style lang="scss" scoped>
  187. .home {
  188. padding-top: 200rpx;
  189. .nav {
  190. position: absolute;
  191. left: 0;
  192. top: 0;
  193. width: 100%;
  194. height: 356rpx;
  195. background: #3e7ef8;
  196. border-radius: 0 0 31rpx 31rpx;
  197. .title {
  198. position: relative;
  199. text-align: center;
  200. font-size: 32rpx;
  201. font-weight: bold;
  202. color: #ffffff;
  203. .back {
  204. position: absolute;
  205. top: 0;
  206. bottom: 0;
  207. margin: auto;
  208. left: 70rpx;
  209. display: flex;
  210. }
  211. }
  212. }
  213. .main {
  214. position: absolute;
  215. width: 100%;
  216. height: calc(100vh - 200rpx);
  217. overflow: hidden;
  218. padding-bottom: 64rpx;
  219. .main-top {
  220. padding: 0 32rpx;
  221. }
  222. .customer-box {
  223. width: 100%;
  224. background: #ffffff;
  225. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  226. border-radius: 32rpx;
  227. padding: 22rpx 38rpx 68rpx 40rpx;
  228. .header {
  229. .name {
  230. .img {
  231. width: 46rpx;
  232. height: 46rpx;
  233. border-radius: 50%;
  234. margin-right: 8rpx;
  235. }
  236. text {
  237. font-size: 28rpx;
  238. font-weight: bold;
  239. color: #323232;
  240. }
  241. }
  242. .date {
  243. font-size: 24rpx;
  244. color: #3e7ef8;
  245. }
  246. }
  247. .info {
  248. .info-item {
  249. margin-top: 18rpx;
  250. .info-label {
  251. width: 162rpx;
  252. text-align: left;
  253. font-size: 24rpx;
  254. color: #646464;
  255. }
  256. .info-txt {
  257. flex: 1;
  258. font-size: 24rpx;
  259. color: #323232;
  260. }
  261. }
  262. }
  263. }
  264. .data-list {
  265. margin-top: 16rpx;
  266. width: 100%;
  267. height: calc(100vh - 532rpx);
  268. background: #ffffff;
  269. padding: 32rpx;
  270. overflow: auto;
  271. padding-bottom: 145rpx;
  272. .status1 {
  273. color: #4096fb;
  274. background: rgba(64, 150, 251, 0.2);
  275. }
  276. .status2 {
  277. background: rgba(255, 184, 60, 0.2);
  278. color: #ffb83c;
  279. }
  280. .status3 {
  281. color: #fe6936;
  282. background: rgba(254, 105, 54, 0.2);
  283. }
  284. }
  285. }
  286. .fixed-btn-group {
  287. position: fixed;
  288. display: flex;
  289. justify-content: space-around;
  290. align-items: center;
  291. width: 90rpx;
  292. height: 90rpx;
  293. bottom: 50rpx;
  294. right: 50rpx;
  295. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  296. border-radius: 20px;
  297. transition: all 0.2s;
  298. background: #fff;
  299. .btn {
  300. width: 60rpx;
  301. height: 60rpx;
  302. background: #3e7ef8;
  303. border-radius: 50%;
  304. margin: 10rpx;
  305. font-size: 26rpx;
  306. font-weight: bold;
  307. color: #ffffff;
  308. }
  309. }
  310. }
  311. </style>