added dark mode
This commit is contained in:
@@ -63,13 +63,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 {
|
||||
changeCustomerActivation,
|
||||
changeCustomerArchive,
|
||||
changeCustomerOrderActivation,
|
||||
getCustomerArchiveTable,
|
||||
getCustomerTable
|
||||
} from '@/api/customer'
|
||||
import { changeProductArchive } from '@/api/product'
|
||||
import { cols } from '../hooks/archiveColumns'
|
||||
import { useUserStore } from '@/store/userStore'
|
||||
import { usePrefix } from '@core/composable/usePrefix'
|
||||
@@ -105,37 +99,12 @@ const tblProps = ref<any>({
|
||||
})
|
||||
const loading = ref<boolean>(false)
|
||||
|
||||
async function changeCustomerActivationFunction(id: number) {
|
||||
try {
|
||||
loading.value = true
|
||||
await changeCustomerActivation(id)
|
||||
reload()
|
||||
message.success('تغییر وضعیت با موفقیت انجام شد')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function changeCustomerOrderActivationFunction(id: number) {
|
||||
try {
|
||||
loading.value = true
|
||||
await changeCustomerOrderActivation(id)
|
||||
reload()
|
||||
message.success('تغییر وضعیت سفارش دهی با موفقیت انجام شد')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
async function archiveFunction(id: number) {
|
||||
try {
|
||||
loading.value = true
|
||||
await changeCustomerArchive(id)
|
||||
await changeProductArchive(id)
|
||||
await Promise.allSettled([reload(), mobileListRef.value?.fetch?.() as Promise<void>])
|
||||
message.success('مشتری با موفقیت از بایگانی خارج شد.')
|
||||
message.success('محصول با موفقیت از بایگانی خارج شد.')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
} finally {
|
||||
|
||||
@@ -36,17 +36,21 @@
|
||||
|
||||
<BasicShowContext title="لیست محصولات" class="min-h-0 flex-1">
|
||||
<template #extra>
|
||||
<BaseButton type="primary" size="small" class="flex shrink-0 md:hidden" @click="emits('add')">
|
||||
<div>افزودن</div>
|
||||
<BaseIcon icon="vuesax-linear:box" Size="16px" />
|
||||
<BaseButton
|
||||
v-if="isMobile"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="vuesax-linear:box"
|
||||
@click="emits('add')"
|
||||
>
|
||||
افزودن محصول
|
||||
</BaseButton>
|
||||
</template>
|
||||
<div class="flex h-full min-h-0 flex-col">
|
||||
<BaseTable v-if="!isMobile" class="h-full min-h-0 min-w-0" v-bind="tblProps" @register="submit" ref="tbl">
|
||||
<template #extraHeader>
|
||||
<BaseButton type="primary" size="small" class="flex" @click="emits('add')">
|
||||
<div>افزودن محصول</div>
|
||||
<BaseIcon icon="vuesax-linear:box" Size="16px" />
|
||||
<BaseButton type="primary" size="small" icon="vuesax-linear:box" @click="emits('add')">
|
||||
افزودن محصول
|
||||
</BaseButton>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import type { BaseTableColumn } from '@core/type/baseTable'
|
||||
import CustomTag from '@/components/CustomTag.vue'
|
||||
import { isStoreApp } from '@/utils/config'
|
||||
import { usePrice } from '@core/utils/usePrice'
|
||||
|
||||
function formatMoney(value: number | null | undefined) {
|
||||
return usePrice(value ?? 0, true, '').trim()
|
||||
}
|
||||
|
||||
const inventoryColumn: BaseTableColumn = {
|
||||
title: 'موجودی',
|
||||
@@ -47,7 +52,8 @@ export function getProductColumns(): BaseTableColumn[] {
|
||||
title: 'قیمت',
|
||||
dataIndex: 'price',
|
||||
key: 'price',
|
||||
type: 'Text'
|
||||
type: 'Text',
|
||||
customRender: ({ record }) => formatMoney(record.price)
|
||||
},
|
||||
{
|
||||
title: 'تعدیل قیمت (٪)',
|
||||
@@ -79,13 +85,15 @@ export function getProductColumns(): BaseTableColumn[] {
|
||||
title: 'هزینه نقدی موقع خرید',
|
||||
dataIndex: 'cash_fee_buy',
|
||||
key: 'cash_fee_buy',
|
||||
type: 'Number'
|
||||
type: 'Number',
|
||||
customRender: ({ record }) => formatMoney(record.cash_fee_buy)
|
||||
},
|
||||
{
|
||||
title: 'هزینه نقدی موقع فروش',
|
||||
dataIndex: 'cash_fee_sell',
|
||||
key: 'cash_fee_sell',
|
||||
type: 'Number'
|
||||
type: 'Number',
|
||||
customRender: ({ record }) => formatMoney(record.cash_fee_sell)
|
||||
},
|
||||
...(isStoreApp() ? [inventoryColumn] : []),
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user