|
@@ -31,13 +31,52 @@
|
|
|
@click="showInvoice">
|
|
@click="showInvoice">
|
|
|
مشاهده سفارش
|
|
مشاهده سفارش
|
|
|
</q-btn>
|
|
</q-btn>
|
|
|
|
|
+
|
|
|
|
|
+ <div v-if="payment.type === 'WITHDRAW_REQUEST'">
|
|
|
|
|
+ <div class="row q-col-gutter-md q-mt-lg">
|
|
|
|
|
+ <div class="col-md-6 col-12">
|
|
|
|
|
+ رسید پرداخت:
|
|
|
|
|
+ {{ payment.receipt }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-md-6 col-12">
|
|
|
|
|
+ شماره شبا:
|
|
|
|
|
+ {{ payment.IBAN }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <form-builder ref="requestForm"
|
|
|
|
|
+ v-model:value="requestInputs"
|
|
|
|
|
+ :loading="requestLoading"
|
|
|
|
|
+ class="q-mt-md" />
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
</entity-show>
|
|
</entity-show>
|
|
|
|
|
+ <div v-if="payment.type === 'WITHDRAW_REQUEST'"
|
|
|
|
|
+ class="row q-col-gutter-md q-mt-md">
|
|
|
|
|
+ <div class="col-md-6 col-12" />
|
|
|
|
|
+ <div class="col-md-3 col-12">
|
|
|
|
|
+ <q-btn color="primary"
|
|
|
|
|
+ class="full-width"
|
|
|
|
|
+ :loading="requestLoading"
|
|
|
|
|
+ @click="confirmWithdraw">
|
|
|
|
|
+ تایید درخواست
|
|
|
|
|
+ </q-btn>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-md-3 col-12">
|
|
|
|
|
+ <q-btn color="red"
|
|
|
|
|
+ class="full-width"
|
|
|
|
|
+ :loading="requestLoading"
|
|
|
|
|
+ outline
|
|
|
|
|
+ @click="rejectWithdraw">
|
|
|
|
|
+ رد درخواست
|
|
|
|
|
+ </q-btn>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import { EntityShow } from 'quasar-crud'
|
|
import { EntityShow } from 'quasar-crud'
|
|
|
|
|
+import { FormBuilder, FormBuilderAssist } from 'quasar-form-builder'
|
|
|
import { Payment } from 'src/models/Payment.js'
|
|
import { Payment } from 'src/models/Payment.js'
|
|
|
import { mixinWidget } from 'src/mixin/Mixins.js'
|
|
import { mixinWidget } from 'src/mixin/Mixins.js'
|
|
|
import { APIGateway } from 'src/api/APIGateway.js'
|
|
import { APIGateway } from 'src/api/APIGateway.js'
|
|
@@ -45,13 +84,15 @@ import { APIGateway } from 'src/api/APIGateway.js'
|
|
|
export default {
|
|
export default {
|
|
|
name: 'AdminPaymentShow',
|
|
name: 'AdminPaymentShow',
|
|
|
components: {
|
|
components: {
|
|
|
- EntityShow
|
|
|
|
|
|
|
+ EntityShow,
|
|
|
|
|
+ FormBuilder
|
|
|
},
|
|
},
|
|
|
mixins: [mixinWidget],
|
|
mixins: [mixinWidget],
|
|
|
data: () => {
|
|
data: () => {
|
|
|
return {
|
|
return {
|
|
|
mounted: false,
|
|
mounted: false,
|
|
|
entityLoading: true,
|
|
entityLoading: true,
|
|
|
|
|
+ requestLoading: false,
|
|
|
api: null,
|
|
api: null,
|
|
|
payment: new Payment(),
|
|
payment: new Payment(),
|
|
|
entityIdKey: 'id',
|
|
entityIdKey: 'id',
|
|
@@ -59,36 +100,31 @@ export default {
|
|
|
showRouteName: 'Admin.Content.Show',
|
|
showRouteName: 'Admin.Content.Show',
|
|
|
indexRouteName: 'Admin.Content.List',
|
|
indexRouteName: 'Admin.Content.List',
|
|
|
inputs: [
|
|
inputs: [
|
|
|
- { type: 'input', name: 'amount', responseKey: 'amount', label: 'مبلغ', placeholder: ' ', col: 'col-md-4 col-12' },
|
|
|
|
|
- { type: 'dateTime', name: 'creation_time', responseKey: 'creation_time', label: 'تاریخ ایجاد', placeholder: ' ', col: 'col-md-4 col-12' },
|
|
|
|
|
|
|
+ { type: 'separator', name: 'space', label: 'مشخصات کاربر', className: 'custom-separator', col: 'col-12' },
|
|
|
|
|
+ { type: 'input', name: 'creator_info.firstname', responseKey: 'creator_info.firstname', label: 'نام', placeholder: ' ', col: 'col-md-3 col-12' },
|
|
|
|
|
+ { type: 'input', name: 'creator_info.lastname', responseKey: 'creator_info.lastname', label: 'نام خانوادگی', placeholder: ' ', col: 'col-md-3 col-12' },
|
|
|
|
|
+ { type: 'input', name: 'creator_info.mobile_number', responseKey: 'creator_info.mobile_number', label: 'تلفن همراه', placeholder: ' ', col: 'col-md-3 col-12' },
|
|
|
|
|
+ { type: 'input', name: 'creator_info.email', responseKey: 'creator_info.email', label: 'ایمیل', placeholder: ' ', col: 'col-md-3 col-12' },
|
|
|
|
|
+
|
|
|
|
|
+ { type: 'separator', name: 'space', label: 'مشخصات حساب', className: 'custom-separator', col: 'col-12' },
|
|
|
|
|
+ { type: 'input', name: 'id', responseKey: 'id', label: 'شناسه', placeholder: ' ', col: 'col-md-2 col-12' },
|
|
|
{
|
|
{
|
|
|
type: 'select',
|
|
type: 'select',
|
|
|
name: 'type',
|
|
name: 'type',
|
|
|
responseKey: 'type',
|
|
responseKey: 'type',
|
|
|
- label: 'نوع',
|
|
|
|
|
- options: [
|
|
|
|
|
- {
|
|
|
|
|
- label: 'برداشت',
|
|
|
|
|
- value: 'WITHDRAW'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: 'درخواست برداشت',
|
|
|
|
|
- value: 'WITHDRAW_REQUEST'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: 'برداشت رد شده',
|
|
|
|
|
- value: 'WITHDRAW_REJECT'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: 'واریز',
|
|
|
|
|
- value: 'DEPOSIT'
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ label: 'نوع درخواست',
|
|
|
|
|
+ options: (new Payment()).typeEnums,
|
|
|
placeholder: ' ',
|
|
placeholder: ' ',
|
|
|
- col: 'col-md-4 col-12'
|
|
|
|
|
|
|
+ col: 'col-md-3 col-12'
|
|
|
},
|
|
},
|
|
|
- { type: 'input', name: 'creator_info.firstname', responseKey: 'creator_info.firstname', label: 'نام پرداخت کننده', placeholder: ' ', col: 'col-md-6 col-12' },
|
|
|
|
|
- { type: 'input', name: 'creator_info.lastname', responseKey: 'creator_info.lastname', label: 'نام خانوادگی پرداخت کننده', placeholder: ' ', col: 'col-md-6 col-12' }
|
|
|
|
|
|
|
+ { type: 'input', name: 'amount', responseKey: 'amount', label: 'مبلغ کل(ریال)', placeholder: ' ', col: 'col-md-3 col-12' },
|
|
|
|
|
+ { type: 'dateTime', name: 'creation_time', responseKey: 'creation_time', label: 'تاریخ ثبت', placeholder: ' ', col: 'col-md-4 col-12' }
|
|
|
|
|
+ // { type: 'input', name: 'IBAN', responseKey: 'IBAN', label: 'شماره شبا', placeholder: ' ', col: 'col-md-6 col-12' },
|
|
|
|
|
+ // { type: 'input', name: 'receipt', responseKey: 'receipt', label: 'رسید پرداخت', placeholder: ' ', col: 'col-md-6 col-12' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ requestInputs: [
|
|
|
|
|
+ { type: 'file', name: 'receipt', label: 'فایل رسید پرداخت', placeholder: ' ', col: 'col-md-3 col-12' },
|
|
|
|
|
+ { type: 'InputEditor', name: 'description', label: 'توضیحات', placeholder: ' ', col: 'col-12' }
|
|
|
]
|
|
]
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -125,6 +161,35 @@ export default {
|
|
|
this.$refs.entityEdit.getData()
|
|
this.$refs.entityEdit.getData()
|
|
|
this.entityLoading = false
|
|
this.entityLoading = false
|
|
|
})
|
|
})
|
|
|
|
|
+ },
|
|
|
|
|
+ confirmWithdraw () {
|
|
|
|
|
+ this.requestLoading = true
|
|
|
|
|
+ APIGateway.payment.confirmWithdraw(this.payment.id, this.getRequestFormData())
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.requestLoading = false
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.requestLoading = false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ rejectWithdraw () {
|
|
|
|
|
+ this.requestLoading = true
|
|
|
|
|
+ APIGateway.payment.rejectWithdraw({
|
|
|
|
|
+ paymentId: this.payment.id,
|
|
|
|
|
+ description: FormBuilderAssist.getInputsByName(this.requestInputs, 'description').value
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.requestLoading = false
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ this.requestLoading = false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ getRequestFormData () {
|
|
|
|
|
+ return this.$refs.requestForm.getFormData()
|
|
|
|
|
+ },
|
|
|
|
|
+ reloadData () {
|
|
|
|
|
+ return this.$refs.entityEdit.getData()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|