details.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <!--
  2. * @Description: 详情弹框
  3. * @Author: Sugar.
  4. * @Date: 2023-11-24 13:55:00
  5. * @LastEditors: Sugar.
  6. * @LastEditTime: 2023-11-24 13:55:00
  7. * @FilePath: \cattle_webui\src\views\finance\refundMr\dialog\details.vue
  8. * @Copyright: Copyright (c) 2016~2023 by Sugar., All Rights Reserved.
  9. -->
  10. <template>
  11. <el-dialog
  12. title="退款详情"
  13. :visible.sync="open"
  14. width="500px"
  15. append-to-body
  16. :close-on-click-modal="false"
  17. @close="cancel"
  18. >
  19. <div class="dialog" v-if="form">
  20. <el-row>
  21. <el-col :span="24">
  22. <div class="grid-content bg-purple item-class">退款单号: <span>{{ form.id }}</span></div>
  23. </el-col>
  24. <el-col :span="24">
  25. <div class="grid-content bg-purple item-class">原订单号: <span>{{ form.orderId }}</span></div>
  26. </el-col>
  27. <el-col :span="24">
  28. <div class="grid-content bg-purple item-class">支付单号: <span>{{ form.transactionId }}</span></div>
  29. </el-col>
  30. <el-col :span="24">
  31. <div class="grid-content bg-purple item-class">退款金额: <span>¥{{ form.refundAmount }}</span></div>
  32. </el-col>
  33. <el-col :span="24">
  34. <div class="grid-content bg-purple item-class">退款原因: <span>{{ form.refundReason }}</span></div>
  35. </el-col>
  36. <el-col :span="24">
  37. <div class="grid-content bg-purple item-class">状态: <span>{{ statusList[form.status] }}</span></div>
  38. </el-col>
  39. <el-col :span="24">
  40. <div class="grid-content bg-purple item-class">备注: <span>{{ form.remark }}</span></div>
  41. </el-col>
  42. <el-col :span="24" v-if="form.status == 2">
  43. <div class="grid-content bg-purple item-class">驳回原因: <span style="color: red;">{{ form.errReason }}</span></div>
  44. </el-col>
  45. </el-row>
  46. </div>
  47. <span slot="footer" class="dialog-footer" v-if="!refund">
  48. <el-button type="primary" @click="cancel">确定</el-button>
  49. </span>
  50. <span slot="footer" class="dialog-footer" v-if="refund">
  51. <!-- <el-button @click="cancel">取消</el-button>-->
  52. <el-button
  53. type="danger"
  54. @click="submitForm(2)"
  55. v-loading.fullscreen.lock="loading"
  56. element-loading-text="提交中..."
  57. element-loading-spinner="el-icon-loading"
  58. element-loading-background="rgba(0, 0, 0, 0.8)"
  59. >
  60. <span v-if="loading">提交中...</span>
  61. <span v-else>驳回退款</span>
  62. </el-button>
  63. <el-button
  64. type="primary"
  65. @click="submitForm(1)"
  66. v-loading.fullscreen.lock="loading"
  67. element-loading-text="提交中..."
  68. element-loading-spinner="el-icon-loading"
  69. element-loading-background="rgba(0, 0, 0, 0.8)"
  70. >
  71. <span v-if="loading">提交中...</span>
  72. <span v-else>同意退款</span>
  73. </el-button>
  74. </span>
  75. </el-dialog>
  76. </template>
  77. <script>
  78. import { pageList, refundAudit } from '@/api/financeMr/refundMr'
  79. import Editor from "@/components/Editor";
  80. import { saveAndEdit } from '@/api/ticketMr/priceMr'
  81. import isEmpty from 'voca/is_empty'
  82. export default {
  83. name: "detailsDia",
  84. components: {
  85. Editor,
  86. },
  87. data() {
  88. return {
  89. title: "编辑",
  90. model: "EDIT",
  91. open: false,
  92. loading: false,
  93. form: {
  94. id: undefined,
  95. },
  96. performerVisible: false,
  97. performerList: [],
  98. refund: false,
  99. statusList: {
  100. 0: '申请中',
  101. 1: '退款成功',
  102. 2: '退款驳回',
  103. 3: '退款中',
  104. 4: '退款失败',
  105. }
  106. };
  107. },
  108. methods: {
  109. /**
  110. * 打开弹框
  111. * @date 2023-11-22
  112. * @param {any} obj
  113. * @returns {any}
  114. */
  115. openDialog(title, obj, type) {
  116. this.open = true;
  117. this.form = obj;
  118. if (type){
  119. this.refund = true
  120. } else {
  121. this.refund = false
  122. }
  123. },
  124. inputValidatorEn(value) {
  125. if(isEmpty(value)) {
  126. return false
  127. } else {
  128. return true
  129. }
  130. },
  131. /**
  132. * 保存
  133. * @date 2023-11-22
  134. * @returns {any}
  135. */
  136. submitForm(status) {
  137. this.$confirm('是否' + ( status == 1 ? '确定' : '驳回' ) + '退款?', '提示', {
  138. confirmButtonText: '确定',
  139. cancelButtonText: '取消',
  140. type: 'warning'
  141. }).then(() => {
  142. if(status == 2){
  143. this.$prompt('驳回理由', '提示', {
  144. confirmButtonText: '确定',
  145. cancelButtonText: '取消',
  146. inputValidator: this.inputValidatorEn,
  147. inputErrorMessage: '请输入驳回理由'
  148. }).then(({ value }) => {
  149. this.refundAuditApi(status, value);
  150. }).catch(() => {});
  151. } else {
  152. this.refundAuditApi(status, '');
  153. }
  154. }).catch(() => {});
  155. },
  156. refundAuditApi(status, value) {
  157. this.loading = true;
  158. refundAudit({ refundId: this.form.id, status: status, errReason: value})
  159. .then(response => {
  160. this.$message.success("操作成功!");
  161. this.$emit("getList");
  162. this.cancel();
  163. this.loading = false;
  164. }
  165. ).catch(() => {
  166. this.loading = false;
  167. });
  168. },
  169. /**
  170. * 关闭弹框
  171. * @date 2023-11-22
  172. * @returns {any}
  173. */
  174. cancel() {
  175. this.open = false;
  176. },
  177. },
  178. };
  179. </script>
  180. <style lang="scss" scoped>
  181. .dialog {
  182. padding: 0 30px;
  183. max-height: 65vh;
  184. overflow-y: auto;
  185. }
  186. .dialog {
  187. padding: 0 30px;
  188. .upload-btn {
  189. width: 100px;
  190. height: 100px;
  191. background-color: #fbfdff;
  192. border: dashed 1px #c0ccda;
  193. border-radius: 5px;
  194. i {
  195. font-size: 30px;
  196. margin-top: 20px;
  197. }
  198. &-text {
  199. margin-top: -10px;
  200. }
  201. }
  202. .avatar {
  203. cursor: pointer;
  204. }
  205. .title-class{
  206. font-size: 16px;
  207. font-weight: bold;
  208. color: black;
  209. margin-bottom: 20px;
  210. margin-top: 20px;
  211. }
  212. .item-class{
  213. margin-bottom: 20px;
  214. }
  215. }
  216. </style>