@things-factory/operato-pms 3.8.0 → 3.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/bootstrap.js +20 -7
- package/client/component/block-selector-popup.js +125 -24
- package/client/component/driver-selector-popup.js +223 -0
- package/client/component/mill-selector-popup.js +200 -0
- package/client/component/tracked-plantation-setting.js +113 -0
- package/client/component/truck-selector-popup.js +202 -0
- package/client/menu.js +34 -2
- package/client/pages/constants/index.js +1 -0
- package/client/pages/constants/organization.js +5 -0
- package/client/pages/dispatchment/daily-dispatch-detail.js +57 -18
- package/client/pages/dispatchment/dispatchment-create-record.js +140 -13
- package/client/pages/dispatchment/dispatchment-list.js +26 -34
- package/client/pages/harvesting/daily-harvesting-detail.js +55 -18
- package/client/pages/harvesting/edit-harvesting-record.js +89 -23
- package/client/pages/harvesting/harvesting-create-record.js +102 -16
- package/client/pages/harvesting/harvesting-list.js +58 -12
- package/client/pages/inventory/inventory-field-bunches.js +6 -4
- package/client/pages/loading/daily-loading-detail.js +47 -93
- package/client/pages/loading/edit-loading-record.js +75 -294
- package/client/pages/loading/loading-create-record.js +52 -329
- package/client/pages/loading/loading-list.js +20 -83
- package/client/pages/master/block.js +1 -0
- package/client/pages/master/company.js +26 -13
- package/client/pages/master/home.js +67 -65
- package/client/pages/master/ramp.js +1 -0
- package/client/pages/master/staff.js +54 -3
- package/client/pages/master/truck.js +416 -0
- package/client/pages/report/home.js +72 -65
- package/client/pages/report/report-daily-ffb-dispatch-and-production.js +393 -0
- package/client/pages/report/report-daily-production.js +38 -6
- package/client/pages/report/report-daily-staff-harvest.js +50 -5
- package/client/pages/report/report-ffb-tonnage-between-individual-block.js +393 -0
- package/client/pages/report/report-monthly-ffb-sale.js +413 -0
- package/client/pages/report/report-monthly-production.js +33 -4
- package/client/pages/report/report-yearly-production.js +24 -8
- package/client/pages/setting/home.js +107 -0
- package/client/pages/setting/plantation-setting.js +109 -0
- package/client/route.js +25 -0
- package/dist-server/constants/index.js +1 -0
- package/dist-server/constants/index.js.map +1 -1
- package/dist-server/constants/organization.js +9 -0
- package/dist-server/constants/organization.js.map +1 -0
- package/dist-server/controllers/render-dispatchment.js +1 -1
- package/dist-server/controllers/render-dispatchment.js.map +1 -1
- package/dist-server/entities/daily-dispatch.js +19 -4
- package/dist-server/entities/daily-dispatch.js.map +1 -1
- package/dist-server/entities/daily-harvest-detail.js +9 -11
- package/dist-server/entities/daily-harvest-detail.js.map +1 -1
- package/dist-server/entities/daily-harvest.js +16 -6
- package/dist-server/entities/daily-harvest.js.map +1 -1
- package/dist-server/entities/daily-loading-detail.js +14 -6
- package/dist-server/entities/daily-loading-detail.js.map +1 -1
- package/dist-server/entities/daily-loading.js +3 -11
- package/dist-server/entities/daily-loading.js.map +1 -1
- package/dist-server/entities/index.js +7 -1
- package/dist-server/entities/index.js.map +1 -1
- package/dist-server/entities/organization-staff.js +5 -1
- package/dist-server/entities/organization-staff.js.map +1 -1
- package/dist-server/entities/plantation-inventory.js +4 -10
- package/dist-server/entities/plantation-inventory.js.map +1 -1
- package/dist-server/entities/plantation-setting.js +76 -0
- package/dist-server/entities/plantation-setting.js.map +1 -0
- package/dist-server/entities/truck.js +77 -0
- package/dist-server/entities/truck.js.map +1 -0
- package/dist-server/graphql/resolvers/daily-dispatch/daily-dispatch-query.js +13 -2
- package/dist-server/graphql/resolvers/daily-dispatch/daily-dispatch-query.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-dispatch/generate-daily-dispatch.js +25 -11
- package/dist-server/graphql/resolvers/daily-dispatch/generate-daily-dispatch.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-dispatch/update-daily-dispatch.js +3 -2
- package/dist-server/graphql/resolvers/daily-dispatch/update-daily-dispatch.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-harvest/daily-harvest-query.js +3 -1
- package/dist-server/graphql/resolvers/daily-harvest/daily-harvest-query.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-harvest/generate-daily-harvest.js +21 -2
- package/dist-server/graphql/resolvers/daily-harvest/generate-daily-harvest.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-harvest/update-daily-harvest.js +8 -2
- package/dist-server/graphql/resolvers/daily-harvest/update-daily-harvest.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-loading/daily-loading-query.js +4 -6
- package/dist-server/graphql/resolvers/daily-loading/daily-loading-query.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-loading/generate-daily-loading.js +20 -54
- package/dist-server/graphql/resolvers/daily-loading/generate-daily-loading.js.map +1 -1
- package/dist-server/graphql/resolvers/daily-loading/update-daily-loading.js +17 -105
- package/dist-server/graphql/resolvers/daily-loading/update-daily-loading.js.map +1 -1
- package/dist-server/graphql/resolvers/dashboard/dashboard-query.js +82 -0
- package/dist-server/graphql/resolvers/dashboard/dashboard-query.js.map +1 -0
- package/dist-server/graphql/resolvers/dashboard/index.js +8 -0
- package/dist-server/graphql/resolvers/dashboard/index.js.map +1 -0
- package/dist-server/graphql/resolvers/index.js +9 -6
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/resolvers/organization-staff/organization-staff-query.js +7 -3
- package/dist-server/graphql/resolvers/organization-staff/organization-staff-query.js.map +1 -1
- package/dist-server/graphql/resolvers/plantation-setting/create-plantation-setting.js +12 -0
- package/dist-server/graphql/resolvers/plantation-setting/create-plantation-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/plantation-setting/delete-plantation-setting.js +13 -0
- package/dist-server/graphql/resolvers/plantation-setting/delete-plantation-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/plantation-setting/delete-plantation-settings.js +16 -0
- package/dist-server/graphql/resolvers/plantation-setting/delete-plantation-settings.js.map +1 -0
- package/dist-server/graphql/resolvers/plantation-setting/index.js +15 -0
- package/dist-server/graphql/resolvers/plantation-setting/index.js.map +1 -0
- package/dist-server/graphql/resolvers/plantation-setting/plantation-setting-query.js +33 -0
- package/dist-server/graphql/resolvers/plantation-setting/plantation-setting-query.js.map +1 -0
- package/dist-server/graphql/resolvers/plantation-setting/update-multiple-plantation-setting.js +31 -0
- package/dist-server/graphql/resolvers/plantation-setting/update-multiple-plantation-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/plantation-setting/update-plantation-setting.js +16 -0
- package/dist-server/graphql/resolvers/plantation-setting/update-plantation-setting.js.map +1 -0
- package/dist-server/graphql/resolvers/report/daily-production-reports.js +46 -33
- package/dist-server/graphql/resolvers/report/daily-production-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/report/daily-staff-harvest-reports.js +21 -10
- package/dist-server/graphql/resolvers/report/daily-staff-harvest-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/report/index.js +4 -1
- package/dist-server/graphql/resolvers/report/index.js.map +1 -1
- package/dist-server/graphql/resolvers/report/monthly-block-dispatch-reports.js +89 -0
- package/dist-server/graphql/resolvers/report/monthly-block-dispatch-reports.js.map +1 -0
- package/dist-server/graphql/resolvers/report/monthly-dispatch-summary-reports.js +89 -0
- package/dist-server/graphql/resolvers/report/monthly-dispatch-summary-reports.js.map +1 -0
- package/dist-server/graphql/resolvers/report/monthly-ffb-sale-reports.js +87 -0
- package/dist-server/graphql/resolvers/report/monthly-ffb-sale-reports.js.map +1 -0
- package/dist-server/graphql/resolvers/report/monthly-production-reports.js +46 -31
- package/dist-server/graphql/resolvers/report/monthly-production-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/report/yearly-production-reports.js +38 -28
- package/dist-server/graphql/resolvers/report/yearly-production-reports.js.map +1 -1
- package/dist-server/graphql/resolvers/truck/delete-trucks.js +18 -0
- package/dist-server/graphql/resolvers/truck/delete-trucks.js.map +1 -0
- package/dist-server/graphql/resolvers/truck/index.js +12 -0
- package/dist-server/graphql/resolvers/truck/index.js.map +1 -0
- package/dist-server/graphql/resolvers/truck/truck-query.js +46 -0
- package/dist-server/graphql/resolvers/truck/truck-query.js.map +1 -0
- package/dist-server/graphql/resolvers/truck/update-multiple-truck.js +40 -0
- package/dist-server/graphql/resolvers/truck/update-multiple-truck.js.map +1 -0
- package/dist-server/graphql/types/daily-dispatch/daily-dispatch-patch.js +4 -1
- package/dist-server/graphql/types/daily-dispatch/daily-dispatch-patch.js.map +1 -1
- package/dist-server/graphql/types/daily-dispatch/daily-dispatch.js +4 -1
- package/dist-server/graphql/types/daily-dispatch/daily-dispatch.js.map +1 -1
- package/dist-server/graphql/types/daily-dispatch/index.js +6 -1
- package/dist-server/graphql/types/daily-dispatch/index.js.map +1 -1
- package/dist-server/graphql/types/daily-dispatch/new-daily-dispatch.js +4 -1
- package/dist-server/graphql/types/daily-dispatch/new-daily-dispatch.js.map +1 -1
- package/dist-server/graphql/types/daily-harvest/daily-harvest-patch.js +5 -2
- package/dist-server/graphql/types/daily-harvest/daily-harvest-patch.js.map +1 -1
- package/dist-server/graphql/types/daily-harvest/daily-harvest.js +3 -0
- package/dist-server/graphql/types/daily-harvest/daily-harvest.js.map +1 -1
- package/dist-server/graphql/types/daily-harvest/new-daily-harvest.js +4 -1
- package/dist-server/graphql/types/daily-harvest/new-daily-harvest.js.map +1 -1
- package/dist-server/graphql/types/daily-harvest-detail/daily-harvest-detail-patch.js +1 -0
- package/dist-server/graphql/types/daily-harvest-detail/daily-harvest-detail-patch.js.map +1 -1
- package/dist-server/graphql/types/daily-harvest-detail/daily-harvest-detail.js +1 -0
- package/dist-server/graphql/types/daily-harvest-detail/daily-harvest-detail.js.map +1 -1
- package/dist-server/graphql/types/daily-harvest-detail/new-daily-harvest-detail.js +1 -0
- package/dist-server/graphql/types/daily-harvest-detail/new-daily-harvest-detail.js.map +1 -1
- package/dist-server/graphql/types/daily-loading/daily-loading-patch.js +0 -2
- package/dist-server/graphql/types/daily-loading/daily-loading-patch.js.map +1 -1
- package/dist-server/graphql/types/daily-loading/daily-loading.js +0 -2
- package/dist-server/graphql/types/daily-loading/daily-loading.js.map +1 -1
- package/dist-server/graphql/types/daily-loading/new-daily-loading.js +0 -2
- package/dist-server/graphql/types/daily-loading/new-daily-loading.js.map +1 -1
- package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail-patch.js +6 -3
- package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail-patch.js.map +1 -1
- package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail.js +3 -0
- package/dist-server/graphql/types/daily-loading-detail/daily-loading-detail.js.map +1 -1
- package/dist-server/graphql/types/daily-loading-detail/new-daily-loading-detail.js +6 -3
- package/dist-server/graphql/types/daily-loading-detail/new-daily-loading-detail.js.map +1 -1
- package/dist-server/graphql/types/dashboard/bunches-count.js +15 -0
- package/dist-server/graphql/types/dashboard/bunches-count.js.map +1 -0
- package/dist-server/graphql/types/dashboard/index.js +32 -0
- package/dist-server/graphql/types/dashboard/index.js.map +1 -0
- package/dist-server/graphql/types/dashboard/productions-overview.js +15 -0
- package/dist-server/graphql/types/dashboard/productions-overview.js.map +1 -0
- package/dist-server/graphql/types/dashboard/tonnage-bunches-inventories.js +14 -0
- package/dist-server/graphql/types/dashboard/tonnage-bunches-inventories.js.map +1 -0
- package/dist-server/graphql/types/dashboard/tonnage-production.js +17 -0
- package/dist-server/graphql/types/dashboard/tonnage-production.js.map +1 -0
- package/dist-server/graphql/types/dashboard/yield-production.js +17 -0
- package/dist-server/graphql/types/dashboard/yield-production.js.map +1 -0
- package/dist-server/graphql/types/index.js +9 -6
- package/dist-server/graphql/types/index.js.map +1 -1
- package/dist-server/graphql/types/organization-staff/organization-staff-patch.js +2 -0
- package/dist-server/graphql/types/organization-staff/organization-staff-patch.js.map +1 -1
- package/dist-server/graphql/types/organization-staff/organization-staff.js +3 -0
- package/dist-server/graphql/types/organization-staff/organization-staff.js.map +1 -1
- package/dist-server/graphql/types/plantation-setting/index.js +36 -0
- package/dist-server/graphql/types/plantation-setting/index.js.map +1 -0
- package/dist-server/graphql/types/plantation-setting/new-plantation-setting.js +16 -0
- package/dist-server/graphql/types/plantation-setting/new-plantation-setting.js.map +1 -0
- package/dist-server/graphql/types/plantation-setting/plantation-setting-list.js +14 -0
- package/dist-server/graphql/types/plantation-setting/plantation-setting-list.js.map +1 -0
- package/dist-server/graphql/types/plantation-setting/plantation-setting-patch.js +18 -0
- package/dist-server/graphql/types/plantation-setting/plantation-setting-patch.js.map +1 -0
- package/dist-server/graphql/types/plantation-setting/plantation-setting.js +22 -0
- package/dist-server/graphql/types/plantation-setting/plantation-setting.js.map +1 -0
- package/dist-server/graphql/types/report/index.js +20 -0
- package/dist-server/graphql/types/report/index.js.map +1 -1
- package/dist-server/graphql/types/report/monthly-block-dispatch-report-list.js +14 -0
- package/dist-server/graphql/types/report/monthly-block-dispatch-report-list.js.map +1 -0
- package/dist-server/graphql/types/report/monthly-block-dispatch-report.js +19 -0
- package/dist-server/graphql/types/report/monthly-block-dispatch-report.js.map +1 -0
- package/dist-server/graphql/types/report/monthly-dispatch-summary-report-list.js +14 -0
- package/dist-server/graphql/types/report/monthly-dispatch-summary-report-list.js.map +1 -0
- package/dist-server/graphql/types/report/monthly-dispatch-summary-report.js +25 -0
- package/dist-server/graphql/types/report/monthly-dispatch-summary-report.js.map +1 -0
- package/dist-server/graphql/types/report/monthly-ffb-sale-report-list.js +14 -0
- package/dist-server/graphql/types/report/monthly-ffb-sale-report-list.js.map +1 -0
- package/dist-server/graphql/types/report/monthly-ffb-sale-report.js +24 -0
- package/dist-server/graphql/types/report/monthly-ffb-sale-report.js.map +1 -0
- package/dist-server/graphql/types/truck/index.js +33 -0
- package/dist-server/graphql/types/truck/index.js.map +1 -0
- package/dist-server/graphql/types/truck/new-truck.js +14 -0
- package/dist-server/graphql/types/truck/new-truck.js.map +1 -0
- package/dist-server/graphql/types/truck/truck-list.js +14 -0
- package/dist-server/graphql/types/truck/truck-list.js.map +1 -0
- package/dist-server/graphql/types/truck/truck-patch.js +17 -0
- package/dist-server/graphql/types/truck/truck-patch.js.map +1 -0
- package/dist-server/graphql/types/truck/truck.js +22 -0
- package/dist-server/graphql/types/truck/truck.js.map +1 -0
- package/package.json +2 -2
- package/server/constants/index.ts +1 -0
- package/server/constants/organization.ts +5 -0
- package/server/controllers/render-dispatchment.ts +1 -1
- package/server/entities/daily-dispatch.ts +21 -5
- package/server/entities/daily-harvest-detail.ts +10 -11
- package/server/entities/daily-harvest.ts +16 -7
- package/server/entities/daily-loading-detail.ts +14 -6
- package/server/entities/daily-loading.ts +7 -11
- package/server/entities/index.ts +6 -0
- package/server/entities/organization-staff.ts +6 -1
- package/server/entities/plantation-inventory.ts +6 -10
- package/server/entities/plantation-setting.ts +60 -0
- package/server/entities/truck.ts +58 -0
- package/server/graphql/resolvers/daily-dispatch/daily-dispatch-query.ts +15 -2
- package/server/graphql/resolvers/daily-dispatch/generate-daily-dispatch.ts +40 -14
- package/server/graphql/resolvers/daily-dispatch/update-daily-dispatch.ts +6 -2
- package/server/graphql/resolvers/daily-harvest/daily-harvest-query.ts +7 -2
- package/server/graphql/resolvers/daily-harvest/generate-daily-harvest.ts +50 -4
- package/server/graphql/resolvers/daily-harvest/update-daily-harvest.ts +12 -2
- package/server/graphql/resolvers/daily-loading/daily-loading-query.ts +6 -6
- package/server/graphql/resolvers/daily-loading/generate-daily-loading.ts +27 -109
- package/server/graphql/resolvers/daily-loading/update-daily-loading.ts +27 -213
- package/server/graphql/resolvers/dashboard/dashboard-query.ts +96 -0
- package/server/graphql/resolvers/dashboard/index.ts +5 -0
- package/server/graphql/resolvers/index.ts +10 -6
- package/server/graphql/resolvers/organization-staff/organization-staff-query.ts +13 -4
- package/server/graphql/resolvers/plantation-setting/create-plantation-setting.ts +16 -0
- package/server/graphql/resolvers/plantation-setting/delete-plantation-setting.ts +13 -0
- package/server/graphql/resolvers/plantation-setting/delete-plantation-settings.ts +16 -0
- package/server/graphql/resolvers/plantation-setting/index.ts +19 -0
- package/server/graphql/resolvers/plantation-setting/plantation-setting-query.ts +38 -0
- package/server/graphql/resolvers/plantation-setting/update-multiple-plantation-setting.ts +46 -0
- package/server/graphql/resolvers/plantation-setting/update-plantation-setting.ts +19 -0
- package/server/graphql/resolvers/report/daily-production-reports.ts +55 -44
- package/server/graphql/resolvers/report/daily-staff-harvest-reports.ts +28 -20
- package/server/graphql/resolvers/report/index.ts +7 -1
- package/server/graphql/resolvers/report/monthly-block-dispatch-reports.ts +112 -0
- package/server/graphql/resolvers/report/monthly-dispatch-summary-reports.ts +110 -0
- package/server/graphql/resolvers/report/monthly-ffb-sale-reports.ts +107 -0
- package/server/graphql/resolvers/report/monthly-production-reports.ts +54 -40
- package/server/graphql/resolvers/report/yearly-production-reports.ts +43 -38
- package/server/graphql/resolvers/truck/delete-trucks.ts +21 -0
- package/server/graphql/resolvers/truck/index.ts +12 -0
- package/server/graphql/resolvers/truck/truck-query.ts +52 -0
- package/server/graphql/resolvers/truck/update-multiple-truck.ts +55 -0
- package/server/graphql/types/daily-dispatch/daily-dispatch-patch.ts +4 -1
- package/server/graphql/types/daily-dispatch/daily-dispatch.ts +4 -1
- package/server/graphql/types/daily-dispatch/index.ts +6 -1
- package/server/graphql/types/daily-dispatch/new-daily-dispatch.ts +4 -1
- package/server/graphql/types/daily-harvest/daily-harvest-patch.ts +5 -2
- package/server/graphql/types/daily-harvest/daily-harvest.ts +3 -0
- package/server/graphql/types/daily-harvest/new-daily-harvest.ts +4 -1
- package/server/graphql/types/daily-harvest-detail/daily-harvest-detail-patch.ts +1 -0
- package/server/graphql/types/daily-harvest-detail/daily-harvest-detail.ts +1 -0
- package/server/graphql/types/daily-harvest-detail/new-daily-harvest-detail.ts +1 -0
- package/server/graphql/types/daily-loading/daily-loading-patch.ts +0 -2
- package/server/graphql/types/daily-loading/daily-loading.ts +0 -2
- package/server/graphql/types/daily-loading/new-daily-loading.ts +0 -2
- package/server/graphql/types/daily-loading-detail/daily-loading-detail-patch.ts +6 -3
- package/server/graphql/types/daily-loading-detail/daily-loading-detail.ts +3 -0
- package/server/graphql/types/daily-loading-detail/new-daily-loading-detail.ts +6 -3
- package/server/graphql/types/dashboard/bunches-count.ts +9 -0
- package/server/graphql/types/dashboard/index.ts +17 -0
- package/server/graphql/types/dashboard/productions-overview.ts +9 -0
- package/server/graphql/types/dashboard/tonnage-bunches-inventories.ts +8 -0
- package/server/graphql/types/dashboard/tonnage-production.ts +11 -0
- package/server/graphql/types/dashboard/yield-production.ts +11 -0
- package/server/graphql/types/index.ts +10 -6
- package/server/graphql/types/organization-staff/organization-staff-patch.ts +2 -0
- package/server/graphql/types/organization-staff/organization-staff.ts +3 -0
- package/server/graphql/types/plantation-setting/index.ts +21 -0
- package/server/graphql/types/plantation-setting/new-plantation-setting.ts +10 -0
- package/server/graphql/types/plantation-setting/plantation-setting-list.ts +8 -0
- package/server/graphql/types/plantation-setting/plantation-setting-patch.ts +12 -0
- package/server/graphql/types/plantation-setting/plantation-setting.ts +16 -0
- package/server/graphql/types/report/index.ts +20 -0
- package/server/graphql/types/report/monthly-block-dispatch-report-list.ts +7 -0
- package/server/graphql/types/report/monthly-block-dispatch-report.ts +13 -0
- package/server/graphql/types/report/monthly-dispatch-summary-report-list.ts +7 -0
- package/server/graphql/types/report/monthly-dispatch-summary-report.ts +19 -0
- package/server/graphql/types/report/monthly-ffb-sale-report-list.ts +7 -0
- package/server/graphql/types/report/monthly-ffb-sale-report.ts +18 -0
- package/server/graphql/types/truck/index.ts +18 -0
- package/server/graphql/types/truck/new-truck.ts +8 -0
- package/server/graphql/types/truck/truck-list.ts +8 -0
- package/server/graphql/types/truck/truck-patch.ts +11 -0
- package/server/graphql/types/truck/truck.ts +16 -0
- package/things-factory.config.js +27 -1
- package/translations/en.json +78 -16
- package/translations/ko.json +77 -48
- package/translations/ms.json +74 -45
- package/translations/zh.json +77 -48
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import '@things-factory/form-ui'
|
|
2
|
+
import '@things-factory/grist-ui'
|
|
3
|
+
|
|
4
|
+
import gql from 'graphql-tag'
|
|
5
|
+
import { css, html } from 'lit-element'
|
|
6
|
+
import { connect } from 'pwa-helpers/connect-mixin'
|
|
7
|
+
|
|
8
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
9
|
+
import { client, PageView, store } from '@things-factory/shell'
|
|
10
|
+
import { isMobileDevice } from '@things-factory/utils'
|
|
11
|
+
|
|
12
|
+
class ReportMonthlyFfbSale extends connect(store)(localize(i18next)(PageView)) {
|
|
13
|
+
static get styles() {
|
|
14
|
+
return css`
|
|
15
|
+
:host {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
data-grist {
|
|
22
|
+
overflow-y: auto;
|
|
23
|
+
flex: 1;
|
|
24
|
+
}
|
|
25
|
+
`
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static get properties() {
|
|
29
|
+
return {
|
|
30
|
+
_searchFields: Object,
|
|
31
|
+
_config: Object,
|
|
32
|
+
_gristData: Object,
|
|
33
|
+
_mill: String,
|
|
34
|
+
_month: String,
|
|
35
|
+
data: Object
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get context() {
|
|
40
|
+
let fileName = `${i18next.t('title.monthly_ffb_sale_report')} (${this._mill} ${this._month})`
|
|
41
|
+
return {
|
|
42
|
+
title: i18next.t('title.monthly_ffb_sale_report'),
|
|
43
|
+
printable: {
|
|
44
|
+
accept: ['preview'],
|
|
45
|
+
content: this
|
|
46
|
+
},
|
|
47
|
+
exportable: {
|
|
48
|
+
name: fileName,
|
|
49
|
+
data: this._exportableData.bind(this)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
get dataGrist() {
|
|
55
|
+
return this.shadowRoot.querySelector('data-grist')
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get searchForm() {
|
|
59
|
+
return this.shadowRoot.querySelector('search-form')
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get _millSelector() {
|
|
63
|
+
return this.searchForm.shadowRoot.querySelector('select[name=organization]')
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
get _monthInput() {
|
|
67
|
+
return this.searchForm.shadowRoot.querySelector('input[name=month]')
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
constructor() {
|
|
71
|
+
super()
|
|
72
|
+
this._mill = ''
|
|
73
|
+
this._month = ''
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
render() {
|
|
77
|
+
return html`
|
|
78
|
+
<search-form id="search-form" .fields=${this._searchFields} @submit=${e => this.dataGrist.fetch()}></search-form>
|
|
79
|
+
|
|
80
|
+
<data-grist
|
|
81
|
+
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
|
82
|
+
.config=${this._config}
|
|
83
|
+
.fetchHandler="${this.fetchHandler.bind(this)}"
|
|
84
|
+
></data-grist>
|
|
85
|
+
`
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
get searchFields() {
|
|
89
|
+
return [
|
|
90
|
+
{
|
|
91
|
+
label: i18next.t('field.mill'),
|
|
92
|
+
name: 'organization',
|
|
93
|
+
type: 'select',
|
|
94
|
+
options: [
|
|
95
|
+
{ name: 'All', value: '' },
|
|
96
|
+
{ name: 'UNKNOWN', value: 'null' },
|
|
97
|
+
...this._mills
|
|
98
|
+
.map(mill => {
|
|
99
|
+
return {
|
|
100
|
+
name: mill.name,
|
|
101
|
+
value: mill.id
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
.sort(this._compareValues('name', 'asc'))
|
|
105
|
+
],
|
|
106
|
+
props: { searchOper: 'eq' },
|
|
107
|
+
handlers: { change: this._submit.bind(this) }
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
label: i18next.t('field.month'),
|
|
111
|
+
name: 'month',
|
|
112
|
+
type: 'month',
|
|
113
|
+
props: {
|
|
114
|
+
searchOper: 'eq',
|
|
115
|
+
min: '2019-01'
|
|
116
|
+
},
|
|
117
|
+
value: this._monthSearch,
|
|
118
|
+
handlers: { change: this._submit.bind(this) }
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
get reportConfig() {
|
|
124
|
+
return {
|
|
125
|
+
pagination: { infinite: true },
|
|
126
|
+
rows: {
|
|
127
|
+
selectable: false,
|
|
128
|
+
insertable: false,
|
|
129
|
+
appendable: false
|
|
130
|
+
},
|
|
131
|
+
columns: [
|
|
132
|
+
{
|
|
133
|
+
type: 'string',
|
|
134
|
+
name: 'dispatchAt',
|
|
135
|
+
header: i18next.t('field.date'),
|
|
136
|
+
record: { editable: false, align: 'left' },
|
|
137
|
+
imex: {
|
|
138
|
+
header: i18next.t('field.date'),
|
|
139
|
+
key: 'dispatchAt',
|
|
140
|
+
width: 20,
|
|
141
|
+
type: 'string'
|
|
142
|
+
},
|
|
143
|
+
width: 120
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
type: 'string',
|
|
147
|
+
name: 'dispatchTo',
|
|
148
|
+
header: i18next.t('field.mill'),
|
|
149
|
+
record: { editable: false, align: 'left' },
|
|
150
|
+
imex: {
|
|
151
|
+
header: i18next.t('field.mill'),
|
|
152
|
+
key: 'dispatchTo',
|
|
153
|
+
width: 50,
|
|
154
|
+
type: 'string'
|
|
155
|
+
},
|
|
156
|
+
width: 200
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
type: 'string',
|
|
160
|
+
name: 'lorryNo',
|
|
161
|
+
header: i18next.t('field.lorry_no'),
|
|
162
|
+
record: { editable: false, align: 'left' },
|
|
163
|
+
imex: {
|
|
164
|
+
header: i18next.t('field.lorry_no'),
|
|
165
|
+
key: 'lorryNo',
|
|
166
|
+
width: 50,
|
|
167
|
+
type: 'string'
|
|
168
|
+
},
|
|
169
|
+
width: 200
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
type: 'string',
|
|
173
|
+
name: 'chitNo',
|
|
174
|
+
header: i18next.t('field.chit_no'),
|
|
175
|
+
record: { editable: false, align: 'left' },
|
|
176
|
+
imex: {
|
|
177
|
+
header: i18next.t('field.chit_no'),
|
|
178
|
+
key: 'chitNo',
|
|
179
|
+
width: 50,
|
|
180
|
+
type: 'string'
|
|
181
|
+
},
|
|
182
|
+
width: 200
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: 'string',
|
|
186
|
+
name: 'tonnage',
|
|
187
|
+
header: i18next.t('field.tonnage'),
|
|
188
|
+
record: { editable: false, align: 'center' },
|
|
189
|
+
imex: {
|
|
190
|
+
header: i18next.t('field.tonnage'),
|
|
191
|
+
key: 'tonnage',
|
|
192
|
+
width: 30,
|
|
193
|
+
type: 'string'
|
|
194
|
+
},
|
|
195
|
+
width: 120
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
type: 'string',
|
|
199
|
+
name: 'today',
|
|
200
|
+
header: i18next.t('field.today'),
|
|
201
|
+
record: { editable: false, align: 'center' },
|
|
202
|
+
imex: {
|
|
203
|
+
header: i18next.t('field.today'),
|
|
204
|
+
key: 'today',
|
|
205
|
+
width: 30,
|
|
206
|
+
type: 'string'
|
|
207
|
+
},
|
|
208
|
+
width: 120
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
type: 'string',
|
|
212
|
+
name: 'todate',
|
|
213
|
+
header: i18next.t('field.to_date'),
|
|
214
|
+
record: { editable: false, align: 'center' },
|
|
215
|
+
imex: {
|
|
216
|
+
header: i18next.t('field.to_date'),
|
|
217
|
+
key: 'todate',
|
|
218
|
+
width: 30,
|
|
219
|
+
type: 'string'
|
|
220
|
+
},
|
|
221
|
+
width: 120
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
type: 'string',
|
|
225
|
+
name: 'percentage',
|
|
226
|
+
header: i18next.t('field.percents'),
|
|
227
|
+
record: { editable: false, align: 'center' },
|
|
228
|
+
imex: {
|
|
229
|
+
header: i18next.t('field.percents'),
|
|
230
|
+
key: 'percentage',
|
|
231
|
+
width: 30,
|
|
232
|
+
type: 'string'
|
|
233
|
+
},
|
|
234
|
+
width: 120
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
type: 'string',
|
|
238
|
+
name: 'todateAvg',
|
|
239
|
+
header: i18next.t('field.avg'),
|
|
240
|
+
record: { editable: false, align: 'center' },
|
|
241
|
+
imex: {
|
|
242
|
+
header: i18next.t('field.avg'),
|
|
243
|
+
key: 'todateAvg',
|
|
244
|
+
width: 30,
|
|
245
|
+
type: 'string'
|
|
246
|
+
},
|
|
247
|
+
width: 120
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
async pageInitialized() {
|
|
254
|
+
let date = new Date()
|
|
255
|
+
this._monthSearch = date.getFullYear().toString() + '-' + (date.getMonth() + 1).toString().padStart(2, 0)
|
|
256
|
+
this._mills = [...(await this._fetchMills())]
|
|
257
|
+
this._gristData = { total: 0, records: [] }
|
|
258
|
+
this._searchFields = this.searchFields
|
|
259
|
+
this._config = this.reportConfig
|
|
260
|
+
|
|
261
|
+
// this._updateGrist()
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
async pageUpdated(changes, lifecycle) {
|
|
265
|
+
if (this.active) {
|
|
266
|
+
this.dataGrist.fetch()
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
async fetchHandler({ page, limit, sorters = [] }) {
|
|
271
|
+
const monthNames = [
|
|
272
|
+
'January',
|
|
273
|
+
'February',
|
|
274
|
+
'March',
|
|
275
|
+
'April',
|
|
276
|
+
'May',
|
|
277
|
+
'June',
|
|
278
|
+
'July',
|
|
279
|
+
'August',
|
|
280
|
+
'September',
|
|
281
|
+
'October',
|
|
282
|
+
'November',
|
|
283
|
+
'December'
|
|
284
|
+
]
|
|
285
|
+
|
|
286
|
+
try {
|
|
287
|
+
const filters = this.searchForm.queryFilters
|
|
288
|
+
const pagination = { page, limit }
|
|
289
|
+
const sortings = sorters
|
|
290
|
+
|
|
291
|
+
this._validate()
|
|
292
|
+
const response = await client.query({
|
|
293
|
+
query: gql`
|
|
294
|
+
query monthlyFfbSaleReports($filters: [Filter], $pagination: Pagination, $sortings: [Sorting]) {
|
|
295
|
+
monthlyFfbSaleReports(filters: $filters, pagination: $pagination, sortings: $sortings) {
|
|
296
|
+
items {
|
|
297
|
+
id
|
|
298
|
+
dispatchAt
|
|
299
|
+
dispatchTo
|
|
300
|
+
lorryNo
|
|
301
|
+
driverIdentification
|
|
302
|
+
chitNo
|
|
303
|
+
percentage
|
|
304
|
+
dispatchTo
|
|
305
|
+
tonnage
|
|
306
|
+
todayAvg
|
|
307
|
+
todateAvg
|
|
308
|
+
today
|
|
309
|
+
todate
|
|
310
|
+
}
|
|
311
|
+
total
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
`,
|
|
315
|
+
variables: { filters, pagination, sortings }
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
const data = {
|
|
319
|
+
// records: this._dataMassage(response.data.dailyStaffHarvestReports.items) || [],
|
|
320
|
+
records: response.data.monthlyFfbSaleReports.items || [],
|
|
321
|
+
total: response.data.monthlyFfbSaleReports.total
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
this._gristData = {
|
|
325
|
+
...data
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
let selectedDate = this._monthInput.valueAsDate
|
|
329
|
+
|
|
330
|
+
this._mill = this._millSelector.options[this._millSelector.selectedIndex].text
|
|
331
|
+
this._month = `${monthNames[selectedDate.getMonth()]} ${selectedDate.getFullYear().toString()}`
|
|
332
|
+
this.updateContext()
|
|
333
|
+
return data
|
|
334
|
+
} catch (e) {
|
|
335
|
+
console.log(e)
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
_submit(e) {
|
|
340
|
+
this.searchForm.submit()
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
_exportableData() {
|
|
344
|
+
if (this._gristData.records.length > 0) {
|
|
345
|
+
var headerSetting = this._config.columns
|
|
346
|
+
.filter(column => column.type !== 'gutter' && column.record !== undefined && column.imex !== undefined)
|
|
347
|
+
.map(column => {
|
|
348
|
+
return column.imex
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
return { header: headerSetting, data: this._gristData.records }
|
|
352
|
+
} else {
|
|
353
|
+
throw new Error('No Data to Export')
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
_validate() {}
|
|
358
|
+
|
|
359
|
+
_compareValues(key, order = 'asc') {
|
|
360
|
+
return function innerSort(a, b) {
|
|
361
|
+
if (!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
|
|
362
|
+
return 0
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
const varA = typeof a[key] === 'string' ? a[key].toUpperCase() : a[key]
|
|
366
|
+
const varB = typeof b[key] === 'string' ? b[key].toUpperCase() : b[key]
|
|
367
|
+
|
|
368
|
+
let comparison = 0
|
|
369
|
+
if (varA > varB) {
|
|
370
|
+
comparison = 1
|
|
371
|
+
} else if (varA < varB) {
|
|
372
|
+
comparison = -1
|
|
373
|
+
}
|
|
374
|
+
return order === 'desc' ? comparison * -1 : comparison
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
async _fetchMills() {
|
|
379
|
+
const filters = [{ name: 'type', operator: 'eq', value: 'MILL' }]
|
|
380
|
+
const pagination = { page: 1, limit: 99999999 }
|
|
381
|
+
|
|
382
|
+
const response = await client.query({
|
|
383
|
+
query: gql`
|
|
384
|
+
query organizations($filters: [Filter], $pagination: Pagination) {
|
|
385
|
+
organizations(filters: $filters, pagination: $pagination) {
|
|
386
|
+
items {
|
|
387
|
+
id
|
|
388
|
+
name
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
`,
|
|
393
|
+
variables: { filters, pagination }
|
|
394
|
+
})
|
|
395
|
+
|
|
396
|
+
if (!response.errors) {
|
|
397
|
+
return [...response.data.organizations.items]
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
_showToast({ type, message }) {
|
|
402
|
+
document.dispatchEvent(
|
|
403
|
+
new CustomEvent('notify', {
|
|
404
|
+
detail: {
|
|
405
|
+
type,
|
|
406
|
+
message
|
|
407
|
+
}
|
|
408
|
+
})
|
|
409
|
+
)
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
window.customElements.define('report-monthly-ffb-sale', ReportMonthlyFfbSale)
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import '@things-factory/form-ui'
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
|
-
|
|
4
|
-
import { client, PageView, store } from '@things-factory/shell'
|
|
5
|
-
import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
|
|
3
|
+
|
|
6
4
|
import gql from 'graphql-tag'
|
|
7
5
|
import { css, html } from 'lit-element'
|
|
8
6
|
import { connect } from 'pwa-helpers/connect-mixin'
|
|
9
7
|
|
|
8
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
9
|
+
import { client, PageView, store } from '@things-factory/shell'
|
|
10
|
+
import { isMobileDevice } from '@things-factory/utils'
|
|
11
|
+
|
|
10
12
|
class ReportMonthlyProduction extends connect(store)(localize(i18next)(PageView)) {
|
|
11
13
|
static get styles() {
|
|
12
14
|
return css`
|
|
@@ -28,11 +30,13 @@ class ReportMonthlyProduction extends connect(store)(localize(i18next)(PageView)
|
|
|
28
30
|
_searchFields: Object,
|
|
29
31
|
_config: Object,
|
|
30
32
|
_gristData: Object,
|
|
33
|
+
_month: String,
|
|
31
34
|
data: Object
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
get context() {
|
|
39
|
+
let fileName = `${i18next.t('title.monthly_production_report')} (${this._month})`
|
|
36
40
|
return {
|
|
37
41
|
title: i18next.t('title.monthly_production_report'),
|
|
38
42
|
printable: {
|
|
@@ -40,7 +44,7 @@ class ReportMonthlyProduction extends connect(store)(localize(i18next)(PageView)
|
|
|
40
44
|
content: this
|
|
41
45
|
},
|
|
42
46
|
exportable: {
|
|
43
|
-
name:
|
|
47
|
+
name: fileName,
|
|
44
48
|
data: this._exportableData.bind(this)
|
|
45
49
|
}
|
|
46
50
|
}
|
|
@@ -58,6 +62,11 @@ class ReportMonthlyProduction extends connect(store)(localize(i18next)(PageView)
|
|
|
58
62
|
return this.searchForm.shadowRoot.querySelector('input[name=month]')
|
|
59
63
|
}
|
|
60
64
|
|
|
65
|
+
constructor() {
|
|
66
|
+
super()
|
|
67
|
+
this._month = ''
|
|
68
|
+
}
|
|
69
|
+
|
|
61
70
|
render() {
|
|
62
71
|
return html`
|
|
63
72
|
<search-form id="search-form" .fields=${this._searchFields} @submit=${e => this.dataGrist.fetch()}></search-form>
|
|
@@ -362,6 +371,21 @@ class ReportMonthlyProduction extends connect(store)(localize(i18next)(PageView)
|
|
|
362
371
|
}
|
|
363
372
|
|
|
364
373
|
async fetchHandler({ page, limit, sorters = [] }) {
|
|
374
|
+
const monthNames = [
|
|
375
|
+
'January',
|
|
376
|
+
'February',
|
|
377
|
+
'March',
|
|
378
|
+
'April',
|
|
379
|
+
'May',
|
|
380
|
+
'June',
|
|
381
|
+
'July',
|
|
382
|
+
'August',
|
|
383
|
+
'September',
|
|
384
|
+
'October',
|
|
385
|
+
'November',
|
|
386
|
+
'December'
|
|
387
|
+
]
|
|
388
|
+
|
|
365
389
|
try {
|
|
366
390
|
const filters = this.searchForm.queryFilters
|
|
367
391
|
const pagination = { page, limit }
|
|
@@ -409,6 +433,11 @@ class ReportMonthlyProduction extends connect(store)(localize(i18next)(PageView)
|
|
|
409
433
|
...data
|
|
410
434
|
}
|
|
411
435
|
|
|
436
|
+
let selectedDate = this._monthInput.valueAsDate
|
|
437
|
+
|
|
438
|
+
this._month = `${monthNames[selectedDate.getMonth()]} ${selectedDate.getFullYear().toString()}`
|
|
439
|
+
this.updateContext()
|
|
440
|
+
|
|
412
441
|
return data
|
|
413
442
|
} catch (e) {
|
|
414
443
|
console.log(e)
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import '@things-factory/form-ui'
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
|
-
|
|
4
|
-
import { client, PageView, store } from '@things-factory/shell'
|
|
5
|
-
import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
|
|
3
|
+
|
|
6
4
|
import gql from 'graphql-tag'
|
|
7
5
|
import { css, html } from 'lit-element'
|
|
8
6
|
import { connect } from 'pwa-helpers/connect-mixin'
|
|
9
7
|
|
|
8
|
+
import { i18next, localize } from '@things-factory/i18n-base'
|
|
9
|
+
import { client, PageView, store } from '@things-factory/shell'
|
|
10
|
+
import { isMobileDevice } from '@things-factory/utils'
|
|
11
|
+
|
|
10
12
|
class ReportYearlyProduction extends connect(store)(localize(i18next)(PageView)) {
|
|
11
13
|
static get styles() {
|
|
12
14
|
return css`
|
|
@@ -28,11 +30,13 @@ class ReportYearlyProduction extends connect(store)(localize(i18next)(PageView))
|
|
|
28
30
|
_searchFields: Object,
|
|
29
31
|
_config: Object,
|
|
30
32
|
_gristData: Object,
|
|
33
|
+
_year: String,
|
|
31
34
|
data: Object
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
get context() {
|
|
39
|
+
let fileName = `${i18next.t('title.yearly_production_report')} (${this._year})`
|
|
36
40
|
return {
|
|
37
41
|
title: i18next.t('title.yearly_production_report'),
|
|
38
42
|
printable: {
|
|
@@ -40,7 +44,7 @@ class ReportYearlyProduction extends connect(store)(localize(i18next)(PageView))
|
|
|
40
44
|
content: this
|
|
41
45
|
},
|
|
42
46
|
exportable: {
|
|
43
|
-
name:
|
|
47
|
+
name: fileName,
|
|
44
48
|
data: this._exportableData.bind(this)
|
|
45
49
|
}
|
|
46
50
|
}
|
|
@@ -55,7 +59,12 @@ class ReportYearlyProduction extends connect(store)(localize(i18next)(PageView))
|
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
get _yearInput() {
|
|
58
|
-
return this.searchForm.shadowRoot.querySelector('
|
|
62
|
+
return this.searchForm.shadowRoot.querySelector('select[name=year]')
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
constructor() {
|
|
66
|
+
super()
|
|
67
|
+
this._year = ''
|
|
59
68
|
}
|
|
60
69
|
|
|
61
70
|
render() {
|
|
@@ -264,13 +273,13 @@ class ReportYearlyProduction extends connect(store)(localize(i18next)(PageView))
|
|
|
264
273
|
}
|
|
265
274
|
}
|
|
266
275
|
|
|
267
|
-
|
|
276
|
+
pageInitialized() {
|
|
268
277
|
this._gristData = { total: 0, records: [] }
|
|
269
278
|
this._searchFields = this.searchFields
|
|
270
279
|
this._config = this.reportConfig
|
|
271
280
|
}
|
|
272
281
|
|
|
273
|
-
|
|
282
|
+
pageUpdated(changes, lifecycle) {
|
|
274
283
|
if (this.active) {
|
|
275
284
|
this.dataGrist.fetch()
|
|
276
285
|
}
|
|
@@ -317,6 +326,11 @@ class ReportYearlyProduction extends connect(store)(localize(i18next)(PageView))
|
|
|
317
326
|
...data
|
|
318
327
|
}
|
|
319
328
|
|
|
329
|
+
let selectedYear = this._yearInput.value
|
|
330
|
+
|
|
331
|
+
this._year = `${selectedYear.toString()}`
|
|
332
|
+
this.updateContext()
|
|
333
|
+
|
|
320
334
|
return data
|
|
321
335
|
} catch (e) {
|
|
322
336
|
console.log(e)
|
|
@@ -337,7 +351,9 @@ class ReportYearlyProduction extends connect(store)(localize(i18next)(PageView))
|
|
|
337
351
|
}
|
|
338
352
|
}
|
|
339
353
|
|
|
340
|
-
_validate() {
|
|
354
|
+
_validate() {
|
|
355
|
+
debugger
|
|
356
|
+
}
|
|
341
357
|
|
|
342
358
|
_showToast({ type, message }) {
|
|
343
359
|
document.dispatchEvent(
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { css, html } from 'lit-element'
|
|
2
|
+
import { connect } from 'pwa-helpers/connect-mixin.js'
|
|
3
|
+
|
|
4
|
+
import { PageView, store } from '@things-factory/shell'
|
|
5
|
+
|
|
6
|
+
class SettingHome extends connect(store)(PageView) {
|
|
7
|
+
static get styles() {
|
|
8
|
+
return [
|
|
9
|
+
css`
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
background-color: var(--main-section-background-color);
|
|
13
|
+
padding: var(--padding-wide);
|
|
14
|
+
|
|
15
|
+
overflow: auto;
|
|
16
|
+
}
|
|
17
|
+
[message] {
|
|
18
|
+
padding: 40px 20px 0 20px;
|
|
19
|
+
max-width: var(--content-container-max-width);
|
|
20
|
+
font-size: 18px;
|
|
21
|
+
color: var(--secondary-color);
|
|
22
|
+
text-align: justify;
|
|
23
|
+
}
|
|
24
|
+
[message] strong {
|
|
25
|
+
display: block;
|
|
26
|
+
font-size: 2.5rem;
|
|
27
|
+
color: var(--primary-color);
|
|
28
|
+
}
|
|
29
|
+
[message] img {
|
|
30
|
+
float: right;
|
|
31
|
+
width: 450px;
|
|
32
|
+
max-width: 90%;
|
|
33
|
+
display: block;
|
|
34
|
+
margin: auto;
|
|
35
|
+
margin-top: 20px;
|
|
36
|
+
}
|
|
37
|
+
[message] ul {
|
|
38
|
+
margin: var(--margin-default) 0;
|
|
39
|
+
padding: 0;
|
|
40
|
+
list-style: circle inside;
|
|
41
|
+
}
|
|
42
|
+
[message] a {
|
|
43
|
+
color: var(--secondary-text-color);
|
|
44
|
+
font-size: 0.9rem;
|
|
45
|
+
}
|
|
46
|
+
[message] a:hover {
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
color: var(--primary-color);
|
|
49
|
+
}
|
|
50
|
+
[button-primary] {
|
|
51
|
+
display: block;
|
|
52
|
+
background-color: var(--button-primary-background-color);
|
|
53
|
+
border: var(--button-border);
|
|
54
|
+
border-radius: var(--button-border-radius);
|
|
55
|
+
margin-top: var(--margin-wide);
|
|
56
|
+
padding: var(--button-padding);
|
|
57
|
+
color: var(--button-primary-color);
|
|
58
|
+
font: var(--button-primary-font);
|
|
59
|
+
text-transform: var(--button-text-transform);
|
|
60
|
+
text-decoration: none;
|
|
61
|
+
}
|
|
62
|
+
[button-primary]:hover {
|
|
63
|
+
background-color: var(--button-primary-active-background-color);
|
|
64
|
+
box-shadow: var(--button-active-box-shadow);
|
|
65
|
+
}
|
|
66
|
+
@media screen and (max-width: 480px) {
|
|
67
|
+
[message] {
|
|
68
|
+
padding-top: 10px;
|
|
69
|
+
font-size: 15px;
|
|
70
|
+
}
|
|
71
|
+
[message] strong {
|
|
72
|
+
font-size: 1.6rem;
|
|
73
|
+
}
|
|
74
|
+
[message] img {
|
|
75
|
+
float: none;
|
|
76
|
+
width: 90%;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static get properties() {
|
|
84
|
+
return {}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
get context() {
|
|
88
|
+
return {
|
|
89
|
+
title: `setting home`
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
render() {
|
|
94
|
+
return html`
|
|
95
|
+
<div message>
|
|
96
|
+
<img src="/assets/images/image-api.png" />
|
|
97
|
+
<strong>Plantation Inventory Setting</strong>
|
|
98
|
+
OPERATO allows plantation user to set inventory to be tracked or non-tracked.
|
|
99
|
+
<ul>
|
|
100
|
+
<li><a href="plantation-setting">Plantation Inventory</a></li>
|
|
101
|
+
</ul>
|
|
102
|
+
</div>
|
|
103
|
+
`
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
window.customElements.define('setting-home', SettingHome)
|