ali 3 vuotta sitten
vanhempi
commit
95d105ed8c

+ 6 - 0
src/components/Template/SideBard/UserPanelSideBar.vue

@@ -81,6 +81,12 @@ export default {
               show: true,
               active: false
             },
+            {
+              title: 'تاریخچه اتصال به درگاه بانک',
+              routeName: 'UserPanel.Payment.TransactionList',
+              show: true,
+              active: false
+            },
             {
               title: 'کیف پول الکترونیک',
               routeName: 'UserPanel.Wallet',

+ 41 - 49
src/components/Widgets/Transaction/TransactionList/PaymentList.vue → src/components/Widgets/Transaction/TransactionList/TransactionList.vue

@@ -1,10 +1,10 @@
 <template>
-  <div class="PaymentList"
+  <div class="TransactionList"
        :style="localOptions.style">
     <entity-index v-if="mounted"
                   ref="entityIndex"
                   v-model:value="inputs"
-                  title="لیست پرداخت ها"
+                  title="لیست تراکنش های بانکی"
                   :api="api"
                   :table="table"
                   :table-keys="tableKeys"
@@ -47,25 +47,26 @@
 </template>
 
 <script>
-import { shallowRef } from 'vue'
+// import { shallowRef } from 'vue'
 import Assist from 'assets/js/Assist.js'
 import { EntityIndex } from 'quasar-crud'
-import { Payment } from 'src/models/Payment.js'
 import { mixinWidget } from 'src/mixin/Mixins.js'
 import { APIGateway } from 'src/api/APIGateway.js'
+// import { Payment } from 'src/models/Payment.js'
 import { FormBuilderAssist } from 'quasar-form-builder'
-import BtnControl from 'src/components/Control/btn.vue'
+import { Transaction } from 'src/models/Transaction.js'
+// import BtnControl from 'src/components/Control/btn.vue'
 import EntityIndexGridItem from 'src/components/EntityIndexGridItem.vue'
 
-const BtnControlComp = shallowRef(BtnControl)
+// const BtnControlComp = shallowRef(BtnControl)
 
 export default {
-  name: 'PaymentList',
+  name: 'TransactionList',
   components: { EntityIndex, EntityIndexGridItem },
   mixins: [mixinWidget],
   data: () => {
     return {
-      api: APIGateway.payment.APIAdresses.base,
+      api: APIGateway.transaction.APIAdresses.base,
       tableKeys: {
         data: 'results',
         total: 'count',
@@ -74,23 +75,7 @@ export default {
         pageKey: 'page'
       },
       inputs: [
-        {
-          type: 'dateTime',
-          name: 'creation_time__gte',
-          label: 'از تاریخ',
-          placeholder: ' ',
-          col: 'col-md-3 col-12'
-        },
-        {
-          type: 'dateTime',
-          name: 'creation_time__lt',
-          label: 'تا تاریخ',
-          placeholder: ' ',
-          col: 'col-md-3 col-12'
-        },
-        { type: 'select', name: 'type', options: (new Payment()).typeEnums, label: 'نوع تراکنش', placeholder: ' ', col: 'col-md-3 col-12' },
-        { type: 'hidden', name: 'wallet__owner', value: null },
-        { type: BtnControlComp, name: 'btn', responseKey: 'btn', label: 'جستجو', placeholder: ' ', atClick: () => {}, col: 'col-md-2 col-12' }
+        { type: 'hidden', name: 'owner', value: null }
       ],
       table: {
         columns: [
@@ -109,40 +94,47 @@ export default {
             field: row => row.id
           },
           {
-            name: 'invoice_info.title',
+            name: 'amount',
             required: true,
-            label: 'عنوان',
+            label: 'مبلغ تراکنش (ریال)',
             align: 'left',
-            field: row => row.invoice_info?.title
+            field: row => row.amount.toLocaleString('fa')
           },
           {
-            name: 'type',
+            name: 'description',
             required: true,
-            label: 'نوع تراکنش',
+            label: 'توضیحات',
             align: 'left',
-            field: row => (new Payment(row)).type_info.label
+            field: row => row.description
           },
           {
-            name: 'amount',
+            name: 'reference_code',
             required: true,
-            label: 'مبلغ تراکنش (ریال)',
+            label: 'کد مرجع',
             align: 'left',
-            field: row => row.amount.toLocaleString('fa')
+            field: row => row.reference_code
           },
           {
-            name: 'creation_time',
+            name: 'status',
             required: true,
-            label: 'زمان',
+            label: 'وضعیت',
             align: 'left',
-            field: row => Assist.miladiToShamsi(row.creation_time)
+            field: row => (new Transaction(row)).status_info.label
           },
           {
-            name: 'action',
+            name: 'creation_time',
             required: true,
-            label: 'جزییات',
+            label: 'تاریخ ایجاد',
             align: 'left',
-            field: row => ''
+            field: row => Assist.miladiToShamsi(row.creation_time)
           }
+          // {
+          //   name: 'action',
+          //   required: true,
+          //   label: 'جزییات',
+          //   align: 'left',
+          //   field: row => ''
+          // }
         ]
       },
       mounted: false,
@@ -151,27 +143,27 @@ export default {
   },
   mounted() {
     this.setOwner()
-    this.setActionBtn()
+    // this.setActionBtn()
     this.$bus.on('ReloadUserPayments', this.search)
     this.mounted = true
   },
   methods: {
     setOwner () {
       const user = this.$store.getters['Auth/user']
-      FormBuilderAssist.setAttributeByName(this.inputs, 'wallet__owner', 'value', user.id)
-    },
-    setActionBtn () {
-      FormBuilderAssist.setAttributeByName(this.inputs, 'btn', 'atClick', this.search)
-    },
-    search () {
-      this.$refs.entityIndex.search()
+      FormBuilderAssist.setAttributeByName(this.inputs, 'owner', 'value', user.id)
     }
+    // setActionBtn () {
+    //   FormBuilderAssist.setAttributeByName(this.inputs, 'btn', 'atClick', this.search)
+    // },
+    // search () {
+    //   this.$refs.entityIndex.search()
+    // }
   }
 }
 </script>
 
 <style scoped lang="scss">
-.PaymentList {
+.TransactionList {
   .title {
     font-style: normal;
     font-weight: 700;

+ 6 - 3
src/models/Transaction.js

@@ -40,9 +40,12 @@ class Transaction extends Model {
         enumListKey: 'statusEnums',
         enums: [
           { label: 'لغو شده', value: 'CANCELED' },
-          { label: 'در حال پرداخت', value: 'IN_PROGRESS' },
-          { label: 'پرداخت نقدی', value: 'PAID' },
-          { label: 'پرداخت قسطی', value: 'PAY_IN_INSTALMENT' }
+          { label: 'ناموفق', value: 'FAILED' },
+          { label: 'موفق', value: 'SUCCESS' },
+          { label: 'خطا', value: 'ERRORED' },
+          { label: 'ناشناخته', value: 'UNKNOWN' },
+          { label: 'در حال انجام', value: 'IN_PROGRESS' },
+          { label: 'در حال اعتبارسنجی', value: 'VERIFYING' }
         ]
       }
     })

+ 8 - 4
src/pages/Admin/User/show.vue

@@ -118,7 +118,8 @@
                     height="200px" />
       </q-tab-panel>
 
-      <q-tab-panel name="financial">
+      <q-tab-panel name="financial"
+                   class="q-pa-none">
         <q-tabs v-model="financialTab"
                 dense
                 class="text-grey"
@@ -136,7 +137,8 @@
         <q-separator />
         <q-tab-panels v-model="financialTab"
                       animated>
-          <q-tab-panel name="invoiceList">
+          <q-tab-panel name="invoiceList"
+                       class="q-pa-none">
             <entity-index v-if="mounted"
                           ref="invoiceList"
                           v-model:value="invoiceListInputs"
@@ -164,7 +166,8 @@
               </template>
             </entity-index>
           </q-tab-panel>
-          <q-tab-panel name="paymentList">
+          <q-tab-panel name="paymentList"
+                       class="q-pa-none">
             <entity-index v-if="mounted"
                           ref="paymentList"
                           v-model:value="paymentListInputs"
@@ -192,7 +195,8 @@
               </template>
             </entity-index>
           </q-tab-panel>
-          <q-tab-panel name="transactionList">
+          <q-tab-panel name="transactionList"
+                       class="q-pa-none">
             <entity-index v-if="mounted"
                           ref="transactionList"
                           v-model:value="transactionListInputs"

+ 24 - 0
src/pages/User/Payment/TransactionList.vue

@@ -0,0 +1,24 @@
+<template>
+  <q-page-builder v-model:sections="currenSections"
+                  v-model:options="pageConfig"
+                  :editable="pageBuilderEditable"
+                  :loading="pageBuilderLoading" />
+</template>
+
+<script>
+import { mixinPageOptions } from 'src/mixin/Mixins.js'
+
+export default {
+  name: 'AdminPanel.Invoice.List',
+  mixins: [mixinPageOptions],
+  data: () => {
+    return {
+      sections: [{ data: { rows: [{ cols: [{ widgets: [{ name: 'TransactionList' }], options: { style: { paddingTop: '' } } }], options: { className: '', height: 'auto', boxed: true, boxedWidth: 1200, gutterXSize: 'md', gutterYSize: 'md', absolute: 'none', paddingOfBoxedInFullWidth: '10px', alignment: { justifyContent: { global: null, xl: null, lg: null, md: null, sm: null, xs: null }, alignItems: { global: null, xl: null, lg: null, md: null, sm: null, xs: null }, alignContent: { global: null, xl: null, lg: null, md: null, sm: null, xs: null } }, style: { maxWidth: '1200px', width: '1200px', marginBottom: '10px' } } }] } }]
+    }
+  },
+  created() {
+    this.currenSections = this.sections
+    this.pageBuilderLoading = false
+  }
+}
+</script>

+ 5 - 0
src/router/routes.js

@@ -413,6 +413,11 @@ const routes = [
                 name: 'UserPanel.Payment.List',
                 component: () => import('src/pages/User/Payment/List.vue')
               },
+              {
+                path: 'transactions',
+                name: 'UserPanel.Payment.TransactionList',
+                component: () => import('src/pages/User/Payment/TransactionList.vue')
+              },
               {
                 name: 'UserPanel.Payment.Show',
                 path: ':id',