details.vue 8.5 KB

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