examine-detail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. <template>
  2. <view class="container mine clearfix">
  3. <!-- <cu-custom :navbar-data='nvabarData' @navigateBack="hanldNavigateBack"></cu-custom> -->
  4. <view
  5. class="tui-header-box first"
  6. :style="{ height: isCmcustomClass == 'fiexd' ? CustomBar + 10 + 'px' : CustomBar + 30 + 'px' }"
  7. :class="isCmcustomClass"
  8. >
  9. <view class="header-top" :style="{ paddingTop: top + 'px', lineHeight: CustomBar + 30 + 'px' }"></view>
  10. <view class="header-sit">
  11. <text
  12. class="iconfont icon-shouye1"
  13. v-if="isShareType"
  14. @click.stop="this.$api.navigateLinkJump()"
  15. ></text>
  16. <text class="iconfont icon-fanhui" v-else @click.stop="this.$api.navigateBack(1)"></text>
  17. <text class="header-sit-text">审核详情</text>
  18. </view>
  19. </view>
  20. <view
  21. class="tui-header-box"
  22. :style="{
  23. height: CustomBar + 30 + 'px',
  24. backgroundImage: 'url(https://static.caimei365.com/app/crm/image/statistic_bg1.png)'
  25. }"
  26. >
  27. </view>
  28. <tui-skeleton
  29. v-if="skeletonShow"
  30. backgroundColor="#fafafa"
  31. borderRadius="10rpx"
  32. :isLoading="true"
  33. :loadingType="7"
  34. />
  35. <view
  36. class="distinguish-section"
  37. v-else
  38. :style="{ top: CustomBar - 4 + 'px', left: 0 + 'px', paddingBottom: isIphoneX ? '148rpx' : '104rpx' }"
  39. >
  40. <view class="distinguish-section-conten">
  41. <view class="section-top">
  42. <view class="title"> <view class="title-text">收款信息</view> </view>
  43. <!-- <view class="button" @click="toNoSms('/pages/collection/list')">
  44. <text class="iconfont icon-wodedingdan"></text>
  45. 收款列表
  46. </view> -->
  47. </view>
  48. <view class="section-top-item">
  49. <view class="list-title-t">
  50. <view class="list-title-tip">
  51. <text class="badges">{{ receiptInfo.receiptType | formatReceiptType }}款</text>
  52. </view>
  53. </view>
  54. <view class="list-title-b">
  55. 收款金额:<text class="text">¥{{ receiptInfo.receiptAmount | NumFormat }}</text>
  56. </view>
  57. <view class="list-title-b">
  58. 收款类型:<text class="text">{{ receiptInfo.payTypeText }}</text>
  59. </view>
  60. <view class="list-title-b">
  61. 收款时间:<text class="text">{{ receiptInfo.receiptDate }}</text>
  62. </view>
  63. <template v-if="receiptInfo.smsContent">
  64. <view class="list-title-b">收款短信:</view>
  65. <view class="list-title-b sms">
  66. <text class="text">{{ receiptInfo.smsContent ? receiptInfo.smsContent : '无' }}</text>
  67. </view>
  68. </template>
  69. <view class="list-icon" v-if="receiptInfo.tipMsg">
  70. <image
  71. class="list-icon-image"
  72. src="https://static.caimei365.com/app/crm/image/icon-noconfirm@2x.png"
  73. mode=""
  74. v-if="receiptInfo.receiptStatus == 1"
  75. ></image>
  76. <image
  77. class="list-icon-image"
  78. src="https://static.caimei365.com/app/crm/image/icon-noaudit@2x.png"
  79. mode=""
  80. v-if="receiptInfo.receiptStatus == 2"
  81. ></image>
  82. </view>
  83. </view>
  84. <view class="section-title">关联订单</view>
  85. <view class="section-mid">
  86. <view class="tui-order-item" v-for="(order, orderIndex) in receiptInfo.shopOrderList" :key="orderIndex">
  87. <receipt-details :orderInfo="order"></receipt-details>
  88. <view class="list-detail" @click="orderDetail(order.shopOrderId)">
  89. <text class="iconfont icon-xiayibu"></text>
  90. </view>
  91. </view>
  92. </view>
  93. <view class="section-title">状态</view>
  94. <view class="section-mid">
  95. <view class="list-title">
  96. <view class="list-title-b"
  97. >进度:<text :style="{ color: formatColor(receiptInfo.receiptStatus) }">{{
  98. receiptInfo.receiptStatusText
  99. }}</text>
  100. </view>
  101. <view class="list-title-b">
  102. 确认人:
  103. <text class="text">
  104. {{ receiptInfo.confirmUserName ? receiptInfo.confirmUserName : '无' }}
  105. </text>
  106. </view>
  107. <view class="list-title-b">
  108. 确认时间:<text class="text">{{ receiptInfo.confirmDate }}</text>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="section-tips">注:款项和订单已确认关联,等待审核</view>
  113. </view>
  114. </view>
  115. <view
  116. class="distinguish-button"
  117. v-if="examineBtnVisible"
  118. :style="{ paddingBottom: isIphoneX ? '68rpx' : '24rpx' }"
  119. >
  120. <view class="button cancel" @click="confirmDistinguish(2)">不通过</view>
  121. <view class="button confirm" @click="confirmDistinguish(1)">通过</view>
  122. </view>
  123. <!-- 审核通过弹窗 -->
  124. <tui-modal
  125. :show="modal"
  126. @click="handleClick"
  127. @cancel="hideMobel(0)"
  128. :content="contentModalText"
  129. color="#333"
  130. :size="32"
  131. shape="circle"
  132. :maskClosable="false"
  133. />
  134. <!--不通过审核备注弹窗 -->
  135. <tui-modal :show="modal1" :padding="'40rpx 30rpx'" @cancel="hideMobel(1)" :custom="true" fadeIn>
  136. <view class="tui-modal-custom">
  137. <view class="tui-prompt-title">确认不通过</view>
  138. <view class="tui-prompt-textarea">
  139. <textarea
  140. :class="modal1 ? 'show' : 'none'"
  141. class="textarea"
  142. placeholder="请输入不通过说明(必填)"
  143. v-model="noReviewReason"
  144. />
  145. </view>
  146. <view class="tui-prompt-flex">
  147. <view class="btn btn-cancel" @click="hideMobel(1)">取消</view>
  148. <view class="btn btn-confirm" @click="handleClick1">确定</view>
  149. </view>
  150. </view>
  151. </tui-modal>
  152. </view>
  153. </template>
  154. <script>
  155. import receiptDetails from '@/components/cm-module/receipt/receipt-details'
  156. import { mapState, mapMutations } from 'vuex'
  157. export default {
  158. components: {
  159. receiptDetails
  160. },
  161. data() {
  162. return {
  163. isIphoneX: this.$store.state.isIphoneX,
  164. CustomBar: this.CustomBar, // 顶部导航栏高度
  165. height: 64, //header高度
  166. top: 0, //标题图标距离顶部距离
  167. scrollH: 0, //滚动总高度
  168. opcity: 1,
  169. isCmcustomClass: 'left',
  170. skeletonShow: true,
  171. nvabarData: {
  172. //顶部自定义导航
  173. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  174. showSearch: 0,
  175. title: '', // 导航栏 中间的标题
  176. haveBack: false,
  177. home: false,
  178. textLeft: this.$store.state.isIphone,
  179. bgColor: '#D33020',
  180. textColor: '#ffffff'
  181. },
  182. receiptInfo: {},
  183. receiptId: 0,
  184. noReviewReason: '',
  185. params: {
  186. id: 0,
  187. receiptStatus: 1
  188. },
  189. contentModalText: '确认通过审核?', //操作文字提示语句
  190. modal: false,
  191. modal1: false,
  192. isShareType: false
  193. }
  194. },
  195. onLoad(option) {
  196. let obj = {}
  197. // #ifdef MP-WEIXIN
  198. obj = wx.getMenuButtonBoundingClientRect()
  199. // #endif
  200. // #ifdef MP-BAIDU
  201. obj = swan.getMenuButtonBoundingClientRect()
  202. // #endif
  203. // #ifdef MP-ALIPAY
  204. my.hideAddToDesktopMenu()
  205. // #endif
  206. uni.getSystemInfo({
  207. success: res => {
  208. this.width = obj.left || res.windowWidth
  209. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  210. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
  211. this.scrollH = res.windowWidth * 0.6
  212. }
  213. })
  214. if (option.type == 'share') {
  215. this.isShareType = true
  216. }
  217. this.receiptId = this.params.id = option.id
  218. this.getOrderReceiptDetail(this.receiptId)
  219. },
  220. computed: {
  221. ...mapState(['examineBtnVisible'])
  222. },
  223. methods: {
  224. getOrderReceiptDetail(id) {
  225. // 收款详情
  226. this.OrderService.orderReceiptDetail({ id: id })
  227. .then(response => {
  228. this.receiptInfo = response.data
  229. setTimeout(() => {
  230. this.skeletonShow = false
  231. }, 1000)
  232. })
  233. .catch(err => {
  234. this.$api.navigateTo('/pages/login/login-error')
  235. })
  236. },
  237. orderReceiptAudit(params) {
  238. //操作审核款项
  239. this.OrderService.orderReceiptAudit(params)
  240. .then(response => {
  241. this.$util.msg('操作成功~', 2000, true, 'success')
  242. setTimeout(() => {
  243. if (this.params.receiptStatus == 3) {
  244. //通过审核跳转
  245. this.$api.redirectTo(`/pages/relation/ordinary/detail?id=${this.params.id}`)
  246. } else {
  247. //不通过审核跳转
  248. this.$api.redirectTo(`/pages/relation/ordinary/index?id=${this.params.id}`)
  249. }
  250. }, 2000)
  251. })
  252. .catch(error => {
  253. this.$util.msg(error.msg, 2000)
  254. })
  255. },
  256. confirmDistinguish(type) {
  257. switch (type) {
  258. case 1:
  259. //通过审核
  260. this.params.receiptStatus = 3
  261. this.modal = true
  262. break
  263. case 2:
  264. //不通过审核显示备注弹窗
  265. this.params.receiptStatus = 4
  266. this.modal1 = true
  267. break
  268. }
  269. },
  270. handleClick(e) {
  271. // 通过审核
  272. let index = e.index
  273. if (index == 1) {
  274. this.orderReceiptAudit(this.params)
  275. }
  276. this.modal = false
  277. },
  278. handleClick1() {
  279. // 不通过审核
  280. if (this.noReviewReason == '') {
  281. this.$util.msg('请输入不通过说明!', 2000)
  282. return
  283. }
  284. this.params.reviewReason = this.noReviewReason
  285. this.orderReceiptAudit(this.params)
  286. this.modal1 = false
  287. },
  288. hideMobel(type) {
  289. switch (type) {
  290. case 0:
  291. this.modal = false
  292. break
  293. case 1:
  294. this.modal1 = false
  295. break
  296. }
  297. },
  298. orderDetail(shopOrderId) {
  299. //订单详情跳转
  300. this.$api.navigateTo(`/pages/relation/order/detail?shopOrderId=${shopOrderId}`)
  301. },
  302. toNoSms(url) {
  303. this.$api.navigateTo(url)
  304. },
  305. formatColor(state) {
  306. //设置颜色
  307. let stateColor = '',
  308. stateColorObject = {
  309. 1: '#FEAC20',
  310. 2: '#4cd964',
  311. 3: '#34CC8C',
  312. 4: '#F94B4B',
  313. 5: '#007aff'
  314. }
  315. Object.keys(stateColorObject).forEach(function(key) {
  316. if (key == state) {
  317. stateColor = stateColorObject[key]
  318. }
  319. })
  320. return stateColor
  321. },
  322. formatReceiptType(value) {
  323. //订单状态文字和颜色
  324. var HtmlStateText = '',
  325. stateTextObject = {
  326. 1: '订单款',
  327. 2: '非订单款',
  328. 3: '返佣款',
  329. 4: '订单款或者非订单款',
  330. 5: '供应商退款'
  331. }
  332. Object.keys(stateTextObject).forEach(function(key) {
  333. if (key == value) {
  334. HtmlStateText = stateTextObject[key]
  335. }
  336. })
  337. return HtmlStateText
  338. }
  339. },
  340. onPageScroll(e) {
  341. //实时获取到滚动的值
  342. // if (e.scrollTop > 30) {
  343. // this.isCmcustomClass = 'fiexd'
  344. // } else {
  345. // this.isCmcustomClass = 'left'
  346. // }
  347. },
  348. onPullDownRefresh() {
  349. setTimeout(() => {
  350. this.getOrderReceiptDetail(this.receiptId)
  351. uni.stopPullDownRefresh()
  352. }, 200)
  353. },
  354. onShareAppMessage(res) {
  355. //分享购买优惠券
  356. const receipt = this.receiptInfo
  357. const receiptTypeText = this.formatReceiptType(receipt.receiptType)
  358. if (res.from === 'button') {
  359. // console.log('来自页面内转发按钮')
  360. }
  361. return {
  362. title: `¥${receipt.receiptAmount.toFixed(2)} | ${receipt.receiptDate} | ${
  363. receipt.receiptStatusText
  364. }(${receiptTypeText})`,
  365. path: `/pages/login/login-share?id=${receipt.id}`,
  366. imageUrl: 'https://static.caimei365.com/app/crm/image/icon-share@2x.jpg'
  367. }
  368. },
  369. onShow() {}
  370. }
  371. </script>
  372. <style lang="scss">
  373. @import '@/uni.scss';
  374. page {
  375. background: #fff;
  376. }
  377. .tui-header-box {
  378. width: 100%;
  379. background: #ffffff;
  380. z-index: 999;
  381. background-size: cover;
  382. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  383. &.fiexd {
  384. position: fixed;
  385. top: 0;
  386. left: 0;
  387. }
  388. }
  389. .header-top {
  390. width: 100%;
  391. font-size: 16px;
  392. font-weight: 500;
  393. height: 32px;
  394. display: flex;
  395. align-items: center;
  396. justify-content: center;
  397. position: relative;
  398. padding: 0 40rpx;
  399. }
  400. .header-sit {
  401. width: 100%;
  402. box-sizing: border-box;
  403. height: 80rpx;
  404. line-height: 80rpx;
  405. box-sizing: border-box;
  406. color: #ffffff;
  407. .header-sit-text {
  408. text-align: left;
  409. font-size: $font-size-40;
  410. font-weight: 600;
  411. font-family: '正楷';
  412. }
  413. .iconfont {
  414. display: block;
  415. width: 80rpx;
  416. height: 80rpx;
  417. float: left;
  418. text-align: center;
  419. line-height: 80rpx;
  420. font-size: 42rpx;
  421. }
  422. }
  423. .mine {
  424. width: 100%;
  425. height: 100%;
  426. position: relative;
  427. }
  428. .distinguish-section {
  429. width: 100%;
  430. position: absolute;
  431. padding: 40rpx 20rpx;
  432. box-sizing: border-box;
  433. }
  434. .distinguish-section-conten {
  435. width: 100%;
  436. height: auto;
  437. position: relative;
  438. background-color: #ffffff;
  439. border-radius: 20rpx;
  440. padding: 20rpx;
  441. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  442. .section-top {
  443. width: 100%;
  444. height: 66rpx;
  445. box-sizing: border-box;
  446. .title {
  447. float: left;
  448. height: 66rpx;
  449. padding: 13rpx 0;
  450. .title-text {
  451. float: left;
  452. line-height: 40rpx;
  453. height: 40rpx;
  454. color: #333333;
  455. text-align: left;
  456. font-weight: 600;
  457. font-size: $font-size-30;
  458. }
  459. }
  460. .button {
  461. float: right;
  462. box-sizing: border-box;
  463. padding: 0 24rpx;
  464. height: 100%;
  465. line-height: 66rpx;
  466. background: $btn-confirm;
  467. border-radius: 8rpx;
  468. text-align: center;
  469. color: #ffffff;
  470. }
  471. }
  472. .section-top-item {
  473. width: 100%;
  474. height: auto;
  475. margin-top: 10rpx;
  476. position: relative;
  477. float: left;
  478. .list-title-t {
  479. width: 100%;
  480. height: 50rpx;
  481. float: left;
  482. font-size: $font-size-28;
  483. padding-bottom: 10rpx;
  484. .list-title-tip {
  485. float: left;
  486. .badges {
  487. display: block;
  488. float: left;
  489. padding: 0 15rpx;
  490. height: 36rpx;
  491. line-height: 36rpx;
  492. border-radius: 18rpx;
  493. background: #ecf5ff;
  494. font-size: $font-size-22;
  495. text-align: center;
  496. color: #409eff;
  497. }
  498. }
  499. }
  500. .list-title-b {
  501. width: 100%;
  502. height: 44rpx;
  503. float: left;
  504. font-size: $font-size-24;
  505. line-height: 44rpx;
  506. color: #666666;
  507. text-align: left;
  508. .text {
  509. color: #999999;
  510. }
  511. .list-title-b-item {
  512. width: 50%;
  513. height: 100%;
  514. float: left;
  515. }
  516. &.sms {
  517. height: auto;
  518. padding: 10rpx;
  519. border-radius: 4rpx;
  520. background: #f7f7f7;
  521. }
  522. }
  523. .list-icon {
  524. width: 120rpx;
  525. height: 120rpx;
  526. border-radius: 10rpx;
  527. position: absolute;
  528. right: 0;
  529. top: 0;
  530. color: #dd524d;
  531. z-index: 99;
  532. .list-icon-image {
  533. width: 120rpx;
  534. height: 120rpx;
  535. display: block;
  536. }
  537. }
  538. }
  539. .section-title {
  540. width: 100%;
  541. height: 66rpx;
  542. float: left;
  543. font-size: $font-size-28;
  544. line-height: 66rpx;
  545. color: #333333;
  546. text-align: left;
  547. font-weight: 600;
  548. }
  549. .section-mid {
  550. width: 100%;
  551. height: auto;
  552. display: flex;
  553. flex-direction: column;
  554. position: relative;
  555. border-radius: 0 0 20rpx 20rpx;
  556. .list-title {
  557. width: 100%;
  558. height: auto;
  559. .list-title-b {
  560. width: 100%;
  561. height: 50rpx;
  562. float: left;
  563. font-size: $font-size-24;
  564. line-height: 50rpx;
  565. color: #666666;
  566. text-align: left;
  567. .text {
  568. color: #999999;
  569. }
  570. .list-title-b-item {
  571. width: 50%;
  572. height: 100%;
  573. float: left;
  574. }
  575. }
  576. }
  577. }
  578. .section-tips {
  579. width: 100%;
  580. height: 50rpx;
  581. font-size: $font-size-28;
  582. line-height: 50rpx;
  583. color: $uni-color-error;
  584. text-align: left;
  585. }
  586. }
  587. .tui-order-item {
  588. display: flex;
  589. flex-direction: column;
  590. width: 100%;
  591. background: #fff;
  592. margin-bottom: 24rpx;
  593. border-radius: 8rpx;
  594. position: relative;
  595. .list-detail {
  596. width: 70rpx;
  597. height: 80rpx;
  598. line-height: 80rpx;
  599. text-align: right;
  600. position: absolute;
  601. right: 0;
  602. bottom: 0;
  603. .iconfont {
  604. font-size: $font-size-32;
  605. color: #999999;
  606. }
  607. }
  608. }
  609. .distinguish-button {
  610. width: 100%;
  611. position: fixed;
  612. bottom: 0;
  613. left: 0;
  614. background-color: #ffffff;
  615. padding: 0 50rpx;
  616. padding-top: 20rpx;
  617. display: flex;
  618. .button {
  619. flex: 1;
  620. height: 80rpx;
  621. margin: 0 20rpx;
  622. border-radius: 40rpx;
  623. text-align: center;
  624. color: #ffffff;
  625. line-height: 80rpx;
  626. font-size: $font-size-28;
  627. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  628. &.confirm {
  629. background: $btn-confirm;
  630. }
  631. &.cancel {
  632. background: $uni-color-error;
  633. }
  634. }
  635. }
  636. .tui-prompt-title {
  637. line-height: 44rpx;
  638. text-align: center;
  639. }
  640. .tui-prompt-textarea {
  641. width: 100%;
  642. height: 160rpx;
  643. box-sizing: border-box;
  644. background: #f7f7f7;
  645. border-radius: 8rpx;
  646. padding: 15rpx 20rpx;
  647. margin: 20rpx 0;
  648. .textarea {
  649. width: 100%;
  650. height: 100%;
  651. font-size: $font-size-26;
  652. &.none {
  653. display: none;
  654. }
  655. }
  656. }
  657. .tui-prompt-flex {
  658. width: 100%;
  659. height: 70rpx;
  660. display: flex;
  661. margin-top: 20rpx;
  662. .btn {
  663. flex: 1;
  664. line-height: 70rpx;
  665. font-size: $font-size-26;
  666. text-align: center;
  667. color: #ffffff;
  668. border-radius: 33rpx;
  669. margin: 0 24rpx;
  670. &.btn-cancel {
  671. background: #f7f7f7;
  672. color: #999999;
  673. }
  674. &.btn-confirm {
  675. background: $color-system;
  676. }
  677. }
  678. }
  679. </style>