AdminTransactionShow.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <div class="AdminTransactionShow"
  3. :style="localOptions.style">
  4. <div class="flex justify-end">
  5. <q-btn flat
  6. color="grey"
  7. @click="$router.go(-1)">
  8. بازگشت
  9. >
  10. </q-btn>
  11. </div>
  12. <entity-show v-if="mounted"
  13. ref="entityEdit"
  14. v-model:value="inputs"
  15. title="اطلاعات پرداخت"
  16. :api="api"
  17. :entity-id-key="entityIdKey"
  18. :index-route-name="'UserPanel.Wallet'"
  19. :show-close-button="false"
  20. :show-edit-button="false"
  21. :show-expand-button="false"
  22. :show-save-button="false"
  23. :show-reload-button="false"
  24. :redirect-after-edit="false"
  25. :show-index-button="false"
  26. :after-load-input-data="afterLoadInputData">
  27. <template #after-form-builder>
  28. <q-btn v-if="transaction.invoice"
  29. class="full-width q-mt-md"
  30. color="primary"
  31. @click="showInvoice">
  32. مشاهده سفارش
  33. </q-btn>
  34. </template>
  35. </entity-show>
  36. </div>
  37. </template>
  38. <script>
  39. import { EntityShow } from 'quasar-crud'
  40. import { mixinWidget } from 'src/mixin/Mixins.js'
  41. import { APIGateway } from 'src/api/APIGateway.js'
  42. import { Transaction } from 'src/models/Transaction.js'
  43. export default {
  44. name: 'AdminTransactionShow',
  45. components: {
  46. EntityShow
  47. },
  48. mixins: [mixinWidget],
  49. data () {
  50. const transactionId = this.$route.params.id
  51. return {
  52. mounted: false,
  53. entityLoading: true,
  54. requestLoading: false,
  55. api: APIGateway.transaction.APIAdresses.byId(transactionId),
  56. transaction: new Transaction(),
  57. entityIdKey: 'id',
  58. inputs: [
  59. { type: 'separator', name: 'space', label: 'مشخصات کاربر', className: 'custom-separator', col: 'col-12' },
  60. { type: 'input', name: 'creator_info.firstname', responseKey: 'creator_info.firstname', label: 'نام', placeholder: ' ', col: 'col-md-3 col-12' },
  61. { type: 'input', name: 'creator_info.lastname', responseKey: 'creator_info.lastname', label: 'نام خانوادگی', placeholder: ' ', col: 'col-md-3 col-12' },
  62. { type: 'input', name: 'creator_info.mobile_number', responseKey: 'creator_info.mobile_number', label: 'تلفن همراه', placeholder: ' ', col: 'col-md-3 col-12' },
  63. { type: 'input', name: 'creator_info.email', responseKey: 'creator_info.email', label: 'ایمیل', placeholder: ' ', col: 'col-md-3 col-12' },
  64. { type: 'separator', name: 'space', label: 'مشخصات حساب', className: 'custom-separator', col: 'col-12' },
  65. { type: 'input', name: 'id', responseKey: 'id', label: 'شناسه', placeholder: ' ', col: 'col-md-4 col-12' },
  66. { type: 'input', name: 'reference_code', responseKey: 'reference_code', label: 'کد مرجع', placeholder: ' ', col: 'col-md-4 col-12' },
  67. { type: 'input', name: 'authority_code', responseKey: 'authority_code', label: 'شناسه پرداخت', placeholder: ' ', col: 'col-md-4 col-12' },
  68. {
  69. type: 'select',
  70. name: 'status',
  71. responseKey: 'status',
  72. label: 'وضعیت',
  73. options: (new Transaction()).statusEnums,
  74. placeholder: ' ',
  75. col: 'col-md-4 col-12'
  76. },
  77. { type: 'input', name: 'amount', responseKey: 'amount', label: 'مبلغ کل(ریال)', placeholder: ' ', col: 'col-md-4 col-12' },
  78. { type: 'dateTime', name: 'creation_time', responseKey: 'creation_time', outsideLabel: 'تاریخ ثبت', col: 'col-md-4 col-12' },
  79. { type: 'inputEditor', name: 'description', responseKey: 'description', label: 'توضیحات', placeholder: ' ', col: 'col-12' }
  80. // { type: 'input', name: 'IBAN', responseKey: 'IBAN', label: 'شماره شبا', placeholder: ' ', col: 'col-md-6 col-12' },
  81. // { type: 'input', name: 'receipt', responseKey: 'receipt', label: 'رسید پرداخت', placeholder: ' ', col: 'col-md-6 col-12' }
  82. ],
  83. requestInputs: [
  84. { type: 'file', name: 'receipt', label: 'فایل رسید پرداخت', placeholder: ' ', col: 'col-md-3 col-12' },
  85. { type: 'InputEditor', name: 'description', label: 'توضیحات', placeholder: ' ', col: 'col-12' }
  86. ]
  87. }
  88. },
  89. mounted() {
  90. this.mounted = true
  91. },
  92. methods: {
  93. showInvoice () {
  94. const routeData = this.$router.resolve({ name: 'UserPanel.Invoice.Show', params: { id: this.transaction.invoice } })
  95. window.open(routeData.href, '_blank')
  96. },
  97. afterLoadInputData (data) {
  98. this.transaction = new Transaction(data)
  99. this.entityLoading = false
  100. }
  101. }
  102. }
  103. </script>
  104. <style scoped lang="scss">
  105. .AdminTransactionShow {
  106. .title {
  107. font-style: normal;
  108. font-weight: 700;
  109. font-size: 24px;
  110. line-height: 140%;
  111. color: #424242;
  112. margin-bottom: 27px;
  113. display: flex;
  114. flex-flow: row;
  115. position: relative;
  116. .static-title {
  117. }
  118. .dynamic-title {
  119. }
  120. .back-action {
  121. position: absolute;
  122. right: 0;
  123. top: 0;
  124. }
  125. }
  126. :deep(.form) {
  127. padding: 24px;
  128. }
  129. }
  130. </style>