Просмотр исходного кода

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

ali 2 лет назад
Родитель
Сommit
62580f0262

+ 14 - 0
src/api/models/TranscriptSheet.js

@@ -28,6 +28,20 @@ export default class TranscriptSheetAPI extends APIRepository {
     })
   }
 
+  deleteById (transcriptSheetId) {
+    return this.sendRequest({
+      apiMethod: 'delete',
+      api: this.api,
+      request: this.APIAdresses.byId(transcriptSheetId),
+      resolveCallback: (response) => {
+        return response.data
+      },
+      rejectCallback: (error) => {
+        return error
+      }
+    })
+  }
+
   update (transcriptSheetId, data) {
     return this.sendRequest({
       apiMethod: 'put',

+ 2 - 0
src/components/Widgets/ActionButton/ActionButton.vue

@@ -78,6 +78,8 @@ export default {
         this.$router.push(this.options.route)
       } else if (this.options.action && this.options.action === 'event') {
         this.$bus.emit(this.options.eventName, this.eventArgs)
+      } else if (this.options.action && this.options.action === 'external-link') {
+        window.open(this.options.route, '_blank')
       }
     }
   }

+ 7 - 1
src/components/Widgets/ActionButton/OptionPanel.vue

@@ -114,6 +114,12 @@
             <q-input v-model="localOptions.route"
                      label="route" />
           </div>
+          <div v-if="localOptions.action === 'external-link'"
+               class="input-container col-md-10">
+            <div class="outsideLabel">route</div>
+            <q-input v-model="localOptions.route"
+                     label="route" />
+          </div>
           <div v-if="localOptions.action === 'event'"
                class="input-container col-md-5">
             <div class="outsideLabel">eventName</div>
@@ -150,7 +156,7 @@ export default defineComponent({
   },
   data () {
     return {
-      actionOptions: ['scroll', 'link', 'event'],
+      actionOptions: ['scroll', 'link', 'event', 'external-link'],
       positionOptions: ['top-right', 'top-left', 'bottom-right', 'bottom-left'],
       defaultOptions: {
         color: null,

+ 1 - 2
src/components/Widgets/Classroom/AdminClassroomShow/components/ActivitySheetList.vue

@@ -59,7 +59,6 @@ import { shallowRef } from 'vue'
 import { EntityIndex } from 'quasar-crud'
 import { APIGateway } from 'src/api/APIGateway.js'
 import BtnControl from 'src/components/Control/btn.vue'
-import { Registration } from 'src/models/Registration.js'
 import DeleteBtn from 'src/components/Control/DeleteBtn.vue'
 
 const BtnControlComp = shallowRef(BtnControl)
@@ -84,7 +83,7 @@ export default {
 
       activitySheetListInputs: [
         { type: 'hidden', name: 'classroom', value: classroomId },
-        { type: 'select', name: 'status', value: null, label: 'وضعیت ثبت نام', options: (new Registration()).statusEnums, placeholder: ' ', col: 'col-md-3 col-12' },
+        { type: 'input', name: 'owner__national_code', value: null, label: 'کد ملی', placeholder: ' ', col: 'col-md-3 col-12' },
         { type: BtnControlComp, name: 'btn', label: 'جستجو', placeholder: ' ', atClick: this.searchActivitySheetList, col: 'col-md-2 col-12' }
       ],
       activitySheetListApi: APIGateway.classroom.APIAdresses.activitySheet,

+ 39 - 3
src/components/Widgets/Classroom/AdminClassroomShow/components/AnnounceResultList.vue

@@ -58,6 +58,11 @@
                       @click="updateTranscriptSheetsUploadIsSentByPost(inputData.props.row)">
                 <q-item-section>تغییر وضعیت پست شده</q-item-section>
               </q-item>
+              <q-item v-close-popup
+                      clickable
+                      @click="deleteTranscriptSheet(inputData.props.row)">
+                <q-item-section>حذف ردیف جاری</q-item-section>
+              </q-item>
             </q-list>
           </q-menu>
         </q-btn>
@@ -129,6 +134,7 @@ export default {
       announceResultListInputs: [
         { type: 'select', name: 'status', value: null, label: 'وضعیت نهایی', options: (new TranscriptSheet()).statusEnums, placeholder: ' ', col: 'col-md-3 col-12' },
         { type: 'select', name: 'registration__status', value: null, label: 'وضعیت ثبت نام', options: (new Registration()).statusEnums, placeholder: ' ', col: 'col-md-3 col-12' },
+        { type: 'input', name: 'registration__owner__national_code', value: null, label: 'کد ملی', placeholder: ' ', col: 'col-md-3 col-12' },
         { type: 'optionGroupRadio', name: 'is_sent_by_post', value: null, label: 'پست', options: [{ label: 'همه موارد', value: null }, { label: 'پست نشده', value: false }, { label: 'پست شده', value: true }], placeholder: ' ', col: 'col-md-3 col-12' },
         { type: 'optionGroupRadio', name: 'certification__isnull', value: null, label: 'مدرک', options: [{ label: 'همه موارد', value: null }, { label: 'آپلود شده', value: false }, { label: 'آپلود نشده', value: true }], placeholder: ' ', col: 'col-md-3 col-12' },
         { type: 'hidden', name: 'registration__classroom', value: classroomId },
@@ -146,12 +152,19 @@ export default {
       announceResultListApi: APIGateway.transcriptSheet.APIAdresses.base,
       announceResultListTable: {
         columns: [
+          // {
+          //   name: 'id',
+          //   required: true,
+          //   label: 'شماره',
+          //   align: 'left',
+          //   field: row => row.id
+          // },
           {
-            name: 'id',
+            name: 'owner',
             required: true,
-            label: 'شماره',
+            label: 'شناسه کاربر',
             align: 'left',
-            field: row => row.id
+            field: row => row.registration_info.owner
           },
           {
             name: 'owner_info.fullname',
@@ -364,6 +377,29 @@ export default {
         // console.log('I am triggered on both OK and Cancel')
       })
     },
+    deleteTranscriptSheet(transcriptSheet) {
+      this.$q.dialog({
+        title: 'حذف ردیف جاری کارنامه',
+        message: 'آیا از حذف ردیف جاری(کارنامه کاربر متناظر) اطمینان دارید؟',
+        cancel: true,
+        persistent: true
+      }).onOk(() => {
+        this.updateTranscriptSheetLoading = true
+        console.log(transcriptSheet)
+        APIGateway.transcriptSheet.deleteById(transcriptSheet.id)
+          .then(() => {
+            this.$refs.announceResultList.search()
+            this.updateTranscriptSheetLoading = false
+          })
+          .catch(() => {
+            this.updateTranscriptSheetLoading = false
+          })
+      }).onCancel(() => {
+        // console.log('>>>> Cancel')
+      }).onDismiss(() => {
+        // console.log('I am triggered on both OK and Cancel')
+      })
+    },
     getExcel () {
       this.exportReportLoading = true
       const filterData = this.$refs.announceResultList.createParams()