detail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. <template>
  2. <view class="scoped-box page u-skeleton">
  3. <!-- 客户信息 -->
  4. <view class="customer-info u-skeleton-fillet box-shadow">
  5. <view class="left">
  6. <view class="customer">
  7. <view class="relname u-skeleton-rect">
  8. <text @click="openInfoPopup">
  9. {{ detail.name }}
  10. </text>
  11. <u-icon
  12. @click="openInfoPopup"
  13. class="u-m-l-10"
  14. :name="detail.sex == 'male' ? 'man' : 'woman'"
  15. size="24"
  16. :color="detail.sex == 'male' ? '#2080f0' : '#f85f69'"
  17. ></u-icon>
  18. <u-tag
  19. :text="detail.report_state == 3 ? '无效客户' : detail.report_state == 2 ? '审核中' : '有效客户'"
  20. :type="detail.report_state == 3 ? 'error' : detail.report_state == 2 ? 'warning' : 'success'"
  21. size="mini"
  22. class="u-m-l-20"
  23. ></u-tag>
  24. <!-- v-if="userInfo.user_id == detail.user_id" -->
  25. <u-tag
  26. @click="openPopup"
  27. text="点击获取报备二维码"
  28. :type="'primary'"
  29. size="mini"
  30. class="u-m-l-20"
  31. ></u-tag>
  32. </view>
  33. <view class="mobile u-skeleton-rect">{{ detail.phone }}</view>
  34. </view>
  35. </view>
  36. <view class="right"><u-icon name="phone" size="32" @click="dial(detail.phone)"></u-icon></view>
  37. </view>
  38. <!-- 项目信息 -->
  39. <view class="property-info u-skeleton-fillet box-shadow">
  40. <view class="name u-skeleton-rect">{{ detail.estate_name }}
  41. <u-tag
  42. @click="pageTo('/pages/agent/recommend/visitimg?id=' + detail.id)"
  43. text="上传/查看到访凭证和结佣资料"
  44. :type="'primary'"
  45. class="u-m-l-20"
  46. ></u-tag>
  47. </view>
  48. <u-line margin="10rpx"></u-line>
  49. <!-- <view class="saler u-skeleton-rect" v-if="detail.salerInfo !== undefined">
  50. 当前置业顾问:{{ detail.salerInfo.name }}-{{ detail.salerInfo.job }}({{ detail.salerInfo.mobile }})
  51. </view> -->
  52. <view v-if="detail.report_step <= 2" class="date u-skeleton-rect">
  53. 保护期截止:{{detail.lock_at}}
  54. </view>
  55. <view v-else class="date u-skeleton-rect">保护期:已认购客户无法被其他经纪人二次报备</view>
  56. </view>
  57. <!-- 当前进度 -->
  58. <view v-if="detail.report_state == 1" class="buystep-info box-shadow u-skeleton-fillet"><u-steps :list="buystepList" :current="Number(detail.report_step)" active-color="#2080f0"></u-steps></view>
  59. <view v-else class="buystep-info box-shadow u-skeleton-fillet"><u-steps :list="buystepList" :current="0" active-color="#2080f0"></u-steps></view>
  60. <!-- 当前进度 -->
  61. <view class="buystep-info u-p-32 box-shadow u-skeleton-fillet">
  62. <view class="name">进度流水</view>
  63. <u-empty v-if="stepsLogList.length == 0" mode="list" text="暂无流水记录"></u-empty>
  64. <u-time-line>
  65. <u-time-line-item v-for="(item, index) in stepsLogList" :key="index">
  66. <template v-slot:node>
  67. <view class="u-node"><u-icon name="checkmark-circle" size="28" color="#2080f0"></u-icon></view>
  68. </template>
  69. <!-- 此处没有自定义左边的内容,会默认显示一个点 -->
  70. <template v-slot:content>
  71. <view>
  72. <view class="u-order-title">{{ item.report_state == 1 ? '报备审核:' : item.report_step ? `报备审核:${reportStepObj[item.report_step]}` : `报备状态:${reportStateObj[item.report_state]}` }}</view>
  73. <view class="u-order-desc">{{item.operator_nickname || ''}}({{item.operator_phone || '系统'}}){{ item.describe !== null ? item.describe : '' }}</view>
  74. <!-- <view class="u-order-time">{{ item._add_time | date('yyyy-mm-dd hh:MM:ss') }}</view> -->
  75. <view class="u-order-time">{{ item.create_at}}</view>
  76. </view>
  77. </template>
  78. </u-time-line-item>
  79. </u-time-line>
  80. </view>
  81. <!--引用组件-->
  82. <u-skeleton :loading="skeletonLoading" :animation="true" bgColor="#FFF"></u-skeleton>
  83. <!-- 弹框 -->
  84. <u-popup v-model="commonRulesShow" mode="center" width="80%" height="800rpx" border-radius="20" closeable>
  85. <view class="bwin-popup">
  86. <view class="popup-header">报备二维码</view>
  87. <view class="popup-body">
  88. <view style="text-align: center;">报备时间:{{detail.report_at}}</view>
  89. <view style="text-align: center;margin-bottom: -30rpx;">保护截止:{{detail.lock_at}}</view>
  90. <image v-if="detail.report_code" :src="detail.report_code" class="qrcode-canvas"></image>
  91. <canvas v-else class='qrcode-canvas' canvas-id='qrcode'></canvas>
  92. </view>
  93. </view>
  94. </u-popup>
  95. <view v-if="detail.report_step == 1 && detail.report_state == 1 && detail.is_edit == 1" class="scoped-footer">
  96. <u-button type="primary" @click="vHandle">确认到访</u-button>
  97. </view>
  98. <view v-if="(curRoles == 1 || curRoles == 5 || curRoles == 7) && detail.report_step == 2" class="scoped-footer">
  99. <u-button type="primary" @click="buyedHandle">确认已认购</u-button>
  100. </view>
  101. <view v-if="(curRoles == 1 || curRoles == 5 || curRoles == 7) && detail.report_step == 3" class="scoped-footer">
  102. <u-button type="primary" @click="signedHandle">确认已签约</u-button>
  103. </view>
  104. <!-- 修改报备 -->
  105. <u-popup v-model="isInfoShow" mode="center" width="80%" height="400rpx" border-radius="20">
  106. <view class="bwin-popup">
  107. <view class="popup-header">修改报备姓名和性别</view>
  108. <view class="popup-body">
  109. <view class="scoped-popup-info">
  110. <view class="spi-op">
  111. <u-input v-model="curName" border placeholder="请输入姓名"></u-input>
  112. </view>
  113. <view class="spi-op">
  114. <u-radio-group v-model="curSex" active-color="#2979ff">
  115. <u-radio name="male">先生</u-radio>
  116. <u-radio name="female">女士</u-radio>
  117. </u-radio-group>
  118. </view>
  119. </view>
  120. </view>
  121. <view class="popup-footer" style="position: absolute;">
  122. <u-button size="medium" @click="isInfoShow = false">关闭</u-button>
  123. <u-button size="medium" type="primary" @click="closeInfoPopup()">确定</u-button>
  124. </view>
  125. </view>
  126. </u-popup>
  127. </view>
  128. </template>
  129. <script>
  130. var that;
  131. let QRCode = require('../../../utils/qrcode.js').default
  132. export default {
  133. data() {
  134. return {
  135. curRoles: '',
  136. curName: '',
  137. curSex: 'male',
  138. isInfoShow: false,
  139. curId: '',
  140. commonRulesShow: false,
  141. skeletonLoading: true,
  142. detail: {
  143. }, // 客户详情
  144. currentStep: 0,
  145. userInfo: {},
  146. buystepList: [
  147. {
  148. name: '审核'
  149. },
  150. {
  151. name: '报备成功'
  152. },
  153. {
  154. name: '到访'
  155. },
  156. {
  157. name: '认购'
  158. },
  159. {
  160. name: '签约'
  161. },
  162. {
  163. name: '结佣'
  164. }
  165. ],
  166. reportStepObj: {
  167. '1': '未到访',
  168. '2': '已到访',
  169. '3': '已认购',
  170. '4': '已签约',
  171. '5': '已结佣',
  172. },
  173. reportStateObj: {
  174. '1': '有效',
  175. '2': '审核中',
  176. '3': '无效',
  177. },
  178. stepsLogList: [] // 进展
  179. };
  180. },
  181. onLoad(params) {
  182. const userInfo2 = uni.getStorageSync('MD_userInfo2')
  183. this.userInfo = {...userInfo2}
  184. this.curRoles = userInfo2 ? userInfo2.roles : ''
  185. this.curId = params.id
  186. uni.api.estate.apireport2detail({id:params.id}).then(res =>{
  187. this.detail = res || {}
  188. this.curName = res.name
  189. this.curSex = res.sex
  190. this.stepsLogList = res.report_flow || []
  191. this.skeletonLoading = false
  192. let r = uni.getSystemInfoSync()
  193. let canvasWidth = r.windowWidth * 500 / 750
  194. let canvasHeight = r.windowWidth * 500 / 750
  195. let qrcode = new QRCode('qrcode', {
  196. text: res.code,
  197. width: canvasWidth,
  198. height: canvasHeight,
  199. colorDark: '#000',
  200. colorLight: '#fff',
  201. correctLevel: QRCode.correctLevel.H,
  202. logo: '',
  203. successTips: false
  204. })
  205. // that.QR = qrcode
  206. })
  207. },
  208. methods: {
  209. openInfoPopup (item) {
  210. if (this.curRoles == 1 || this.curRoles == 5 || this.curRoles == 6) {
  211. this.isInfoShow = true
  212. }
  213. },
  214. closeInfoPopup () {
  215. uni.api.estate.apireportedit({
  216. id: this.detail.id,
  217. name: this.curName,
  218. sex: this.curSex,
  219. }).then(res => {
  220. uni.$msg('修改成功')
  221. this.isInfoShow = false
  222. this.getData()
  223. })
  224. },
  225. openPopup () {
  226. if (this.detail.report_code) {
  227. uni.previewImage({
  228. current: this.detail.report_code,
  229. urls: [this.detail.report_code]
  230. })
  231. } else {
  232. if (this.detail.is_edit == 1) {
  233. uni.$msg('暂无报备二维码,请联系管理员')
  234. return
  235. }
  236. this.commonRulesShow = true
  237. }
  238. },
  239. getData () {
  240. uni.api.estate.apireport2detail({id:this.curId}).then(res =>{
  241. this.detail = res || {}
  242. this.stepsLogList = res.report_flow || []
  243. this.skeletonLoading = false
  244. })
  245. },
  246. vHandle() {
  247. uni.$msgConfirm('确定已到访?', () => {
  248. uni.api.cust.apireportvisit({id: this.detail.id}).then(res => {
  249. this.getData()
  250. uni.$msg('操作成功~')
  251. })
  252. })
  253. },
  254. buyedHandle () {
  255. uni.$msgConfirm('确定已认购?', () => {})
  256. uni.api.estate.apireportsubscrDeal({id: this.detail.id}).then(res => {
  257. this.getData()
  258. uni.$msg('操作成功~')
  259. })
  260. },
  261. signedHandle () {
  262. uni.$msgConfirm('确定已签约?', () => {})
  263. uni.api.estate.apireportsignupDeal({id: this.detail.id}).then(res => {
  264. this.getData()
  265. uni.$msg('操作成功~')
  266. })
  267. },
  268. pageTo(path) {
  269. if (path === 'dev') {
  270. uni.$msg('开发中~')
  271. return
  272. }
  273. uni.navigateTo({
  274. url: path
  275. })
  276. },
  277. dial(tel) {
  278. uni.makePhoneCall({
  279. phoneNumber: tel
  280. });
  281. }
  282. }
  283. };
  284. </script>
  285. <style lang="scss">
  286. .scoped-box {
  287. padding-bottom: 120rpx;
  288. }
  289. .customer-info {
  290. width: 100%;
  291. padding: 32rpx;
  292. background-color: #fff;
  293. display: flex;
  294. align-items: center;
  295. justify-content: space-between;
  296. margin-bottom: 20rpx;
  297. border-radius: 10rpx;
  298. .left {
  299. display: flex;
  300. align-items: center;
  301. .customer {
  302. font-size: $u-p2;
  303. .relname {
  304. font-size: $u-p;
  305. font-weight: bold;
  306. margin-bottom: 10rpx;
  307. }
  308. }
  309. }
  310. }
  311. .property-info {
  312. width: 100%;
  313. padding: 32rpx;
  314. background-color: #fff;
  315. display: flex;
  316. flex-direction: column;
  317. align-items: flex-start;
  318. margin-bottom: 20rpx;
  319. font-size: $u-p2;
  320. border-radius: 10rpx;
  321. .name {
  322. font-size: $u-p;
  323. font-weight: bold;
  324. }
  325. .saler {
  326. margin-bottom: 20rpx;
  327. }
  328. }
  329. .buystep-info {
  330. width: 100%;
  331. padding: 32rpx 0rpx;
  332. background-color: #fff;
  333. margin-bottom: 20rpx;
  334. border-radius: 10rpx;
  335. .name {
  336. font-weight: bold;
  337. margin-bottom: 20rpx;
  338. }
  339. }
  340. .u-order-title {
  341. color: $u-main-color;
  342. font-size: $u-p2;
  343. }
  344. .u-order-desc {
  345. // color: $u-content-color;
  346. color: #777;
  347. font-size: $u-p2;
  348. margin-bottom: 6rpx;
  349. }
  350. .u-order-time {
  351. color: rgb(200, 200, 200);
  352. font-size: $u-p2;
  353. }
  354. .qrcode-canvas {
  355. margin: 30px auto;
  356. height: 500rpx;
  357. width: 500rpx;
  358. }
  359. .scoped-footer {
  360. position: fixed;
  361. bottom: 0;
  362. left: 0;
  363. width: 100%;
  364. height: 120rpx;
  365. background: #fff;
  366. z-index: 999;
  367. border-top: 1PX solid #dcdcdc;
  368. padding: 20rpx;
  369. }
  370. .scoped-popup-info {
  371. .spi-op {
  372. padding-bottom: 30rpx;
  373. }
  374. }
  375. </style>