|
|
@@ -202,8 +202,9 @@
|
|
|
:show-search-button="false"
|
|
|
:show-expand-button="false">
|
|
|
<template #toolbar>
|
|
|
- <div class="flex justify-end">
|
|
|
- <q-btn color="primary"
|
|
|
+ <div class="flex flex-nowrap justify-end">
|
|
|
+ <q-btn class="q-ml-sm"
|
|
|
+ color="primary"
|
|
|
outline
|
|
|
:loading="exportReportLoading"
|
|
|
@click="getSubscriptionsListExcel">
|
|
|
@@ -215,6 +216,17 @@
|
|
|
@click="showAlertDialog = true" />
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template #before-index-table>
|
|
|
+ <div class="flex flex-nowrap justify-end"
|
|
|
+ style="margin-bottom: 16px; margin-left: 16px">
|
|
|
+ <q-btn color="red"
|
|
|
+ outline
|
|
|
+ :loading="deleteAllLoading"
|
|
|
+ @click="deleteAllSubscriptions">
|
|
|
+ حذف همه دنبال کنندگان
|
|
|
+ </q-btn>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template #after-index-table>
|
|
|
<q-separator class="q-my-lg" />
|
|
|
</template>
|
|
|
@@ -316,6 +328,7 @@ export default {
|
|
|
tab: 'UnitInfo',
|
|
|
mounted: false,
|
|
|
exportReportLoading: false,
|
|
|
+ deleteAllLoading: false,
|
|
|
showAlertDialog: false,
|
|
|
alertMessageText: '',
|
|
|
sendingAlertConfirmation: false,
|
|
|
@@ -595,6 +608,25 @@ export default {
|
|
|
this.mounted = true
|
|
|
},
|
|
|
methods: {
|
|
|
+ deleteAllSubscriptions () {
|
|
|
+ this.deleteAllLoading = true
|
|
|
+ APIGateway.subscription.deleteAllSubscriptions({
|
|
|
+ source_type: 'UNIT',
|
|
|
+ source_id: this.$route.params.id
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$refs.subscriptionsEntityIndex.search()
|
|
|
+ this.$q.notify({
|
|
|
+ type: 'positive',
|
|
|
+ message: 'دنبال کنندگان حذف شدند',
|
|
|
+ position: 'center'
|
|
|
+ })
|
|
|
+ this.deleteAllLoading = false
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.deleteAllLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
getSubscriptionsListExcel () {
|
|
|
this.exportReportLoading = true
|
|
|
const status = null
|