fix some bugs

This commit is contained in:
2026-06-23 22:31:07 +03:30
parent 4e7d6bca00
commit 71764f7e9a
68 changed files with 1941 additions and 1288 deletions
@@ -42,6 +42,7 @@ import MobileSheetHeader from '@/components/mobile/MobileSheetHeader.vue'
import MobileStatCard from '@/components/mobile/MobileStatCard.vue'
import { isMobile } from '@core/utils/is'
import { toJalali } from '@core/utils/useDataTime'
import { metalLabel } from '@/utils/adminMetalLabels'
const props = defineProps<{
visible: boolean
@@ -82,7 +83,7 @@ function statusClass(row: Giftcardcode) {
}
function unitLabel(row: Giftcardcode) {
return row.unit === 2 ? 'طلایی' : 'ریالی'
return row.unit === 2 ? metalLabel.goldWalletShort() : 'ریالی'
}
function unitTagClass(row: Giftcardcode) {
@@ -19,6 +19,7 @@
<script setup lang="ts">
import type { Giftcardcode } from '@/model/giftCard'
import MobileCard from '@/components/mobile/MobileCard.vue'
import { metalLabel } from '@/utils/adminMetalLabels'
const props = defineProps<{
item: Giftcardcode
@@ -50,7 +51,7 @@ const statusClass = computed(() => {
}
})
const unitLabel = computed(() => (props.item.unit === 2 ? 'طلایی' : 'ریالی'))
const unitLabel = computed(() => (props.item.unit === 2 ? metalLabel.goldWalletShort() : 'ریالی'))
const unitTagClass = computed(() =>
props.item.unit === 2
? 'border-amber-300 bg-amber-50 text-amber-700'
@@ -28,7 +28,7 @@
<CustomTag v-else textColor="#C53030" bgColor="#FECACA">غیرفعال</CustomTag>
</template>
<template v-else-if="column.key === 'unit'">
<CustomTag v-if="record.unit === 2" textColor="#C53030" bgColor="#FECACA">طلایی</CustomTag>
<CustomTag v-if="record.unit === 2" textColor="#C53030" bgColor="#FECACA">{{ metalLabel.goldWalletShort() }}</CustomTag>
<CustomTag v-else textColor="#25855A" bgColor="#E3F4E9">ریالی</CustomTag>
</template>
<template v-else-if="column.key === 'amount'">
@@ -68,6 +68,7 @@ import BasicActionSheet from '@/components/BasicActionSheet.vue'
import CustomTag from '@/components/CustomTag.vue'
import { useMobileDetailSheet } from '@/components/mobile/composables/useMobileDetailSheet'
import { isMobile } from '@core/utils/is'
import { metalLabel } from '@/utils/adminMetalLabels'
import { toJalali } from '@core/utils/useDataTime'
import GiftCardCodeMobileDetailSheet from './GiftCardCodeMobileDetailSheet.vue'
import GiftCardCodeMobileListItem from './GiftCardCodeMobileListItem.vue'
@@ -12,7 +12,7 @@
<a-form-item label="نوع کارت هدیه" name="unit" :rules="inputRules()">
<a-radio-group v-model:value="form.unit" button-style="solid">
<a-radio-button value="1">ریالی</a-radio-button>
<a-radio-button value="2">طلایی</a-radio-button>
<a-radio-button value="2">{{ metalLabel.goldWalletShort() }}</a-radio-button>
</a-radio-group>
</a-form-item>
@@ -48,6 +48,7 @@
import type { FormInstance } from 'ant-design-vue'
import type { GiftcardInput } from '@/model/giftCard'
import { inputLenRules, inputRules, inputRulesNumber } from '@/utils/inputRules'
import { metalLabel } from '@/utils/adminMetalLabels'
defineProps<{
form: GiftcardInput
@@ -63,6 +63,7 @@ import MobileStatCard from '@/components/mobile/MobileStatCard.vue'
import { isMobile } from '@core/utils/is'
import { toJalali, toJalaliNoTime } from '@core/utils/useDataTime'
import { usePrice } from '@core/utils/usePrice'
import { metalLabel } from '@/utils/adminMetalLabels'
type GiftCardRow = Giftcard & { customer?: { name?: string; mobile?: string } }
@@ -83,7 +84,7 @@ const visibleProxy = computed({
const sheetTitle = computed(() => props.item?.unique_code || `کارت هدیه #${props.item?.id ?? '-'}`)
function unitLabel(row: GiftCardRow) {
return row.unit === 2 ? 'طلایی' : 'ریالی'
return row.unit === 2 ? metalLabel.goldWalletShort() : 'ریالی'
}
function unitTagClass(row: GiftCardRow) {
@@ -31,6 +31,7 @@
import type { Giftcard } from '@/model/giftCard'
import MobileCard from '@/components/mobile/MobileCard.vue'
import MobileIconButton from '@/components/mobile/MobileIconButton.vue'
import { metalLabel } from '@/utils/adminMetalLabels'
type GiftCardRow = Giftcard & { customer?: { name?: string; mobile?: string } }
@@ -44,7 +45,7 @@ defineEmits<{
(e: 'giftCardCodes', item: GiftCardRow): void
}>()
const unitLabel = computed(() => (props.item.unit === 2 ? 'طلایی' : 'ریالی'))
const unitLabel = computed(() => (props.item.unit === 2 ? metalLabel.goldWalletShort() : 'ریالی'))
const unitTagClass = computed(() =>
props.item.unit === 2
? 'border-amber-300 bg-amber-50 text-amber-700'
@@ -59,7 +59,7 @@
import type { TableInput } from '@core/type/baseTable'
import useBaseTable from '@core/components/BaseTableOld/hooks/useBaseTable'
import Icon from '@core/components/BaseIcon/src/Icon.vue'
import { cols } from '../hooks/orderColumns'
import { getGiftCardColumns } from '../hooks/orderColumns'
import { usePrefix } from '@core/composable/usePrefix'
import { getGiftCardTable } from '@/api/giftCard'
import GiftCardMobileCardList from './GiftCardMobileCardList.vue'
@@ -79,7 +79,7 @@ const mobileListRef = ref<null | { fetch: () => Promise<void> }>(null)
const { prefixCls } = usePrefix('pophoverstatus')
const tblProps = ref<any>({
columns: cols,
columns: getGiftCardColumns(),
api: (params: TableInput) => {
if (props.customerId) {
params.filters = []
@@ -2,6 +2,7 @@ import type { BaseTableColumn } from '@core/type/baseTable'
import { toJalali, toJalaliNoTime, toTime } from '@core/utils/useDataTime'
import CustomTag from '@/components/CustomTag.vue'
import { usePrice } from '@core/utils/usePrice'
import { metalLabel } from '@/utils/adminMetalLabels'
/*import BudgetSelect from '@/components/BudgetSelect.vue'
import { useStaticApiListsStore } from '@/store/staticApisStore'
import type { FilterSelect } from '@/model/filterSelect'
@@ -21,7 +22,8 @@ const filteredDocTypes: FilterSelect = docTypes?.map((x: DocItem) => {
}
})*/
export const cols: BaseTableColumn[] = [
export function getGiftCardColumns(): BaseTableColumn[] {
return [
{
title: 'ردیف',
dataIndex: 'id',
@@ -50,7 +52,7 @@ export const cols: BaseTableColumn[] = [
return (
<div class="flex justify-center">
<CustomTag textColor="#C53030" bgColor="#FECACA">
طلایی
{metalLabel.goldWalletShort()}
</CustomTag>
</div>
)
@@ -236,4 +238,5 @@ export const cols: BaseTableColumn[] = [
fixed: 'right',
filterable: false
}
]
]
}
+2 -1
View File
@@ -106,6 +106,7 @@ import type { Giftcard, Giftcardcode, GiftcardInput } from '@/model/giftCard'
import { createGiftCard } from '@/api/giftCard'
import dayjs from 'dayjs'
import { isMobile } from '@core/utils/is'
import { metalLabel } from '@/utils/adminMetalLabels'
import { isStoreApp } from '@/utils/config'
import { inputRules, inputRulesNumber } from '@/utils/inputRules'
import BasicInput from '@/components/BasicInput.vue'
@@ -174,7 +175,7 @@ function info(val: Giftcard) {
},
{
key: 'نوع کارت هدیه',
value: val.unit === 3 ? 'تخفیف' : val.unit === 2 ? 'طلایی' : 'ریالی'
value: val.unit === 3 ? 'تخفیف' : val.unit === 2 ? metalLabel.goldWalletShort() : 'ریالی'
},
{
key: 'تعداد کدها',