record.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <view class="scoped-box">
  3. <wm-watermark :text="userInfo2.phone" :num="50"></wm-watermark>
  4. <view class="scoped-list">
  5. <view class="sl-item">
  6. <view :class="'sli-top t' + dtlObj.deal_type">{{ dtlObj.deal_item }}[{{ thtObj[dtlObj.house_type] }}] {{ dtlObj.house_no }}
  7. <view class="r2" @click="pageTo('/pages/trade/create', { info: item })">编辑</view>
  8. <view class="r" @click="copyTextHandle(dtlObj)">喜报</view>
  9. </view>
  10. <view class="sli-body">
  11. <view class="sli-p2">总价:<view class="n">{{ dtlObj.price }}元</view> => {{(Number(dtlObj.price)/dtlObj.area).toFixed(2)}}元|<view class="n">{{ dtlObj.area }}㎡</view></view>
  12. <view class="sli-p4" v-if="dtlObj.discount">折扣:{{ dtlObj.discount || '未知' }}</view>
  13. <view class="sli-p1" @click="callHandle">客户:{{ dtlObj.customer_name }}({{ dtlObj.customer_phone }})
  14. <view class="i">[打电话]</view>
  15. </view>
  16. <view class="sli-p1">业务:{{ dtlObj.deal_clerk }}报备至{{ dtlObj.report_dept }}({{ tdtObj[dtlObj.deal_type] }})</view>
  17. <view class="sli-p1">佣金:<view class="n">{{ dtlObj.brokerage || '0' }}</view> 元
  18. <view v-if="dtlObj.brokerage_img" class="i" @click="previewImgHandle(dtlObj.brokerage_img, [dtlObj.brokerage_img])">[凭证]</view>
  19. | 返佣<view class="n">{{ dtlObj.rebate || '0' }}</view>元
  20. </view>
  21. <view class="sli-p3">成交日期:{{ dtlObj.deal_at }}</view>
  22. </view>
  23. </view>
  24. </view>
  25. <view>
  26. <view class="buystep-info u-p-32 box-shadow u-skeleton-fillet">
  27. <view class="name" @click="dial()">跟进记录:{{custTips || ''}}</view>
  28. <u-empty v-if="stepsLogList.length == 0" mode="list" text="暂无流水记录"></u-empty>
  29. <u-time-line>
  30. <u-time-line-item v-for="(item, index) in stepsLogList" :key="index">
  31. <template v-slot:node>
  32. <view class="u-node"><u-icon name="checkmark-circle" size="28" color="#2080f0"></u-icon></view>
  33. </template>
  34. <template v-slot:content>
  35. <view>
  36. <view class="u-order-title" v-if="item.info1">佣金到款日:{{item.info1}}</view>
  37. <view class="u-order-title" v-if="item.info2">回款比例:<view class="c2">{{item.info2}}%</view></view>
  38. <view class="u-order-title" v-if="item.info3">渠道或佣金开票情况:{{item.info3 == 1 ? '有开票' : '没有开票'}}</view>
  39. <view class="u-order-img" v-if="item.info4">
  40. <image class="img" :src="item.info4" mode="aspectFill" @click="previewImgHandle(item.info4, [item.info4])"></image>
  41. </view>
  42. <view class="u-order-desc" v-if="item.remark">{{item.remark}}</view>
  43. <view class="u-order-time">{{ item.create_at}}</view>
  44. </view>
  45. </template>
  46. </u-time-line-item>
  47. </u-time-line>
  48. </view>
  49. </view>
  50. <u-button class="f-btn bwin-btn-80 u-m-b-10" type="primary" @click="addHandle">添加跟进记录</u-button>
  51. </view>
  52. </template>
  53. <script>
  54. import { arrToObj } from '@/utils'
  55. import wmWatermark from '@/components/wm-watermark/wm-watermark.vue'
  56. import uniCopy from '@/js_sdk/xb-copy/uni-copy.js'
  57. export default {
  58. components: {
  59. wmWatermark
  60. },
  61. data() {
  62. return {
  63. userInfo2: {},
  64. rsObj: {},
  65. curId: '',
  66. custTips: '',
  67. dtlObj: {},
  68. thtObj: {},
  69. tdtObj: {},
  70. stepsLogList: [] // 进展
  71. };
  72. },
  73. onLoad(params) {
  74. this.curId = params.id
  75. const dictObj = uni.getStorageSync('MD_dict')
  76. this.thtObj = arrToObj(dictObj.trade_house_type)
  77. this.tdtObj = arrToObj(dictObj.trade_deal_type)
  78. },
  79. onShow() {
  80. this.getData()
  81. uni.api.cust.apitradedetail({id:this.curId}).then(res =>{
  82. this.dtlObj = res || {}
  83. })
  84. },
  85. created () {
  86. this.userInfo2 = uni.getStorageSync('MD_userInfo2')
  87. },
  88. methods: {
  89. // 带监听器跳转
  90. pageTo(url, data) {
  91. /// xxxxx
  92. uni.navigateTo({
  93. url: url,
  94. events: {
  95. // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
  96. update: function(data) {
  97. // 当B页面运行 eventChannel.emit('update', { a:1 }); 时,会运行这里的代码逻辑。
  98. }
  99. },
  100. success: function(res) {
  101. // 通过eventChannel向被打开页面传送数据
  102. res.eventChannel.emit('data', data);
  103. }
  104. });
  105. },
  106. copyTextHandle (item) {
  107. // return
  108. uniCopy({
  109. content: `【洪楼News】${item.deal_at}喜报
  110. 恭喜${item.deal_clerk}小伙伴今日成交${this.thtObj[item.house_type]}一套
  111. (1)客户姓名: ${item.customer_name}
  112. (2)报备电话:${item.customer_phone}
  113. (3)报备渠道:${item.report_dept}(${this.tdtObj[item.deal_type]})
  114. (4)成交项目:${item.deal_item}
  115. (5)具体房号:${item.house_no}
  116. (6)面积:${item.area}㎡
  117. (7)总价:${item.price}元
  118. (8)单价:${(Number(item.price)/item.area).toFixed(2)}元
  119. (9)折扣:${item.discount || '未知' }
  120. 齐心协力向前冲,洪楼业绩显峥嵘!`,
  121. success:(res)=>{
  122. uni.showToast({
  123. title: res,
  124. icon: 'none'
  125. })
  126. },
  127. error:(e)=>{
  128. uni.showToast({
  129. title: e,
  130. icon: 'none',
  131. duration:3000,
  132. })
  133. }
  134. })
  135. },
  136. callHandle() {
  137. uni.makePhoneCall({
  138. phoneNumber: this.dtlObj.customer_phone || ''
  139. });
  140. },
  141. getData () {
  142. uni.api.cust.apitraderecordlist({trade_id:this.curId, page_size: 100}).then(res =>{
  143. let stepsLogList = res.list || []
  144. this.stepsLogList = [...stepsLogList]
  145. })
  146. },
  147. previewImgHandle (current, urls){
  148. uni.previewImage({
  149. current,
  150. urls
  151. })
  152. },
  153. addHandle () {
  154. uni.navigateTo({
  155. url: `/pages/trade/recordedit?id=${this.curId}`
  156. })
  157. },
  158. }
  159. };
  160. </script>
  161. <style lang="scss">
  162. .scoped-list {
  163. padding-top: 20rpx;
  164. .sl-item {
  165. box-shadow: 0 0 5px #ccc;
  166. margin: 0 20rpx 20rpx;
  167. border-radius: 20rpx;
  168. overflow: hidden;
  169. background: #fff;
  170. .sli-top {
  171. position: relative;
  172. height: 70rpx;
  173. line-height: 70rpx;
  174. color: #fff;
  175. background: #2d8cf0;
  176. padding-left: 20rpx;
  177. &.t2 {
  178. background: #19be6b;
  179. }
  180. &.t3 {
  181. background: #795548;
  182. }
  183. .r {
  184. position: absolute;
  185. top: 0;
  186. right: 20rpx;
  187. height: 70rpx;
  188. line-height: 70rpx;
  189. color: #eee;
  190. }
  191. .r2 {
  192. position: absolute;
  193. top: 0;
  194. right: 100rpx;
  195. height: 70rpx;
  196. line-height: 70rpx;
  197. color: #eee;
  198. }
  199. }
  200. .sli-body {
  201. padding: 10rpx 20rpx;
  202. }
  203. .sli-p1 {
  204. color: #666;
  205. margin-bottom: 10rpx;
  206. font-size: 28rpx;
  207. .n {
  208. color: #ff9900;
  209. display: inline-block;
  210. font-weight: bold;
  211. }
  212. .i {
  213. color: #2d8cf0;
  214. font-weight: bold;
  215. display: inline-block;
  216. padding-right: 10rpx;
  217. }
  218. }
  219. .sli-p2 {
  220. color: #333;
  221. margin-bottom: 10rpx;
  222. .n {
  223. font-size: 30rpx;
  224. display: inline-block;
  225. font-weight: bold;
  226. color: #ed4014;
  227. }
  228. }
  229. .sli-p3 {
  230. color: #999;
  231. font-size: 28rpx;
  232. margin-bottom: 10rpx;
  233. }
  234. .sli-p4 {
  235. background: rgba(255,229,100,.3);
  236. color: #666;
  237. margin-bottom: 10rpx;
  238. }
  239. }
  240. }
  241. .buystep-info {
  242. width: 100%;
  243. padding: 0 0 32rpx;
  244. background-color: #fff;
  245. margin-bottom: 20rpx;
  246. border-radius: 10rpx;
  247. .name {
  248. font-weight: bold;
  249. margin-bottom: 20rpx;
  250. }
  251. .u-order-title {
  252. color: $u-main-color;
  253. font-size: $u-p1;
  254. margin-bottom: 10rpx;
  255. .c {
  256. display: inline-block;
  257. color: #2979ff;
  258. font-weight: bold;
  259. }
  260. .c2 {
  261. display: inline-block;
  262. color: #5a7fbd;
  263. font-weight: bold;
  264. }
  265. }
  266. .u-order-desc {
  267. // color: $u-content-color;
  268. color: #777;
  269. font-size: $u-p2;
  270. margin-bottom: 6rpx;
  271. }
  272. .u-order-img {
  273. .img {
  274. padding: 10rpx;
  275. border: 1PX solid #dcdcdc;
  276. width: 160rpx;
  277. height: 160rpx;
  278. margin-right: 20rpx;
  279. border-radius: 10rpx;
  280. overflow: hidden;
  281. }
  282. }
  283. .u-order-time {
  284. color: rgb(200, 200, 200);
  285. font-size: $u-p2;
  286. }
  287. }
  288. .scoped-box {
  289. padding-bottom: 100rpx;
  290. background: #f2f2f2;
  291. .f-btn {
  292. position: fixed;
  293. bottom: 0;
  294. left: 20rpx;
  295. right: 20rpx;
  296. }
  297. }
  298. </style>