order.data.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. import { reactive } from 'vue'
  2. import { useI18n } from '@/hooks/web/useI18n'
  3. import { required } from '@/utils/formRules'
  4. import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
  5. import { DICT_TYPE } from '@/utils/dict'
  6. const { t } = useI18n() // 国际化
  7. // 表单校验
  8. export const rules = reactive({
  9. merchantId: [required],
  10. appId: [required],
  11. merchantOrderId: [required],
  12. subject: [required],
  13. body: [required],
  14. notifyUrl: [required],
  15. notifyStatus: [required],
  16. amount: [required],
  17. status: [required],
  18. userIp: [required],
  19. expireTime: [required],
  20. refundStatus: [required],
  21. refundTimes: [required],
  22. refundAmount: [required]
  23. })
  24. // CrudSchema
  25. const crudSchemas = reactive<CrudSchema[]>([
  26. {
  27. label: t('common.index'),
  28. field: 'id',
  29. type: 'index',
  30. form: {
  31. show: false
  32. },
  33. detail: {
  34. show: false
  35. }
  36. },
  37. {
  38. label: '商户编号',
  39. field: 'merchantId',
  40. search: {
  41. show: true
  42. }
  43. },
  44. {
  45. label: '应用编号',
  46. field: 'appId',
  47. search: {
  48. show: true
  49. }
  50. },
  51. {
  52. label: '渠道编号',
  53. field: 'channelId'
  54. },
  55. {
  56. label: '渠道编码',
  57. field: 'channelCode',
  58. search: {
  59. show: true
  60. }
  61. },
  62. {
  63. label: '渠道订单号',
  64. field: 'merchantOrderId',
  65. search: {
  66. show: true
  67. }
  68. },
  69. {
  70. label: '商品标题',
  71. field: 'subject'
  72. },
  73. {
  74. label: '商品描述',
  75. field: 'body'
  76. },
  77. {
  78. label: '异步通知地址',
  79. field: 'notifyUrl'
  80. },
  81. {
  82. label: '回调商户状态',
  83. field: 'notifyStatus',
  84. dictType: DICT_TYPE.PAY_ORDER_NOTIFY_STATUS
  85. },
  86. {
  87. label: '支付金额',
  88. field: 'amount',
  89. search: {
  90. show: true
  91. }
  92. },
  93. {
  94. label: '渠道手续费',
  95. field: 'channelFeeRate',
  96. search: {
  97. show: true
  98. }
  99. },
  100. {
  101. label: '渠道手续金额',
  102. field: 'channelFeeAmount',
  103. search: {
  104. show: true
  105. }
  106. },
  107. {
  108. label: '支付状态',
  109. field: 'status',
  110. dictType: DICT_TYPE.PAY_ORDER_STATUS,
  111. search: {
  112. show: true
  113. }
  114. },
  115. {
  116. label: '用户 IP',
  117. field: 'userIp'
  118. },
  119. {
  120. label: '订单失效时间',
  121. field: 'expireTime'
  122. },
  123. {
  124. label: '订单支付成功时间',
  125. field: 'successTime'
  126. },
  127. {
  128. label: '订单支付通知时间',
  129. field: 'notifyTime'
  130. },
  131. {
  132. label: '支付成功的订单拓展单编号',
  133. field: 'successExtensionId'
  134. },
  135. {
  136. label: '退款状态',
  137. field: 'refundStatus',
  138. dictType: DICT_TYPE.PAY_ORDER_REFUND_STATUS,
  139. search: {
  140. show: true
  141. }
  142. },
  143. {
  144. label: '退款次数',
  145. field: 'refundTimes'
  146. },
  147. {
  148. label: '退款总金额',
  149. field: 'refundAmount'
  150. },
  151. {
  152. label: '渠道用户编号',
  153. field: 'channelUserId'
  154. },
  155. {
  156. label: '渠道订单号',
  157. field: 'channelOrderNo'
  158. },
  159. {
  160. label: t('common.createTime'),
  161. field: 'createTime',
  162. form: {
  163. show: false
  164. },
  165. search: {
  166. show: true,
  167. component: 'DatePicker',
  168. componentProps: {
  169. type: 'datetimerange',
  170. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  171. defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]
  172. }
  173. }
  174. },
  175. {
  176. label: t('table.action'),
  177. field: 'action',
  178. width: '270px',
  179. form: {
  180. show: false
  181. }
  182. }
  183. ])
  184. export const { allSchemas } = useCrudSchemas(crudSchemas)