UserDialog.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <script setup>
  2. import { ref, reactive } from 'vue'
  3. import {apiOrderConfig} from '@/api/order'
  4. import { InfoFilled } from '@element-plus/icons-vue'
  5. const show = defineModel('show', { type: Boolean, default: false })
  6. const props=defineProps({
  7. isRefund:{
  8. type:Boolean,
  9. default:false
  10. },
  11. row:{
  12. type:Object,
  13. default:()=>{}
  14. },
  15. })
  16. const emits = defineEmits(["success"])
  17. emits("success")
  18. watch(() => props.show, (newval) => {
  19. if (newval) {
  20. if (!props.isRefund) {
  21. getRefundData()
  22. } else {
  23. refundInfo.value = props.row||{}
  24. }
  25. }
  26. })
  27. const refundInfo = ref({})
  28. const remark = ref('')
  29. function getRefundData(){
  30. apiOrderConfig.getRefundDetail({
  31. ProductOrderNo:props.row.OrderID,
  32. }).then(res=>{
  33. if(res.Ret!==200) return
  34. refundInfo.value = res.Data||{}
  35. refundInfo.value.PaymentAmount = res.Data.RefundAmount
  36. remark.value = refundInfo.value.Remark||''
  37. })
  38. }
  39. function confirm() {
  40. apiOrderConfig.postOrderRefund({
  41. ProductOrderNo:props.row.OrderID,
  42. Remark:remark.value
  43. }).then(res=>{
  44. if(res.Ret!==200) return
  45. emits("success")
  46. })
  47. }
  48. </script>
  49. <template>
  50. <el-dialog
  51. v-model="show"
  52. :close-on-click-modal="false"
  53. :modal-append-to-body="false"
  54. width="30%"
  55. draggable
  56. :title="props.isRefund ? '退款' : '退款详情'"
  57. >
  58. <div class="dialog-top">
  59. <div class="dialog-content-top">
  60. <div class="dialog-top-item">
  61. 退款用户:{{ refundInfo.RealName }}
  62. </div>
  63. <div class="dialog-top-item">
  64. 退回账号:{{ }}
  65. </div>
  66. <div class="dialog-top-item">
  67. 退款金额:{{ refundInfo.PaymentAmount }}
  68. </div>
  69. </div>
  70. <div class="dialog-content">
  71. <div class="dialog-content-item">
  72. 退款说明
  73. </div>
  74. <el-input
  75. type="textarea"
  76. :rows="5"
  77. placeholder="请输入内容"
  78. v-model="remark">
  79. </el-input>
  80. </div>
  81. </div>
  82. <div class="dialog-footer" v-if="props.isRefund">
  83. <el-button @click="show = false">取 消</el-button>
  84. <div class="button">
  85. <el-button type="primary" @click="confirm()" style="margin-right: 10px;">确定</el-button>
  86. <el-tooltip
  87. class="box-item"
  88. effect="dark"
  89. content="原支付渠道退款"
  90. placement="top"
  91. >
  92. <el-icon><InfoFilled /></el-icon>
  93. </el-tooltip>
  94. </div>
  95. </div>
  96. </el-dialog>
  97. </template>
  98. <style scoped lang="scss">
  99. .dialog-top {
  100. padding-bottom: 40px;
  101. .dialog-content-top {
  102. display: flex;
  103. justify-content: flex-start;
  104. padding-bottom: 30px;
  105. .dialog-top-item {
  106. flex: 1;
  107. padding-right: 20px;
  108. }
  109. }
  110. .dialog-content{
  111. .dialog-content-item {
  112. padding-bottom: 10px;
  113. }
  114. }
  115. }
  116. .dialog-footer {
  117. display: flex;
  118. justify-content: space-around;
  119. padding-bottom: 40px;
  120. .button {
  121. display: flex;
  122. justify-content: space-around;
  123. align-items: center;
  124. }
  125. }
  126. </style>