Compare commits
38 Commits
dev-defuj
...
developmen
Author | SHA1 | Date | |
---|---|---|---|
|
e67c823a69 | ||
|
85a79d6bc3 | ||
|
4f91c945d2 | ||
|
bec792125d | ||
|
d9c956b5a1 | ||
|
d190bbaa25 | ||
|
40680c9040 | ||
|
5fd6e7a86c | ||
|
fea148b487 | ||
|
288201f25c | ||
|
3c8ccfe6a1 | ||
|
8e7a3caab8 | ||
|
3f53f68257 | ||
|
6848a91efd | ||
|
d726b88045 | ||
|
d431bd63d1 | ||
|
2970cec061 | ||
|
90e5074cf4 | ||
|
e3e1993635 | ||
|
714ae40d2c | ||
|
7c950d0eb2 | ||
|
8160e53e93 | ||
|
5a65655fd5 | ||
|
aac497998c | ||
|
63d0a676fa | ||
|
fddc43581d | ||
|
1b94c0ba74 | ||
|
b94201911f | ||
|
4e7dc2adae | ||
|
91c08a29ac | ||
|
03caab34c1 | ||
|
b8867a1310 | ||
|
768abf7dbf | ||
|
ed931d8eb3 | ||
|
b40a877cda | ||
|
bc8abdbc6f | ||
|
af4f6035f5 | ||
|
0710b2635d |
@ -1,4 +1,4 @@
|
|||||||
VITE_BASE_URL=http://localhost:5173
|
VITE_BASE_URL=http://localhost/:5173
|
||||||
VITE_BASE_DIRECTORY=/
|
VITE_BASE_DIRECTORY=/
|
||||||
VITE_APP_VERSION=0.0.1
|
VITE_APP_VERSION=0.0.1
|
||||||
VITE_APP_NAME='Executive Information System'
|
VITE_APP_NAME='Executive Information System'
|
||||||
|
@ -1 +1 @@
|
|||||||
{"name":"eis","version":"0.0.184-vm","private":true,"scripts":{"dev":"vite","host":"vite --host","tailwind":"tailwindcss -i ./src/assets/css/tailwind.css -o ./src/assets/css/style.css --watch","build":"run-p type-check build-only","preview":"vite preview --host","test:unit":"vitest","build-only":"vite build","type-check":"vue-tsc --noEmit -p tsconfig.vitest.json --composite false","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore","format":"prettier --write src/","deploy":"node deploy.js","set-version":"node version.js","version":"echo $npm_package_version"},"dependencies":{"@apollo/client":"^3.8.10","@apollo/link-context":"^2.0.0-beta.3","@flavorly/vanilla-components":"^0.7.65","@headlessui/tailwindcss":"^0.2.0","@headlessui/vue":"^1.7.19","@heroicons/vue":"^2.0.18","@lottiefiles/lottie-player":"^2.0.4","@phosphor-icons/vue":"^2.1.6","@types/qs":"^6.9.12","@types/uuid":"^9.0.8","@types/vue-select":"^3.16.8","@vue/apollo-components":"^4.0.0","@vue/apollo-composable":"^4.0.1","@vue/apollo-option":"^4.0.0","axios":"^1.6.7","devextreme":"23.2.4","devextreme-vue":"23.2.4","docx":"^8.5.0","dotenv":"^16.3.1","encrypt-storage":"^2.12.22","exceljs":"^4.4.0","file-saver":"^2.0.5","graphql":"^16.8.1","graphql-tag":"^2.12.6","jspdf":"^2.5.1","jspdf-autotable":"^3.8.2","pinia":"^2.1.3","qs":"^6.11.2","uuid":"^9.0.1","vue":"^3.3.4","vue-html-to-paper":"^2.0.3","vue-router":"^4.2.2","vue-tailwind-datepicker":"^1.6.1","vue3-star-ratings":"^3.0.5"},"devDependencies":{"@rushstack/eslint-patch":"^1.5.1","@tailwindcss/aspect-ratio":"^0.4.2","@tailwindcss/container-queries":"^0.1.1","@tailwindcss/forms":"^0.5.7","@tailwindcss/typography":"^0.5.10","@tsconfig/node18":"^2.0.1","@types/file-saver":"^2.0.6","@types/jsdom":"^21.1.1","@types/node":"^18.16.17","@vitejs/plugin-vue":"^4.2.3","@vitejs/plugin-vue-jsx":"^3.0.1","@vue/eslint-config-prettier":"^8.0.0","@vue/eslint-config-typescript":"^12.0.0","@vue/test-utils":"^2.3.2","@vue/tsconfig":"^0.4.0","autoprefixer":"^10.4.14","eslint":"^8.39.0","eslint-plugin-vue":"^9.11.0","jsdom":"^22.1.0","npm-run-all":"^4.1.5","postcss":"^8.4.24","prettier":"^3.0.3","tailwindcss":"^3.3.2","typescript":"~5.2.2","vite":"^4.3.9","vitest":"^1.3.1","vue-tsc":"^2.0.5"}}
|
{"name":"eis","version":"0.0.193-vm","private":true,"scripts":{"dev":"vite","host":"vite --host","tailwind":"tailwindcss -i ./src/assets/css/tailwind.css -o ./src/assets/css/style.css --watch","build":"run-p type-check build-only","preview":"vite preview --host","test:unit":"vitest","build-only":"vite build","type-check":"vue-tsc --noEmit -p tsconfig.vitest.json --composite false","lint":"eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore","format":"prettier --write src/","deploy":"node deploy.js","set-version":"node version.js","version":"echo $npm_package_version"},"dependencies":{"@apollo/client":"^3.8.10","@apollo/link-context":"^2.0.0-beta.3","@flavorly/vanilla-components":"^0.7.65","@headlessui/tailwindcss":"^0.2.0","@headlessui/vue":"^1.7.19","@heroicons/vue":"^2.0.18","@lottiefiles/lottie-player":"^2.0.4","@phosphor-icons/vue":"^2.1.6","@types/qs":"^6.9.12","@types/uuid":"^9.0.8","@types/vue-select":"^3.16.8","@vue/apollo-components":"^4.0.0","@vue/apollo-composable":"^4.0.1","@vue/apollo-option":"^4.0.0","axios":"^1.6.7","devextreme":"23.2.4","devextreme-vue":"23.2.4","docx":"^8.5.0","dotenv":"^16.3.1","encrypt-storage":"^2.12.22","exceljs":"^4.4.0","file-saver":"^2.0.5","graphql":"^16.8.1","graphql-tag":"^2.12.6","jspdf":"^2.5.1","jspdf-autotable":"^3.8.2","pinia":"^2.1.3","qs":"^6.11.2","uuid":"^9.0.1","vue":"^3.3.4","vue-html-to-paper":"^2.0.3","vue-router":"^4.2.2","vue-tailwind-datepicker":"^1.6.1","vue3-star-ratings":"^3.0.5"},"devDependencies":{"@rushstack/eslint-patch":"^1.5.1","@tailwindcss/aspect-ratio":"^0.4.2","@tailwindcss/container-queries":"^0.1.1","@tailwindcss/forms":"^0.5.7","@tailwindcss/typography":"^0.5.10","@tsconfig/node18":"^2.0.1","@types/file-saver":"^2.0.6","@types/jsdom":"^21.1.1","@types/node":"^18.16.17","@vitejs/plugin-vue":"^4.2.3","@vitejs/plugin-vue-jsx":"^3.0.1","@vue/eslint-config-prettier":"^8.0.0","@vue/eslint-config-typescript":"^12.0.0","@vue/test-utils":"^2.3.2","@vue/tsconfig":"^0.4.0","autoprefixer":"^10.4.14","eslint":"^8.39.0","eslint-plugin-vue":"^9.11.0","jsdom":"^22.1.0","npm-run-all":"^4.1.5","postcss":"^8.4.24","prettier":"^3.0.3","tailwindcss":"^3.3.2","typescript":"~5.2.2","vite":"^4.3.9","vitest":"^1.3.1","vue-tsc":"^2.0.5"}}
|
@ -1,7 +1,11 @@
|
|||||||
APP_NAME=example
|
APP_NAME=PLN Gitea
|
||||||
RUN_USER=gitea
|
RUN_USER=gitea
|
||||||
RUN_MODE=prod
|
RUN_MODE=prod
|
||||||
WORK_PATH=/opt/bitnami/gitea
|
WORK_PATH=/opt/bitnami/gitea
|
||||||
|
QUEUE_LENGTH=1000
|
||||||
|
DELIVER_TIMEOUT=30
|
||||||
|
SKIP_TLS_VERIFY=false
|
||||||
|
PAGING_NUM=3
|
||||||
|
|
||||||
[repository]
|
[repository]
|
||||||
ROOT=/opt/bitnami/gitea/data/git/repositories
|
ROOT=/opt/bitnami/gitea/data/git/repositories
|
||||||
@ -25,9 +29,9 @@ LOG_SQL=false
|
|||||||
|
|
||||||
[server]
|
[server]
|
||||||
DOMAIN=localhost
|
DOMAIN=localhost
|
||||||
HTTP_PORT=3000
|
HTTP_PORT=32443
|
||||||
PROTOCOL=http
|
PROTOCOL=http
|
||||||
ROOT_URL=http://localhost:3000
|
ROOT_URL=http://10.1.50.173:32443
|
||||||
APP_DATA_PATH=/opt/bitnami/gitea/data
|
APP_DATA_PATH=/opt/bitnami/gitea/data
|
||||||
DISABLE_SSH=false
|
DISABLE_SSH=false
|
||||||
START_SSH_SERVER=true
|
START_SSH_SERVER=true
|
||||||
@ -78,7 +82,6 @@ NO_REPLY_ADDRESS=
|
|||||||
|
|
||||||
[openid]
|
[openid]
|
||||||
ENABLE_OPENID_SIGNIN=false
|
ENABLE_OPENID_SIGNIN=false
|
||||||
ENABLE_OPENID_SIGNUP=false
|
|
||||||
|
|
||||||
[cron.update_checker]
|
[cron.update_checker]
|
||||||
ENABLED=false
|
ENABLED=false
|
||||||
@ -93,8 +96,4 @@ DEFAULT_TRUST_MODEL=committer
|
|||||||
JWT_SECRET=kcpMlf3SqetVDc_HfS5gMhTbEjE6hC2madu0wF-Pq9g
|
JWT_SECRET=kcpMlf3SqetVDc_HfS5gMhTbEjE6hC2madu0wF-Pq9g
|
||||||
|
|
||||||
[webhook]
|
[webhook]
|
||||||
QUEUE_LENGTH=1000
|
|
||||||
DELIVER_TIMEOUT=30
|
|
||||||
ALLOWED_HOST_LIST=*
|
ALLOWED_HOST_LIST=*
|
||||||
SKIP_TLS_VERIFY=false
|
|
||||||
PAGING_NUM=3
|
|
||||||
|
@ -1,99 +0,0 @@
|
|||||||
APP_NAME = Gitea: Git with a cup of tea
|
|
||||||
RUN_USER = gitea
|
|
||||||
RUN_MODE = prod
|
|
||||||
|
|
||||||
[repository]
|
|
||||||
ROOT = /opt/bitnami/gitea/data/git/repositories
|
|
||||||
|
|
||||||
[repository.local]
|
|
||||||
LOCAL_COPY_PATH =/opt/bitnami/gitea/tmp/local-repo
|
|
||||||
|
|
||||||
[repository.upload]
|
|
||||||
TEMP_PATH = /opt/bitnami/gitea/tmp/uploads
|
|
||||||
|
|
||||||
[database]
|
|
||||||
DB_TYPE = postgres
|
|
||||||
HOST = postgresql:5432
|
|
||||||
NAME = bitnami_gitea
|
|
||||||
USER = bn_gitea
|
|
||||||
PASSWD = U39vSmVbXs
|
|
||||||
SSL_MODE=disable
|
|
||||||
SCHEMA=
|
|
||||||
PATH=
|
|
||||||
LOG_SQL=false
|
|
||||||
|
|
||||||
[server]
|
|
||||||
DOMAIN = localhost
|
|
||||||
HTTP_PORT = 3000
|
|
||||||
PROTOCOL = http
|
|
||||||
ROOT_URL = http://localhost:3000
|
|
||||||
APP_DATA_PATH = /opt/bitnami/gitea/data
|
|
||||||
DISABLE_SSH = false
|
|
||||||
START_SSH_SERVER = true
|
|
||||||
SSH_PORT = 22
|
|
||||||
SSH_LISTEN_PORT = 2222
|
|
||||||
SSH_DOMAIN = localhost
|
|
||||||
BUILTIN_SSH_SERVER_USER = gitea
|
|
||||||
LFS_START_SERVER = false
|
|
||||||
OFFLINE_MODE=false
|
|
||||||
|
|
||||||
[mailer]
|
|
||||||
ENABLED = false
|
|
||||||
|
|
||||||
[session]
|
|
||||||
PROVIDER_CONFIG = /opt/bitnami/gitea/data/sessions
|
|
||||||
PROVIDER=file
|
|
||||||
|
|
||||||
[picture]
|
|
||||||
AVATAR_UPLOAD_PATH = /opt/bitnami/gitea/data/avatars
|
|
||||||
REPOSITORY_AVATAR_UPLOAD_PATH = /opt/bitnami/gitea/data/repo-avatars
|
|
||||||
|
|
||||||
[attachment]
|
|
||||||
PATH = /opt/bitnami/gitea/data/attachments
|
|
||||||
|
|
||||||
[log]
|
|
||||||
ROOT_PATH = /opt/bitnami/gitea/tmp/log
|
|
||||||
MODE=console
|
|
||||||
LEVEL=info
|
|
||||||
|
|
||||||
[security]
|
|
||||||
PASSWORD_HASH_ALGO = pbkdf2
|
|
||||||
REVERSE_PROXY_LIMIT = 1
|
|
||||||
REVERSE_PROXY_TRUSTED_PROXIES = *
|
|
||||||
INSTALL_LOCK=true
|
|
||||||
INTERNAL_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE3MDc3MTAyODF9.gAVc1ZLcnFEf3TcoB4p9Q6GS8vJG_DIqZOazMd6XZi8
|
|
||||||
|
|
||||||
[service]
|
|
||||||
REGISTER_EMAIL_CONFIRM=false
|
|
||||||
ENABLE_NOTIFY_MAIL=false
|
|
||||||
DISABLE_REGISTRATION=false
|
|
||||||
ALLOW_ONLY_EXTERNAL_REGISTRATION=false
|
|
||||||
ENABLE_CAPTCHA=false
|
|
||||||
REQUIRE_SIGNIN_VIEW=false
|
|
||||||
DEFAULT_KEEP_EMAIL_PRIVATE=false
|
|
||||||
DEFAULT_ALLOW_CREATE_ORGANIZATION=false
|
|
||||||
DEFAULT_ENABLE_TIMETRACKING=false
|
|
||||||
NO_REPLY_ADDRESS=
|
|
||||||
|
|
||||||
[openid]
|
|
||||||
ENABLE_OPENID_SIGNIN=false
|
|
||||||
ENABLE_OPENID_SIGNUP=false
|
|
||||||
|
|
||||||
[cron.update_checker]
|
|
||||||
ENABLED=false
|
|
||||||
|
|
||||||
[repository.pull-request]
|
|
||||||
DEFAULT_MERGE_STYLE=merge
|
|
||||||
|
|
||||||
[repository.signing]
|
|
||||||
DEFAULT_TRUST_MODEL=committer
|
|
||||||
|
|
||||||
[oauth2]
|
|
||||||
JWT_SECRET=kcpMlf3SqetVDc_HfS5gMhTbEjE6hC2madu0wF-Pq9g
|
|
||||||
|
|
||||||
[webhook]
|
|
||||||
QUEUE_LENGTH=1000
|
|
||||||
DELIVER_TIMEOUT=30
|
|
||||||
ALLOWED_HOST_LIST=*
|
|
||||||
SKIP_TLS_VERIFY=false
|
|
||||||
PAGING_NUM=3
|
|
@ -1 +1 @@
|
|||||||
{"version":"0.0.184-vm"}
|
{"version":"0.0.193-vm"}
|
@ -89,15 +89,12 @@ onMounted(() => {
|
|||||||
keys.forEach((key: any, index: any) => {
|
keys.forEach((key: any, index: any) => {
|
||||||
if (filterPresets.value[key]) {
|
if (filterPresets.value[key]) {
|
||||||
presetValues[index].value = filterPresets.value[key]
|
presetValues[index].value = filterPresets.value[key]
|
||||||
|
|
||||||
if (key !== 'uid') {
|
|
||||||
setFunctions[index](filterPresets.value[key])
|
setFunctions[index](filterPresets.value[key])
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
|
|
||||||
fetchUid()
|
fetchUid()
|
||||||
|
}
|
||||||
|
|
||||||
emit('update:filters', data.value)
|
emit('update:filters', data.value)
|
||||||
})
|
})
|
||||||
|
@ -165,15 +165,12 @@ onMounted(() => {
|
|||||||
keys.forEach((key: any, index: any) => {
|
keys.forEach((key: any, index: any) => {
|
||||||
if (filterPresets.value[key]) {
|
if (filterPresets.value[key]) {
|
||||||
presetValues[index].value = filterPresets.value[key]
|
presetValues[index].value = filterPresets.value[key]
|
||||||
|
|
||||||
if (key !== 'uid') {
|
|
||||||
setFunctions[index](filterPresets.value[key])
|
setFunctions[index](filterPresets.value[key])
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
|
|
||||||
fetchUid()
|
fetchUid()
|
||||||
|
}
|
||||||
|
|
||||||
emit('update:filters', data.value)
|
emit('update:filters', data.value)
|
||||||
})
|
})
|
||||||
|
@ -122,15 +122,12 @@ onMounted(() => {
|
|||||||
keys.forEach((key: any, index: any) => {
|
keys.forEach((key: any, index: any) => {
|
||||||
if (filterPresets.value[key]) {
|
if (filterPresets.value[key]) {
|
||||||
presetValues[index].value = filterPresets.value[key]
|
presetValues[index].value = filterPresets.value[key]
|
||||||
|
|
||||||
if (key !== 'uid') {
|
|
||||||
setFunctions[index](filterPresets.value[key])
|
setFunctions[index](filterPresets.value[key])
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
|
|
||||||
fetchUid()
|
fetchUid()
|
||||||
|
}
|
||||||
|
|
||||||
emit('update:filters', data.value)
|
emit('update:filters', data.value)
|
||||||
})
|
})
|
||||||
|
@ -90,15 +90,12 @@ onMounted(() => {
|
|||||||
keys.forEach((key: any, index: any) => {
|
keys.forEach((key: any, index: any) => {
|
||||||
if (filterPresets.value[key]) {
|
if (filterPresets.value[key]) {
|
||||||
presetValues[index].value = filterPresets.value[key]
|
presetValues[index].value = filterPresets.value[key]
|
||||||
|
|
||||||
if (key !== 'uid') {
|
|
||||||
setFunctions[index](filterPresets.value[key])
|
setFunctions[index](filterPresets.value[key])
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
|
|
||||||
fetchUid()
|
fetchUid()
|
||||||
|
}
|
||||||
|
|
||||||
emit('update:filters', data.value)
|
emit('update:filters', data.value)
|
||||||
})
|
})
|
||||||
|
@ -173,15 +173,12 @@ onMounted(() => {
|
|||||||
keys.forEach((key: any, index: any) => {
|
keys.forEach((key: any, index: any) => {
|
||||||
if (filterPresets.value[key]) {
|
if (filterPresets.value[key]) {
|
||||||
presetValues[index].value = filterPresets.value[key]
|
presetValues[index].value = filterPresets.value[key]
|
||||||
|
|
||||||
if (key !== 'uid') {
|
|
||||||
setFunctions[index](filterPresets.value[key])
|
setFunctions[index](filterPresets.value[key])
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
|
|
||||||
fetchUid()
|
fetchUid()
|
||||||
|
}
|
||||||
|
|
||||||
emit('update:filters', data.value)
|
emit('update:filters', data.value)
|
||||||
})
|
})
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
selectedUid,
|
selectedUid,
|
||||||
selectedUp3Ulp,
|
selectedUp3Ulp,
|
||||||
fetchRegional,
|
fetchRegional,
|
||||||
fetchUid,
|
selectedRegional,
|
||||||
itemsUid,
|
itemsUid,
|
||||||
itemsUp3,
|
itemsUp3,
|
||||||
itemsUlp,
|
itemsUlp,
|
||||||
@ -67,11 +67,7 @@ watch(data, (value) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const setRegional = (value: any) => {
|
const setRegional = (value: any) => {
|
||||||
if (!presetUID.value) {
|
selectedRegional(value)
|
||||||
fetchUid()
|
|
||||||
selectedUid(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
data.value = {
|
data.value = {
|
||||||
...data.value,
|
...data.value,
|
||||||
regional: value
|
regional: value
|
||||||
@ -119,7 +115,6 @@ const setUp3 = (value: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const setUlp = (value: any) => {
|
const setUlp = (value: any) => {
|
||||||
selectedUp3Ulp(value)
|
|
||||||
data.value = {
|
data.value = {
|
||||||
...data.value,
|
...data.value,
|
||||||
ulp: value
|
ulp: value
|
||||||
@ -155,15 +150,12 @@ onMounted(() => {
|
|||||||
if (filterPresets.value[key]) {
|
if (filterPresets.value[key]) {
|
||||||
presetValues[index].value = filterPresets.value[key]
|
presetValues[index].value = filterPresets.value[key]
|
||||||
|
|
||||||
if (key !== 'regional' || key !== 'uid') {
|
|
||||||
setFunctions[index](filterPresets.value[key])
|
setFunctions[index](filterPresets.value[key])
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
|
|
||||||
fetchRegional()
|
fetchRegional()
|
||||||
fetchUid()
|
}
|
||||||
|
|
||||||
emit('update:filters', data.value)
|
emit('update:filters', data.value)
|
||||||
})
|
})
|
||||||
|
@ -88,15 +88,12 @@ onMounted(() => {
|
|||||||
keys.forEach((key: any, index: any) => {
|
keys.forEach((key: any, index: any) => {
|
||||||
if (filterPresets.value[key]) {
|
if (filterPresets.value[key]) {
|
||||||
presetValues[index].value = filterPresets.value[key]
|
presetValues[index].value = filterPresets.value[key]
|
||||||
|
|
||||||
if (key !== 'uid') {
|
|
||||||
setFunctions[index](filterPresets.value[key])
|
setFunctions[index](filterPresets.value[key])
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
|
|
||||||
fetchUid()
|
fetchUid()
|
||||||
|
}
|
||||||
|
|
||||||
emit('update:filters', data.value)
|
emit('update:filters', data.value)
|
||||||
})
|
})
|
||||||
|
@ -99,15 +99,12 @@ onMounted(() => {
|
|||||||
keys.forEach((key: any, index: any) => {
|
keys.forEach((key: any, index: any) => {
|
||||||
if (filterPresets.value[key]) {
|
if (filterPresets.value[key]) {
|
||||||
presetValues[index].value = filterPresets.value[key]
|
presetValues[index].value = filterPresets.value[key]
|
||||||
|
|
||||||
if (key !== 'uid') {
|
|
||||||
setFunctions[index](filterPresets.value[key])
|
setFunctions[index](filterPresets.value[key])
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
} else {
|
||||||
|
|
||||||
fetchUid()
|
fetchUid()
|
||||||
|
}
|
||||||
|
|
||||||
emit('update:filters', data.value)
|
emit('update:filters', data.value)
|
||||||
})
|
})
|
||||||
|
@ -132,6 +132,11 @@ const fetchDataPosko = async (up3: number) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const fetchRegional = async () => {
|
const fetchRegional = async () => {
|
||||||
|
itemsUid.value = []
|
||||||
|
itemsUp3.value = []
|
||||||
|
itemsPosko.value = []
|
||||||
|
itemsUlp.value = []
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await getRegional()
|
const res = await getRegional()
|
||||||
itemsRegional.value = res.data.map((item: any) => ({
|
itemsRegional.value = res.data.map((item: any) => ({
|
||||||
@ -157,6 +162,13 @@ const formatWaktu = (durasiDetik: any): string => {
|
|||||||
return `${hari} - ${jam} : ${menit} : ${detik}`
|
return `${hari} - ${jam} : ${menit} : ${detik}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const selectedRegional = (value: any) => {
|
||||||
|
fetchUidByRegional(value.id)
|
||||||
|
itemsUid.value = []
|
||||||
|
itemsUp3.value = []
|
||||||
|
itemsPosko.value = []
|
||||||
|
itemsUlp.value = []
|
||||||
|
}
|
||||||
|
|
||||||
const selectedUid = (value: any) => {
|
const selectedUid = (value: any) => {
|
||||||
fetchDataUp3(value.id)
|
fetchDataUp3(value.id)
|
||||||
@ -203,5 +215,6 @@ export {
|
|||||||
itemsUlp,
|
itemsUlp,
|
||||||
months,
|
months,
|
||||||
years,
|
years,
|
||||||
formatWaktu
|
formatWaktu,
|
||||||
|
selectedRegional
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
<DxColumn
|
<DxColumn
|
||||||
v-if="grouping.length > 0"
|
v-if="grouping.length > 0"
|
||||||
v-for="(group, index) in grouping"
|
v-for="(group, index) in grouping"
|
||||||
|
:key="index"
|
||||||
:width="150"
|
:width="150"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:data-field="group.data"
|
:data-field="group.data"
|
||||||
|
@ -411,7 +411,7 @@
|
|||||||
cell-template="formatNumber"
|
cell-template="formatNumber"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
:width="150"
|
:width="200"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
data-field="nama_uid"
|
data-field="nama_uid"
|
||||||
caption="UIW/D"
|
caption="UIW/D"
|
||||||
@ -526,7 +526,7 @@
|
|||||||
cell-template="formatText"
|
cell-template="formatText"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
:width="150"
|
:width="250"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
data-field="alamat_pelapor"
|
data-field="alamat_pelapor"
|
||||||
caption="Alamat Pelapor"
|
caption="Alamat Pelapor"
|
||||||
@ -542,7 +542,7 @@
|
|||||||
cell-template="formatText"
|
cell-template="formatText"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
:width="150"
|
:width="250"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
data-field="keterangan_pelapor"
|
data-field="keterangan_pelapor"
|
||||||
caption="Keterangan Pelapor"
|
caption="Keterangan Pelapor"
|
||||||
@ -550,7 +550,7 @@
|
|||||||
cell-template="formatText"
|
cell-template="formatText"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
:width="150"
|
:width="250"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
data-field="uraian"
|
data-field="uraian"
|
||||||
caption="Uraian"
|
caption="Uraian"
|
||||||
@ -606,13 +606,23 @@
|
|||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">No Laporan:</h3>
|
<h3 class="text-sm font-medium w-[135px] text-gray-800">No Laporan:</h3>
|
||||||
<InputText
|
<InputText
|
||||||
|
v-if="filters.jenisLaporan.name === 'Laporan Berulang Unit'"
|
||||||
:readonly="true"
|
:readonly="true"
|
||||||
:value="dataSubSelected?.no_laporan_anomali"
|
:value="dataSubSelected?.no_laporan_anomali"
|
||||||
class-name="flex-1"
|
class-name="flex-1"
|
||||||
/>
|
/>
|
||||||
|
<InputText
|
||||||
|
v-else
|
||||||
|
:readonly="true"
|
||||||
|
:value="dataSubSelected?.no_laporan"
|
||||||
|
class-name="flex-1"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div
|
||||||
|
v-if="filters.jenisLaporan.name === 'Laporan Berulang Unit'"
|
||||||
|
class="flex flex-row items-center justify-between w-full"
|
||||||
|
>
|
||||||
<h3 class="text-sm font-medium w-[135px] text-gray-800">No Laporan Referensi:</h3>
|
<h3 class="text-sm font-medium w-[135px] text-gray-800">No Laporan Referensi:</h3>
|
||||||
<InputText
|
<InputText
|
||||||
:readonly="true"
|
:readonly="true"
|
||||||
|
@ -1240,7 +1240,8 @@ const getDetail = async () => {
|
|||||||
idPosko: posko ? posko.id : 0,
|
idPosko: posko ? posko.id : 0,
|
||||||
idUid: uid ? uid.id : 0,
|
idUid: uid ? uid.id : 0,
|
||||||
idUp3: up3 ? up3.id : 0,
|
idUp3: up3 ? up3.id : 0,
|
||||||
personilYantek: isTotal.value ? '' : selected?.personil_yantek ? selected?.personil_yantek : ''
|
personilYantek: isTotal.value ? '' : selected?.personil_yantek ? selected?.personil_yantek : '',
|
||||||
|
userRegu: isTotal.value ? '' : selected?.user_regu ? selected?.user_regu : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
loadingSubData.value = true
|
loadingSubData.value = true
|
||||||
|
@ -985,6 +985,8 @@ const onCellClicked = (e: any) => {
|
|||||||
if (e.rowType == 'group') {
|
if (e.rowType == 'group') {
|
||||||
groupDialog.value = true
|
groupDialog.value = true
|
||||||
groupIndex.value = e.row.groupIndex
|
groupIndex.value = e.row.groupIndex
|
||||||
|
} else {
|
||||||
|
groupDialog.value = false
|
||||||
}
|
}
|
||||||
isDialogEnabled.value = true
|
isDialogEnabled.value = true
|
||||||
|
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type16 @update:filters="(value) => (filters = value)" />
|
<Type16 @update:filters="(value) => (filters = value)" />
|
||||||
</Filters>
|
</Filters>
|
||||||
|
|
||||||
<div id="data">
|
<div id="data">
|
||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
|
@option-changed="handleRequestChange"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loading == false"
|
:remote-operations="true"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
@ -21,6 +22,7 @@
|
|||||||
:allow-column-resizing="true"
|
:allow-column-resizing="true"
|
||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
>
|
>
|
||||||
|
<DxLoadPanel :enabled="true" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :page-size="20" :enabled="true" />
|
<DxPaging :page-size="20" :enabled="true" />
|
||||||
<DxPager
|
<DxPager
|
||||||
@ -31,16 +33,6 @@
|
|||||||
:show-info="true"
|
:show-info="true"
|
||||||
:show-navigation-buttons="true"
|
:show-navigation-buttons="true"
|
||||||
/>
|
/>
|
||||||
<!-- <DxLoadPanel
|
|
||||||
shading-color="rgba(0,0,0,0.4)"
|
|
||||||
:position="position"
|
|
||||||
:show-indicator="showIndicator"
|
|
||||||
:show-pane="showPane"
|
|
||||||
:shading="shading"
|
|
||||||
v-if="loading"
|
|
||||||
v-model:visible="loading"
|
|
||||||
:enabled="true"
|
|
||||||
/> -->
|
|
||||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||||
<DxExport
|
<DxExport
|
||||||
:enabled="true"
|
:enabled="true"
|
||||||
@ -48,11 +40,12 @@
|
|||||||
:allow-export-selected-data="false"
|
:allow-export-selected-data="false"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column"
|
:allow-sorting="false"
|
||||||
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -282,8 +275,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
|
|
||||||
<BufferDialog v-if="loading" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -291,8 +282,10 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
|||||||
import InputText from '@/components/InputText.vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type16 from '@/components/Form/FiltersType/Type16.vue'
|
import Type16 from '@/components/Form/FiltersType/Type16.vue'
|
||||||
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import { onMounted, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
@ -303,46 +296,162 @@ import {
|
|||||||
DxSearchPanel,
|
DxSearchPanel,
|
||||||
DxSelection
|
DxSelection
|
||||||
} from 'devextreme-vue/data-grid'
|
} from 'devextreme-vue/data-grid'
|
||||||
import { useQuery } from '@vue/apollo-composable'
|
|
||||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||||
import { exportToPDF, exportToDOCX, exportToXLSX } from '@/report/Gangguan/Daftar/DGangguan_BM'
|
import { exportToPDF, exportToDOCX, exportToXLSX } from '@/report/Gangguan/Daftar/DGangguan_BM'
|
||||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
|
||||||
|
|
||||||
const position = { of: '#data' }
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
const showIndicator = ref(true)
|
|
||||||
const shading = ref(true)
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
const showPane = ref(true)
|
skip: 0,
|
||||||
const data = ref<any[]>([])
|
take: 20,
|
||||||
|
requireTotalCount: true,
|
||||||
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
const dataSelected = ref<any>({})
|
const dataSelected = ref<any>({})
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
|
const reportData: any = ref(null)
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
const loading = ref(false)
|
const filters = ref()
|
||||||
const clearSelection = () => {
|
const reportMeta = ref({
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
dataGrid.clearSelection()
|
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||||
}
|
posko: { id: 0, name: 'Semua Posko' },
|
||||||
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
media: { id: '', name: 'Semua Media' },
|
||||||
if (selectedRowsData[0] != undefined) {
|
periode: ''
|
||||||
dataSelected.value = selectedRowsData[0]
|
})
|
||||||
}
|
|
||||||
clearSelection()
|
const allowTableRequest = ref(false)
|
||||||
showDetail()
|
const data = new CustomStore({
|
||||||
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const showDetail = () => (dialogDetail.value = true)
|
return await requestGraphQl(queries.gangguan.daftar.ssdaftarGangguanBerdasarkanMedia, query)
|
||||||
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarGangguanBerdasarkanMedia
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const closeDialog = () => (dialogDetail.value = false)
|
const closeDialog = () => (dialogDetail.value = false)
|
||||||
|
|
||||||
const resetData = () => {
|
const resetData = () => {
|
||||||
data.value = []
|
allowTableRequest.value = false
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
const handleRequestChange = (e: any) => {
|
||||||
resetData()
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
const { posko, uid, up3, media } = params
|
const { posko, uid, up3, media } = params
|
||||||
const dateValue = params.periode.split(' s/d ')
|
const dateValue = params.periode.split(' s/d ')
|
||||||
|
|
||||||
const query = {
|
return {
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
@ -354,140 +463,46 @@ const filterData = async (params: any) => {
|
|||||||
idUp3: up3 ? up3.id : 0,
|
idUp3: up3 ? up3.id : 0,
|
||||||
media: media ? media.id : ''
|
media: media ? media.id : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.value = true
|
|
||||||
await requestGraphQl(queries.gangguan.daftar.berdasarkanMedia, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarGangguanBerdasarkanMedia
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
const clearSelection = () => {
|
||||||
})
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
.catch((err) => {
|
dataGrid.clearSelection()
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
if (e.format === 'pdf') {
|
if (selectedRowsData[0] != undefined) {
|
||||||
exportToPDF(reportMeta, data)
|
dataSelected.value = selectedRowsData[0]
|
||||||
|
}
|
||||||
|
clearSelection()
|
||||||
|
showDetail()
|
||||||
|
}
|
||||||
|
|
||||||
|
const showDetail = () => (dialogDetail.value = true)
|
||||||
|
|
||||||
|
const onExporting = async (e: any) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
|
||||||
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
|
reportData.value = await data.load()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
|
dataGrid.beginCustomLoading('')
|
||||||
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
|
|
||||||
|
if (pdf) {
|
||||||
|
dataGrid.endCustomLoading()
|
||||||
|
}
|
||||||
} else if (e.format === 'xlsx') {
|
} else if (e.format === 'xlsx') {
|
||||||
exportToXLSX(reportMeta, data, e)
|
exportToXLSX(reportMeta, e)
|
||||||
} else {
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
exportToDOCX(reportMeta, data)
|
dataGrid.beginCustomLoading('')
|
||||||
}
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
}
|
|
||||||
|
|
||||||
const filters = ref()
|
if (doc) {
|
||||||
const reportMeta = ref({
|
dataGrid.endCustomLoading()
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
}
|
||||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
|
||||||
posko: { id: 0, name: 'Semua Posko' },
|
|
||||||
media: { id: '', name: 'Semua Media' },
|
|
||||||
periode: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (import.meta.env.DEV) {
|
|
||||||
data.value = [
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020100150',
|
|
||||||
waktu_lapor: '31-01-2023 17:16:17',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_response: '31-01-2023 17:56:28',
|
|
||||||
waktu_recovery: '31-01-2023 18:00:37',
|
|
||||||
durasi_response_time: 2411,
|
|
||||||
durasi_recovery_time: 249,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Raihana S. Rahmahadi',
|
|
||||||
alamat_pelapor: 'JL BKT RAFLESIA N8-16',
|
|
||||||
no_telp_pelapor: '6282138889101',
|
|
||||||
keterangan_media: 'x',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
waktu_media: '31-12-1969 17:00:00',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020100985',
|
|
||||||
waktu_lapor: '31-01-2023 20:09:50',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_response: '31-01-2023 20:42:40',
|
|
||||||
waktu_recovery: '31-01-2023 20:49:35',
|
|
||||||
durasi_response_time: 1970,
|
|
||||||
durasi_recovery_time: 415,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Risky Ariyanto',
|
|
||||||
alamat_pelapor: 'JL JANKES AD No. RT.7 RW.2',
|
|
||||||
no_telp_pelapor: '6285240208016',
|
|
||||||
keterangan_media: 'x',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
waktu_media: '31-12-1969 17:00:00',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020101461',
|
|
||||||
waktu_lapor: '31-01-2023 22:38:01',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_response: '31-01-2023 22:48:13',
|
|
||||||
waktu_recovery: '31-01-2023 22:54:06',
|
|
||||||
durasi_response_time: 612,
|
|
||||||
durasi_recovery_time: 353,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Junaedi Muntoro',
|
|
||||||
alamat_pelapor: 'PR BKT GOLF ARCADIA BLK G.06 No.5 CBBR',
|
|
||||||
no_telp_pelapor: '628111588806',
|
|
||||||
keterangan_media: 'x',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
waktu_media: '31-12-1969 17:00:00',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5523020100067',
|
|
||||||
waktu_lapor: '31-01-2023 22:57:02',
|
|
||||||
pembuat_laporan: 'CC.55.SUMIATI',
|
|
||||||
waktu_response: '31-01-2023 23:18:55',
|
|
||||||
waktu_recovery: '31-12-1969 17:00:00',
|
|
||||||
durasi_response_time: 1313,
|
|
||||||
durasi_recovery_time: 33945870,
|
|
||||||
status_akhir: 'Dibatalkan',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP ANAL ',
|
|
||||||
alamat_pelapor: 'JL MANUNGGAL RT 05 RW 02 KEL KELAPA DUA WETAN KEC CIRACAS JAKARTA TIMUR ',
|
|
||||||
no_telp_pelapor: '6285777592240',
|
|
||||||
keterangan_media: 'x',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
waktu_media: '31-12-1969 17:00:00',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020103015',
|
|
||||||
waktu_lapor: '01-02-2023 00:39:03',
|
|
||||||
pembuat_laporan: 'CC.54.EKA.CSOI',
|
|
||||||
waktu_response: '01-02-2023 01:14:56',
|
|
||||||
waktu_recovery: '01-02-2023 01:19:32',
|
|
||||||
durasi_response_time: 2153,
|
|
||||||
durasi_recovery_time: 276,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'IBU DIN',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL. HAJI MIUN NO.97 RT. 1 RW 2 KEL KALISARI KEC. PASAR REBO JAKTIM, SEBERANG CAFE LAW COFFE ',
|
|
||||||
no_telp_pelapor: '082112050265',
|
|
||||||
keterangan_media: 'x',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
waktu_media: '31-12-1969 17:00:00',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type1 @update:filters="(value) => (filters = value)" />
|
<Type1 @update:filters="(value) => (filters = value)" />
|
||||||
</Filters>
|
</Filters>
|
||||||
|
|
||||||
<div id="dataTable">
|
<div id="dataTable">
|
||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
|
@option-changed="handleRequestChange"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loading == false"
|
:remote-operations="true"
|
||||||
key-expr="no_laporan"
|
key-expr="no_laporan"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
@ -22,6 +23,7 @@
|
|||||||
:allow-column-resizing="true"
|
:allow-column-resizing="true"
|
||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
>
|
>
|
||||||
|
<DxLoadPanel :enabled="true" />
|
||||||
<DxPaging :page-size="20" :enabled="true" :page-index="0" />
|
<DxPaging :page-size="20" :enabled="true" :page-index="0" />
|
||||||
<DxPager
|
<DxPager
|
||||||
:visible="true"
|
:visible="true"
|
||||||
@ -32,17 +34,6 @@
|
|||||||
:show-navigation-buttons="true"
|
:show-navigation-buttons="true"
|
||||||
/>
|
/>
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<!-- <DxScrolling column-rendering-mode="virtual" mode="virtual" row-rendering-mode="virtual" /> -->
|
|
||||||
<!-- <DxLoadPanel
|
|
||||||
shading-color="rgba(0,0,0,0.4)"
|
|
||||||
:position="position"
|
|
||||||
:show-indicator="showIndicator"
|
|
||||||
:show-pane="showPane"
|
|
||||||
:shading="shading"
|
|
||||||
v-if="loading"
|
|
||||||
v-model:visible="loading"
|
|
||||||
:enabled="true"
|
|
||||||
/> -->
|
|
||||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||||
<DxExport
|
<DxExport
|
||||||
:enabled="true"
|
:enabled="true"
|
||||||
@ -50,11 +41,12 @@
|
|||||||
:allow-export-selected-data="false"
|
:allow-export-selected-data="false"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
|
:allow-sorting="false"
|
||||||
css-class="custom-table-column !text-right"
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
@ -320,7 +312,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
<h3 class="text-sm font-medium w-[170px] text-gray-800">Pembuat Laporan:</h3>
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">No Telp Pelapor:</h3>
|
||||||
<InputText :readonly="true" :value="dataSelected?.no_telp_pelapor" class-name="flex-1" />
|
<InputText :readonly="true" :value="dataSelected?.no_telp_pelapor" class-name="flex-1" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -335,18 +327,20 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
<h3 class="text-sm font-medium w-[170px] text-gray-800">Posko:</h3>
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">Unit Layanan Pelanggan:</h3>
|
||||||
<InputText :readonly="true" :value="dataSelected?.nama_posko_lama" class-name="flex-1" />
|
<InputText :readonly="true" :value="dataSelected?.nama_posko_lama" class-name="flex-1" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
|
|
||||||
<BufferDialog v-if="loading" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type1 from '@/components/Form/FiltersType/Type1.vue'
|
import Type1 from '@/components/Form/FiltersType/Type1.vue'
|
||||||
|
import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
||||||
|
import InputText from '@/components/InputText.vue'
|
||||||
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
@ -354,32 +348,169 @@ import {
|
|||||||
DxPager,
|
DxPager,
|
||||||
DxPaging,
|
DxPaging,
|
||||||
DxSearchPanel,
|
DxSearchPanel,
|
||||||
DxSelection
|
DxSelection,
|
||||||
|
DxLoadPanel
|
||||||
} from 'devextreme-vue/data-grid'
|
} from 'devextreme-vue/data-grid'
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import { onMounted, ref } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
|
||||||
import InputText from '@/components/InputText.vue'
|
|
||||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||||
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Gangguan/Daftar/DGangguan_DKPL'
|
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Gangguan/Daftar/DGangguan_DKPL'
|
||||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
|
||||||
|
|
||||||
const data = ref<any[]>([])
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
|
|
||||||
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
|
skip: 0,
|
||||||
|
take: 20,
|
||||||
|
requireTotalCount: true,
|
||||||
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
const dataSelected = ref<any>()
|
const dataSelected = ref<any>()
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
const loading = ref(false)
|
const reportData: any = ref(null)
|
||||||
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
|
const filters = ref()
|
||||||
|
const reportMeta = ref({
|
||||||
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
|
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||||
|
posko: { id: 0, name: 'Semua Posko' },
|
||||||
|
periode: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
const allowTableRequest = ref(false)
|
||||||
|
const data = new CustomStore({
|
||||||
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
return await requestGraphQl(
|
||||||
|
queries.gangguan.daftar.ssdaftarGangguanDialihkanKePoskoLain,
|
||||||
|
query
|
||||||
|
)
|
||||||
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarGangguanDialihkanKePoskoLain
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const closeDialog = () => (dialogDetail.value = false)
|
const closeDialog = () => (dialogDetail.value = false)
|
||||||
|
|
||||||
const resetData = () => {
|
const resetData = () => {
|
||||||
data.value = []
|
allowTableRequest.value = false
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
const handleRequestChange = (e: any) => {
|
||||||
resetData()
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
const { posko, uid, up3 } = params
|
const { posko, uid, up3 } = params
|
||||||
const dateValue = params.periode.split(' s/d ')
|
const dateValue = params.periode.split(' s/d ')
|
||||||
|
|
||||||
const query = {
|
return {
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
@ -390,175 +521,48 @@ const filterData = async (params: any) => {
|
|||||||
idUid: uid ? uid.id : 0,
|
idUid: uid ? uid.id : 0,
|
||||||
idUp3: up3 ? up3.id : 0
|
idUp3: up3 ? up3.id : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(query)
|
|
||||||
|
|
||||||
loading.value = true
|
|
||||||
await requestGraphQl(queries.gangguan.daftar.dataDialihkanKePoskoLain, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarGangguanDialihkanKePoskoLain
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
|
||||||
const clearSelection = () => {
|
const clearSelection = () => {
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
dataGrid.clearSelection()
|
dataGrid.clearSelection()
|
||||||
}
|
}
|
||||||
|
|
||||||
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
if (selectedRowsData[0] != undefined) {
|
if (selectedRowsData[0] != undefined) {
|
||||||
dataSelected.value = selectedRowsData[0]
|
dataSelected.value = selectedRowsData[0]
|
||||||
}
|
}
|
||||||
showDetail()
|
showDetail()
|
||||||
}
|
}
|
||||||
|
|
||||||
const showDetail = () => {
|
const showDetail = () => {
|
||||||
dialogDetail.value = true
|
dialogDetail.value = true
|
||||||
clearSelection()
|
clearSelection()
|
||||||
}
|
}
|
||||||
|
|
||||||
const filters = ref()
|
const onExporting = async (e: any) => {
|
||||||
const reportMeta = ref({
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
|
||||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
|
||||||
posko: { id: 0, name: 'Semua Posko' },
|
|
||||||
periode: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
if (import.meta.env.DEV) {
|
reportData.value = await data.load()
|
||||||
data.value = [
|
|
||||||
{
|
|
||||||
no_laporan: 'G1423012400040',
|
|
||||||
pembuat_laporan: 'CC.14.ALFIAN',
|
|
||||||
waktu_lapor: '01/02/2023 13:53:36',
|
|
||||||
waktu_dialihkan: '24/01/2023 02:20:22',
|
|
||||||
waktu_response: null,
|
|
||||||
waktu_recovery: null,
|
|
||||||
durasi_response_time: null,
|
|
||||||
durasi_recovery_time: null,
|
|
||||||
id_posko_lama: 181701,
|
|
||||||
nama_posko_lama: 'POSKO ULP SIAK SRI INDRAPURA',
|
|
||||||
id_posko_baru: 181801,
|
|
||||||
nama_posko_baru: 'POSKO ULP PANGKALAN KERINCI',
|
|
||||||
status_akhir: 'Dibatalkan',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP HABIB',
|
|
||||||
alamat_pelapor: 'JL PEMBANGUNAN RT 5 RW 2 DESA RAWANG TAUH KEC LUBUK DALAM KAB SIAK ',
|
|
||||||
no_telp_pelapor: '081365027399',
|
|
||||||
keterangan_pelapor: 'GANGGUAN BERULANG : G1423012400025, BANYAK RUMAH PADAM',
|
|
||||||
media: 'Call PLN 123'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G1223012400580',
|
|
||||||
pembuat_laporan: 'CC.12.TONI',
|
|
||||||
waktu_lapor: '01/02/2023 13:53:36',
|
|
||||||
waktu_dialihkan: '24/01/2023 17:30:32',
|
|
||||||
waktu_response: null,
|
|
||||||
waktu_recovery: null,
|
|
||||||
durasi_response_time: null,
|
|
||||||
durasi_recovery_time: null,
|
|
||||||
id_posko_lama: 181101,
|
|
||||||
nama_posko_lama: 'POSKO ULP PEKANBARU KOTA TIMUR',
|
|
||||||
id_posko_baru: 181101,
|
|
||||||
nama_posko_baru: 'POSKO ULP PEKANBARU KOTA TIMUR',
|
|
||||||
status_akhir: 'Selesai(PEMADAMAN MELUAS)',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP DAUT',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL RAWAMANGUN SIMPANG ANGGREK RT01 RW8 KEL TANGERANG LUBUAY KEC BUKIT RAYA KOTA PEKANBARU RIAU ACUAN DEKAT KOLAM PANCING RIKI ',
|
|
||||||
no_telp_pelapor: '085278178766',
|
|
||||||
keterangan_pelapor: 'TRAFO MELEDAK, BANYAK RUMAH VOLTAGE TIDAK STABIL, TEGANGAN 120 V ',
|
|
||||||
media: 'Call PLN 123'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G1223012400580',
|
|
||||||
pembuat_laporan: 'CC.12.TONI',
|
|
||||||
waktu_lapor: '01/02/2023 13:53:36',
|
|
||||||
waktu_dialihkan: '24/01/2023 17:30:29',
|
|
||||||
waktu_response: null,
|
|
||||||
waktu_recovery: null,
|
|
||||||
durasi_response_time: null,
|
|
||||||
durasi_recovery_time: null,
|
|
||||||
id_posko_lama: 181111,
|
|
||||||
nama_posko_lama: 'POSKO ULP PEKANBARU KOTA BARAT',
|
|
||||||
id_posko_baru: 181101,
|
|
||||||
nama_posko_baru: 'POSKO ULP PEKANBARU KOTA TIMUR',
|
|
||||||
status_akhir: 'Selesai(PEMADAMAN MELUAS)',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP DAUT',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL RAWAMANGUN SIMPANG ANGGREK RT01 RW8 KEL TANGERANG LUBUAY KEC BUKIT RAYA KOTA PEKANBARU RIAU ACUAN DEKAT KOLAM PANCING RIKI ',
|
|
||||||
no_telp_pelapor: '085278178766',
|
|
||||||
keterangan_pelapor: 'TRAFO MELEDAK, BANYAK RUMAH VOLTAGE TIDAK STABIL, TEGANGAN 120 V ',
|
|
||||||
media: 'Call PLN 123'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G1423012400611',
|
|
||||||
pembuat_laporan: 'cc.14.OKTA',
|
|
||||||
waktu_lapor: '01/02/2023 13:53:36',
|
|
||||||
waktu_dialihkan: '24/01/2023 15:39:23',
|
|
||||||
waktu_response: null,
|
|
||||||
waktu_recovery: null,
|
|
||||||
durasi_response_time: null,
|
|
||||||
durasi_recovery_time: null,
|
|
||||||
id_posko_lama: 181201,
|
|
||||||
nama_posko_lama: 'POSKO ULP SIMPANG TIGA',
|
|
||||||
id_posko_baru: 181131,
|
|
||||||
nama_posko_baru: '',
|
|
||||||
status_akhir: 'Selesai(PEMADAMAN MELUAS)',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'IBU SURYANTI',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JLN. KEPAU JAYA RT 01 RW 03 DESA KEPAU KEC. SIAK HULU KAB. KAMPAR PROV. RIAU. DIDEKAT SIMPANG PT. BENI',
|
|
||||||
no_telp_pelapor: '082246836428',
|
|
||||||
keterangan_pelapor: 'SR PUTUS (PTL PADAM) ',
|
|
||||||
media: 'Call PLN 123'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5223012400639',
|
|
||||||
pembuat_laporan: 'CC.52.HARYO.SM',
|
|
||||||
waktu_lapor: '01/02/2023 13:53:36',
|
|
||||||
waktu_dialihkan: '24/01/2023 11:02:02',
|
|
||||||
waktu_response: null,
|
|
||||||
waktu_recovery: null,
|
|
||||||
durasi_response_time: null,
|
|
||||||
durasi_recovery_time: null,
|
|
||||||
id_posko_lama: 182601,
|
|
||||||
nama_posko_lama: 'POSKO ULP BAGAN BATU',
|
|
||||||
id_posko_baru: 181801,
|
|
||||||
nama_posko_baru: 'POSKO ULP PANGKALAN KERINCI',
|
|
||||||
status_akhir: 'Selesai(PEMADAMAN MELUAS)',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BAPAK SAOR MARUDUT',
|
|
||||||
alamat_pelapor:
|
|
||||||
'DESA BANJAR PANJANG KECAMATAN KERUMUTAN KABUPATEN PELALAWAN PROVINSI RIAU ',
|
|
||||||
no_telp_pelapor: '085278020428',
|
|
||||||
keterangan_pelapor: 'TERKAIT NO LAPOR G5423012405161 STATUS DIBATALKAN. BANYAK RUMAH PADAM',
|
|
||||||
media: 'Live Chat PLN Mobile'
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
if (e.format === 'pdf') {
|
dataGrid.beginCustomLoading('')
|
||||||
exportToPDF(reportMeta, data)
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
|
|
||||||
|
if (pdf) {
|
||||||
|
dataGrid.endCustomLoading()
|
||||||
|
}
|
||||||
} else if (e.format === 'xlsx') {
|
} else if (e.format === 'xlsx') {
|
||||||
exportToXLSX(reportMeta, e)
|
exportToXLSX(reportMeta, e)
|
||||||
} else {
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
exportToDOCX(reportMeta, data)
|
dataGrid.beginCustomLoading('')
|
||||||
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
|
|
||||||
|
if (doc) {
|
||||||
|
dataGrid.endCustomLoading()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type1 @update:filters="(value) => (filters = value)" />
|
<Type1 @update:filters="(value) => (filters = value)" />
|
||||||
</Filters>
|
</Filters>
|
||||||
|
|
||||||
<div id="data">
|
<div id="data">
|
||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
|
@option-changed="handleRequestChange"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loading == false"
|
:remote-operations="true"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
@ -21,6 +22,7 @@
|
|||||||
:allow-column-resizing="true"
|
:allow-column-resizing="true"
|
||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
>
|
>
|
||||||
|
<DxLoadPanel :enabled="true" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :page-size="20" :enabled="true" />
|
<DxPaging :page-size="20" :enabled="true" />
|
||||||
<DxPager
|
<DxPager
|
||||||
@ -31,16 +33,6 @@
|
|||||||
:show-info="true"
|
:show-info="true"
|
||||||
:show-navigation-buttons="true"
|
:show-navigation-buttons="true"
|
||||||
/>
|
/>
|
||||||
<!-- <DxLoadPanel
|
|
||||||
shading-color="rgba(0,0,0,0.4)"
|
|
||||||
:position="position"
|
|
||||||
:show-indicator="showIndicator"
|
|
||||||
:show-pane="showPane"
|
|
||||||
:shading="shading"
|
|
||||||
v-if="loading"
|
|
||||||
v-model:visible="loading"
|
|
||||||
:enabled="true"
|
|
||||||
/> -->
|
|
||||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||||
<DxExport
|
<DxExport
|
||||||
:enabled="true"
|
:enabled="true"
|
||||||
@ -48,11 +40,12 @@
|
|||||||
:allow-export-selected-data="false"
|
:allow-export-selected-data="false"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column"
|
:allow-sorting="false"
|
||||||
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -277,8 +270,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
|
|
||||||
<BufferDialog v-if="loading" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -286,8 +277,10 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
|||||||
import InputText from '@/components/InputText.vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type1 from '@/components/Form/FiltersType/Type1.vue'
|
import Type1 from '@/components/Form/FiltersType/Type1.vue'
|
||||||
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import { onMounted, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
@ -298,46 +291,164 @@ import {
|
|||||||
DxSearchPanel,
|
DxSearchPanel,
|
||||||
DxSelection
|
DxSelection
|
||||||
} from 'devextreme-vue/data-grid'
|
} from 'devextreme-vue/data-grid'
|
||||||
import { useQuery } from '@vue/apollo-composable'
|
|
||||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||||
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Gangguan/Daftar/DGangguan_DMAPKT'
|
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Gangguan/Daftar/DGangguan_DMAPKT'
|
||||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
|
||||||
|
|
||||||
const position = { of: '#data' }
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
const showIndicator = ref(true)
|
|
||||||
const shading = ref(true)
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
const showPane = ref(true)
|
skip: 0,
|
||||||
const data = ref<any[]>([])
|
take: 20,
|
||||||
|
requireTotalCount: true,
|
||||||
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
const dataSelected = ref<any>({})
|
const dataSelected = ref<any>({})
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
|
const reportData: any = ref(null)
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
const loading = ref(false)
|
const filters = ref()
|
||||||
const clearSelection = () => {
|
const reportMeta = ref({
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
dataGrid.clearSelection()
|
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||||
}
|
posko: { id: 0, name: 'Semua Posko' },
|
||||||
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
periode: ''
|
||||||
if (selectedRowsData[0] != undefined) {
|
})
|
||||||
dataSelected.value = selectedRowsData[0]
|
|
||||||
}
|
const allowTableRequest = ref(false)
|
||||||
clearSelection()
|
const data = new CustomStore({
|
||||||
showDetail()
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const showDetail = () => (dialogDetail.value = true)
|
return await requestGraphQl(
|
||||||
|
queries.gangguan.daftar.ssdaftarGangguanDiselesaikanMobileAPKT,
|
||||||
|
query
|
||||||
|
)
|
||||||
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarGangguanDiselesaikanMobileAPKT
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const closeDialog = () => (dialogDetail.value = false)
|
const closeDialog = () => (dialogDetail.value = false)
|
||||||
|
|
||||||
const resetData = () => {
|
const resetData = () => {
|
||||||
data.value = []
|
allowTableRequest.value = false
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
const handleRequestChange = (e: any) => {
|
||||||
resetData()
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
const dateValue = params.periode.split(' s/d ')
|
const dateValue = params.periode.split(' s/d ')
|
||||||
const { posko, uid, up3 } = params
|
const { posko, uid, up3 } = params
|
||||||
|
|
||||||
const query = {
|
return {
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
@ -348,136 +459,46 @@ const filterData = async (params: any) => {
|
|||||||
idUid: uid ? uid.id : 0,
|
idUid: uid ? uid.id : 0,
|
||||||
idUp3: up3?.id ? up3.id : 0
|
idUp3: up3?.id ? up3.id : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.value = true
|
|
||||||
await requestGraphQl(queries.gangguan.daftar.diselesaikanMobileAPKT, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarGangguanDiselesaikanMobileAPKT
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
const clearSelection = () => {
|
||||||
})
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
.catch((err) => {
|
dataGrid.clearSelection()
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
if (e.format === 'pdf') {
|
if (selectedRowsData[0] != undefined) {
|
||||||
exportToPDF(reportMeta, data)
|
dataSelected.value = selectedRowsData[0]
|
||||||
|
}
|
||||||
|
clearSelection()
|
||||||
|
showDetail()
|
||||||
|
}
|
||||||
|
|
||||||
|
const showDetail = () => (dialogDetail.value = true)
|
||||||
|
|
||||||
|
const onExporting = async (e: any) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
|
||||||
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
|
reportData.value = await data.load()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
|
dataGrid.beginCustomLoading('')
|
||||||
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
|
|
||||||
|
if (pdf) {
|
||||||
|
dataGrid.endCustomLoading()
|
||||||
|
}
|
||||||
} else if (e.format === 'xlsx') {
|
} else if (e.format === 'xlsx') {
|
||||||
exportToXLSX(reportMeta, data, e)
|
exportToXLSX(reportMeta, e)
|
||||||
} else {
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
exportToDOCX(reportMeta, data)
|
dataGrid.beginCustomLoading('')
|
||||||
}
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
}
|
|
||||||
|
|
||||||
const filters = ref()
|
if (doc) {
|
||||||
const reportMeta = ref({
|
dataGrid.endCustomLoading()
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
}
|
||||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
|
||||||
posko: { id: 0, name: 'Semua Posko' },
|
|
||||||
periode: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (import.meta.env.DEV) {
|
|
||||||
data.value = [
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020100150',
|
|
||||||
waktu_lapor: '01-02-2023 00:16:17',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_response: '01-02-2023 00:56:28',
|
|
||||||
waktu_recovery: '01-02-2023 01:00:37',
|
|
||||||
durasi_response_time: 2411,
|
|
||||||
durasi_recovery_time: 249,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Raihana S. Rahmahadi',
|
|
||||||
alamat_pelapor: 'JL BKT RAFLESIA N8-16',
|
|
||||||
no_telp_pelapor: '6282138889101',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MCB LEMAH DAYA RI/2200VA. SESUAI INFO PELANGGAN SUDAH ADA PETUGAS YANG MENGHUBUNGI DIINFORMASIKAN AKAN ADA PETUGAS YANG DATANG KE LOKASI.',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020100985',
|
|
||||||
waktu_lapor: '01-02-2023 03:09:50',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_response: '01-02-2023 03:42:40',
|
|
||||||
waktu_recovery: '01-02-2023 03:49:35',
|
|
||||||
durasi_response_time: 1970,
|
|
||||||
durasi_recovery_time: 415,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Risky Ariyanto',
|
|
||||||
alamat_pelapor: 'JL JANKES AD No. RT.7 RW.2',
|
|
||||||
no_telp_pelapor: '6285240208016',
|
|
||||||
keterangan_pelapor: 'gagal isi token dan di meteran ada tulisan Periksa',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020101461',
|
|
||||||
waktu_lapor: '01-02-2023 05:38:01',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_response: '01-02-2023 05:48:13',
|
|
||||||
waktu_recovery: '01-02-2023 05:54:06',
|
|
||||||
durasi_response_time: 612,
|
|
||||||
durasi_recovery_time: 353,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Junaedi Muntoro',
|
|
||||||
alamat_pelapor: 'PR BKT GOLF ARCADIA BLK G.06 No.5 CBBR',
|
|
||||||
no_telp_pelapor: '628111588806',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'Mohon bantuan isi token PLN 3214732093\\n\\nPT. KARYA CANTIKA KUSUMA\\n\\nBukit Golf Riverside\\nKluster Arcadia Blok G6/5\\nBojong Nangka Gunung Putri Bogor\\n\\nGagal isi Tokel Tertera Meteran TERPERIKSA.\\n\\nMOHON BANTUAN PAK..',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5523020100067',
|
|
||||||
waktu_lapor: '01-02-2023 05:57:02',
|
|
||||||
pembuat_laporan: 'CC.55.SUMIATI',
|
|
||||||
waktu_response: '01-02-2023 06:18:55',
|
|
||||||
waktu_recovery: '01-01-1970 00:00:00',
|
|
||||||
durasi_response_time: 1313,
|
|
||||||
durasi_recovery_time: 33958371,
|
|
||||||
status_akhir: 'Dibatalkan',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP ANAL ',
|
|
||||||
alamat_pelapor: 'JL MANUNGGAL RT 05 RW 02 KEL KELAPA DUA WETAN KEC CIRACAS JAKARTA TIMUR ',
|
|
||||||
no_telp_pelapor: '6285777592240',
|
|
||||||
keterangan_pelapor: 'BANYAK RUMAH PADAM ',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020103015',
|
|
||||||
waktu_lapor: '01-02-2023 07:39:03',
|
|
||||||
pembuat_laporan: 'CC.54.EKA.CSOI',
|
|
||||||
waktu_response: '01-02-2023 08:14:56',
|
|
||||||
waktu_recovery: '01-02-2023 08:19:32',
|
|
||||||
durasi_response_time: 2153,
|
|
||||||
durasi_recovery_time: 276,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'IBU DIN',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL. HAJI MIUN NO.97 RT. 1 RW 2 KEL KALISARI KEC. PASAR REBO JAKTIM, SEBERANG CAFE LAW COFFE ',
|
|
||||||
no_telp_pelapor: '082112050265',
|
|
||||||
keterangan_pelapor: 'MCB LEMAH DAYA 1.300 VA ',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type6 @update:filters="(value) => (filters = value)" />
|
<Type6 @update:filters="(value) => (filters = value)" />
|
||||||
</Filters>
|
</Filters>
|
||||||
|
|
||||||
@ -7,9 +7,10 @@
|
|||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
|
@option-changed="handleRequestChange"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loadingData == false"
|
:remote-operations="true"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
@ -31,15 +32,7 @@
|
|||||||
:show-info="true"
|
:show-info="true"
|
||||||
:show-navigation-buttons="true"
|
:show-navigation-buttons="true"
|
||||||
/>
|
/>
|
||||||
<!-- <DxLoadPanel
|
<DxLoadPanel :enabled="true" />
|
||||||
shading-color="rgba(0,0,0,0.4)"
|
|
||||||
:position="position"
|
|
||||||
:show-indicator="showIndicator"
|
|
||||||
:show-pane="showPane"
|
|
||||||
:shading="shading"
|
|
||||||
v-model:visible.sync="loadingData"
|
|
||||||
:enabled="true"
|
|
||||||
/> -->
|
|
||||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||||
<DxExport
|
<DxExport
|
||||||
:enabled="true"
|
:enabled="true"
|
||||||
@ -47,11 +40,12 @@
|
|||||||
:allow-export-selected-data="false"
|
:allow-export-selected-data="false"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column"
|
:allow-sorting="false"
|
||||||
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
@ -310,7 +304,6 @@
|
|||||||
:row-alternation-enabled="true"
|
:row-alternation-enabled="true"
|
||||||
:hover-state-enabled="true"
|
:hover-state-enabled="true"
|
||||||
@selection-changed="onDataSubSelectionChanged"
|
@selection-changed="onDataSubSelectionChanged"
|
||||||
@exporting="onExporting"
|
|
||||||
:allow-column-resizing="true"
|
:allow-column-resizing="true"
|
||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
>
|
>
|
||||||
@ -324,13 +317,12 @@
|
|||||||
:show-info="true"
|
:show-info="true"
|
||||||
:show-navigation-buttons="true"
|
:show-navigation-buttons="true"
|
||||||
/>
|
/>
|
||||||
<!-- -->
|
|
||||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||||
<DxExport
|
<!-- <DxExport
|
||||||
:enabled="true"
|
:enabled="true"
|
||||||
:formats="['pdf', 'xlsx', 'document']"
|
:formats="['pdf', 'xlsx', 'document']"
|
||||||
:allow-export-selected-data="false"
|
:allow-export-selected-data="false"
|
||||||
/>
|
/> -->
|
||||||
|
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column"
|
css-class="custom-table-column"
|
||||||
@ -415,49 +407,51 @@
|
|||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
|
|
||||||
<BufferDialog v-if="loadingData || loadingSubData" />
|
<BufferDialog v-if="loadingSubData" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type6 from '@/components/Form/FiltersType/Type6.vue'
|
import Type6 from '@/components/Form/FiltersType/Type6.vue'
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
||||||
import { onMounted, ref } from 'vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
||||||
|
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
DxExport,
|
|
||||||
DxLoadPanel,
|
DxLoadPanel,
|
||||||
|
DxExport,
|
||||||
DxPager,
|
DxPager,
|
||||||
DxPaging,
|
DxPaging,
|
||||||
DxSearchPanel,
|
DxSearchPanel,
|
||||||
DxSelection
|
DxSelection
|
||||||
} from 'devextreme-vue/data-grid'
|
} from 'devextreme-vue/data-grid'
|
||||||
import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import InputText from '@/components/InputText.vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||||
import { formatNumber, isNumber } from '@/utils/numbers'
|
import { formatNumber, isNumber } from '@/utils/numbers'
|
||||||
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Gangguan/Daftar/DGangguan_MLD1K'
|
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Gangguan/Daftar/DGangguan_MLD1K'
|
||||||
import { apolloClient } from '@/utils/api/api.graphql'
|
|
||||||
import { provideApolloClient } from '@vue/apollo-composable'
|
|
||||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
|
||||||
|
|
||||||
const client = apolloClient()
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
provideApolloClient(client)
|
|
||||||
const position = { of: '#data' }
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
const showIndicator = ref(true)
|
skip: 0,
|
||||||
const shading = ref(true)
|
take: 20,
|
||||||
const showPane = ref(true)
|
requireTotalCount: true,
|
||||||
const data = ref<any[]>([])
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
|
|
||||||
|
const reportData: any = ref(null)
|
||||||
const dataSub = ref<any[]>([])
|
const dataSub = ref<any[]>([])
|
||||||
const dataSelected = ref<any>()
|
const dataSelected = ref<any>()
|
||||||
const dataSubSelected = ref<any>()
|
const dataSubSelected = ref<any>()
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
const closedialogDetail = () => (dialogDetail.value = false)
|
|
||||||
const loadingData = ref(false)
|
|
||||||
const loadingSubData = ref(false)
|
const loadingSubData = ref(false)
|
||||||
const detailType = ref('form') // form, table
|
const detailType = ref('form')
|
||||||
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
const filters = ref()
|
const filters = ref()
|
||||||
const reportMeta = ref({
|
const reportMeta = ref({
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
@ -468,6 +462,56 @@ const reportMeta = ref({
|
|||||||
maxJmlLapor: 1
|
maxJmlLapor: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const allowTableRequest = ref(false)
|
||||||
|
const data = new CustomStore({
|
||||||
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
return await requestGraphQl(
|
||||||
|
queries.gangguan.daftar.ssdaftarGangguanMelaporLebihDariSatuKali,
|
||||||
|
query
|
||||||
|
)
|
||||||
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarGangguanMelaporLebihDariSatuKali
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const setDetailType = (columnCaption: string) => {
|
const setDetailType = (columnCaption: string) => {
|
||||||
if (columnCaption == 'Jml Lapor') {
|
if (columnCaption == 'Jml Lapor') {
|
||||||
detailType.value = 'table'
|
detailType.value = 'table'
|
||||||
@ -477,7 +521,6 @@ const setDetailType = (columnCaption: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getDetail = async () => {
|
const getDetail = async () => {
|
||||||
const dateValue = filters.value.periode.split(' s/d ')
|
|
||||||
const selected = dataSelected.value
|
const selected = dataSelected.value
|
||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
@ -503,14 +546,16 @@ const getDetail = async () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
|
||||||
const clearSelection = () => {
|
const clearSelection = () => {
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
dataGrid.clearSelection()
|
dataGrid.clearSelection()
|
||||||
}
|
}
|
||||||
|
|
||||||
const showDetail = () => {
|
const showDetail = () => {
|
||||||
clearSelection()
|
clearSelection()
|
||||||
|
|
||||||
dataSubSelected.value = null
|
dataSubSelected.value = null
|
||||||
|
|
||||||
if (detailType.value == 'table') {
|
if (detailType.value == 'table') {
|
||||||
getDetail()
|
getDetail()
|
||||||
} else {
|
} else {
|
||||||
@ -521,28 +566,102 @@ const showDetail = () => {
|
|||||||
const onDataSelectionChanged = ({ selectedRowsData }: any) => {
|
const onDataSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
if (selectedRowsData[0] != undefined) {
|
if (selectedRowsData[0] != undefined) {
|
||||||
dataSelected.value = selectedRowsData[0]
|
dataSelected.value = selectedRowsData[0]
|
||||||
|
|
||||||
showDetail()
|
showDetail()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onDataSubSelectionChanged = ({ selectedRowsData }: any) => {
|
const onDataSubSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
const data = selectedRowsData[0]
|
const data = selectedRowsData[0]
|
||||||
|
|
||||||
dataSubSelected.value = data
|
dataSubSelected.value = data
|
||||||
}
|
}
|
||||||
|
|
||||||
const closeDialog = () => (dialogDetail.value = false)
|
const closeDialog = () => (dialogDetail.value = false)
|
||||||
|
|
||||||
const resetData = () => {
|
const resetData = () => {
|
||||||
data.value = []
|
allowTableRequest.value = false
|
||||||
dataSub.value = []
|
dataSub.value = []
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
const handleRequestChange = (e: any) => {
|
||||||
resetData()
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
const { minJmlLapor, maxJmlLapor, posko, uid, up3 } = params
|
const { minJmlLapor, maxJmlLapor, posko, uid, up3 } = params
|
||||||
const dateValue = params.periode.split(' s/d ')
|
const dateValue = params.periode.split(' s/d ')
|
||||||
|
|
||||||
const query = {
|
return {
|
||||||
minJmlLapor: minJmlLapor ? minJmlLapor : 1,
|
minJmlLapor: minJmlLapor ? minJmlLapor : 1,
|
||||||
maxJmlLapor: maxJmlLapor ? maxJmlLapor : 1,
|
maxJmlLapor: maxJmlLapor ? maxJmlLapor : 1,
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
@ -555,131 +674,31 @@ const filterData = async (params: any) => {
|
|||||||
idUid: uid ? uid.id : 0,
|
idUid: uid ? uid.id : 0,
|
||||||
idUp3: up3 ? up3.id : 0
|
idUp3: up3 ? up3.id : 0
|
||||||
}
|
}
|
||||||
loadingData.value = true
|
|
||||||
await requestGraphQl(queries.gangguan.daftar.melaporLebihDariSatuKali, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarGangguanMelaporLebihDariSatuKali
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
const onExporting = async (e: any) => {
|
||||||
})
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
.catch((err) => {
|
|
||||||
console.error(err)
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
})
|
reportData.value = await data.load()
|
||||||
.finally(() => {
|
|
||||||
loadingData.value = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
if (e.format === 'pdf') {
|
dataGrid.beginCustomLoading('')
|
||||||
exportToPDF(reportMeta, data)
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
|
|
||||||
|
if (pdf) {
|
||||||
|
dataGrid.endCustomLoading()
|
||||||
|
}
|
||||||
} else if (e.format === 'xlsx') {
|
} else if (e.format === 'xlsx') {
|
||||||
exportToXLSX(reportMeta, data, e)
|
await exportToXLSX(reportMeta, e)
|
||||||
} else {
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
exportToDOCX(reportMeta, data)
|
dataGrid.beginCustomLoading('')
|
||||||
}
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
if (doc) {
|
||||||
if (import.meta.env.DEV) {
|
dataGrid.endCustomLoading()
|
||||||
data.value = [
|
}
|
||||||
{
|
|
||||||
no_laporan: 'G5423020100150',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '01-02-2023 00:16:17',
|
|
||||||
waktu_response: '01-02-2023 00:56:28',
|
|
||||||
waktu_recovery: '01-02-2023 01:00:37',
|
|
||||||
jumlah_lapor: 0,
|
|
||||||
durasi_response_time: 2411,
|
|
||||||
durasi_recovery_time: 249,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Raihana S. Rahmahadi',
|
|
||||||
alamat_pelapor: 'JL BKT RAFLESIA N8-16',
|
|
||||||
no_telp_pelapor: '6282138889101',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MCB LEMAH DAYA RI/2200VA. SESUAI INFO PELANGGAN SUDAH ADA PETUGAS YANG MENGHUBUNGI DIINFORMASIKAN AKAN ADA PETUGAS YANG DATANG KE LOKASI.',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020100985',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '01-02-2023 03:09:50',
|
|
||||||
waktu_response: '01-02-2023 03:42:40',
|
|
||||||
waktu_recovery: '01-02-2023 03:49:35',
|
|
||||||
jumlah_lapor: 0,
|
|
||||||
durasi_response_time: 1970,
|
|
||||||
durasi_recovery_time: 415,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Risky Ariyanto',
|
|
||||||
alamat_pelapor: 'JL JANKES AD No. RT.7 RW.2',
|
|
||||||
no_telp_pelapor: '6285240208016',
|
|
||||||
keterangan_pelapor: 'gagal isi token dan di meteran ada tulisan Periksa',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020101461',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '01-02-2023 05:38:01',
|
|
||||||
waktu_response: '01-02-2023 05:48:13',
|
|
||||||
waktu_recovery: '01-02-2023 05:54:06',
|
|
||||||
jumlah_lapor: 0,
|
|
||||||
durasi_response_time: 612,
|
|
||||||
durasi_recovery_time: 353,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Junaedi Muntoro',
|
|
||||||
alamat_pelapor: 'PR BKT GOLF ARCADIA BLK G.06 No.5 CBBR',
|
|
||||||
no_telp_pelapor: '628111588806',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'Mohon bantuan isi token PLN 3214732093\\n\\nPT. KARYA CANTIKA KUSUMA\\n\\nBukit Golf Riverside\\nKluster Arcadia Blok G6/5\\nBojong Nangka Gunung Putri Bogor\\n\\nGagal isi Tokel Tertera Meteran TERPERIKSA.\\n\\nMOHON BANTUAN PAK..',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020101612',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '01-02-2023 05:54:33',
|
|
||||||
waktu_response: '01-01-1970 00:00:00',
|
|
||||||
waktu_recovery: '01-01-1970 00:00:00',
|
|
||||||
jumlah_lapor: 0,
|
|
||||||
durasi_response_time: 0,
|
|
||||||
durasi_recovery_time: 0,
|
|
||||||
status_akhir: 'Dibatalkan',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Raihana S. Rahmahadi',
|
|
||||||
alamat_pelapor: 'JL BKT RAFLESIA N8-16',
|
|
||||||
no_telp_pelapor: '6282138889101',
|
|
||||||
keterangan_pelapor: 'listrik turun lagi setelah diganti mcb oleh petugas jam 1 malam',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5523020100067',
|
|
||||||
pembuat_laporan: 'CC.55.SUMIATI',
|
|
||||||
waktu_lapor: '01-02-2023 05:57:02',
|
|
||||||
waktu_response: '01-02-2023 06:18:55',
|
|
||||||
waktu_recovery: '01-01-1970 00:00:00',
|
|
||||||
jumlah_lapor: 0,
|
|
||||||
durasi_response_time: 0,
|
|
||||||
durasi_recovery_time: 0,
|
|
||||||
status_akhir: 'Dibatalkan',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP ANAL ',
|
|
||||||
alamat_pelapor: 'JL MANUNGGAL RT 05 RW 02 KEL KELAPA DUA WETAN KEC CIRACAS JAKARTA TIMUR ',
|
|
||||||
no_telp_pelapor: '6285777592240',
|
|
||||||
keterangan_pelapor: 'BANYAK RUMAH PADAM ',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type7
|
<Type7
|
||||||
@update:filters="(value) => (filters = value)"
|
@update:filters="(value) => (filters = value)"
|
||||||
:sla-options="[
|
:sla-options="[
|
||||||
@ -22,10 +22,11 @@
|
|||||||
<div id="data">
|
<div id="data">
|
||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
|
@option-changed="handleRequestChange"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loading == false"
|
:remote-operations="true"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
@ -37,6 +38,7 @@
|
|||||||
@selection-changed="onSelectionChanged"
|
@selection-changed="onSelectionChanged"
|
||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
>
|
>
|
||||||
|
<DxLoadPanel :enabled="true" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :page-size="20" :enabled="true" />
|
<DxPaging :page-size="20" :enabled="true" />
|
||||||
<DxPager
|
<DxPager
|
||||||
@ -47,16 +49,6 @@
|
|||||||
:show-info="true"
|
:show-info="true"
|
||||||
:show-navigation-buttons="true"
|
:show-navigation-buttons="true"
|
||||||
/>
|
/>
|
||||||
<!-- <DxLoadPanel
|
|
||||||
shading-color="rgba(0,0,0,0.4)"
|
|
||||||
:position="position"
|
|
||||||
:show-indicator="showIndicator"
|
|
||||||
:show-pane="showPane"
|
|
||||||
:shading="shading"
|
|
||||||
v-if="loading"
|
|
||||||
v-model:visible="loading"
|
|
||||||
:enabled="true"
|
|
||||||
/> -->
|
|
||||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||||
<DxExport
|
<DxExport
|
||||||
:enabled="true"
|
:enabled="true"
|
||||||
@ -64,11 +56,12 @@
|
|||||||
:allow-export-selected-data="false"
|
:allow-export-selected-data="false"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column"
|
:allow-sorting="false"
|
||||||
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -312,8 +305,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
|
|
||||||
<BufferDialog v-if="loading" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -321,8 +312,10 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
|||||||
import InputText from '@/components/InputText.vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type7 from '@/components/Form/FiltersType/Type7.vue'
|
import Type7 from '@/components/Form/FiltersType/Type7.vue'
|
||||||
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import { onMounted, ref } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
@ -333,50 +326,167 @@ import {
|
|||||||
DxSearchPanel,
|
DxSearchPanel,
|
||||||
DxSelection
|
DxSelection
|
||||||
} from 'devextreme-vue/data-grid'
|
} from 'devextreme-vue/data-grid'
|
||||||
import { useQuery } from '@vue/apollo-composable'
|
|
||||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||||
import {
|
import {
|
||||||
exportToPDF,
|
exportToPDF,
|
||||||
exportToXLSX,
|
exportToXLSX,
|
||||||
exportToDOCX
|
exportToDOCX
|
||||||
} from '@/report/Gangguan/Daftar/DGangguan_RecoveryTime'
|
} from '@/report/Gangguan/Daftar/DGangguan_RecoveryTime'
|
||||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
|
||||||
|
|
||||||
const position = { of: '#data' }
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
const showIndicator = ref(true)
|
|
||||||
const shading = ref(true)
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
const showPane = ref(true)
|
skip: 0,
|
||||||
const data = ref<any[]>([])
|
take: 20,
|
||||||
|
requireTotalCount: true,
|
||||||
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
const dataSelected = ref<any>({})
|
const dataSelected = ref<any>({})
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
|
const reportData: any = ref(null)
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
const loading = ref(false)
|
const filters = ref()
|
||||||
const clearSelection = () => {
|
const reportMeta = ref({
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
dataGrid.clearSelection()
|
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||||
}
|
posko: { id: 0, name: 'Semua Posko' },
|
||||||
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
periode: '',
|
||||||
if (selectedRowsData[0] != undefined) {
|
minTime: '',
|
||||||
dataSelected.value = selectedRowsData[0]
|
maxTime: ''
|
||||||
}
|
})
|
||||||
clearSelection()
|
|
||||||
showDetail()
|
const allowTableRequest = ref(false)
|
||||||
|
const data = new CustomStore({
|
||||||
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const showDetail = () => (dialogDetail.value = true)
|
return await requestGraphQl(queries.gangguan.daftar.ssdaftarGangguanRecoveryTime, query)
|
||||||
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarGangguanRecoveryTime
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const closeDialog = () => (dialogDetail.value = false)
|
const closeDialog = () => (dialogDetail.value = false)
|
||||||
|
|
||||||
const resetData = () => {
|
const resetData = () => {
|
||||||
data.value = []
|
allowTableRequest.value = false
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
const handleRequestChange = (e: any) => {
|
||||||
resetData()
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
const { minTime, maxTime, posko, uid, up3 } = params
|
const { minTime, maxTime, posko, uid, up3 } = params
|
||||||
const dateValue = params.periode.split(' s/d ')
|
const dateValue = params.periode.split(' s/d ')
|
||||||
|
|
||||||
const query = {
|
return {
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
@ -389,147 +499,48 @@ const filterData = async (params: any) => {
|
|||||||
idUid: uid ? uid.id : 0,
|
idUid: uid ? uid.id : 0,
|
||||||
idUp3: up3 ? up3.id : 0
|
idUp3: up3 ? up3.id : 0
|
||||||
}
|
}
|
||||||
loading.value = true
|
|
||||||
await requestGraphQl(queries.gangguan.daftar.recoveryTime, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarGangguanRecoveryTime
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
const clearSelection = () => {
|
||||||
})
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
.catch((err) => {
|
dataGrid.clearSelection()
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
if (e.format === 'pdf') {
|
if (selectedRowsData[0] != undefined) {
|
||||||
exportToPDF(reportMeta, data)
|
dataSelected.value = selectedRowsData[0]
|
||||||
|
}
|
||||||
|
showDetail()
|
||||||
|
}
|
||||||
|
|
||||||
|
const showDetail = () => {
|
||||||
|
dialogDetail.value = true
|
||||||
|
clearSelection()
|
||||||
|
}
|
||||||
|
|
||||||
|
const onExporting = async (e: any) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
|
||||||
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
|
reportData.value = await data.load()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
|
dataGrid.beginCustomLoading('')
|
||||||
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
|
|
||||||
|
if (pdf) {
|
||||||
|
dataGrid.endCustomLoading()
|
||||||
|
}
|
||||||
} else if (e.format === 'xlsx') {
|
} else if (e.format === 'xlsx') {
|
||||||
exportToXLSX(reportMeta, data, e)
|
exportToXLSX(reportMeta, e)
|
||||||
} else {
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
exportToDOCX(reportMeta, data)
|
dataGrid.beginCustomLoading('')
|
||||||
}
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
}
|
|
||||||
|
|
||||||
const filters = ref()
|
if (doc) {
|
||||||
const reportMeta = ref({
|
dataGrid.endCustomLoading()
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
}
|
||||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
|
||||||
posko: { id: 0, name: 'Semua Posko' },
|
|
||||||
periode: '',
|
|
||||||
minTime: '',
|
|
||||||
maxTime: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (import.meta.env.DEV) {
|
|
||||||
data.value = [
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020100150',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '01-02-2023 00:16:17',
|
|
||||||
waktu_response: '01-02-2023 00:56:28',
|
|
||||||
waktu_recovery: '01-02-2023 01:00:37',
|
|
||||||
durasi_response_time: 2411,
|
|
||||||
durasi_recovery_time: 249,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
is_marking: 0,
|
|
||||||
referensi_marking: 'P3124142424',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Raihana S. Rahmahadi',
|
|
||||||
alamat_pelapor: 'JL BKT RAFLESIA N8-16',
|
|
||||||
no_telp_pelapor: '6282138889101',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MCB LEMAH DAYA RI/2200VA. SESUAI INFO PELANGGAN SUDAH ADA PETUGAS YANG MENGHUBUNGI DIINFORMASIKAN AKAN ADA PETUGAS YANG DATANG KE LOKASI.',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020100985',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '01-02-2023 03:09:50',
|
|
||||||
waktu_response: '01-02-2023 03:42:40',
|
|
||||||
waktu_recovery: '01-02-2023 03:49:35',
|
|
||||||
durasi_response_time: 1970,
|
|
||||||
durasi_recovery_time: 415,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
is_marking: 0,
|
|
||||||
referensi_marking: 'P3124142424',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Risky Ariyanto',
|
|
||||||
alamat_pelapor: 'JL JANKES AD No. RT.7 RW.2',
|
|
||||||
no_telp_pelapor: '6285240208016',
|
|
||||||
keterangan_pelapor: 'gagal isi token dan di meteran ada tulisan Periksa',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020101461',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '01-02-2023 05:38:01',
|
|
||||||
waktu_response: '01-02-2023 05:48:13',
|
|
||||||
waktu_recovery: '01-02-2023 05:54:06',
|
|
||||||
durasi_response_time: 612,
|
|
||||||
durasi_recovery_time: 353,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
is_marking: 0,
|
|
||||||
referensi_marking: 'P3124142424',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Junaedi Muntoro',
|
|
||||||
alamat_pelapor: 'PR BKT GOLF ARCADIA BLK G.06 No.5 CBBR',
|
|
||||||
no_telp_pelapor: '628111588806',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'Mohon bantuan isi token PLN 3214732093\\n\\nPT. KARYA CANTIKA KUSUMA\\n\\nBukit Golf Riverside\\nKluster Arcadia Blok G6/5\\nBojong Nangka Gunung Putri Bogor\\n\\nGagal isi Tokel Tertera Meteran TERPERIKSA.\\n\\nMOHON BANTUAN PAK..',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5523020100067',
|
|
||||||
pembuat_laporan: 'CC.55.SUMIATI',
|
|
||||||
waktu_lapor: '01-02-2023 05:57:02',
|
|
||||||
waktu_response: '01-02-2023 06:18:55',
|
|
||||||
waktu_recovery: '01-01-1970 00:00:00',
|
|
||||||
durasi_response_time: 1313,
|
|
||||||
durasi_recovery_time: 33958236,
|
|
||||||
status_akhir: 'Dibatalkan',
|
|
||||||
is_marking: 0,
|
|
||||||
referensi_marking: 'P3124142424',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP ANAL ',
|
|
||||||
alamat_pelapor: 'JL MANUNGGAL RT 05 RW 02 KEL KELAPA DUA WETAN KEC CIRACAS JAKARTA TIMUR ',
|
|
||||||
no_telp_pelapor: '6285777592240',
|
|
||||||
keterangan_pelapor: 'BANYAK RUMAH PADAM ',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020103015',
|
|
||||||
pembuat_laporan: 'CC.54.EKA.CSOI',
|
|
||||||
waktu_lapor: '01-02-2023 07:39:03',
|
|
||||||
waktu_response: '01-02-2023 08:14:56',
|
|
||||||
waktu_recovery: '01-02-2023 08:19:32',
|
|
||||||
durasi_response_time: 2153,
|
|
||||||
durasi_recovery_time: 276,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
is_marking: 0,
|
|
||||||
referensi_marking: 'P3124142424',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'IBU DIN',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL. HAJI MIUN NO.97 RT. 1 RW 2 KEL KALISARI KEC. PASAR REBO JAKTIM, SEBERANG CAFE LAW COFFE ',
|
|
||||||
no_telp_pelapor: '082112050265',
|
|
||||||
keterangan_pelapor: 'MCB LEMAH DAYA 1.300 VA ',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type7 @update:filters="(value) => (filters = value)" />
|
<Type7 @update:filters="(value) => (filters = value)" />
|
||||||
</Filters>
|
</Filters>
|
||||||
|
|
||||||
@ -9,7 +9,8 @@
|
|||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loading == false"
|
@option-changed="handleRequestChange"
|
||||||
|
:remote-operations="true"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
@ -21,6 +22,7 @@
|
|||||||
:allow-column-resizing="true"
|
:allow-column-resizing="true"
|
||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
>
|
>
|
||||||
|
<DxLoadPanel :enabled="true" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :page-size="20" :enabled="true" />
|
<DxPaging :page-size="20" :enabled="true" />
|
||||||
<DxPager
|
<DxPager
|
||||||
@ -31,16 +33,6 @@
|
|||||||
:show-info="true"
|
:show-info="true"
|
||||||
:show-navigation-buttons="true"
|
:show-navigation-buttons="true"
|
||||||
/>
|
/>
|
||||||
<!-- <DxLoadPanel
|
|
||||||
shading-color="rgba(0,0,0,0.4)"
|
|
||||||
:position="position"
|
|
||||||
:show-indicator="showIndicator"
|
|
||||||
:show-pane="showPane"
|
|
||||||
:shading="shading"
|
|
||||||
v-if="loading"
|
|
||||||
v-model:visible="loading"
|
|
||||||
:enabled="true"
|
|
||||||
/> -->
|
|
||||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||||
<DxExport
|
<DxExport
|
||||||
:enabled="true"
|
:enabled="true"
|
||||||
@ -48,13 +40,13 @@
|
|||||||
:allow-export-selected-data="false"
|
:allow-export-selected-data="false"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column"
|
:allow-sorting="false"
|
||||||
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
cell-template="cellCenter"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<DxColumn
|
<DxColumn
|
||||||
@ -309,71 +301,191 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
|
|
||||||
<BufferDialog v-if="loading" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type7 from '@/components/Form/FiltersType/Type7.vue'
|
import Type7 from '@/components/Form/FiltersType/Type7.vue'
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
||||||
import { onMounted, ref } from 'vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
DxExport,
|
|
||||||
DxLoadPanel,
|
DxLoadPanel,
|
||||||
|
DxExport,
|
||||||
DxPager,
|
DxPager,
|
||||||
DxPaging,
|
DxPaging,
|
||||||
DxSearchPanel,
|
DxSearchPanel,
|
||||||
DxSelection
|
DxSelection
|
||||||
} from 'devextreme-vue/data-grid'
|
} from 'devextreme-vue/data-grid'
|
||||||
import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import InputText from '@/components/InputText.vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { useQuery } from '@vue/apollo-composable'
|
|
||||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||||
import {
|
import {
|
||||||
exportToPDF,
|
exportToPDF,
|
||||||
exportToXLSX,
|
exportToXLSX,
|
||||||
exportToDOCX
|
exportToDOCX
|
||||||
} from '@/report/Gangguan/Daftar/DGangguan_ResponseTime'
|
} from '@/report/Gangguan/Daftar/DGangguan_ResponseTime'
|
||||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
|
||||||
|
|
||||||
const position = { of: '#data' }
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
const showIndicator = ref(true)
|
|
||||||
const shading = ref(true)
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
const showPane = ref(true)
|
skip: 0,
|
||||||
const data = ref<any[]>([])
|
take: 20,
|
||||||
|
requireTotalCount: true,
|
||||||
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
const dataSelected = ref<any>({})
|
const dataSelected = ref<any>({})
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
|
const reportData: any = ref(null)
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
const loading = ref(false)
|
const filters = ref()
|
||||||
|
const reportMeta = ref({
|
||||||
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
|
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||||
|
posko: { id: 0, name: 'Semua Posko' },
|
||||||
|
periode: '',
|
||||||
|
minTime: '',
|
||||||
|
maxTime: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
const allowTableRequest = ref(false)
|
||||||
|
const data = new CustomStore({
|
||||||
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
return await requestGraphQl(queries.gangguan.daftar.ssdaftarGangguanResponseTime, query)
|
||||||
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarGangguanResponseTime
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const clearSelection = () => {
|
const clearSelection = () => {
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
dataGrid.clearSelection()
|
dataGrid.clearSelection()
|
||||||
}
|
}
|
||||||
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
|
||||||
if (selectedRowsData[0] != undefined) {
|
|
||||||
dataSelected.value = selectedRowsData[0]
|
|
||||||
}
|
|
||||||
clearSelection()
|
|
||||||
showDetail()
|
|
||||||
}
|
|
||||||
|
|
||||||
const showDetail = () => (dialogDetail.value = true)
|
|
||||||
|
|
||||||
const closeDialog = () => (dialogDetail.value = false)
|
|
||||||
|
|
||||||
const resetData = () => {
|
const resetData = () => {
|
||||||
data.value = []
|
allowTableRequest.value = false
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
const handleRequestChange = (e: any) => {
|
||||||
resetData()
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
const { minTime, maxTime, posko, uid, up3 } = params
|
const { minTime, maxTime, posko, uid, up3 } = params
|
||||||
const dateValue = params.periode.split(' s/d ')
|
const dateValue = params.periode.split(' s/d ')
|
||||||
|
|
||||||
const query = {
|
return {
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
@ -386,157 +498,44 @@ const filterData = async (params: any) => {
|
|||||||
idUid: uid ? uid.id : 0,
|
idUid: uid ? uid.id : 0,
|
||||||
idUp3: up3 ? up3.id : 0
|
idUp3: up3 ? up3.id : 0
|
||||||
}
|
}
|
||||||
loading.value = true
|
|
||||||
await requestGraphQl(queries.gangguan.daftar.responseTime, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarGangguanResponseTime
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
})
|
if (selectedRowsData[0] != undefined) {
|
||||||
.catch((err) => {
|
dataSelected.value = selectedRowsData[0]
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
clearSelection()
|
||||||
if (e.format === 'pdf') {
|
showDetail()
|
||||||
exportToPDF(reportMeta, data)
|
}
|
||||||
|
|
||||||
|
const showDetail = () => (dialogDetail.value = true)
|
||||||
|
|
||||||
|
const closeDialog = () => (dialogDetail.value = false)
|
||||||
|
|
||||||
|
const onExporting = async (e: any) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
|
||||||
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
|
reportData.value = await data.load()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
|
dataGrid.beginCustomLoading('')
|
||||||
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
|
|
||||||
|
if (pdf) {
|
||||||
|
dataGrid.endCustomLoading()
|
||||||
|
}
|
||||||
} else if (e.format === 'xlsx') {
|
} else if (e.format === 'xlsx') {
|
||||||
exportToXLSX(reportMeta, data, e)
|
exportToXLSX(reportMeta, e)
|
||||||
} else {
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
exportToDOCX(reportMeta, data)
|
dataGrid.beginCustomLoading('')
|
||||||
}
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
}
|
|
||||||
|
|
||||||
const filters = ref()
|
if (doc) {
|
||||||
const reportMeta = ref({
|
dataGrid.endCustomLoading()
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
}
|
||||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
|
||||||
posko: { id: 0, name: 'Semua Posko' },
|
|
||||||
periode: '',
|
|
||||||
minTime: '',
|
|
||||||
maxTime: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (import.meta.env.DEV) {
|
|
||||||
data.value = [
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020100150',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '01-02-2023 00:16:17',
|
|
||||||
waktu_response: '01-02-2023 00:56:28',
|
|
||||||
waktu_recovery: '01-02-2023 01:00:37',
|
|
||||||
durasi_response_time: 2411,
|
|
||||||
durasi_recovery_time: 249,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
is_marking: 0,
|
|
||||||
referensi_marking: 'P3124142424',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Raihana S. Rahmahadi',
|
|
||||||
alamat_pelapor: 'JL BKT RAFLESIA N8-16',
|
|
||||||
no_telp_pelapor: '6282138889101',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MCB LEMAH DAYA RI/2200VA. SESUAI INFO PELANGGAN SUDAH ADA PETUGAS YANG MENGHUBUNGI DIINFORMASIKAN AKAN ADA PETUGAS YANG DATANG KE LOKASI.',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS',
|
|
||||||
penyebab: 'P3124142424',
|
|
||||||
tindakan: 'P3124142424'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020100985',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '01-02-2023 03:09:50',
|
|
||||||
waktu_response: '01-02-2023 03:42:40',
|
|
||||||
waktu_recovery: '01-02-2023 03:49:35',
|
|
||||||
durasi_response_time: 1970,
|
|
||||||
durasi_recovery_time: 415,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
is_marking: 0,
|
|
||||||
referensi_marking: 'P3124142424',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Risky Ariyanto',
|
|
||||||
alamat_pelapor: 'JL JANKES AD No. RT.7 RW.2',
|
|
||||||
no_telp_pelapor: '6285240208016',
|
|
||||||
keterangan_pelapor: 'gagal isi token dan di meteran ada tulisan Periksa',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS',
|
|
||||||
penyebab: 'P3124142424',
|
|
||||||
tindakan: 'P3124142424'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020101461',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '01-02-2023 05:38:01',
|
|
||||||
waktu_response: '01-02-2023 05:48:13',
|
|
||||||
waktu_recovery: '01-02-2023 05:54:06',
|
|
||||||
durasi_response_time: 612,
|
|
||||||
durasi_recovery_time: 353,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
is_marking: 0,
|
|
||||||
referensi_marking: 'P3124142424',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Junaedi Muntoro',
|
|
||||||
alamat_pelapor: 'PR BKT GOLF ARCADIA BLK G.06 No.5 CBBR',
|
|
||||||
no_telp_pelapor: '628111588806',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'Mohon bantuan isi token PLN 3214732093\\n\\nPT. KARYA CANTIKA KUSUMA\\n\\nBukit Golf Riverside\\nKluster Arcadia Blok G6/5\\nBojong Nangka Gunung Putri Bogor\\n\\nGagal isi Tokel Tertera Meteran TERPERIKSA.\\n\\nMOHON BANTUAN PAK..',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS',
|
|
||||||
penyebab: 'P3124142424',
|
|
||||||
tindakan: 'P3124142424'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5523020100067',
|
|
||||||
pembuat_laporan: 'CC.55.SUMIATI',
|
|
||||||
waktu_lapor: '01-02-2023 05:57:02',
|
|
||||||
waktu_response: '01-02-2023 06:18:55',
|
|
||||||
waktu_recovery: '01-01-1970 00:00:00',
|
|
||||||
durasi_response_time: 1313,
|
|
||||||
durasi_recovery_time: 0,
|
|
||||||
status_akhir: 'Dibatalkan',
|
|
||||||
is_marking: 0,
|
|
||||||
referensi_marking: 'P3124142424',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP ANAL ',
|
|
||||||
alamat_pelapor: 'JL MANUNGGAL RT 05 RW 02 KEL KELAPA DUA WETAN KEC CIRACAS JAKARTA TIMUR ',
|
|
||||||
no_telp_pelapor: '6285777592240',
|
|
||||||
keterangan_pelapor: 'BANYAK RUMAH PADAM ',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_posko: 'POSKO CIRACAS',
|
|
||||||
penyebab: 'P3124142424',
|
|
||||||
tindakan: 'P3124142424'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020103015',
|
|
||||||
pembuat_laporan: 'CC.54.EKA.CSOI',
|
|
||||||
waktu_lapor: '01-02-2023 07:39:03',
|
|
||||||
waktu_response: '01-02-2023 08:14:56',
|
|
||||||
waktu_recovery: '01-02-2023 08:19:32',
|
|
||||||
durasi_response_time: 2153,
|
|
||||||
durasi_recovery_time: 276,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
is_marking: 0,
|
|
||||||
referensi_marking: 'P3124142424',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'IBU DIN',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL. HAJI MIUN NO.97 RT. 1 RW 2 KEL KALISARI KEC. PASAR REBO JAKTIM, SEBERANG CAFE LAW COFFE ',
|
|
||||||
no_telp_pelapor: '082112050265',
|
|
||||||
keterangan_pelapor: 'MCB LEMAH DAYA 1.300 VA ',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_posko: 'POSKO CIRACAS',
|
|
||||||
penyebab: 'P3124142424',
|
|
||||||
tindakan: 'P3124142424'
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type1 @update:filters="(value) => (filters = value)" />
|
<Type1 @update:filters="(value) => (filters = value)" />
|
||||||
</Filters>
|
</Filters>
|
||||||
|
|
||||||
@ -7,9 +7,10 @@
|
|||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
|
@option-changed="handleRequestChange"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loading == false"
|
:remote-operations="true"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
@ -21,6 +22,7 @@
|
|||||||
:allow-column-resizing="true"
|
:allow-column-resizing="true"
|
||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
>
|
>
|
||||||
|
<DxLoadPanel :enabled="true" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :page-size="20" :enabled="true" />
|
<DxPaging :page-size="20" :enabled="true" />
|
||||||
<DxPager
|
<DxPager
|
||||||
@ -31,16 +33,6 @@
|
|||||||
:show-info="true"
|
:show-info="true"
|
||||||
:show-navigation-buttons="true"
|
:show-navigation-buttons="true"
|
||||||
/>
|
/>
|
||||||
<!-- <DxLoadPanel
|
|
||||||
shading-color="rgba(0,0,0,0.4)"
|
|
||||||
:position="position"
|
|
||||||
:show-indicator="showIndicator"
|
|
||||||
:show-pane="showPane"
|
|
||||||
:shading="shading"
|
|
||||||
v-if="loading"
|
|
||||||
v-model:visible="loading"
|
|
||||||
:enabled="true"
|
|
||||||
/> -->
|
|
||||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||||
<DxExport
|
<DxExport
|
||||||
:enabled="true"
|
:enabled="true"
|
||||||
@ -48,11 +40,12 @@
|
|||||||
:allow-export-selected-data="false"
|
:allow-export-selected-data="false"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column"
|
:allow-sorting="false"
|
||||||
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@ -281,8 +274,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
|
|
||||||
<BufferDialog v-if="loading" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -290,8 +281,10 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
|||||||
import InputText from '@/components/InputText.vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type1 from '@/components/Form/FiltersType/Type1.vue'
|
import Type1 from '@/components/Form/FiltersType/Type1.vue'
|
||||||
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import { onMounted, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
@ -302,46 +295,164 @@ import {
|
|||||||
DxSearchPanel,
|
DxSearchPanel,
|
||||||
DxSelection
|
DxSelection
|
||||||
} from 'devextreme-vue/data-grid'
|
} from 'devextreme-vue/data-grid'
|
||||||
import { useQuery } from '@vue/apollo-composable'
|
|
||||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||||
import { exportToPDF, exportToDOCX, exportToXLSX } from '@/report/Gangguan/Daftar/DGangguan_STIDP'
|
import { exportToPDF, exportToDOCX, exportToXLSX } from '@/report/Gangguan/Daftar/DGangguan_STIDP'
|
||||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
|
||||||
|
|
||||||
const position = { of: '#data' }
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
const showIndicator = ref(true)
|
|
||||||
const shading = ref(true)
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
const showPane = ref(true)
|
skip: 0,
|
||||||
const data = ref<any[]>([])
|
take: 20,
|
||||||
|
requireTotalCount: true,
|
||||||
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
const dataSelected = ref<any>({})
|
const dataSelected = ref<any>({})
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
|
const reportData: any = ref(null)
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
const loading = ref(false)
|
const filters = ref()
|
||||||
const clearSelection = () => {
|
const reportMeta = ref({
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
dataGrid.clearSelection()
|
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||||
}
|
posko: { id: 0, name: 'Semua Posko' },
|
||||||
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
periode: ''
|
||||||
if (selectedRowsData[0] != undefined) {
|
})
|
||||||
dataSelected.value = selectedRowsData[0]
|
|
||||||
}
|
const allowTableRequest = ref(false)
|
||||||
clearSelection()
|
const data = new CustomStore({
|
||||||
showDetail()
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const showDetail = () => (dialogDetail.value = true)
|
return await requestGraphQl(
|
||||||
|
queries.gangguan.daftar.ssdaftarGangguanSelesaiTanpaIdPelanggan,
|
||||||
|
query
|
||||||
|
)
|
||||||
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarGangguanSelesaiTanpaIdPelanggan
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const closeDialog = () => (dialogDetail.value = false)
|
const closeDialog = () => (dialogDetail.value = false)
|
||||||
|
|
||||||
const resetData = () => {
|
const resetData = () => {
|
||||||
data.value = []
|
allowTableRequest.value = false
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
const handleRequestChange = (e: any) => {
|
||||||
resetData()
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
const { posko, uid, up3 } = params
|
const { posko, uid, up3 } = params
|
||||||
const dateValue = params.periode.split(' s/d ')
|
const dateValue = params.periode.split(' s/d ')
|
||||||
|
|
||||||
const query = {
|
return {
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
@ -352,135 +463,46 @@ const filterData = async (params: any) => {
|
|||||||
idUid: uid ? uid.id : 0,
|
idUid: uid ? uid.id : 0,
|
||||||
idUp3: up3 ? up3.id : 0
|
idUp3: up3 ? up3.id : 0
|
||||||
}
|
}
|
||||||
loading.value = true
|
|
||||||
await requestGraphQl(queries.gangguan.daftar.selesaiTanpaIDPelanggan, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarGangguanSelesaiTanpaIdPelanggan
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
const clearSelection = () => {
|
||||||
})
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
.catch((err) => {
|
dataGrid.clearSelection()
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
if (e.format === 'pdf') {
|
if (selectedRowsData[0] != undefined) {
|
||||||
exportToPDF(reportMeta, data)
|
dataSelected.value = selectedRowsData[0]
|
||||||
|
}
|
||||||
|
clearSelection()
|
||||||
|
showDetail()
|
||||||
|
}
|
||||||
|
|
||||||
|
const showDetail = () => (dialogDetail.value = true)
|
||||||
|
|
||||||
|
const onExporting = async (e: any) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
|
||||||
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
|
reportData.value = await data.load()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
|
dataGrid.beginCustomLoading('')
|
||||||
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
|
|
||||||
|
if (pdf) {
|
||||||
|
dataGrid.endCustomLoading()
|
||||||
|
}
|
||||||
} else if (e.format === 'xlsx') {
|
} else if (e.format === 'xlsx') {
|
||||||
exportToXLSX(reportMeta, data, e)
|
exportToXLSX(reportMeta, e)
|
||||||
} else {
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
exportToDOCX(reportMeta, data)
|
dataGrid.beginCustomLoading('')
|
||||||
}
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
}
|
|
||||||
|
|
||||||
const filters = ref()
|
if (doc) {
|
||||||
const reportMeta = ref({
|
dataGrid.endCustomLoading()
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
}
|
||||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
|
||||||
posko: { id: 0, name: 'Semua Posko' },
|
|
||||||
periode: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (import.meta.env.DEV) {
|
|
||||||
data.value = [
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020100150',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '01-02-2023 00:16:17',
|
|
||||||
waktu_response: '01-02-2023 00:56:28',
|
|
||||||
waktu_recovery: '01-02-2023 01:00:37',
|
|
||||||
durasi_response_time: 2411,
|
|
||||||
durasi_recovery_time: 249,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Raihana S. Rahmahadi',
|
|
||||||
alamat_pelapor: 'JL BKT RAFLESIA N8-16',
|
|
||||||
no_telp_pelapor: '6282138889101',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MCB LEMAH DAYA RI/2200VA. SESUAI INFO PELANGGAN SUDAH ADA PETUGAS YANG MENGHUBUNGI DIINFORMASIKAN AKAN ADA PETUGAS YANG DATANG KE LOKASI.',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020100985',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '01-02-2023 03:09:50',
|
|
||||||
waktu_response: '01-02-2023 03:42:40',
|
|
||||||
waktu_recovery: '01-02-2023 03:49:35',
|
|
||||||
durasi_response_time: 1970,
|
|
||||||
durasi_recovery_time: 415,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Risky Ariyanto',
|
|
||||||
alamat_pelapor: 'JL JANKES AD No. RT.7 RW.2',
|
|
||||||
no_telp_pelapor: '6285240208016',
|
|
||||||
keterangan_pelapor: 'gagal isi token dan di meteran ada tulisan Periksa',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020101461',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '01-02-2023 05:38:01',
|
|
||||||
waktu_response: '01-02-2023 05:48:13',
|
|
||||||
waktu_recovery: '01-02-2023 05:54:06',
|
|
||||||
durasi_response_time: 612,
|
|
||||||
durasi_recovery_time: 353,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Junaedi Muntoro',
|
|
||||||
alamat_pelapor: 'PR BKT GOLF ARCADIA BLK G.06 No.5 CBBR',
|
|
||||||
no_telp_pelapor: '628111588806',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'Mohon bantuan isi token PLN 3214732093\\n\\nPT. KARYA CANTIKA KUSUMA\\n\\nBukit Golf Riverside\\nKluster Arcadia Blok G6/5\\nBojong Nangka Gunung Putri Bogor\\n\\nGagal isi Tokel Tertera Meteran TERPERIKSA.\\n\\nMOHON BANTUAN PAK..',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5523020100067',
|
|
||||||
pembuat_laporan: 'CC.55.SUMIATI',
|
|
||||||
waktu_lapor: '01-02-2023 05:57:02',
|
|
||||||
waktu_response: '01-02-2023 06:18:55',
|
|
||||||
waktu_recovery: '01-01-1970 00:00:00',
|
|
||||||
durasi_response_time: 1313,
|
|
||||||
durasi_recovery_time: 33948072,
|
|
||||||
status_akhir: 'Dibatalkan',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP ANAL ',
|
|
||||||
alamat_pelapor: 'JL MANUNGGAL RT 05 RW 02 KEL KELAPA DUA WETAN KEC CIRACAS JAKARTA TIMUR ',
|
|
||||||
no_telp_pelapor: '6285777592240',
|
|
||||||
keterangan_pelapor: 'BANYAK RUMAH PADAM ',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'G5423020103015',
|
|
||||||
pembuat_laporan: 'CC.54.EKA.CSOI',
|
|
||||||
waktu_lapor: '01-02-2023 07:39:03',
|
|
||||||
waktu_response: '01-02-2023 08:14:56',
|
|
||||||
waktu_recovery: '01-02-2023 08:19:32',
|
|
||||||
durasi_response_time: 2153,
|
|
||||||
durasi_recovery_time: 276,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'IBU DIN',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL. HAJI MIUN NO.97 RT. 1 RW 2 KEL KALISARI KEC. PASAR REBO JAKTIM, SEBERANG CAFE LAW COFFE ',
|
|
||||||
no_telp_pelapor: '082112050265',
|
|
||||||
keterangan_pelapor: 'MCB LEMAH DAYA 1.300 VA ',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_posko: 'POSKO CIRACAS'
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type3 @update:filters="(value) => (filters = value)" />
|
<Type3 @update:filters="(value) => (filters = value)" />
|
||||||
</Filters>
|
</Filters>
|
||||||
|
|
||||||
<div id="data">
|
<div id="data">
|
||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
|
@option-changed="handleRequestChange"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loading == false"
|
:remote-operations="true"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
@ -22,6 +23,7 @@
|
|||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
:word-wrap-enabled="false"
|
:word-wrap-enabled="false"
|
||||||
>
|
>
|
||||||
|
<DxLoadPanel :enabled="true" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :page-size="20" :enabled="true" />
|
<DxPaging :page-size="20" :enabled="true" />
|
||||||
<DxPager
|
<DxPager
|
||||||
@ -41,11 +43,12 @@
|
|||||||
<DxColumnFixing :enabled="true" />
|
<DxColumnFixing :enabled="true" />
|
||||||
|
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column"
|
:allow-sorting="false"
|
||||||
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
@ -281,7 +284,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
<BufferDialog v-if="loading" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -289,8 +291,10 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
|||||||
import InputText from '@/components/InputText.vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type3 from '@/components/Form/FiltersType/Type3.vue'
|
import Type3 from '@/components/Form/FiltersType/Type3.vue'
|
||||||
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import { onMounted, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
@ -308,59 +312,161 @@ import {
|
|||||||
exportToXLSX,
|
exportToXLSX,
|
||||||
exportToDOCX
|
exportToDOCX
|
||||||
} from '@/report/Keluhan/Daftar/DKeluhan_BerdasarMedia'
|
} from '@/report/Keluhan/Daftar/DKeluhan_BerdasarMedia'
|
||||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
|
||||||
|
|
||||||
const position = { of: '#data' }
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
const showIndicator = ref(true)
|
|
||||||
const shading = ref(true)
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
const showPane = ref(true)
|
skip: 0,
|
||||||
|
take: 20,
|
||||||
|
requireTotalCount: true,
|
||||||
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
const dataSelected = ref<any>()
|
const dataSelected = ref<any>()
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
|
const reportData: any = ref(null)
|
||||||
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
|
const filters = ref()
|
||||||
|
const reportMeta = ref({
|
||||||
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
|
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||||
|
ulp: { id: 0, name: 'Semua Unit Layanan Pelanggan' },
|
||||||
|
periode: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
const allowTableRequest = ref(false)
|
||||||
|
const data = new CustomStore({
|
||||||
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
return await requestGraphQl(queries.keluhan.daftar.ssdaftarKeluhanBerdasarkanMedia, query)
|
||||||
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarKeluhanBerdasarkanMedia
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
dialogDetail.value = false
|
dialogDetail.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
|
||||||
const clearSelection = () => {
|
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
|
||||||
dataGrid.clearSelection()
|
|
||||||
}
|
|
||||||
const showDetail = () => {
|
|
||||||
clearSelection()
|
|
||||||
dialogDetail.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
|
||||||
if (selectedRowsData[0] != undefined) {
|
|
||||||
dataSelected.value = selectedRowsData[0]
|
|
||||||
}
|
|
||||||
showDetail()
|
|
||||||
}
|
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
|
||||||
if (e.format === 'pdf') {
|
|
||||||
exportToPDF(reportMeta, data)
|
|
||||||
} else if (e.format === 'xlsx') {
|
|
||||||
exportToXLSX(reportMeta, e)
|
|
||||||
} else {
|
|
||||||
exportToDOCX(reportMeta, data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = ref<any[]>([])
|
|
||||||
const loading = ref(false)
|
|
||||||
|
|
||||||
const resetData = () => {
|
const resetData = () => {
|
||||||
data.value = []
|
allowTableRequest.value = false
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
const handleRequestChange = (e: any) => {
|
||||||
resetData()
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
const dateValue = params.periode.split(' s/d ')
|
const dateValue = params.periode.split(' s/d ')
|
||||||
const { ulp, uid, up3 } = params
|
const { ulp, uid, up3 } = params
|
||||||
|
|
||||||
const query = {
|
return {
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
@ -371,135 +477,48 @@ const filterData = async (params: any) => {
|
|||||||
idUid: uid ? uid.id : 0,
|
idUid: uid ? uid.id : 0,
|
||||||
idUp3: up3 ? up3.id : 0
|
idUp3: up3 ? up3.id : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.value = true
|
|
||||||
await requestGraphQl(queries.keluhan.daftar.keluhanBerdasarkanMedia, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarKeluhanBerdasarkanMedia
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
const clearSelection = () => {
|
||||||
})
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
.catch((err) => {
|
dataGrid.clearSelection()
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const filters = ref()
|
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
const reportMeta = ref({
|
if (selectedRowsData[0] != undefined) {
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
dataSelected.value = selectedRowsData[0]
|
||||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
}
|
||||||
ulp: { id: 0, name: 'Semua Unit Layanan Pelanggan' },
|
showDetail()
|
||||||
periode: ''
|
}
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
const showDetail = () => {
|
||||||
if (import.meta.env.DEV) {
|
clearSelection()
|
||||||
data.value = [
|
dialogDetail.value = true
|
||||||
{
|
}
|
||||||
no_laporan: 'K5123020100019',
|
|
||||||
waktu_lapor: '01/02/2023 01:59:02',
|
const onExporting = async (e: any) => {
|
||||||
waktu_response: '01/02/2023 05:22:50',
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
waktu_recovery: '01/02/2023 08:33:38',
|
|
||||||
durasi_response_time: 12228,
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
durasi_recovery_time: 11448,
|
reportData.value = await data.load()
|
||||||
status_akhir: 'Selesai',
|
}
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP AHMAD',
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
alamat_pelapor:
|
dataGrid.beginCustomLoading('')
|
||||||
'JL BENTENGAN TIMUR NO31 RT11/03, SUNTER JAYA, TANJUNG PRIOK, KOTA ADM. JAKARTA UTARA, DKI JAKARTA',
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
no_telp_pelapor: '082320000152',
|
|
||||||
keterangan_pelapor:
|
if (pdf) {
|
||||||
'MOHON BANTUAN PEMBATALAN PERMOHONAN PB NO AGENDA 545109912301319203 DIKARENAKAN PELANGGAN INGIN KE DAYA 2200 VA, PELANGGAN SUDAH MELAKUKAN PEMBAYARAN MELALAUI GOPAY TANGGAL 31/01/2023 PUKUL 18:49 WIB, NAMUN PEMBAYARAN BELUM MASUK, MOHON KONFRIMASI KE PELANGGAN, TERIMA KASIH. ',
|
dataGrid.endCustomLoading()
|
||||||
media: 'Call PLN 123',
|
}
|
||||||
waktu_media: '01/01/1970 00:00:00',
|
} else if (e.format === 'xlsx') {
|
||||||
keterangan_media: 'x',
|
exportToXLSX(reportMeta, e)
|
||||||
nama_ulp: 'UP3 TANJUNG PRIOK'
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
},
|
dataGrid.beginCustomLoading('')
|
||||||
{
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
no_laporan: 'K5123020100021',
|
|
||||||
waktu_lapor: '01/02/2023 02:04:04',
|
if (doc) {
|
||||||
waktu_response: '01/02/2023 02:26:01',
|
dataGrid.endCustomLoading()
|
||||||
waktu_recovery: '01/02/2023 02:34:06',
|
}
|
||||||
durasi_response_time: 1317,
|
|
||||||
durasi_recovery_time: 485,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'IBU TITIN ',
|
|
||||||
alamat_pelapor: 'TIDAK BISAMALKUKANPEMBELIAN KETMELEBIHI BATAS MAXIMUM / SISA 100 KWH ',
|
|
||||||
no_telp_pelapor: '087786974290',
|
|
||||||
keterangan_pelapor: 'TIDAK BISAMALKUKANPEMBELIAN KETMELEBIHI BATAS MAXIMUM / SISA 100 KWH ',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
waktu_media: '01/01/1970 00:00:00',
|
|
||||||
keterangan_media: 'x',
|
|
||||||
nama_ulp: 'ULP CIBITUNG'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K1423020100022',
|
|
||||||
waktu_lapor: '01/02/2023 03:13:25',
|
|
||||||
waktu_response: '01/02/2023 04:59:44',
|
|
||||||
waktu_recovery: '01/02/2023 07:03:37',
|
|
||||||
durasi_response_time: 6379,
|
|
||||||
durasi_recovery_time: 7433,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '000000000000000001820788',
|
|
||||||
nama_pelapor: 'IBU IRFI ',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL NIAGA 7 PERUM KEMANG BLOK F NO 23 KEC RAWA LUMBU KEL SEPANJANG JAYA KOTA BEKASI ACUAN LOKASI DEKAT RUMAH YATIM ',
|
|
||||||
no_telp_pelapor: '62816922683',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'TIDAK BISA INPUT TOKEN SETELAH UPDATE VKRN 43 (PTL TIDAK PADAM) \\nDENGAN NO METER 56700750112 DAN SISA KWH 15.1',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
waktu_media: '01/01/1970 00:00:00',
|
|
||||||
keterangan_media: 'x',
|
|
||||||
nama_ulp: 'ULP BANTARGEBANG'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5223020100106',
|
|
||||||
waktu_lapor: '01/02/2023 03:45:58',
|
|
||||||
waktu_response: '01/02/2023 06:24:51',
|
|
||||||
waktu_recovery: '01/02/2023 06:28:11',
|
|
||||||
durasi_response_time: 9533,
|
|
||||||
durasi_recovery_time: 200,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '000000000000000000943441',
|
|
||||||
nama_pelapor: 'IBU MELLY KURNIASIH',
|
|
||||||
alamat_pelapor: 'PERUMAHAN CEMPAKA ARUM JL. FLAMBOYAN 5 NO 191 CIREBON',
|
|
||||||
no_telp_pelapor: '08889353988',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'LEBIH TAGIH. ST AK REK FEB 2023 (28/01/2023) = 4608, ST APP TGL 26/01/2023 = 4496. REK BELUM DILUNASI. (RUMAH TIDAK DIHUNI NAMUN PAGAR TIDAK TERKUNCI, PETUGAS TIDAK DIKETAHUI DATANG KE LOKASI). PELANGGAN MENGINGINKAN AGAR HAL TERSEBUT TIDAK TERULANG KEMBALI.',
|
|
||||||
media: 'Live Chat PLN Mobile',
|
|
||||||
waktu_media: '01/01/1970 00:00:00',
|
|
||||||
keterangan_media: 'x',
|
|
||||||
nama_ulp: 'ULP SUMBER'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5223020100112',
|
|
||||||
waktu_lapor: '01/02/2023 04:16:48',
|
|
||||||
waktu_response: '01/02/2023 05:58:33',
|
|
||||||
waktu_recovery: '01/02/2023 12:02:23',
|
|
||||||
durasi_response_time: 6105,
|
|
||||||
durasi_recovery_time: 21830,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP HENDRIYANTO',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL.PALEM HIJAU, COKROKONTENG, RT.04 RW.2. KEL SIDOARUM. KEC GODEAN KAB SLEMAN PROV DIY',
|
|
||||||
no_telp_pelapor: '085921182228',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'PELANGGAN TIDAK BISA INPUT TOKEN SETELAH UPDATE VKRN 43. (BELUM ADA) PETUGAS YANG MELAKUKAN PENGATURAN. SISA KWH: 385.41. PTL (HAMPIR PADAM). PELANGGAN PERNAH LAPOR DENGAN NO: K5223013102183, STATUS SELESAI, PELANGGAN TIDAK DIKONFIRMASI s.d 1X6 JAM. LAPOR KEMBALI CC.54.JULIANA TGL 01/02/23 12FZUS3 08.46 085921182228',
|
|
||||||
media: 'Live Chat PLN Mobile',
|
|
||||||
waktu_media: '01/01/1970 00:00:00',
|
|
||||||
keterangan_media: 'x',
|
|
||||||
nama_ulp: 'ULP SEDAYU'
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type3 @update:filters="(value) => (filters = value)" />
|
<Type3 @update:filters="(value) => (filters = value)" />
|
||||||
</Filters>
|
</Filters>
|
||||||
|
|
||||||
<div id="data">
|
<div id="data">
|
||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
|
@option-changed="handleRequestChange"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loading == false"
|
:remote-operations="true"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
@ -22,6 +23,7 @@
|
|||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
:word-wrap-enabled="false"
|
:word-wrap-enabled="false"
|
||||||
>
|
>
|
||||||
|
<DxLoadPanel :enabled="true" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :page-size="20" :enabled="true" />
|
<DxPaging :page-size="20" :enabled="true" />
|
||||||
<DxPager
|
<DxPager
|
||||||
@ -41,13 +43,13 @@
|
|||||||
<DxColumnFixing :enabled="true" />
|
<DxColumnFixing :enabled="true" />
|
||||||
|
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column !align-top"
|
:allow-sorting="false"
|
||||||
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
cell-template="formatNumber"
|
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
:width="170"
|
:width="170"
|
||||||
@ -230,11 +232,21 @@
|
|||||||
<InputText :readonly="true" :value="dataSelected.no_laporan" class-name="flex-1" />
|
<InputText :readonly="true" :value="dataSelected.no_laporan" class-name="flex-1" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">Pembuat Laporan:</h3>
|
||||||
|
<InputText :readonly="true" :value="dataSelected.pembuat_laporan" class-name="flex-1" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
<h3 class="text-sm font-medium w-[170px] text-gray-800">Tgl Lapor:</h3>
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">Tgl Lapor:</h3>
|
||||||
<InputText :readonly="true" :value="dataSelected?.waktu_lapor" class-name="flex-1" />
|
<InputText :readonly="true" :value="dataSelected?.waktu_lapor" class-name="flex-1" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">Tgl Dialihkan:</h3>
|
||||||
|
<InputText :readonly="true" :value="dataSelected?.waktu_dialihkan" class-name="flex-1" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
<h3 class="text-sm font-medium w-[170px] text-gray-800">Tgl Response:</h3>
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">Tgl Response:</h3>
|
||||||
<InputText :readonly="true" :value="dataSelected?.waktu_response" class-name="flex-1" />
|
<InputText :readonly="true" :value="dataSelected?.waktu_response" class-name="flex-1" />
|
||||||
@ -245,6 +257,19 @@
|
|||||||
<InputText :readonly="true" :value="dataSelected?.waktu_recovery" class-name="flex-1" />
|
<InputText :readonly="true" :value="dataSelected?.waktu_recovery" class-name="flex-1" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">Recovery Time:</h3>
|
||||||
|
<InputText
|
||||||
|
:readonly="true"
|
||||||
|
class-name="flex-1"
|
||||||
|
:value="
|
||||||
|
parseInt(dataSelected?.durasi_recovery_time)
|
||||||
|
? formatWaktu(dataSelected?.durasi_recovery_time)
|
||||||
|
: '-'
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
<h3 class="text-sm font-medium w-[170px] text-gray-800">Response Time:</h3>
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">Response Time:</h3>
|
||||||
<InputText
|
<InputText
|
||||||
@ -259,16 +284,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
<h3 class="text-sm font-medium w-[170px] text-gray-800">Recovery Time:</h3>
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">Unit Asal :</h3>
|
||||||
<InputText
|
<InputText :readonly="true" :value="dataSelected?.nama_unit_lama" class-name="flex-1" />
|
||||||
:readonly="true"
|
</div>
|
||||||
class-name="flex-1"
|
|
||||||
:value="
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
parseInt(dataSelected?.durasi_recovery_time)
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">Unit Tujuan :</h3>
|
||||||
? formatWaktu(dataSelected?.durasi_recovery_time)
|
<InputText :readonly="true" :value="dataSelected?.nama_unit_baru" class-name="flex-1" />
|
||||||
: '-'
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
@ -317,7 +339,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
<BufferDialog v-if="loading" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -325,8 +346,10 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
|||||||
import InputText from '@/components/InputText.vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type3 from '@/components/Form/FiltersType/Type3.vue'
|
import Type3 from '@/components/Form/FiltersType/Type3.vue'
|
||||||
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import { onMounted, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
@ -341,16 +364,20 @@ import {
|
|||||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||||
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
|
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
|
||||||
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Keluhan/Daftar/DKeluhan_DKUL'
|
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Keluhan/Daftar/DKeluhan_DKUL'
|
||||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
|
||||||
|
|
||||||
const position = { of: '#data' }
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
const showIndicator = ref(true)
|
|
||||||
const shading = ref(true)
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
const showPane = ref(true)
|
skip: 0,
|
||||||
const data = ref<any[]>([])
|
take: 20,
|
||||||
|
requireTotalCount: true,
|
||||||
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
const dataSelected = ref<any>({})
|
const dataSelected = ref<any>({})
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
const loading = ref(false)
|
const reportData: any = ref(null)
|
||||||
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
const filters = ref()
|
const filters = ref()
|
||||||
const reportMeta = ref({
|
const reportMeta = ref({
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
@ -359,42 +386,137 @@ const reportMeta = ref({
|
|||||||
periode: ''
|
periode: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const showDetail = () => (dialogDetail.value = true)
|
const allowTableRequest = ref(false)
|
||||||
|
const data = new CustomStore({
|
||||||
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
return await requestGraphQl(queries.keluhan.daftar.ssdaftarKeluhanDialihkanKeUnitLain, query)
|
||||||
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarKeluhanDialihkanKeUnitLain
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const closeDialog = () => (dialogDetail.value = false)
|
const closeDialog = () => (dialogDetail.value = false)
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
|
||||||
if (e.format === 'pdf') {
|
|
||||||
exportToPDF(reportMeta, data)
|
|
||||||
} else if (e.format === 'xlsx') {
|
|
||||||
exportToXLSX(reportMeta, e)
|
|
||||||
} else {
|
|
||||||
exportToDOCX(reportMeta, data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
|
||||||
const clearSelection = () => {
|
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
|
||||||
dataGrid.clearSelection()
|
|
||||||
}
|
|
||||||
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
|
||||||
if (selectedRowsData[0] != undefined) {
|
|
||||||
dataSelected.value = selectedRowsData[0]
|
|
||||||
}
|
|
||||||
clearSelection()
|
|
||||||
showDetail()
|
|
||||||
}
|
|
||||||
|
|
||||||
const resetData = () => {
|
const resetData = () => {
|
||||||
data.value = []
|
allowTableRequest.value = false
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
const handleRequestChange = (e: any) => {
|
||||||
resetData()
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
const dateValue = params.periode.split(' s/d ')
|
const dateValue = params.periode.split(' s/d ')
|
||||||
const { ulp, uid, up3 } = params
|
const { ulp, uid, up3 } = params
|
||||||
|
|
||||||
const query = {
|
return {
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
@ -405,141 +527,46 @@ const filterData = async (params: any) => {
|
|||||||
idUid: uid ? uid.id : 0,
|
idUid: uid ? uid.id : 0,
|
||||||
idUp3: up3 ? up3.id : 0
|
idUp3: up3 ? up3.id : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.value = true
|
|
||||||
await requestGraphQl(queries.keluhan.daftar.keluhanDipindahkanKeIDULPLain, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarKeluhanDialihkanKeUnitLain
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
const clearSelection = () => {
|
||||||
})
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
.catch((err) => {
|
dataGrid.clearSelection()
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
if (import.meta.env.DEV) {
|
if (selectedRowsData[0] != undefined) {
|
||||||
data.value = [
|
dataSelected.value = selectedRowsData[0]
|
||||||
{
|
}
|
||||||
no_laporan: 'K5523020400288',
|
clearSelection()
|
||||||
pembuat_laporan: 'CC.55.ANISA',
|
showDetail()
|
||||||
waktu_lapor: '04/02/2023 11:18:57',
|
}
|
||||||
waktu_dialihkan: '04/02/2023 12:49:36',
|
|
||||||
waktu_response: '04/02/2023 12:50:21',
|
const showDetail = () => (dialogDetail.value = true)
|
||||||
waktu_recovery: '04/02/2023 13:06:53',
|
|
||||||
durasi_response_time: 5484,
|
const onExporting = async (e: any) => {
|
||||||
durasi_recovery_time: 992,
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
id_unit_lama: 227,
|
|
||||||
nama_unit_lama: 'ULP MEDAN SELATAN',
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
id_unit_baru: 5,
|
reportData.value = await data.load()
|
||||||
nama_unit_baru: 'ULP DENAI',
|
}
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
nama_pelapor: 'IBU ELVIRA ',
|
dataGrid.beginCustomLoading('')
|
||||||
alamat_pelapor:
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
'JL PASAR 3 GG PISANG NO.22 RT0/RW0 KEL BANDAR KALIFA KEC PERCUT SEI TUAN KAB DELI SERDANG SUMATRA UTARA',
|
|
||||||
no_telp_pelapor: '087882621344',
|
if (pdf) {
|
||||||
keterangan_pelapor:
|
dataGrid.endCustomLoading()
|
||||||
'1 APP PRABAYAR TERTERA GAGAL. TIDAK BISA MEMASUKKAN PULSA. (PTL TIDAK PADAM ). SETELAH UPDATE VKRN 43. NO TOKEN : 38665587538675472633. SISA PULSA : 43.20 KWH PELANGGAN MENGHUBUNGI KEMBALI. UPDATE CC.52.ETA',
|
}
|
||||||
media: 'Call PLN 123'
|
} else if (e.format === 'xlsx') {
|
||||||
},
|
exportToXLSX(reportMeta, e)
|
||||||
{
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
no_laporan: 'K5423021005925',
|
dataGrid.beginCustomLoading('')
|
||||||
pembuat_laporan: 'CC.54.HENDI',
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
waktu_lapor: '10/02/2023 20:24:35',
|
|
||||||
waktu_dialihkan: '10/02/2023 21:02:39',
|
if (doc) {
|
||||||
waktu_response: '10/02/2023 21:36:20',
|
dataGrid.endCustomLoading()
|
||||||
waktu_recovery: '10/02/2023 21:42:37',
|
}
|
||||||
durasi_response_time: 4305,
|
|
||||||
durasi_recovery_time: 377,
|
|
||||||
id_unit_lama: 233,
|
|
||||||
nama_unit_lama: 'ULP PURWOKERTO KOTA',
|
|
||||||
id_unit_baru: 236,
|
|
||||||
nama_unit_baru: 'ULP BANJARNEGARA',
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP EKO BUDIYANTO',
|
|
||||||
alamat_pelapor:
|
|
||||||
'ALAMAT LOKASI : DN TANJUNG TIRTA RT 5 RW 1 KEL DS TANJUNG TIRTA KEC PUNGGELAN KAB BANJARNEGARA JATENG, ACUAN LOKASI : DEKAT KELURAHAN',
|
|
||||||
no_telp_pelapor: '08121512224',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MOHON UNTUK DITINDAKLANJUTI PROSES PS NON PELANGGAN ( L/ 5500 VA ) MELALUI PLN 123 DENGAN NO AGENDA 522040132302100027 DAN NO REG 5220429004905 DIPERUNTUKAN UNTUK PENERANGAN BTS SELAMA 14 HARI MULAI PADA TGL 11/2/23 - 24/2/23 PUKUL 12:00 WIB PEMOHON MENGAKU SEBAGAI PIHAK YANG BERTANGGUNG JAWAB',
|
|
||||||
media: 'Call PLN 123'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423021005015',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '10/02/2023 18:01:21',
|
|
||||||
waktu_dialihkan: '10/02/2023 18:04:07',
|
|
||||||
waktu_response: '10/02/2023 18:13:47',
|
|
||||||
waktu_recovery: '01/01/1970 00:00:00',
|
|
||||||
durasi_response_time: 746,
|
|
||||||
durasi_recovery_time: 33136328,
|
|
||||||
id_unit_lama: 227,
|
|
||||||
nama_unit_lama: 'ULP MEDAN SELATAN',
|
|
||||||
id_unit_baru: 225,
|
|
||||||
nama_unit_baru: 'ULP MEDAN KOTA',
|
|
||||||
status_akhir: 'Dalam Proses Bidang Unit',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Ervina Vina4',
|
|
||||||
alamat_pelapor: 'JL PSR MERAH GG SETIA UJUNG KEL BINJAI No.0 RT.0 RW.0 M DENAI',
|
|
||||||
no_telp_pelapor: '6285276706679',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MUTASI_K (G9923021098935:app) - sudah beli token.tapi gagal terus tolong PLN tindak lanjutin lebih cepat.terima kasih',
|
|
||||||
media: 'PLN Mobile'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423021004276',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '10/02/2023 16:20:21',
|
|
||||||
waktu_dialihkan: '11/02/2023 06:28:29',
|
|
||||||
waktu_response: '11/02/2023 13:39:37',
|
|
||||||
waktu_recovery: '11/02/2023 16:28:03',
|
|
||||||
durasi_response_time: 76756,
|
|
||||||
durasi_recovery_time: 10106,
|
|
||||||
id_unit_lama: 62,
|
|
||||||
nama_unit_lama: 'ULP KAYU AGUNG',
|
|
||||||
id_unit_baru: 82,
|
|
||||||
nama_unit_baru: 'ULP TUGU MULYO',
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'call center bmg',
|
|
||||||
alamat_pelapor:
|
|
||||||
'Desa Gading Raja Desa SP2 Kecamatan Padamaran Kabupaten Ogan Komering Ilir, Sumatera Selatan',
|
|
||||||
no_telp_pelapor: '6281225199487',
|
|
||||||
keterangan_pelapor: 'Seal in MCB KWH NA or Seal Papan OKA NA',
|
|
||||||
media: 'PLN Mobile'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423021001969',
|
|
||||||
pembuat_laporan: 'PLNMOBILE',
|
|
||||||
waktu_lapor: '10/02/2023 10:49:02',
|
|
||||||
waktu_dialihkan: '10/02/2023 10:53:35',
|
|
||||||
waktu_response: '10/02/2023 11:21:09',
|
|
||||||
waktu_recovery: '10/02/2023 12:15:16',
|
|
||||||
durasi_response_time: 1927,
|
|
||||||
durasi_recovery_time: 3247,
|
|
||||||
id_unit_lama: 238,
|
|
||||||
nama_unit_lama: 'UP3 TANJUNG PRIOK',
|
|
||||||
id_unit_baru: 194,
|
|
||||||
nama_unit_baru: 'UP3 BANDENGAN',
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'muhammad alinafia',
|
|
||||||
alamat_pelapor: 'blok a no 55',
|
|
||||||
no_telp_pelapor: '6282123607797',
|
|
||||||
keterangan_pelapor: 'K5423021001925',
|
|
||||||
media: 'PLN Mobile'
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type10 @update:filters="(value) => (filters = value)" />
|
<Type10 @update:filters="(value) => (filters = value)" />
|
||||||
</Filters>
|
</Filters>
|
||||||
|
|
||||||
<div id="data">
|
<div id="data">
|
||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
|
@option-changed="handleRequestChange"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loadingData == false"
|
:remote-operations="true"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
@ -22,6 +23,7 @@
|
|||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
:word-wrap-enabled="false"
|
:word-wrap-enabled="false"
|
||||||
>
|
>
|
||||||
|
<DxLoadPanel :enabled="true" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :page-size="20" :enabled="true" />
|
<DxPaging :page-size="20" :enabled="true" />
|
||||||
<DxPager
|
<DxPager
|
||||||
@ -42,11 +44,12 @@
|
|||||||
<DxColumnFixing :enabled="true" />
|
<DxColumnFixing :enabled="true" />
|
||||||
|
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column"
|
:allow-sorting="false"
|
||||||
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
@ -76,7 +79,7 @@
|
|||||||
<DxColumn
|
<DxColumn
|
||||||
:width="170"
|
:width="170"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
data-field="waktu_selesai"
|
data-field="waktu_recovery"
|
||||||
caption="Tgl Recovery"
|
caption="Tgl Recovery"
|
||||||
css-class="custom-table-column"
|
css-class="custom-table-column"
|
||||||
cell-template="formatText"
|
cell-template="formatText"
|
||||||
@ -192,7 +195,7 @@
|
|||||||
|
|
||||||
<DetailDialog
|
<DetailDialog
|
||||||
:open="dialogDetail"
|
:open="dialogDetail"
|
||||||
:title="detailType == 'table' ? 'Daftar Lapor ULang' : 'Detail Gangguan'"
|
:title="detailType == 'table' ? 'Daftar Lapor Ulang' : 'Detail Keluhan'"
|
||||||
@on-close="closeDialog"
|
@on-close="closeDialog"
|
||||||
:full-width="detailType == 'table'"
|
:full-width="detailType == 'table'"
|
||||||
>
|
>
|
||||||
@ -214,7 +217,7 @@
|
|||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
<h3 class="text-sm font-medium w-[170px] text-gray-800">Tanggal Recovery:</h3>
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">Tanggal Recovery:</h3>
|
||||||
<InputText :readonly="true" :value="dataSelected?.waktu_selesai" class-name="flex-1" />
|
<InputText :readonly="true" :value="dataSelected?.waktu_recovery" class-name="flex-1" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
@ -311,7 +314,6 @@
|
|||||||
:row-alternation-enabled="true"
|
:row-alternation-enabled="true"
|
||||||
:hover-state-enabled="true"
|
:hover-state-enabled="true"
|
||||||
@selection-changed="onDataSubSelectionChanged"
|
@selection-changed="onDataSubSelectionChanged"
|
||||||
@exporting="onExporting"
|
|
||||||
:allow-column-resizing="true"
|
:allow-column-resizing="true"
|
||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
>
|
>
|
||||||
@ -327,11 +329,6 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
<DxSearchPanel :visible="true" :highlight-case-sensitive="true" />
|
||||||
<DxExport
|
|
||||||
:enabled="true"
|
|
||||||
:formats="['pdf', 'xlsx', 'document']"
|
|
||||||
:allow-export-selected-data="false"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column"
|
css-class="custom-table-column"
|
||||||
@ -415,7 +412,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
<BufferDialog v-if="loadingData || loadingSubData" />
|
|
||||||
|
<BufferDialog v-if="loadingSubData" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -423,35 +421,42 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
|||||||
import InputText from '@/components/InputText.vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type10 from '@/components/Form/FiltersType/Type10.vue'
|
import Type10 from '@/components/Form/FiltersType/Type10.vue'
|
||||||
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import { onMounted, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
DxColumnFixing,
|
DxColumnFixing,
|
||||||
DxExport, DxPager,
|
DxExport,
|
||||||
|
DxPager,
|
||||||
DxPaging,
|
DxPaging,
|
||||||
DxSearchPanel,
|
DxSearchPanel,
|
||||||
DxSelection
|
DxSelection,
|
||||||
|
DxLoadPanel
|
||||||
} from 'devextreme-vue/data-grid'
|
} from 'devextreme-vue/data-grid'
|
||||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||||
import { formatNumber, isNumber } from '@/utils/numbers'
|
import { formatNumber, isNumber } from '@/utils/numbers'
|
||||||
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Keluhan/Daftar/DKeluhan_PLD1K'
|
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Keluhan/Daftar/DKeluhan_PLD1K'
|
||||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
|
||||||
|
|
||||||
const position = { of: '#data' }
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
const showIndicator = ref(true)
|
|
||||||
const shading = ref(true)
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
const showPane = ref(true)
|
skip: 0,
|
||||||
const data = ref<any[]>([])
|
take: 20,
|
||||||
|
requireTotalCount: true,
|
||||||
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
const dataSub = ref<any[]>([])
|
const dataSub = ref<any[]>([])
|
||||||
const dataSelected = ref<any>()
|
const dataSelected = ref<any>()
|
||||||
const dataSubSelected = ref<any>()
|
const dataSubSelected = ref<any>()
|
||||||
|
const reportData: any = ref(null)
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
const closedialogDetail = () => (dialogDetail.value = false)
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
const loadingData = ref(false)
|
|
||||||
const loadingSubData = ref(false)
|
const loadingSubData = ref(false)
|
||||||
const detailType = ref('form') // form, table
|
const detailType = ref('form')
|
||||||
const filters = ref()
|
const filters = ref()
|
||||||
const reportMeta = ref({
|
const reportMeta = ref({
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
@ -462,6 +467,154 @@ const reportMeta = ref({
|
|||||||
periode: ''
|
periode: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const allowTableRequest = ref(false)
|
||||||
|
const data = new CustomStore({
|
||||||
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
return await requestGraphQl(
|
||||||
|
queries.keluhan.daftar.ssdaftarKeluhanMelaporLebihDariSatuKali,
|
||||||
|
query
|
||||||
|
)
|
||||||
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarKeluhanMelaporLebihDariSatuKali
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const resetData = () => {
|
||||||
|
allowTableRequest.value = false
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleRequestChange = (e: any) => {
|
||||||
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
|
const dateValue = params.periode.split(' s/d ')
|
||||||
|
const { ulp, uid, up3 } = params
|
||||||
|
const minJmlLapor = params.minJmlLapor ? params.minJmlLapor : 1
|
||||||
|
const maxJmlLapor = params.maxJmlLapor ? params.maxJmlLapor : 100
|
||||||
|
|
||||||
|
return {
|
||||||
|
minJmlLapor: minJmlLapor,
|
||||||
|
maxJmlLapor: maxJmlLapor,
|
||||||
|
dateFrom: dateValue[0]
|
||||||
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
|
: new Date().toISOString().slice(0, 10),
|
||||||
|
dateTo: dateValue[1]
|
||||||
|
? dateValue[1].split('-').reverse().join('-')
|
||||||
|
: new Date().toISOString().slice(0, 10),
|
||||||
|
idUlp: ulp ? ulp.id : 0,
|
||||||
|
idUid: uid ? uid.id : 0,
|
||||||
|
idUp3: up3 ? up3.id : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const setDetailType = (columnCaption: string) => {
|
const setDetailType = (columnCaption: string) => {
|
||||||
if (columnCaption == 'Jml Lapor') {
|
if (columnCaption == 'Jml Lapor') {
|
||||||
detailType.value = 'table'
|
detailType.value = 'table'
|
||||||
@ -471,7 +624,6 @@ const setDetailType = (columnCaption: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getDetail = async () => {
|
const getDetail = async () => {
|
||||||
const dateValue = filters.value.periode.split(' s/d ')
|
|
||||||
const selected = dataSelected.value
|
const selected = dataSelected.value
|
||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
@ -497,11 +649,11 @@ const getDetail = async () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
|
||||||
const clearSelection = () => {
|
const clearSelection = () => {
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
dataGrid.clearSelection()
|
dataGrid.clearSelection()
|
||||||
}
|
}
|
||||||
|
|
||||||
const showDetail = () => {
|
const showDetail = () => {
|
||||||
clearSelection()
|
clearSelection()
|
||||||
dataSubSelected.value = null
|
dataSubSelected.value = null
|
||||||
@ -525,152 +677,29 @@ const onDataSubSelectionChanged = ({ selectedRowsData }: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const closeDialog = () => (dialogDetail.value = false)
|
const closeDialog = () => (dialogDetail.value = false)
|
||||||
|
const onExporting = async (e: any) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
if (e.format === 'pdf') {
|
reportData.value = await data.load()
|
||||||
exportToPDF(reportMeta, data)
|
}
|
||||||
|
|
||||||
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
|
dataGrid.beginCustomLoading('')
|
||||||
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
|
|
||||||
|
if (pdf) {
|
||||||
|
dataGrid.endCustomLoading()
|
||||||
|
}
|
||||||
} else if (e.format === 'xlsx') {
|
} else if (e.format === 'xlsx') {
|
||||||
exportToXLSX(reportMeta, e)
|
exportToXLSX(reportMeta, e)
|
||||||
} else {
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
exportToDOCX(reportMeta, data)
|
dataGrid.beginCustomLoading('')
|
||||||
}
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
}
|
|
||||||
|
|
||||||
const resetData = () => {
|
if (doc) {
|
||||||
data.value = []
|
dataGrid.endCustomLoading()
|
||||||
dataSub.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
|
||||||
resetData()
|
|
||||||
const dateValue = params.periode.split(' s/d ')
|
|
||||||
const { ulp, uid, up3 } = params
|
|
||||||
const minJmlLapor = params.minJmlLapor ? params.minJmlLapor : 1
|
|
||||||
const maxJmlLapor = params.maxJmlLapor ? params.maxJmlLapor : 100
|
|
||||||
|
|
||||||
const query = {
|
|
||||||
minJmlLapor: minJmlLapor,
|
|
||||||
maxJmlLapor: maxJmlLapor,
|
|
||||||
dateFrom: dateValue[0]
|
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
|
||||||
: new Date().toISOString().slice(0, 10),
|
|
||||||
dateTo: dateValue[1]
|
|
||||||
? dateValue[1].split('-').reverse().join('-')
|
|
||||||
: new Date().toISOString().slice(0, 10),
|
|
||||||
idUlp: ulp ? ulp.id : 0,
|
|
||||||
idUid: uid ? uid.id : 0,
|
|
||||||
idUp3: up3 ? up3.id : 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loadingData.value = true
|
|
||||||
await requestGraphQl(queries.keluhan.daftar.keluhanMelaporLebihDariSatuKali, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarKeluhanMelaporLebihDariSatuKali
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loadingData.value = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (import.meta.env.DEV) {
|
|
||||||
data.value = [
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423020100003',
|
|
||||||
waktu_lapor: '01/02/2023 00:00:54',
|
|
||||||
waktu_response: '01/01/1970 00:00:00',
|
|
||||||
waktu_recovery: '01/01/1970 00:00:00',
|
|
||||||
jumlah_lapor: 1,
|
|
||||||
durasi_response_time: -1675209654,
|
|
||||||
durasi_recovery_time: 1709189971,
|
|
||||||
status_akhir: 'Dalam Proses Manager Unit',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'ROLLY DWI NOVIANDARU',
|
|
||||||
alamat_pelapor: 'TA MBAK BERAS RT1 CER No.ME RT.00 RW.00',
|
|
||||||
no_telp_pelapor: '6285785412365',
|
|
||||||
keterangan_pelapor: 'meter macet',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP BENJENG'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423020100006',
|
|
||||||
waktu_lapor: '01/02/2023 00:01:23',
|
|
||||||
waktu_response: '01/02/2023 00:01:59',
|
|
||||||
waktu_recovery: '01/02/2023 00:02:52',
|
|
||||||
jumlah_lapor: 1,
|
|
||||||
durasi_response_time: 36,
|
|
||||||
durasi_recovery_time: 53,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Doni',
|
|
||||||
alamat_pelapor: 'JL KH WASYID NO 119 CILEGON No.0 RT.0 RW.0 CILEGON',
|
|
||||||
no_telp_pelapor: '62895391110909',
|
|
||||||
keterangan_pelapor: 'mohon info terkait prediksi pemakaian tenaga listrik',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP PRIMA KRAKATAU (TT/TM)'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423020100022',
|
|
||||||
waktu_lapor: '01/02/2023 00:06:30',
|
|
||||||
waktu_response: '01/02/2023 04:26:02',
|
|
||||||
waktu_recovery: '01/01/1970 00:00:00',
|
|
||||||
jumlah_lapor: 1,
|
|
||||||
durasi_response_time: 15572,
|
|
||||||
durasi_recovery_time: 33964409,
|
|
||||||
status_akhir: 'Dalam Proses Bidang Unit',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Yolanda Palar',
|
|
||||||
alamat_pelapor: 'JL TANGGUL SELATAN No.0',
|
|
||||||
no_telp_pelapor: '6285256607777',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MUTASI_K (G9923020187811:meteran terblokir) - Kilometer Terblokir, Listrik Padam, Vouchers tidak bisa diisi. informasi dari petugas Aplikasi harus ganti kilometer. saya Naikan Daya dari Agustus 2022 Terblokirnya Hari ini bagaimana ya?',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP PALU KOTA'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423020100028',
|
|
||||||
waktu_lapor: '01/02/2023 00:09:30',
|
|
||||||
waktu_response: '01/01/1970 00:00:00',
|
|
||||||
waktu_recovery: '01/01/1970 00:00:00',
|
|
||||||
jumlah_lapor: 1,
|
|
||||||
durasi_response_time: -1675210170,
|
|
||||||
durasi_recovery_time: 1709189971,
|
|
||||||
status_akhir: 'Dalam Proses Manager Unit',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Tisatin Najemi',
|
|
||||||
alamat_pelapor: 'JL ABADI 2 No. RT.47 RW.7 GT MANGGIS',
|
|
||||||
no_telp_pelapor: '6281349719849',
|
|
||||||
keterangan_pelapor: 'saya baru aja isi token listrik lewat bangking cuman gak mau masuk ',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP BANJARBARU'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423020100029',
|
|
||||||
waktu_lapor: '01/02/2023 00:09:39',
|
|
||||||
waktu_response: '01/02/2023 05:48:52',
|
|
||||||
waktu_recovery: '01/01/1970 00:00:00',
|
|
||||||
jumlah_lapor: 1,
|
|
||||||
durasi_response_time: 20353,
|
|
||||||
durasi_recovery_time: 33959439,
|
|
||||||
status_akhir: 'Dalam Proses Bidang Unit',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'fris jhon ferni',
|
|
||||||
alamat_pelapor: 'the royal griya loka blok o no 05',
|
|
||||||
no_telp_pelapor: '62895396277717',
|
|
||||||
keterangan_pelapor: 'MUTASI_K (G9923020187825:tekmik) - token gagal masuk',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP TABANAN'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type11
|
<Type11
|
||||||
@update:filters="(value) => (filters = value)"
|
@update:filters="(value) => (filters = value)"
|
||||||
:sla-options="[
|
:sla-options="[
|
||||||
@ -22,10 +22,11 @@
|
|||||||
<div id="data">
|
<div id="data">
|
||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
|
@option-changed="handleRequestChange"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loading == false"
|
:remote-operations="true"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
@ -38,6 +39,7 @@
|
|||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
:word-wrap-enabled="false"
|
:word-wrap-enabled="false"
|
||||||
>
|
>
|
||||||
|
<DxLoadPanel :enabled="true" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :page-size="20" :enabled="true" />
|
<DxPaging :page-size="20" :enabled="true" />
|
||||||
<DxPager
|
<DxPager
|
||||||
@ -57,11 +59,12 @@
|
|||||||
<DxColumnFixing :enabled="true" />
|
<DxColumnFixing :enabled="true" />
|
||||||
|
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column"
|
:allow-sorting="false"
|
||||||
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
@ -283,7 +286,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
<BufferDialog v-if="loading" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -291,8 +293,10 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
|||||||
import InputText from '@/components/InputText.vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type11 from '@/components/Form/FiltersType/Type11.vue'
|
import Type11 from '@/components/Form/FiltersType/Type11.vue'
|
||||||
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import { onMounted, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
@ -310,59 +314,163 @@ import {
|
|||||||
exportToDOCX,
|
exportToDOCX,
|
||||||
exportToXLSX
|
exportToXLSX
|
||||||
} from '@/report/Keluhan/Daftar/DKeluhan_RecoveryTime'
|
} from '@/report/Keluhan/Daftar/DKeluhan_RecoveryTime'
|
||||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
|
||||||
|
|
||||||
const position = { of: '#data' }
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
const showIndicator = ref(true)
|
|
||||||
const shading = ref(true)
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
const showPane = ref(true)
|
skip: 0,
|
||||||
|
take: 20,
|
||||||
|
requireTotalCount: true,
|
||||||
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
const dataSelected = ref<any>()
|
const dataSelected = ref<any>()
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
|
const reportData: any = ref(null)
|
||||||
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
|
const filters = ref()
|
||||||
|
const reportMeta = ref({
|
||||||
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
|
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||||
|
ulp: { id: 0, name: 'Semua Unit Layanan Pelanggan' },
|
||||||
|
periode: '',
|
||||||
|
minTime: '',
|
||||||
|
maxTime: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
const allowTableRequest = ref(false)
|
||||||
|
const data = new CustomStore({
|
||||||
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
return await requestGraphQl(queries.keluhan.daftar.ssdaftarKeluhanRecoveryTime, query)
|
||||||
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarKeluhanRecoveryTime
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
dialogDetail.value = false
|
dialogDetail.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
|
||||||
const clearSelection = () => {
|
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
|
||||||
dataGrid.clearSelection()
|
|
||||||
}
|
|
||||||
const showDetail = () => {
|
|
||||||
clearSelection()
|
|
||||||
dialogDetail.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
|
||||||
if (selectedRowsData[0] != undefined) {
|
|
||||||
dataSelected.value = selectedRowsData[0]
|
|
||||||
}
|
|
||||||
showDetail()
|
|
||||||
}
|
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
|
||||||
if (e.format === 'pdf') {
|
|
||||||
exportToPDF(reportMeta, data)
|
|
||||||
} else if (e.format === 'xlsx') {
|
|
||||||
exportToXLSX(reportMeta, e)
|
|
||||||
} else {
|
|
||||||
exportToDOCX(reportMeta, data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = ref<any[]>([])
|
|
||||||
const loading = ref(false)
|
|
||||||
|
|
||||||
const resetData = () => {
|
const resetData = () => {
|
||||||
data.value = []
|
allowTableRequest.value = false
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
const handleRequestChange = (e: any) => {
|
||||||
resetData()
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
const dateValue = params.periode.split(' s/d ')
|
const dateValue = params.periode.split(' s/d ')
|
||||||
const { ulp, uid, up3, minTime, maxTime } = params
|
const { ulp, uid, up3, minTime, maxTime } = params
|
||||||
|
|
||||||
const query = {
|
return {
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
@ -375,124 +483,48 @@ const filterData = async (params: any) => {
|
|||||||
idUid: uid ? uid.id : 0,
|
idUid: uid ? uid.id : 0,
|
||||||
idUp3: up3 ? up3.id : 0
|
idUp3: up3 ? up3.id : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.value = true
|
|
||||||
await requestGraphQl(queries.keluhan.daftar.keluhanRecoveryTime, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarKeluhanRecoveryTime
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
const clearSelection = () => {
|
||||||
})
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
.catch((err) => {
|
dataGrid.clearSelection()
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const filters = ref()
|
const showDetail = () => {
|
||||||
const reportMeta = ref({
|
clearSelection()
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
dialogDetail.value = true
|
||||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
}
|
||||||
ulp: { id: 0, name: 'Semua Unit Layanan Pelanggan' },
|
|
||||||
periode: '',
|
|
||||||
minTime: '',
|
|
||||||
maxTime: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
if (import.meta.env.DEV) {
|
if (selectedRowsData[0] != undefined) {
|
||||||
data.value = [
|
dataSelected.value = selectedRowsData[0]
|
||||||
{
|
}
|
||||||
no_laporan: 'K5423020100006',
|
showDetail()
|
||||||
waktu_lapor: '01/02/2023 00:01:23',
|
}
|
||||||
waktu_response: '01/02/2023 00:01:59',
|
|
||||||
waktu_recovery: '01/02/2023 00:02:52',
|
const onExporting = async (e: any) => {
|
||||||
durasi_response_time: 36,
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
durasi_recovery_time: 53,
|
|
||||||
status_akhir: 'Selesai',
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
idpel_nometer: '',
|
reportData.value = await data.load()
|
||||||
nama_pelapor: 'Doni',
|
}
|
||||||
alamat_pelapor: 'JL KH WASYID NO 119 CILEGON No.0 RT.0 RW.0 CILEGON',
|
|
||||||
no_telp_pelapor: '62895391110909',
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
keterangan_pelapor: 'mohon info terkait prediksi pemakaian tenaga listrik',
|
dataGrid.beginCustomLoading('')
|
||||||
media: 'PLN Mobile',
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
nama_ulp: 'ULP PRIMA KRAKATAU (TT/TM)'
|
|
||||||
},
|
if (pdf) {
|
||||||
{
|
dataGrid.endCustomLoading()
|
||||||
no_laporan: 'K5423020100030',
|
}
|
||||||
waktu_lapor: '01/02/2023 00:10:39',
|
} else if (e.format === 'xlsx') {
|
||||||
waktu_response: '01/02/2023 01:17:31',
|
exportToXLSX(reportMeta, e)
|
||||||
waktu_recovery: '01/01/1970 00:00:00',
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
durasi_response_time: 4012,
|
dataGrid.beginCustomLoading('')
|
||||||
durasi_recovery_time: 33977641,
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
status_akhir: 'Dalam Proses Bidang Unit',
|
|
||||||
idpel_nometer: '',
|
if (doc) {
|
||||||
nama_pelapor: 'wulan',
|
dataGrid.endCustomLoading()
|
||||||
alamat_pelapor: 'DS OELETA No. RT.3 RW.2 ALAK',
|
}
|
||||||
no_telp_pelapor: '6285788900596',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MUTASI_K (G9923020187809:pemeriksaan ) - pulsa meter su babunyi .ketong isi gagal terus . apa bisa di konfirmasi kenapa begitu ',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP KUPANG'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423020100045',
|
|
||||||
waktu_lapor: '01/02/2023 00:16:57',
|
|
||||||
waktu_response: '01/02/2023 00:19:40',
|
|
||||||
waktu_recovery: '01/01/1970 00:00:00',
|
|
||||||
durasi_response_time: 163,
|
|
||||||
durasi_recovery_time: 33981112,
|
|
||||||
status_akhir: 'Dalam Proses Bidang Unit',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'veri susanto',
|
|
||||||
alamat_pelapor: 'JL NURUL HUDA KOMP TERAS HOKILAND No.A6 RT.2 RW.3 DS KAPUR',
|
|
||||||
no_telp_pelapor: '6282150235722',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MUTASI_K (G9923020187794:cek kwh) - tidak bisa membeli vocer listrik,vocer listrik sudah mau habis',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP SIANTAN'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423020100062',
|
|
||||||
waktu_lapor: '01/02/2023 00:29:48',
|
|
||||||
waktu_response: '01/02/2023 01:08:45',
|
|
||||||
waktu_recovery: '01/01/1970 00:00:00',
|
|
||||||
durasi_response_time: 2337,
|
|
||||||
durasi_recovery_time: 33978167,
|
|
||||||
status_akhir: 'Dalam Proses Bidang Unit',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Diki wahyudi',
|
|
||||||
alamat_pelapor: 'jl Galunggung amansari RT. 01 rw 01',
|
|
||||||
no_telp_pelapor: '6285770967966',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MUTASI_K (G9923020187796:token gagal) - token di masukan keterangan gagal',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP RENGASDENGKLOK'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423020100089',
|
|
||||||
waktu_lapor: '01/02/2023 00:45:30',
|
|
||||||
waktu_response: '01/02/2023 01:00:27',
|
|
||||||
waktu_recovery: '01/02/2023 07:53:08',
|
|
||||||
durasi_response_time: 897,
|
|
||||||
durasi_recovery_time: 24761,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'SAHABATJAKARTA',
|
|
||||||
alamat_pelapor: 'Stasiun Jln. Nyi Raja Permas',
|
|
||||||
no_telp_pelapor: '6281210701126',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'NO AGENDA 538319912301199708\\nMOHON PERCEPATAN PASANG BARU ATAS NAMA CFC ST KA BOGOR..KARNA HARI RABU 1 FEBRUARI 2023 GERAI TERSEBUT MAU GRAND OPENING *5 MOHON DAPAT PRIORITAS INVESTASI KAMI DI KOTA BOGOR TSB TKSH',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP BOGOR KOTA'
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type11
|
<Type11
|
||||||
@update:filters="(value) => (filters = value)"
|
@update:filters="(value) => (filters = value)"
|
||||||
:sla-options="[
|
:sla-options="[
|
||||||
@ -22,10 +22,11 @@
|
|||||||
<div id="data">
|
<div id="data">
|
||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
|
@option-changed="handleRequestChange"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loading == false"
|
:remote-operations="true"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
@ -38,6 +39,7 @@
|
|||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
:word-wrap-enabled="false"
|
:word-wrap-enabled="false"
|
||||||
>
|
>
|
||||||
|
<DxLoadPanel :enabled="true" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :page-size="20" :enabled="true" />
|
<DxPaging :page-size="20" :enabled="true" />
|
||||||
<DxPager
|
<DxPager
|
||||||
@ -57,11 +59,12 @@
|
|||||||
<DxColumnFixing :enabled="true" />
|
<DxColumnFixing :enabled="true" />
|
||||||
|
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column"
|
:allow-sorting="false"
|
||||||
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
@ -301,7 +304,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
<BufferDialog v-if="loading" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -309,8 +311,10 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
|||||||
import InputText from '@/components/InputText.vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type11 from '@/components/Form/FiltersType/Type11.vue'
|
import Type11 from '@/components/Form/FiltersType/Type11.vue'
|
||||||
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import { onMounted, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
@ -330,18 +334,176 @@ import {
|
|||||||
exportToDOCX
|
exportToDOCX
|
||||||
} from '@/report/Keluhan/Daftar/DKeluhan_ResponseTime'
|
} from '@/report/Keluhan/Daftar/DKeluhan_ResponseTime'
|
||||||
|
|
||||||
const position = { of: '#data' }
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
const showIndicator = ref(true)
|
|
||||||
const shading = ref(true)
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
const showPane = ref(true)
|
skip: 0,
|
||||||
|
take: 20,
|
||||||
|
requireTotalCount: true,
|
||||||
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
const dataSelected = ref<any>()
|
const dataSelected = ref<any>()
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
|
const reportData: any = ref(null)
|
||||||
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
|
const filters = ref()
|
||||||
|
const reportMeta = ref({
|
||||||
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
|
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||||
|
ulp: { id: 0, name: 'Semua Unit Layanan Pelanggan' },
|
||||||
|
periode: '',
|
||||||
|
minTime: '',
|
||||||
|
maxTime: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
const allowTableRequest = ref(false)
|
||||||
|
const data = new CustomStore({
|
||||||
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
return await requestGraphQl(queries.keluhan.daftar.ssdaftarKeluhanResponseTime, query)
|
||||||
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarKeluhanResponseTime
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const resetData = () => {
|
||||||
|
allowTableRequest.value = false
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleRequestChange = (e: any) => {
|
||||||
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
|
const dateValue = params.periode.split(' s/d ')
|
||||||
|
const { ulp, uid, up3, maxTime, minTime } = params
|
||||||
|
|
||||||
|
return {
|
||||||
|
dateFrom: dateValue[0]
|
||||||
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
|
: new Date().toISOString().slice(0, 10),
|
||||||
|
dateTo: dateValue[1]
|
||||||
|
? dateValue[1].split('-').reverse().join('-')
|
||||||
|
: new Date().toISOString().slice(0, 10),
|
||||||
|
minDurasiResponseTime: minTime,
|
||||||
|
maxDurasiResponseTime: maxTime,
|
||||||
|
idUlp: ulp ? ulp.id : 0,
|
||||||
|
idUid: uid ? uid.id : 0,
|
||||||
|
idUp3: up3 ? up3.id : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
dialogDetail.value = false
|
dialogDetail.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
|
||||||
const clearSelection = () => {
|
const clearSelection = () => {
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
dataGrid.clearSelection()
|
dataGrid.clearSelection()
|
||||||
@ -358,159 +520,29 @@ const onSelectionChanged = ({ selectedRowsData }: any) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
const onExporting = async (e: any) => {
|
||||||
if (e.format === 'pdf') {
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
exportToPDF(reportMeta, data)
|
|
||||||
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
|
reportData.value = await data.load()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
|
dataGrid.beginCustomLoading('')
|
||||||
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
|
|
||||||
|
if (pdf) {
|
||||||
|
dataGrid.endCustomLoading()
|
||||||
|
}
|
||||||
} else if (e.format === 'xlsx') {
|
} else if (e.format === 'xlsx') {
|
||||||
exportToXLSX(reportMeta, e)
|
exportToXLSX(reportMeta, e)
|
||||||
} else {
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
exportToDOCX(reportMeta, data)
|
dataGrid.beginCustomLoading('')
|
||||||
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
|
|
||||||
|
if (doc) {
|
||||||
|
dataGrid.endCustomLoading()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = ref<any[]>([])
|
|
||||||
const loading = ref(false)
|
|
||||||
|
|
||||||
const resetData = () => {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
|
||||||
resetData()
|
|
||||||
const dateValue = params.periode.split(' s/d ')
|
|
||||||
const { ulp, uid, up3, maxTime, minTime } = params
|
|
||||||
|
|
||||||
const query = {
|
|
||||||
dateFrom: dateValue[0]
|
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
|
||||||
: new Date().toISOString().slice(0, 10),
|
|
||||||
dateTo: dateValue[1]
|
|
||||||
? dateValue[1].split('-').reverse().join('-')
|
|
||||||
: new Date().toISOString().slice(0, 10),
|
|
||||||
minDurasiResponseTime: minTime,
|
|
||||||
maxDurasiResponseTime: maxTime,
|
|
||||||
idUlp: ulp ? ulp.id : 0,
|
|
||||||
idUid: uid ? uid.id : 0,
|
|
||||||
idUp3: up3 ? up3.id : 0
|
|
||||||
}
|
|
||||||
|
|
||||||
loading.value = true
|
|
||||||
await requestGraphQl(queries.keluhan.daftar.keluhanResponseTime, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarKeluhanResponseTime
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const filters = ref()
|
|
||||||
const reportMeta = ref({
|
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
|
||||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
|
||||||
ulp: { id: 0, name: 'Semua Unit Layanan Pelanggan' },
|
|
||||||
periode: '',
|
|
||||||
minTime: '',
|
|
||||||
maxTime: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (import.meta.env.DEV) {
|
|
||||||
data.value = [
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423020100006',
|
|
||||||
waktu_lapor: '01/02/2023 00:01:23',
|
|
||||||
waktu_response: '01/02/2023 00:01:59',
|
|
||||||
waktu_recovery: '01/02/2023 00:02:52',
|
|
||||||
durasi_response_time: 36,
|
|
||||||
durasi_recovery_time: 53,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Doni',
|
|
||||||
alamat_pelapor: 'JL KH WASYID NO 119 CILEGON No.0 RT.0 RW.0 CILEGON',
|
|
||||||
no_telp_pelapor: '62895391110909',
|
|
||||||
keterangan_pelapor: 'mohon info terkait prediksi pemakaian tenaga listrik',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP PRIMA KRAKATAU (TT/TM)'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423020100030',
|
|
||||||
waktu_lapor: '01/02/2023 00:10:39',
|
|
||||||
waktu_response: '01/02/2023 01:17:31',
|
|
||||||
waktu_recovery: '01/01/1970 00:00:00',
|
|
||||||
durasi_response_time: 4012,
|
|
||||||
durasi_recovery_time: 33978014,
|
|
||||||
status_akhir: 'Dalam Proses Bidang Unit',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'wulan',
|
|
||||||
alamat_pelapor: 'DS OELETA No. RT.3 RW.2 ALAK',
|
|
||||||
no_telp_pelapor: '6285788900596',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MUTASI_K (G9923020187809:pemeriksaan ) - pulsa meter su babunyi .ketong isi gagal terus . apa bisa di konfirmasi kenapa begitu ',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP KUPANG'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423020100045',
|
|
||||||
waktu_lapor: '01/02/2023 00:16:57',
|
|
||||||
waktu_response: '01/02/2023 00:19:40',
|
|
||||||
waktu_recovery: '01/01/1970 00:00:00',
|
|
||||||
durasi_response_time: 163,
|
|
||||||
durasi_recovery_time: 33981485,
|
|
||||||
status_akhir: 'Dalam Proses Bidang Unit',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'veri susanto',
|
|
||||||
alamat_pelapor: 'JL NURUL HUDA KOMP TERAS HOKILAND No.A6 RT.2 RW.3 DS KAPUR',
|
|
||||||
no_telp_pelapor: '6282150235722',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MUTASI_K (G9923020187794:cek kwh) - tidak bisa membeli vocer listrik,vocer listrik sudah mau habis',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP SIANTAN'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423020100062',
|
|
||||||
waktu_lapor: '01/02/2023 00:29:48',
|
|
||||||
waktu_response: '01/02/2023 01:08:45',
|
|
||||||
waktu_recovery: '01/01/1970 00:00:00',
|
|
||||||
durasi_response_time: 2337,
|
|
||||||
durasi_recovery_time: 33978540,
|
|
||||||
status_akhir: 'Dalam Proses Bidang Unit',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Diki wahyudi',
|
|
||||||
alamat_pelapor: 'jl Galunggung amansari RT. 01 rw 01',
|
|
||||||
no_telp_pelapor: '6285770967966',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MUTASI_K (G9923020187796:token gagal) - token di masukan keterangan gagal',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP RENGASDENGKLOK'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5423020100089',
|
|
||||||
waktu_lapor: '01/02/2023 00:45:30',
|
|
||||||
waktu_response: '01/02/2023 01:00:27',
|
|
||||||
waktu_recovery: '01/02/2023 07:53:08',
|
|
||||||
durasi_response_time: 897,
|
|
||||||
durasi_recovery_time: 24761,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'SAHABATJAKARTA',
|
|
||||||
alamat_pelapor: 'Stasiun Jln. Nyi Raja Permas',
|
|
||||||
no_telp_pelapor: '6281210701126',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'NO AGENDA 538319912301199708\\nMOHON PERCEPATAN PASANG BARU ATAS NAMA CFC ST KA BOGOR..KARNA HARI RABU 1 FEBRUARI 2023 GERAI TERSEBUT MAU GRAND OPENING *5 MOHON DAPAT PRIORITAS INVESTASI KAMI DI KOTA BOGOR TSB TKSH',
|
|
||||||
media: 'PLN Mobile',
|
|
||||||
nama_ulp: 'ULP BOGOR KOTA'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type3 @update:filters="(value) => (filters = value)" />
|
<Type3 @update:filters="(value) => (filters = value)" />
|
||||||
</Filters>
|
</Filters>
|
||||||
|
|
||||||
<div id="data">
|
<div id="data">
|
||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
|
@option-changed="handleRequestChange"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loading == false"
|
:remote-operations="true"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
@ -22,6 +23,7 @@
|
|||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
:word-wrap-enabled="false"
|
:word-wrap-enabled="false"
|
||||||
>
|
>
|
||||||
|
<DxLoadPanel :enabled="true" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :page-size="20" :enabled="true" />
|
<DxPaging :page-size="20" :enabled="true" />
|
||||||
<DxPager
|
<DxPager
|
||||||
@ -41,11 +43,12 @@
|
|||||||
<DxColumnFixing :enabled="true" />
|
<DxColumnFixing :enabled="true" />
|
||||||
|
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column"
|
:allow-sorting="false"
|
||||||
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
@ -274,7 +277,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
<BufferDialog v-if="loading" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -282,8 +284,10 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
|||||||
import InputText from '@/components/InputText.vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type3 from '@/components/Form/FiltersType/Type3.vue'
|
import Type3 from '@/components/Form/FiltersType/Type3.vue'
|
||||||
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
|
||||||
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
import { formatWaktu } from '@/components/Form/FiltersType/reference'
|
||||||
import { onMounted, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
@ -297,24 +301,182 @@ import {
|
|||||||
} from 'devextreme-vue/data-grid'
|
} from 'devextreme-vue/data-grid'
|
||||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||||
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Keluhan/Daftar/DKeluhan_STIDP'
|
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Keluhan/Daftar/DKeluhan_STIDP'
|
||||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
|
||||||
|
|
||||||
const position = { of: '#data' }
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
const showIndicator = ref(true)
|
|
||||||
const shading = ref(true)
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
const showPane = ref(true)
|
skip: 0,
|
||||||
|
take: 20,
|
||||||
|
requireTotalCount: true,
|
||||||
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
|
|
||||||
const dataSelected = ref<any>()
|
const dataSelected = ref<any>()
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
|
const reportData: any = ref(null)
|
||||||
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
|
const filters = ref()
|
||||||
|
const reportMeta = ref({
|
||||||
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
|
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
||||||
|
ulp: { id: 0, name: 'Semua Unit Layanan Pelanggan' },
|
||||||
|
periode: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
const allowTableRequest = ref(false)
|
||||||
|
const data = new CustomStore({
|
||||||
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
return await requestGraphQl(
|
||||||
|
queries.keluhan.daftar.ssdaftarKeluhanSelesaiTanpaIdPelanggan,
|
||||||
|
query
|
||||||
|
)
|
||||||
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarKeluhanSelesaiTanpaIdPelanggan
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const resetData = () => {
|
||||||
|
allowTableRequest.value = false
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleRequestChange = (e: any) => {
|
||||||
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
|
const dateValue = params.periode.split(' s/d ')
|
||||||
|
const { ulp, uid, up3 } = params
|
||||||
|
|
||||||
|
return {
|
||||||
|
dateFrom: dateValue[0]
|
||||||
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
|
: new Date().toISOString().slice(0, 10),
|
||||||
|
dateTo: dateValue[1]
|
||||||
|
? dateValue[1].split('-').reverse().join('-')
|
||||||
|
: new Date().toISOString().slice(0, 10),
|
||||||
|
idUlp: ulp ? ulp.id : 0,
|
||||||
|
idUid: uid ? uid.id : 0,
|
||||||
|
idUp3: up3 ? up3.id : 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
dialogDetail.value = false
|
dialogDetail.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
|
||||||
const clearSelection = () => {
|
const clearSelection = () => {
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
dataGrid.clearSelection()
|
dataGrid.clearSelection()
|
||||||
}
|
}
|
||||||
|
|
||||||
const showDetail = () => {
|
const showDetail = () => {
|
||||||
clearSelection()
|
clearSelection()
|
||||||
dialogDetail.value = true
|
dialogDetail.value = true
|
||||||
@ -327,159 +489,29 @@ const onSelectionChanged = ({ selectedRowsData }: any) => {
|
|||||||
showDetail()
|
showDetail()
|
||||||
}
|
}
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
const onExporting = async (e: any) => {
|
||||||
if (e.format === 'pdf') {
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
exportToPDF(reportMeta, data)
|
|
||||||
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
|
reportData.value = await data.load()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
|
dataGrid.beginCustomLoading('')
|
||||||
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
|
|
||||||
|
if (pdf) {
|
||||||
|
dataGrid.endCustomLoading()
|
||||||
|
}
|
||||||
} else if (e.format === 'xlsx') {
|
} else if (e.format === 'xlsx') {
|
||||||
exportToXLSX(reportMeta, e)
|
exportToXLSX(reportMeta, e)
|
||||||
} else {
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
exportToDOCX(reportMeta, data)
|
dataGrid.beginCustomLoading('')
|
||||||
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
|
|
||||||
|
if (doc) {
|
||||||
|
dataGrid.endCustomLoading()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = ref<any[]>([])
|
|
||||||
const loading = ref(false)
|
|
||||||
|
|
||||||
const resetData = () => {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
|
||||||
resetData()
|
|
||||||
const dateValue = params.periode.split(' s/d ')
|
|
||||||
const { ulp, uid, up3 } = params
|
|
||||||
|
|
||||||
const query = {
|
|
||||||
dateFrom: dateValue[0]
|
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
|
||||||
: new Date().toISOString().slice(0, 10),
|
|
||||||
dateTo: dateValue[1]
|
|
||||||
? dateValue[1].split('-').reverse().join('-')
|
|
||||||
: new Date().toISOString().slice(0, 10),
|
|
||||||
idUlp: ulp ? ulp.id : 0,
|
|
||||||
idUid: uid ? uid.id : 0,
|
|
||||||
idUp3: up3 ? up3.id : 0
|
|
||||||
}
|
|
||||||
|
|
||||||
loading.value = true
|
|
||||||
await requestGraphQl(queries.keluhan.daftar.keluhanSelesaiTanpaIDPelanggan, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarKeluhanSelesaiTanpaIdPelanggan
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const filters = ref()
|
|
||||||
const reportMeta = ref({
|
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
|
||||||
up3: { id: 0, name: 'Semua Unit Pelaksanaan Pelayanan Pelanggan' },
|
|
||||||
ulp: { id: 0, name: 'Semua Unit Layanan Pelanggan' },
|
|
||||||
periode: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (import.meta.env.DEV) {
|
|
||||||
data.value = [
|
|
||||||
{
|
|
||||||
no_laporan: 'K5123020100019',
|
|
||||||
waktu_lapor: '01/02/2023 01:59:02',
|
|
||||||
waktu_response: '01/02/2023 05:22:50',
|
|
||||||
waktu_recovery: '01/02/2023 08:33:38',
|
|
||||||
durasi_response_time: 12228,
|
|
||||||
durasi_recovery_time: 11448,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP AHMAD',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL BENTENGAN TIMUR NO31 RT11/03, SUNTER JAYA, TANJUNG PRIOK, KOTA ADM. JAKARTA UTARA, DKI JAKARTA',
|
|
||||||
no_telp_pelapor: '082320000152',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'MOHON BANTUAN PEMBATALAN PERMOHONAN PB NO AGENDA 545109912301319203 DIKARENAKAN PELANGGAN INGIN KE DAYA 2200 VA, PELANGGAN SUDAH MELAKUKAN PEMBAYARAN MELALAUI GOPAY TANGGAL 31/01/2023 PUKUL 18:49 WIB, NAMUN PEMBAYARAN BELUM MASUK, MOHON KONFRIMASI KE PELANGGAN, TERIMA KASIH. ',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_ulp: 'UP3 TANJUNG PRIOK'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5123020100021',
|
|
||||||
waktu_lapor: '01/02/2023 02:04:04',
|
|
||||||
waktu_response: '01/02/2023 02:26:01',
|
|
||||||
waktu_recovery: '01/02/2023 02:34:06',
|
|
||||||
durasi_response_time: 1317,
|
|
||||||
durasi_recovery_time: 485,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'IBU TITIN ',
|
|
||||||
alamat_pelapor: 'TIDAK BISAMALKUKANPEMBELIAN KETMELEBIHI BATAS MAXIMUM / SISA 100 KWH ',
|
|
||||||
no_telp_pelapor: '087786974290',
|
|
||||||
keterangan_pelapor: 'TIDAK BISAMALKUKANPEMBELIAN KETMELEBIHI BATAS MAXIMUM / SISA 100 KWH ',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_ulp: 'ULP CIBITUNG'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5223020100112',
|
|
||||||
waktu_lapor: '01/02/2023 04:16:48',
|
|
||||||
waktu_response: '01/02/2023 05:58:33',
|
|
||||||
waktu_recovery: '01/02/2023 12:02:23',
|
|
||||||
durasi_response_time: 6105,
|
|
||||||
durasi_recovery_time: 21830,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP HENDRIYANTO',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL.PALEM HIJAU, COKROKONTENG, RT.04 RW.2. KEL SIDOARUM. KEC GODEAN KAB SLEMAN PROV DIY',
|
|
||||||
no_telp_pelapor: '085921182228',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'PELANGGAN TIDAK BISA INPUT TOKEN SETELAH UPDATE VKRN 43. (BELUM ADA) PETUGAS YANG MELAKUKAN PENGATURAN. SISA KWH: 385.41. PTL (HAMPIR PADAM). PELANGGAN PERNAH LAPOR DENGAN NO: K5223013102183, STATUS SELESAI, PELANGGAN TIDAK DIKONFIRMASI s.d 1X6 JAM. LAPOR KEMBALI CC.54.JULIANA TGL 01/02/23 12FZUS3 08.46 085921182228',
|
|
||||||
media: 'Live Chat PLN Mobile',
|
|
||||||
nama_ulp: 'ULP SEDAYU'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5223020100116',
|
|
||||||
waktu_lapor: '01/02/2023 04:43:43',
|
|
||||||
waktu_response: '01/02/2023 08:06:28',
|
|
||||||
waktu_recovery: '01/02/2023 08:52:05',
|
|
||||||
durasi_response_time: 12165,
|
|
||||||
durasi_recovery_time: 2737,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP SELAMET',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL MUARA TAKUS NO.30 - RT- / RW- KEL MADRASHULU KEC MEDAN KOLONIA KOTA MEDAN > LOKASI BELAKANG SAN PLASA',
|
|
||||||
no_telp_pelapor: '0614510290',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'LEBIH TAGIH . STAND AKHIR REK JANUARI, 2023 =19583, STAND APP 01/02/2023 = 16677,NOTE: PETUGAS CATER SELALU MENGINFORMASIKAN UNTUK LISTRIK AKAN DIGANTI KE BISNIS, PELANGGAN INGIN MENGETAHUI MAKSUD DAN TUJUAN, PETUGAS CATER DIJANJIKAN UNTUK MELAKUKAN PERGANTIAN KWH METER BARU NAMUN JUGA TIDAK DIREALISASI.',
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_ulp: 'ULP MEDAN KOTA'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5223020100119',
|
|
||||||
waktu_lapor: '01/02/2023 04:48:12',
|
|
||||||
waktu_response: '01/02/2023 07:34:08',
|
|
||||||
waktu_recovery: '01/02/2023 11:50:28',
|
|
||||||
durasi_response_time: 9956,
|
|
||||||
durasi_recovery_time: 15380,
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'Febry Cahjagraha_',
|
|
||||||
alamat_pelapor:
|
|
||||||
' JL PISANG GG.TALOK 3 SAREN NO., CATURTUNGGAL, DEPOK, KAB. SLEMAN, DAERAH ISTIMEWA YOGYAKARTA',
|
|
||||||
no_telp_pelapor: '089611011990',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'PELANGGAN MENGAJUKAN PROSES TURUN DAYA (R2T/3500 VA - R1T/1300 VA) MELALUI APLIKASI PLN MOBILE DENGAN STATUS PERMOHONAN MENUNGGU VERIFIKASI PLN UNIT DAN STATUS PADA AP2T PERMOHONAN BELUM DISAHKAN MANAGER. YBS INGIN SEGERA DAPAT DITINDAKLANJUTI.',
|
|
||||||
media: 'Facebook',
|
|
||||||
nama_ulp: 'ULP YOGYAKARTA KOTA'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<Filters @reset-form="data = []" @run-search="() => filterData(filters)" class="mb-4">
|
<Filters @reset-form="resetData" @run-search="() => filterData()" class="mb-4">
|
||||||
<Type3 @update:filters="(value) => (filters = value)" />
|
<Type3 @update:filters="(value) => (filters = value)" />
|
||||||
</Filters>
|
</Filters>
|
||||||
|
|
||||||
<div id="data">
|
<div id="data">
|
||||||
<DxDataGrid
|
<DxDataGrid
|
||||||
ref="dataGridRef"
|
ref="dataGridRef"
|
||||||
|
@option-changed="handleRequestChange"
|
||||||
:allow-column-reordering="true"
|
:allow-column-reordering="true"
|
||||||
class="max-h-[calc(100vh-140px)] mb-10"
|
class="max-h-[calc(100vh-140px)] mb-10"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
v-if="loading == false"
|
:remote-operations="true"
|
||||||
:show-column-lines="true"
|
:show-column-lines="true"
|
||||||
:show-row-lines="false"
|
:show-row-lines="false"
|
||||||
:show-borders="true"
|
:show-borders="true"
|
||||||
@ -22,6 +23,7 @@
|
|||||||
column-resizing-mode="widget"
|
column-resizing-mode="widget"
|
||||||
:word-wrap-enabled="false"
|
:word-wrap-enabled="false"
|
||||||
>
|
>
|
||||||
|
<DxLoadPanel :enabled="true" />
|
||||||
<DxSelection mode="single" />
|
<DxSelection mode="single" />
|
||||||
<DxPaging :page-size="20" :enabled="true" />
|
<DxPaging :page-size="20" :enabled="true" />
|
||||||
<DxPager
|
<DxPager
|
||||||
@ -41,13 +43,13 @@
|
|||||||
<DxColumnFixing :enabled="true" />
|
<DxColumnFixing :enabled="true" />
|
||||||
|
|
||||||
<DxColumn
|
<DxColumn
|
||||||
css-class="custom-table-column !align-top"
|
:allow-sorting="false"
|
||||||
|
css-class="custom-table-column !text-right"
|
||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
|
||||||
data-type="number"
|
data-type="number"
|
||||||
|
data-field="no"
|
||||||
caption="No"
|
caption="No"
|
||||||
cell-template="formatNumber"
|
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
:width="170"
|
:width="170"
|
||||||
@ -73,6 +75,14 @@
|
|||||||
css-class="custom-table-column !align-top"
|
css-class="custom-table-column !align-top"
|
||||||
cell-template="formatText"
|
cell-template="formatText"
|
||||||
/>
|
/>
|
||||||
|
<DxColumn
|
||||||
|
:width="170"
|
||||||
|
alignment="center"
|
||||||
|
data-field="nama_up3"
|
||||||
|
caption="UP3"
|
||||||
|
css-class="custom-table-column !align-top"
|
||||||
|
cell-template="formatText"
|
||||||
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
:width="170"
|
:width="170"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
@ -134,11 +144,19 @@
|
|||||||
<DxColumn
|
<DxColumn
|
||||||
:width="150"
|
:width="150"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
data-field="nama_pelapor"
|
data-field="pembuat_laporan"
|
||||||
caption="Created By"
|
caption="Created By"
|
||||||
css-class="custom-table-column !align-top"
|
css-class="custom-table-column !align-top"
|
||||||
cell-template="formatText"
|
cell-template="formatText"
|
||||||
/>
|
/>
|
||||||
|
<DxColumn
|
||||||
|
:width="170"
|
||||||
|
alignment="center"
|
||||||
|
data-field="waktu_lapor"
|
||||||
|
caption="Tgl Lapor"
|
||||||
|
css-class="custom-table-column !align-top"
|
||||||
|
cell-template="formatText"
|
||||||
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
:width="170"
|
:width="170"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
@ -213,7 +231,7 @@
|
|||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
<h3 class="text-sm font-medium w-[170px] text-gray-800">Contact Center:</h3>
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">Contact Center:</h3>
|
||||||
<InputText :readonly="true" :value="dataSelected?.media" class-name="flex-1" />
|
<InputText :readonly="true" :value="dataSelected?.nama_ulp" class-name="flex-1" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
@ -292,9 +310,13 @@
|
|||||||
<h3 class="text-sm font-medium w-[170px] text-gray-800">Jumlah Lapor Ulang:</h3>
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">Jumlah Lapor Ulang:</h3>
|
||||||
<InputText :readonly="true" :value="dataSelected?.jumlah_lapor" class-name="flex-1" />
|
<InputText :readonly="true" :value="dataSelected?.jumlah_lapor" class-name="flex-1" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-row items-center justify-between w-full">
|
||||||
|
<h3 class="text-sm font-medium w-[170px] text-gray-800">Sumber Lapor:</h3>
|
||||||
|
<InputText :readonly="true" :value="dataSelected?.media" class-name="flex-1" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</DetailDialog>
|
</DetailDialog>
|
||||||
<BufferDialog v-if="loading" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -302,7 +324,9 @@ import DetailDialog from '@/components/Dialogs/DetailDialog.vue'
|
|||||||
import InputText from '@/components/InputText.vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
import Filters from '@/components/Form/Filters.vue'
|
import Filters from '@/components/Form/Filters.vue'
|
||||||
import Type3 from '@/components/Form/FiltersType/Type3.vue'
|
import Type3 from '@/components/Form/FiltersType/Type3.vue'
|
||||||
import { onMounted, ref } from 'vue'
|
import CustomStore from 'devextreme/data/custom_store'
|
||||||
|
|
||||||
|
import { reactive, ref } from 'vue'
|
||||||
import { DxDataGrid } from 'devextreme-vue'
|
import { DxDataGrid } from 'devextreme-vue'
|
||||||
import {
|
import {
|
||||||
DxColumn,
|
DxColumn,
|
||||||
@ -317,48 +341,20 @@ import {
|
|||||||
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
import { queries, requestGraphQl } from '@/utils/api/api.graphql'
|
||||||
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
|
import { formatNumber, formatPercentage, isNumber } from '@/utils/numbers'
|
||||||
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Keluhan/Daftar/DKeluhan_SelesaiCC'
|
import { exportToPDF, exportToXLSX, exportToDOCX } from '@/report/Keluhan/Daftar/DKeluhan_SelesaiCC'
|
||||||
import BufferDialog from '@/components/Dialogs/BufferDialog.vue'
|
|
||||||
|
|
||||||
const position = { of: '#data' }
|
import type { IRequestOptions } from '@/types/requestParams'
|
||||||
const showIndicator = ref(true)
|
|
||||||
const shading = ref(true)
|
const requestOptions = reactive<IRequestOptions>({
|
||||||
const showPane = ref(true)
|
skip: 0,
|
||||||
|
take: 20,
|
||||||
|
requireTotalCount: true,
|
||||||
|
sort: null,
|
||||||
|
filter: null
|
||||||
|
})
|
||||||
const dataSelected = ref<any>()
|
const dataSelected = ref<any>()
|
||||||
const dialogDetail = ref(false)
|
const dialogDetail = ref(false)
|
||||||
|
const reportData: any = ref(null)
|
||||||
const closeDialog = () => {
|
|
||||||
dialogDetail.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
const dataGridRef = ref<DxDataGrid | null>(null)
|
const dataGridRef = ref<DxDataGrid | null>(null)
|
||||||
const clearSelection = () => {
|
|
||||||
const dataGrid = dataGridRef.value!.instance!
|
|
||||||
dataGrid.clearSelection()
|
|
||||||
}
|
|
||||||
const showDetail = () => {
|
|
||||||
clearSelection()
|
|
||||||
dialogDetail.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
|
||||||
if (selectedRowsData[0] != undefined) {
|
|
||||||
dataSelected.value = selectedRowsData[0]
|
|
||||||
showDetail()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const onExporting = (e: any) => {
|
|
||||||
if (e.format === 'pdf') {
|
|
||||||
exportToPDF(reportMeta, data)
|
|
||||||
} else if (e.format === 'xlsx') {
|
|
||||||
exportToXLSX(reportMeta, e)
|
|
||||||
} else {
|
|
||||||
exportToDOCX(reportMeta, data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = ref<any[]>([])
|
|
||||||
const loading = ref(false)
|
|
||||||
const filters = ref()
|
const filters = ref()
|
||||||
const reportMeta = ref({
|
const reportMeta = ref({
|
||||||
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
uid: { id: 0, name: 'Semua Unit Induk Distribusi/Wilayah' },
|
||||||
@ -367,16 +363,135 @@ const reportMeta = ref({
|
|||||||
periode: ''
|
periode: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const resetData = () => {
|
const allowTableRequest = ref(false)
|
||||||
data.value = []
|
const data = new CustomStore({
|
||||||
|
load: async (loadOptions: any) => {
|
||||||
|
if (allowTableRequest.value) {
|
||||||
|
loadOptions.requireTotalCount = true
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
skip: loadOptions.skip,
|
||||||
|
take: loadOptions.take,
|
||||||
|
sort: loadOptions.sort ? loadOptions.sort : null,
|
||||||
|
filter: loadOptions.filter ? mapSearchOptions(loadOptions.filter) : null,
|
||||||
|
requireTotalCount: loadOptions.requireTotalCount,
|
||||||
|
...createQuery(filters.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterData = async (params: any) => {
|
return await requestGraphQl(queries.keluhan.daftar.ssdaftarKeluhanDiselesaikanCC123, query)
|
||||||
resetData()
|
.then((result) => {
|
||||||
|
const response = result.data.data.ssdaftarKeluhanDiselesaikanCC123
|
||||||
|
|
||||||
|
let no = query.skip ?? 0
|
||||||
|
|
||||||
|
for (const data of response.data) {
|
||||||
|
data.no = ++no
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: response.data,
|
||||||
|
totalCount: response.totalCount
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
throw Error(err)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
reportMeta.value = filters.value
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return new Promise(function (resolve) {
|
||||||
|
resolve({
|
||||||
|
data: [],
|
||||||
|
totalCount: 0
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const resetData = () => {
|
||||||
|
allowTableRequest.value = false
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleRequestChange = (e: any) => {
|
||||||
|
if (e.name === 'searchPanel') {
|
||||||
|
if (e.value !== '') {
|
||||||
|
requestOptions.filter = createSearchOptions(e.value)
|
||||||
|
} else {
|
||||||
|
requestOptions.filter = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'paging') {
|
||||||
|
requestOptions.take = e.value
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.name === 'columns') {
|
||||||
|
const columnIndex = parseInt(e.fullName.match(/\[(\d+)\]/)[1])
|
||||||
|
const columnDataField = e.component.columnOption(columnIndex).dataField
|
||||||
|
|
||||||
|
requestOptions.sort = [
|
||||||
|
{
|
||||||
|
selector: columnDataField,
|
||||||
|
desc: e.value === 'desc'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const createSearchOptions = (keyword: string) => {
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const columns = dataGrid.getVisibleColumns()
|
||||||
|
|
||||||
|
const searchOptions = []
|
||||||
|
|
||||||
|
for (const column of columns) {
|
||||||
|
if (column.dataField === 'no' || !column.dataField) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
searchOptions.push({
|
||||||
|
field: column.dataField,
|
||||||
|
value: keyword
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return searchOptions
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapSearchOptions = (searchOptions: any) => {
|
||||||
|
const result = searchOptions.map((option: any) => {
|
||||||
|
if (Array.isArray(option) && option[0] !== 'no') {
|
||||||
|
return {
|
||||||
|
field: option[0],
|
||||||
|
value: option[2]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return result.filter((item: any) => item)
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterData = () => {
|
||||||
|
allowTableRequest.value = true
|
||||||
|
|
||||||
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
|
const dataGridDataSource = dataGrid.getDataSource()
|
||||||
|
|
||||||
|
dataGridDataSource.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const createQuery = (params: any) => {
|
||||||
const dateValue = params.periode.split(' s/d ')
|
const dateValue = params.periode.split(' s/d ')
|
||||||
const { ulp, uid, up3 } = params
|
const { ulp, uid, up3 } = params
|
||||||
|
|
||||||
const query = {
|
return {
|
||||||
dateFrom: dateValue[0]
|
dateFrom: dateValue[0]
|
||||||
? dateValue[0].split('-').reverse().join('-')
|
? dateValue[0].split('-').reverse().join('-')
|
||||||
: new Date().toISOString().slice(0, 10),
|
: new Date().toISOString().slice(0, 10),
|
||||||
@ -388,147 +503,52 @@ const filterData = async (params: any) => {
|
|||||||
idUp3: up3 ? up3.id : 0,
|
idUp3: up3 ? up3.id : 0,
|
||||||
media: ''
|
media: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.value = true
|
|
||||||
await requestGraphQl(queries.keluhan.daftar.keluhanDiselesaikanCC123, query)
|
|
||||||
.then((result) => {
|
|
||||||
if (result.data.data != undefined) {
|
|
||||||
data.value = result.data.data.daftarKeluhanDiselesaikanCC123
|
|
||||||
} else {
|
|
||||||
data.value = []
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reportMeta.value = filters.value
|
const clearSelection = () => {
|
||||||
})
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
.catch((err) => {
|
dataGrid.clearSelection()
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
const onSelectionChanged = ({ selectedRowsData }: any) => {
|
||||||
if (import.meta.env.DEV) {
|
if (selectedRowsData[0] != undefined) {
|
||||||
data.value = [
|
dataSelected.value = selectedRowsData[0]
|
||||||
{
|
showDetail()
|
||||||
no_laporan: 'K5123020100019',
|
}
|
||||||
id_uid: 2,
|
}
|
||||||
nama_uid: 'DISTRIBUSI JAKARTA RAYA',
|
|
||||||
id_up3: 13,
|
const closeDialog = () => {
|
||||||
nama_up3: 'UP3 TANJUNG PRIOK',
|
dialogDetail.value = false
|
||||||
id_ulp: 54510,
|
}
|
||||||
nama_ulp: 'UP3 TANJUNG PRIOK',
|
|
||||||
idpel_nometer: '',
|
const showDetail = () => {
|
||||||
nama_pelapor: 'BP AHMAD',
|
clearSelection()
|
||||||
alamat_pelapor:
|
dialogDetail.value = true
|
||||||
'JL BENTENGAN TIMUR NO31 RT11/03, SUNTER JAYA, TANJUNG PRIOK, KOTA ADM. JAKARTA UTARA, DKI JAKARTA',
|
}
|
||||||
no_telp_pelapor: '082320000152',
|
|
||||||
keterangan_pelapor:
|
const onExporting = async (e: any) => {
|
||||||
'MOHON BANTUAN PEMBATALAN PERMOHONAN PB NO AGENDA 545109912301319203 DIKARENAKAN PELANGGAN INGIN KE DAYA 2200 VA, PELANGGAN SUDAH MELAKUKAN PEMBAYARAN MELALAUI GOPAY TANGGAL 31/01/2023 PUKUL 18:49 WIB, NAMUN PEMBAYARAN BELUM MASUK, MOHON KONFRIMASI KE PELANGGAN, TERIMA KASIH. ',
|
const dataGrid = dataGridRef.value!.instance!
|
||||||
status_akhir: 'Selesai',
|
|
||||||
pembuat_laporan: 'CC.51.NUGROHO',
|
if (e.format === 'pdf' || e.format === 'document') {
|
||||||
waktu_lapor: '01/02/2023 01:59:02',
|
reportData.value = await data.load()
|
||||||
waktu_recovery: '01/02/2023 08:33:38',
|
}
|
||||||
jumlah_lapor: 1,
|
|
||||||
media: 'Call PLN 123',
|
if (e.format === 'pdf' && reportData.value) {
|
||||||
nama_issuetype: 'Informasi',
|
dataGrid.beginCustomLoading('')
|
||||||
nama_subissuetype: 'PB '
|
const pdf = await exportToPDF(reportMeta, reportData)
|
||||||
},
|
|
||||||
{
|
if (pdf) {
|
||||||
no_laporan: 'K5123020100021',
|
dataGrid.endCustomLoading()
|
||||||
id_uid: 427,
|
}
|
||||||
nama_uid: 'DISTRIBUSI JAWA BARAT',
|
} else if (e.format === 'xlsx') {
|
||||||
id_up3: 547,
|
exportToXLSX(reportMeta, e)
|
||||||
nama_up3: 'UP3 CIKARANG',
|
} else if (e.format === 'document' && reportData.value) {
|
||||||
id_ulp: 53702,
|
dataGrid.beginCustomLoading('')
|
||||||
nama_ulp: 'ULP CIBITUNG',
|
const doc = await exportToDOCX(reportMeta, reportData)
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'IBU TITIN ',
|
if (doc) {
|
||||||
alamat_pelapor: 'TIDAK BISAMALKUKANPEMBELIAN KETMELEBIHI BATAS MAXIMUM / SISA 100 KWH ',
|
dataGrid.endCustomLoading()
|
||||||
no_telp_pelapor: '087786974290',
|
}
|
||||||
keterangan_pelapor: 'TIDAK BISAMALKUKANPEMBELIAN KETMELEBIHI BATAS MAXIMUM / SISA 100 KWH ',
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
pembuat_laporan: 'CC.51.BARIQI',
|
|
||||||
waktu_lapor: '01/02/2023 02:04:04',
|
|
||||||
waktu_recovery: '01/02/2023 02:34:06',
|
|
||||||
jumlah_lapor: 1,
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_issuetype: 'Tagihan Listrik dan Token ',
|
|
||||||
nama_subissuetype: 'Tidak bisa beli Token '
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K1423020100022',
|
|
||||||
id_uid: 427,
|
|
||||||
nama_uid: 'DISTRIBUSI JAWA BARAT',
|
|
||||||
id_up3: 532,
|
|
||||||
nama_up3: 'UP3 BEKASI',
|
|
||||||
id_ulp: 53741,
|
|
||||||
nama_ulp: 'ULP BANTARGEBANG',
|
|
||||||
idpel_nometer: '000000000000000001820788',
|
|
||||||
nama_pelapor: 'IBU IRFI ',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL NIAGA 7 PERUM KEMANG BLOK F NO 23 KEC RAWA LUMBU KEL SEPANJANG JAYA KOTA BEKASI ACUAN LOKASI DEKAT RUMAH YATIM ',
|
|
||||||
no_telp_pelapor: '62816922683',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'TIDAK BISA INPUT TOKEN SETELAH UPDATE VKRN 43 (PTL TIDAK PADAM) \\nDENGAN NO METER 56700750112 DAN SISA KWH 15.1',
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
pembuat_laporan: 'CC.14.ANDI',
|
|
||||||
waktu_lapor: '01/02/2023 03:13:25',
|
|
||||||
waktu_recovery: '01/02/2023 07:03:37',
|
|
||||||
jumlah_lapor: 1,
|
|
||||||
media: 'Call PLN 123',
|
|
||||||
nama_issuetype: 'Tagihan Listrik dan Token ',
|
|
||||||
nama_subissuetype: 'Gagal Input Token'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5223020100106',
|
|
||||||
id_uid: 427,
|
|
||||||
nama_uid: 'DISTRIBUSI JAWA BARAT',
|
|
||||||
id_up3: 537,
|
|
||||||
nama_up3: 'UP3 CIREBON',
|
|
||||||
id_ulp: 53331,
|
|
||||||
nama_ulp: 'ULP SUMBER',
|
|
||||||
idpel_nometer: '000000000000000000943441',
|
|
||||||
nama_pelapor: 'IBU MELLY KURNIASIH',
|
|
||||||
alamat_pelapor: 'PERUMAHAN CEMPAKA ARUM JL. FLAMBOYAN 5 NO 191 CIREBON',
|
|
||||||
no_telp_pelapor: '08889353988',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'LEBIH TAGIH. ST AK REK FEB 2023 (28/01/2023) = 4608, ST APP TGL 26/01/2023 = 4496. REK BELUM DILUNASI. (RUMAH TIDAK DIHUNI NAMUN PAGAR TIDAK TERKUNCI, PETUGAS TIDAK DIKETAHUI DATANG KE LOKASI). PELANGGAN MENGINGINKAN AGAR HAL TERSEBUT TIDAK TERULANG KEMBALI.',
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
pembuat_laporan: 'CC.52.YORDAN.LC',
|
|
||||||
waktu_lapor: '01/02/2023 03:45:58',
|
|
||||||
waktu_recovery: '01/02/2023 06:28:11',
|
|
||||||
jumlah_lapor: 1,
|
|
||||||
media: 'Live Chat PLN Mobile',
|
|
||||||
nama_issuetype: 'Cater',
|
|
||||||
nama_subissuetype: 'Keakuratan hasil catat meter '
|
|
||||||
},
|
|
||||||
{
|
|
||||||
no_laporan: 'K5223020100112',
|
|
||||||
id_uid: 101,
|
|
||||||
nama_uid: 'DISTRIBUSI JAWA TENGAH & DIY',
|
|
||||||
id_up3: 52100,
|
|
||||||
nama_up3: 'UP3 YOGYAKARTA',
|
|
||||||
id_ulp: 52104,
|
|
||||||
nama_ulp: 'ULP SEDAYU',
|
|
||||||
idpel_nometer: '',
|
|
||||||
nama_pelapor: 'BP HENDRIYANTO',
|
|
||||||
alamat_pelapor:
|
|
||||||
'JL.PALEM HIJAU, COKROKONTENG, RT.04 RW.2. KEL SIDOARUM. KEC GODEAN KAB SLEMAN PROV DIY',
|
|
||||||
no_telp_pelapor: '085921182228',
|
|
||||||
keterangan_pelapor:
|
|
||||||
'PELANGGAN TIDAK BISA INPUT TOKEN SETELAH UPDATE VKRN 43. (BELUM ADA) PETUGAS YANG MELAKUKAN PENGATURAN. SISA KWH: 385.41. PTL (HAMPIR PADAM). PELANGGAN PERNAH LAPOR DENGAN NO: K5223013102183, STATUS SELESAI, PELANGGAN TIDAK DIKONFIRMASI s.d 1X6 JAM. LAPOR KEMBALI CC.54.JULIANA TGL 01/02/23 12FZUS3 08.46 085921182228',
|
|
||||||
status_akhir: 'Selesai',
|
|
||||||
pembuat_laporan: 'CC.52.YORDAN.LC',
|
|
||||||
waktu_lapor: '01/02/2023 04:16:48',
|
|
||||||
waktu_recovery: '01/02/2023 12:02:23',
|
|
||||||
jumlah_lapor: 1,
|
|
||||||
media: 'Live Chat PLN Mobile',
|
|
||||||
nama_issuetype: 'Tagihan Listrik dan Token ',
|
|
||||||
nama_subissuetype: 'Gagal Input Token'
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -69,6 +69,15 @@
|
|||||||
css-class="custom-table-column"
|
css-class="custom-table-column"
|
||||||
cell-template="formatNumber"
|
cell-template="formatNumber"
|
||||||
/>
|
/>
|
||||||
|
<DxColumn
|
||||||
|
:width="100"
|
||||||
|
alignment="center"
|
||||||
|
data-field="total"
|
||||||
|
data-type="number"
|
||||||
|
caption="Total"
|
||||||
|
css-class="custom-table-column"
|
||||||
|
cell-template="formatNumber"
|
||||||
|
/>
|
||||||
</DxColumn>
|
</DxColumn>
|
||||||
|
|
||||||
<DxSummary>
|
<DxSummary>
|
||||||
|
@ -46,9 +46,9 @@
|
|||||||
:width="50"
|
:width="50"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
data-type="number"
|
data-type="number"
|
||||||
data-field="number"
|
|
||||||
caption="No"
|
caption="No"
|
||||||
cell-template="formatNumber"
|
cell-template="formatNumber"
|
||||||
|
:calculate-display-value="(item: any) => data.findIndex((i) => i == item) + 1"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
:width="170"
|
:width="170"
|
||||||
@ -1175,14 +1175,7 @@ const filterData = async (params: any) => {
|
|||||||
await requestGraphQl(queries.keluhan.rekap.keluhanPerJenisKeluhan, query)
|
await requestGraphQl(queries.keluhan.rekap.keluhanPerJenisKeluhan, query)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result.data.data != undefined) {
|
if (result.data.data != undefined) {
|
||||||
data.value = [...result.data.data.rekapitulasiKeluhanPerJenisKeluhan]
|
data.value = result.data.data.rekapitulasiKeluhanPerJenisKeluhan
|
||||||
.sort((a: any, b: any) => a.tipe_keluhan.localeCompare(b.tipe_keluhan))
|
|
||||||
.map((item: any, index: number) => {
|
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
number: index + 1
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
data.value = []
|
data.value = []
|
||||||
}
|
}
|
||||||
@ -1393,13 +1386,6 @@ onMounted(() => {
|
|||||||
total_diatas_sla_recovery: 2
|
total_diatas_sla_recovery: 2
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
.sort((a: any, b: any) => a.tipe_keluhan.localeCompare(b.tipe_keluhan))
|
|
||||||
.map((item: any, index: number) => {
|
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
number: index + 1
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex flex-row items-center w-full mb-6 space-x-4">
|
<div class="flex flex-row items-center w-full mb-6 space-x-4">
|
||||||
<button
|
<button
|
||||||
@click="tab = 'gangguan'"
|
@click="changeTab('gangguan')"
|
||||||
type="button"
|
type="button"
|
||||||
class="px-1 py-4 text-sm"
|
class="px-1 py-4 text-sm"
|
||||||
:class="[
|
:class="[
|
||||||
@ -13,7 +13,7 @@
|
|||||||
Gangguan: Transaksi Aktif > SLA
|
Gangguan: Transaksi Aktif > SLA
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@click="tab = 'keluhan'"
|
@click="changeTab('keluhan')"
|
||||||
type="button"
|
type="button"
|
||||||
class="px-1 py-4 text-sm"
|
class="px-1 py-4 text-sm"
|
||||||
:class="[
|
:class="[
|
||||||
@ -179,7 +179,6 @@
|
|||||||
cell-template="formatText"
|
cell-template="formatText"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
v-if="tab == 'keluhan'"
|
|
||||||
:width="170"
|
:width="170"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
data-field="status_akhir"
|
data-field="status_akhir"
|
||||||
@ -188,7 +187,6 @@
|
|||||||
cell-template="formatText"
|
cell-template="formatText"
|
||||||
/>
|
/>
|
||||||
<DxColumn
|
<DxColumn
|
||||||
v-if="tab == 'keluhan'"
|
|
||||||
:width="170"
|
:width="170"
|
||||||
alignment="center"
|
alignment="center"
|
||||||
data-field="durasi_time"
|
data-field="durasi_time"
|
||||||
@ -196,6 +194,14 @@
|
|||||||
css-class="custom-table-column"
|
css-class="custom-table-column"
|
||||||
cell-template="formatTime"
|
cell-template="formatTime"
|
||||||
/>
|
/>
|
||||||
|
<DxColumn
|
||||||
|
:width="170"
|
||||||
|
alignment="center"
|
||||||
|
data-field="email_pelapor"
|
||||||
|
caption="Email"
|
||||||
|
css-class="custom-table-column"
|
||||||
|
cell-template="formatText"
|
||||||
|
/>
|
||||||
|
|
||||||
<template #formatText="{ data }">
|
<template #formatText="{ data }">
|
||||||
<p class="text-left">
|
<p class="text-left">
|
||||||
@ -274,6 +280,11 @@ const reportMeta = ref({
|
|||||||
periode: ''
|
periode: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const changeTab = (newTab: string) => {
|
||||||
|
tab.value = newTab
|
||||||
|
data.value = []
|
||||||
|
}
|
||||||
|
|
||||||
const formatMetaData = (reportMeta: any) => {
|
const formatMetaData = (reportMeta: any) => {
|
||||||
const periode = reportMeta.periode ? reportMeta.periode.split(' s/d ') : ''
|
const periode = reportMeta.periode ? reportMeta.periode.split(' s/d ') : ''
|
||||||
|
|
||||||
@ -305,31 +316,12 @@ const onExporting = (e: any) => {
|
|||||||
const worksheet = workbook.addWorksheet('Transaksi APKT')
|
const worksheet = workbook.addWorksheet('Transaksi APKT')
|
||||||
|
|
||||||
setHeaderStyle(worksheet, 1, 1, 'PT. PLN(Persero)')
|
setHeaderStyle(worksheet, 1, 1, 'PT. PLN(Persero)')
|
||||||
setHeaderStyle(
|
|
||||||
worksheet,
|
setHeaderStyle(worksheet, 3, 1, 'Transaksi APKT'.toUpperCase(), true)
|
||||||
2,
|
|
||||||
1,
|
|
||||||
`UNIT PLN : ${reportMeta.value.uid.id ? reportMeta.value.uid.name.toUpperCase() + ',' : ''} ${reportMeta.value.up3.id ? reportMeta.value.up3.name.toUpperCase() + ',' : ''} ${reportMeta.value.ulp.id ? reportMeta.value.ulp.name.toUpperCase() + ',' : ''}`
|
|
||||||
)
|
|
||||||
setHeaderStyle(
|
|
||||||
worksheet,
|
|
||||||
3,
|
|
||||||
1,
|
|
||||||
`STATUS : ${reportMeta.value.status ? reportMeta.value.status.name.toUpperCase() : ''}`
|
|
||||||
)
|
|
||||||
setHeaderStyle(
|
setHeaderStyle(
|
||||||
worksheet,
|
worksheet,
|
||||||
4,
|
4,
|
||||||
1,
|
1,
|
||||||
`SLA : ${reportMeta.value.sla ? reportMeta.value.sla.name.toUpperCase() : ''}`
|
|
||||||
)
|
|
||||||
setHeaderStyle(worksheet, 5, 1, `PENCARIAN : ${reportMeta.value.keyword.toUpperCase()}`)
|
|
||||||
|
|
||||||
setHeaderStyle(worksheet, 7, 1, 'Transaksi APKT'.toUpperCase(), true)
|
|
||||||
setHeaderStyle(
|
|
||||||
worksheet,
|
|
||||||
8,
|
|
||||||
1,
|
|
||||||
`PERIODE TANGGAL : ${meta.dateFromFormat} SD TGL ${meta.dateToFormat}`,
|
`PERIODE TANGGAL : ${meta.dateFromFormat} SD TGL ${meta.dateToFormat}`,
|
||||||
true
|
true
|
||||||
)
|
)
|
||||||
@ -338,15 +330,12 @@ const onExporting = (e: any) => {
|
|||||||
worksheet.mergeCells('A2:M2')
|
worksheet.mergeCells('A2:M2')
|
||||||
worksheet.mergeCells('A3:M3')
|
worksheet.mergeCells('A3:M3')
|
||||||
worksheet.mergeCells('A4:M4')
|
worksheet.mergeCells('A4:M4')
|
||||||
worksheet.mergeCells('A5:M5')
|
|
||||||
worksheet.mergeCells('A7:M7')
|
|
||||||
worksheet.mergeCells('A8:M8')
|
|
||||||
|
|
||||||
exportToExcel({
|
exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
topLeftCell: { row: 10, column: 1 },
|
topLeftCell: { row: 6, column: 1 },
|
||||||
loadPanel: {
|
loadPanel: {
|
||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
|
@ -46,12 +46,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
return { dateFromFormat, dateToFormat, dayTo }
|
return { dateFromFormat, dateToFormat, dayTo }
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -134,7 +135,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Keterangan Media'
|
'Keterangan Media'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.nama_pelapor,
|
item.nama_pelapor,
|
||||||
@ -201,12 +202,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
const worksheet = workbook.addWorksheet(`${reportName}`)
|
const worksheet = workbook.addWorksheet(`${reportName}`)
|
||||||
@ -269,14 +277,11 @@ const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
|||||||
worksheet.mergeCells('H7:J7')
|
worksheet.mergeCells('H7:J7')
|
||||||
worksheet.mergeCells('H8:J8')
|
worksheet.mergeCells('H8:J8')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
topLeftCell: { row: 10, column: 1 },
|
topLeftCell: { row: 10, column: 1 }
|
||||||
loadPanel: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
||||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
||||||
@ -286,15 +291,16 @@ const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const resultData = data.value.data
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -542,10 +548,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -48,12 +48,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
return { dateFromFormat, dateToFormat, dayTo }
|
return { dateFromFormat, dateToFormat, dayTo }
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -133,7 +134,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Posko'
|
'Posko'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.pembuat_laporan,
|
item.pembuat_laporan,
|
||||||
@ -204,12 +205,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
const worksheet = workbook.addWorksheet(`${reportName}`)
|
const worksheet = workbook.addWorksheet(`${reportName}`)
|
||||||
@ -262,14 +270,11 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
worksheet.mergeCells('A6:S6')
|
worksheet.mergeCells('A6:S6')
|
||||||
worksheet.mergeCells('A7:S7')
|
worksheet.mergeCells('A7:S7')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
topLeftCell: { row: 10, column: 1 },
|
topLeftCell: { row: 10, column: 1 }
|
||||||
loadPanel: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
||||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
||||||
@ -279,15 +284,16 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const resultData = data.value.data
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -530,11 +536,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
console.log(blob)
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -46,12 +46,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
return { dateFromFormat, dateToFormat, dayTo }
|
return { dateFromFormat, dateToFormat, dayTo }
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -127,7 +128,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Posko'
|
'Posko'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.waktu_lapor,
|
item.waktu_lapor,
|
||||||
@ -194,12 +195,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
const worksheet = workbook.addWorksheet(`${reportName}`)
|
const worksheet = workbook.addWorksheet(`${reportName}`)
|
||||||
@ -252,14 +260,11 @@ const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
|||||||
worksheet.mergeCells('H7:J7')
|
worksheet.mergeCells('H7:J7')
|
||||||
worksheet.mergeCells('H8:J8')
|
worksheet.mergeCells('H8:J8')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
topLeftCell: { row: 10, column: 1 },
|
topLeftCell: { row: 10, column: 1 }
|
||||||
loadPanel: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
||||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
||||||
@ -269,15 +274,16 @@ const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const resultData = data.value.data
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -512,10 +518,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -46,12 +46,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
return { dateFromFormat, dateToFormat, dayTo }
|
return { dateFromFormat, dateToFormat, dayTo }
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -129,7 +130,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Posko'
|
'Posko'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.waktu_lapor,
|
item.waktu_lapor,
|
||||||
@ -197,12 +198,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
const worksheet = workbook.addWorksheet(`${reportName}`)
|
const worksheet = workbook.addWorksheet(`${reportName}`)
|
||||||
@ -261,14 +269,11 @@ const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
|||||||
worksheet.mergeCells('H7:J7')
|
worksheet.mergeCells('H7:J7')
|
||||||
worksheet.mergeCells('H8:J8')
|
worksheet.mergeCells('H8:J8')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
topLeftCell: { row: 11, column: 1 },
|
topLeftCell: { row: 11, column: 1 }
|
||||||
loadPanel: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
||||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
||||||
@ -278,15 +283,16 @@ const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const resultData = data.value.data
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -532,10 +538,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -64,12 +64,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -150,7 +151,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Posko'
|
'Posko'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.waktu_lapor,
|
item.waktu_lapor,
|
||||||
@ -217,12 +218,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
@ -282,14 +290,11 @@ const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
|||||||
worksheet.mergeCells('H7:J7')
|
worksheet.mergeCells('H7:J7')
|
||||||
worksheet.mergeCells('H8:J8')
|
worksheet.mergeCells('H8:J8')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
topLeftCell: { row: 11, column: 1 },
|
topLeftCell: { row: 10, column: 1 }
|
||||||
loadPanel: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
||||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
||||||
@ -299,15 +304,16 @@ const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const resultData = data.value.data
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -553,10 +559,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -64,12 +64,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -150,7 +151,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Posko'
|
'Posko'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.waktu_lapor,
|
item.waktu_lapor,
|
||||||
@ -217,12 +218,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
@ -282,14 +290,11 @@ const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
|||||||
worksheet.mergeCells('H7:J7')
|
worksheet.mergeCells('H7:J7')
|
||||||
worksheet.mergeCells('H8:J8')
|
worksheet.mergeCells('H8:J8')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
topLeftCell: { row: 11, column: 1 },
|
topLeftCell: { row: 11, column: 1 }
|
||||||
loadPanel: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
||||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
||||||
@ -299,15 +304,16 @@ const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const resultData = data.value.data
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -553,10 +559,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -46,12 +46,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
return { dateFromFormat, dateToFormat, dayTo }
|
return { dateFromFormat, dateToFormat, dayTo }
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -127,7 +128,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Posko'
|
'Posko'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.waktu_lapor,
|
item.waktu_lapor,
|
||||||
@ -194,12 +195,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
const worksheet = workbook.addWorksheet(`${reportName}`)
|
const worksheet = workbook.addWorksheet(`${reportName}`)
|
||||||
@ -252,14 +260,11 @@ const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
|||||||
worksheet.mergeCells('H7:J7')
|
worksheet.mergeCells('H7:J7')
|
||||||
worksheet.mergeCells('H8:J8')
|
worksheet.mergeCells('H8:J8')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
topLeftCell: { row: 10, column: 1 },
|
topLeftCell: { row: 10, column: 1 }
|
||||||
loadPanel: {
|
|
||||||
enabled: false
|
|
||||||
}
|
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
||||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
||||||
@ -269,15 +274,16 @@ const exportToXLSX = (reportMeta: any, data: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const resultData = data.value.data
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -512,10 +518,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -48,12 +48,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
return { dateFromFormat, dateToFormat, dayTo }
|
return { dateFromFormat, dateToFormat, dayTo }
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -129,7 +130,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Keterangan Media'
|
'Keterangan Media'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.nama_pelapor,
|
item.nama_pelapor,
|
||||||
@ -196,12 +197,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
const worksheet = workbook.addWorksheet(`${reportName}`)
|
const worksheet = workbook.addWorksheet(`${reportName}`)
|
||||||
@ -254,11 +262,11 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
worksheet.mergeCells('A6:O6')
|
worksheet.mergeCells('A6:O6')
|
||||||
worksheet.mergeCells('A7:O7')
|
worksheet.mergeCells('A7:O7')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
topLeftCell: { row: 9, column: 1 }
|
topLeftCell: { row: 10, column: 1 }
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
||||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
||||||
@ -268,15 +276,16 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -511,10 +520,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -48,12 +48,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
return { dateFromFormat, dateToFormat, dayTo }
|
return { dateFromFormat, dateToFormat, dayTo }
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -133,7 +134,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Nama ULP'
|
'Nama ULP'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.pembuat_laporan,
|
item.pembuat_laporan,
|
||||||
@ -204,12 +205,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
const worksheet = workbook.addWorksheet(`${reportName}`)
|
const worksheet = workbook.addWorksheet(`${reportName}`)
|
||||||
@ -262,11 +270,11 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
worksheet.mergeCells('A6:S6')
|
worksheet.mergeCells('A6:S6')
|
||||||
worksheet.mergeCells('A7:S7')
|
worksheet.mergeCells('A7:S7')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
topLeftCell: { row: 9, column: 1 }
|
topLeftCell: { row: 10, column: 1 }
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
||||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
||||||
@ -276,15 +284,16 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const resultData = data.value.data
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -527,10 +536,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -48,12 +48,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
return { dateFromFormat, dateToFormat, dayTo }
|
return { dateFromFormat, dateToFormat, dayTo }
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -131,7 +132,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Nama ULP'
|
'Nama ULP'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.waktu_lapor,
|
item.waktu_lapor,
|
||||||
@ -199,12 +200,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
const worksheet = workbook.addWorksheet(`${reportName}`)
|
const worksheet = workbook.addWorksheet(`${reportName}`)
|
||||||
@ -264,7 +272,7 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
worksheet.mergeCells('A7:P7')
|
worksheet.mergeCells('A7:P7')
|
||||||
worksheet.mergeCells('A8:P8')
|
worksheet.mergeCells('A8:P8')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
@ -278,15 +286,16 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const resultData = data.value.data
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -532,10 +541,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -59,12 +59,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
return { dateFromFormat, dateToFormat, dayTo, durasi, minTime, maxTime }
|
return { dateFromFormat, dateToFormat, dayTo, durasi, minTime, maxTime }
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -144,7 +145,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Nama ULP'
|
'Nama ULP'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.waktu_lapor,
|
item.waktu_lapor,
|
||||||
@ -210,12 +211,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
const worksheet = workbook.addWorksheet(`${reportName}`)
|
const worksheet = workbook.addWorksheet(`${reportName}`)
|
||||||
@ -275,7 +283,7 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
worksheet.mergeCells('A7:N7')
|
worksheet.mergeCells('A7:N7')
|
||||||
worksheet.mergeCells('A8:N8')
|
worksheet.mergeCells('A8:N8')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
@ -289,15 +297,16 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const resultData = data.value.data
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -539,10 +548,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -59,12 +59,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
return { dateFromFormat, dateToFormat, dayTo, durasi, minTime, maxTime }
|
return { dateFromFormat, dateToFormat, dayTo, durasi, minTime, maxTime }
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -144,7 +145,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Nama ULP'
|
'Nama ULP'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.waktu_lapor,
|
item.waktu_lapor,
|
||||||
@ -210,12 +211,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
const worksheet = workbook.addWorksheet(`${reportName}`)
|
const worksheet = workbook.addWorksheet(`${reportName}`)
|
||||||
@ -275,7 +283,7 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
worksheet.mergeCells('A7:N7')
|
worksheet.mergeCells('A7:N7')
|
||||||
worksheet.mergeCells('A8:N8')
|
worksheet.mergeCells('A8:N8')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
@ -289,15 +297,16 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const resultData = data.value.data
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -539,10 +548,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -48,12 +48,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
return { dateFromFormat, dateToFormat, dayTo }
|
return { dateFromFormat, dateToFormat, dayTo }
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -129,7 +130,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Nama ULP'
|
'Nama ULP'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.waktu_lapor,
|
item.waktu_lapor,
|
||||||
@ -196,12 +197,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
const worksheet = workbook.addWorksheet(`${reportName}`)
|
const worksheet = workbook.addWorksheet(`${reportName}`)
|
||||||
@ -254,11 +262,11 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
worksheet.mergeCells('A6:O6')
|
worksheet.mergeCells('A6:O6')
|
||||||
worksheet.mergeCells('A7:O7')
|
worksheet.mergeCells('A7:O7')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
topLeftCell: { row: 9, column: 1 }
|
topLeftCell: { row: 10, column: 1 }
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
||||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
||||||
@ -268,15 +276,16 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const resultData = data.value.data
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -511,10 +520,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -48,12 +48,13 @@ const formatMetaData = (reportMeta: any) => {
|
|||||||
return { dateFromFormat, dateToFormat, dayTo }
|
return { dateFromFormat, dateToFormat, dayTo }
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToPDF = (reportMeta: any, data: any) => {
|
const exportToPDF = async (reportMeta: any, data: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
|
const resultData = data.value.data
|
||||||
const doc = new jsPDF({
|
const doc = new jsPDF({
|
||||||
orientation: 'landscape'
|
orientation: 'landscape'
|
||||||
})
|
})
|
||||||
@ -131,7 +132,7 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
'Sub Issue Type'
|
'Sub Issue Type'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
body: data.value.map((item: any, i: any) => [
|
body: resultData.map((item: any, i: any) => [
|
||||||
{ content: ++i, styles: { halign: 'right' } },
|
{ content: ++i, styles: { halign: 'right' } },
|
||||||
item.no_laporan,
|
item.no_laporan,
|
||||||
item.nama_ulp,
|
item.nama_ulp,
|
||||||
@ -200,12 +201,19 @@ const exportToPDF = (reportMeta: any, data: any) => {
|
|||||||
margin: { left: 230 }
|
margin: { left: 230 }
|
||||||
})
|
})
|
||||||
|
|
||||||
doc.save(`Laporan ${reportName}.pdf`, { returnPromise: true }).then(() => {
|
await doc
|
||||||
console.log('pdf berhasil disimpan')
|
.save(`Laporan ${reportName}.pdf`, { returnPromise: true })
|
||||||
|
.then(() => {
|
||||||
|
console.log('PDF Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting PDF', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToXLSX = (reportMeta: any, e: any) => {
|
const exportToXLSX = async (reportMeta: any, e: any) => {
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
const workbook = new Workbook()
|
const workbook = new Workbook()
|
||||||
const worksheet = workbook.addWorksheet(`${reportName}`)
|
const worksheet = workbook.addWorksheet(`${reportName}`)
|
||||||
@ -258,11 +266,11 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
worksheet.mergeCells('A6:Q6')
|
worksheet.mergeCells('A6:Q6')
|
||||||
worksheet.mergeCells('A7:Q7')
|
worksheet.mergeCells('A7:Q7')
|
||||||
|
|
||||||
exportToExcel({
|
await exportToExcel({
|
||||||
component: e.component,
|
component: e.component,
|
||||||
worksheet,
|
worksheet,
|
||||||
autoFilterEnabled: true,
|
autoFilterEnabled: true,
|
||||||
topLeftCell: { row: 9, column: 1 }
|
topLeftCell: { row: 10, column: 1 }
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
workbook.xlsx.writeBuffer().then((buffer: any) => {
|
||||||
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), `Laporan ${reportName}.xlsx`)
|
||||||
@ -272,15 +280,16 @@ const exportToXLSX = (reportMeta: any, e: any) => {
|
|||||||
e.cancel = true
|
e.cancel = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const exportToDOCX = (reportMeta: any, data: any) => {
|
const exportToDOCX = async (reportMeta: any, data: any) => {
|
||||||
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
const day = new Date().toLocaleString('id-ID', { weekday: 'long' })
|
||||||
const date = new Date().getDate()
|
const date = new Date().getDate()
|
||||||
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
const month = new Date().toLocaleString('id-ID', { month: 'long' })
|
||||||
const year = new Date().getFullYear()
|
const year = new Date().getFullYear()
|
||||||
const meta = formatMetaData(reportMeta)
|
const meta = formatMetaData(reportMeta)
|
||||||
|
const resultData = data.value.data
|
||||||
|
|
||||||
const generateRows = () => {
|
const generateRows = () => {
|
||||||
return data.value.map((item: any, i: any) => {
|
return resultData.map((item: any, i: any) => {
|
||||||
return new TableRow({
|
return new TableRow({
|
||||||
children: [
|
children: [
|
||||||
{ text: `${++i}`, field: 'no' },
|
{ text: `${++i}`, field: 'no' },
|
||||||
@ -509,10 +518,17 @@ const exportToDOCX = (reportMeta: any, data: any) => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
Packer.toBlob(doc).then((blob) => {
|
await Packer.toBlob(doc)
|
||||||
|
.then((blob) => {
|
||||||
saveAs(blob, `Laporan ${reportName}.docx`)
|
saveAs(blob, `Laporan ${reportName}.docx`)
|
||||||
console.log('Document created successfully')
|
|
||||||
|
console.log('DOCX Exported')
|
||||||
})
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error while exporting DOCX', error)
|
||||||
|
})
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export { exportToPDF, exportToXLSX, exportToDOCX }
|
export { exportToPDF, exportToXLSX, exportToDOCX }
|
||||||
|
@ -64,6 +64,7 @@ export const useAuthStore = defineStore('auth', () => {
|
|||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log(filterPresets.value)
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
} else {
|
} else {
|
||||||
dispatchNotification({
|
dispatchNotification({
|
||||||
|
9
src/types/requestParams.ts
Normal file
9
src/types/requestParams.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
interface IRequestOptions {
|
||||||
|
skip: number
|
||||||
|
take: number
|
||||||
|
requireTotalCount: boolean
|
||||||
|
sort: null | Array<object>
|
||||||
|
filter: null | Array<object>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type { IRequestOptions }
|
@ -51,6 +51,51 @@ export const apolloClient = () => {
|
|||||||
export const queries = {
|
export const queries = {
|
||||||
keluhan: {
|
keluhan: {
|
||||||
daftar: {
|
daftar: {
|
||||||
|
ssdaftarKeluhanSelesaiTanpaIdPelanggan: gql`
|
||||||
|
query ssdaftarKeluhanSelesaiTanpaIdPelanggan(
|
||||||
|
$dateFrom: Date!
|
||||||
|
$dateTo: Date!
|
||||||
|
$idUlp: Int!
|
||||||
|
$idUid: Int!
|
||||||
|
$idUp3: Int!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
|
) {
|
||||||
|
ssdaftarKeluhanSelesaiTanpaIdPelanggan(
|
||||||
|
dateFrom: $dateFrom
|
||||||
|
dateTo: $dateTo
|
||||||
|
idUlp: $idUlp
|
||||||
|
idUid: $idUid
|
||||||
|
idUp3: $idUp3
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
|
waktu_lapor
|
||||||
|
waktu_response
|
||||||
|
waktu_recovery
|
||||||
|
durasi_response_time
|
||||||
|
durasi_recovery_time
|
||||||
|
status_akhir
|
||||||
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_pelapor
|
||||||
|
media
|
||||||
|
nama_ulp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
keluhanSelesaiTanpaIDPelanggan: gql`
|
keluhanSelesaiTanpaIDPelanggan: gql`
|
||||||
query daftarKeluhanSelesaiTanpaIdPelanggan(
|
query daftarKeluhanSelesaiTanpaIdPelanggan(
|
||||||
$dateFrom: Date!
|
$dateFrom: Date!
|
||||||
@ -83,6 +128,59 @@ export const queries = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
ssdaftarKeluhanDiselesaikanCC123: gql`
|
||||||
|
query ssdaftarKeluhanDiselesaikanCC123(
|
||||||
|
$dateFrom: Date!
|
||||||
|
$dateTo: Date!
|
||||||
|
$idUlp: Int!
|
||||||
|
$idUid: Int!
|
||||||
|
$idUp3: Int!
|
||||||
|
$media: String!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
|
) {
|
||||||
|
ssdaftarKeluhanDiselesaikanCC123(
|
||||||
|
dateFrom: $dateFrom
|
||||||
|
dateTo: $dateTo
|
||||||
|
idUlp: $idUlp
|
||||||
|
idUid: $idUid
|
||||||
|
idUp3: $idUp3
|
||||||
|
media: $media
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
|
id_uid
|
||||||
|
nama_uid
|
||||||
|
id_up3
|
||||||
|
nama_up3
|
||||||
|
id_ulp
|
||||||
|
nama_ulp
|
||||||
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_pelapor
|
||||||
|
status_akhir
|
||||||
|
pembuat_laporan
|
||||||
|
waktu_lapor
|
||||||
|
waktu_recovery
|
||||||
|
jumlah_lapor
|
||||||
|
media
|
||||||
|
nama_issuetype
|
||||||
|
nama_subissuetype
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
keluhanDiselesaikanCC123: gql`
|
keluhanDiselesaikanCC123: gql`
|
||||||
query daftarKeluhanDiselesaikanCC123(
|
query daftarKeluhanDiselesaikanCC123(
|
||||||
$dateFrom: Date!
|
$dateFrom: Date!
|
||||||
@ -123,6 +221,55 @@ export const queries = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
ssdaftarKeluhanResponseTime: gql`
|
||||||
|
query ssdaftarKeluhanResponseTime(
|
||||||
|
$dateFrom: Date!
|
||||||
|
$dateTo: Date!
|
||||||
|
$idUlp: Int!
|
||||||
|
$idUid: Int!
|
||||||
|
$idUp3: Int!
|
||||||
|
$minDurasiResponseTime: Int!
|
||||||
|
$maxDurasiResponseTime: Int!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
|
) {
|
||||||
|
ssdaftarKeluhanResponseTime(
|
||||||
|
dateFrom: $dateFrom
|
||||||
|
dateTo: $dateTo
|
||||||
|
idUlp: $idUlp
|
||||||
|
idUid: $idUid
|
||||||
|
idUp3: $idUp3
|
||||||
|
minDurasiResponseTime: $minDurasiResponseTime
|
||||||
|
maxDurasiResponseTime: $maxDurasiResponseTime
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
|
waktu_lapor
|
||||||
|
waktu_response
|
||||||
|
waktu_recovery
|
||||||
|
durasi_response_time
|
||||||
|
durasi_recovery_time
|
||||||
|
status_akhir
|
||||||
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_pelapor
|
||||||
|
media
|
||||||
|
nama_ulp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
keluhanResponseTime: gql`
|
keluhanResponseTime: gql`
|
||||||
query daftarKeluhanResponseTime(
|
query daftarKeluhanResponseTime(
|
||||||
$dateFrom: Date!
|
$dateFrom: Date!
|
||||||
@ -159,6 +306,55 @@ export const queries = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
ssdaftarKeluhanRecoveryTime: gql`
|
||||||
|
query ssdaftarKeluhanRecoveryTime(
|
||||||
|
$dateFrom: Date!
|
||||||
|
$dateTo: Date!
|
||||||
|
$idUlp: Int!
|
||||||
|
$idUid: Int!
|
||||||
|
$idUp3: Int!
|
||||||
|
$minDurasiRecoveryTime: Int!
|
||||||
|
$maxDurasiRecoveryTime: Int!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
|
) {
|
||||||
|
ssdaftarKeluhanRecoveryTime(
|
||||||
|
dateFrom: $dateFrom
|
||||||
|
dateTo: $dateTo
|
||||||
|
idUlp: $idUlp
|
||||||
|
idUid: $idUid
|
||||||
|
idUp3: $idUp3
|
||||||
|
minDurasiRecoveryTime: $minDurasiRecoveryTime
|
||||||
|
maxDurasiRecoveryTime: $maxDurasiRecoveryTime
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
|
waktu_lapor
|
||||||
|
waktu_response
|
||||||
|
waktu_recovery
|
||||||
|
durasi_response_time
|
||||||
|
durasi_recovery_time
|
||||||
|
status_akhir
|
||||||
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_pelapor
|
||||||
|
media
|
||||||
|
nama_ulp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
keluhanRecoveryTime: gql`
|
keluhanRecoveryTime: gql`
|
||||||
query daftarKeluhanRecoveryTime(
|
query daftarKeluhanRecoveryTime(
|
||||||
$dateFrom: Date!
|
$dateFrom: Date!
|
||||||
@ -206,6 +402,56 @@ export const queries = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
ssdaftarKeluhanMelaporLebihDariSatuKali: gql`
|
||||||
|
query ssdaftarKeluhanMelaporLebihDariSatuKali(
|
||||||
|
$dateFrom: Date!
|
||||||
|
$dateTo: Date!
|
||||||
|
$idUlp: Int!
|
||||||
|
$idUid: Int!
|
||||||
|
$idUp3: Int!
|
||||||
|
$minJmlLapor: Int!
|
||||||
|
$maxJmlLapor: Int!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
|
) {
|
||||||
|
ssdaftarKeluhanMelaporLebihDariSatuKali(
|
||||||
|
dateFrom: $dateFrom
|
||||||
|
dateTo: $dateTo
|
||||||
|
idUlp: $idUlp
|
||||||
|
idUid: $idUid
|
||||||
|
idUp3: $idUp3
|
||||||
|
minJmlLapor: $minJmlLapor
|
||||||
|
maxJmlLapor: $maxJmlLapor
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
|
waktu_lapor
|
||||||
|
waktu_response
|
||||||
|
waktu_recovery
|
||||||
|
jumlah_lapor
|
||||||
|
durasi_response_time
|
||||||
|
durasi_recovery_time
|
||||||
|
status_akhir
|
||||||
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_pelapor
|
||||||
|
media
|
||||||
|
nama_ulp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
keluhanMelaporLebihDariSatuKali: gql`
|
keluhanMelaporLebihDariSatuKali: gql`
|
||||||
query daftarKeluhanMelaporLebihDariSatuKali(
|
query daftarKeluhanMelaporLebihDariSatuKali(
|
||||||
$minJmlLapor: Int!
|
$minJmlLapor: Int!
|
||||||
@ -280,6 +526,103 @@ export const queries = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
ssdaftarKeluhanDialihkanKeUnitLain: gql`
|
||||||
|
query ssdaftarKeluhanDialihkanKeUnitLain(
|
||||||
|
$dateFrom: Date!
|
||||||
|
$dateTo: Date!
|
||||||
|
$idUlp: Int!
|
||||||
|
$idUid: Int!
|
||||||
|
$idUp3: Int!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
|
) {
|
||||||
|
ssdaftarKeluhanDialihkanKeUnitLain(
|
||||||
|
dateFrom: $dateFrom
|
||||||
|
dateTo: $dateTo
|
||||||
|
idUlp: $idUlp
|
||||||
|
idUid: $idUid
|
||||||
|
idUp3: $idUp3
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
|
pembuat_laporan
|
||||||
|
waktu_lapor
|
||||||
|
waktu_dialihkan
|
||||||
|
waktu_response
|
||||||
|
waktu_recovery
|
||||||
|
durasi_response_time
|
||||||
|
durasi_recovery_time
|
||||||
|
id_unit_lama
|
||||||
|
nama_unit_lama
|
||||||
|
id_unit_baru
|
||||||
|
nama_unit_baru
|
||||||
|
status_akhir
|
||||||
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_pelapor
|
||||||
|
media
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
ssdaftarKeluhanBerdasarkanMedia: gql`
|
||||||
|
query ssdaftarKeluhanBerdasarkanMedia(
|
||||||
|
$dateFrom: Date!
|
||||||
|
$dateTo: Date!
|
||||||
|
$idUlp: Int!
|
||||||
|
$idUid: Int!
|
||||||
|
$idUp3: Int!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
|
) {
|
||||||
|
ssdaftarKeluhanBerdasarkanMedia(
|
||||||
|
dateFrom: $dateFrom
|
||||||
|
dateTo: $dateTo
|
||||||
|
idUlp: $idUlp
|
||||||
|
idUid: $idUid
|
||||||
|
idUp3: $idUp3
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
|
waktu_lapor
|
||||||
|
waktu_response
|
||||||
|
waktu_recovery
|
||||||
|
durasi_response_time
|
||||||
|
durasi_recovery_time
|
||||||
|
status_akhir
|
||||||
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_pelapor
|
||||||
|
media
|
||||||
|
waktu_media
|
||||||
|
keterangan_media
|
||||||
|
nama_ulp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
keluhanBerdasarkanMedia: gql`
|
keluhanBerdasarkanMedia: gql`
|
||||||
query daftarKeluhanBerdasarkanMedia(
|
query daftarKeluhanBerdasarkanMedia(
|
||||||
$dateFrom: Date!
|
$dateFrom: Date!
|
||||||
@ -2375,6 +2718,52 @@ export const queries = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
ssdaftarGangguanSelesaiTanpaIdPelanggan: gql`
|
||||||
|
query ssdaftarGangguanSelesaiTanpaIdPelanggan(
|
||||||
|
$dateFrom: Date!
|
||||||
|
$dateTo: Date!
|
||||||
|
$posko: Int!
|
||||||
|
$idUid: Int!
|
||||||
|
$idUp3: Int!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
|
) {
|
||||||
|
ssdaftarGangguanSelesaiTanpaIdPelanggan(
|
||||||
|
dateFrom: $dateFrom
|
||||||
|
dateTo: $dateTo
|
||||||
|
posko: $posko
|
||||||
|
idUid: $idUid
|
||||||
|
idUp3: $idUp3
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
|
pembuat_laporan
|
||||||
|
waktu_lapor
|
||||||
|
waktu_response
|
||||||
|
waktu_recovery
|
||||||
|
durasi_response_time
|
||||||
|
durasi_recovery_time
|
||||||
|
status_akhir
|
||||||
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_pelapor
|
||||||
|
media
|
||||||
|
nama_posko
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
responseTime: gql`
|
responseTime: gql`
|
||||||
query daftarGangguanResponseTime(
|
query daftarGangguanResponseTime(
|
||||||
$dateFrom: Date!
|
$dateFrom: Date!
|
||||||
@ -2415,6 +2804,60 @@ export const queries = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
ssdaftarGangguanResponseTime: gql`
|
||||||
|
query ssdaftarGangguanResponseTime(
|
||||||
|
$dateFrom: Date!
|
||||||
|
$dateTo: Date!
|
||||||
|
$posko: Int!
|
||||||
|
$idUid: Int!
|
||||||
|
$idUp3: Int!
|
||||||
|
$minDurasiResponseTime: Int!
|
||||||
|
$maxDurasiResponseTime: Int!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
|
) {
|
||||||
|
ssdaftarGangguanResponseTime(
|
||||||
|
dateFrom: $dateFrom
|
||||||
|
dateTo: $dateTo
|
||||||
|
minDurasiResponseTime: $minDurasiResponseTime
|
||||||
|
maxDurasiResponseTime: $maxDurasiResponseTime
|
||||||
|
posko: $posko
|
||||||
|
idUid: $idUid
|
||||||
|
idUp3: $idUp3
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
|
pembuat_laporan
|
||||||
|
waktu_lapor
|
||||||
|
waktu_response
|
||||||
|
waktu_recovery
|
||||||
|
durasi_response_time
|
||||||
|
durasi_recovery_time
|
||||||
|
status_akhir
|
||||||
|
is_marking
|
||||||
|
referensi_marking
|
||||||
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_pelapor
|
||||||
|
media
|
||||||
|
nama_posko
|
||||||
|
penyebab
|
||||||
|
tindakan
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
recoveryTime: gql`
|
recoveryTime: gql`
|
||||||
query daftarGangguanRecoveryTime(
|
query daftarGangguanRecoveryTime(
|
||||||
$dateFrom: Date!
|
$dateFrom: Date!
|
||||||
@ -2452,6 +2895,58 @@ export const queries = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
ssdaftarGangguanRecoveryTime: gql`
|
||||||
|
query ssdaftarGangguanRecoveryTime(
|
||||||
|
$dateFrom: Date!
|
||||||
|
$dateTo: Date!
|
||||||
|
$posko: Int!
|
||||||
|
$idUid: Int!
|
||||||
|
$idUp3: Int!
|
||||||
|
$minDurasiRecoveryTime: Int!
|
||||||
|
$maxDurasiRecoveryTime: Int!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
|
) {
|
||||||
|
ssdaftarGangguanRecoveryTime(
|
||||||
|
dateFrom: $dateFrom
|
||||||
|
dateTo: $dateTo
|
||||||
|
minDurasiRecoveryTime: $minDurasiRecoveryTime
|
||||||
|
maxDurasiRecoveryTime: $maxDurasiRecoveryTime
|
||||||
|
posko: $posko
|
||||||
|
idUid: $idUid
|
||||||
|
idUp3: $idUp3
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
|
pembuat_laporan
|
||||||
|
waktu_lapor
|
||||||
|
waktu_response
|
||||||
|
waktu_recovery
|
||||||
|
durasi_response_time
|
||||||
|
durasi_recovery_time
|
||||||
|
status_akhir
|
||||||
|
is_marking
|
||||||
|
referensi_marking
|
||||||
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_pelapor
|
||||||
|
media
|
||||||
|
nama_posko
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
melaporLebihDariSatuKaliDetail: gql`
|
melaporLebihDariSatuKaliDetail: gql`
|
||||||
query detailGangguanLaporLebihDariSatuKali($noLaporan: String!) {
|
query detailGangguanLaporLebihDariSatuKali($noLaporan: String!) {
|
||||||
detailGangguanLaporLebihDariSatuKali(noLaporan: $noLaporan) {
|
detailGangguanLaporLebihDariSatuKali(noLaporan: $noLaporan) {
|
||||||
@ -2501,6 +2996,103 @@ export const queries = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
ssdaftarGangguanMelaporLebihDariSatuKali: gql`
|
||||||
|
query ssdaftarGangguanMelaporLebihDariSatuKali(
|
||||||
|
$dateFrom: Date!
|
||||||
|
$dateTo: Date!
|
||||||
|
$posko: Int!
|
||||||
|
$idUid: Int!
|
||||||
|
$idUp3: Int!
|
||||||
|
$minJmlLapor: Int!
|
||||||
|
$maxJmlLapor: Int!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
|
) {
|
||||||
|
ssdaftarGangguanMelaporLebihDariSatuKali(
|
||||||
|
dateFrom: $dateFrom
|
||||||
|
dateTo: $dateTo
|
||||||
|
minJmlLapor: $minJmlLapor
|
||||||
|
maxJmlLapor: $maxJmlLapor
|
||||||
|
posko: $posko
|
||||||
|
idUid: $idUid
|
||||||
|
idUp3: $idUp3
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
|
pembuat_laporan
|
||||||
|
waktu_lapor
|
||||||
|
waktu_response
|
||||||
|
waktu_recovery
|
||||||
|
jumlah_lapor
|
||||||
|
durasi_response_time
|
||||||
|
durasi_recovery_time
|
||||||
|
status_akhir
|
||||||
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_pelapor
|
||||||
|
media
|
||||||
|
nama_posko
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
ssdaftarGangguanDiselesaikanMobileAPKT: gql`
|
||||||
|
query ssdaftarGangguanDiselesaikanMobileAPKT(
|
||||||
|
$dateFrom: Date!
|
||||||
|
$dateTo: Date!
|
||||||
|
$posko: Int!
|
||||||
|
$idUid: Int!
|
||||||
|
$idUp3: Int!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
|
) {
|
||||||
|
ssdaftarGangguanDiselesaikanMobileAPKT(
|
||||||
|
dateFrom: $dateFrom
|
||||||
|
dateTo: $dateTo
|
||||||
|
posko: $posko
|
||||||
|
idUid: $idUid
|
||||||
|
idUp3: $idUp3
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
|
waktu_lapor
|
||||||
|
pembuat_laporan
|
||||||
|
waktu_response
|
||||||
|
waktu_recovery
|
||||||
|
durasi_response_time
|
||||||
|
durasi_recovery_time
|
||||||
|
status_akhir
|
||||||
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_pelapor
|
||||||
|
media
|
||||||
|
nama_posko
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
diselesaikanMobileAPKT: gql`
|
diselesaikanMobileAPKT: gql`
|
||||||
query daftarGangguanDiselesaikanMobileAPKT(
|
query daftarGangguanDiselesaikanMobileAPKT(
|
||||||
$dateFrom: Date!
|
$dateFrom: Date!
|
||||||
@ -2533,40 +3125,103 @@ export const queries = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
dataDialihkanKePoskoLain: gql`
|
ssdaftarGangguanDialihkanKePoskoLain: gql`
|
||||||
query DaftarGangguan(
|
query ssdaftarGangguanDialihkanKePoskoLain(
|
||||||
$dateFrom: Date!
|
$dateFrom: Date!
|
||||||
$dateTo: Date!
|
$dateTo: Date!
|
||||||
$posko: Int
|
$posko: Int!
|
||||||
$idUid: Int
|
$idUid: Int!
|
||||||
$idUp3: Int
|
$idUp3: Int!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
) {
|
) {
|
||||||
daftarGangguanDialihkanKePoskoLain(
|
ssdaftarGangguanDialihkanKePoskoLain(
|
||||||
dateFrom: $dateFrom
|
dateFrom: $dateFrom
|
||||||
dateTo: $dateTo
|
dateTo: $dateTo
|
||||||
posko: $posko
|
posko: $posko
|
||||||
idUid: $idUid
|
idUid: $idUid
|
||||||
idUp3: $idUp3
|
idUp3: $idUp3
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
) {
|
) {
|
||||||
alamat_pelapor
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
pembuat_laporan
|
pembuat_laporan
|
||||||
durasi_recovery_time
|
|
||||||
durasi_response_time
|
|
||||||
waktu_lapor
|
waktu_lapor
|
||||||
waktu_dialihkan
|
waktu_dialihkan
|
||||||
waktu_recovery
|
|
||||||
waktu_response
|
waktu_response
|
||||||
idpel_nometer
|
waktu_recovery
|
||||||
keterangan_pelapor
|
durasi_response_time
|
||||||
media
|
durasi_recovery_time
|
||||||
nama_pelapor
|
id_posko_lama
|
||||||
no_laporan
|
|
||||||
no_telp_pelapor
|
|
||||||
nama_posko_lama
|
nama_posko_lama
|
||||||
|
id_posko_baru
|
||||||
nama_posko_baru
|
nama_posko_baru
|
||||||
status_akhir
|
status_akhir
|
||||||
waktu_recovery
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_pelapor
|
||||||
|
media
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
ssdaftarGangguanBerdasarkanMedia: gql`
|
||||||
|
query ssdaftarGangguanBerdasarkanMedia(
|
||||||
|
$dateFrom: Date!
|
||||||
|
$dateTo: Date!
|
||||||
|
$posko: Int!
|
||||||
|
$idUid: Int!
|
||||||
|
$idUp3: Int!
|
||||||
|
$media: String!
|
||||||
|
$skip: Int
|
||||||
|
$take: Int
|
||||||
|
$requireTotalCount: Boolean
|
||||||
|
$sort: [SortInput]
|
||||||
|
$filter: [FilterInput]
|
||||||
|
) {
|
||||||
|
ssdaftarGangguanBerdasarkanMedia(
|
||||||
|
dateFrom: $dateFrom
|
||||||
|
dateTo: $dateTo
|
||||||
|
posko: $posko
|
||||||
|
idUid: $idUid
|
||||||
|
idUp3: $idUp3
|
||||||
|
media: $media
|
||||||
|
skip: $skip
|
||||||
|
take: $take
|
||||||
|
requireTotalCount: $requireTotalCount
|
||||||
|
sort: $sort
|
||||||
|
filter: $filter
|
||||||
|
) {
|
||||||
|
totalCount
|
||||||
|
data {
|
||||||
|
no_laporan
|
||||||
|
waktu_lapor
|
||||||
|
pembuat_laporan
|
||||||
waktu_response
|
waktu_response
|
||||||
|
waktu_recovery
|
||||||
|
durasi_response_time
|
||||||
|
durasi_recovery_time
|
||||||
|
status_akhir
|
||||||
|
idpel_nometer
|
||||||
|
nama_pelapor
|
||||||
|
alamat_pelapor
|
||||||
|
no_telp_pelapor
|
||||||
|
keterangan_media
|
||||||
|
media
|
||||||
|
waktu_media
|
||||||
|
keterangan_media
|
||||||
|
nama_posko
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
@ -3794,6 +4449,7 @@ export const queries = {
|
|||||||
$idUid: Int!
|
$idUid: Int!
|
||||||
$idUp3: Int!
|
$idUp3: Int!
|
||||||
$personilYantek: String!
|
$personilYantek: String!
|
||||||
|
$userRegu: String!
|
||||||
) {
|
) {
|
||||||
detailCheckInCheckOutIndividu(
|
detailCheckInCheckOutIndividu(
|
||||||
dateFrom: $dateFrom
|
dateFrom: $dateFrom
|
||||||
@ -3802,6 +4458,7 @@ export const queries = {
|
|||||||
idUid: $idUid
|
idUid: $idUid
|
||||||
idUp3: $idUp3
|
idUp3: $idUp3
|
||||||
personilYantek: $personilYantek
|
personilYantek: $personilYantek
|
||||||
|
userRegu: $userRegu
|
||||||
) {
|
) {
|
||||||
id
|
id
|
||||||
id_uid
|
id_uid
|
||||||
@ -3857,6 +4514,7 @@ export const queries = {
|
|||||||
$idUid: Int!
|
$idUid: Int!
|
||||||
$idUp3: Int!
|
$idUp3: Int!
|
||||||
$personilYantek: String!
|
$personilYantek: String!
|
||||||
|
$userRegu: String!
|
||||||
) {
|
) {
|
||||||
detailCheckInCheckOutKhusus(
|
detailCheckInCheckOutKhusus(
|
||||||
dateFrom: $dateFrom
|
dateFrom: $dateFrom
|
||||||
@ -3865,6 +4523,7 @@ export const queries = {
|
|||||||
idUid: $idUid
|
idUid: $idUid
|
||||||
idUp3: $idUp3
|
idUp3: $idUp3
|
||||||
personilYantek: $personilYantek
|
personilYantek: $personilYantek
|
||||||
|
userRegu: $userRegu
|
||||||
) {
|
) {
|
||||||
id
|
id
|
||||||
nama_uid
|
nama_uid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user