examine-detail.vue 16 KB

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