|
|
@@ -25,6 +25,24 @@
|
|
|
</div>
|
|
|
</q-card-section>
|
|
|
|
|
|
+ <q-card-section
|
|
|
+ v-if="packageWarning"
|
|
|
+ class="q-pt-none q-pb-sm q-px-lg"
|
|
|
+ >
|
|
|
+ <div class="package-warning-box row no-wrap q-gutter-x-sm q-pa-sm">
|
|
|
+ <q-icon
|
|
|
+ class="q-mt-xs flex-shrink-0"
|
|
|
+ color="negative"
|
|
|
+ name="mdi-package-variant"
|
|
|
+ size="22px"
|
|
|
+ />
|
|
|
+
|
|
|
+ <span class="font13 fontbold text-negative">
|
|
|
+ {{ packageWarning }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </q-card-section>
|
|
|
+
|
|
|
<q-card-section class="q-pt-none q-pb-sm q-px-lg">
|
|
|
<div class="text-grey-8 font14 fontbold q-mb-xs">
|
|
|
{{ $t('provider.dashboard.cancel_schedule.reason_label') }}
|
|
|
@@ -103,7 +121,7 @@
|
|
|
import { cancelSchedule } from 'src/api/schedule'
|
|
|
import { useDialogPluginComponent, useQuasar } from 'quasar'
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
-import { ref } from 'vue'
|
|
|
+import { computed, ref } from 'vue'
|
|
|
|
|
|
const props = defineProps({
|
|
|
schedule: {
|
|
|
@@ -119,6 +137,20 @@ const $q = useQuasar()
|
|
|
const cancelText = ref('')
|
|
|
const loading = ref(false)
|
|
|
|
|
|
+const packageWarning = computed(() => {
|
|
|
+ if (!props.schedule?.service_package_id) return null
|
|
|
+
|
|
|
+ const count = props.schedule?.package_items?.length
|
|
|
+
|
|
|
+ if (count > 1) {
|
|
|
+ return t('provider.dashboard.cancel_schedule.package_warning', { count })
|
|
|
+ }
|
|
|
+
|
|
|
+ if (count === 1) return null
|
|
|
+
|
|
|
+ return t('provider.dashboard.cancel_schedule.package_warning_generic')
|
|
|
+})
|
|
|
+
|
|
|
const confirmCancel = async () => {
|
|
|
if (!cancelText.value || cancelText.value.trim().length < 5) return
|
|
|
|
|
|
@@ -153,6 +185,11 @@ const confirmCancel = async () => {
|
|
|
border-radius: 10px;
|
|
|
}
|
|
|
|
|
|
+.package-warning-box {
|
|
|
+ background: #fdecec;
|
|
|
+ border-radius: 10px;
|
|
|
+}
|
|
|
+
|
|
|
.btn-action {
|
|
|
min-width: 110px;
|
|
|
}
|