@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
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
2
1
|
import '@things-factory/grist-ui'
|
|
2
|
+
import '../../component/block-selector-popup'
|
|
3
|
+
|
|
4
|
+
import gql from 'graphql-tag'
|
|
5
|
+
import { css, html } from 'lit-element'
|
|
6
|
+
|
|
7
|
+
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
3
8
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
4
9
|
import { openPopup } from '@things-factory/layout-base'
|
|
5
10
|
import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
|
|
6
11
|
import { CommonButtonStyles } from '@things-factory/styles'
|
|
7
12
|
import { isMobileDevice } from '@things-factory/utils'
|
|
8
|
-
import gql from 'graphql-tag'
|
|
9
|
-
import { css, html } from 'lit-element'
|
|
10
|
-
import '../../component/block-selector-popup'
|
|
11
13
|
|
|
12
14
|
class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
13
15
|
static get properties() {
|
|
@@ -95,17 +97,17 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
95
97
|
return html`
|
|
96
98
|
<form name="dailyHarvest" class="multi-column-form" autocomplete="off">
|
|
97
99
|
<fieldset>
|
|
98
|
-
<legend>${i18next.t('title.
|
|
99
|
-
<label>${i18next.t('label.
|
|
100
|
+
<legend>${i18next.t('title.harvesting_contractors_daily_harvesting_record')}</legend>
|
|
101
|
+
<label>${i18next.t('label.date')}</label>
|
|
100
102
|
<input type="date" name="harvestDate" required />
|
|
101
103
|
|
|
102
104
|
<label>${i18next.t('label.block')}</label>
|
|
103
|
-
<input name="block" readonly
|
|
105
|
+
<input name="block" readonly />
|
|
104
106
|
|
|
105
107
|
<label>${i18next.t('label.harvesting_round')}</label>
|
|
106
108
|
<input type="number" min="1" name="harvestingRound" />
|
|
107
109
|
|
|
108
|
-
<label>${i18next.t('label.
|
|
110
|
+
<label>${i18next.t('label.total_task_covered')}</label>
|
|
109
111
|
<input type="number" min="1" name="coverage" />
|
|
110
112
|
</fieldset>
|
|
111
113
|
</form>
|
|
@@ -123,6 +125,16 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
123
125
|
></data-grist>
|
|
124
126
|
</div>
|
|
125
127
|
</div>
|
|
128
|
+
|
|
129
|
+
<form name="dailyCollection" class="multi-column-form" autocomplete="off">
|
|
130
|
+
<fieldset>
|
|
131
|
+
<label>${i18next.t('label.yesterday_balance_in_field')}</label>
|
|
132
|
+
<input type="number" min="0" name="yesterdayBalanceBunchInField" />
|
|
133
|
+
|
|
134
|
+
<label>${i18next.t('label.collected_today')}</label>
|
|
135
|
+
<input type="number" min="0" name="collectedBunch" />
|
|
136
|
+
</fieldset>
|
|
137
|
+
</form>
|
|
126
138
|
`
|
|
127
139
|
}
|
|
128
140
|
|
|
@@ -135,6 +147,10 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
135
147
|
return this.shadowRoot.querySelector('form[name=dailyHarvest]')
|
|
136
148
|
}
|
|
137
149
|
|
|
150
|
+
get collectionForm() {
|
|
151
|
+
return this.shadowRoot.querySelector('form[name=dailyCollection]')
|
|
152
|
+
}
|
|
153
|
+
|
|
138
154
|
get harvestGrist() {
|
|
139
155
|
return this.shadowRoot.querySelector('data-grist#harvest-grist')
|
|
140
156
|
}
|
|
@@ -143,7 +159,15 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
143
159
|
return this.shadowRoot.querySelector('input[name=block]')
|
|
144
160
|
}
|
|
145
161
|
|
|
146
|
-
|
|
162
|
+
get collectionInput() {
|
|
163
|
+
return this.shadowRoot.querySelector('input[name=collectedBunch]')
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
get balanceInput() {
|
|
167
|
+
return this.shadowRoot.querySelector('input[name=yesterdayBalanceBunchInField]')
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
pageInitialized() {
|
|
147
171
|
this.harvestGristConfig = {
|
|
148
172
|
pagination: { infinite: true },
|
|
149
173
|
list: {
|
|
@@ -167,13 +191,20 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
167
191
|
select: [
|
|
168
192
|
{ name: 'id', hidden: true },
|
|
169
193
|
{ name: 'staffId', header: i18next.t('field.staff_id'), width: 200 },
|
|
170
|
-
{ name: 'name', header: i18next.t('field.name'), width: 200 }
|
|
194
|
+
{ name: 'name', header: i18next.t('field.name'), width: 200 },
|
|
195
|
+
{ name: 'organizationName', header: i18next.t('field.contractor'), width: 200 }
|
|
171
196
|
],
|
|
172
|
-
list: { fields: ['staffId', 'name'] }
|
|
197
|
+
list: { fields: ['staffId', 'name', 'organizationName'] }
|
|
173
198
|
}
|
|
174
199
|
},
|
|
175
200
|
width: 300
|
|
176
201
|
},
|
|
202
|
+
{
|
|
203
|
+
type: 'string',
|
|
204
|
+
name: 'organizationName',
|
|
205
|
+
header: i18next.t('field.contractor'),
|
|
206
|
+
width: 300
|
|
207
|
+
},
|
|
177
208
|
{
|
|
178
209
|
type: 'float',
|
|
179
210
|
name: 'totalBunchHarvested',
|
|
@@ -181,6 +212,13 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
181
212
|
record: { editable: true },
|
|
182
213
|
width: 150
|
|
183
214
|
},
|
|
215
|
+
{
|
|
216
|
+
type: 'float',
|
|
217
|
+
name: 'totalTonnageHarvested',
|
|
218
|
+
header: i18next.t('field.total_tonnage_harvested'),
|
|
219
|
+
record: { editable: true },
|
|
220
|
+
width: 150
|
|
221
|
+
},
|
|
184
222
|
{
|
|
185
223
|
type: 'string',
|
|
186
224
|
name: 'remark',
|
|
@@ -197,10 +235,15 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
197
235
|
this._checkStaffDuplication()
|
|
198
236
|
let changeRecord = event.detail.after
|
|
199
237
|
const changedColumn = event.detail.column.name
|
|
200
|
-
let { totalBunchHarvested } = changeRecord
|
|
238
|
+
let { totalBunchHarvested, totalTonnageHarvested } = changeRecord
|
|
201
239
|
|
|
202
|
-
if (changedColumn === 'totalBunchHarvested' && (totalBunchHarvested < 0 || isNaN(totalBunchHarvested)))
|
|
240
|
+
if (changedColumn === 'totalBunchHarvested' && (totalBunchHarvested < 0 || isNaN(totalBunchHarvested))) {
|
|
203
241
|
throw new Error(i18next.t('text.total_no_of_bunches_should_be_positive'))
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (changedColumn === 'totalTonnageHarvested' && (totalTonnageHarvested < 0 || isNaN(totalTonnageHarvested))) {
|
|
245
|
+
throw new Error(i18next.t('text.total_tonnage_harvested_should_be_positive'))
|
|
246
|
+
}
|
|
204
247
|
} catch (e) {
|
|
205
248
|
const beforeValue = event.detail.before && event.detail.before[event.detail.column.name]
|
|
206
249
|
if (beforeValue) {
|
|
@@ -240,12 +283,7 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
240
283
|
}
|
|
241
284
|
|
|
242
285
|
async _fetchHarvestRecord() {
|
|
243
|
-
if (!this._harvestNo)
|
|
244
|
-
CustomAlert({
|
|
245
|
-
title: i18next.t('text.no_records'),
|
|
246
|
-
text: i18next.t('text.unable_to_find_harvest_record')
|
|
247
|
-
})
|
|
248
|
-
}
|
|
286
|
+
if (!this._harvestNo) return
|
|
249
287
|
|
|
250
288
|
const response = await client.query({
|
|
251
289
|
query: gql`
|
|
@@ -258,17 +296,24 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
258
296
|
description
|
|
259
297
|
}
|
|
260
298
|
harvestDate
|
|
299
|
+
collectedBunch
|
|
261
300
|
coverage
|
|
262
301
|
rainfall
|
|
302
|
+
yesterdayBalanceBunchInField
|
|
263
303
|
harvestingRound
|
|
264
304
|
status
|
|
265
305
|
dailyHarvestDetails {
|
|
266
306
|
name
|
|
267
307
|
totalBunchHarvested
|
|
308
|
+
totalTonnageHarvested
|
|
268
309
|
remark
|
|
269
310
|
organizationStaff {
|
|
270
311
|
id
|
|
271
312
|
name
|
|
313
|
+
organization {
|
|
314
|
+
id
|
|
315
|
+
name
|
|
316
|
+
}
|
|
272
317
|
}
|
|
273
318
|
}
|
|
274
319
|
}
|
|
@@ -281,12 +326,17 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
281
326
|
const dailyHarvest = response.data.dailyHarvest
|
|
282
327
|
const dailyHarvestDetails = dailyHarvest.dailyHarvestDetails
|
|
283
328
|
this._fillupHarvestForm({ ...dailyHarvest, block: dailyHarvest.block.name })
|
|
329
|
+
this._fillupCollectionForm({
|
|
330
|
+
collectedBunch: dailyHarvest.collectedBunch,
|
|
331
|
+
yesterdayBalanceBunchInField: dailyHarvest.yesterdayBalanceBunchInField
|
|
332
|
+
})
|
|
284
333
|
this._status = dailyHarvest.status
|
|
285
334
|
this.harvestData = {
|
|
286
335
|
records: dailyHarvestDetails.map(detail => {
|
|
287
336
|
return {
|
|
288
337
|
...detail,
|
|
289
|
-
staffName: detail.organizationStaff && detail.organizationStaff.name
|
|
338
|
+
staffName: detail.organizationStaff && detail.organizationStaff.name,
|
|
339
|
+
organizationName: detail.organizationStaff.organization && detail.organizationStaff.organization?.name
|
|
290
340
|
}
|
|
291
341
|
})
|
|
292
342
|
}
|
|
@@ -324,8 +374,12 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
324
374
|
|
|
325
375
|
if (!result.value) return
|
|
326
376
|
|
|
327
|
-
let dailyHarvestPatch = this._getFormInfo()
|
|
377
|
+
let dailyHarvestPatch = this._getFormInfo(this.harvestingForm)
|
|
378
|
+
const dailyCollection = this._getFormInfo(this.collectionForm)
|
|
379
|
+
|
|
328
380
|
dailyHarvestPatch.harvestingRound = parseInt(dailyHarvestPatch.harvestingRound)
|
|
381
|
+
dailyHarvestPatch.collectedBunch = parseFloat(dailyCollection.collectedBunch)
|
|
382
|
+
dailyHarvestPatch.yesterdayBalanceBunchInField = parseFloat(dailyCollection.yesterdayBalanceBunchInField)
|
|
329
383
|
dailyHarvestPatch.coverage = parseFloat(dailyHarvestPatch.coverage)
|
|
330
384
|
dailyHarvestPatch.dailyHarvestDetails = this._getHarvestDetails()
|
|
331
385
|
|
|
@@ -353,6 +407,12 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
353
407
|
|
|
354
408
|
_validateForm() {
|
|
355
409
|
if (!this.harvestingForm.checkValidity()) throw new Error(i18next.t('text.harvesting_record_invalid'))
|
|
410
|
+
|
|
411
|
+
if (this.balanceInput?.value < 0 || isNaN(this.balanceInput?.value))
|
|
412
|
+
throw new Error(i18next.t('text.x_has_invalid_value', { state: 'label.yesterday_balance_bunch' }))
|
|
413
|
+
|
|
414
|
+
if (this.collectionInput?.value < 0 || isNaN(this.collectionInput?.value))
|
|
415
|
+
throw new Error(i18next.t('text.x_has_invalid_value', { state: 'label.collected_bunch' }))
|
|
356
416
|
}
|
|
357
417
|
|
|
358
418
|
_validateHarvestData() {
|
|
@@ -369,8 +429,8 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
369
429
|
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
370
430
|
}
|
|
371
431
|
|
|
372
|
-
_getFormInfo() {
|
|
373
|
-
return this._serializeForm(
|
|
432
|
+
_getFormInfo(form) {
|
|
433
|
+
return this._serializeForm(form)
|
|
374
434
|
}
|
|
375
435
|
|
|
376
436
|
_getHarvestDetails() {
|
|
@@ -382,6 +442,7 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
382
442
|
name: record.organizationStaff.name
|
|
383
443
|
},
|
|
384
444
|
totalBunchHarvested: Number(record.totalBunchHarvested),
|
|
445
|
+
totalTonnageHarvested: Number(record.totalTonnageHarvested),
|
|
385
446
|
remark: record?.remark ? record.remark : null
|
|
386
447
|
}
|
|
387
448
|
|
|
@@ -393,6 +454,10 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
393
454
|
this._fillupForm(this.harvestingForm, data)
|
|
394
455
|
}
|
|
395
456
|
|
|
457
|
+
_fillupCollectionForm(data) {
|
|
458
|
+
this._fillupForm(this.collectionForm, data)
|
|
459
|
+
}
|
|
460
|
+
|
|
396
461
|
_fillupForm(form, data) {
|
|
397
462
|
form.reset()
|
|
398
463
|
for (let key in data) {
|
|
@@ -413,6 +478,7 @@ class EditHarvestingRecord extends localize(i18next)(PageView) {
|
|
|
413
478
|
|
|
414
479
|
_clearView() {
|
|
415
480
|
this.harvestingForm.reset()
|
|
481
|
+
this.collectionForm.reset()
|
|
416
482
|
this.harvestData = { ...this.harvestData, records: [] }
|
|
417
483
|
}
|
|
418
484
|
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import '@things-factory/form-ui'
|
|
2
|
-
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
3
2
|
import '@things-factory/grist-ui'
|
|
3
|
+
import '../../component/block-selector-popup'
|
|
4
|
+
|
|
5
|
+
import gql from 'graphql-tag'
|
|
6
|
+
import { css, html } from 'lit-element'
|
|
7
|
+
|
|
8
|
+
import { MultiColumnFormStyles } from '@things-factory/form-ui'
|
|
4
9
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
5
10
|
import { openPopup } from '@things-factory/layout-base'
|
|
6
11
|
import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
|
|
7
12
|
import { CommonButtonStyles } from '@things-factory/styles'
|
|
8
13
|
import { isMobileDevice } from '@things-factory/utils'
|
|
9
|
-
import gql from 'graphql-tag'
|
|
10
|
-
import { css, html } from 'lit-element'
|
|
11
|
-
import '../../component/block-selector-popup'
|
|
12
14
|
|
|
13
15
|
class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
14
16
|
static get properties() {
|
|
@@ -89,8 +91,8 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
89
91
|
return html`
|
|
90
92
|
<form name="dailyHarvest" class="multi-column-form" autocomplete="off">
|
|
91
93
|
<fieldset>
|
|
92
|
-
<legend>${i18next.t('title.
|
|
93
|
-
<label>${i18next.t('label.
|
|
94
|
+
<legend>${i18next.t('title.harvesting_contractors_daily_harvesting_record')}</legend>
|
|
95
|
+
<label>${i18next.t('label.date')}</label>
|
|
94
96
|
<input type="date" name="harvestDate" required />
|
|
95
97
|
|
|
96
98
|
<label>${i18next.t('label.block')}</label>
|
|
@@ -99,7 +101,7 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
99
101
|
<label>${i18next.t('label.harvesting_round')}</label>
|
|
100
102
|
<input type="number" min="1" name="harvestingRound" />
|
|
101
103
|
|
|
102
|
-
<label>${i18next.t('label.
|
|
104
|
+
<label>${i18next.t('label.total_task_covered')}</label>
|
|
103
105
|
<input type="number" min="1" name="coverage" />
|
|
104
106
|
</fieldset>
|
|
105
107
|
</form>
|
|
@@ -117,6 +119,16 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
117
119
|
></data-grist>
|
|
118
120
|
</div>
|
|
119
121
|
</div>
|
|
122
|
+
|
|
123
|
+
<form name="dailyCollection" class="multi-column-form" autocomplete="off">
|
|
124
|
+
<fieldset>
|
|
125
|
+
<label>${i18next.t('label.yesterday_balance_in_field')}</label>
|
|
126
|
+
<input type="number" min="0" name="yesterdayBalanceBunchInField" />
|
|
127
|
+
|
|
128
|
+
<label>${i18next.t('label.collected_today')}</label>
|
|
129
|
+
<input type="number" min="0" name="collectedBunch" />
|
|
130
|
+
</fieldset>
|
|
131
|
+
</form>
|
|
120
132
|
`
|
|
121
133
|
}
|
|
122
134
|
|
|
@@ -129,6 +141,10 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
129
141
|
return this.shadowRoot.querySelector('form[name=dailyHarvest]')
|
|
130
142
|
}
|
|
131
143
|
|
|
144
|
+
get collectionForm() {
|
|
145
|
+
return this.shadowRoot.querySelector('form[name=dailyCollection]')
|
|
146
|
+
}
|
|
147
|
+
|
|
132
148
|
get harvestGrist() {
|
|
133
149
|
return this.shadowRoot.querySelector('data-grist#harvest-grist')
|
|
134
150
|
}
|
|
@@ -137,7 +153,15 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
137
153
|
return this.shadowRoot.querySelector('input[name=block]')
|
|
138
154
|
}
|
|
139
155
|
|
|
140
|
-
|
|
156
|
+
get collectionInput() {
|
|
157
|
+
return this.shadowRoot.querySelector('input[name=collectedBunch]')
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
get balanceInput() {
|
|
161
|
+
return this.shadowRoot.querySelector('input[name=yesterdayBalanceBunchInField]')
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
pageInitialized() {
|
|
141
165
|
this.harvestGristConfig = {
|
|
142
166
|
pagination: { infinite: true },
|
|
143
167
|
list: {
|
|
@@ -168,9 +192,10 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
168
192
|
select: [
|
|
169
193
|
{ name: 'id', hidden: true },
|
|
170
194
|
{ name: 'staffId', header: i18next.t('field.staff_id'), width: 200 },
|
|
171
|
-
{ name: 'name', header: i18next.t('field.name'), width: 200 }
|
|
195
|
+
{ name: 'name', header: i18next.t('field.name'), width: 200 },
|
|
196
|
+
{ name: 'organizationName', header: i18next.t('field.contractor'), width: 200 }
|
|
172
197
|
],
|
|
173
|
-
list: { fields: ['staffId', 'name'] }
|
|
198
|
+
list: { fields: ['staffId', 'name', 'organizationName'] }
|
|
174
199
|
}
|
|
175
200
|
},
|
|
176
201
|
width: 300
|
|
@@ -182,6 +207,13 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
182
207
|
record: { editable: true },
|
|
183
208
|
width: 150
|
|
184
209
|
},
|
|
210
|
+
{
|
|
211
|
+
type: 'float',
|
|
212
|
+
name: 'totalTonnageHarvested',
|
|
213
|
+
header: i18next.t('field.total_tonnage_harvested'),
|
|
214
|
+
record: { editable: true },
|
|
215
|
+
width: 150
|
|
216
|
+
},
|
|
185
217
|
{
|
|
186
218
|
type: 'string',
|
|
187
219
|
name: 'remark',
|
|
@@ -198,10 +230,15 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
198
230
|
this._checkStaffDuplication()
|
|
199
231
|
let changeRecord = event.detail.after
|
|
200
232
|
const changedColumn = event.detail.column.name
|
|
201
|
-
let { totalBunchHarvested } = changeRecord
|
|
233
|
+
let { totalBunchHarvested, totalTonnageHarvested } = changeRecord
|
|
202
234
|
|
|
203
|
-
if (changedColumn === 'totalBunchHarvested' && (!totalBunchHarvested || totalBunchHarvested < 0))
|
|
235
|
+
if (changedColumn === 'totalBunchHarvested' && (!totalBunchHarvested || totalBunchHarvested < 0)) {
|
|
204
236
|
throw new Error(i18next.t('text.total_no_of_bunches_should_be_positive'))
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (changedColumn === 'totalTonnageHarvested' && totalTonnageHarvested < 0) {
|
|
240
|
+
throw new Error(i18next.t('text.total_tonnage_harvested_should_be_positive'))
|
|
241
|
+
}
|
|
205
242
|
} catch (e) {
|
|
206
243
|
const beforeValue = event.detail.before && event.detail.before[event.detail.column.name]
|
|
207
244
|
if (beforeValue) {
|
|
@@ -236,8 +273,9 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
236
273
|
openPopup(
|
|
237
274
|
html`
|
|
238
275
|
<block-selector-popup
|
|
239
|
-
@selected="${e => {
|
|
276
|
+
@selected="${async e => {
|
|
240
277
|
this.blockInput.value = e.detail.name
|
|
278
|
+
this.balanceInput.value = await this._fetchBlockBunches(e.detail.id)
|
|
241
279
|
}}"
|
|
242
280
|
></block-selector-popup>
|
|
243
281
|
`,
|
|
@@ -249,6 +287,42 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
249
287
|
)
|
|
250
288
|
}
|
|
251
289
|
|
|
290
|
+
async _fetchBlockBunches(blockId) {
|
|
291
|
+
if (!blockId) return
|
|
292
|
+
|
|
293
|
+
const filters = [
|
|
294
|
+
{
|
|
295
|
+
name: 'block',
|
|
296
|
+
operator: 'eq',
|
|
297
|
+
value: blockId
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: 'type',
|
|
301
|
+
operator: 'eq',
|
|
302
|
+
value: 'FIELD_BUNCHES'
|
|
303
|
+
}
|
|
304
|
+
]
|
|
305
|
+
|
|
306
|
+
const response = await client.query({
|
|
307
|
+
query: gql`
|
|
308
|
+
query plantationInventories($filters: [Filter]) {
|
|
309
|
+
plantationInventories(filters: $filters) {
|
|
310
|
+
items {
|
|
311
|
+
id
|
|
312
|
+
name
|
|
313
|
+
totalBunches
|
|
314
|
+
type
|
|
315
|
+
}
|
|
316
|
+
total
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
`,
|
|
320
|
+
variables: { filters }
|
|
321
|
+
})
|
|
322
|
+
|
|
323
|
+
return response.data.plantationInventories.items[0]?.totalBunches || 0
|
|
324
|
+
}
|
|
325
|
+
|
|
252
326
|
async _generateHarvestingRecord() {
|
|
253
327
|
try {
|
|
254
328
|
this._validateForm()
|
|
@@ -263,8 +337,12 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
263
337
|
|
|
264
338
|
if (!result.value) return
|
|
265
339
|
|
|
266
|
-
let dailyHarvest = this._getFormInfo()
|
|
340
|
+
let dailyHarvest = this._getFormInfo(this.harvestingForm)
|
|
341
|
+
const dailyCollection = this._getFormInfo(this.collectionForm)
|
|
342
|
+
|
|
267
343
|
dailyHarvest.harvestingRound = parseInt(dailyHarvest.harvestingRound)
|
|
344
|
+
dailyHarvest.collectedBunch = parseFloat(dailyCollection.collectedBunch)
|
|
345
|
+
dailyHarvest.yesterdayBalanceBunchInField = parseFloat(dailyCollection.yesterdayBalanceBunchInField)
|
|
268
346
|
dailyHarvest.coverage = parseFloat(dailyHarvest.coverage)
|
|
269
347
|
dailyHarvest.dailyHarvestDetails = this._getHarvestDetails()
|
|
270
348
|
|
|
@@ -292,6 +370,12 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
292
370
|
|
|
293
371
|
_validateForm() {
|
|
294
372
|
if (!this.harvestingForm.checkValidity()) throw new Error(i18next.t('text.harvesting_record_invalid'))
|
|
373
|
+
|
|
374
|
+
if (this.balanceInput?.value < 0 || isNaN(this.balanceInput?.value))
|
|
375
|
+
throw new Error(i18next.t('text.x_has_invalid_value', { x: i18next.t('label.yesterday_balance_bunch') }))
|
|
376
|
+
|
|
377
|
+
if (this.collectionInput?.value < 0 || isNaN(this.collectionInput?.value))
|
|
378
|
+
throw new Error(i18next.t('text.x_has_invalid_value', { x: i18next.t('label.collected_bunch') }))
|
|
295
379
|
}
|
|
296
380
|
|
|
297
381
|
_validateHarvestData() {
|
|
@@ -307,8 +391,8 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
307
391
|
throw new Error(i18next.t('text.empty_value_in_list'))
|
|
308
392
|
}
|
|
309
393
|
|
|
310
|
-
_getFormInfo() {
|
|
311
|
-
return this._serializeForm(
|
|
394
|
+
_getFormInfo(form) {
|
|
395
|
+
return this._serializeForm(form)
|
|
312
396
|
}
|
|
313
397
|
|
|
314
398
|
_getHarvestDetails() {
|
|
@@ -319,6 +403,7 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
319
403
|
name: record.organizationStaff.name
|
|
320
404
|
},
|
|
321
405
|
totalBunchHarvested: Number(record.totalBunchHarvested),
|
|
406
|
+
totalTonnageHarvested: Number(record.totalTonnageHarvested),
|
|
322
407
|
remark: record?.remark ? record.remark : null
|
|
323
408
|
}
|
|
324
409
|
|
|
@@ -328,6 +413,7 @@ class HarvestingCreateRecord extends localize(i18next)(PageView) {
|
|
|
328
413
|
|
|
329
414
|
_clearView() {
|
|
330
415
|
this.harvestingForm.reset()
|
|
416
|
+
this.collectionForm.reset()
|
|
331
417
|
this.harvestData = { ...this.harvestData, records: [] }
|
|
332
418
|
}
|
|
333
419
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import '@things-factory/form-ui'
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
|
+
|
|
4
|
+
import gql from 'graphql-tag'
|
|
5
|
+
import { css, html } from 'lit-element'
|
|
6
|
+
|
|
3
7
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
4
8
|
import { client, navigate, PageView } from '@things-factory/shell'
|
|
5
9
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
6
10
|
import { isMobileDevice } from '@things-factory/utils'
|
|
7
|
-
import gql from 'graphql-tag'
|
|
8
|
-
import { css, html } from 'lit-element'
|
|
9
11
|
|
|
10
12
|
class HarvestingList extends localize(i18next)(PageView) {
|
|
11
13
|
static get styles() {
|
|
@@ -52,9 +54,9 @@ class HarvestingList extends localize(i18next)(PageView) {
|
|
|
52
54
|
|
|
53
55
|
get context() {
|
|
54
56
|
return {
|
|
55
|
-
title: i18next.t('title.
|
|
57
|
+
title: i18next.t('title.harvesting_contractors_daily_harvesting_record'),
|
|
56
58
|
exportable: {
|
|
57
|
-
name: i18next.t('title.
|
|
59
|
+
name: i18next.t('title.harvesting_contractors_daily_harvesting_record'),
|
|
58
60
|
data: this._exportableData.bind(this)
|
|
59
61
|
}
|
|
60
62
|
}
|
|
@@ -71,7 +73,7 @@ class HarvestingList extends localize(i18next)(PageView) {
|
|
|
71
73
|
|
|
72
74
|
this._searchFields = [
|
|
73
75
|
{
|
|
74
|
-
label: i18next.t('field.
|
|
76
|
+
label: i18next.t('field.date'),
|
|
75
77
|
name: 'harvestDate',
|
|
76
78
|
type: 'date',
|
|
77
79
|
props: { searchOper: 'eq' }
|
|
@@ -97,11 +99,21 @@ class HarvestingList extends localize(i18next)(PageView) {
|
|
|
97
99
|
|
|
98
100
|
this.config = {
|
|
99
101
|
list: {
|
|
100
|
-
fields: [
|
|
102
|
+
fields: [
|
|
103
|
+
'harvestDate',
|
|
104
|
+
'block',
|
|
105
|
+
'yesterdayBalanceBunchInField',
|
|
106
|
+
'totalBunchHarvested',
|
|
107
|
+
'collectedBunch',
|
|
108
|
+
'balanceBunchInField',
|
|
109
|
+
'coverage',
|
|
110
|
+
'harvestingRound',
|
|
111
|
+
'updatedAt',
|
|
112
|
+
'updater'
|
|
113
|
+
]
|
|
101
114
|
},
|
|
102
115
|
rows: { appendable: false, selectable: { multiple: true } },
|
|
103
116
|
columns: [
|
|
104
|
-
{ type: 'gutter', gutterName: 'dirty' },
|
|
105
117
|
{ type: 'gutter', gutterName: 'sequence' },
|
|
106
118
|
{
|
|
107
119
|
type: 'gutter',
|
|
@@ -116,7 +128,8 @@ class HarvestingList extends localize(i18next)(PageView) {
|
|
|
116
128
|
{
|
|
117
129
|
type: 'date',
|
|
118
130
|
name: 'harvestDate',
|
|
119
|
-
header: i18next.t('field.
|
|
131
|
+
header: i18next.t('field.date'),
|
|
132
|
+
label: true,
|
|
120
133
|
sortable: true,
|
|
121
134
|
width: 120
|
|
122
135
|
},
|
|
@@ -124,27 +137,55 @@ class HarvestingList extends localize(i18next)(PageView) {
|
|
|
124
137
|
type: 'object',
|
|
125
138
|
name: 'block',
|
|
126
139
|
header: i18next.t('field.block'),
|
|
140
|
+
label: true,
|
|
141
|
+
sortable: true,
|
|
142
|
+
width: 180
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
type: 'float',
|
|
146
|
+
name: 'yesterdayBalanceBunchInField',
|
|
147
|
+
header: i18next.t('field.yesterday_balance_in_field'),
|
|
148
|
+
label: true,
|
|
127
149
|
sortable: true,
|
|
128
150
|
width: 180
|
|
129
151
|
},
|
|
130
152
|
{
|
|
131
153
|
type: 'float',
|
|
132
154
|
name: 'totalBunchHarvested',
|
|
133
|
-
header: i18next.t('field.
|
|
155
|
+
header: i18next.t('field.harvested_today'),
|
|
156
|
+
label: true,
|
|
134
157
|
sortable: true,
|
|
135
|
-
width:
|
|
158
|
+
width: 180
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
type: 'float',
|
|
162
|
+
name: 'collectedBunch',
|
|
163
|
+
header: i18next.t('field.collected_bunch'),
|
|
164
|
+
label: true,
|
|
165
|
+
sortable: true,
|
|
166
|
+
width: 180
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
type: 'float',
|
|
170
|
+
name: 'balanceBunchInField',
|
|
171
|
+
header: i18next.t('field.balance_bunch_in_field'),
|
|
172
|
+
label: true,
|
|
173
|
+
sortable: true,
|
|
174
|
+
width: 180
|
|
136
175
|
},
|
|
137
176
|
{
|
|
138
177
|
type: 'float',
|
|
139
178
|
name: 'coverage',
|
|
140
|
-
header: i18next.t('field.
|
|
179
|
+
header: i18next.t('field.total_task_covered'),
|
|
180
|
+
label: true,
|
|
141
181
|
sortable: true,
|
|
142
|
-
width:
|
|
182
|
+
width: 160
|
|
143
183
|
},
|
|
144
184
|
{
|
|
145
185
|
type: 'integer',
|
|
146
186
|
name: 'harvestingRound',
|
|
147
187
|
header: i18next.t('field.harvesting_round'),
|
|
188
|
+
label: true,
|
|
148
189
|
sortable: true,
|
|
149
190
|
width: 150
|
|
150
191
|
},
|
|
@@ -152,6 +193,7 @@ class HarvestingList extends localize(i18next)(PageView) {
|
|
|
152
193
|
type: 'datetime',
|
|
153
194
|
name: 'updatedAt',
|
|
154
195
|
header: i18next.t('field.updated_at'),
|
|
196
|
+
label: true,
|
|
155
197
|
sortable: true,
|
|
156
198
|
width: 160
|
|
157
199
|
},
|
|
@@ -159,6 +201,7 @@ class HarvestingList extends localize(i18next)(PageView) {
|
|
|
159
201
|
type: 'object',
|
|
160
202
|
name: 'updater',
|
|
161
203
|
header: i18next.t('field.updater'),
|
|
204
|
+
label: true,
|
|
162
205
|
sortable: true,
|
|
163
206
|
width: 200
|
|
164
207
|
}
|
|
@@ -193,6 +236,9 @@ class HarvestingList extends localize(i18next)(PageView) {
|
|
|
193
236
|
}
|
|
194
237
|
harvestDate
|
|
195
238
|
totalBunchHarvested
|
|
239
|
+
collectedBunch
|
|
240
|
+
yesterdayBalanceBunchInField
|
|
241
|
+
balanceBunchInField
|
|
196
242
|
coverage
|
|
197
243
|
harvestingRound
|
|
198
244
|
deletedAt
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import '@things-factory/form-ui'
|
|
2
2
|
import '@things-factory/grist-ui'
|
|
3
|
+
import './inventory-history-by-bunches'
|
|
4
|
+
|
|
5
|
+
import gql from 'graphql-tag'
|
|
6
|
+
import { css, html } from 'lit-element'
|
|
7
|
+
import { connect } from 'pwa-helpers/connect-mixin'
|
|
8
|
+
|
|
3
9
|
import { i18next, localize } from '@things-factory/i18n-base'
|
|
4
10
|
import { openPopup } from '@things-factory/layout-base'
|
|
5
11
|
import { client, PageView, store } from '@things-factory/shell'
|
|
6
12
|
import { ScrollbarStyles } from '@things-factory/styles'
|
|
7
13
|
import { isMobileDevice } from '@things-factory/utils'
|
|
8
|
-
import gql from 'graphql-tag'
|
|
9
|
-
import { css, html } from 'lit-element'
|
|
10
|
-
import { connect } from 'pwa-helpers/connect-mixin'
|
|
11
|
-
import './inventory-history-by-bunches'
|
|
12
14
|
|
|
13
15
|
class InventoryFieldBunches extends connect(store)(localize(i18next)(PageView)) {
|
|
14
16
|
static get styles() {
|