Browse Source

Merge branch 'master' of http://git.hghweb.ir/ali.s/palizvani-front-vite into production

hgh 1 năm trước cách đây
mục cha
commit
91185a454f

+ 2 - 2
src/components/Template/Header/MainHeader.vue

@@ -186,7 +186,7 @@
             <q-list>
               <q-item v-close-popup
                       clickable
-                      :to="{ name: 'UserPanel.Profile.UserInfo' }">
+                      :to="{ name: 'UserPanel.Profile.AllClassrooms' }">
                 <q-item-section>
                   پنل کاربری
                 </q-item-section>
@@ -305,7 +305,7 @@ export default {
       if (this.canSeeAdminPanel) {
         // this.$router.push({ name: 'Admin.User.Index' })
       } else {
-        this.$router.push({ name: 'UserPanel.Profile.UserInfo' })
+        this.$router.push({ name: 'UserPanel.Profile.AllClassrooms' })
       }
     },
     goToHome () {

+ 18 - 16
src/components/Widgets/Classroom/ClassroomList/ClassroomList.vue

@@ -1,5 +1,15 @@
 <template>
   <breadcrumbs style="margin-top: 29px; margin-bottom: 19px;" />
+  <template v-if="mounted">
+    <q-card class="barcode-section">
+      <q-card-section>
+        شناسه ورود به جلسه
+      </q-card-section>
+      <q-separator />
+      <form-builder-bar-code lable=""
+                             :value="this.national_code" />
+    </q-card>
+  </template>
   <entity-index v-if="mounted"
                 ref="entityIndex"
                 v-model:value="inputs"
@@ -60,7 +70,6 @@ import Enums from 'src/assets/Enums/Enums.js'
 import { Invoice } from 'src/models/Invoice.js'
 import ShamsiDate from 'src/assets/ShamsiDate.js'
 import { APIGateway } from 'src/api/APIGateway.js'
-import { Classroom } from 'src/models/Classroom.js'
 import { FormBuilderAssist } from 'quasar-form-builder'
 import BtnControl from 'src/components/Control/btn.vue'
 import { Registration } from 'src/models/Registration.js'
@@ -68,12 +77,14 @@ import { mixinAuth, mixinWidget } from 'src/mixin/Mixins.js'
 import EntityIndexGridItem from 'src/components/EntityIndexGridItem.vue'
 import Breadcrumbs from 'src/components/Widgets/Breadcrumbs/Breadcrumbs.vue'
 import { TranscriptSheet } from 'src/models/TranscriptSheet'
+import FormBuilderBarCode from 'src/components/FormBuilderCustumComponents/FormBuilderBarCode.vue'
 
 const BtnControlComp = shallowRef(BtnControl)
 
 export default {
   name: 'UserPanel.Profile.AllClassrooms',
   components: {
+    FormBuilderBarCode,
     EntityIndex,
     Breadcrumbs,
     EntityIndexGridItem
@@ -82,6 +93,7 @@ export default {
   data () {
     return {
       mounted: false,
+      national_code: null,
       inputs: [
         {
           type: 'select',
@@ -104,7 +116,6 @@ export default {
         },
         { type: 'hidden', name: 'classroom__unit__category__type', value: 'TRAINING' },
         { type: 'hidden', name: 'owner', value: null },
-        { type: 'input', name: 'search', label: 'جستجو', placeholder: ' ', col: 'col-md-2 col-12' },
         { type: BtnControlComp, name: 'btn', responseKey: 'btn', label: 'جستجو', placeholder: ' ', atClick: () => {}, col: 'col-md-2 col-12' }
       ],
       api: APIGateway.registration.APIAdresses.base,
@@ -117,13 +128,6 @@ export default {
             align: 'left',
             field: () => ''
           },
-          {
-            name: 'id',
-            required: true,
-            label: 'شناسه',
-            align: 'left',
-            field: row => row.classroom_info.id
-          },
           {
             name: 'classroom_info.title',
             required: true,
@@ -131,13 +135,6 @@ export default {
             align: 'left',
             field: row => row.classroom_info?.title
           },
-          {
-            name: 'audience_gender_type',
-            required: true,
-            label: 'جنسیت',
-            align: 'left',
-            field: row => (new Classroom(row.classroom_info)).audience_gender_type_info.label
-          },
           {
             name: 'title',
             required: true,
@@ -262,6 +259,7 @@ export default {
     },
     setOwner () {
       const user = this.$store.getters['Auth/user']
+      this.national_code = user.national_code
       FormBuilderAssist.setAttributeByName(this.inputs, 'owner', 'value', user.id)
     },
     setActionBtn () {
@@ -359,6 +357,10 @@ export default {
 </script>
 
 <style scoped lang="scss">
+.barcode-section{
+  margin-bottom: 8px;
+  padding-bottom: 8px;
+}
 .CLEAN_PASSED {
   //font-size: 1.1em;
   color: green;

+ 1 - 1
src/components/Widgets/Classroom/ClassroomShow/ClassroomShow.vue

@@ -326,7 +326,7 @@ export default {
           {
             name: 'attendance_status',
             required: true,
-            label: 'وضعیت حضور و غیاب',
+            label: 'وضعیت حضور 2و غیاب',
             align: 'left',
             field: row => (new SessionAttendanceSheets(this.getCurrentUserAttendanceSheet(row))).attendance_status_info.label
           },

+ 18 - 16
src/components/Widgets/ContentCategory/ContentCategoryList/ContentCategoryList.vue

@@ -207,24 +207,26 @@ export default {
 
       return filter
     },
-    async loadMoreContents(index, done) {
+    loadMoreContents(index, done) {
       if (this.contents.loading) return
       this.contents.loading = true
-      try {
-        const { list, paginate } = await APIGateway.content.index({ ...this.filters, page: this.nextPage, per_page: this.perPage })
-        this.nextPage = paginate.current + 1
-        if (this.nextPage > paginate.num_pages) {
-          done(true) // پایان لیست
-        } else {
-          done()
-        }
-        const newList = new ContentList(list)
-        this.contents.list = [...this.contents.list, ...newList.list]
-      } catch (error) {
-        done(true) // در صورت خطا بارگذاری را متوقف کن
-      } finally {
-        this.contents.loading = false
-      }
+      APIGateway.content.index({ ...this.filters, page: this.nextPage, per_page: this.perPage })
+        .then(({ list, paginate }) => {
+          this.nextPage = paginate.current + 1
+          if (this.nextPage > paginate.num_pages) {
+            done(true) // پایان لیست
+          } else {
+            done()
+          }
+          const newList = new ContentList(list)
+          this.contents.list = [...this.contents.list, ...newList.list]
+        })
+        .catch(() => {
+          done(true) // در صورت خطا بارگذاری را متوقف کن
+        })
+        .finally(() => {
+          this.contents.loading = false
+        })
     },
     getContentCategories () {
       const filter = this.getFilterOfCategorySearch()

+ 3 - 1
src/components/Widgets/ContentCategory/ContentCategoryShow/ContentCategoryShow.vue

@@ -23,7 +23,9 @@
                   :show-expand-button="false"
                   :show-reload-button="false">
       <template #entity-index-table-item-cell="{inputData}">
-        <content-item :content="getContent(inputData.props.row)" />
+        <div class="col-md-4 col-12">
+          <content-item :content="getContent(inputData.props.row)" />
+        </div>
       </template>
     </entity-index>
     <q-banner v-if="showRelatedProduct"

+ 55 - 42
src/components/Widgets/ContentCategory/ContentCategoryShow/ContentItem.vue

@@ -1,42 +1,51 @@
 <template>
-  <div class="col-md-4 col-sm-6 col-12">
-    <q-card flat
-            class="ContentItem"
-            @click="goToContentPage">
-      <div class="thumbnail">
-        <q-img :src="content.thumbnail" />
-      </div>
-      <div class="title ellipsis-2-lines">
-        <router-link :to="{name: 'Public.Content.Show', params: {id: content.id}}">
-          {{content.title}}
-        </router-link>
-      </div>
-      <q-card-actions class="action-section">
-        <q-btn color="primary"
-               class="btn-show-content"
-               :to="{name: 'Public.Content.Show', params: {id: content.id}}">
-          مشاهده جزئیات
-        </q-btn>
-      </q-card-actions>
-    </q-card>
-  </div>
+  <q-card class="ContentItem"
+          flat>
+    <div class="thumbnail"
+         @click="goToContentPageShow">
+      <q-img :src="content.thumbnail" />
+    </div>
+    <div class="title ellipsis-2-lines"
+         @click="goToContentPageShow">
+      {{ content.title }}
+    </div>
+    <content-item-categories :content="content" />
+    <q-btn color="primary"
+           class="show-content-btn"
+           :to="{name: 'Public.Content.Show', params: {id: content.id}}">
+      مشاهده
+    </q-btn>
+  </q-card>
 </template>
 
 <script>
 import { defineComponent } from 'vue'
+import Assist from 'src/assets/js/Assist.js'
 import { Content } from 'src/models/Content.js'
+import ContentItemCategories from '../../ContentCategory/ContentCategoryList/ContentItemCategories.vue'
 
 export default defineComponent({
   name: 'ContentItem',
+  components: { ContentItemCategories },
   props: {
     content: {
       type: Content,
       default: new Content()
     }
   },
+  data() {
+    return {
+    }
+  },
   methods: {
-    goToContentPage () {
+    goToContentPageShow () {
+      this.$router.push({ name: 'Public.Content.Show', params: { id: this.content.id } })
+    },
+    goToPage () {
       this.$router.push({ name: 'Public.Content.Show', params: { id: this.content.id } })
+    },
+    miladiToShamsi () {
+      return Assist.miladiToShamsi(this.content.creation_time, 'jD jMMMM jYYYY ساعت HH:mm')
     }
   }
 })
@@ -44,34 +53,38 @@ export default defineComponent({
 
 <style lang="scss" scoped>
 .ContentItem {
-  background: #F6F6F6;
-  border-radius: 8px;
-  border: 1px solid #DFE1EC;
-  padding: 11px 24px 24px 24px;
-  margin: 8px;
+  background-color: #f6f6f6;
+  display: flex;
+  flex-flow: column;
   position: relative;
+  cursor: pointer;
+  padding: 16px;
+  margin: 8px;
+  border-radius: 16px;
   .thumbnail {
-    padding: 0 34px;
-    margin-bottom: 8px;
+    margin-bottom: 16px;
     .q-img {
+      width: 100%;
+      border-radius: 8px;
     }
   }
   .title {
-    font-size: 18px;
-    color: #212121;
     text-align: center;
-    margin-bottom: 8px;
-    max-height: 48px;
-    min-height: 48px;
-    a {
-      color: #212121;
-    }
+    margin-bottom: 16px;
+    font-size: 16px;
   }
-  .action-section {
-    .btn-show-content {
-      width: 100%;
-      height: 48px;
-    }
+  .description {
+    position: absolute;
+    left: 21px;
+    color: #FFFFFF;
+    font-size: 16px;
+    display: none;
+  }
+  .show-content-btn {
+    width: 100%;
+    border-top-right-radius: 0;
+    border-top-left-radius: 0;
+    height: 60px;
   }
 }
 </style>

+ 20 - 3
src/components/Widgets/Invoice/AdminInvoiceShow/AdminInvoiceShow.vue

@@ -18,9 +18,17 @@
             class="q-mt-lg">
       <q-linear-progress v-if="invoice.loading"
                          indeterminate />
-      <q-card-section>
-        صورتحساب شناسه
-        {{ invoice.id }}
+      <q-card-section class="invoiceActionRow">
+        <div class="heading">
+          صورتحساب شناسه
+          {{ invoice.id }}
+        </div>
+        <q-btn v-if="invoice.status==='PAYING'"
+               outline
+               color="primary"
+               @click="onCancel()">
+          لغو صورتحساب
+        </q-btn>
       </q-card-section>
       <q-separator />
       <q-card-section>
@@ -459,5 +467,14 @@ export default {
       top: 0;
     }
   }
+  .invoiceActionRow {
+    display: flex;
+    flex-flow: row;
+    justify-content: space-between;
+    align-items: center;
+    .heading {
+      font-size: 18px;
+    }
+  }
 }
 </style>

+ 19 - 5
src/components/Widgets/Store/Basket/AdminStoreBasketList/AdminStoreBasketList.vue

@@ -56,8 +56,10 @@ import { Basket } from 'src/models/Basket.js'
 import { mixinWidget } from 'src/mixin/Mixins.js'
 import { APIGateway } from 'src/api/APIGateway.js'
 import BtnControl from 'src/components/Control/btn.vue'
+import FormBuilderDateTime from 'src/components/FormBuilderCustumComponents/FormBuilderDateTime.vue'
 
 const BtnControlComp = shallowRef(BtnControl)
+const FormBuilderDateTimeComp = shallowRef(FormBuilderDateTime)
 
 export default {
   name: 'AdminBasketList',
@@ -81,11 +83,16 @@ export default {
       },
       inputs: [
         {
-          type: 'input',
-          name: 'search',
-          label: 'جست جو',
-          placeholder: ' ',
-          col: 'col-md-4 col-12'
+          type: FormBuilderDateTimeComp,
+          name: 'order_time__gte',
+          outsideLabel: 'از تاریخ',
+          col: 'col-md-5 col-12'
+        },
+        {
+          type: FormBuilderDateTimeComp,
+          name: 'order_time__lt',
+          outsideLabel: 'تا تاریخ',
+          col: 'col-md-5 col-12'
         },
         {
           type: 'select',
@@ -111,6 +118,13 @@ export default {
           placeholder: ' ',
           col: 'col-md-3 col-12'
         },
+        {
+          type: 'input',
+          name: 'search',
+          label: 'جست جو',
+          placeholder: ' ',
+          col: 'col-md-4 col-12'
+        },
         { type: BtnControlComp, name: 'btn', label: 'جستجو', placeholder: ' ', atClick: this.search, col: 'col-md-2 col-12' }
       ],
       table: {

+ 4 - 0
src/models/Payment.js

@@ -49,6 +49,10 @@ class Payment extends Model {
             label: 'درخواست برداشت',
             value: 'WITHDRAW_REQUEST'
           },
+          {
+            label: 'برداشت تایید شده',
+            value: 'WITHDRAW_ADMITTED'
+          },
           {
             label: 'برداشت رد شده',
             value: 'WITHDRAW_REJECT'

+ 1 - 4
src/models/SessionAttendanceSheets.js

@@ -15,10 +15,7 @@ class SessionAttendanceSheets extends Model {
         default: []
       },
       { key: 'assignment_status' },
-      {
-        key: 'attendance_status',
-        default: 'NOT_SENT'
-      },
+      { key: 'attendance_status' },
       { key: 'is_listen_part1' },
       { key: 'is_listen_part2' },
       { key: 'is_present_read_part1' },

+ 9 - 6
src/pages/Admin/User/index.vue

@@ -57,6 +57,7 @@ import Assist from 'src/assets/js/Assist.js'
 import { APIGateway } from 'src/api/APIGateway.js'
 import BtnControl from 'src/components/Control/btn.vue'
 import DeleteBtn from 'src/components/Control/DeleteBtn.vue'
+import Enums from 'assets/Enums/Enums'
 
 const BtnControlComp = shallowRef(BtnControl)
 
@@ -71,13 +72,15 @@ export default {
       mounted: false,
       exportReportLoading: false,
       inputs: [
-        { type: 'input', name: 'id', value: null, label: 'شناسه', placeholder: ' ', col: 'col-md-4 col-12' },
-        { type: 'input', name: 'national_code', value: null, label: 'کد ملی', placeholder: ' ', col: 'col-md-4 col-12' },
-        { type: 'input', name: 'mobile_number', value: null, label: 'شماره همراه', placeholder: ' ', col: 'col-md-4 col-12' },
+        { type: 'input', name: 'id', value: null, label: 'شناسه', placeholder: ' ', col: 'col-md-3 col-12' },
+        { type: 'input', name: 'firstname__contains', value: null, label: 'نام', placeholder: ' ', col: 'col-md-3 col-12' },
+        { type: 'input', name: 'lastname__contains', value: null, label: 'نام خانوادگی', placeholder: ' ', col: 'col-md-3 col-12' },
+        { type: 'input', name: 'national_code', value: null, label: 'کد ملی', placeholder: ' ', col: 'col-md-3 col-12' },
+        { type: 'input', name: 'mobile_number', value: null, label: 'شماره همراه', placeholder: ' ', col: 'col-md-3 col-12' },
         { type: 'input', name: 'email', value: null, label: 'ایمیل', placeholder: ' ', col: 'col-md-3 col-12' },
-        { type: 'input', name: 'firstname', value: null, label: 'نام', placeholder: ' ', col: 'col-md-3 col-12' },
-        { type: 'input', name: 'lastname', value: null, label: 'نام خانوادگی', placeholder: ' ', col: 'col-md-3 col-12' },
-        { type: BtnControlComp, name: 'btn', responseKey: 'btn', label: 'جستجو', placeholder: ' ', atClick: () => {}, col: 'col-md-3 col-12' }
+        { type: 'input', name: 'search', label: 'جست جو', placeholder: ' ', col: 'col-md-3 col-12' },
+        { type: 'select', name: 'role', value: null, label: 'نقش', placeholder: ' ', options: Enums.groups, col: 'col-md-3 col-12' },
+        { type: BtnControlComp, name: 'btn', responseKey: 'btn', label: 'جستجو', placeholder: ' ', atClick: () => {}, col: 'col-md-2 col-12' }
       ],
       api: APIGateway.user.APIAdresses.base,
       table: {

+ 7 - 1
src/pages/User/Profile/sessionInfo.vue

@@ -24,7 +24,8 @@
                    :show-edit-button="false"
                    :show-index-button="false"
                    :show-reload-button="false"
-                   :before-load-input-data="beforeLoadInputData">
+                   :before-load-input-data="beforeLoadInputData"
+                   :after-load-input-data="afterLoadInputData">
         <template #before-form-builder>
           <div class="session-title-and-time-row">
             <div class="item">
@@ -376,6 +377,11 @@ export default {
       this.getClassInfo(this.session.classroom)
       this.entityLoading = false
     },
+    afterLoadInputData (data) {
+      if (data.assignment_description === '') {
+        FormBuilderAssist.setAttributeByName(this.sessionInfoInputs, 'assignment_description', 'type', 'hidden')
+      }
+    },
     getClassInfo (classroomId) {
       this.classroom.loading = true
       APIGateway.classroom.get(classroomId)

+ 2 - 2
src/router/routes/UserPanel.js

@@ -86,7 +86,7 @@ export default {
           component: () => import('src/pages/User/Profile/classrooms.vue'),
           meta: {
             breadcrumbs: {
-              visible: true,
+              visible: false,
               loading: false,
               path: [
                 {
@@ -120,7 +120,7 @@ export default {
           component: () => import('src/pages/User/Profile/Events.vue'),
           meta: {
             breadcrumbs: {
-              visible: true,
+              visible: false,
               loading: false,
               path: [
                 {