Browse Source

show invoice

ali 3 years ago
parent
commit
8e8caae206

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

@@ -52,13 +52,6 @@ export default {
           show: true,
           active: false
         },
-        {
-          title: 'مدیریت حلقه ها',
-          // routeName: 'Admin.User.Index',
-          scrollTo: '#introSection',
-          show: true,
-          active: false
-        },
         {
           title: 'دوره های آموزشی',
           routeName: null,
@@ -71,13 +64,6 @@ export default {
               routeName: 'UserPanel.Profile.AllClassrooms',
               show: true,
               active: false
-            },
-            {
-              title: 'کارنامه',
-              scrollTo: '#introSection',
-              // routeName: 'Admin.User.Index',
-              show: true,
-              active: false
             }
           ]
         },

+ 6 - 7
src/components/Widgets/Invoice/InvoiceList/InvoiceList.vue

@@ -14,8 +14,7 @@
                   :show-reload-button="false">
       <template #entity-index-table-cell="{inputData}">
         <template v-if="inputData.col.name === 'action'">
-          <q-btn flat
-                 color="primary"
+          <q-btn color="primary"
                  :to="{name: 'UserPanel.Invoice.Show', params: {id: inputData.props.row.id}}">
             مشاهده جزییات
           </q-btn>
@@ -45,7 +44,7 @@ export default {
   mixins: [mixinWidget],
   data: () => {
     return {
-      api: APIGateway.payment.APIAdresses.base,
+      api: APIGateway.invoice.APIAdresses.base,
       tableKeys: {
         data: 'results',
         total: 'count',
@@ -91,16 +90,16 @@ export default {
           {
             name: 'amount',
             required: true,
-            label: 'مبلغ تراکنش (تومان)',
+            label: 'مبلغ تراکنش(تومان)',
             align: 'left',
             field: row => row.amount.toLocaleString('fa')
           },
           {
-            name: 'invoice_info.status',
+            name: 'status',
             required: true,
-            label: 'وضعیت تراکنش',
+            label: 'وضعیت',
             align: 'left',
-            field: row => (new Invoice(row.invoice_info)).status_info.label
+            field: row => (new Invoice(row)).status_info.label
           },
           {
             name: 'creation_time',

+ 68 - 129
src/components/Widgets/Invoice/InvoiceShow/InvoiceShow.vue

@@ -1,21 +1,9 @@
 <template>
   <div class="InvoiceShow"
        :style="localOptions.style">
-    <div class="title">
-      <div class="static-title">
-        مشاهده صورتحساب
-        شماره:
-      </div>
-      <div class="dynamic-title">
-        <template v-if="entityLoading">
-          <q-skeleton type="text"
-                      class="q-ml-lg"
-                      width="100px" />
-        </template>
-        <template v-else>
-          {{ entityId }}
-        </template>
-      </div>
+    <div class="title q-pb-lg">
+      <div class="static-title" />
+      <div class="dynamic-title" />
       <div class="back-action">
         <q-btn flat
                :to="{name: 'UserPanel.Invoice.List'}"
@@ -25,55 +13,72 @@
         </q-btn>
       </div>
     </div>
-    <q-card class="form"
-            flat>
-      <entity-show v-if="mounted"
-                   ref="entityEdit"
-                   v-model:value="inputs"
-                   :api="api"
-                   :entity-id-key="entityIdKey"
-                   :entity-param-key="entityParamKey"
-                   :show-route-name="showRouteName"
-                   :show-close-button="false"
-                   :show-edit-button="false"
-                   :show-expand-button="false"
-                   :show-save-button="false"
-                   :show-reload-button="false"
-                   :default-layout="false"
-                   :redirect-after-edit="false"
-                   :after-load-input-data="afterLoadInputData" />
-    </q-card>
-    <q-card v-if="invoice.products_info.list.length > 0"
+    <entity-show v-if="mounted"
+                 ref="entityEdit"
+                 v-model:value="inputs"
+                 :title="'مشاهده صورتحساب شماره: ' + entityId"
+                 :api="api"
+                 :entity-id-key="entityIdKey"
+                 :entity-param-key="entityParamKey"
+                 :show-route-name="showRouteName"
+                 :show-close-button="false"
+                 :show-edit-button="false"
+                 :show-expand-button="false"
+                 :show-save-button="false"
+                 :show-reload-button="false"
+                 :redirect-after-edit="false"
+                 :show-index-button="false"
+                 :after-load-input-data="afterLoadInputData" />
+    <q-card v-if="invoice.item_info"
             class="q-mt-lg">
       <q-card-section>
-        <div class="selectedProductsList">
-          <div class="selectedProductsList-row head">
-            <div class="selectedProductsList-title">
-              شرح خدمات
-            </div>
-            <div class="selectedProductsList-price">
-              مبلغ
-            </div>
+        <div class="row">
+          <div class="col-md-3 col-12">
+            <q-banner>
+              <q-icon name="isax:stickynote" />
+              {{ getDateTime(invoice.creation_time) }}
+            </q-banner>
           </div>
-          <div v-for="item in invoice.products_info.list[0].registrations_info.list"
-               :key="item.id"
-               class="selectedProductsList-row">
-            <div class="selectedProductsList-title">
-              {{ item.item_info.title }}
-            </div>
-            <div class="selectedProductsList-price">
-              {{ (item.count * item.item_info.unit_price).toLocaleString('fa') }}
+          <div class="col-md-3 col-12">
+            <q-banner>
+              {{ (invoice.amount ? invoice.amount.toLocaleString('fa') : 0) }}
               تومان
-            </div>
+            </q-banner>
           </div>
-          <div class="selectedProductsList-row footer">
-            <div class="selectedProductsList-title">
-              قابل پرداخت
-            </div>
-            <div class="selectedProductsList-price">
-              {{ (invoice.products_info.list[0].amount) ? invoice.products_info.list[0].amount.toLocaleString('fa') : 0 }}
-              تومان
-            </div>
+          <div class="col-md-3 col-12">
+            <q-banner>
+              شماره پیگیری
+              {{ invoice.id }}
+            </q-banner>
+          </div>
+          <div class="col-md-3 col-12">
+            <q-banner>
+              وضعیت:
+              {{ invoice.status_info.label }}
+            </q-banner>
+          </div>
+        </div>
+        <div class="row">
+          <div class="col-md-4 col-12">
+            <q-img :src="invoice.item_info.thumbnail"
+                   width="100px" />
+            {{ invoice.item_info.title }}
+          </div>
+          <div class="col-md-4 col-12">
+            <q-img :src="invoice.item_info.thumbnail"
+                   width="100px" />
+            <q-icon name="isax:user" />
+            استاد:
+            {{ invoice.item_info.professor_info.firstname }}
+            {{ invoice.item_info.professor_info.lastname }}
+          </div>
+          <div class="col-md-4 col-12">
+            <q-img :src="invoice.item_info.thumbnail"
+                   width="100px" />
+            <q-icon name="isax:card" />
+            قیمت:
+            {{ invoice.item_info?.price ? invoice.item_info.price.toLocaleString('fa') : 0 }}
+            تومان
           </div>
         </div>
       </q-card-section>
@@ -96,6 +101,7 @@
 </template>
 
 <script>
+import Assist from 'assets/js/Assist.js'
 import { EntityShow } from 'quasar-crud'
 import { Invoice } from 'src/models/Invoice.js'
 import { mixinWidget } from 'src/mixin/Mixins.js'
@@ -160,6 +166,9 @@ export default {
     this.mounted = true
   },
   methods: {
+    getDateTime (dateTime) {
+      return Assist.miladiToShamsi(dateTime)
+    },
     pay () {
       this.invoice.loading = true
       APIGateway.invoice.pay(this.invoice.id)
@@ -223,75 +232,5 @@ export default {
     padding: 24px;
   }
 
-  .selectedProductsList {
-    width: 100%;
-
-    .selectedProductsList-row {
-      display: flex;
-      flex-flow: row;
-      justify-content: flex-start;
-      align-items: center;
-      padding: 16px 0;
-      border-bottom: solid 1px #F6F6F6;
-
-      &.head {
-        .selectedProductsList-title {
-          color: #6589C3;
-          font-size: 16px;
-          font-weight: 700;
-          line-height: 140%;
-        }
-
-        .selectedProductsList-price {
-          color: #6589C3;
-          font-size: 16px;
-          font-weight: 700;
-          line-height: 140%;
-        }
-      }
-
-      &.footer {
-        .selectedProductsList-title {
-          color: #2FA84A;
-          font-size: 16px;
-          font-weight: 700;
-          line-height: 140%;
-        }
-
-        .selectedProductsList-price {
-          color: #2FA84A;
-          font-size: 16px;
-          font-weight: 700;
-          line-height: 140%;
-        }
-      }
-
-      .selectedProductsList-title {
-        width: calc(100% - 150px);
-        color: #272727;
-        font-size: 16px;
-        font-weight: 500;
-        line-height: 140%;
-      }
-
-      .selectedProductsList-price {
-        width: 150px;
-        color: #272727;
-        font-size: 16px;
-        line-height: 140%;
-      }
-    }
-
-    :deep(.form) {
-      padding: 24px;
-
-      .action {
-        display: flex;
-        flex-flow: row;
-        justify-content: flex-end;
-        margin-top: 32px;
-      }
-    }
-  }
 }
 </style>

+ 2 - 1
src/components/Widgets/Other/Shop/ShopPaymentFromWallet/components/PaymentCard.vue

@@ -7,7 +7,8 @@
       <div class="PaymentCard-head-caption">
         خرید شما قطعی نشده است و در صورت عدم پرداخت تا پایان زمان، صورتحساب شما لغو خواهد شد
       </div>
-      <div class="PaymentCard-head-remaining-time">
+      <div v-if="false"
+           class="PaymentCard-head-remaining-time">
         <q-icon name="isax:clock" />
         زمان باقی مانده :
         {{ timerString }}

+ 4 - 5
src/components/Widgets/Payment/PaymentList/PaymentList.vue

@@ -14,11 +14,10 @@
                   :show-reload-button="false">
       <template #entity-index-table-cell="{inputData}">
         <template v-if="inputData.col.name === 'action'">
-          <q-btn flat
-                 color="primary"
-                 :to="{name: 'UserPanel.Invoice.Show', params: {id: inputData.props.row.id}}">
-            مشاهده جزییات
-          </q-btn>
+          <!--          <q-btn color="primary"-->
+          <!--                 :to="{name: 'UserPanel.Invoice.Show', params: {id: inputData.props.row.id}}">-->
+          <!--            مشاهده جزییات-->
+          <!--          </q-btn>-->
         </template>
         <template v-else>
           {{ inputData.col.value }}

+ 1 - 0
src/components/Widgets/Wallet/MyWallet/MyWallet.vue

@@ -65,6 +65,7 @@ export default {
   },
   mounted() {
     this.loadAuthData()
+    this.getMyWallet()
   },
   methods: {
     loadAuthData() { // prevent Hydration node mismatch