record.vue 11 KB

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