examine-detail.vue 16 KB

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