all customer fixing added
This commit is contained in:
@@ -113,47 +113,6 @@
|
||||
:color="record.trade_active === 1 ? '#54AD06' : '#ad0627'"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
:key="`co-${record.conditional_order_active}-${record.id}`"
|
||||
placement="bottom"
|
||||
class="cursor-pointer"
|
||||
@click="changeConditionalOrderActiveFunction(record.id)"
|
||||
>
|
||||
<template #title>
|
||||
<span>
|
||||
{{
|
||||
record.conditional_order_active
|
||||
? 'محدود کردن سفارش شرطی'
|
||||
: 'مجاز کردن سفارش شرطی'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
<Icon
|
||||
:icon="
|
||||
record.conditional_order_active
|
||||
? 'vuesax-linear:timer'
|
||||
: 'vuesax-linear:timer-pause'
|
||||
"
|
||||
:color="record.conditional_order_active ? '#54AD06' : '#ad0627'"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
placement="bottom"
|
||||
class="cursor-pointer"
|
||||
@click="openConditionalOrderLimit(record)"
|
||||
>
|
||||
<template #title>
|
||||
<span>
|
||||
سقف سفارش شرطی
|
||||
{{
|
||||
record.conditional_order_limit
|
||||
? `(${record.conditional_order_limit})`
|
||||
: '(نامحدود)'
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
<Icon icon="vuesax-linear:slider-horizontal" color="#4572E9" />
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="customerDirectSmsEnabled"
|
||||
placement="bottom"
|
||||
@@ -252,8 +211,6 @@ import {
|
||||
changeCustomerActivation,
|
||||
changeCustomerArchive,
|
||||
changeCustomerOrderActivation,
|
||||
changeCustomerConditionalOrderActive,
|
||||
updateCustomerConditionalOrderLimit,
|
||||
confirmUser,
|
||||
getCustomerTable
|
||||
} from '@/api/customer'
|
||||
@@ -427,49 +384,6 @@ async function changeCustomerOrderActivationFunction(id: number) {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function changeConditionalOrderActiveFunction(id: number) {
|
||||
try {
|
||||
loading.value = true
|
||||
await changeCustomerConditionalOrderActive(id)
|
||||
await fetch()
|
||||
message.success('مجوز سفارش شرطی بهروز شد')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function openConditionalOrderLimit(customer: Customer) {
|
||||
const current = customer.conditional_order_limit
|
||||
Modal.confirm({
|
||||
title: 'سقف تعداد سفارش شرطی',
|
||||
content: `برای «${customer.name || customer.id}» عدد سقف را وارد کنید (خالی = نامحدود). فعلی: ${
|
||||
current ? current : 'نامحدود'
|
||||
}`,
|
||||
okText: 'ذخیره',
|
||||
cancelText: 'انصراف',
|
||||
centered: true,
|
||||
zIndex: MODAL_ABOVE_ACTION_SHEET_Z_INDEX,
|
||||
onOk: async () => {
|
||||
const raw = window.prompt(
|
||||
'سقف تعداد تریگر pending (خالی = نامحدود):',
|
||||
current != null ? String(current) : ''
|
||||
)
|
||||
if (raw === null) return
|
||||
const trimmed = raw.trim()
|
||||
const limit = trimmed === '' ? null : Number(trimmed)
|
||||
if (limit !== null && (!Number.isFinite(limit) || limit < 1)) {
|
||||
message.error('عدد نامعتبر است')
|
||||
return Promise.reject()
|
||||
}
|
||||
await updateCustomerConditionalOrderLimit(customer.id, limit)
|
||||
await fetch()
|
||||
message.success('سقف سفارش شرطی ذخیره شد')
|
||||
},
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
Reference in New Issue
Block a user