record.vue 10 KB

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