summaryrefslogtreecommitdiff
path: root/src/services.js
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-03-14 13:47:56 +0300
committereug-vs <eug-vs@keemail.me>2021-03-14 13:47:56 +0300
commit296f43c5aef2a128defc3fe016c01f7d6455e6ba (patch)
treed90f67a1867529cb785ba2b0c3554ad5e63e8ceb /src/services.js
parent2ff20a6b93a92f0cac6b9f5584e81e39407e51c5 (diff)
downloadcommercel-ui-296f43c5aef2a128defc3fe016c01f7d6455e6ba.tar.gz
feat: enable transform of item fields
Diffstat (limited to 'src/services.js')
-rw-r--r--src/services.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/services.js b/src/services.js
index b9c2ecf..bebf07f 100644
--- a/src/services.js
+++ b/src/services.js
@@ -1,5 +1,17 @@
import { ServiceParams } from './containers/Service/ServiceContext';
+
+const waybillStatusNames = {
+ waiting: 'Ожидание',
+ executed: 'Проведена',
+ cancelled: 'Отменена',
+};
+
+const operationNames = {
+ in: 'Приход',
+ out: 'Расход',
+};
+
const services: ServiceParams[] = [
{
route: 'products',
@@ -36,10 +48,10 @@ const services: ServiceParams[] = [
name: 'Накладные',
nameSingular: 'Накладная',
tableFields: [
- { key: 'operation', label: 'Операция' },
+ { key: 'operation', label: 'Операция', transform: op => operationNames[op] },
{ key: 'product.name', label: 'Товар' },
{ key: 'contractor.name', label: 'Поставщик' },
- { key: 'status', label: 'Статус' },
+ { key: 'status', label: 'Статус', transform: status => waybillStatusNames[status] },
{ key: 'quantity', label: 'Количество' },
],
default: {