details.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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>{{ distrType == '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">{{ distrType == '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="distrType"></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. distrType: '10',
  132. }
  133. },
  134. onLoad(option) {
  135. this.distrId = parseInt(option.id)
  136. this.distrType = 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. // this.$store.commit('setDetails', this.projectData)
  166. uni.navigateTo({
  167. //保留当前页面,跳转到应用内的某个页面
  168. url: '/pages/publicPages/follow?targetType=50&id=' + this.distrInfo.id,
  169. })
  170. },
  171. goBack() {
  172. uni.navigateBack({
  173. //关闭当前页面,返回上一页面或多级页面。
  174. delta: 1,
  175. })
  176. },
  177. },
  178. }
  179. </script>
  180. <style>
  181. page {
  182. background: #f2f3f5;
  183. }
  184. </style>
  185. <style lang="scss" scoped>
  186. .home {
  187. padding-top: 200rpx;
  188. .nav {
  189. position: absolute;
  190. left: 0;
  191. top: 0;
  192. width: 100%;
  193. height: 356rpx;
  194. background: #3e7ef8;
  195. border-radius: 0 0 31rpx 31rpx;
  196. .title {
  197. position: relative;
  198. text-align: center;
  199. font-size: 32rpx;
  200. font-weight: bold;
  201. color: #ffffff;
  202. .back {
  203. position: absolute;
  204. top: 0;
  205. bottom: 0;
  206. margin: auto;
  207. left: 70rpx;
  208. display: flex;
  209. }
  210. }
  211. }
  212. .main {
  213. position: absolute;
  214. width: 100%;
  215. height: calc(100vh - 200rpx);
  216. overflow: hidden;
  217. padding-bottom: 64rpx;
  218. .main-top {
  219. padding: 0 32rpx;
  220. }
  221. .customer-box {
  222. width: 100%;
  223. background: #ffffff;
  224. box-shadow: 0 6rpx 19rpx 2rpx rgba(0, 45, 132, 0.15);
  225. border-radius: 32rpx;
  226. padding: 22rpx 38rpx 68rpx 40rpx;
  227. .header {
  228. .name {
  229. .img {
  230. width: 46rpx;
  231. height: 46rpx;
  232. border-radius: 50%;
  233. margin-right: 8rpx;
  234. }
  235. text {
  236. font-size: 28rpx;
  237. font-weight: bold;
  238. color: #323232;
  239. }
  240. }
  241. .date {
  242. font-size: 24rpx;
  243. color: #3e7ef8;
  244. }
  245. }
  246. .info {
  247. .info-item {
  248. margin-top: 18rpx;
  249. .info-label {
  250. width: 162rpx;
  251. text-align: left;
  252. font-size: 24rpx;
  253. color: #646464;
  254. }
  255. .info-txt {
  256. flex: 1;
  257. font-size: 24rpx;
  258. color: #323232;
  259. }
  260. }
  261. }
  262. }
  263. .data-list {
  264. margin-top: 16rpx;
  265. width: 100%;
  266. height: calc(100vh - 532rpx);
  267. background: #ffffff;
  268. padding: 32rpx;
  269. overflow: auto;
  270. padding-bottom: 145rpx;
  271. .status1 {
  272. color: #4096fb;
  273. background: rgba(64, 150, 251, 0.2);
  274. }
  275. .status2 {
  276. background: rgba(255, 184, 60, 0.2);
  277. color: #ffb83c;
  278. }
  279. .status3 {
  280. color: #fe6936;
  281. background: rgba(254, 105, 54, 0.2);
  282. }
  283. }
  284. }
  285. .fixed-btn-group {
  286. position: fixed;
  287. display: flex;
  288. justify-content: space-around;
  289. align-items: center;
  290. width: 90rpx;
  291. height: 90rpx;
  292. bottom: 50rpx;
  293. right: 50rpx;
  294. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  295. border-radius: 20px;
  296. transition: all 0.2s;
  297. background: #fff;
  298. .btn {
  299. width: 60rpx;
  300. height: 60rpx;
  301. background: #3e7ef8;
  302. border-radius: 50%;
  303. margin: 10rpx;
  304. font-size: 26rpx;
  305. font-weight: bold;
  306. color: #ffffff;
  307. }
  308. }
  309. }
  310. </style>