receipt-modal.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template name="modal">
  2. <view class="modal-template">
  3. <!-- 自定义弹窗内容 -->
  4. <tui-modal :show="show" :padding="'40rpx 60rpx'" @cancel="handleClickCancel" :custom="true" fadeIn>
  5. <view class="tui-modal-custom">
  6. <!-- 当收款金额等于所选订单的剩余应收金额 -->
  7. <template v-if="handleType == 1">
  8. <view class="tui-prompt-text">
  9. 订单金额:<text class="text">¥{{ hanldOrder.payTotalFee | NumFormat }}</text>
  10. </view>
  11. <view class="tui-prompt-text">
  12. 余额抵扣:<text class="text">¥{{ hanldOrder.balancePayFee | NumFormat }}</text>
  13. </view>
  14. <view class="tui-prompt-text">
  15. 应收金额:<text class="text">¥{{ hanldOrder.payableAmount | NumFormat }}</text>
  16. </view>
  17. <view class="tui-prompt-text">
  18. 已收金额:<text class="text">¥{{ hanldOrder.paidAmount | NumFormat }}</text>
  19. </view>
  20. <view class="tui-prompt-text">
  21. 收款金额:<text class="text">¥{{ amount | NumFormat }}</text>
  22. </view>
  23. <view class="tui-prompt-text">
  24. 剩余应收:<text class="text"
  25. >¥{{ (amount - hanldOrder.surplusAmount) | NumFormat }}({{
  26. hanldOrder.orderNums
  27. }}个订单)</text
  28. >
  29. </view>
  30. </template>
  31. <!-- 当收款金额大于所选订单的剩余应收金额 -->
  32. <template v-if="handleType == 2">
  33. <view class="tui-prompt-text">
  34. 收款金额:<text class="text">¥{{ amount | NumFormat }}</text>
  35. </view>
  36. <view class="tui-prompt-text">
  37. 剩余应收:<text class="text"
  38. >¥{{ hanldOrder.surplusAmount | NumFormat }}({{ hanldOrder.orderNums }}个订单)</text
  39. >
  40. </view>
  41. <view class="tui-prompt-text">
  42. 本次收款金额超出剩余应收金额:<text class="text"
  43. >¥{{ (amount - hanldOrder.surplusAmount) | NumFormat }}</text
  44. >关联订单的同时将超出金额退到机构余额吗?
  45. </view>
  46. </template>
  47. <!-- 当收款金额等于所选订单的剩余应收金额 -->
  48. <template v-if="handleType == 3">
  49. <view class="tui-prompt-text">
  50. 收款金额:<text class="text">¥{{ amount | NumFormat }}</text>
  51. </view>
  52. <view class="tui-prompt-text">
  53. 剩余应收:<text class="text"
  54. >¥{{ hanldOrder.surplusAmount | NumFormat }}({{ hanldOrder.orderNums }}个订单)</text
  55. >
  56. </view>
  57. <view class="tui-prompt-text">
  58. 本次收款后,订单剩余未收款金额:<text class="text"
  59. >¥{{ (hanldOrder.surplusAmount - amount ) | NumFormat }}</text
  60. >抹平确认还是等值确认?
  61. </view>
  62. </template>
  63. <view class="tui-prompt-flex" v-if="handleType == 1">
  64. <view class="btn btn-cancel" @click="handleClickCancel">取消</view>
  65. <view class="btn btn-confirm" @click="handleClick(4)">确认收款</view>
  66. </view>
  67. <view class="tui-prompt-flex" v-if="handleType == 2">
  68. <view class="btn btn-cancel" @click="handleClickCancel">取消</view>
  69. <view class="btn btn-confirm" @click="handleClick(3)">退到余额</view>
  70. </view>
  71. <view class="tui-prompt-flex" v-if="handleType == 3">
  72. <view class="btn btn-warning" @click="handleClick(1)">抹平确认</view>
  73. <view class="btn btn-confirm" @click="handleClick(4)">等值确认</view>
  74. </view>
  75. </view>
  76. </tui-modal>
  77. </view>
  78. </template>
  79. <script>
  80. export default {
  81. name: 'modal',
  82. props: {
  83. totalOrder: {
  84. type: Object
  85. },
  86. modelTpye: {
  87. //1
  88. type: Number,
  89. default: 1
  90. },
  91. amount: {
  92. type: Number
  93. },
  94. show: {
  95. type: Boolean,
  96. default: false
  97. }
  98. },
  99. data() {
  100. return {
  101. handleType: 1,
  102. hanldOrder: {}
  103. }
  104. },
  105. filters: {
  106. NumFormat(value) {
  107. //处理金额
  108. if (value) {
  109. return Number(value).toFixed(2)
  110. } else {
  111. return '0.00'
  112. }
  113. }
  114. },
  115. created() {
  116. this.initData(this.modelTpye, this.totalOrder)
  117. },
  118. methods: {
  119. async initData(type, order) {
  120. this.handleType = type
  121. this.hanldOrder = order
  122. console.log('handleType', this.handleType)
  123. console.log('hanldOrder', this.hanldOrder)
  124. console.log('amount', this.amount)
  125. },
  126. handleClick(type) {
  127. this.$emit('click',type)
  128. },
  129. handleClickCancel() {
  130. this.$emit('cancel')
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss">
  136. .tui-prompt-text {
  137. font-size: $font-size-26;
  138. color: #333333;
  139. line-height: 44rpx;
  140. .text {
  141. color: $color-system;
  142. }
  143. }
  144. .tui-prompt-flex {
  145. width: 100%;
  146. height: 70rpx;
  147. display: flex;
  148. margin-top: 40rpx;
  149. .btn {
  150. flex: 1;
  151. line-height: 70rpx;
  152. font-size: $font-size-26;
  153. text-align: center;
  154. color: #ffffff;
  155. border-radius: 33rpx;
  156. margin: 0 24rpx;
  157. &.btn-cancel {
  158. background: #f7f7f7;
  159. color: #999999;
  160. }
  161. &.btn-confirm {
  162. background: $color-system;
  163. }
  164. &.btn-warning {
  165. background: #f0ad4e;
  166. }
  167. }
  168. }
  169. </style>