added function for trigger in admin
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<a-form :model="form" ref="formRef" layout="vertical" autocomplete="off">
|
||||
<a-form-item label="مشتری" name="customer_id" :rules="inputRules()">
|
||||
<BasicSelect
|
||||
v-model:value="form.customer_id"
|
||||
:items="customerItems"
|
||||
key-name="id"
|
||||
value-name="label"
|
||||
placeholder="انتخاب مشتری"
|
||||
:disabled="Boolean(editId)"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="شرط قیمت" name="price_condition" :rules="inputRules()">
|
||||
<BasicSelect
|
||||
v-model:value="form.price_condition"
|
||||
:items="conditionItems"
|
||||
key-name="key"
|
||||
value-name="value"
|
||||
placeholder="بزرگتر یا کوچکتر"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="قیمت هدف" name="target_price" :rules="inputRulesNumber()">
|
||||
<BasicInput v-model:value="form.target_price" type="price" addon-before="ریال" placeholder="مثلاً ۱۷۸۵۰۰۰۰۰" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="روش اطلاعرسانی" name="action" :rules="inputRules()">
|
||||
<a-radio-group v-model:value="form.action" button-style="solid">
|
||||
<a-radio-button value="sms">پیامک</a-radio-button>
|
||||
<a-radio-button value="email">ایمیل</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="وضعیت" name="is_active">
|
||||
<a-switch v-model:checked="form.is_active" checked-children="فعال" un-checked-children="غیرفعال" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import type { FormInstance } from 'ant-design-vue'
|
||||
import type { Customer } from '@/model/customer'
|
||||
import type { PriceTriggers } from '@/model/priceTriggers'
|
||||
import { inputRules, inputRulesNumber } from '@/utils/inputRules'
|
||||
|
||||
defineProps<{
|
||||
form: Partial<PriceTriggers>
|
||||
customerItems: Array<{ id: number; label: string }>
|
||||
editId?: number
|
||||
}>()
|
||||
|
||||
const conditionItems = [
|
||||
{ value: 'بزرگتر از', key: '>' },
|
||||
{ value: 'کوچکتر از', key: '<' },
|
||||
]
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
defineExpose({
|
||||
validateFields: () => formRef.value?.validateFields(),
|
||||
resetFields: () => formRef.value?.resetFields(),
|
||||
})
|
||||
</script>
|
||||
@@ -1,27 +1,52 @@
|
||||
<template>
|
||||
<div>
|
||||
<BasicShowContext title="هشدار قیمت">
|
||||
<AdminFieldHelp :text="priceTriggersPageIntro" root-class="mb-3 px-1" />
|
||||
<BaseTable 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:user-add" Size="16px" />
|
||||
<template #extra>
|
||||
<div class="flex items-center gap-2">
|
||||
<AdminFieldHelp :text="priceTriggersPageIntro" />
|
||||
<BaseButton type="primary" size="small" @click="emits('add')">
|
||||
<span>افزودن هشدار</span>
|
||||
<BaseIcon icon="vuesax-linear:add" size="16" />
|
||||
</BaseButton>
|
||||
</template>-->
|
||||
<template #action="{ column, record }">
|
||||
<div class="gap-2 flex justify-center">
|
||||
<a-tooltip placement="bottom" class="cursor-pointer" @click="emits('info', record)">
|
||||
<template #title>
|
||||
<span>مشخصات</span>
|
||||
</template>
|
||||
<Icon icon="vuesax-linear:stickynote" color="#10913A" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<BaseTable v-bind="tblProps" @register="submit" ref="tbl">
|
||||
<template #extraHeader>
|
||||
<BaseButton type="primary" size="small" class="hidden md:inline-flex" @click="emits('add')">
|
||||
<span>افزودن هشدار</span>
|
||||
<BaseIcon icon="vuesax-linear:add" size="16" />
|
||||
</BaseButton>
|
||||
</template>
|
||||
|
||||
<template #action="{ record }">
|
||||
<div class="flex justify-center gap-2">
|
||||
<a-tooltip placement="bottom">
|
||||
<template #title>ویرایش</template>
|
||||
<Icon
|
||||
icon="vuesax-linear:edit"
|
||||
color="#4572E9"
|
||||
class="cursor-pointer"
|
||||
@click="emits('edit', record)"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="bottom" class="cursor-pointer" @click="emits('edit', record)">
|
||||
<template #title>
|
||||
<span>ویرایش</span>
|
||||
</template>
|
||||
<Icon icon="vuesax-linear:edit" color="#4572E9" />
|
||||
<a-tooltip placement="bottom">
|
||||
<template #title>{{ record.is_active ? 'غیرفعال کردن' : 'فعال کردن' }}</template>
|
||||
<Icon
|
||||
:icon="record.is_active ? 'vuesax-linear:eye-slash' : 'vuesax-linear:eye'"
|
||||
:color="record.is_active ? '#C53030' : '#25855A'"
|
||||
class="cursor-pointer"
|
||||
@click="emits('toggle', record)"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="bottom">
|
||||
<template #title>حذف</template>
|
||||
<Icon
|
||||
icon="vuesax-linear:trash"
|
||||
color="#C53030"
|
||||
class="cursor-pointer"
|
||||
@click="emits('delete', record.id)"
|
||||
/>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
@@ -33,67 +58,29 @@
|
||||
<script lang="tsx" setup>
|
||||
import type { TableInput } from '@core/type/baseTable'
|
||||
import useBaseTable from '@core/components/BaseTableOld/hooks/useBaseTable'
|
||||
import { toJalali, toJalaliNoTime } from '@core/utils/useDataTime'
|
||||
import { message, Tag } from 'ant-design-vue'
|
||||
import CustomTag from '@/components/CustomTag.vue'
|
||||
import Icon from '@core/components/BaseIcon/src/Icon.vue'
|
||||
import { changeUserActivation, getUserTable } from '@/api/user'
|
||||
import { useUserStore } from '@/store/userStore'
|
||||
import { cols } from '../hooks/priceTriggersColumns'
|
||||
import { changeCustomerActivation } from '@/api/customer'
|
||||
import { getPriceTriggersTable } from '@/api/priceTriggers'
|
||||
import AdminFieldHelp from '@/components/AdminFieldHelp.vue'
|
||||
import { priceTriggersPageIntro } from '@/utils/adminHelpCopy'
|
||||
|
||||
const [submit, reload] = useBaseTable()
|
||||
|
||||
//emits
|
||||
const emits = defineEmits(['delete', 'edit', 'add', 'info'])
|
||||
const emits = defineEmits<{
|
||||
add: []
|
||||
edit: [record: Record<string, unknown>]
|
||||
toggle: [record: Record<string, unknown>]
|
||||
delete: [id: number]
|
||||
}>()
|
||||
|
||||
//define table
|
||||
const table = ref(null)
|
||||
|
||||
//permission
|
||||
function checkPermission(temp: string) {
|
||||
const store = useUserStore()
|
||||
return store.canAccess(temp)
|
||||
}
|
||||
|
||||
const loading = ref<boolean>(false)
|
||||
|
||||
async function changeUserActivationFunction(id: number) {
|
||||
try {
|
||||
loading.value = true
|
||||
await changeUserActivation(id)
|
||||
reload()
|
||||
message.success('تغییر وضعیت با موفقیت انجام شد')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const tblProps = ref<any>({
|
||||
const tblProps = {
|
||||
columns: cols,
|
||||
api: (params: TableInput) => {
|
||||
return getPriceTriggersTable(params)
|
||||
}
|
||||
//bordered: true
|
||||
})
|
||||
api: (params: TableInput) => getPriceTriggersTable(params),
|
||||
}
|
||||
|
||||
const fetch = () => {
|
||||
// console.log('sss')
|
||||
function fetch() {
|
||||
reload()
|
||||
}
|
||||
// const spinTable = (val: boolean) => {
|
||||
// // console.log('sss')
|
||||
// table?.value?.loading.value = val
|
||||
// }
|
||||
defineExpose({
|
||||
fetch
|
||||
// spinTable
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
defineExpose({ fetch })
|
||||
</script>
|
||||
|
||||
@@ -29,6 +29,16 @@ export const cols: BaseTableColumn[] = [
|
||||
return record.index + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'مشتری',
|
||||
dataIndex: 'customer',
|
||||
key: 'customer',
|
||||
type: 'Text',
|
||||
customRender: ({ record }) => {
|
||||
const name = record.customer?.name?.trim()
|
||||
return name ? `${name} (${record.customer_id})` : String(record.customer_id ?? '-')
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'کد مشتری',
|
||||
dataIndex: 'customer_id',
|
||||
@@ -203,6 +213,15 @@ export const cols: BaseTableColumn[] = [
|
||||
{
|
||||
title: 'روش ارسال',
|
||||
dataIndex: 'action',
|
||||
key: 'action',
|
||||
}
|
||||
key: 'notify_action',
|
||||
customRender: ({ record }) => (record.action === 'email' ? 'ایمیل' : 'پیامک'),
|
||||
},
|
||||
{
|
||||
title: 'عملیات',
|
||||
dataIndex: 'row_action',
|
||||
key: 'row_action',
|
||||
slot: 'action',
|
||||
fixed: 'right',
|
||||
filterable: false,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -1,248 +1,163 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <BasicMainCard>-->
|
||||
<div class="flex w-full h-full">
|
||||
<tbl ref="table" class="w-full h-full" @info="info" @edit="edit" @add="add" />
|
||||
<div class="flex h-full w-full">
|
||||
<tbl ref="tableRef" class="h-full w-full" @add="openAdd" @edit="openEdit" @toggle="toggleActive" @delete="deleteItem" />
|
||||
|
||||
<!-- <BasicMenu :menu="menu" width="13rem" @onChange="tabSelected" />
|
||||
<component :is="selectedComponent" class="mr-5" />-->
|
||||
<!-- <BasicShowContext title="پروژه ها"> <Search /> </BasicShowContext>-->
|
||||
</div>
|
||||
<!-- </BasicMainCard>-->
|
||||
<!-- <BasicModal
|
||||
v-model:visible="addUserVisible"
|
||||
width="40rem"
|
||||
:title="`${editId ? 'ویرایش' : 'افزودن'} کاربر`"
|
||||
@ok="ok"
|
||||
<BasicActionSheet
|
||||
v-model:visible="editorVisible"
|
||||
:title="sheetTitle"
|
||||
modal-width="32rem"
|
||||
drawer-height="85vh"
|
||||
:loading="loading"
|
||||
@close="addUserVisible = false"
|
||||
>-->
|
||||
<!-- <a-form :model="form" ref="formRef" autocomplete="off">
|
||||
<div class="grid md:grid-cols-2 gap-4">
|
||||
<a-form-item label="نام" name="fname" :rules="inputRules()">
|
||||
<BasicInput v-model:value="form.fname" />
|
||||
</a-form-item>
|
||||
<a-form-item label="نام خانوادگی" name="lname" :rules="inputRules()">
|
||||
<BasicInput v-model:value="form.lname" />
|
||||
</a-form-item>
|
||||
<a-form-item label="شماره همراه" name="mobile" :rules="inputLenRules(11)">
|
||||
<BasicInput v-model:value="form.mobile" type="number" />
|
||||
</a-form-item>
|
||||
<a-form-item v-if="editId" label="رمز عبور" name="password">
|
||||
<BasicInput v-model:value="form.password" is-password type="number" />
|
||||
</a-form-item>
|
||||
<a-form-item v-if="editId" label="تکرار رمز عبور">
|
||||
<BasicInput v-model:value="form.repassword" is-password type="number" />
|
||||
</a-form-item>
|
||||
</div>
|
||||
</a-form>-->
|
||||
<!-- <BasicInfoModal
|
||||
v-model:visible="userInfoVisible"
|
||||
@close="userInfoVisible = false"
|
||||
:title="infoParams.title"
|
||||
:date="infoParams.date"
|
||||
:time="infoParams.time"
|
||||
:type="infoParams.type"
|
||||
itemsTitle="اطلاعات فردی"
|
||||
:name="infoParams.name"
|
||||
:items="infoParams.items"
|
||||
/>-->
|
||||
:show-button="true"
|
||||
:show-cancel="true"
|
||||
:show-ok="true"
|
||||
ok-text="ذخیره"
|
||||
cancel-text="انصراف"
|
||||
@ok="submitForm"
|
||||
@close="closeEditor"
|
||||
@cancel="closeEditor"
|
||||
>
|
||||
<div v-if="isMobile" class="mb-3 text-base font-bold">{{ sheetTitle }}</div>
|
||||
<PriceTriggerEditorFormBody
|
||||
ref="editorRef"
|
||||
:form="form"
|
||||
:customer-items="customerItems"
|
||||
:edit-id="editId"
|
||||
/>
|
||||
</BasicActionSheet>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// import BasicInfoModal from '@/components/BasicInfoModal'
|
||||
import { inputLenRules, inputRules } from '@/utils/inputRules'
|
||||
import { useStaticApiListsStore } from '@/store/staticApisStore'
|
||||
import type { Const } from '@/model/const'
|
||||
import type { User } from '@/model/user'
|
||||
import { createUser, deleteUser, updateUser } from '@/api/user'
|
||||
import { ref } from 'vue'
|
||||
import tbl from './components/table.vue'
|
||||
import type { FormInstance } from 'ant-design-vue'
|
||||
import BasicInfoModal from '@/components/BasicInfoModal/index.vue'
|
||||
import { message } from 'ant-design-vue/es'
|
||||
import type { Info } from '@/components/BasicInfoModal/model/Info'
|
||||
import { toJalaliNoTime, toTime } from '@core/utils/useDataTime'
|
||||
import { confirmDeleteItem } from '@/utils/confirmModal'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import type { Item } from '@/model/Item'
|
||||
import tbl from './components/table.vue'
|
||||
import BasicActionSheet from '@/components/BasicActionSheet.vue'
|
||||
import PriceTriggerEditorFormBody from './components/PriceTriggerEditorFormBody.vue'
|
||||
import type { PriceTriggers } from '@/model/priceTriggers'
|
||||
import type { Customer } from '@/model/customer'
|
||||
import { getCustomersList } from '@/api/customer'
|
||||
import {
|
||||
createPriceTrigger,
|
||||
deletePriceTrigger,
|
||||
togglePriceTriggerActive,
|
||||
updatePriceTrigger,
|
||||
} from '@/api/priceTriggers'
|
||||
import { confirmDeleteItem } from '@/utils/confirmModal'
|
||||
import { isMobile } from '@core/utils/is'
|
||||
|
||||
//loading
|
||||
const loading = ref<boolean>(false)
|
||||
const tableRef = ref<null | { fetch: () => void }>(null)
|
||||
const editorRef = ref<{
|
||||
validateFields?: () => Promise<unknown>
|
||||
resetFields?: () => void
|
||||
}>()
|
||||
|
||||
//define store
|
||||
const store = useStaticApiListsStore()
|
||||
const loading = ref(false)
|
||||
const editorVisible = ref(false)
|
||||
const editId = ref<number | undefined>()
|
||||
const customers = ref<Customer[]>([])
|
||||
|
||||
//define tbl
|
||||
const table = ref(null)
|
||||
const refreshTable = () => table?.value?.fetch()
|
||||
|
||||
let updateKey = ref<number>(0)
|
||||
|
||||
//role confirm items
|
||||
const confirmItems: Array<Item> = [
|
||||
{
|
||||
value: 'بله',
|
||||
key: true
|
||||
},
|
||||
{
|
||||
value: 'خیر',
|
||||
key: false
|
||||
}
|
||||
]
|
||||
|
||||
//form
|
||||
const form = ref<User>({
|
||||
active: true
|
||||
const defaultForm = (): Partial<PriceTriggers> => ({
|
||||
customer_id: undefined,
|
||||
target_price: undefined,
|
||||
price_condition: '>',
|
||||
action: 'sms',
|
||||
is_active: true,
|
||||
})
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
//info
|
||||
let infoParams = reactive<Info>({})
|
||||
const form = ref<Partial<PriceTriggers>>(defaultForm())
|
||||
|
||||
function info(val: User) {
|
||||
infoParams.name = val.name
|
||||
infoParams.type = val.mobile
|
||||
infoParams.date = toJalaliNoTime(val.created_at)
|
||||
infoParams.time = toTime(val.created_at)
|
||||
infoParams.itemsTitle = 'اطلاعات کاربری'
|
||||
infoParams.items = [
|
||||
{
|
||||
key: 'تلفن همراه',
|
||||
value: val.mobile ?? '-'
|
||||
},
|
||||
{
|
||||
key: 'کد کاربری',
|
||||
value: val.id ?? '-'
|
||||
}
|
||||
]
|
||||
userInfoVisible.value = true
|
||||
const sheetTitle = computed(() => (editId.value ? 'ویرایش هشدار قیمت' : 'افزودن هشدار قیمت'))
|
||||
|
||||
const customerItems = computed(() =>
|
||||
customers.value.map((customer) => ({
|
||||
id: customer.id,
|
||||
label: `${customer.name || 'بدون نام'} — ${customer.mobile || customer.id}`,
|
||||
}))
|
||||
)
|
||||
|
||||
function refreshTable() {
|
||||
tableRef.value?.fetch()
|
||||
}
|
||||
|
||||
//edit
|
||||
let editId: number | undefined = undefined
|
||||
|
||||
async function edit(record: User) {
|
||||
addUserVisible.value = true
|
||||
editId = record.id
|
||||
form.value = cloneDeep(record)
|
||||
function closeEditor() {
|
||||
editorVisible.value = false
|
||||
}
|
||||
|
||||
//add
|
||||
async function add() {
|
||||
loading.value = true
|
||||
editId = undefined
|
||||
// await store.getUsersList()
|
||||
addUserVisible.value = true
|
||||
updateKey.value++
|
||||
resetData()
|
||||
loading.value = false
|
||||
function openAdd() {
|
||||
editId.value = undefined
|
||||
form.value = defaultForm()
|
||||
editorRef.value?.resetFields?.()
|
||||
editorVisible.value = true
|
||||
}
|
||||
|
||||
//reset data
|
||||
const resetData = () => {
|
||||
formRef.value?.resetFields()
|
||||
form.value = {
|
||||
fname: '',
|
||||
lname: '',
|
||||
active: false,
|
||||
avatar_id: undefined,
|
||||
sts: undefined,
|
||||
id: undefined,
|
||||
mobile: undefined
|
||||
}
|
||||
function openEdit(record: PriceTriggers) {
|
||||
editId.value = record.id
|
||||
form.value = cloneDeep({
|
||||
customer_id: record.customer_id,
|
||||
target_price: record.target_price,
|
||||
price_condition: record.price_condition,
|
||||
action: record.action,
|
||||
is_active: record.is_active,
|
||||
})
|
||||
editorVisible.value = true
|
||||
}
|
||||
|
||||
//delete
|
||||
const deleteItem = (id: number) => confirmDeleteItem('کاربر', id, deleteUser, refreshTable)
|
||||
|
||||
/* Modal.confirm({
|
||||
title: 'آیا از حذف کاربر اطمینان دارید؟',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
okText: 'تایید',
|
||||
okType: 'danger',
|
||||
centered: true,
|
||||
cancelText: 'انصراف',
|
||||
async onOk() {
|
||||
// console.log('OK');
|
||||
await deleteItem(id)
|
||||
},
|
||||
onCancel() {
|
||||
console.log('Cancel')
|
||||
}
|
||||
})*/
|
||||
|
||||
/*async function deleteItem(id: number) {
|
||||
async function submitForm() {
|
||||
try {
|
||||
await editorRef.value?.validateFields?.()
|
||||
loading.value = true
|
||||
// table?.value?.spinTable(true)
|
||||
await deleteUser(id)
|
||||
message.success('با موفقیت حذف شد')
|
||||
table?.value?.fetch()
|
||||
|
||||
const payload = {
|
||||
customer_id: Number(form.value.customer_id),
|
||||
target_price: Number(form.value.target_price),
|
||||
price_condition: form.value.price_condition,
|
||||
action: form.value.action,
|
||||
is_active: Boolean(form.value.is_active),
|
||||
}
|
||||
|
||||
if (editId.value) {
|
||||
await updatePriceTrigger(editId.value, payload)
|
||||
} else {
|
||||
await createPriceTrigger(payload)
|
||||
}
|
||||
|
||||
message.success('هشدار با موفقیت ذخیره شد')
|
||||
editorVisible.value = false
|
||||
refreshTable()
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
message.error('خطا در حذف')
|
||||
console.error(e)
|
||||
} finally {
|
||||
loading.value = false
|
||||
// table?.value?.spinTable(false)
|
||||
}
|
||||
}*/
|
||||
|
||||
//define selects
|
||||
onMounted(async () => {
|
||||
loading.value = true
|
||||
// await getResponsible()
|
||||
// await getQC()
|
||||
// await getManager()
|
||||
loading.value = false
|
||||
})
|
||||
|
||||
interface selectsItem {
|
||||
responsibleItems: Array<User> | undefined
|
||||
users: Array<Const> | undefined
|
||||
}
|
||||
|
||||
//add project modal
|
||||
const addUserVisible = ref<boolean>(false)
|
||||
const userInfoVisible = ref<boolean>(false)
|
||||
async function toggleActive(record: PriceTriggers) {
|
||||
if (!record.id) return
|
||||
|
||||
//submit user
|
||||
async function ok() {
|
||||
formRef.value?.validateFields().then(async () => {
|
||||
// console.log('salam', form.value)
|
||||
// return
|
||||
try {
|
||||
loading.value = true
|
||||
try {
|
||||
if (editId) {
|
||||
if (form.value.password) {
|
||||
if (form.value.password === form.value.repassword) {
|
||||
await updateUser(editId, form.value)
|
||||
} else {
|
||||
message.error('پسورد وارد شده با تکرار پسورد وارد شده یکسان نیست')
|
||||
return
|
||||
}
|
||||
} else {
|
||||
await updateUser(editId, form.value)
|
||||
}
|
||||
} else {
|
||||
await createUser(form.value)
|
||||
}
|
||||
addUserVisible.value = false
|
||||
refreshTable()
|
||||
resetData()
|
||||
message.success('عملیات با موفقیت انجام شد')
|
||||
// await getResponsible()
|
||||
// await getQC()
|
||||
// await getManager()
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
// message.error('خطا در بارگذاری اطلاعات')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
await togglePriceTriggerActive(record.id)
|
||||
message.success(record.is_active ? 'هشدار غیرفعال شد' : 'هشدار فعال شد')
|
||||
refreshTable()
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
message.error('خطا در تغییر وضعیت')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
function deleteItem(id: number) {
|
||||
confirmDeleteItem('هشدار قیمت', id, deletePriceTrigger, refreshTable)
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
customers.value = (await getCustomersList()) ?? []
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user