diff --git a/Mohem/package-lock.json b/Mohem/package-lock.json index 7eadf53b..6e1eae67 100644 --- a/Mohem/package-lock.json +++ b/Mohem/package-lock.json @@ -1098,9 +1098,9 @@ } }, "@ionic-native/firebase-x": { - "version": "5.19.1", - "resolved": "https://registry.npmjs.org/@ionic-native/firebase-x/-/firebase-x-5.19.1.tgz", - "integrity": "sha512-UKNfGmwxy6++21KkZwZxXf0/t1zIKkybwCk6NVRwyuEnPTtNgnynA2G10pYOfTkOFu5UnK8WpqFagRJbHHBHdg==", + "version": "5.21.6", + "resolved": "https://registry.npmjs.org/@ionic-native/firebase-x/-/firebase-x-5.21.6.tgz", + "integrity": "sha512-NS7FEa1DMP3mBOrrOOMPan9cj+VCyLbqHPBcUooFchIGtsrYcMiBHq+q7NQyrKhry3BFSG2PusKR8oTr0TCyoQ==", "requires": { "@types/cordova": "^0.0.34" }, @@ -1216,21 +1216,6 @@ "@types/cordova": "^0.0.34" } }, - "@ionic-native/vibration": { - "version": "5.21.6", - "resolved": "https://registry.npmjs.org/@ionic-native/vibration/-/vibration-5.21.6.tgz", - "integrity": "sha512-sVmB4sHJ0MG+3IwmSvaHUATEM9D8ZFKko/1orHALTwGN57o0Ncf/n37PKWdPp8BANmYhTAoj6iOBd+YNonhf3w==", - "requires": { - "@types/cordova": "^0.0.34" - }, - "dependencies": { - "@types/cordova": { - "version": "0.0.34", - "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", - "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" - } - } - }, "@ionic-native/zbar": { "version": "5.19.1", "resolved": "https://registry.npmjs.org/@ionic-native/zbar/-/zbar-5.19.1.tgz", @@ -1530,9 +1515,9 @@ "dev": true }, "@types/selenium-webdriver": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.16.tgz", - "integrity": "sha512-lMC2G0ItF2xv4UCiwbJGbnJlIuUixHrioOhNGHSCsYCJ8l4t9hMCUimCytvFv7qy6AfSzRxhRHoGa+UqaqwyeA==", + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.17.tgz", + "integrity": "sha512-tGomyEuzSC1H28y2zlW6XPCaDaXFaD6soTdb4GNdmte2qfHtrKqhy0ZFs4r/1hpazCfEZqeTSRLvSasmEx89uw==", "dev": true }, "@types/source-list-map": { @@ -1789,9 +1774,9 @@ } }, "adm-zip": { - "version": "0.4.13", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.13.tgz", - "integrity": "sha512-fERNJX8sOXfel6qCBCMPvZLzENBEhZTzKqg6vrOW5pvoEaQuJhRU4ndTAh6lHOxn1I6jnz2NHra56ZODM751uw==", + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.14.tgz", + "integrity": "sha512-/9aQCnQHF+0IiCl0qhXoK7qs//SwYE7zX8lsr/DNk1BRAHYxeLZPL4pguwK29gUEqasYQjqPtEpDRSWEkdHn9g==", "dev": true }, "after": { @@ -4508,9 +4493,9 @@ } }, "cordova-plugin-firebasex": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cordova-plugin-firebasex/-/cordova-plugin-firebasex-7.0.1.tgz", - "integrity": "sha512-0gV2yXrsRw5xXx4xgwLNb8BcHo7IRXLrnZuVM9S2eUw5FxH5IcsksXGxRKXc5ccYG+kSe0sMlwP5ULkSKhckzw==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cordova-plugin-firebasex/-/cordova-plugin-firebasex-7.0.2.tgz", + "integrity": "sha512-xEZvcJC/8jwfz0Dr9XSi6NQaUyv34SSLzF04Pa0HWRM+CZ788pvGXRjWjpNe7n9eirpB9HDNZ92i18T81tovBQ==", "requires": { "plist": "^3.0.1", "xcode": "^2.0.0", @@ -4572,11 +4557,6 @@ "resolved": "https://registry.npmjs.org/cordova-plugin-themeablebrowser/-/cordova-plugin-themeablebrowser-0.2.18.tgz", "integrity": "sha512-FdE1L3wItbTtUudysX/QxN6DTnfGPTMiS4Np/XKeSfYM0bU8sP6DhUIUp1vA8GAulihkEfbNIvy68oVkx2xtFQ==" }, - "cordova-plugin-vibration": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/cordova-plugin-vibration/-/cordova-plugin-vibration-3.1.1.tgz", - "integrity": "sha512-qgv67Rueo4Pydfant3TwnXeFiN9dl+6lKMM6h5jYg9XewiGAGOr8vfWsTvQssC3m3xMKGS1ap3xPNH+BzZ4RMA==" - }, "cordova-plugin-whitelist": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.4.tgz", @@ -7673,6 +7653,11 @@ "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", "dev": true }, + "ionic2-calendar": { + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/ionic2-calendar/-/ionic2-calendar-0.5.8.tgz", + "integrity": "sha512-+8xy/cahkCzEJTYmsqkRiAXcn7FlSSXPM72nU/BKtDj6uNKBl/5Bqu6EoKT1z4YAc1cC3uOZSdSKv9smr4GNnA==" + }, "ionicons": { "version": "4.6.3", "resolved": "https://registry.npmjs.org/ionicons/-/ionicons-4.6.3.tgz", @@ -9574,9 +9559,9 @@ } }, "node-sass": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.0.tgz", - "integrity": "sha512-W1XBrvoJ1dy7VsvTAS5q1V45lREbTlZQqFbiHb3R3OTTCma0XBtuG6xZ6Z4506nR4lmHPTqVRwxT6KgtWC97CA==", + "version": "4.13.1", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.1.tgz", + "integrity": "sha512-TTWFx+ZhyDx1Biiez2nB0L3YrCZ/8oHagaDalbuBSlqXgUPsdkUSzJsVxeDO9LtPB49+Fh3WQl3slABo6AotNw==", "dev": true, "requires": { "async-foreach": "^0.1.3", @@ -9672,9 +9657,9 @@ "dev": true }, "npm": { - "version": "6.13.6", - "resolved": "https://registry.npmjs.org/npm/-/npm-6.13.6.tgz", - "integrity": "sha512-NomC08kv7HIl1FOyLOe9Hp89kYsOsvx52huVIJ7i8hFW8Xp65lDwe/8wTIrh9q9SaQhA8hTrfXPh3BEL3TmMpw==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/npm/-/npm-6.14.0.tgz", + "integrity": "sha512-OgfdLadz7j6dikbpaimmLzMxwLKbXthQXHiJwtegorwtBVnhecfUeYkHopwd5ICaiClQnqlYQCHERXDiYK3Jcw==", "requires": { "JSONStream": "^1.3.5", "abbrev": "~1.1.1", @@ -9682,12 +9667,12 @@ "ansistyles": "~0.1.3", "aproba": "^2.0.0", "archy": "~1.0.0", - "bin-links": "^1.1.6", + "bin-links": "^1.1.7", "bluebird": "^3.5.5", "byte-size": "^5.0.1", "cacache": "^12.0.3", "call-limit": "^1.1.1", - "chownr": "^1.1.3", + "chownr": "^1.1.4", "ci-info": "^2.0.0", "cli-columns": "^3.1.2", "cli-table3": "^0.5.1", @@ -9707,7 +9692,7 @@ "glob": "^7.1.4", "graceful-fs": "^4.2.3", "has-unicode": "~2.0.1", - "hosted-git-info": "^2.8.5", + "hosted-git-info": "^2.8.6", "iferr": "^1.0.2", "imurmurhash": "*", "infer-owner": "^1.0.4", @@ -9725,7 +9710,7 @@ "libnpmorg": "^1.0.1", "libnpmsearch": "^2.0.2", "libnpmteam": "^1.0.2", - "libnpx": "^10.2.0", + "libnpx": "^10.2.2", "lock-verify": "^2.1.0", "lockfile": "^1.0.4", "lodash._baseindexof": "*", @@ -9744,7 +9729,7 @@ "mississippi": "^3.0.0", "mkdirp": "~0.5.1", "move-concurrently": "^1.0.1", - "node-gyp": "^5.0.5", + "node-gyp": "^5.0.7", "nopt": "~4.0.1", "normalize-package-data": "^2.5.0", "npm-audit-report": "^1.3.2", @@ -9752,10 +9737,10 @@ "npm-install-checks": "^3.0.2", "npm-lifecycle": "^3.1.4", "npm-package-arg": "^6.1.1", - "npm-packlist": "^1.4.7", + "npm-packlist": "^1.4.8", "npm-pick-manifest": "^3.0.2", "npm-profile": "^4.0.2", - "npm-registry-fetch": "^4.0.2", + "npm-registry-fetch": "^4.0.3", "npm-user-validate": "~1.0.0", "npmlog": "~4.1.2", "once": "~1.4.0", @@ -9772,7 +9757,7 @@ "read-installed": "~4.0.3", "read-package-json": "^2.1.1", "read-package-tree": "^5.3.1", - "readable-stream": "^3.4.0", + "readable-stream": "^3.6.0", "readdir-scoped-modules": "^1.1.0", "request": "^2.88.0", "retry": "^0.12.0", @@ -9941,7 +9926,7 @@ } }, "bin-links": { - "version": "1.1.6", + "version": "1.1.7", "bundled": true, "requires": { "bluebird": "^3.5.3", @@ -10040,7 +10025,7 @@ } }, "chownr": { - "version": "1.1.3", + "version": "1.1.4", "bundled": true }, "ci-info": { @@ -10421,7 +10406,7 @@ } }, "env-paths": { - "version": "1.0.0", + "version": "2.2.0", "bundled": true }, "err-code": { @@ -10724,7 +10709,7 @@ } }, "get-caller-file": { - "version": "1.0.2", + "version": "1.0.3", "bundled": true }, "get-stream": { @@ -10819,7 +10804,7 @@ "bundled": true }, "hosted-git-info": { - "version": "2.8.5", + "version": "2.8.6", "bundled": true }, "http-cache-semantics": { @@ -10919,7 +10904,7 @@ } }, "invert-kv": { - "version": "1.0.0", + "version": "2.0.0", "bundled": true }, "ip": { @@ -11077,10 +11062,10 @@ "bundled": true }, "lcid": { - "version": "1.0.0", + "version": "2.0.0", "bundled": true, "requires": { - "invert-kv": "^1.0.0" + "invert-kv": "^2.0.0" } }, "libcipm": { @@ -11239,7 +11224,7 @@ } }, "libnpx": { - "version": "10.2.0", + "version": "10.2.2", "bundled": true, "requires": { "dotenv": "^5.0.1", @@ -11369,15 +11354,30 @@ "ssri": "^6.0.0" } }, + "map-age-cleaner": { + "version": "0.1.3", + "bundled": true, + "requires": { + "p-defer": "^1.0.0" + } + }, "meant": { "version": "1.0.1", "bundled": true }, "mem": { - "version": "1.1.0", + "version": "4.3.0", "bundled": true, "requires": { - "mimic-fn": "^1.0.0" + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + }, + "dependencies": { + "mimic-fn": { + "version": "2.1.0", + "bundled": true + } } }, "mime-db": { @@ -11391,10 +11391,6 @@ "mime-db": "~1.35.0" } }, - "mimic-fn": { - "version": "1.2.0", - "bundled": true - }, "minimatch": { "version": "3.0.4", "bundled": true, @@ -11472,6 +11468,10 @@ "version": "0.0.7", "bundled": true }, + "nice-try": { + "version": "1.0.5", + "bundled": true + }, "node-fetch-npm": { "version": "2.0.2", "bundled": true, @@ -11482,33 +11482,20 @@ } }, "node-gyp": { - "version": "5.0.5", + "version": "5.0.7", "bundled": true, "requires": { - "env-paths": "^1.0.0", - "glob": "^7.0.3", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nopt": "2 || 3", - "npmlog": "0 || 1 || 2 || 3 || 4", - "request": "^2.87.0", - "rimraf": "2", - "semver": "~5.3.0", + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.2", + "mkdirp": "^0.5.1", + "nopt": "^4.0.1", + "npmlog": "^4.1.2", + "request": "^2.88.0", + "rimraf": "^2.6.3", + "semver": "^5.7.1", "tar": "^4.4.12", - "which": "1" - }, - "dependencies": { - "nopt": { - "version": "3.0.6", - "bundled": true, - "requires": { - "abbrev": "1" - } - }, - "semver": { - "version": "5.3.0", - "bundled": true - } + "which": "^1.3.1" } }, "nopt": { @@ -11597,11 +11584,12 @@ } }, "npm-packlist": { - "version": "1.4.7", + "version": "1.4.8", "bundled": true, "requires": { "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" + "npm-bundled": "^1.0.1", + "npm-normalize-package-bin": "^1.0.1" } }, "npm-pick-manifest": { @@ -11623,7 +11611,7 @@ } }, "npm-registry-fetch": { - "version": "4.0.2", + "version": "4.0.3", "bundled": true, "requires": { "JSONStream": "^1.3.4", @@ -11702,12 +11690,38 @@ "bundled": true }, "os-locale": { - "version": "2.1.0", + "version": "3.1.0", "bundled": true, "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "bundled": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "bundled": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + } } }, "os-tmpdir": { @@ -11722,10 +11736,18 @@ "os-tmpdir": "^1.0.0" } }, + "p-defer": { + "version": "1.0.0", + "bundled": true + }, "p-finally": { "version": "1.0.0", "bundled": true }, + "p-is-promise": { + "version": "2.1.0", + "bundled": true + }, "p-limit": { "version": "1.2.0", "bundled": true, @@ -12031,7 +12053,7 @@ } }, "readable-stream": { - "version": "3.4.0", + "version": "3.6.0", "bundled": true, "requires": { "inherits": "^2.0.3", @@ -12366,10 +12388,16 @@ } }, "string_decoder": { - "version": "1.2.0", + "version": "1.3.0", "bundled": true, "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.0", + "bundled": true + } } }, "stringify-package": { @@ -12700,14 +12728,14 @@ "bundled": true }, "yargs": { - "version": "11.0.0", + "version": "11.1.1", "bundled": true, "requires": { "cliui": "^4.0.0", "decamelize": "^1.1.1", "find-up": "^2.1.0", "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", + "os-locale": "^3.1.0", "require-directory": "^2.1.1", "require-main-filename": "^1.0.1", "set-blocking": "^2.0.0", @@ -13662,9 +13690,9 @@ } }, "protractor": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/protractor/-/protractor-5.4.2.tgz", - "integrity": "sha512-zlIj64Cr6IOWP7RwxVeD8O4UskLYPoyIcg0HboWJL9T79F1F0VWtKkGTr/9GN6BKL+/Q/GmM7C9kFVCfDbP5sA==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/protractor/-/protractor-5.4.3.tgz", + "integrity": "sha512-7pMAolv8Ah1yJIqaorDTzACtn3gk7BamVKPTeO5lqIGOrfosjPgXFx/z1dqSI+m5EeZc2GMJHPr5DYlodujDNA==", "dev": true, "requires": { "@types/q": "^0.0.32", diff --git a/Mohem/package.json b/Mohem/package.json index c515f9b0..939b044a 100755 --- a/Mohem/package.json +++ b/Mohem/package.json @@ -38,7 +38,7 @@ "@ionic-native/file": "^5.18.0", "@ionic-native/file-path": "^5.18.0", "@ionic-native/fingerprint-aio": "^5.18.0", - "@ionic-native/firebase-x": "^5.19.1", + "@ionic-native/firebase-x": "^5.21.5", "@ionic-native/geolocation": "^5.10.0", "@ionic-native/globalization": "^5.18.0", "@ionic-native/health": "^5.4.0", @@ -52,7 +52,6 @@ "@ionic-native/sqlite": "^5.18.0", "@ionic-native/status-bar": "^5.0.0", "@ionic-native/themeable-browser": "^5.18.0", - "@ionic-native/vibration": "^5.21.6", "@ionic-native/zbar": "^5.10.0", "@ionic/angular": "^4.1.0", "@ng-bootstrap/ng-bootstrap": "^4.2.2", @@ -84,7 +83,7 @@ "cordova-plugin-file": "^6.0.2", "cordova-plugin-filepath": "^1.5.6", "cordova-plugin-fingerprint-aio": "^3.0.0", - "cordova-plugin-firebasex": "^7.0.1", + "cordova-plugin-firebasex": "^7.0.2", "cordova-plugin-geolocation": "^4.0.2", "cordova-plugin-globalization": "^1.11.0", "cordova-plugin-inappbrowser": "^3.1.0", @@ -96,19 +95,19 @@ "cordova-plugin-splashscreen": "^5.0.3", "cordova-plugin-statusbar": "^2.4.3", "cordova-plugin-themeablebrowser": "^0.2.18", - "cordova-plugin-vibration": "^3.1.1", "cordova-plugin-whitelist": "^1.3.4", "cordova-sqlite-storage": "^3.4.0", "cordova-support-google-services": "^1.3.2", "cordova.plugins.diagnostic": "^5.0.1", "core-js": "^2.5.4", "date-fns": "^1.30.1", + "ionic2-calendar": "^0.5.8", "mx.ferreyra.callnumber": "0.0.2", "ng-circle-progress": "^1.5.1", "ng2-file-upload": "^1.3.0", "ng2-pdf-viewer": "^5.3.2", "ngx-gauge": "^1.0.0-beta.10", - "npm": "^6.13.1", + "npm": "^6.13.7", "phonegap-plugin-barcodescanner": "^8.1.0", "phonegap-plugin-multidex": "^1.0.0", "primeicons": "^1.0.0", @@ -141,11 +140,11 @@ "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~1.1.2", "karma-jasmine-html-reporter": "^0.2.2", - "node-sass": "^4.13.0", - "protractor": "~5.4.0", + "node-sass": "^4.13.1", + "protractor": "^5.4.3", "ts-node": "~8.0.0", "tslint": "~5.12.0", - "typescript": "~3.1.6" + "typescript": "3.1.6" }, "description": "An Ionic project", "cordova": { @@ -195,8 +194,7 @@ "cordova-plugin-fingerprint-aio": { "FACEID_USAGE_DESCRIPTION": "User Authentication" }, - "cordova-plugin-firebasex": {}, - "cordova-plugin-vibration": {} + "cordova-plugin-firebasex": {} }, "platforms": [ "browser", diff --git a/Mohem/src/app/absence/absence-confirm/absence-confirm.component.html b/Mohem/src/app/absence/absence-confirm/absence-confirm.component.html index 30597134..d54f2c4e 100644 --- a/Mohem/src/app/absence/absence-confirm/absence-confirm.component.html +++ b/Mohem/src/app/absence/absence-confirm/absence-confirm.component.html @@ -1,6 +1,6 @@ - + {{ts.trPK('submitAbsenceConfirm','submitAbsenceConfirm')}} @@ -11,7 +11,137 @@ - + + + + +
{{'general, addAttach' | translate}}
+
+ +
+ +
+
+
+ + + {{ 'general, notAttch' | translate}} + +
+ + +
+ + + + {{attachList.AttachmentID +1 }} . + + + + + {{attachList.P_FILE_NAME }} + + + + + + + + +
+ +
+ +
+ + +
+
+ + {{attachRes.FILE_NAME }} + +
+ + + + + + + +
+
+ +
+ + + +
{{'confirmAddEit, comment' | translate}}
+ + + + +
+ + +
{{'confirmAddEit, approverList' | translate}}
+
+

{{ 'general, empty' | translate}}

+
+
+ +
+ + +
+
+ +
+
+ + + {{employee.APPROVER}} + + + {{employee.POSITION_TITLE}} + + + +
+
+
+
+
+ +
+ + + + + + + + + + + - +
- {{ts.trPK('confirmAddEit','start')}} + {{ts.trPK('confirmAddEit','start')}}
\ No newline at end of file diff --git a/Mohem/src/app/absence/absence-confirm/absence-confirm.component.scss b/Mohem/src/app/absence/absence-confirm/absence-confirm.component.scss index b4dba631..96965e58 100644 --- a/Mohem/src/app/absence/absence-confirm/absence-confirm.component.scss +++ b/Mohem/src/app/absence/absence-confirm/absence-confirm.component.scss @@ -28,4 +28,246 @@ ion-card-content.confirm-details{ } .confirm-details label{ font-size: 13px; -} \ No newline at end of file +} + +/****************** NEW Design ***************************************/ +.footer-button { + border-radius: 2px; + padding: 0 1.1em; + min-height: 45px; + min-width: 200px; + } + + + + .Header { + font-weight: bold; + color: #1a586d !important; + font-size: 10px; + } + + .tbData { + font-size: 10px; + } + + .btnBack { + background: transparent; + float: right; + } + + .attachmentDiv{ + background: #ffffff; + height: auto; + text-align: center; + padding-top: 1px; + margin: 10px; + border-radius: 15px; + border: 1px solid grey; + } + + .noDataDiv{ + background: #ffffff; + height: 11%; + text-align: center; + padding-top: 1px; + border-radius: 10px; + margin: 10px; + border-radius: 5px; + } + .submitNote{ + background: #ffffff; + height: 80px; + padding-top: 1px; + margin: 10px; + border-radius: 15px; + border: 1px solid grey; + } + + .approvalList{ + --background: #f0efef; + height: auto; + text-align: center; + padding-top: 1px; + border-radius: 10px; + margin: 10px; + border-radius: 5px; + } + + /************************New Design**********************************/ + .notification-list{ + background: none; + background: none; + border-radius: 32px; + ion-item{ + // margin-top: 5px; + // margin-bottom: 5px; + + background-color: transparent; + .item-date{ + width: 100%; + font-size: 16px; + font-weight: bold; + + text-align: start; + padding: 0; + margin: 0; + + position: absolute; + left: 0; + top: 12%; + } + ion-label , [item-end]{ + + white-space: normal; + font-size: 14px; + padding-top: 15%; + // :root[dir="ltr"]{ + // margin-left: 10px; + // } + // :root[dir="rtl"]{ + // margin-right: 10px; + // } + + } + + } + } + + + + + + + .timeline { + position: relative; + margin: 15px 0 0 0; + // border-bottom: solid 1px var(--cusgray); + } + + .timeline:before { + + content: ''; + position: inherit !important; + top: 0; + bottom: 0; + width: 4px; + // background: #e4e4e4; + z-index: 1; + left: 35px; + /* margin-left: -10px; */ + /* z-index: 1; */ + } + + .timeline .timeline-thumb { + + border-radius: 500px; + width: 70px !important; + z-index: 2; + position: absolute; + left: 0px; + // :root[dir="ltr"]{ + // left: 37px; + // } + // :root[dir="rtl"]{ + // right: 37px; + // } + float: right; + top: 9px; + } + + .timeline .timeline-thumb.timeline-icon { + height: 70px; + // text-align: center; + // color: white; + // border: 5px solid #CBD0D3; + // transform: scale(0.2); + } + + + + .timeline .timeline-item { + width: 40px; + + } + + .timeline .timeline-stats { + position: relative; + font-size: 12px; + color: var(--darkgray); + + } + + .empImge{ + border-radius: 50%; + width:100%; + height: 100%; + border: #dedede solid 1px; + + } + .empImgeRep { + border-radius: 50% !important; + width: 80px; + height: 80px; + border: #dedede solid 1px; + } + + .line{ + padding-bottom:87px; + } + + .attachLable{ + position: absolute; + top: 0px; + z-index: 0; + background: #30b8c6; + color: #fff; + border-radius: 50%; + border: 0px; + width: 24px; + height: 24px; + text-align: center; + font-size: 5px; + } + + .removeLable{ + top: 0px; + z-index: 0; + background: #d8252d; + color: #fff; + border-radius: 50%; + border: 0px; + width: 20px; + height: 20px; + text-align: center; + font-size: 5px; + } + + .note-modal { + // width: 90%; + // height: 50%; + // top: 20%; + // left: 5%; + // right: 5%; + // bottom: 5%; + background: rgba(0, 0, 0, 0.5) !important; + padding: 30% 10% !important; + --height: 12cm !important; + // --width: 80% !important; + --border-radius:20px; + + } + .header-toolbar-new{ + --background: #22c6b3; + } + + .confirmEitOkButton{ + white-space: normal !important; + text-transform: capitalize !important; + min-height: 45px !important; + min-width: 5px !important; + margin: 8px !important; + --background: #22c6b3; + width: 80% !important; + color: white!important; + border-radius: 16px !important; + } \ No newline at end of file diff --git a/Mohem/src/app/absence/absence-confirm/absence-confirm.component.ts b/Mohem/src/app/absence/absence-confirm/absence-confirm.component.ts index 06b73416..a68cbad8 100644 --- a/Mohem/src/app/absence/absence-confirm/absence-confirm.component.ts +++ b/Mohem/src/app/absence/absence-confirm/absence-confirm.component.ts @@ -13,7 +13,8 @@ import { ConfirmAddEitService } from '../service/confirm-add-eit-service'; import { AbsenceNotificatonBodyResponse } from '../models/AbsenceNotificationBodyRes'; import { AbsenceAttachmentComponent } from '../absence-attachment/absence-attachment.component'; import { WorkListAttachViewComponent } from 'src/app/notification/work-list-attach-view/work-list-attach-view.component'; - +import { FileUploader } from 'ng2-file-upload'; +import { SubmitAbsenceModalComponent } from '../submit-absence-modal/submit-absence-modal.component'; @Component({ selector: "app-absence-confirm", templateUrl: "./absence-confirm.component.html", @@ -38,6 +39,9 @@ export class AbsenceConfirmComponent implements OnInit { attachReqObj: WorkListButtonRequest = new WorkListButtonRequest(); private isResubmitAbs: boolean = false; private isSubmitBtnClicked: boolean; + filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']; + + constructor( public common: CommonService, public ts: TranslatorService, @@ -225,6 +229,41 @@ export class AbsenceConfirmComponent implements OnInit { } + +/*****submit modal********/ +async openSubmitModal() { + this.common.sharedService.setSharedData( this.attachListOver, 'submitAbsAttachmentList'); + this.common.sharedService.setSharedData(this.absComments, 'absComments'); + const modal = await this.modalCtrl.create({ + component: SubmitAbsenceModalComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'note-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + this.startAbApproval(); + } + }); + + return await modal.present(); + + + + +} + + + + + + removeFile(objectitem) { if (this.attachListOver) { @@ -324,4 +363,96 @@ export class AbsenceConfirmComponent implements OnInit { if (this.P_TransactionID && this.isSubmitBtnClicked == false) this.cancelAbProcess(); } + + + + /*******************Add attchement Functions*************/ + + public uploader: FileUploader = new FileUploader({ + allowedMimeType: ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], + maxFileSize: 10 * 1024 * 1024, + formatDataFunctionIsAsync: true, + formatDataFunction: async (item) => { + return new Promise((resolve, reject) => { + resolve({ + name: item._file.name, + length: item._file.size, + contentType: item._file.type, + date: new Date() + }); + }); + } + }); + + + onFileSelected(input) { + + // this.uploader.onWhenAddingFileFailed = function (item: any, filter: any, options: any){ + + if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) { + let msg: string = ""; + msg = this.ts.trPK("general", "notSupport"); + this.common.presentAlert(msg); + return + } // todo: show alert that you tried uploading wrong files + + else { + + const file = input.target.files[0]; + + // console.log(file); + + //var encoded = Base64.encode(file); + this.getBase64(file).then( + data => this.pushObject(data, file.name, file.type) + ); + + // } + // }; + + } + } + + + getBase64(file) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); + reader.onerror = error => reject(error); + }); + } + + + pushObject(fileData, name, type) { + + console.log("before push: "+ this.index); + //this.attachListOver.length++; + try { + let array = name.split('.'); + let attachType: string = array[array.length - 1]; + + this.attachListOver.push( + { + AttachmentID: this.attachListOver.length, + P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1], + P_FILE_DATA: fileData.split(',')[1], + P_FILE_NAME: name,//.split('.')[0], + P_TRANSACTION_ID: this.P_TransactionID + }) + + } catch (e) { + + } + + + //console.log("after push: "+ this.index); + // return this.addAttachRequest + } + + + + + + } diff --git a/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.html b/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.html new file mode 100644 index 00000000..5ecc61f1 --- /dev/null +++ b/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.html @@ -0,0 +1,132 @@ + + + + {{ 'replacementRoll, title' | translate}} + + + + + + + + {{'replacementRoll, searchBy' | translate}} + + {{'addAttach, name' | translate}} + {{'login, username' | translate}} + {{'general, email' | translate}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + +
+ + + +
+ +
+ +
+ + + {{employee.EMPLOYEE_DISPLAY_NAME}} +
{{employee.USER_NAME}}
+ {{employee.EMAIL_ADDRESS}} +
+
+
+ +
+ + +
+ + + +
+ + +
+ + {{'general, submit' | translate}} + + + {{'general, cancel' | translate}} +
+
\ No newline at end of file diff --git a/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.scss b/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.scss new file mode 100644 index 00000000..7da0d5c7 --- /dev/null +++ b/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.scss @@ -0,0 +1,121 @@ +button.item-button.button.button-md.button-clear.button-clear-md { + background-color: transparent; + } + + .footer-button { + border-radius: 3px; + padding: 0 1.1em; + min-height: 45px; + min-width: 200px; + } + + // ion-item { + // margin-top: 5%; + // margin-right: 7%; + // width: 100%; + // } + .ionItem{ + border: #e4e4e4 solid; + /* margin: 6px; */ + /* padding: 11px; */ + height: 85px; + width: 164px; + border-radius: 5px; + text-align: center; + + } + + + .profileImageDiv{ + text-align: center; + margin-bottom: -27px; + z-index: 3; + position: relative; + top: 0; + + } + .profileImage{ + width:60px !important; + // margin-left: -25px; + // margin-right: 22px; + } + + .activated{ + border: #209a83 0.02cm solid ; + } + .deactivated{ border: #e4e4e4 0.02cm solid; + } + .repContentDiv{ + text-align: center; + width: 85%; + font-size: 14px; + border: #e4e4e4 solid; + border-radius: 5px; + padding: 20px 8px 8px 8px; + margin-top: -9px; + margin-right: -35px + + } + .selIEmpDiv{ + text-align: right; + margin-bottom: -26px; + margin-right: 0px; + z-index: 3; + position: relative; + top: 0; + } + + .selIEmpImage{ + width:22px !important + + } + + .noteInput{ + border: solid var(--gray) 1px; + border-radius: 15px; + margin: 8px 17px 0px 17px; + padding: 10px 2px 10px 2px; + } + .filterInput{ + border: solid var(--gray) 1px; + border-radius: 21px; + padding-left: 10px !important; + } + .filterBtn{ + background: var(--newgreen); + --background: var (--newgreen); + border-radius: 50%; + height: 60px; + width: 60px; + } + + + + *{ + box-sizing: border-box; + } + + .square-container{ + // padding: 8px; + width:100%; + } + .square{ + // width:calc(100% / 2); + width:50%; + float:left; + position: relative; + // padding-bottom: calc(100% / 2); + } + + .square .content{ + width: calc(100% - 16px) !important; + height: calc(100% - 16px) !important; + margin: 8px; + padding: 16px; + // position: absolute; + color: white; + border-radius: 9px; + text-align: center; + // background-color: #0095ff; + // box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26); + } \ No newline at end of file diff --git a/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.spec.ts b/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.spec.ts new file mode 100644 index 00000000..4dbb31b1 --- /dev/null +++ b/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AbsenceReplacementListComponent } from './absence-replacement-list.component'; + +describe('AbsenceReplacementListComponent', () => { + let component: AbsenceReplacementListComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AbsenceReplacementListComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AbsenceReplacementListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.ts b/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.ts new file mode 100644 index 00000000..c14a88e6 --- /dev/null +++ b/Mohem/src/app/absence/absence-replacement-list/absence-replacement-list.component.ts @@ -0,0 +1,342 @@ +import { ModalController } from '@ionic/angular'; +import { Component, OnInit } from '@angular/core'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { WorKListReplacmentEmployeeResponse } from 'src/app/notification/models/ReplacmentEmployeeRes'; +import { WorkListReplacmentEmployeeRequest } from 'src/app/notification/models/ReplacmentEmployeeReq'; +import { WorkListActionRequest } from 'src/app/notification/models/NotificationActionReq'; +import { WorklistMainService } from 'src/app/notification/service/work-list.main.service'; +import { ViewReplacementModalComponent } from 'src/app/notification/view-replacement-modal/view-replacement-modal.component'; +import { WorklistService } from 'src/app/notification/service/worklist.service'; + +@Component({ + selector: 'app-absence-replacement-list', + templateUrl: './absence-replacement-list.component.html', + styleUrls: ['./absence-replacement-list.component.scss'], +}) +export class AbsenceReplacementListComponent implements OnInit { + + P_SEARCH_EMPLOYEE_DISPLAY_NAME: string = ""; + P_SEARCH_EMAIL_ADDRESS: string = ""; + getPassActionMode: any; + selectedValue: any; + inputSearch: any; + selEmpName: any; + selectedUserInf: any; + userNote: any; + getPassNotificationDetails: any; + isAnswer: boolean = false; + pQuestion: string = ""; + selEmp: any; + P_PAGE_NUM: number; + P_PAGE_LIMIT: number; + ReplacementList: any = []; + searchBy: string = ""; + IsReachEnd: boolean = false; + ReplacmentListRes: WorKListReplacmentEmployeeResponse; + private WorkListReplacmentEmployeeObj: WorkListReplacmentEmployeeRequest = new WorkListReplacmentEmployeeRequest(); + private WorkListActionObj: WorkListActionRequest; + getpassResAttr: any = []; + active: any; + demoeAttach:any=[]; + + constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) { + this.P_PAGE_NUM = 1; + this.P_PAGE_LIMIT = 50; + // this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode', false); + // this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo', false); + // this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr', false); + // this.pQuestion = this.cs.sharedService.getSharedData('pQuestion', false); + // if (this.getPassActionMode == "ANSWER_INFO") { + // this.isAnswer = true; + // } + this.WorkListReplacmentEmployeeObj.P_PAGE_NUM = this.P_PAGE_NUM; + this.WorkListReplacmentEmployeeObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + + // this.WorkListActionObj = new WorkListActionRequest(); + // this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;//26919060; + // this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; + // this.WorkListActionObj.P_ACTION_MODE = ""; + // this.WorkListActionObj.P_COMMENTS = ""; + // this.WorkListActionObj.RespondAttributeList =[];// this.getpassResAttr; + // this.WorkListActionObj.P_APPROVER_INDEX = null; + } + + ngOnInit() { + + this.demoeAttach = [{ + USER_NAME: '18888', + EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ", + EMAIL_ADDRESS: "test@yuyuu.hjj", + + + + }, + { + + USER_NAME: '18888', + EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ", + EMAIL_ADDRESS: "test@yuyuu.hjj" + + }, + { + USER_NAME: '18888', + EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ", + EMAIL_ADDRESS: "test@yuyuu.hjj" + + }, + { + USER_NAME: '18888', + EMPLOYEE_DISPLAY_NAME: "AAA fgfhfhfhf hyutyututut ", + EMAIL_ADDRESS: "test@yuyuu.hjj" + + } + ]; + } + + getreplacmentemployee() { + this.ReplacementList = []; + this.IsReachEnd = false; + this.P_PAGE_NUM = 1; + if (this.inputSearch) { + switch (this.searchBy) { + case '1': { + + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.inputSearch; + this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = ""; + + break; + } + case '2': { + this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = this.inputSearch; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = ""; + break; + } + case '3': { + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = this.inputSearch; + this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + break; + } + default: { + this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = ""; + break; + } + } + } else { + this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS = ""; + } + // if(this.selectedValue =="1"){ + // this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME=this.inputSearch; + // this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME=""; + // this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS=""; + // } + // else if(this.selectedValue =="2"){ + // this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME=""; + // this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME=this.inputSearch; + // this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS=""; + // } + // else if(this.selectedValue =="3"){ + // this.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME=""; + // this.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME=""; + // this.WorkListReplacmentEmployeeObj.P_SEARCH_EMAIL_ADDRESS=this.inputSearch; + // } + + this.worklistService.getReplacmentEmployeeList(this.WorkListReplacmentEmployeeObj). + subscribe((result: WorKListReplacmentEmployeeResponse) => { + this.handleWorkListReplacmentEmployeeResult(result); + }); + + }//End replacment Employee + + handleWorkListReplacmentEmployeeResult(result) { + + if (this.cs.validResponse(result)) { + // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); + if (this.cs.hasData(result.ReplacementList)) { + //this.ReplacmentListRes =result.ReplacementList; + this.ReplacementList = result.ReplacementList; + this.P_PAGE_NUM++; + let lastItemIndex = this.ReplacementList.length - 1; + if (result.ReplacementList[lastItemIndex]) { + let lastitem = result.ReplacementList[lastItemIndex]; + if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + } + } else { + let msg: string = this.ts.trPK('general', 'noResult'); + this.cs.presentAlert(msg); + } + // if(result.ReplacementList.length == 0){ + + // } + + // else if(result.ReplacementList != null) + // { + // this.ReplacmentListRes =result.ReplacementList; + // //open modal + // this.openModale(this.ReplacmentListRes); + + + // } // if result == null + + } // valid it + } + + getValueSelected(Value) { + + this.selectedValue = Value; + } + + + select(selectEmp,index){ + console.log(selectEmp.EMPLOYEE_DISPLAY_NAME); + this.selEmp=selectEmp + this.active=index; + } + clear() { + this.selEmpName = ""; + this.selectedUserInf = null; + + } + async openModale(ReplacmentListRes) { + const modal = await this.modalCtrl.create({ + component: ViewReplacementModalComponent + }); + + modal.onDidDismiss() + .then((data) => { + if (data == "cancel" || data == "undefined") { + //this.selEmpName=""; + return; + } else { + this.selectedUserInf = data; + this.selEmpName = this.selectedUserInf.EMPLOYEE_DISPLAY_NAME; + } + }); + + return await modal.present(); + } + + submitAction() { + this.selEmp + if( this.selEmp){ + let data = this.selEmp; + this.modalCtrl.dismiss(data); + }else{ + let msg: string = this.ts.trPK("replacementRoll", "msg"); + this.cs.showErrorMessageDialog(() => { + }, this.ts.trPK('general', 'ok'), msg); + return false; + } + + // if (this.selEmp && this.isAnswer == false) { + // // this.selectedUserInf = this.ReplacementList[this.selEmp]; + // this.selectedUserInf = this.selEmp; + // console.log("selEmp "+ this.selEmp.USER_NAME); + + // if (this.selectedUserInf && this.selectedUserInf.USER_NAME) { + // console.log("userInfo "+this.selectedUserInf.USER_NAME); + // if (this.userNote) { + // this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME; + // this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; + // this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr + + // this.workListMainService.actionButton(this.WorkListActionObj). + // subscribe((result: any) => { + // this.handleApplayActionResult(result); + // }); + // } else { + // let msg: string = this.ts.trPK("replacementRoll", "enterNote"); + // this.cs.showErrorMessageDialog(() => { + // }, this.ts.trPK('general', 'ok'), msg); + + // } + // } else { + // let msg: string = this.ts.trPK("replacementRoll", "msg"); + // this.cs.showErrorMessageDialog(() => { + // }, this.ts.trPK('general', 'ok'), msg); + // } + // } else if (this.isAnswer == true) { + // if (this.userNote) { + // this.WorkListActionObj.P_FORWARD_TO_USER_NAME = null; + // this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; + // this.WorkListActionObj.P_COMMENTS = this.userNote;// response Attr + + // this.workListMainService.actionButton(this.WorkListActionObj). + // subscribe((result: any) => { + // this.handleApplayActionResult(result); + // }); + // } else { + // let msg: string = this.ts.trPK("replacementRoll", "enterNote"); + // this.cs.showErrorMessageDialog(() => { + // }, this.ts.trPK('general', 'ok'), msg); + // } + // } else { + // let msg: string = this.ts.trPK("replacementRoll", "msg"); + // this.cs.showErrorMessageDialog(() => { + // }, this.ts.trPK('general', 'ok'), msg); + // } + } + + + + + doInfinite(infiniteScroll) { + if (!this.IsReachEnd) { + //const request =new WorkListActionRequest(); + // request.WorkListReplacmentEmployeeObj.P_SEARCH_USER_NAME=this.P_SEARCH_USER_NAME; + // request.WorkListReplacmentEmployeeObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME=this.P_SEARCH_EMPLOYEE_DISPLAY_NAME; + // request.P_SEARCH_EMAIL_ADDRESS=this.P_SEARCH_EMAIL_ADDRESS; + this.WorkListReplacmentEmployeeObj.P_PAGE_NUM = this.P_PAGE_NUM; + this.WorkListReplacmentEmployeeObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + // request.P_SELECTED_EMPLOYEE_NUMBER=this.selEmp; + + this.worklistService.getReplacmentEmployeeList(this.WorkListReplacmentEmployeeObj). + subscribe((result: any) => { + if (this.cs.validResponse(result)) { + if (this.cs.hasData(result.ReplacementList)) { + this.P_PAGE_NUM++; + result.ReplacementList.forEach(vr => { + if (vr.ROW_NUM == vr.NO_OF_ROWS) { + this.IsReachEnd = true; + } + else { + this.IsReachEnd = false; + } + this.ReplacementList.push(vr); + // this.pro.GetVacationRulesList.push(vr); + }); + } else { + this.IsReachEnd = true; + } + } + //this.P_PAGE_NUM++; + if (infiniteScroll) + infiniteScroll.target.complete(); + + + // console.log(resFlag); + }, (Error) => console.log(Error), () => infiniteScroll.target.complete()); + } else { + if (infiniteScroll) + infiniteScroll.target.complete(); + } + } + + + closeModal() { + this.modalCtrl.dismiss(); + } + +} + diff --git a/Mohem/src/app/absence/absence.module.ts b/Mohem/src/app/absence/absence.module.ts index 2a2c609b..1b8d9bc5 100644 --- a/Mohem/src/app/absence/absence.module.ts +++ b/Mohem/src/app/absence/absence.module.ts @@ -20,6 +20,10 @@ import { AbsenceAttachmentComponent } from "./absence-attachment/absence-attachm import { AddAttachService } from "./service/add-attach-service"; import { WorkListAttachViewComponent } from "src/app/notification/work-list-attach-view/work-list-attach-view.component"; import { ViewAttachmentsComponent } from './view-attachments/view-attachments.component'; +import { SubmitAbsenceModalComponent } from './submit-absence-modal/submit-absence-modal.component'; +import { AbsenceReplacementListComponent } from './absence-replacement-list/absence-replacement-list.component'; +import { WorklistService } from 'src/app/notification/service/worklist.service'; +import { WorklistMainService } from 'src/app/notification/service/work-list.main.service'; const routes: Routes = [ { path: "", @@ -52,6 +56,14 @@ const routes: Routes = [ { path:'view-attachements', component:ViewAttachmentsComponent + }, + { + path:'absence-submit-modal', + component:SubmitAbsenceModalComponent + }, + { + path:'absence-replacment-modal', + component:AbsenceReplacementListComponent } ] } @@ -73,7 +85,9 @@ const routes: Routes = [ SubmitAbConfirmService, DatePicker, ConfirmAddEitService, - AddAttachService + AddAttachService, + WorklistService, + WorklistMainService ], declarations: [ AbsencePage, @@ -81,7 +95,9 @@ const routes: Routes = [ SubmitAbsenceComponent, AbsenceConfirmComponent, AbsenceAttachmentComponent, - ViewAttachmentsComponent + ViewAttachmentsComponent, + SubmitAbsenceModalComponent, + AbsenceReplacementListComponent ] }) export class AbsencePageModule {} diff --git a/Mohem/src/app/absence/home/home.component.html b/Mohem/src/app/absence/home/home.component.html index 73c20ece..86fd1dcc 100644 --- a/Mohem/src/app/absence/home/home.component.html +++ b/Mohem/src/app/absence/home/home.component.html @@ -1,19 +1,150 @@ - + {{ts.trPK('absenceList','absenceList')}} - + - + + +
+
+ + + + + + +
+ + +
+
+ + + + +
+ +
+
+ + + + + +
+
+ +
+ +

{{totalnumber}}

+ + + + + {{ts.trPK('absenceList','totalNumber')}} + +
+ + + + +
+
+ + + + + + + + +
+
+ + + + + + + + + +
+
+ + + + + + + + + +
+ + + + + +
+
+
+
+ + + + +
@@ -25,92 +156,104 @@
- +
- + + +
- - - - + +
+ +
+
- - - - - + +
+ +
+
+
- - - - + +
+ +
+
- - - - + +
+ +
+
- - - - + +
+ +
+
- - - - + +
+ +
+
- - - - + +
+ +
+
- - - - + +
+ +
+
- - + +
+ + + +
- + \ No newline at end of file diff --git a/Mohem/src/app/absence/home/home.component.scss b/Mohem/src/app/absence/home/home.component.scss index 36a672b9..670bd6c2 100644 --- a/Mohem/src/app/absence/home/home.component.scss +++ b/Mohem/src/app/absence/home/home.component.scss @@ -7,3 +7,212 @@ height:20px; width:20px; } + +.addClass{ + background-color: #094875; + width: 80px; + height: 80px; + right: 8%; + position: fixed; + color: white; + bottom: 20%; + border-radius: 50%; + z-index: 999; + -webkit-box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59); + -moz-box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59); + box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59); + } + + .grids{ + border-radius: 20px !important; + background: white; + padding-left: 1px; + padding-right: 1px; + margin: 13px; + padding-top: 0px; + padding-bottom: 3px; + padding-left: 13px; + padding-right: 13px; + border: 1px solid #cac8c8; + margin-bottom: 10% !important; + } + + .bgcolor { + + color: white; + border-top-right-radius: 19px; + border-top-left-radius: 15px; + padding-top: 1; + padding-bottom: 0; + margin-top: 0; + margin-bottom: 0; + /* border-radius: 12px !important; */ + background: #094875; + border-bottom: 1px solid #a7a4a4; + border-top: 1px solid #cac8c8; + margin-left: -13px; + margin-right: -13px; + } + + + .header-div { + + background-color: #22C6B3; + text-transform: capitalize; + height: 160px; + /* position: relative; */ + /* display: block; */ + margin-bottom: -28px; + } + + .header-toolbar-new{ + --background: #22c6b3; + } + + + .hrClass{ + border-width: 0; + box-sizing: content-box; + border-bottom: 1px solid #e6e6e6; + background: #fff !important; + height: 1px; + } + + //////////////////////////////////////////////down + + .colorBG{ + --background: #f0efef; + } + + + + + .Title{ + text-align: center; + color: white; + margin-top: -33px; + font-size: 17px; + } + + .result-graph{ + font-size: 14px; + margin-left: -48px; + margin-right: 3px; + margin-bottom: -30px; + } + + .datetime{ + // text-align: center; + // font-family: WorkSans-Bold; + // margin-left: 111px; + text-align: center; + font-family: WorkSans-Bold; + margin-left: 47px; + margin-top: -19px; + + } + .datelabel{ + margin-left: 150px; + color: black !important; + font-family: WorkSans-Bold; + } + .iconCalendar{ + // margin-left: -241px; + // margin-top: 5px; + margin-left: 30px !important; + width: 22% !important; + height: 26px !important; + margin-top: -69px !important; + margin-bottom: 20px !important; + } +.today-graph{ + // display:block !important; + // height: 150px !important; + // width: 300 !important; + // margin-left: -70px !important; + display: block !important; + height: 196px; + width: 385px; + padding-left: 51px; + // padding-top: 29px; + margin-left: -70px !important; +} + + .headerGrid{ + background-color: white !important; + border: 1px solid #cac8c8 !important; + border-radius: 20px !important; + padding-top: 28px; + padding-bottom: 14px; + margin-left: 13px; + margin-right: 13px; + margin-top: -136px; + margin-bottom: 10px; + + } + .header{ + + margin-top: -126px; + } + .result-text-container { + padding: 0; + margin: 0; + position: absolute; + left: 31%; + top: 23%; + display: block; + text-align: center; + transform: translate(-50%, -50%); + + h2 { + + font-size: 25px; + font-family: WorkSans-Bold; + margin: 0 auto; + // margin-top: 289px; + line-height: 36px; + + } + + span { + + width: 125px; + display: block; + margin: 0 auto; + font-size: 12px; + // margin-top: 289px; + font-family: workSans-Regular; + } + } +.green-label{ +font-size: 12px; +margin-top: -13px; +} + +.green-amount{ + font-size: 17px; + font-family: WorkSans-Bold; + margin-top: -3px; +} + +.blue-label{ + font-size: 12px; + margin-top: -13px; + } + + .blue-amount{ + font-size: 17px; + font-family: WorkSans-Bold; + margin-top: -4px; + } + + .contentEit:before { + position: absolute; + content: ""; + // background: #22c6b3; + height: 140px; + width: 100%; + left: 0; + top: 0px; + z-index: 1; + } \ No newline at end of file diff --git a/Mohem/src/app/absence/home/home.component.ts b/Mohem/src/app/absence/home/home.component.ts index 50dd3494..398820e9 100644 --- a/Mohem/src/app/absence/home/home.component.ts +++ b/Mohem/src/app/absence/home/home.component.ts @@ -6,6 +6,9 @@ import { MenuService } from "src/app/hmg-common/services/menu/menuservice.servic import { AbsenceAttahcmentResponse } from "../models/abs.attach.response"; import { AbsenceListService } from "../service/service.service"; import { IonInfiniteScroll } from "@ionic/angular"; +import { AccrualService } from 'src/app/accrual-balances/services/accrual.service'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; +import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user'; @Component({ selector: "app-home", @@ -13,6 +16,7 @@ import { IonInfiniteScroll } from "@ionic/angular"; styleUrls: ["./home.component.scss"] }) export class HomeComponent implements OnInit { + [x: string]: any; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; P_PAGE_NUM: number; P_PAGE_LIMIT: number; @@ -21,14 +25,55 @@ export class HomeComponent implements OnInit { selEmp: string = ""; respID: number; selMenu: MenuResponse; + leaveAccrualBalance: any; + data: any; + accrualNet: any; + getleaveAccrualBalance: any; + accrualUsed: any; + accrualYearly: any; + effectiveDate: any; + Sdate: any; + emp_no: any; + balance: any; + ACCRUAL_NET_ENTITLEMENT: any; + ACCRUAL_USED_ENTITLEMENT: any; + ACCRUAL_YEARLY_ENTITLEMENT: any; + totalnumber: any; + + public options = { + cutoutPercentage: 80, + tooltips: { enabled: false }, + legend: { display: false }}; + gaugeType = "full"; + // gaugeValue = 11.200; + // gaugeLabel = ""; + constructor( public common: CommonService, public ts: TranslatorService, public menuService: MenuService, - public absService: AbsenceListService + public absService: AbsenceListService, + public accrualService: AccrualService, + public authService: AuthenticationService ) {} ngOnInit() { + + this.Sdate = new Date().toISOString(); + + this.getUserDetails(); + } + private getUserDetails(){ + this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { + if (user) { + this.emp_no=user.EMPLOYEE_NUMBER; + this.getAccrualBalance(); + } + }); + + + + this.P_PAGE_LIMIT = 50; this.P_PAGE_NUM = 1; this.selMenu = this.common.sharedService.getSharedData( @@ -43,13 +88,42 @@ export class HomeComponent implements OnInit { MenuResponse.SHARED_SEL_RESP_ID, false ); + this.leaveAccrualBalance = this.common.sharedService.getSharedData('leaveAccrualBalance', false); + console.log("this.leaveAccrualBalance>>>>>>>>>>" + this.leaveAccrualBalance.ACCRUAL_NET_ENTITLEMENT); + /*** + ACCRUAL_NET_ENTITLEMENT: 24.59 + ACCRUAL_USED_ENTITLEMENT: 0 + ACCRUAL_YEARLY_ENTITLEMENT: 50.4*/ + this.accrualNet = this.leaveAccrualBalance.ACCRUAL_NET_ENTITLEMENT; + this.accrualUsed = this.leaveAccrualBalance.ACCRUAL_USED_ENTITLEMENT; + this.accrualYearly = this.leaveAccrualBalance.ACCRUAL_YEARLY_ENTITLEMENT; + this.totalnumber= this.accrualNet + this.accrualUsed + this.accrualYearly; + this.totalnumber= this.totalnumber.toFixed(3); + this.request = this.common.sharedService.getSharedData('leaveAccrualBalanceDate', false); + console.log("this.request" + this.request.P_EFFECTIVE_DATE); + this.effectiveDate = this.request.P_EFFECTIVE_DATE; + this.data = { + // labels: ['earingTotal', 'deductionTotal'], + datasets: [ + { data: [this.accrualNet,this.accrualUsed,this.accrualYearly], + backgroundColor: [ + '#DDB017', + '#094875', + '#CB3232',], + borderWidth: 2 + } + ] + }; + this.getAbsenceTransaction(); } - AccrualBalances() { + + +AccrualBalances() { this.common.openAccuralPage(); } - AttachmentDocuments(id) { +AttachmentDocuments(id) { const request = { P_ABSENCE_ATTENDANCE_ID: id }; @@ -77,7 +151,7 @@ export class HomeComponent implements OnInit { //this.GetAbsenceTransactionList =result.GetAbsenceTransactionList; } } - getAbsenceTransaction() { +getAbsenceTransaction() { this.IsReachEnd = false; const request = { P_SELECTED_EMPLOYEE_NUMBER: this.selEmp, @@ -91,7 +165,7 @@ export class HomeComponent implements OnInit { }); } - private handleAbsListResult(result) { + handleAbsListResult(result) { if (this.common.validResponse(result)) { if (this.common.hasData(result.GetAbsenceTransactionList)) { this.GetAbsenceTransactionList = result.GetAbsenceTransactionList; @@ -108,7 +182,7 @@ export class HomeComponent implements OnInit { } } } - doInfinite(infiniteScroll) { +doInfinite() { if (!this.IsReachEnd) { //this.P_PAGE_NUM++; const request = { @@ -148,7 +222,54 @@ export class HomeComponent implements OnInit { } } } - createAbsence() { +createAbsence() { this.common.openSubmitAbsencePage(); } + +/////////////////////////////////////////////////////////////// + getAccrualBalance() { + if (this.Sdate) { + let today = new Date(this.Sdate); + let day = today.getDate(); + let month = today.getMonth() + 1; + let year = today.getFullYear(); + let todayDate = month + '/' + day + '/' + year; + let effectiveDate = todayDate; + const request = { + P_SELECTED_EMPLOYEE_NUMBER: this.emp_no, + P_EFFECTIVE_DATE: effectiveDate + }; + + this.accrualService + .getAccrualBalances(request) + .subscribe((result: any) => { + this.handleAccrualResult(result); + }); + } + } + handleAccrualResult(result) { + if (this.common.validResponse(result)) { + this.balance = result.GetAccrualBalancesList; + } + if(this.balance){ + this.accrualNet = this.balance[0].ACCRUAL_NET_ENTITLEMENT; + this.accrualUsed = this.balance[0].ACCRUAL_USED_ENTITLEMENT; + this.accrualYearly = this.balance[0].ACCRUAL_YEARLY_ENTITLEMENT; + this.totalnumber= this.accrualNet + this.accrualUsed + this.accrualYearly; + this.totalnumber= this.totalnumber.toFixed(3); + this.data = { + // labels: ['earingTotal', 'deductionTotal'], + datasets: [ + { data: [this.accrualNet,this.accrualUsed,this.accrualYearly], + backgroundColor: [ + '#DDB017', + '#094875', + '#CB3232',], + borderWidth: 2 + } + ] + }; + + } + } } diff --git a/Mohem/src/app/absence/submit-absence-modal/submit-absence-modal.component.html b/Mohem/src/app/absence/submit-absence-modal/submit-absence-modal.component.html new file mode 100644 index 00000000..917ed98c --- /dev/null +++ b/Mohem/src/app/absence/submit-absence-modal/submit-absence-modal.component.html @@ -0,0 +1,39 @@ + + + + + +

Confirmation

+ +
+
+ No Attachment +
+
+ No Note +
+
+ + + + + Are you sure you want to submit + {{ts.trPK('general','ok')}} + + + + + {{ts.trPK('general','cancel')}} + + + + +
+ \ No newline at end of file diff --git a/Mohem/src/app/absence/submit-absence-modal/submit-absence-modal.component.scss b/Mohem/src/app/absence/submit-absence-modal/submit-absence-modal.component.scss new file mode 100644 index 00000000..5803e3f2 --- /dev/null +++ b/Mohem/src/app/absence/submit-absence-modal/submit-absence-modal.component.scss @@ -0,0 +1,53 @@ +.rowBtn{ + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.Header{ + color: black !important; + font-size: 25px !important; + font-weight: bold !important;; + margin: 0; + text-align: center; + margin-bottom: 20px; +} + +.labelRadio{ + color: black !important; + font-weight: bold !important; + padding-bottom: 20px; +} + +.labelcheck{ + color: red !important; + font-weight: bold !important; + margin-bottom: 10px; +} + +.submitOkButton{ + white-space: normal !important; + text-transform: capitalize !important; + min-height: 45px !important; + min-width: 5px !important; + margin: 8px !important; + --background:: #22c6b3; + width: 100% !important; + color: white!important; + border-radius: 16px !important; +} +.submitCancelButton{ + white-space: normal !important; + text-transform: capitalize !important; + min-height: 45px !important; + min-width: 5px !important; + margin: 8px !important; + --background:: #094875; + width: 100% !important; + color: white!important; + border-radius: 16px !important; +} + + + diff --git a/Mohem/src/app/absence/submit-absence-modal/submit-absence-modal.component.spec.ts b/Mohem/src/app/absence/submit-absence-modal/submit-absence-modal.component.spec.ts new file mode 100644 index 00000000..b1caf2ba --- /dev/null +++ b/Mohem/src/app/absence/submit-absence-modal/submit-absence-modal.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SubmitAbsenceModalComponent } from './submit-absence-modal.component'; + +describe('SubmitAbsenceModalComponent', () => { + let component: SubmitAbsenceModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SubmitAbsenceModalComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SubmitAbsenceModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/absence/submit-absence-modal/submit-absence-modal.component.ts b/Mohem/src/app/absence/submit-absence-modal/submit-absence-modal.component.ts new file mode 100644 index 00000000..53dc2393 --- /dev/null +++ b/Mohem/src/app/absence/submit-absence-modal/submit-absence-modal.component.ts @@ -0,0 +1,36 @@ +import { Component, OnInit } from '@angular/core'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { ModalController } from '@ionic/angular'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; + +@Component({ + selector: 'app-submit-absence-modal', + templateUrl: './submit-absence-modal.component.html', + styleUrls: ['./submit-absence-modal.component.scss'], +}) +export class SubmitAbsenceModalComponent implements OnInit { + submitAbsAttachmentList :any =[]; + absComments: string; + constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService){ + this.submitAbsAttachmentList = this.cs.sharedService.getSharedData('submitAbsAttachmentList', false); + this.absComments = this.cs.sharedService.getSharedData('absComments', false); + } + + ngOnInit() { + console.log("modal"); + //this.actionBtns = this.cs.sharedService.getSharedData("passActionMore" , false); + console.log("modal"); + + } + closeModal() { + this.modalCtrl.dismiss(); + } + + + OkBtnModal() { + let data = "ok"; + this.modalCtrl.dismiss(data); + } + +} + diff --git a/Mohem/src/app/absence/submit-absence/submit-absence.component.html b/Mohem/src/app/absence/submit-absence/submit-absence.component.html index 19fd2200..e1a10ef5 100644 --- a/Mohem/src/app/absence/submit-absence/submit-absence.component.html +++ b/Mohem/src/app/absence/submit-absence/submit-absence.component.html @@ -1,5 +1,5 @@ - + {{ts.trPK('submitAbsence','submitAbsence')}} @@ -8,37 +8,36 @@ - - {{ts.trPK('submitAbsence','absenceType')}} + + {{ts.trPK('submitAbsence','absenceType')}} {{item.ABSENCE_ATTENDANCE_TYPE_NAME}} - - {{ts.trPK('submitAbsence','startDate')}} + + {{ts.trPK('submitAbsence','startDate')}} - - {{ts.trPK('submitAbsence','startTime')}} + + {{ts.trPK('submitAbsence','startTime')}} - - {{ts.trPK('submitAbsence','endDate')}} + + {{ts.trPK('submitAbsence','endDate')}} - - {{ts.trPK('submitAbsence','endTime')}} + + {{ts.trPK('submitAbsence','endTime')}} - + {{ts.trPK('submitAbsence','totalDays')}} {{totalDays}} - - + - - {{ts.trPK('submitAbsence','comments')}} + + {{ts.trPK('submitAbsence','comments')}}
@@ -55,6 +54,6 @@
- {{ts.trPK('general','next')}} + {{ts.trPK('general','next')}}
diff --git a/Mohem/src/app/absence/submit-absence/submit-absence.component.scss b/Mohem/src/app/absence/submit-absence/submit-absence.component.scss index 8783b654..477ee720 100644 --- a/Mohem/src/app/absence/submit-absence/submit-absence.component.scss +++ b/Mohem/src/app/absence/submit-absence/submit-absence.component.scss @@ -3,3 +3,21 @@ font-size: 25px; color: #7F8C8D; } + +.header-toolbar-new{ + --background: #22c6b3; + } + + .confirmEitOkButton{ + white-space: normal !important; + text-transform: capitalize !important; + min-height: 45px !important; + min-width: 5px !important; + margin: 8px !important; + --background: #22c6b3; + width: 80% !important; + color: white!important; + border-radius: 16px !important; + } + + diff --git a/Mohem/src/app/absence/submit-absence/submit-absence.component.ts b/Mohem/src/app/absence/submit-absence/submit-absence.component.ts index 81d1bc98..cd019974 100644 --- a/Mohem/src/app/absence/submit-absence/submit-absence.component.ts +++ b/Mohem/src/app/absence/submit-absence/submit-absence.component.ts @@ -26,6 +26,7 @@ import * as moment from "moment"; import {ReplacementListComponent} from "../../vacation-rule/replacement-list/replacement-list.component"; import {ReplacmentResponse} from "../models/replacment-response"; import { AbsenceResponse } from '../models/absence.response'; +import { AbsenceReplacementListComponent } from '../absence-replacement-list/absence-replacement-list.component'; @Component({ selector: "app-submit-absence", templateUrl: "./submit-absence.component.html", @@ -230,12 +231,13 @@ export class SubmitAbsenceComponent implements OnInit { async SearchReplacment() { const modal = await this.modalCtrl.create({ - component: ReplacementListComponent + component: AbsenceReplacementListComponent, + backdropDismiss: false }); - + modal.cssClass = 'replaceRoll-modal'; modal.onDidDismiss() .then((data) => { - const user = data.data.empData; + const user = data.data; console.log(data) console.log(user); if (data) { diff --git a/Mohem/src/app/absence/view-attachments/view-attachments.component.html b/Mohem/src/app/absence/view-attachments/view-attachments.component.html index 921c5ac8..2e17a7bd 100644 --- a/Mohem/src/app/absence/view-attachments/view-attachments.component.html +++ b/Mohem/src/app/absence/view-attachments/view-attachments.component.html @@ -1,6 +1,6 @@ - + {{ts.trPK('absenceList','attach')}} diff --git a/Mohem/src/app/absence/view-attachments/view-attachments.component.scss b/Mohem/src/app/absence/view-attachments/view-attachments.component.scss index e69de29b..d98a85be 100644 --- a/Mohem/src/app/absence/view-attachments/view-attachments.component.scss +++ b/Mohem/src/app/absence/view-attachments/view-attachments.component.scss @@ -0,0 +1,3 @@ +.header-toolbar-new{ + --background: #22c6b3; + } \ No newline at end of file diff --git a/Mohem/src/app/accrual-balances/services/accrual.service.ts b/Mohem/src/app/accrual-balances/services/accrual.service.ts index 6e063d3e..c7b6c198 100644 --- a/Mohem/src/app/accrual-balances/services/accrual.service.ts +++ b/Mohem/src/app/accrual-balances/services/accrual.service.ts @@ -1,13 +1,13 @@ -import { Injectable } from "@angular/core"; -import { Observable } from "rxjs"; -import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service"; -import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; @Injectable({ - providedIn: "root" + providedIn: 'root' }) export class AccrualService { public static GET_ACCRUAL_BALANCE = - "Services/ERP.svc/REST/GET_ACCRUAL_BALANCES"; + 'Services/ERP.svc/REST/GET_ACCRUAL_BALANCES'; constructor( public con: ConnectorService, public authService: AuthenticationService diff --git a/Mohem/src/app/app.component.ts b/Mohem/src/app/app.component.ts index 28f84927..7378cfea 100644 --- a/Mohem/src/app/app.component.ts +++ b/Mohem/src/app/app.component.ts @@ -29,6 +29,10 @@ export class AppComponent implements OnInit, AfterViewInit { companyDesc: string = "Powered By Cloud Solutions"; public direction = "ltr"; User_Job_name: string; + requestGetLoginInfo: { + DeviceType: string; DeviceToken: string; //this.deviceToken + }; + user: boolean; constructor( public ts: TranslatorService, private cs: CommonService, @@ -71,6 +75,7 @@ export class AppComponent implements OnInit, AfterViewInit { } private startReceivingPushService() { + console.log("platform.ready") this.pushService.startReceiving(); } subscribeEvents() { @@ -159,6 +164,7 @@ export class AppComponent implements OnInit, AfterViewInit { closeMenu(){ this.menu.toggle(); } - + + } diff --git a/Mohem/src/app/app.module.ts b/Mohem/src/app/app.module.ts index f6013cf6..436caf2a 100644 --- a/Mohem/src/app/app.module.ts +++ b/Mohem/src/app/app.module.ts @@ -15,6 +15,9 @@ import { FilePath } from '@ionic-native/file-path/ngx'; import { File } from '@ionic-native/file/ngx'; import { Base64 } from '@ionic-native/base64/ngx'; import { FirebaseX } from '@ionic-native/firebase-x/ngx'; +import { NgCalendarModule } from 'ionic2-calendar'; + + @NgModule({ declarations: [AppComponent], entryComponents: [], @@ -25,7 +28,8 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; hardwareBackButton: true, }), AppRoutingModule, - HmgCommonModule + HmgCommonModule, + NgCalendarModule ], providers: [ StatusBar, diff --git a/Mohem/src/app/attendance-tracking/home/home.component.html b/Mohem/src/app/attendance-tracking/home/home.component.html index 1a28a602..48d2c99c 100644 --- a/Mohem/src/app/attendance-tracking/home/home.component.html +++ b/Mohem/src/app/attendance-tracking/home/home.component.html @@ -1,16 +1,29 @@ - + + + + +
+ +
- {{curentDate}}
+ {{curentDate}}
{{ts.trPK('attendance-tracking','today-time-left')}}
@@ -46,32 +59,29 @@
- {{ts.trPK('attendance-tracking','shift-time')}} -

- {{attendanceTrackingList.P_SHT_NAME}} + + {{ts.trPK('attendance-tracking','shift-time')}} + {{attendanceTrackingList.P_SHT_NAME}} +
- + {{ts.trPK('attendance-tracking','check-in')}} -

08:00
- + {{ts.trPK('attendance-tracking','check-out')}} -

08:00
- + {{ts.trPK('attendance-tracking','late-in')}} -

08:00
- + {{ts.trPK('attendance-tracking','regular')}} -

- {{attendanceTrackingList.P_SCHEDULED_HOURS}} + {{attendanceTrackingList.P_SCHEDULED_HOURS | slice:0:-3}}
diff --git a/Mohem/src/app/attendance-tracking/home/home.component.scss b/Mohem/src/app/attendance-tracking/home/home.component.scss index f09a8a87..f92e8d05 100644 --- a/Mohem/src/app/attendance-tracking/home/home.component.scss +++ b/Mohem/src/app/attendance-tracking/home/home.component.scss @@ -1,26 +1,29 @@ +ion-content { + font-family: WorkSans-Regular; +} +ion-grid { + padding:30px 15px; +} .timer-chart{ -padding-top:18px; -background: #094773; -// height: 50%; -text-align: center; + background: #094773; + text-align: center; + line-height: .7cm; } .tracking-content{ -background: #053c63; -height: 50%; + background: #053c63; + min-height: 50%; } + .rowBorder{ text-align: center; border-bottom: var(--lightblue) solid 1px; } .shift-text{ - // text-align: center; - // width: 100%; - // color: white !important; - margin-bottom: 12px; - margin-top: -9px; - font-size: 30px; + font-size: 36px; + line-height: 36px; + display: block; } .shift-title{ width: 100%; @@ -34,24 +37,32 @@ height: 50%; } .divstopBtn{ -text-align: center; + text-align: center; } .stopBtn{ - height: 70px; - width: 70px; + height: 89px; + width: 89px; background-color: var(--lightblue) !important; border-radius: 50%; display: inline-block; - margin-top: -24px; - border: solid 3px #053c63; + margin-top: -40px; + border: solid 5px #053c63; } .colBorder{ + padding: 20px 0px; + text-align: center; +} + +.colBorder:nth-child(1){ border-right: var(--lightblue) solid 1px; } .fixed-shift-timer{ margin-top: -50px; - margin-bottom: -30px; + margin-bottom: -10px; +} +.back-button-container{ + background: #094773; } diff --git a/Mohem/src/app/attendance-tracking/home/home.component.ts b/Mohem/src/app/attendance-tracking/home/home.component.ts index a872b22a..aa8ca30b 100644 --- a/Mohem/src/app/attendance-tracking/home/home.component.ts +++ b/Mohem/src/app/attendance-tracking/home/home.component.ts @@ -4,6 +4,9 @@ import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbore import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import {AttendScanService} from '../../hmg-common/services/attend-services/attend-scan.service'; import { AttendanceTrackingResponse } from 'src/app/hmg-common/services/dashbored/attendance-tracking.response'; +import { SharedDataService } from '../../hmg-common/services/shared-data-service/shared-data.service'; +import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user'; + @Component({ selector: 'app-home', templateUrl: './home.component.html', @@ -22,12 +25,14 @@ export class HomeComponent implements OnInit { public isCheckedIn = undefined; public displayTime: any; public percent: any; - + public spentHours: any; + public userData = this.sharedData.getSharedData(AuthenticatedUser.SHARED_DATA, false); constructor( public cs: CommonService, public db: DashboredService, public ts: TranslatorService, - public attendScanService: AttendScanService + public attendScanService: AttendScanService, + public sharedData: SharedDataService ) { } ngOnInit() { @@ -90,18 +95,20 @@ export class HomeComponent implements OnInit { } convertAndAssignTime(data) { - console.log(data); this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':')); this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':')); - this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true; - this.initTimer(); - console.log('remainingTime: ' + this.remainingTime); - console.log('scheduledTime: ' + this.scheduledTime); - console.log('isCheckedIn: ' + this.isCheckedIn); - } + this.spentHours = this.convertInSeconds(data.P_SPENT_HOURS.split(':')); + this.isCheckedIn = this.spentHours === 0 ? false : true; + if (this.isCheckedIn) { + this.initTimer(); + } +} showAttendanceTracking() { - this.db.getAttendanceTracking() .subscribe((result: AttendanceTrackingResponse) => { + const request = { + P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER + }; + this.db.getAttendanceTracking(request).subscribe((result: AttendanceTrackingResponse) => { if (this.cs.validResponse(result)) { const key = 'GetAttendanceTrackingList'; this.convertAndAssignTime(result[key]); diff --git a/Mohem/src/app/attendance/attendance.module.ts b/Mohem/src/app/attendance/attendance.module.ts index 851b4691..7d5acba4 100644 --- a/Mohem/src/app/attendance/attendance.module.ts +++ b/Mohem/src/app/attendance/attendance.module.ts @@ -7,6 +7,8 @@ import { IonicModule } from '@ionic/angular'; import { AttendancePage } from './attendance.page'; import { HomeComponent } from './home/home.component'; +import {MonthlyAttendanceComponent} from './monthly-attendance/monthly-attendance.component'; +import { HmgCommonModule } from '../hmg-common/hmg-common.module'; const routes: Routes = [ { @@ -16,6 +18,10 @@ const routes: Routes = [ { path: 'home', component: HomeComponent + }, + { + path: 'monthlyAttendance', + component: MonthlyAttendanceComponent } ] } @@ -26,8 +32,9 @@ const routes: Routes = [ CommonModule, FormsModule, IonicModule, + HmgCommonModule, RouterModule.forChild(routes) ], - declarations: [AttendancePage, HomeComponent] + declarations: [AttendancePage, HomeComponent, MonthlyAttendanceComponent] }) export class AttendancePageModule {} diff --git a/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.html b/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.html new file mode 100644 index 00000000..d1812a7d --- /dev/null +++ b/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.html @@ -0,0 +1,113 @@ + + + + + + {{ts.trPK('attendance','attendance')}} + + + + + +
+
+

{{currentMonth}}

+ + + +
+ +
+ +
+ + Open Request Analysis + +
+ +
+ +

287

+ + TOTAL
OPEN REQUEST
+ +
+ + + +
+
+
+
+
+ +
+
+ +
+
+
+
+
+ + + + + + + + + + +

23

+
+
+
+
+ + + + + + + +

08

+
+
+
+
+ + + +

01

+
+
+ + + +

03

+
+
+
+
+
+
+ + + +
+
\ No newline at end of file diff --git a/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.scss b/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.scss new file mode 100644 index 00000000..730bfcfe --- /dev/null +++ b/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.scss @@ -0,0 +1,242 @@ +.colorBG { + --background: #f0efef; +} +.header-div { + background: #22c6b3; + color: var(--light); + text-transform: capitalize; + display: block; + position: relative; + height: 210px; + margin-bottom: 60px; +} + + + + +.chart-modal .modal-Wrapper { + --background: rgb(116, 108, 108) !important; + --border-color:white!important ; + width: 85%!important ; + height: 40px !important ; + + } + + .navbar{ + font-size: 10px !important; + --background: #22C6B3 !important; + color: aliceblue !important; +// margin-top: 10px !important; + + } + + .menu{ + // margin-left:330px !important; + margin-top: 0px !important; + font-size: 35px !important; + background: #22C6B3; + color: aliceblue; + margin-left: 0px !important; + + } + + .person{ + + margin-left:100px !important; + margin-top: 0px !important; + font-size: 23px !important; + background: #22C6B3 !important; + color: aliceblue !important; + + } + + .grid{ +margin-bottom: 550px !important; +margin-top: 20px !important; +margin-left: 15px !important; +margin-right: 15px !important; +background-color:white !important; +border-radius: 20px !important; +height: 250px !important; + } + + .headerGrid{ + margin-bottom: 550px !important; +margin-top: 80px !important; +margin-left: 15px !important; +margin-right: 15px !important; +background-color:white !important; +border-radius: 20px !important; +height: 250px !important; + } + + .bodyGrid{ + margin-bottom: 550px !important; + margin-top: 20px !important; + margin-left: 15px !important; + margin-right: 15px !important; + background-color:white !important; + border-radius: 20px !important; + height: 270px !important; + } + .labelGrid{ + margin-top: -30px !important; + background-color:white !important; + border-radius: 20px !important; + height: 100px !important; + } + +.ionSliders{ + margin: 0px !important; + padding: 0px !important; + +} + + + .ionSlide{ + margin-top: 5px !important; + margin-left: 190px !important; + color: black !important; + + } + .dateLable{ + + margin-left: 90px !important; + color: black !important; + font-size: small !important; + margin-top: 15px !important; + } +// h1{ +// font-size: 15px !important; +// text-align: center !important; +// } +.arrowDropright{ + margin-left:100px !important; + font-size: 20px !important; + color: rgb(168, 165, 165) !important; + margin-top: 15px !important; + +} +.arrowDropleft{ + font-size: 20px !important; + margin-left: 10px !important; + margin-top: 15px !important; + color: rgb(116, 108, 108) !important; +} + + .ionLable{ + font-size: 10px !important; + } + + .number{ + + font-size: 18px !important; + font-weight: bolder !important; + color: black !important; + } + + .header-div{ + background:var(--primary); + background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); + background: -webkit-linear-gradient(45deg, (--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); + background: #22C6B3; + // background: linear-gradient(90deg, #85C48D 0%, #85C48D 13%, #2BB5C6 98%, #2BB5C6 100%); + color:var(--light); + text-transform: capitalize; + + display: block; + position: relative; + height: 210px; + margin-bottom:60px; + // border-radius: 0px 0px 70px 70px; + } + + .request-heading { + + span { + + text-align: center; + + display: block; + + padding-top: 8px; + + font-family: workSans-Regular; + + } + + } + + + + .result-graph { + + position: relative; + + background: white; + + margin-right: 20px; + + margin-left: 20px; + + margin-top: 20px; + + padding-bottom: 20px; + + border-radius: 20px; + + } + + + + + + + + + + + .result-text-container { + + padding: 0; + + margin: 0; + + position: absolute; + + left: 50%; + + top: 50%; + + display: block; + + text-align: center; + + transform: translate(-50%, -50%); + + h2 { + + font-size: 38px; + + font-family: WorkSans-Bold; + + margin: 0 auto; + + line-height: 36px; + + } + + span { + + width: 125px; + + display: block; + + margin: 0 auto; + + font-size: 12px; + + font-family: workSans-Regular; + } + } + \ No newline at end of file diff --git a/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.spec.ts b/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.spec.ts new file mode 100644 index 00000000..39779b1a --- /dev/null +++ b/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MonthlyAttendanceComponent } from './monthly-attendance.component'; + +describe('MonthlyAttendanceComponent', () => { + let component: MonthlyAttendanceComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MonthlyAttendanceComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MonthlyAttendanceComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.ts b/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.ts new file mode 100644 index 00000000..13b560f4 --- /dev/null +++ b/Mohem/src/app/attendance/monthly-attendance/monthly-attendance.component.ts @@ -0,0 +1,101 @@ +import { Component, OnInit } from '@angular/core'; +import { CommonService } from '../../hmg-common/services/common/common.service'; +import { TranslatorService } from '../../hmg-common/services/translator/translator.service'; +import { SharedDataService } from '../../hmg-common/services/shared-data-service/shared-data.service'; +import { GetSubordinatesAttdStatusRequest } from 'src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest'; +import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; +import { GetSubordinatesAttdStatusResponse } from 'src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse'; + + +@Component({ + selector: 'app-monthly-attendance', + templateUrl: './monthly-attendance.component.html', + styleUrls: ['./monthly-attendance.component.scss'], +}) +export class MonthlyAttendanceComponent implements OnInit { + + constructor( + private cs: CommonService, + public ts: TranslatorService, + public sharedData: SharedDataService, + public DS: DashboredService) { } + gaugeType = 'full'; + gaugeValue = 28.3; + gaugeLabel = 'Days'; + // gaugeAppendText = "km/hr"; + + + currentMonth: any; + todayYear: any; + todayMonth: any; + public options = { + + cutoutPercentage: 80, + + tooltips: { enabled: false }, + + legend: { display: false } + + }; + + + +public data = { + + datasets: [ + + { + + data: [120, 50], + + backgroundColor: [ + + '#22c6b3', + + '#094875', + ], + + borderWidth: 2 + + }] + + }; + ngOnInit() { } + + ionViewWillEnter() { + this.currentMonth = this.sharedData.getSharedData("currentMonth"); + console.log(this.currentMonth); + let day = this.currentMonth.split(" "); + this.todayMonth =day[0]; + this.todayYear = day[1]; + this.todayYear = parseInt(this.todayYear); + console.log("MONTH: " +this.todayMonth); + console.log("YEAR: " +this.todayYear); + this.getSubordinatesAttStatus() + } + + + getSubordinatesAttStatus() { + let request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest(); + // request.P_SCHEDULE_DATE_FROM = "/Date(1578603600000+0300)/"; //test + // request.P_SCHEDULE_DATE_TO = "/Date(1576011600000+0300)/";//test + console.log(this.currentMonth); + request.SearchMonth = this.todayMonth; + request.SearchYear = 2019//this.todayYear; + + this.DS.getSubordinatesAttStatus(request, () => { console.log("Error "); }).subscribe((result: GetSubordinatesAttdStatusResponse) => { + if (this.cs.validResponse(result)) { + console.log("response"); + console.log(result); + } + }); + + } + + x(){ + console.log("ENAD CHANge") + } + + + +} diff --git a/Mohem/src/app/authentication/change-password/change-password.component.html b/Mohem/src/app/authentication/change-password/change-password.component.html index ef0cdcd7..29eb0d85 100644 --- a/Mohem/src/app/authentication/change-password/change-password.component.html +++ b/Mohem/src/app/authentication/change-password/change-password.component.html @@ -1,5 +1,5 @@ - + diff --git a/Mohem/src/app/authentication/check-user/check-user.component.ts b/Mohem/src/app/authentication/check-user/check-user.component.ts index f0bd66a9..5e9f5dab 100644 --- a/Mohem/src/app/authentication/check-user/check-user.component.ts +++ b/Mohem/src/app/authentication/check-user/check-user.component.ts @@ -78,6 +78,7 @@ export class CheckUserComponent implements OnInit { console.log(result); this.loginData.LogInTokenID = result.LogInTokenID; this.loginData.P_USER_NAME = this.P_USER_NAME; + // this.loginData.EMPLOYEE_NAME=result.MemberLoginList[0].EMPLOYEE_NAME; this.sharedData.setSharedData(this.loginData, AuthenticationService.LOGIN_DATA); this.sharedData.setSharedData(true,Password.IS_FORGET_PSW); this.cs.stopLoading(); diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.html b/Mohem/src/app/authentication/confirm-login/confirm-login.component.html index ba09e11a..931f7349 100644 --- a/Mohem/src/app/authentication/confirm-login/confirm-login.component.html +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.html @@ -1,5 +1,5 @@ - + @@ -28,7 +28,10 @@ -

{{empname}}

+

{{ts.trPK('login','verify-login-with')}}

- +
@@ -19,7 +19,7 @@
- + @@ -30,12 +30,12 @@ - +

{{ts.trPK('login','login')}}

-
+
- - - - - +
@@ -169,24 +246,21 @@ - +
- + --> + -
- + {{ (isDelete ? 'general, delete' : 'general, submit') | translate }}
\ No newline at end of file diff --git a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.scss b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.scss index 94ace281..908f7d32 100644 --- a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.scss +++ b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.scss @@ -24,3 +24,220 @@ background: transparent; float: right; } + +.attachmentDiv{ + background: #ffffff; + height: auto; + text-align: center; + padding-top: 1px; + margin: 10px; + border-radius: 15px; + border: 1px solid grey; +} + +.noDataDiv{ + background: #ffffff; + height: 11%; + text-align: center; + padding-top: 1px; + border-radius: 10px; + margin: 10px; + border-radius: 5px; +} +.submitNote{ + background: #ffffff; + height: 80px; + padding-top: 1px; + margin: 10px; + border-radius: 15px; + border: 1px solid grey; +} + +.approvalList{ + --background: #f0efef; + height: auto; + text-align: center; + padding-top: 1px; + border-radius: 10px; + margin: 10px; + border-radius: 5px; +} + +/************************New Design**********************************/ +.notification-list{ + background: none; + background: none; + border-radius: 32px; + ion-item{ + // margin-top: 5px; + // margin-bottom: 5px; + + background-color: transparent; + .item-date{ + width: 100%; + font-size: 16px; + font-weight: bold; + + text-align: start; + padding: 0; + margin: 0; + + position: absolute; + left: 0; + top: 12%; + } + ion-label , [item-end]{ + + white-space: normal; + font-size: 14px; + padding-top: 15%; + // :root[dir="ltr"]{ + // margin-left: 10px; + // } + // :root[dir="rtl"]{ + // margin-right: 10px; + // } + + } + + } +} + + + + + + +.timeline { + position: relative; + margin: 15px 0 0 0; + // border-bottom: solid 1px var(--cusgray); +} + +.timeline:before { + + content: ''; + position: inherit !important; + top: 0; + bottom: 0; + width: 4px; + // background: #e4e4e4; + z-index: 1; + left: 35px; + /* margin-left: -10px; */ + /* z-index: 1; */ +} + +.timeline .timeline-thumb { + + border-radius: 500px; + width: 70px !important; + z-index: 2; + position: absolute; + left: 0px; + // :root[dir="ltr"]{ + // left: 37px; + // } + // :root[dir="rtl"]{ + // right: 37px; + // } + float: right; + top: 9px; +} + +.timeline .timeline-thumb.timeline-icon { + height: 70px; + // text-align: center; + // color: white; + // border: 5px solid #CBD0D3; + // transform: scale(0.2); +} + + + +.timeline .timeline-item { + width: 40px; + +} + +.timeline .timeline-stats { + position: relative; + font-size: 12px; + color: var(--darkgray); + +} + +.empImge{ + border-radius: 50%; + width:100%; + height: 100%; + border: #dedede solid 1px; + +} +.empImgeRep { + border-radius: 50% !important; + width: 80px; + height: 80px; + border: #dedede solid 1px; +} + +.line{ + padding-bottom:87px; +} + +.attachLable{ + position: absolute; + top: 0px; + z-index: 0; + background: #30b8c6; + color: #fff; + border-radius: 50%; + border: 0px; + width: 24px; + height: 24px; + text-align: center; + font-size: 5px; +} + +.removeLable{ + top: 0px; + z-index: 0; + background: #d8252d; + color: #fff; + border-radius: 50%; + border: 0px; + width: 20px; + height: 20px; + text-align: center; + font-size: 5px; +} + +.note-modal { + // width: 90%; + // height: 50%; + // top: 20%; + // left: 5%; + // right: 5%; + // bottom: 5%; + background: rgba(0, 0, 0, 0.5) !important; + padding: 30% 10% !important; + --height: 12cm !important; + // --width: 80% !important; + --border-radius:20px; + +} +.header-toolbar-new{ + --background: #22c6b3; +} + +.confirmEitOkButton{ + white-space: normal !important; + text-transform: capitalize !important; + min-height: 45px !important; + min-width: 5px !important; + margin: 8px !important; + background-color: #22c6b3; + width: 80% !important; + color: white!important; + border-radius: 16px !important; +} \ No newline at end of file diff --git a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts index 4171b53f..608e2308 100644 --- a/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts +++ b/Mohem/src/app/eit/confirm-add-eit/confirm-add-eit.component.ts @@ -12,6 +12,8 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { EitService } from '../services/eit.service'; import { AddEitResponse } from '../models/add.eit.response'; +import { FileUploader } from 'ng2-file-upload'; +import { SubmitEitModalComponent } from '../submit-eit-modal/submit-eit-modal.component'; @Component({ selector: 'app-confirm-add-eit', @@ -46,6 +48,20 @@ export class ConfirmAddEitComponent implements OnInit { isSubmitBtnClicked: boolean; isDelete: boolean = false; + /***Add Attchment Vars */ + isUpload: boolean = false; + inQueue: boolean = false; + addAttachmentListReq: any; + attachmentID: number = 0; + addAttachRequest: any = []; + fileData: any; + fileType: any; + dirPage: any; + TransactionID: any; + indexLastObj: any = 0; + filterAllowedType: any = ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']; + + constructor(public modalController: ModalController, public cs: CommonService, private ts: TranslatorService, private eitService: EitService) { this.isSubmitBtnClicked = false; this.eitRequest = new EitRequest(); @@ -277,6 +293,37 @@ export class ConfirmAddEitComponent implements OnInit { return await modal.present(); } + /*****submit modal********/ + async openSubmitModal() { + this.cs.sharedService.setSharedData( this.attachListOver, 'submitAttachmentList'); + this.cs.sharedService.setSharedData(this.eitComments, 'eitComments'); + const modal = await this.modalController.create({ + component: SubmitEitModalComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'note-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + this.startEitApproval(); + } + }); + + return await modal.present(); + + + + + } + + + removeFile(objectitem) { @@ -413,4 +460,100 @@ export class ConfirmAddEitComponent implements OnInit { this.cancelEitProcess(); } + /*******************Add attchement Functions*************/ + + public uploader: FileUploader = new FileUploader({ + allowedMimeType: ['application/pdf', 'image/jpeg', 'image/png', 'text/plain', 'image/jpg', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], + maxFileSize: 10 * 1024 * 1024, + formatDataFunctionIsAsync: true, + formatDataFunction: async (item) => { + return new Promise((resolve, reject) => { + resolve({ + name: item._file.name, + length: item._file.size, + contentType: item._file.type, + date: new Date() + }); + }); + } + }); + + + onFileSelected(input) { + + // this.uploader.onWhenAddingFileFailed = function (item: any, filter: any, options: any){ + + if (!(this.filterAllowedType.indexOf(input.target.files[0].type) > -1)) { + let msg: string = ""; + msg = this.ts.trPK("general", "notSupport"); + this.cs.presentAlert(msg); + return + } // todo: show alert that you tried uploading wrong files + + else { + + const file = input.target.files[0]; + + // console.log(file); + + //var encoded = Base64.encode(file); + this.getBase64(file).then( + data => this.pushObject(data, file.name, file.type) + ); + + // } + // }; + + } + } + + + getBase64(file) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); + reader.onerror = error => reject(error); + }); + } + + + pushObject(fileData, name, type) { + + console.log("before push: "+ this.index); + //this.attachListOver.length++; + try { + let array = name.split('.'); + let attachType: string = array[array.length - 1]; + + this.attachListOver.push( + { + AttachmentID: this.attachListOver.length, + P_FILE_CONTENT_TYPE: attachType,//type.split('/')[1], + P_FILE_DATA: fileData.split(',')[1], + P_FILE_NAME: name,//.split('.')[0], + P_TRANSACTION_ID: this.P_TransactionID + }) + + } catch (e) { + + } + + + //console.log("after push: "+ this.index); + // return this.addAttachRequest + } + + + // removeFile(objectitem) { + + // let objIndex1 = this.uploader.queue.findIndex(item => item == objectitem); + // this.uploader.queue.splice(objIndex1, 1); + // let objIndex = this.addAttachRequest.findIndex(item => item.AttachmentID == objectitem.AttachmentID); + // this.addAttachRequest.splice(objIndex, 1); + // // this.addAttachRequest =this.addAttachRequest.filter(item => item.AttachmentID !== objectitem.AttachmentID); + + // } + + } diff --git a/Mohem/src/app/eit/eit-list/eit-list.component.html b/Mohem/src/app/eit/eit-list/eit-list.component.html index 51a4ac97..b442044d 100644 --- a/Mohem/src/app/eit/eit-list/eit-list.component.html +++ b/Mohem/src/app/eit/eit-list/eit-list.component.html @@ -1,15 +1,116 @@ - - - - - - {{headerTitle}} - + + + {{headerTitle}} + - + +
+ +
+ + +

{{ts.trPK('absenceList','tickets-balance')}}

+
+ +
+ + + +
+ + + +
+ + +
+ +
+ + +
+ +
+ + + +
+
+
+ + +
+
+
+
+ + +
+ + +
+ +
+
+ +
+
+ +
+ +
+
+ + +
+
+ +
+ +
+
+ +
+
+
+ + +
+
+ + + + +
@@ -63,9 +164,9 @@
- +
- + +
- +
+
- + + + + + +
+ +
+
+
+
+
-
- - - +
+ +
+
+ +
+ +
- - {{'general, add' | translate}} +
+
\ No newline at end of file diff --git a/Mohem/src/app/eit/eit-list/eit-list.component.scss b/Mohem/src/app/eit/eit-list/eit-list.component.scss index e10a250d..c2b03032 100644 --- a/Mohem/src/app/eit/eit-list/eit-list.component.scss +++ b/Mohem/src/app/eit/eit-list/eit-list.component.scss @@ -9,3 +9,256 @@ h4 { text-align: center; color: #000000; } +.grids{ + border-radius: 20px !important; + background: white; + padding-left: 1px; + padding-right: 1px; + margin: 13px; + padding-top: 0px; + padding-bottom: 3px; + padding-left: 13px; + padding-right: 13px; + border: 1px solid #cac8c8; + } + + .bgcolor { + + color: white; + border-top-right-radius: 19px; + border-top-left-radius: 15px; + padding-top: 1; + padding-bottom: 0; + margin-top: 0; + margin-bottom: 0; + /* border-radius: 12px !important; */ + background: #094875; + border-bottom: 1px solid #a7a4a4; + border-top: 1px solid #cac8c8; + margin-left: -13px; + margin-right: -13px; +} +.colEit{ + border-right: 1px solid #cac8c8; + border-bottom-left-radius: -10px !important; + padding-top: 8px; + padding-bottom: 8px; + margin-left: 18px; + font-size: 12px !important; +} + +.header-div { + + background-color: #22C6B3; + text-transform: capitalize; + height: 160px; + // position: relative; + display: block; + margin-bottom: -28px; +} + +.header-toolbar-new{ + --background: #22c6b3; +} + +.addClass{ + background-color: #094875; + width: 80px; + height: 80px; + right: 8%; + position: fixed; + color: white; + bottom: 20%; + border-radius: 50%; + z-index: 999; + -webkit-box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59); + -moz-box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59); + box-shadow: 2px -1px 13px 0px rgba(0,0,0,0.59); +} + +.hrClass{ + border-width: 0; + box-sizing: content-box; + border-bottom: 1px solid #e6e6e6; + background: #fff !important; + height: 1px; +} + +//////////////////////////////// +.content:before { + position: absolute; +content: ""; +background: #22c6b3; +height: 140px; +width: 100%; +left: 0; +top: 0px; +z-index: 1; +} + + +.colorBG{ + --background: #f0efef; + } + +.Title{ + text-align: center; + color: white; + margin-top: -33px; + font-size: 17px; +} +.title{ + text-align: center; + color: black; + margin-top: 5px; + font-size: 17px; +} +.today-graph{ + display: block !important; + height: 196px; + width: 365px; + /* padding-left: 51px; */ + margin-left: 28px !important; +} + + .headerGrid{ + // background-color: white !important; + // border: 1px solid #cac8c8 !important; + // border-radius: 20px !important; + // padding-top: 28px; + // padding-bottom: 53px; + // margin-left: 9px; + // margin-right: 13px; + // margin-top: -94px; + // margin-bottom: 10px; + background-color: white !important; + border: 1px solid #cac8c8 !important; + /* padding-top: 28px; */ + padding-bottom: 53px; + padding-top: -30px; + margin-left: 13px; + margin-right: 13px; + /* margin-top: -86px; */ + margin-bottom: 10px; + position: relative; + z-index: 1; + border-radius: 20px; + margin-top: 17px; + } + .result-graph{ + font-size: 14px; + margin-left: -48px; + margin-right: 3px; + margin-bottom: -30px; + + + + } + + .green-label{ + font-size: 15px !important; + margin-left: 7px !important; + margin-right: 42px; + } + .blue-label{ + font-size: 15px !important; + margin-left: 7px !important; + margin-right: 13px; + } + .light-label{ + font-size: 15px !important; + margin-left: 7px !important; + margin-right: -26px; + } + + .light-dote{ + background-color: #3CB9D5; + width: 12px; + height: 12px; + border-radius: 50% !important; + display: inline-block; + } + .blue-dote{ + + background-color: #22C6B3; + width: 12px; + height: 12px; + border-radius: 50% !important; + display: inline-block; + } + .green-dote{ + background-color: #1FA269; + width: 12px; + height: 12px; + border-radius: 50% !important; + display: inline-block; + margin-right: -1px; + } + .col{ + text-align: right; + } + + .gridService{ + + /* margin-top: 87px; */ + border-radius: 10px; + /* margin-bottom: -49px; */ + margin-left: 14px; + margin-right: 14px; + + } + .columns{ + margin: 3px; + margin-bottom: 13px; + background: white; + border-radius: 27px; + padding-left: 30px; + padding-right: 6px; + padding-top: 19px; + padding-bottom: 8px; + border: 1px solid #cac8c8 !important; + } + + + .service{ + font-size: 22px; + color: black; + letter-spacing: 1px; + font-weight: bold; + } + .services{ + + font-size: 12px; + color: black; + } + + .adult-dote{ + background-color: #3CB9D5; + width: 15px; + height: 15px; + border-radius: 50% !important; + display: inline-block; + margin-left: -17px; + margin-right: 5px; + } + .child-dote{ + + background-color: #22C6B3; + width: 15px; + height: 15px; + border-radius: 50% !important; + display: inline-block; + margin-left: -17px; + margin-right: 5px; + } + .infants-dote{ + background-color: #1FA269; + width: 15px; + height: 15px; + border-radius: 50% !important; + display: inline-block; + margin-left: -17px; + margin-right: 5px; + // margin-bottom: 6px; + } + \ No newline at end of file diff --git a/Mohem/src/app/eit/eit-list/eit-list.component.ts b/Mohem/src/app/eit/eit-list/eit-list.component.ts index 20b7eb2a..cf6bbe83 100644 --- a/Mohem/src/app/eit/eit-list/eit-list.component.ts +++ b/Mohem/src/app/eit/eit-list/eit-list.component.ts @@ -40,6 +40,20 @@ export class EitListComponent implements OnInit { private selectedIndex: number; private pAction: number = 0; public headerTitle: string = ""; + data: any; + accrualNetInfants: any; + accrualUNetChild: any; + accrualNetAdult: any; + + public options = { + cutoutPercentage: 80, + tooltips: { enabled: false }, + legend: { display: false }}; + gaugeType = "full"; + accrualBalancesList: any; + common: any; + // gaugeValue = 11.200; + // gaugeLabel = ""; constructor(private cs: CommonService, private EITService: EitService, private ts: TranslatorService, private modalCtrl: ModalController) { this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); @@ -49,6 +63,7 @@ export class EitListComponent implements OnInit { this.menuType = this.selMenu.List_Menu.MENU_TYPE; this.transactionNo = 0; this.functionName = this.getPassMnuEntryObj.FUNCTION_NAME; + console.log("fN>>>>>>>>>>>>>>>>>"+this.functionName); this.headerTitle = this.selMenu.GetMenuEntriesList.PROMPT; this.validEitTransactionTbl = []; this.P_PAGE_NUM = 1; @@ -57,6 +72,27 @@ export class EitListComponent implements OnInit { ngOnInit() { this.getEITTransactions(); + + this.accrualBalancesList = this.cs.sharedService.getSharedData('tickitsbalance', false); + // accrualNetInfants + // accrualUNetChild + // accrualNetAdult + this.accrualNetAdult = this.accrualBalancesList[1].ACCRUAL_NET_ENTITLEMENT; + this.accrualUNetChild = this.accrualBalancesList[2].ACCRUAL_NET_ENTITLEMENT; + this. accrualNetInfants= this.accrualBalancesList[3].ACCRUAL_NET_ENTITLEMENT; + + this.data = { + // labels: ['earingTotal', 'deductionTotal'], + datasets: [ + { data: [this.accrualNetInfants, this.accrualUNetChild, this.accrualNetAdult], + backgroundColor: [ + '#1FA269', + '#22C6B3', + '#3CB9D5',], + borderWidth: 2 + } + ] + }; } getEITTransactions() { @@ -334,7 +370,7 @@ export class EitListComponent implements OnInit { // this.P_TransactionID=result.SubmitEITTransactionList.P_TRANSACTION_ID; // this.sharedData.setSharedData(result,AddEitResponse.SHARED_DATA); - // // this.sharedData.setSharedData(result.SubmitEITTransactionList.P_TRANSACTION_ID,"TransactionIDResubmit"); + // //this.cs.sharedService.setSharedData(result.SubmitEITTransactionList.P_TRANSACTION_ID,"TransactionIDResubmit"); // // this.sharedData.setSharedData(this.eitRequest,EitRequest.SHARED_DATA); this.cs.sharedService.setSharedData({ isResubmit: false, isDelete: this.isDelete }, 'confirmAddEITData') this.cs.openConfirmEitPage(); @@ -455,4 +491,6 @@ export class EitListComponent implements OnInit { this.eitAddedList = list; this.removeItems(item.Collection_Transaction[0].TRANSACTION_NUMBER); } + + } diff --git a/Mohem/src/app/eit/eit.module.ts b/Mohem/src/app/eit/eit.module.ts index 0e823e56..98d5bde0 100644 --- a/Mohem/src/app/eit/eit.module.ts +++ b/Mohem/src/app/eit/eit.module.ts @@ -13,6 +13,7 @@ import { EitListComponent } from './eit-list/eit-list.component'; import { DatePicker } from '@ionic-native/date-picker/ngx'; import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component'; import { EitUpdateListComponent } from './eit-update-list/eit-update-list.component'; +import { SubmitEitModalComponent } from './submit-eit-modal/submit-eit-modal.component'; const routes: Routes = [ @@ -43,6 +44,10 @@ const routes: Routes = [ { path: 'eit-update-list', component: EitUpdateListComponent + }, + { + path: 'eit-submit-modal', + component: SubmitEitModalComponent } ] } @@ -63,7 +68,8 @@ const routes: Routes = [ AddEitComponent, ConfirmAddEitComponent, AddAttachComponent, - EitUpdateListComponent + EitUpdateListComponent, + SubmitEitModalComponent ], entryComponents: [ WorkListAttachViewComponent diff --git a/Mohem/src/app/eit/home/home.component.html b/Mohem/src/app/eit/home/home.component.html index 944ae6ef..28c4956e 100644 --- a/Mohem/src/app/eit/home/home.component.html +++ b/Mohem/src/app/eit/home/home.component.html @@ -1,5 +1,5 @@ - + {{headerTitle}} @@ -10,34 +10,82 @@ - + + - - + + - + - +
- - {{menuItem.PROMPT}} - - + + {{menuItem.PROMPT}} + + + + +
- - + - -  {{subPage.PROMPT}} - - + +  {{subPage.PROMPT}} + + +
- +
+ + + + + + + + + + +
+ + {{menuItem.PROMPT}} + + + + + +
+ + + + +  {{subPage.PROMPT}} + + + + + +
+
+ +
+
+
\ No newline at end of file diff --git a/Mohem/src/app/eit/home/home.component.scss b/Mohem/src/app/eit/home/home.component.scss index 76bf1ca5..cc7f2852 100644 --- a/Mohem/src/app/eit/home/home.component.scss +++ b/Mohem/src/app/eit/home/home.component.scss @@ -4,16 +4,16 @@ ion-item.custCollabs.item.item-block.item-ios { } .ion-item-styling { - -webkit-box-shadow: 0px 2px 7px 0px #7f8c8d; - -moz-box-shadow: 0px 2px 7px 0px #7f8c8d; - box-shadow: 0px 2px 7px 0px #7f8c8d; - color: #209a83 !important; - border: 0px; - border-radius: 5px; + color: black; line-height: 2; margin: 8px 2px; min-height: 40px; background-color: #ffffff; + border-bottom: 1px solid #c8c8c8; +} + +.header-toolbar-new{ + --background: #22c6b3; } ion-item.item.item-block { diff --git a/Mohem/src/app/eit/home/home.component.ts b/Mohem/src/app/eit/home/home.component.ts index 75909a97..2f250a21 100644 --- a/Mohem/src/app/eit/home/home.component.ts +++ b/Mohem/src/app/eit/home/home.component.ts @@ -16,12 +16,14 @@ export class HomeComponent implements OnInit { selMenu: MenuResponse = new MenuResponse(); // Selected Side Menu selectedMenu: any; + pageType :string; constructor(private cs: CommonService, private ts: TranslatorService) { this.menu = this.cs.sharedService.getSharedData('menuEntries', false); + this.pageType = this.cs.sharedService.getSharedData('homemenuentries', false); this.selMenu = this.cs.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); const title: string = this.ts.trPK('eit', 'my-requests'); - this.headerTitle = this.selMenu.List_Menu.MENU_NAME ? this.selMenu.List_Menu.MENU_NAME : title; + this.headerTitle = this.menu.PROMPT ? this.menu.PROMPT : title; } ngOnInit() { } @@ -40,6 +42,7 @@ export class HomeComponent implements OnInit { this.selectedMenu = index; } } + console.log("selected>>>>>>>"+this.selectedMenu); } goToRequest(menuEntry) { @@ -55,6 +58,9 @@ export class HomeComponent implements OnInit { if (menuEntry.REQUEST_TYPE === 'PAYSLIP'){ this.cs.openPayslipPage(); } + if (menuEntry.REQUEST_TYPE === 'TIME_CARD') { + this.cs.openTimeCardPage(); + } } } diff --git a/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.html b/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.html new file mode 100644 index 00000000..2a19db89 --- /dev/null +++ b/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.html @@ -0,0 +1,39 @@ + + + + + +

Confirmation

+ +
+
+ No Attachment +
+
+ No Note +
+
+ + + + + Are you sure you want to submit + {{ts.trPK('general','ok')}} + + + + + {{ts.trPK('general','cancel')}} + + + + +
+ \ No newline at end of file diff --git a/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.scss b/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.scss new file mode 100644 index 00000000..5803e3f2 --- /dev/null +++ b/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.scss @@ -0,0 +1,53 @@ +.rowBtn{ + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.Header{ + color: black !important; + font-size: 25px !important; + font-weight: bold !important;; + margin: 0; + text-align: center; + margin-bottom: 20px; +} + +.labelRadio{ + color: black !important; + font-weight: bold !important; + padding-bottom: 20px; +} + +.labelcheck{ + color: red !important; + font-weight: bold !important; + margin-bottom: 10px; +} + +.submitOkButton{ + white-space: normal !important; + text-transform: capitalize !important; + min-height: 45px !important; + min-width: 5px !important; + margin: 8px !important; + --background:: #22c6b3; + width: 100% !important; + color: white!important; + border-radius: 16px !important; +} +.submitCancelButton{ + white-space: normal !important; + text-transform: capitalize !important; + min-height: 45px !important; + min-width: 5px !important; + margin: 8px !important; + --background:: #094875; + width: 100% !important; + color: white!important; + border-radius: 16px !important; +} + + + diff --git a/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.spec.ts b/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.spec.ts new file mode 100644 index 00000000..7171d957 --- /dev/null +++ b/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SubmitEitModalComponent } from './submit-eit-modal.component'; + +describe('SubmitEitModalComponent', () => { + let component: SubmitEitModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SubmitEitModalComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SubmitEitModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.ts b/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.ts new file mode 100644 index 00000000..81ff9ffc --- /dev/null +++ b/Mohem/src/app/eit/submit-eit-modal/submit-eit-modal.component.ts @@ -0,0 +1,36 @@ +import { Component, OnInit } from '@angular/core'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { ModalController } from '@ionic/angular'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; + +@Component({ + selector: 'app-submit-eit-modal', + templateUrl: './submit-eit-modal.component.html', + styleUrls: ['./submit-eit-modal.component.scss'], +}) +export class SubmitEitModalComponent implements OnInit { + submitAttachmentList :any =[]; + eitComments: string; + constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService){ + this.submitAttachmentList = this.cs.sharedService.getSharedData('submitAttachmentList', false); + this.eitComments = this.cs.sharedService.getSharedData('eitComments', false); + } + + ngOnInit() { + console.log("modal"); + //this.actionBtns = this.cs.sharedService.getSharedData("passActionMore" , false); + console.log("modal"); + + } + closeModal() { + this.modalCtrl.dismiss(); + } + + + OkBtnModal() { + let data = "ok"; + this.modalCtrl.dismiss(data); + } + +} + diff --git a/Mohem/src/app/hmg-common/directive/feedback/feedback.directive.spec.ts b/Mohem/src/app/hmg-common/directive/feedback/feedback.directive.spec.ts deleted file mode 100644 index 7acbd168..00000000 --- a/Mohem/src/app/hmg-common/directive/feedback/feedback.directive.spec.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { FeedbackDirective } from './feedback.directive'; - -describe('FeedbackDirective', () => { - it('should create an instance', () => { - const directive = new FeedbackDirective(); - expect(directive).toBeTruthy(); - }); -}); diff --git a/Mohem/src/app/hmg-common/directive/feedback/feedback.directive.ts b/Mohem/src/app/hmg-common/directive/feedback/feedback.directive.ts deleted file mode 100644 index 14637341..00000000 --- a/Mohem/src/app/hmg-common/directive/feedback/feedback.directive.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Directive, ElementRef, HostListener } from '@angular/core'; -import { TranslatorService } from '../../services/translator/translator.service'; -import { CommonService } from '../../services/common/common.service'; -import { FeedbackService } from './feedback.service'; - -@Directive({ - selector: '[feedback]' -}) -export class FeedbackDirective { - - constructor( - private cs: CommonService, - private ts: TranslatorService, - private el: ElementRef, - private feedBackService: FeedbackService - ) { - - } - - - @HostListener('mousedown') onMouseEnter() { - this.feedBackService.vibrate(); - } -} diff --git a/Mohem/src/app/hmg-common/directive/feedback/feedback.service.spec.ts b/Mohem/src/app/hmg-common/directive/feedback/feedback.service.spec.ts deleted file mode 100644 index dabb73db..00000000 --- a/Mohem/src/app/hmg-common/directive/feedback/feedback.service.spec.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { FeedbackService } from './feedback.service'; - -describe('FeedbackService', () => { - beforeEach(() => TestBed.configureTestingModule({})); - - it('should be created', () => { - const service: FeedbackService = TestBed.get(FeedbackService); - expect(service).toBeTruthy(); - }); -}); diff --git a/Mohem/src/app/hmg-common/directive/feedback/feedback.service.ts b/Mohem/src/app/hmg-common/directive/feedback/feedback.service.ts deleted file mode 100644 index a2b446da..00000000 --- a/Mohem/src/app/hmg-common/directive/feedback/feedback.service.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Injectable } from '@angular/core'; -import { Vibration } from '@ionic-native/vibration/ngx'; -// import { SettingsService } from 'src/app/settings/service/settings.service'; - -@Injectable({ -providedIn: 'root' -}) -export class FeedbackService { -// constructor(private vibration: Vibration, private settings: SettingsService) {} -constructor(private vibration: Vibration) {} - -public async vibrate() { -try { -const on = true; -if (on) { -this.vibration.vibrate(500); -}} catch (e) { -} -} -} diff --git a/Mohem/src/app/hmg-common/hmg-common.module.ts b/Mohem/src/app/hmg-common/hmg-common.module.ts index 85bb9ce8..ca469fcd 100644 --- a/Mohem/src/app/hmg-common/hmg-common.module.ts +++ b/Mohem/src/app/hmg-common/hmg-common.module.ts @@ -43,6 +43,8 @@ import { NativeStorage } from '@ionic-native/native-storage/ngx'; import { ProgressLoadingService } from './ui/progressLoading/progress-loading.service'; import { BarChartComponent } from './ui/bar-chart/bar-chart.component'; import { DonutChartComponent } from './ui/donut-chart/donut-chart.component'; +// import { UserLocalNotificationService } from './services/user-local-notification/user-local-notification.service'; +// import { LocalNotifications } from '@ionic-native/local-notifications/ngx'; import { EmailComponent } from './ui/email/email.component'; import { Badge } from '@ionic-native/badge/ngx'; import { PushService } from './services/push/push.service'; @@ -51,6 +53,8 @@ import { HmgBrowserService } from './services/hmg-browser/hmg-browser.service'; import { GuidService } from './services/guid/guid.service'; import { TabsBarComponent } from './ui/tabs-bar/tabs-bar.component'; import { PageTrailerComponent } from './ui/spacer/page-trailer/page-trailer.component'; +// import { GeofencingService } from './services/geofencing/geofencing.service'; +// import { BackgroundGeolocation } from '@ionic-native/background-geolocation/ngx'; import { ButtonComponent } from './ui/button/button.component'; import { ToolbarButtonComponent } from './ui/toolbar-button/toolbar-button.component'; import { ListboxModule } from 'primeng/listbox'; @@ -78,10 +82,13 @@ import { Diagnostic } from '@ionic-native/diagnostic/ngx'; import { DetailButtonComponent } from './ui/detail-button/detail-button.component'; import { RouterModule } from '@angular/router'; import { HeaderButtonComponent } from './ui/header-button/header-button.component'; +// import { CallNumber } from '@ionic-native/call-number/ngx'; import { AppRate } from '@ionic-native/app-rate/ngx'; import { RatingService } from './services/rating/rating.service'; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { RateService } from './services/rate/rate.service'; +// import { PaymentComponent } from './ui/payment/payment.component'; +// import { PaymentService } from './ui/payment/service/payment.service'; import { MenuService } from './services/menu/menuservice.service'; import { ReplacementListComponent } from '../vacation-rule/replacement-list/replacement-list.component'; import { FileSelectDirective } from 'ng2-file-upload'; @@ -89,7 +96,7 @@ import { PdfViewerModule } from 'ng2-pdf-viewer'; import { WorkListAttachViewComponent } from '../notification/work-list-attach-view/work-list-attach-view.component'; import {Camera, CameraOptions, PictureSourceType} from '@ionic-native/Camera/ngx'; import {File} from '@ionic-native/file/ngx'; -import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uploder-profile.component' +import {FileUploderProfileComponent} from './ui/file-uploder-profile/file-uploder-profile.component'; import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx'; import { AccordinCustomComponent } from './ui/accordin-custom/accordin-custom.component'; import { AccordinTabCustomComponent} from './ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component' @@ -103,6 +110,11 @@ import {FabButtonComponent} from './ui/fab-button/fab-button.component' import { AttendScanService } from './services/attend-services/attend-scan.service'; import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx'; import { NgCircleProgressModule } from 'ng-circle-progress'; +import { CardFilterComponent } from './ui/card-filter/card-filter.component'; +import { EmployeeInformationComponent } from './ui/employee-information/employee-information.component'; +import { CircleCalendarComponent } from './ui/circle-calendar/circle-calendar.component'; +import { NgCalendarModule } from 'ionic2-calendar'; +import { DateInfoModalComponent } from './ui/circle-calendar/date-info-modal/date-info-modal.component'; import { ChartModule } from 'primeng/chart'; @NgModule({ imports: [ @@ -115,6 +127,7 @@ import { ChartModule } from 'primeng/chart'; ListboxModule, PdfViewerModule, NgCircleProgressModule.forRoot(), + NgCalendarModule, ChartModule, NgxGaugeModule ], @@ -135,6 +148,7 @@ import { ChartModule } from 'primeng/chart'; DatePipeTransform, DateTimePipe, SafeHtmlPipe, + // TurncatePipe, BackButtonComponent, IfDatePipe, DynamicTableComponent, @@ -168,7 +182,6 @@ import { ChartModule } from 'primeng/chart'; EmptyDataComponent, DetailButtonComponent, HeaderButtonComponent, - //PaymentComponent, ReplacementListComponent, FileSelectDirective, WorkListAttachViewComponent, @@ -177,7 +190,13 @@ import { ChartModule } from 'primeng/chart'; AccordinCustomComponent, StatsButtonComponent, ServicesButtonComponent, - ConfirmLoginComponent + ConfirmLoginComponent, + CardFilterComponent, + EmployeeInformationComponent, + ConfirmLoginComponent, + CircleCalendarComponent, + DateInfoModalComponent + ], exports: [ FabButtonComponent, @@ -193,6 +212,7 @@ import { ChartModule } from 'primeng/chart'; DividerComponent, NavButtonsComponent, DatePipeTransform, + // TurncatePipe, TranslatePipe, DateTimePipe, SafeHtmlPipe, @@ -237,7 +257,15 @@ import { ChartModule } from 'primeng/chart'; ServicesButtonComponent, ConfirmLoginComponent, NgCircleProgressModule, + ChartModule, + CardFilterComponent, + EmployeeInformationComponent, + ConfirmLoginComponent, + CircleCalendarComponent, + DateInfoModalComponent, + NgCalendarModule, ChartModule + ], providers: [ AttendScanService, @@ -255,10 +283,14 @@ import { ChartModule } from 'primeng/chart'; NativeStorage, ProgressLoadingService, PushService, + // UserLocalNotificationService, + // LocalNotifications, Badge, LifeCycleService, HmgBrowserService, GuidService, + // BackgroundGeolocation, + // GeofencingService, Keyboard, KeyboardService, Diagnostic, @@ -273,11 +305,12 @@ import { ChartModule } from 'primeng/chart'; RateService, Camera, File, + // PaymentService, MenuService, OpenNativeSettings, - BarcodeScanner, - - ] + BarcodeScanner + ], + entryComponents: [DateInfoModalComponent], }) export class HmgCommonModule { } diff --git a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts index 1e615403..42a403b3 100644 --- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts +++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts @@ -55,7 +55,7 @@ export class AuthenticationService { public static smsSendCode='Services/ERP.svc/REST/SendPublicActivationCode'; public static sendActivationCodeByType = 'Services/ERP.svc/REST/Mohemm_SendActivationCodebyOTPNotificationType'; - public static getMobileLoginInfo ='Services/ERP.svc/REST/Mohemm_GetMobileLoginInfo'; + public static getMobileLoginInfo ='Services/ERP.svc/REST/Mohemm_GetMobileLoginInfo_NEW';//Mohemm_GetMobileLoginInfo public static insertMobileLoginInfo ='Services/ERP.svc/REST/Mohemm_InsertMobileLoginInfo'; /* register methods */ @@ -82,6 +82,7 @@ export class AuthenticationService { public static LOGIN_DATA="logindata"; public static DEVICE_TOKEN = "device_token"; public static LAST_LOGIN = 'last-login'; + public static IMEI_USER_DATA = "imei-user-data"; // private static user: AuthenticatedUser; @@ -107,7 +108,6 @@ export class AuthenticationService { request.P_USER_NAME = user.EMPLOYEE_NUMBER; request.UserName = user.EMPLOYEE_NUMBER; request.P_EMAIL_ADDRESS = user.EMPLOYEE_EMAIL_ADDRESS; - if (AuthenticationService.requireRelogin) { this.sessionTimeOutDialog(); } @@ -304,11 +304,11 @@ export class AuthenticationService { } public getLoginInfo( - request: GetLoginInfoRequest, + request: any, onError: any, errorLabel: string ): Observable { - this.setPublicFields(request); + //this.setPublicFields(request); return this.con.post( AuthenticationService.getMobileLoginInfo, request, diff --git a/Mohem/src/app/hmg-common/services/authentication/models/check-user-auth.response.ts b/Mohem/src/app/hmg-common/services/authentication/models/check-user-auth.response.ts index 1322f30a..8c00d26b 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/check-user-auth.response.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/check-user-auth.response.ts @@ -20,5 +20,7 @@ export class CheckUserAuthenticationResponse extends Response { public IsPasswordExpired: boolean; //public P_SESSION_ID:string; public MemberLoginList: MemberList ; - public BasicMemberInformation: BasicInfo; + public BasicMemberInformation: BasicInfo; + public EMPLOYEE_DISPLAY_NAME: string; + public EMPLOYEE_NAME:string; } diff --git a/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.request.ts b/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.request.ts index 46671721..064aac75 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.request.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.request.ts @@ -14,6 +14,8 @@ export class GetLoginInfoRequest extends Request { CompanyID:number; DeviceType:string; LoginType:number; + EMPLOYEE_NAME:string; + EmployeeName:string; // constructor(user: AuthenticatedUser) { // super(); // this.NationalID = user.IdentificationNo; diff --git a/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.response.ts b/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.response.ts index a43ece48..70a8e9fe 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.response.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/get-login-info.response.ts @@ -5,7 +5,8 @@ export class GetLoginInfoResponse extends Response { SMSLoginRequired: boolean; isSMSSent: boolean; LogInTokenID: string; - Mohemm_GetPatientID_List:any + Mohemm_GetPatientID_List:any //old one + Mohemm_GetMobileLoginInfoList:any isActiveCode: boolean; // PatientOutSA: boolean; } \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/authentication/models/member.list.ts b/Mohem/src/app/hmg-common/services/authentication/models/member.list.ts index e74b563f..477a41cf 100644 --- a/Mohem/src/app/hmg-common/services/authentication/models/member.list.ts +++ b/Mohem/src/app/hmg-common/services/authentication/models/member.list.ts @@ -6,4 +6,6 @@ export class MemberList { public P_RETURN_MSG: string; public P_RETURN_STATUS: string; public P_SESSION_ID: number; + public EMPLOYEE_DISPLAY_NAME: string; + public EMPLOYEE_NAME:string; } \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/common/common.service.ts b/Mohem/src/app/hmg-common/services/common/common.service.ts index dc65e9a3..660e0b80 100644 --- a/Mohem/src/app/hmg-common/services/common/common.service.ts +++ b/Mohem/src/app/hmg-common/services/common/common.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from "@angular/core"; +import { Injectable } from '@angular/core'; import { NavController, ToastController, @@ -6,74 +6,74 @@ import { AlertController, Platform, MenuController -} from "@ionic/angular"; -import { Router } from "@angular/router"; -import { TranslatorService } from "../translator/translator.service"; -import { AlertControllerService } from "../../ui/alert/alert-controller.service"; +} from '@ionic/angular'; +import { Router } from '@angular/router'; +import { TranslatorService } from '../translator/translator.service'; +import { AlertControllerService } from '../../ui/alert/alert-controller.service'; //import { Response } from "../models/response"; import { Response } from 'src/app/hmg-common/services/models/response'; -import { Location, DatePipe } from "@angular/common"; -import { ThemeableBrowser } from "@ionic-native/themeable-browser/ngx"; -import { BrowserConfig } from "./models/browser-config"; +import { Location, DatePipe } from '@angular/common'; +import { ThemeableBrowser } from '@ionic-native/themeable-browser/ngx'; +import { BrowserConfig } from './models/browser-config'; import { LaunchNavigator, LaunchNavigatorOptions -} from "@ionic-native/launch-navigator/ngx"; -import { Device } from "@ionic-native/device/ngx"; -import { ProgressLoadingService } from "../../ui/progressLoading/progress-loading.service"; -import { Observable, throwError } from "rxjs"; -import { SharedDataService } from "../shared-data-service/shared-data.service"; -import { Badge } from "@ionic-native/badge/ngx"; -import { LifeCycleService } from "../life-cycle/life-cycle.service"; -import { Diagnostic } from "@ionic-native/diagnostic/ngx"; +} from '@ionic-native/launch-navigator/ngx'; +import { Device } from '@ionic-native/device/ngx'; +import { ProgressLoadingService } from '../../ui/progressLoading/progress-loading.service'; +import { Observable, throwError } from 'rxjs'; +import { SharedDataService } from '../shared-data-service/shared-data.service'; +import { Badge } from '@ionic-native/badge/ngx'; +import { LifeCycleService } from '../life-cycle/life-cycle.service'; +import { Diagnostic } from '@ionic-native/diagnostic/ngx'; //import { CallNumber } from "@ionic-native/call-number/ngx"; -import { InAppBrowser } from "@ionic-native/in-app-browser/ngx"; +import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; @Injectable({ - providedIn: "root" + providedIn: 'root' }) export class CommonService { public static months_en_long = [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December' ]; public static months_en = [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec' ]; public static months_ar = [ - "يناير", - "فبراير", - "مارس", - "أبريل", - "مايو", - "يونيو", - "يوليو", - "أغسطس", - "سبتمبر", - "أكتوبر", - "نوفمبر", - "ديسمبر" + 'يناير', + 'فبراير', + 'مارس', + 'أبريل', + 'مايو', + 'يونيو', + 'يوليو', + 'أغسطس', + 'سبتمبر', + 'أكتوبر', + 'نوفمبر', + 'ديسمبر' ]; private progressLoaders: any[] = []; @@ -172,7 +172,7 @@ public getMonthNameAr(value: number): string { public round(value: number, decimal: number): string { const valueStr = value.toString(); - const dotIndex = valueStr.indexOf("."); + const dotIndex = valueStr.indexOf('.'); if (dotIndex >= 0) { return valueStr.toString().substr(0, dotIndex + decimal); @@ -186,13 +186,13 @@ public getMonthNameAr(value: number): string { var hours = Math.floor(sec_num / 3600); var minutes = Math.floor((sec_num - hours * 3600) / 60); var seconds = sec_num - hours * 3600 - minutes * 60; - var hoursString = ""; - var minutesString = ""; - var secondsString = ""; - hoursString = hours < 10 ? "0" + hours : hours.toString(); - minutesString = minutes < 10 ? "0" + minutes : minutes.toString(); - secondsString = seconds < 10 ? "0" + seconds : seconds.toString(); - return minutesString + ":" + secondsString; + var hoursString = ''; + var minutesString = ''; + var secondsString = ''; + hoursString = hours < 10 ? '0' + hours : hours.toString(); + minutesString = minutes < 10 ? '0' + minutes : minutes.toString(); + secondsString = seconds < 10 ? '0' + seconds : seconds.toString(); + return minutesString + ':' + secondsString; } public toastPK(page: string, key: string) { @@ -202,9 +202,9 @@ public getMonthNameAr(value: number): string { const toast = await this.toastController.create({ message: message, showCloseButton: true, - position: "middle", + position: 'middle', duration: 2000, - closeButtonText: this.ts.trPK("general", "close") + closeButtonText: this.ts.trPK('general', 'close') }); toast.present(); } @@ -213,9 +213,9 @@ public getMonthNameAr(value: number): string { async startLoadingOld() { this.stopLoading(); const loader = await this.loadingController.create({ - spinner: "bubbles", + spinner: 'bubbles', duration: 30000, - message: this.ts.trPK("error", "wait"), + message: this.ts.trPK('error', 'wait'), translucent: true }); this.progressLoaders.push(loader); @@ -228,7 +228,7 @@ public getMonthNameAr(value: number): string { */ this.stopLoading(); this.progressLoadingService.presentLoading( - this.ts.trPK("general", "loading") + this.ts.trPK('general', 'loading') ); } @@ -248,8 +248,8 @@ public getMonthNameAr(value: number): string { onAccept(); } }, - this.ts.trPK("general", "ok"), - this.ts.trPK("general", "alert"), + this.ts.trPK('general', 'ok'), + this.ts.trPK('general', 'alert'), message ); } @@ -257,10 +257,10 @@ public getMonthNameAr(value: number): string { public presentConfirmDialog(message: string, onAccept: any, onCancel?: any) { this.confirmAlertDialog( onAccept, - this.ts.trPK("general", "ok"), + this.ts.trPK('general', 'ok'), onCancel, - this.ts.trPK("general", "cancel"), - this.ts.trPK("general", "confirm"), + this.ts.trPK('general', 'cancel'), + this.ts.trPK('general', 'confirm'), message ); } @@ -268,8 +268,8 @@ public getMonthNameAr(value: number): string { public presentAcceptDialog(message: string, onAccept: any) { this.alertDialog( onAccept, - this.ts.trPK("general", "ok"), - this.ts.trPK("general", "confirm"), + this.ts.trPK('general', 'ok'), + this.ts.trPK('general', 'confirm'), message ); } @@ -279,8 +279,8 @@ public getMonthNameAr(value: number): string { () => { this.back(); }, - this.ts.trPK("general", "ok"), - this.ts.trPK("general", "info"), + this.ts.trPK('general', 'ok'), + this.ts.trPK('general', 'info'), message ); } @@ -288,9 +288,9 @@ public getMonthNameAr(value: number): string { this.openHome(); this.alertDialog( () => {}, - this.ts.trPK("general", "ok"), - this.ts.trPK("general", "info"), - this.ts.trPK("general", "not-allowed") + this.ts.trPK('general', 'ok'), + this.ts.trPK('general', 'info'), + this.ts.trPK('general', 'not-allowed') ); } @@ -301,14 +301,14 @@ public getMonthNameAr(value: number): string { ) { this.alertDialog( onClick, - this.ts.trPK("general", "ok"), - this.ts.trPK("general", "alert"), + this.ts.trPK('general', 'ok'), + this.ts.trPK('general', 'alert'), message ); } public userNeedToReLogin() { - this.presentAcceptDialog(this.ts.trPK("general", "relogin"), () => { + this.presentAcceptDialog(this.ts.trPK('general', 'relogin'), () => { this.sharedService.clearAll(); this.openLogin(); }); @@ -317,9 +317,9 @@ public getMonthNameAr(value: number): string { public showConnectionErrorDialog(onClick: any, okLabel: string) { this.alertDialog( onClick, - this.ts.trPK("general", "ok"), - this.ts.trPK("general", "alert"), - this.ts.trPK("general", "connError") + this.ts.trPK('general', 'ok'), + this.ts.trPK('general', 'alert'), + this.ts.trPK('general', 'connError') ); } @@ -327,15 +327,15 @@ public getMonthNameAr(value: number): string { this.alertDialog( onClick, okLabel, - this.ts.trPK("general", "alert"), - this.ts.trPK("general", "timeout") + this.ts.trPK('general', 'alert'), + this.ts.trPK('general', 'timeout') ); } async JustAlertDialog(acceptLabel: string, message: string) { this.clearAllAlerts(); const alert = await this.alertControllerIonic.create({ - header: this.ts.trPK("general", "info"), + header: this.ts.trPK('general', 'info'), message: message, buttons: [ { @@ -360,13 +360,13 @@ public getMonthNameAr(value: number): string { ) { this.clearAllAlerts(); const alert = await this.alertControllerIonic.create({ - header: this.ts.trPK("general", "confirm"), + header: this.ts.trPK('general', 'confirm'), message: message, buttons: [ { text: cancelLabel, - role: "cancel", - cssClass: "cancel-button", + role: 'cancel', + cssClass: 'cancel-button', handler: () => { if (onCancel) { onCancel(); @@ -399,7 +399,7 @@ public getMonthNameAr(value: number): string { ) { this.clearAllAlerts(); const alert = await this.alertControllerIonic.create({ - header: this.ts.trPK("general", "confirm"), + header: this.ts.trPK('general', 'confirm'), message: message, buttons: [ { @@ -433,7 +433,7 @@ public getMonthNameAr(value: number): string { message: message, buttons: [ { - text:this.ts.trPK("general", "ok"), + text:this.ts.trPK('general', 'ok'), handler: () => { if (onAccept) { onAccept(); @@ -476,7 +476,7 @@ public getMonthNameAr(value: number): string { ) { this.clearAllAlerts(); const alert = await this.alertControllerIonic.create({ - header: this.ts.trPK("general", "confirm"), + header: this.ts.trPK('general', 'confirm'), message: message, buttons: [ { @@ -492,7 +492,7 @@ public getMonthNameAr(value: number): string { }, { text: acceptLabel, - role: "Confirm", + role: 'Confirm', cssClass: "checkOutOkBtn", @@ -558,7 +558,7 @@ public getMonthNameAr(value: number): string { public clearAllAlerts() { // custom solutions because of async issue - const alerts = document.getElementsByTagName("ion-alert"); + const alerts = document.getElementsByTagName('ion-alert'); for (let i = 0; i < alerts.length; i++) { const alert = alerts[i]; alert.parentNode.removeChild(alert); @@ -566,15 +566,15 @@ public getMonthNameAr(value: number): string { } public getDeviceInfo(): string { - if (this.platform.is("mobile")) { - const os = this.platform.is("ios") ? "Iphone" : "android"; + if (this.platform.is('mobile')) { + const os = this.platform.is('ios') ? 'Iphone' : 'android'; return ( os + - " - " + + ' - ' + this.device.platform + - " - " + + ' - ' + this.device.version + - " , " + + ' , ' + this.device.manufacturer ); } else { @@ -583,19 +583,19 @@ public getMonthNameAr(value: number): string { } public getDeviceType(): string { - if (this.platform.is("mobile")) { + if (this.platform.is('mobile')) { // return "Mobile " + (this.platform.is("ios") ? "Iphone" : "android"); - return (this.platform.is("ios") ? "Iphone" : "android"); + return (this.platform.is('ios') ? 'Iphone' : 'android'); } else { - return "Desktop"; + return 'Desktop'; } } public validResponse(result: Response): boolean { if (result.MessageStatus === 1) { return true; } else if (result.MessageStatus === 2) { - return this.hasData(result["SameClinicApptList"]); + return this.hasData(result['SameClinicApptList']); } return false; } @@ -616,15 +616,15 @@ public getMonthNameAr(value: number): string { } private openBrowserHtml(url, onExit?, onFaild?, onSuccess?) { - const browser = window.open(url, "_blank", "location=no"); - browser.addEventListener("loadstart", () => {}); + const browser = window.open(url, '_blank', 'location=no'); + browser.addEventListener('loadstart', () => {}); - browser.addEventListener("loaderror", () => { + browser.addEventListener('loaderror', () => { if (onFaild) { onFaild(); } }); - browser.addEventListener("loadstop", () => { + browser.addEventListener('loadstop', () => { if (onSuccess) { onSuccess(); } @@ -641,14 +641,14 @@ public getMonthNameAr(value: number): string { this.platform.ready().then(() => { const browser = this.iab.create( url, - "_blank", - "closebuttoncolor=#60686b,hidenavigationbuttons=yes,hideurlbar=yes,zoom=no" + '_blank', + 'closebuttoncolor=#60686b,hidenavigationbuttons=yes,hideurlbar=yes,zoom=no' ); // browser.executeScript(...); // browser.insertCSS(...); - browser.on("loaderror").subscribe(event => { + browser.on('loaderror').subscribe(event => { if (onFaild) { onFaild(); } @@ -664,13 +664,13 @@ public getMonthNameAr(value: number): string { }); */ - browser.on("exit").subscribe(event => { + browser.on('exit').subscribe(event => { if (onExit) { onExit(); } }); - browser.on("loadstart").subscribe(event => { + browser.on('loadstart').subscribe(event => { if (successURLS) { successURLS.forEach((successURL, index) => { if (event.url && event.url.indexOf(successURL) >= 0) { @@ -687,7 +687,7 @@ public getMonthNameAr(value: number): string { } public imageFromBase64(base64: string) { - return "data:image/jpeg;base64," + base64; + return 'data:image/jpeg;base64,' + base64; } public openLocation(lat: number, lng: number) { @@ -696,24 +696,24 @@ public getMonthNameAr(value: number): string { () => {}, err => { // this.failedToOpenMap(); - window.open("https://maps.google.com/?q=" + lat + "," + lng); + window.open('https://maps.google.com/?q=' + lat + ',' + lng); } ); }); } private failedToOpenMap() { - this.presentAlert(this.ts.trPK("error", "map")); + this.presentAlert(this.ts.trPK('error', 'map')); } public localizeTime(date: Date) { if (!(date.getHours() == 0 && date.getMinutes() == 0)) { let h = date.getHours() % 12 || 12; - let hStr = h < 10 ? "0" + h : h; // leading 0 at the left for 1 digit hours + let hStr = h < 10 ? '0' + h : h; // leading 0 at the left for 1 digit hours const m = date.getMinutes(); - let mStr = m < 10 ? "0" + m : m; - return hStr + ":" + mStr + (date.getHours() < 12 ? " AM" : " PM"); + let mStr = m < 10 ? '0' + m : m; + return hStr + ':' + mStr + (date.getHours() < 12 ? ' AM' : ' PM'); } - return ""; + return ''; } public localizeDate(date: Date, time = false) { @@ -722,20 +722,20 @@ public getMonthNameAr(value: number): string { if (lng === TranslatorService.AR) { dateStr = CommonService.months_ar[date.getMonth()] + - " " + + ' ' + date.getDate() + - " " + + ' ' + date.getFullYear(); } else { dateStr = CommonService.months_en[date.getMonth()] + - " " + + ' ' + date.getDate() + - "," + + ',' + date.getFullYear(); } - return time ? dateStr + " " + this.localizeTime(date) : dateStr; + return time ? dateStr + ' ' + this.localizeTime(date) : dateStr; } public localizeMonth(monthIndex) { @@ -767,21 +767,21 @@ public getMonthNameAr(value: number): string { return ( date.getMonth() + 1 + - "/" + + '/' + date .getFullYear() .toString() .substr(2) ); } else { - return "--"; + return '--'; } } public convertISODateToJsonDate(isoDate: string): string { - return "/Date(" + Date.parse(isoDate) + ")/"; + return '/Date(' + Date.parse(isoDate) + ')/'; } public convertDateToJsonDate(date: Date): string { - return "/Date(" + date.getTime() + ")/"; + return '/Date(' + date.getTime() + ')/'; } /* @@ -790,13 +790,13 @@ public getMonthNameAr(value: number): string { */ public convertIsoDateToObject(isoDate: string, isoTime: string): Date { const date = new Date(isoDate); - const parts = isoTime.split(":"); + const parts = isoTime.split(':'); if (this.hasData(parts)) { // remove if numbers start with 0 let hrsStr = parts[0]; let msStr = parts[1]; - hrsStr = hrsStr[0] == "0" ? hrsStr.substr(1) : hrsStr; - msStr = msStr[0] == "0" ? msStr.substr(1) : msStr; + hrsStr = hrsStr[0] == '0' ? hrsStr.substr(1) : hrsStr; + msStr = msStr[0] == '0' ? msStr.substr(1) : msStr; date.setHours(Number(hrsStr)); date.setMinutes(Number(msStr)); } @@ -824,9 +824,9 @@ public getMonthNameAr(value: number): string { public getDateISO(date: Date): string { return ( date.getFullYear().toString() + - "-" + + '-' + this.trailerZero(date.getMonth() + 1) + - "-" + + '-' + this.trailerZero(date.getDate()) ); } @@ -838,19 +838,19 @@ public getMonthNameAr(value: number): string { public getTimeISO(date: Date): string { return ( this.trailerZero(date.getHours()) + - ":" + + ':' + this.trailerZero(date.getMinutes()) + - ":00" + ':00' ); } public getDateTimeISO(date: Date): string { - return this.getDateISO(date) + " " + this.getTimeISO(date); + return this.getDateISO(date) + ' ' + this.getTimeISO(date); } public getDateTimeISOFromString(dateStr: string): string { const date = this.evaluteDateAsObject(dateStr); - return this.getDateTimeISO(date) + " " + this.getTimeISO(date); + return this.getDateTimeISO(date) + ' ' + this.getTimeISO(date); } public getCurrentTimeISO(): string { @@ -859,7 +859,7 @@ public getMonthNameAr(value: number): string { private trailerZero(value: number): string { const str = value.toString(); - return str.length > 1 ? str : "0" + str; + return str.length > 1 ? str : '0' + str; } public hasData(array: any[]): boolean { @@ -883,13 +883,13 @@ public getMonthNameAr(value: number): string { } } } - return startIndex ? message.substring(startIndex, endIndex) : ""; + return startIndex ? message.substring(startIndex, endIndex) : ''; } return null; } public inNumberRange(targetCode: number): boolean { - const minDigit = "0".charCodeAt(0); - const maxDigit = "9".charCodeAt(0); + const minDigit = '0'.charCodeAt(0); + const maxDigit = '9'.charCodeAt(0); return targetCode >= minDigit && targetCode <= maxDigit; } @@ -911,24 +911,24 @@ public getMonthNameAr(value: number): string { title?: string ) { this.smsAlertDialog = await this.alertControllerIonic.create({ - header: title || this.ts.trPK("general", "enter-sms-code"), + header: title || this.ts.trPK('general', 'enter-sms-code'), inputs: [ { - name: "sms", - type: "number", + name: 'sms', + type: 'number', value: smsCode, - placeholder: this.ts.trPK("general", "enter-sms") + placeholder: this.ts.trPK('general', 'enter-sms') } ], buttons: [ { - text: this.ts.trPK("general", "cancel"), - role: "cancel", - cssClass: "cancel-button", + text: this.ts.trPK('general', 'cancel'), + role: 'cancel', + cssClass: 'cancel-button', handler: () => {} }, { - text: this.ts.trPK("general", "ok"), + text: this.ts.trPK('general', 'ok'), handler: data => { onAccept(data.sms); } @@ -1031,8 +1031,8 @@ public getMonthNameAr(value: number): string { } const dataSets = [ - this.getGraphDataSet(this.ts.trInline(title1), series1, "#d12026"), - this.getGraphDataSet(this.ts.trInline(title2), series2, "#60686b") + this.getGraphDataSet(this.ts.trInline(title1), series1, '#d12026'), + this.getGraphDataSet(this.ts.trInline(title2), series2, '#60686b') ]; return this.getGraphMultiSeries(labels, dataSets); } @@ -1048,7 +1048,7 @@ public getMonthNameAr(value: number): string { } public isHtml5VideoSupported(): boolean { - const v = document.createElement("video"); + const v = document.createElement('video'); if (v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')) { return true; } @@ -1062,7 +1062,7 @@ public getMonthNameAr(value: number): string { } public isCordova(): boolean { - return this.platform.is("cordova"); + return this.platform.is('cordova'); } public pageRevisited(pageName: string): Observable { @@ -1077,118 +1077,132 @@ public getMonthNameAr(value: number): string { } public openEitListPage() { - this.nav.navigateForward(["/eit/eit-list"]); + this.nav.navigateForward(['/eit/eit-list']); } public openAddEitPage() { - this.nav.navigateForward(["/eit/add-eit"]); + this.nav.navigateForward(['/eit/add-eit']); } public openConfirmEitPage() { - this.nav.navigateForward(["/eit/confirm-add-eit"]); + this.nav.navigateForward(['/eit/confirm-add-eit']); } public openHome() { - this.nav.navigateRoot(["/home"]); + this.nav.navigateRoot(['/home']); } public openForgotPassword() { - this.nav.navigateForward(["/authentication/forgot"]); + this.nav.navigateForward(['/authentication/forgot']); } public openChangePassword() { - this.nav.navigateForward(["/authentication/changepassowrd"]); + this.nav.navigateForward(['/authentication/changepassowrd']); } public openProfile() { - this.nav.navigateForward(["/profile/home"]); + this.nav.navigateForward(['/profile/home']); } public openEditProfile() { this.nav.navigateForward(["/profile/editprofile"]); } public openAccuralPage() { - this.nav.navigateForward(["/accrual-balances/home"]); + this.nav.navigateForward(['/accrual-balances/home']); } public openEITPage() { - this.nav.navigateForward(["/eit/homepage"]); + this.nav.navigateForward(['/eit/homepage']); } public openMyTeamPage() { - this.nav.navigateForward(["/my-team/home"]); + console.log('someeeeeeee'); + this.nav.navigateForward(['/my-team/home']); + } + public openMyTeamDetailPage() { + this.nav.navigateForward(['/my-team/details']); } - public static myTeamDetailUrl =["/my-team/details","/my-team/details-2"] + + public openPage(link: string) { + this.nav.navigateForward([link]); + } + public static myTeamDetailUrl =['/my-team/details','/my-team/details-2'] public openMyTeamDetails() { - this.alternateNavigate(CommonService.myTeamDetailUrl,"teamDetail-open",true); + this.alternateNavigate(CommonService.myTeamDetailUrl,'teamDetail-open',true); // this.nav.navigateForward(["/my-team/details"]); } public openAbsencePage() { - this.nav.navigateForward(["/absence/home"]); + this.nav.navigateForward(['/absence/home']); } public openSubmitAbsencePage() { - this.nav.navigateForward(["/absence/submit-absence"]); + this.nav.navigateForward(['/absence/submit-absence']); } public openConfirmAbsece() { - this.nav.navigateForward(["/absence/confirm-absence"]); + this.nav.navigateForward(['/absence/confirm-absence']); } public openWorkListAttachViewPage() { - this.nav.navigateForward(["/notification/work-list-attach-view"]); + this.nav.navigateForward(['/notification/work-list-attach-view']); } public openviewAbsenceAttachment() { - this.nav.navigateForward(["/absence/view-attachements"]); + this.nav.navigateForward(['/absence/view-attachements']); } public openNotificationPage() { - this.nav.navigateForward(["/notification/homepage"]); + this.nav.navigateForward(['/notification/homepage']); } public openWorklistMainPage() { - this.nav.navigateForward(["/notification/worklist-main"]); + this.nav.navigateForward(['/notification/worklist-main']); } public openWorklistMainPRPage() { - this.nav.navigateForward(["/notification/worklist-main-PR"]); + this.nav.navigateForward(['/notification/worklist-main-PR']); } public openWorklistMainPOPage() { - this.nav.navigateForward(["/notification/worklist-main-PO"]); + this.nav.navigateForward(['/notification/worklist-main-PO']); } public openWorklistReplacementRollPage() { - this.nav.navigateForward(["/notification/work-list-replacement-roll"]); + this.nav.navigateForward(['/notification/work-list-replacement-roll']); } public openNotificationDetailsPage() { - this.nav.navigateForward(["/notification/work-list-details"]); + this.nav.navigateForward(['/notification/work-list-details']); } public openWorklistHistoryPage() { - this.nav.navigateForward(["/notification/work-list-action-history"]); + this.nav.navigateForward(['/notification/work-list-action-history']); } public openWorklistAttachPage() { - this.nav.navigateForward(["/notification/work-list-attach"]); + this.nav.navigateForward(['/notification/work-list-attach']); } public openWorklistRFCPage() { - this.nav.navigateForward(["/notification/work-list-rfc"]); + this.nav.navigateForward(['/notification/work-list-rfc']); } public openWorklistRollReplacement() { - this.nav.navigateForward(["/notification/work-list-replacement-roll"]); + this.nav.navigateForward(['/notification/work-list-replacement-roll']); } public openItemHistoryPage() { - this.nav.navigateForward(["/notification/item-history-PO"]); + this.nav.navigateForward(['/notification/item-history-PO']); } public openQutationAnalysisPage() { - this.nav.navigateForward(["/notification/qutation-analysis-PO"]); + this.nav.navigateForward(['/notification/qutation-analysis-PO']); } public openWorklistMainMRPage() { - this.nav.navigateForward(["/notification/worklist-main-MR"]); + this.nav.navigateForward(['/notification/worklist-main-MR']); + } + public openWorklistITGPage() { + this.nav.navigateForward(['/notification/worklist-main-ITG']); } public openMySpecialistPage() { - this.nav.navigateForward(["/my-specialist/home"]); + this.nav.navigateForward(['/my-specialist/home']); } public openMySubordinatePage() { - this.nav.navigateForward(["/my-subordinate/home"]); + this.nav.navigateForward(['/my-subordinate/home']); } public openChangeImagePage() { - this.nav.navigateForward(["/profile/profileImg"]); + this.nav.navigateForward(['/profile/profileImg']); } public openPayslipPage() { - this.nav.navigateForward(["/payslip/home"]); + this.nav.navigateForward(['/payslip/home']); + } + public openTimeCardPage() { + this.nav.navigateForward(["/time-card/time-card-details"]); } public openEarningsPage() { - this.nav.navigateForward(["/payslip/Earnings"]); + this.nav.navigateForward(['/payslip/Earnings']); } public openDeductionsPage() { - this.nav.navigateForward(["/payslip/Deductions"]); + this.nav.navigateForward(['/payslip/Deductions']); } public openConfirmLoginPage() { - this.nav.navigateForward(["/authentication/confirmLogin"]); + this.nav.navigateForward(['/authentication/confirmLogin']); } public openEditprofile() { this.nav.navigateForward(["/profile/editProfile"]); @@ -1198,8 +1212,12 @@ public getMonthNameAr(value: number): string { } + public navigatePage(path) { + this.nav.navigateForward([path]); + } + public reload(url: string, from: string) { - console.log("force reload called from:" + from); + console.log('force reload called from:' + from); // window.location.reload(); location.href = url; } @@ -1223,11 +1241,11 @@ public getMonthNameAr(value: number): string { private alternateNavigate(paths: string[], key: string, root = false) { let url: string; - if (localStorage.getItem(key) === "yes") { - localStorage.setItem(key, "no"); + if (localStorage.getItem(key) === 'yes') { + localStorage.setItem(key, 'no'); url = paths[0]; } else { - localStorage.setItem(key, "yes"); + localStorage.setItem(key, 'yes'); url = paths[1]; } if (root) { @@ -1238,14 +1256,14 @@ public getMonthNameAr(value: number): string { } public openLogin() { - this.nav.navigateRoot(["/authentication/login"]); + this.nav.navigateRoot(['/authentication/login']); } public openUserForgot() { - this.nav.navigateForward(["/authentication/checkuser"]); + this.nav.navigateForward(['/authentication/checkuser']); } public openSMSPage() { - this.nav.navigateForward(["/authentication/smspage"]); + this.nav.navigateForward(['/authentication/smspage']); } public navigateTo(url: string) { @@ -1281,11 +1299,11 @@ public getMonthNameAr(value: number): string { if (state == this.diagnostic.bluetoothState.POWERED_ON) { feedback(); } else { - this.presentAlert(this.ts.trPK("bluetooth", "start")); + this.presentAlert(this.ts.trPK('bluetooth', 'start')); } }) .catch(e => { - this.presentAlert(this.ts.trPK("bluetooth", "start")); + this.presentAlert(this.ts.trPK('bluetooth', 'start')); }); }); } @@ -1315,7 +1333,7 @@ public getMonthNameAr(value: number): string { } for (i = 0; i < list.length; i += 1) { node = list[i]; - if (node.PARENT_MENU_NAME !== "") { + if (node.PARENT_MENU_NAME !== '') { // if you have dangling branches check that map[node.parentId] exists list[map[node.PARENT_MENU_NAME]].children.push(node); } else { @@ -1327,8 +1345,8 @@ public getMonthNameAr(value: number): string { public reverseFormatDate(date) { let FormatedDate; if (date) { - FormatedDate = date.replace(/\//g, "-"); - FormatedDate = FormatedDate.replace(/ 00:00:00/g, ""); + FormatedDate = date.replace(/\//g, '-'); + FormatedDate = FormatedDate.replace(/ 00:00:00/g, ''); } else { FormatedDate = date; } @@ -1337,7 +1355,7 @@ public getMonthNameAr(value: number): string { public formatStandardDate(date) { let FormatedDate; if (date) { - FormatedDate = date.replace(/-/g, "/"); + FormatedDate = date.replace(/-/g, '/'); } else { FormatedDate = date; } @@ -1346,7 +1364,7 @@ public getMonthNameAr(value: number): string { public reverseFormatStandardDate(date) { let FormatedDate; if (date) { - FormatedDate = date.replace(/\//g, "-"); + FormatedDate = date.replace(/\//g, '-'); } else { FormatedDate = date; } @@ -1358,8 +1376,8 @@ public getMonthNameAr(value: number): string { if (date) { date = date.slice(0, 10); - FormatedDate = date.replace(/-/g, "/"); - FormatedDate = FormatedDate + " 00:00:00"; + FormatedDate = date.replace(/-/g, '/'); + FormatedDate = FormatedDate + ' 00:00:00'; } else { FormatedDate = date; } @@ -1371,8 +1389,8 @@ public getMonthNameAr(value: number): string { console.log(date); if (date) { // FormatedDate = date.replace(/-/g, "/"); - FormatedDate = date.split("T")[0]; - FormatedDate = FormatedDate + " 00:00:00"; + FormatedDate = date.split('T')[0]; + FormatedDate = FormatedDate + ' 00:00:00'; console.log(FormatedDate); } else { FormatedDate = date; @@ -1381,12 +1399,12 @@ public getMonthNameAr(value: number): string { } public setUpdateImage (image){ - console.log("setUpdateImage"); + console.log('setUpdateImage'); this.setUpdateImg=image; this.updateImage=true; } public getUpdateImage(){ - console.log("getUpdateImage"); + console.log('getUpdateImage'); const objImg={ img: this.setUpdateImg, status: this.updateImage diff --git a/Mohem/src/app/hmg-common/services/dashbored/AttensanceTrackingList.ts b/Mohem/src/app/hmg-common/services/dashbored/AttensanceTrackingList.ts index b5083234..4e238e58 100644 --- a/Mohem/src/app/hmg-common/services/dashbored/AttensanceTrackingList.ts +++ b/Mohem/src/app/hmg-common/services/dashbored/AttensanceTrackingList.ts @@ -7,4 +7,9 @@ export class AttendanceTrackingList { public P_SCHEDULED_HOURS: string; public P_SHT_NAME: string; public P_SPENT_HOURS: string; + public P_BREAK_HOURS: string; + public P_LATE_IN_HOURS: string; + public P_SWIPES_EXEMPTED_FLAG: string; + public P_SWIPE_IN: string; + public P_SWIPE_OUT: string; } diff --git a/Mohem/src/app/hmg-common/services/dashbored/dashbored.service.ts b/Mohem/src/app/hmg-common/services/dashbored/dashbored.service.ts index 21fc550f..587aeee6 100644 --- a/Mohem/src/app/hmg-common/services/dashbored/dashbored.service.ts +++ b/Mohem/src/app/hmg-common/services/dashbored/dashbored.service.ts @@ -66,8 +66,8 @@ export class DashboredService { oerrorLable ); } -public getAttendanceTracking(onError ?: any ,oerrorLable ?: any): Observable{ - const request = new Request(); +public getAttendanceTracking(selectedEmployee: any, onError ?: any , oerrorLable ?: any): Observable{ + const request = selectedEmployee; this.authService.authenticateRequest(request); return this.con.post( DashboredService.attendancetrackingUrl, diff --git a/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest.ts b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest.ts index 740656b8..858449b3 100644 --- a/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest.ts +++ b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest.ts @@ -2,6 +2,9 @@ import { Request } from '../../../services/models/request' export class GetSubordinatesAttdStatusRequest extends Request{ //public static SHARED_DATA = ''; - public P_SCHEDULE_DATE_FROM :any; - public P_SCHEDULE_DATE_TO :any; + public P_SCHEDULE_DATE_FROM: any; + public P_SCHEDULE_DATE_TO: any; + public SearchMonth: string; + public SearchYear: number; + } \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest.ts b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest.ts index 30a4befd..378cc5e6 100644 --- a/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest.ts +++ b/Mohem/src/app/hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest.ts @@ -4,5 +4,5 @@ export class GetSubordinatesLeavesRequest extends Request{ //public static SHARED_DATA = ''; public P_DATE_FROM :any; public P_DATE_TO :any; - + public P_SELECTED_EMPLOYEE_NUMBER:any; } \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/services/push/push.service.ts b/Mohem/src/app/hmg-common/services/push/push.service.ts index 0a0bf4d5..9b9dcc79 100644 --- a/Mohem/src/app/hmg-common/services/push/push.service.ts +++ b/Mohem/src/app/hmg-common/services/push/push.service.ts @@ -43,6 +43,7 @@ export class PushService { ) { } public startReceiving() { + console.log("startReceiving"); // this.processStartReceiving(); this.processStartReceivingWithFirebase(); } @@ -161,10 +162,11 @@ export class PushService { } private registerInBackend(data: any) { - console.log('firebasex Token ID: ' + data); + console.log('firebasex Token ID: ' + data); if (data) { this.cs.sharedService.setSharedData(data, AuthenticationService.DEVICE_TOKEN); localStorage.setItem('deviceToken', data); + } if (this.authService.isAuthenticated()) { this.registerAuthenticatedUser(data); @@ -216,14 +218,22 @@ export class PushService { private processStartReceivingWithFirebase() { + console.log("processStartReceivingWithFirebase"); + this.firebasex.getToken().then(token => { - console.log(token); - this.registerInBackend(token); - }); - this.firebasex.onTokenRefresh().subscribe(token => { - console.log(token); + alert("token: "+ token); this.registerInBackend(token); - }); + }).catch(error => console.error('Error getting token', error)); + + + // this.firebase.getToken() + // .then(token => console.log(`The token is ${token}`)) + // .catch(error => console.error('Error getting token', error)); + + // this.firebasex.onTokenRefresh().subscribe(token => { + // alert("token: "+ token); + // this.registerInBackend(token); + // }); } public onPushReceived(payload: any) { @@ -240,4 +250,7 @@ export class PushService { + + + } diff --git a/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.scss b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.scss index 14151600..18ee0a3a 100644 --- a/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.scss +++ b/Mohem/src/app/hmg-common/ui/accordin-custom/accordin-tab-custom/accordin-tab-custom.component.scss @@ -49,9 +49,9 @@ text-overflow: ellipsis; white-space: nowrap; overflow: hidden !important; - font-size: 0.46cm; + font-size: 16px; width: 78%; - font-weight: bold; + font-weight: bold !important; } diff --git a/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.html b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.html new file mode 100644 index 00000000..fb3f1a49 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.html @@ -0,0 +1,5 @@ +
+
+ {{value}} + {{text}} +
diff --git a/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.scss b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.scss new file mode 100644 index 00000000..1c67af05 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.scss @@ -0,0 +1,33 @@ +.main-container{ + width: 72px; + background-color: white; + padding: 10px; + border-radius: 20px; + height: 70px; + text-align: right; + font-family: WorkSans-Regular; + padding-top: 25px; + box-shadow: 0 0 6px rgba(0,0,0,0.16); + position: relative; +} +.main-container-radius{ + // content: ""; + position: absolute; + width: 30px; + height: 6px; + border-radius: 10px; + background-color: red; + left: 10px; + top: 10px; +} +.number-span{ + font-size: 19px; + display: block; + line-height: 18px; +} + +.text-span{ + font-size: 14px; + color: #888; + margin: -1px; +} diff --git a/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.spec.ts b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.spec.ts new file mode 100644 index 00000000..37e7805b --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CardFilterComponent } from './card-filter.component'; + +describe('CardFilterComponent', () => { + let component: CardFilterComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CardFilterComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CardFilterComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.ts b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.ts new file mode 100644 index 00000000..c414bc98 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/card-filter/card-filter.component.ts @@ -0,0 +1,18 @@ +import { Component, OnInit, Input } from '@angular/core'; + +@Component({ + selector: 'app-card-filter', + templateUrl: './card-filter.component.html', + styleUrls: ['./card-filter.component.scss'], +}) +export class CardFilterComponent implements OnInit { + @Input() value: number; + @Input() text: string; + @Input() active: boolean; + @Input() color: string; + + constructor() { } + + ngOnInit() {} + +} diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.html b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.html new file mode 100644 index 00000000..48c55d3e --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.html @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.scss b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.scss new file mode 100644 index 00000000..f265cb6e --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.scss @@ -0,0 +1,124 @@ + + + +// .modalCss .modal-Wrapper { +// width: 600px; +// height: 300px; +// } + +.chart-modal .modal-Wrapper { + --background: rgb(116, 108, 108) !important; + --border-color:white!important ; + width: 85%!important ; + height: 40px !important ; + + } + + .navbar{ + font-size: 10px !important; + --background: #22C6B3 !important; + color: aliceblue !important; +// margin-top: 10px !important; + + } + + .menu{ + // margin-left:330px !important; + margin-top: 0px !important; + font-size: 35px !important; + background: #22C6B3; + color: aliceblue; + margin-left: 0px !important; + + } + + .person{ + + margin-left:100px !important; + margin-top: 0px !important; + font-size: 23px !important; + background: #22C6B3 !important; + color: aliceblue !important; + + } + + .grid{ +margin-bottom: 550px !important; +margin-top: 20px !important; +margin-left: 15px !important; +margin-right: 15px !important; +background-color:white !important; +border-radius: 20px !important; +height: 250px !important; + } + +.ionSliders{ + margin: 0px !important; + padding: 0px !important; + +} + + + .ionSlide{ + margin-top: 5px !important; + margin-left: 190px !important; + color: black !important; + + } + .dateLable{ + + margin-left: 90px !important; + color: black !important; + font-size: small !important; + margin-top: 15px !important; + } +// h1{ +// font-size: 15px !important; +// text-align: center !important; +// } +.arrowDropright{ + margin-left:100px !important; + font-size: 20px !important; + color: rgb(168, 165, 165) !important; + margin-top: 15px !important; + +} +.arrowDropleft{ + font-size: 20px !important; + margin-left: 10px !important; + margin-top: 15px !important; + color: rgb(116, 108, 108) !important; +} + + .ionLable{ + font-size: 10px !important; + } + + .number{ + + font-size: 18px !important; + font-weight: bolder !important; + color: black !important; + } + + .header-div{ + background:var(--primary); + background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); + background: -webkit-linear-gradient(45deg, (--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); + background: #22C6B3; + // background: linear-gradient(90deg, #85C48D 0%, #85C48D 13%, #2BB5C6 98%, #2BB5C6 100%); + color:var(--light); + text-transform: capitalize; + + display: block; + position: relative; + height: 210px; + margin-bottom:60px; + // border-radius: 0px 0px 70px 70px; + } + + .advanced-search-modal { + --height: 12cm !important; + --width: 80% !important; + --border-radius: 0.4cm; + } \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.spec.ts b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.spec.ts new file mode 100644 index 00000000..7e402bac --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CircleCalendarComponent } from './circle-calendar.component'; + +describe('CircleCalendarComponent', () => { + let component: CircleCalendarComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CircleCalendarComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CircleCalendarComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.ts b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.ts new file mode 100644 index 00000000..c664d3dc --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/circle-calendar.component.ts @@ -0,0 +1,149 @@ +import { Component, OnInit, Output, Input, ViewChild, ElementRef, EventEmitter } from '@angular/core'; +import { TimeSlot } from './time.slot'; +import { SharedDataService } from '../../services/shared-data-service/shared-data.service'; +import { ModalController } from '@ionic/angular'; +import { DateInfoModalComponent } from './date-info-modal/date-info-modal.component'; +import { MenuResponse } from '../../services/menu/models/menu-response'; +import * as moment from 'moment'; +import { CommonService } from '../../services/common/common.service'; +import { GetDayAndHoursDetailsRequest } from 'src/app/time-card/service/models/get-day-hours-type-details.request'; +import { TimeCardService } from 'src/app/time-card/service/time-card.service'; +import { GetShiftDetailRequest } from 'src/app/time-card/service/models/get-shift-detail.request'; +import { GetSwipesRequest } from 'src/app/time-card/service/models/get-swipes-request'; + +@Component({ + selector: 'app-circle-calendar', + templateUrl: './circle-calendar.component.html', + styleUrls: ['./circle-calendar.component.scss'] +}) +export class CircleCalendarComponent implements OnInit { + + @Input() eventsdateDayOff: any = []; + @Input() eventsdateAttend: any = []; + @Input() eventsdateAbsent: any = []; + @Input() normalDays: any = []; + @Input() dayHoursTypeDetailsList: any = []; + @Input() currentDateParent: string; + @Output() monthTitle = new EventEmitter(); + @Output() currentYear = new EventEmitter(); + + public monthName: any; + public yearDate: any; + public selEmp: string; + public selMenu: MenuResponse = new MenuResponse(); + public respID: number; + public menuType: any; + public dayAndHoursPageNumber = 1; + public selectedFilters: any = {}; + public selectedShiftFilter: any; + public arrDaysAttendance: any = []; + public arrDaysAbsent: any = []; + public arrDaysOff: any = []; + public selectedShift: any; + public shiftDetailsData: any = []; + public swipeDetailsData: any = []; + public arrOfAllList: any = []; + eventsdata: any = []; + + public calendar = { + mode: 'month' + }; + + public currentAvailableAppoDate: any; + public eventsInput: any = []; + public events: TimeSlot[] = []; + public selectedTime: string; + public selectedDate: string; + public weekDaysEn = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; + public weekDaysEnSort = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; + public lockSwipeToPrev: any = true; + public currentDate: any; + public selectedDateObject: any; + public currentDateToSwipe: any; + public activeMonth: any; + public isFirst = false; + public selectedIndexData: any; + arrFutrueDays: any; + eventsdateFutrue: any; + detailData: any; + constructor( + public sharedData: SharedDataService, + public mod: ModalController, + public common: CommonService, + public timeCardService: TimeCardService) { } + @ViewChild('slider') slides: ElementRef; + + ngOnInit() { + this.reRenderCalendar(); + console.log(this.currentDateParent); + } + + // tslint:disable-next-line: use-life-cycle-interface + ngAfterViewInit() { + setTimeout(() => { + this.reRenderCalendar(); + }, 1000); + } + + reRenderCalendar() { + this.renderDate(this.eventsdateAbsent, 'absent'); + this.renderDate(this.eventsdateAttend, 'present'); + this.renderDate(this.eventsdateDayOff, 'dayoff'); + this.renderDate(this.normalDays, 'scheduleDay'); + } + + public async dateModal(shiftDetails) { + const modal = await this.mod.create({ + component: DateInfoModalComponent, + showBackdrop: true, + backdropDismiss: true, + componentProps: { + TODAYDATE: this.selectedIndexData, + SHIFTDETAILS: shiftDetails + } + }); + modal.cssClass = 'calendar-modal'; + await modal.present(); + } + + public renderDate(arrayDays, cssClass) { + const td = document.querySelectorAll('.swiper-slide-active .monthview-datetable td:not(.text-muted)'); + arrayDays.forEach(dateObj => { + const date = dateObj.startTime; + td.forEach(element => { + // tslint:disable-next-line: triple-equals + if (date.getDate() == element.textContent.trim()) { + element.classList.add(cssClass); + } + }); + }); + } + + onDayClicked(event) { + if (this.isFirst) { + console.log(event.selectedTime.getDate()); + const selectedIndex = event.selectedTime.getDate(); + this.selectedIndexData = this.dayHoursTypeDetailsList[selectedIndex - 1]; + if (this.selectedIndexData.present) { + const rtpID = this.selectedIndexData.RTP_ID; + this.getScheduleShiftDetails(rtpID); + } + } else { + this.isFirst = true; + } + } + + getScheduleShiftDetails(RTP_ID) { + const GetShiftDetailRequestObject = new GetShiftDetailRequest(); + GetShiftDetailRequestObject.P_RTP_ID = RTP_ID; + GetShiftDetailRequestObject.P_PAGE_NUM = 1; + GetShiftDetailRequestObject.P_PAGE_LIMIT = 10; + this.timeCardService.getShiftDetail(GetShiftDetailRequestObject).subscribe((result) => { + if (this.common.validResponse(result)) { + console.log(result); + this.shiftDetailsData = result.GetScheduleShiftsDetailsList; + this.dateModal(result); + } + }); + } +} diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.html b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.html new file mode 100644 index 00000000..5c57f654 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.html @@ -0,0 +1,104 @@ + + + + + + +
+
+
+

{{percentage}}

+ Completed



+
+ +
+
+
+ +
+ +

{{nameDay}}

+
+ +

{{day}}

+
+ +

{{nameMonth}}

+
+ +

{{year}}

+
+ +

{{ts.trPK('attendance','present')}}

+
+
+
+
+
+ +
+ + + +

{{shiftTime}}

+ +

{{ts.trPK('attendance-tracking','shift-time')}}

+
+
+ +

{{scheduled}}

+ +

{{ts.trPK('attendance-tracking','regular')}}

+
+
+
+ + +

{{startDate}}

+ +

{{ts.trPK('attendance-tracking','check-in')}}

+
+
+ +

{{endDate}}

+ +

{{ts.trPK('attendance-tracking','check-out')}}

+
+
+
+ + +

{{lateIn}}

+ +

{{ts.trPK('attendance-tracking','late-in')}}

+
+
+ +

{{excess}}

+ +

{{ts.trPK('attendance-tracking','excess')}}

+
+
+
+ + +

{{shortage}}

+ +

{{ts.trPK('attendance-tracking','shortage')}}

+
+
+ +

{{earlyOut}}

+ +

{{ts.trPK('attendance-tracking','early-out')}}

+
+
+
+ +
+
+ + + diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.scss b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.scss new file mode 100644 index 00000000..53ea08a2 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.scss @@ -0,0 +1,180 @@ +.result-text-container { + + // padding: 0; + + // margin: 0; + + // position: absolute; + + // left: 50%; + + // top: 50%; + + // display: block; + + // text-align: center; + + // transform: translate(-50%, -50%); +//////////////////////////here + padding: 0; + margin: 0; + position: absolute; + left: 58%; + top: 67%; + display: block; + text-align: center; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + + h2 { + + font-size: 25px; + + // font-family: WorkSans-Bold; + font-weight: bold; + + margin: 0 auto; + + line-height: 36px; + + } + + span { + + width: 125px; + + display: block; + + margin: 0 auto; + + font-size: 12px; + + font-family: workSans-Regular; + color: rgb(163, 163, 163) !important; + } +} + +.today-graph{ + display: block; + height: 127px; + width: 288px; +} +.amountlabel{ + color: black !important; + font-weight: bold !important; + font-size: 13px !important; +// border-top: 1px solid rgb(163, 163, 163) !important; + margin-left: 0px !important; + margin-bottom: -29px !important; +} + .rowlabel{ +color: rgb(163, 163, 163) !important; +font-size: 13px !important; +font-family: WorkSans-Bold; + } + .grid{ +padding-bottom: -20px !important; +padding-top: -20px !important; +height: 360px !important; + + } + .liftcol{ + // padding-top: 1px !important; + // padding-bottom: 1px !important; + border-right: 1px solid rgb(163, 163, 163) !important; + } + + .rightcol{ + + margin-left: 5px !important; + } + .gridrow{ + border-top: 1px solid rgb(163, 163, 163) !important; + margin-left: 19px; + margin-right: 12px; + } + + .div{ + // border: 1px solid #a3a3a3 !important; + // text-align: center; + // width: 274%; + // border-radius: 8%; + // height: 40%; + // margin-right: -11px; + border: 1px solid #a3a3a3 !important; + border-radius: 9px; + width: 241%; + margin-right: -226px; + + + } + .p0{ + margin-bottom: -13px !important; + color: black !important; + font-weight: bold !important; + font-size: 15px !important; + margin-top: 8px; + text-align: center; + display: block; + width: 100%; + } + .p1{ + margin-bottom: -7px !important; + color: black !important; + font-family: WorkSans-Bold !important; + font-size: 33px; + margin-top: 10px; + text-align: center; + display: block; + width: 100%; + } + .p2{ font-weight: bold !important; + font-size: 17px !important; + margin-bottom: 43px !important; + margin-top: 0px !important; + color: black !important; + font-weight: bold !important; + margin-left: 33px; + } + .p3{ /* margin-bottom: -72px !important; */ + color: black !important; + font-weight: bold !important; + font-size: 19px; + margin-top: -43px; + margin-left: 27px; + } + .p4{ margin-bottom: 56px !important; + margin-top: -26px !important; + color: black !important; + } + // .pdiv{background-color: gray;height: 26px;} + .p5{ + font-size: 14px; + text-align: center; + background-color: #094875; + color: white; + margin-top: -13px; + margin-bottom: -3px; + height: 21px; + width: 110px; + padding-top: 7px; + /* font-family: WorkSans-Bold !important; */ + padding-bottom: 21px; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; + } + // .less{ background-color: #22C6B3; + // background-color: #22C6B3; + // border: none; + // color: white; + // text-align: center; + // text-decoration: none; + // display: inline-block; + // font-size: 12px; + // border-radius: 30px; + // height: 26px; + // padding: 6px 24px; + // margin-left: 123px; + // /* margin-top: -19px; */ + // margin-bottom: 17px; + // } \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.spec.ts b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.spec.ts new file mode 100644 index 00000000..ffb04f8b --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DateInfoModalComponent } from './date-info-modal.component'; + +describe('DateInfoModalComponent', () => { + let component: DateInfoModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DateInfoModalComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DateInfoModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.ts b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.ts new file mode 100644 index 00000000..6bee539f --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/date-info-modal/date-info-modal.component.ts @@ -0,0 +1,138 @@ +import { Component, OnInit, Input, ViewChild } from '@angular/core'; +import { ModalController, NavParams, IonInfiniteScroll } from '@ionic/angular'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { IonSlides } from '@ionic/angular'; + +@Component({ + selector: 'app-date-info-modal', + templateUrl: './date-info-modal.component.html', + styleUrls: ['./date-info-modal.component.scss'], +}) +export class DateInfoModalComponent implements OnInit { + @ViewChild('slides') slides: IonSlides; + [x: string]: any; + gaugeType = 'full'; + gaugeValue = 28.3; + gaugeLabel = 'Days'; + @Input() TODAYDATE: any; + @Input() SHIFTDETAILS: any; + today: any; + month: any; + monthDate: any; + excess: any; + shortage: any; + lateIn: any; + scheduled: any; + earlyOut: any; + shiftTime: any; + startDate: any; + endDate: any; + shift: any; + percentage: any; + data: any; + scheduleDate: any; + tests: any; + year: any; + nameMonth: any; + nameDay: any; + public weekDaysEn = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; + + public options = { + cutoutPercentage: 85, + tooltips: { enabled: false }, + legend: { display: false } + }; + + public slideOptsOne = { + slidesPerView: 1, + spaceBetween: 0 + }; + + constructor( + public modalController: ModalController, + public navParams: NavParams, + public ts: TranslatorService + ) { } + + ngOnInit() { + console.log(this.TODAYDATE); + this.excess = this.TODAYDATE.EXCESS_HRS; + this.lateIn = this.TODAYDATE.LATE_IN_HRS; + this.shortage = this.TODAYDATE.SHORTAGE_HRS; + this.scheduled = this.TODAYDATE.SCHEDULED_HRS; + this.earlyOut = this.TODAYDATE.EARLY_OUT_HRS ; + this.scheduleDate = this.TODAYDATE.SCHEDULE_DATE; + this.assignData(this.SHIFTDETAILS.GetScheduleShiftsDetailsList[0]); + } + + assignData(shiftDetails) { + this.shiftTime = shiftDetails.SHT_NAME; + this.startDate = shiftDetails.SHT_ACTUAL_START_TIME; + this.endDate = shiftDetails.SHT_ACTUAL_END_TIME; + this.percentage = shiftDetails.PERCENTAGE; + this.percChart = this.percentage.substring(0, this.percentage.indexOf('%')); + const test = this.scheduleDate; + const splitdate = test.split(' '); + const date = splitdate[0]; + const test1 = date.split('/'); + this.day = test1[1]; + this.year = test1[2]; + this.month = test1[0]; + + // tslint:disable-next-line: radix + this.nameMonth = this.getMonthName(parseInt(this.month)); + this.nameDay = this.getHeaderDay(new Date(date)); + const d = new Date(date); + this.data = { + labels: ['percentage'], + datasets: [ + { + data: [this.percChart], + backgroundColor: [ + '#22C6B3' + ], + borderWidth: 2 + }] + }; + } + +slideChanged(ev) { + this.slides.getActiveIndex().then(index => { + const shiftDetails = this.SHIFTDETAILS[index]; + this.assignData(shiftDetails); + }); +} + + public getMonthName(value: number): string { + switch (value) { + case 1: + return 'Jan'; + case 2: + return 'Feb'; + case 3: + return 'Mar'; + case 4: + return 'Apr'; + case 5: + return 'May'; + case 6: + return 'Jun'; + case 7: + return 'Jul'; + case 8: + return 'Aug'; + case 9: + return 'Sep'; + case 10: + return 'Oct'; + case 11: + return 'Nov'; + case 12: + return 'Dec'; + } + } + + getHeaderDay(date: any) { + return this.weekDaysEn[date.getDay()]; + } +} diff --git a/Mohem/src/app/hmg-common/ui/circle-calendar/time.slot.ts b/Mohem/src/app/hmg-common/ui/circle-calendar/time.slot.ts new file mode 100644 index 00000000..99760881 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/circle-calendar/time.slot.ts @@ -0,0 +1,21 @@ +export class TimeSlot { + constructor(isoTime: string, startDate: string, end: string) { + this.isoTime = isoTime; + this.start = startDate; + this.end = end; + this.allDay = true; + this.draggable = false; + } + + public eventTimeLabel() { + return new Date(this.end).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', hour12: false }); + } + // event time in iso format + isoTime: string; + // start of event day + start: string; + // event date time + end: string; + allDay: boolean; + draggable: boolean; +} diff --git a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.html b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.html new file mode 100644 index 00000000..f6b03e26 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.html @@ -0,0 +1,26 @@ +
+ + +
+
+ Team Member Image +
+
+
+ +
+ +

{{name}}

+ {{title}} +
+ + + +
+ +
+
+
\ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.scss b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.scss new file mode 100644 index 00000000..4c5915c1 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.scss @@ -0,0 +1,84 @@ +.team-member-container{ + background: white; + border-radius: 100px 20px 20px 100px; + margin-top: 15px; + font-family: WorkSans-Regular; +} + +.user-image-container{ + position: relative; + width: 70px; + height: 70px; + display: block; + margin: 0 auto; +// &:before{ +// position: absolute; +// content: ""; +// width: 20px; +// height: 20px; +// border-radius: 20px; +// border: 1px solid white; +// top: 0; +// right: 0; +// background-color: red; +// z-index: 9; +// } +// &.present:before{ +// background-color: green !important; +// } +} +.user-image{ + overflow: hidden; + position: relative; + display: block; + width: 100%; + height: 100%; + border-radius: 80px; + border: 1px solid #ccc; + margin: 0px auto 6px; + img { + width: 100%; + max-height: 100%; + } +} + +.employee-name{ + display: inline-block; + width: 80%; + .name{ + font-size: 16px; + color: black; + margin: 0; + width: 100%; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + } + .title{ + font-size: 13px; + color: #888; + width: 100%; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + display: block; + } +} +.image-container{ + width: 20%; + display: inline-block; + text-align: center; + vertical-align: top; + margin-top: 5px; +} +.swipe-information{ + color: #888; + font-size: 12px; + border-top: 1px solid #ccc; + padding-top: 6px; + margin-top: 6px; + .check-in { + font-size: 12px; + margin-right: 15px; + } +} \ No newline at end of file diff --git a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.spec.ts b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.spec.ts new file mode 100644 index 00000000..853caab1 --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { EmployeeInformationComponent } from './employee-information.component'; + +describe('EmployeeInformationComponent', () => { + let component: EmployeeInformationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ EmployeeInformationComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(EmployeeInformationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.ts b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.ts new file mode 100644 index 00000000..da0f9ffb --- /dev/null +++ b/Mohem/src/app/hmg-common/ui/employee-information/employee-information.component.ts @@ -0,0 +1,19 @@ +import { Component, OnInit, Input } from '@angular/core'; + +@Component({ + selector: 'app-employee-information', + templateUrl: './employee-information.component.html', + styleUrls: ['./employee-information.component.scss'], +}) +export class EmployeeInformationComponent implements OnInit { + + public userImage: any = '../assets/imgs/profile.png'; + @Input() name: string; + @Input() title: string; + @Input() employeeImage: string; + + constructor() { } + + ngOnInit() {} + +} diff --git a/Mohem/src/app/hmg-common/ui/services-button/services-button.component.html b/Mohem/src/app/hmg-common/ui/services-button/services-button.component.html index ef14b4af..ec6dc980 100644 --- a/Mohem/src/app/hmg-common/ui/services-button/services-button.component.html +++ b/Mohem/src/app/hmg-common/ui/services-button/services-button.component.html @@ -1,6 +1,6 @@
- +

{{title}}

diff --git a/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.html b/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.html index b58e0af1..e1c3a368 100644 --- a/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.html +++ b/Mohem/src/app/hmg-common/ui/welcome-login/welcome.component.html @@ -1,33 +1,46 @@ - + + +

{{welcome}}

{{'home,welcome-back' | translate}}

{{empname}}

{{welcome_txt}}

{{txt_account}}

-
+ --> + + - + + +

{{welcome}}

+

{{welcome_txt}}

+

{{txt_account}}

+
+
+ + - + + + + - - + - + - + + + + + {{item.MENU_NAME}} + + + + + + @@ -45,7 +59,7 @@ + [icon]="subMenu.ICON"> @@ -60,94 +74,6 @@ - - - - - - -
Time Left Today diff --git a/Mohem/src/app/home/home.page.scss b/Mohem/src/app/home/home.page.scss index 8143cf6e..c803673d 100644 --- a/Mohem/src/app/home/home.page.scss +++ b/Mohem/src/app/home/home.page.scss @@ -39,10 +39,6 @@ ion-label{ position: relative; width: 100%; } -.header-md:after { - height: 0px !important; - display: none !important; -} .contentBg:before { position: absolute; content: ""; diff --git a/Mohem/src/app/home/home.page.ts b/Mohem/src/app/home/home.page.ts index b013bc8f..f87c14ae 100644 --- a/Mohem/src/app/home/home.page.ts +++ b/Mohem/src/app/home/home.page.ts @@ -15,24 +15,28 @@ import { attendanceSwipeScannerRequest } from './models/attendanceSwipe.Request' import { Response } from 'src/app/hmg-common/services/models/response'; import { AttendanceService } from './services/attendance.services'; import { LoginRequest } from '../hmg-common/services/authentication/models/login.request'; -import {FileUploaderComponent} from '../hmg-common/ui/file-uploader/file-uploader.component' -import { Camera} from '@ionic-native/Camera/ngx'; +import { FileUploaderComponent } from '../hmg-common/ui/file-uploader/file-uploader.component'; +import { Camera } from '@ionic-native/Camera/ngx'; import { File } from '@ionic-native/file/ngx'; import { DomSanitizer } from '@angular/platform-browser'; import { SharedDataService } from '../hmg-common/services/shared-data-service/shared-data.service'; import { DevicePermissionsService } from '../hmg-common/services/device-permissions/device-permissions.service'; import { DashboredService } from '../hmg-common/services/dashbored/dashbored.service'; import { OrganizationSalariesResponse } from '../hmg-common/services/dashbored/organization-salaries.response'; -import { OpenMissingSwipesResponse} from '../hmg-common/services/dashbored/open-missing-swipes.response'; -import {PerformanceAppraisalResponse} from '../hmg-common/services/dashbored/performance-appraisal.response'; +import { OpenMissingSwipesResponse } from '../hmg-common/services/dashbored/open-missing-swipes.response'; +import { PerformanceAppraisalResponse } from '../hmg-common/services/dashbored/performance-appraisal.response'; import { AttendanceTrackingResponse } from '../hmg-common/services/dashbored/attendance-tracking.response'; import { OpenPeriodDatesResponse } from '../hmg-common/services/dashbored/models/openPeriodDatesResponse'; -import {GetSubordinatesAttdStatusRequest} from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest'; -import {GetSubordinatesLeavesRequest} from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest' -import {GetOpenNotificationsResponse} from '../hmg-common/services/dashbored/models/GetOpenNotificationsResponse' -import {GetSubordinatesAttdStatusResponse} from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse' -import {GetSubordinatesLeavesResponse} from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse' +import { GetSubordinatesAttdStatusRequest } from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusRequest'; +import { GetSubordinatesLeavesRequest } from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest'; +import { GetOpenNotificationsResponse } from '../hmg-common/services/dashbored/models/GetOpenNotificationsResponse'; +import { GetSubordinatesAttdStatusResponse } from '../hmg-common/services/dashbored/models/GetSubordinatesAttdStatusResponse'; +import { GetSubordinatesLeavesResponse } from '../hmg-common/services/dashbored/models/GetSubordinatesLeavesResponse'; import { AccrualService } from '../accrual-balances/services/accrual.service'; +import { GetDayAndHoursDetailsRequest } from '../time-card/service/models/get-day-hours-type-details.request'; +import * as moment from 'moment'; +import { TimeCardService } from '../time-card/service/time-card.service'; +import { WorklistMainService } from '../notification/service/work-list.main.service'; @Component({ selector: 'app-home', @@ -53,31 +57,39 @@ export class HomePage implements OnInit { public fileUploder: FileUploaderComponent; location: boolean; camera: boolean; + ticketRequestObject : any; + leaveRequestObject : any; + missingSwipeRequestObject : any; public statsButtons = [ { title: 'Work List', statsValue: 0, - icon: 'assets/icon/new-design/work_list.png' - }, - { - title: 'Pending Request', - statsValue: 13, - icon: 'assets/icon/new-design/pending_request.png' + icon: 'assets/icon/new-design/work_list.png', + link: '1' }, + // { + // title: 'Pending Request', + // statsValue: 13, + // icon: 'assets/icon/new-design/pending_request.png', + // link: '' + // }, { title: 'Missing Swipes', statsValue: 0, - icon: 'assets/icon/new-design/missing_swipe.png' + icon: 'assets/icon/new-design/missing_swipe.png', + link: '2' }, { title: 'Leave Balance', statsValue: 0, - icon: 'assets/icon/new-design/leave_balance.png' + icon: 'assets/icon/new-design/leave_balance.png', + link: '3' }, { title: 'Ticket Balance', statsValue: 0, - icon: 'assets/icon/new-design/ticket_balance.png' + icon: 'assets/icon/new-design/ticket_balance.png', + link: '4' } ]; @@ -101,8 +113,8 @@ export class HomePage implements OnInit { // ]; public slideOptsOne = { - slidesPerView: 3.5, - spaceBetween: 10 + slidesPerView: 3.5, + spaceBetween: 10 }; public slideOptsTwo = { slidesPerView: 3.2, @@ -113,10 +125,17 @@ export class HomePage implements OnInit { public hasFinished = false; public remainingTime: any; public scheduledTime: any; + public spentHours: any; public isCheckedIn = undefined; public displayTime: any; public menuEntries: any; public percent: any; + public selEmp: string; + public selMenu: MenuResponse = new MenuResponse(); + public respID: number; + public menuType: any; + accrualBalancesList: any; + public countAllNotification = 0; constructor( public ts: TranslatorService, @@ -138,31 +157,43 @@ export class HomePage implements OnInit { private file: File, private permissions: DevicePermissionsService, public DS: DashboredService, - public accrualService: AccrualService + public accrualService: AccrualService, + //////////////////////////////////////// TIME AND DATE//////////////////////////// + public timeCardService: TimeCardService, + ///////////////////// END///////////////////////////////////////////////////////// + public workListService: WorklistMainService ) { this.events.subscribe('img-change', displayImg => { - this.userImage = this.sanitizer.bypassSecurityTrustUrl('data:Image/*;base64,' + displayImg); + this.userImage = this.sanitizer.bypassSecurityTrustUrl( + 'data:Image/*;base64,' + displayImg + ); console.log('html saved img: ' + this.userImage); }); - } + } ngOnInit() { - this.getUserDetails(); - + // this.getUserDetails(); // this.getCount(); // this.events.subscribe('getNotCount', badge => { // this.notBadge = badge; // }); } + ionViewWillEnter() { + this.remainingTime = 0; + this.displayTime = '00:00:00'; + this.runTimer = false; + this.getUserDetails(); + } + initTimer() { this.runTimer = false; this.hasStarted = false; this.hasFinished = false; - this.percent = 100 - ((this.remainingTime / this.scheduledTime) * 100); + this.percent = 100 - (this.remainingTime / this.scheduledTime) * 100; this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime); this.startTimer(); - } + } startTimer() { this.runTimer = true; @@ -172,11 +203,16 @@ export class HomePage implements OnInit { timerTick() { setTimeout(() => { - if (!this.runTimer) { return; } + if (!this.runTimer) { + return; + } this.remainingTime--; this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime); if (this.remainingTime > 0) { - const newPercent: any = ((this.remainingTime / this.scheduledTime) * 100).toFixed(2); + const newPercent: any = ( + (this.remainingTime / this.scheduledTime) * + 100 + ).toFixed(2); this.percent = 100 - newPercent; this.timerTick(); } else { @@ -188,21 +224,20 @@ export class HomePage implements OnInit { getSecondsAsDigitalClock(inputSeconds: number) { const secNum = parseInt(inputSeconds.toString(), 10); // don't forget the second param const hours = Math.floor(secNum / 3600); - const minutes = Math.floor((secNum - (hours * 3600)) / 60); - const seconds = secNum - (hours * 3600) - (minutes * 60); + const minutes = Math.floor((secNum - hours * 3600) / 60); + const seconds = secNum - hours * 3600 - minutes * 60; let hoursString = ''; let minutesString = ''; let secondsString = ''; - hoursString = (hours < 10) ? '0' + hours : hours.toString(); - minutesString = (minutes < 10) ? '0' + minutes : minutes.toString(); - secondsString = (seconds < 10) ? '0' + seconds : seconds.toString(); + hoursString = hours < 10 ? '0' + hours : hours.toString(); + minutesString = minutes < 10 ? '0' + minutes : minutes.toString(); + secondsString = seconds < 10 ? '0' + seconds : seconds.toString(); return hoursString + ':' + minutesString + ':' + secondsString; } - getDeviceLocation() { const isVirtual = this.device.isVirtual; - if (isVirtual === true){ + if (isVirtual === true) { alert('emulater>>>>>>>' + isVirtual); alert('You are using virtual device'); return false; @@ -211,7 +246,11 @@ export class HomePage implements OnInit { this.location = granted as boolean; if (this.location) { this.geolocation - .getCurrentPosition({ maximumAge: 3000, timeout: 10000, enableHighAccuracy: true }) + .getCurrentPosition({ + maximumAge: 3000, + timeout: 10000, + enableHighAccuracy: true + }) .then(resp => { this.lat = resp.coords.latitude; this.longt = resp.coords.longitude; @@ -224,33 +263,35 @@ export class HomePage implements OnInit { return false; } }); - } setServicesPrivilage() { for (const servicePrivilage of AuthenticationService.servicePrivilage) { if (servicePrivilage.Previlege === false) { - document.getElementById(servicePrivilage.ServiceName).setAttribute('disabled', 'disabled'); - document.getElementById(servicePrivilage.ServiceName).style.filter = 'grayscale(1)'; + document + .getElementById(servicePrivilage.ServiceName) + .setAttribute('disabled', 'disabled'); + document.getElementById(servicePrivilage.ServiceName).style.filter = + 'grayscale(1)'; } } } // getCount() { - // const req: any = {}; - // this.menuService.getNotificationCount(req).subscribe((result: any) => { - // if (this.common.validResponse(result)) { - // this.notBadge = - // result.GetOpenNotificationsNumList.P_OPEN_NOTIFICATIONS_NUM; - // if (this.notBadge <= 0) { - // this.notBadge = null; - // } - // this.events.publish("getNotCount", this.notBadge); - // } - // }); + // const req: any = {}; + // this.menuService.getNotificationCount(req).subscribe((result: any) => { + // if (this.common.validResponse(result)) { + // this.notBadge = + // result.GetOpenNotificationsNumList.P_OPEN_NOTIFICATIONS_NUM; + // if (this.notBadge <= 0) { + // this.notBadge = null; + // } + // this.events.publish("getNotCount", this.notBadge); + // } + // }); // } - ionViewDidLoad() { + ionViewDidEnter() { this.geolocation .getCurrentPosition() .then(resp => { @@ -267,277 +308,323 @@ export class HomePage implements OnInit { } private getUserDetails() { - this.authService .loadAuthenticatedUser() .subscribe((user: AuthenticatedUser) => { if (user) { this.events.publish('setMenu'); this.userData = user; - this.sharedData.setSharedData(this.userData, AuthenticatedUser.SHARED_DATA); - this.userImage = user.EMPLOYEE_IMAGE ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE : this.userImage; + this.sharedData.setSharedData( + this.userData, + AuthenticatedUser.SHARED_DATA + ); + this.userImage = user.EMPLOYEE_IMAGE + ? 'data:image/png;base64,' + user.EMPLOYEE_IMAGE + : this.userImage; this.callDashboardServices(); } else { console.log(user); } }); - } + } - callDashboardServices() { - this.getMenu(); - this.setServicesPrivilage(); - this.openNotificationsDashbored(); - this.showOpenMissingSwipes(); - this.showAttendanceTracking(); - this.getAccrualBalance(); - } + callDashboardServices() { + this.getMenu(); + this.setServicesPrivilage(); + this.openNotificationsDashbored(); + this.showOpenMissingSwipes(); + this.showAttendanceTracking(); + this.getAccrualBalance(); + } - public Vacation_Rule() { - this.common.navigateForward('/vacation-rule/home'); - } + public Vacation_Rule() { + this.common.navigateForward('/vacation-rule/home'); + } - private getMenu() { - this.menuService.getMenu().subscribe((result: MenuResponse) => { - this.handleMenuResult(result); - }); - } + private getMenu() { + this.menuService.getMenu().subscribe((result: MenuResponse) => { + this.handleMenuResult(result); + }); + } - private handleMenuResult(result) { - if (this.common.validResponse(result)) { - if (this.common.hasData(result.List_Menu)) { - console.log('list menu'); - this.menuList = result.List_Menu; - this.getMenuDetails(); - } + private handleMenuResult(result) { + if (this.common.validResponse(result)) { + if (this.common.hasData(result.List_Menu)) { + console.log('list menu'); + this.menuList = result.List_Menu; + this.getMenuDetails(); } } + } - private accrualBalance() { - this.common.openAccuralPage(); - } + private accrualBalance() { + this.common.openAccuralPage(); + } - private changeImage() { - this.common.openChangeImagePage(); - } + private changeImage() { + this.common.openChangeImagePage(); + } - public getMenuDetails() { - const item = this.menuList[0]; - const selMenu: MenuResponse = new MenuResponse(); - selMenu.List_Menu = item; - selMenu.userid = this.userData.EMPLOYEE_NUMBER; - console.log('menu: ' + selMenu.List_Menu); - this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA); - this.getMenuEntries(item); - // if (item.MENU_TYPE === 'M') { - // this.common.openMyTeamPage(); - // // this.navCtrl.push("MySubordinatePage"); - // } else if (item.MENU_TYPE === 'S') { - // this.common.sharedService.setSharedData(item, 'mySpecList'); - // this.common.openMySpecialistPage(); - // // this.navCtrl.push('MySpecialistPage',{"mySpecList":item}); - // } else { - // this.getMenuEntries(item); - // } - } + public getMenuDetails() { + const item = this.menuList[0]; + const selMenu: MenuResponse = new MenuResponse(); + selMenu.List_Menu = item; + selMenu.userid = this.userData.EMPLOYEE_NUMBER; + console.log("menu: " + selMenu.List_Menu); + this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA); + this.getMenuEntries(item); + // if (item.MENU_TYPE === 'M') { + // this.common.openMyTeamPage(); + // // this.navCtrl.push("MySubordinatePage"); + // } else if (item.MENU_TYPE === 'S') { + // this.common.sharedService.setSharedData(item, 'mySpecList'); + // this.common.openMySpecialistPage(); + // // this.navCtrl.push('MySpecialistPage',{"mySpecList":item}); + // } else { + // this.getMenuEntries(item); + // } + } - getMenuEntries(item) { - const request: any = {}; - let selEmpNo: string = null; - let nationality: string = null; - request.P_SELECTED_RESP_ID = -999; - if (item.MENU_TYPE === 'S') { - request.P_SELECTED_RESP_ID = item.RESP_ID; - } else { - selEmpNo = this.common.sharedService.getSharedData( - LoginRequest.SHARED_DATA, - false - ); - } - nationality = this.common.sharedService.getSharedData( - LoginRequest.NATIONALITY_CODE, + openMyTeamPage() { + this.common.openMyTeamPage(); + } + getMenuEntries(item) { + const request: any = {}; + let selEmpNo: string = null; + let nationality: string = null; + request.P_SELECTED_RESP_ID = -999; + if (item.MENU_TYPE === 'S') { + request.P_SELECTED_RESP_ID = item.RESP_ID; + } else { + selEmpNo = this.common.sharedService.getSharedData( + LoginRequest.SHARED_DATA, false ); - request.P_SELECTED_EMPLOYEE_NUMBER = selEmpNo; - request.P_MENU_TYPE = item.MENU_TYPE; - request.NationalityCode = nationality; - // set emp and resp id - console.log('set data'); - this.common.sharedService.setSharedData( - selEmpNo, - MenuResponse.SHARED_SEL_EMP - ); - this.common.sharedService.setSharedData( - request.P_SELECTED_RESP_ID, - MenuResponse.SHARED_SEL_RESP_ID - ); - - this.eitService - .getMenuEntries(request) - .subscribe((result: MenuResponse) => { - this.handleMenuEntiresResult(result); - }); } + nationality = this.common.sharedService.getSharedData( + LoginRequest.NATIONALITY_CODE, + false + ); + request.P_SELECTED_EMPLOYEE_NUMBER = selEmpNo; + request.P_MENU_TYPE = item.MENU_TYPE; + request.NationalityCode = nationality; + // set emp and resp id + console.log("set data"); + this.common.sharedService.setSharedData( + selEmpNo, + MenuResponse.SHARED_SEL_EMP + ); + this.common.sharedService.setSharedData( + request.P_SELECTED_RESP_ID, + MenuResponse.SHARED_SEL_RESP_ID + ); + + this.eitService + .getMenuEntries(request) + .subscribe((result: MenuResponse) => { + this.handleMenuEntiresResult(result); + }); + } - sortMenuEntires(list) { - const tree = this.common.list_to_tree(list); - this.menuEntries = tree; - console.log(this.menuEntries); - this.common.sharedService.setSharedData(tree, 'menuEntries'); - // this.common.navigateForward("/eit/homepage"); - // this.common.openEITPage(); - } + sortMenuEntires(list) { + const tree = this.common.list_to_tree(list); + this.menuEntries = tree; + console.log(this.menuEntries); + this.common.sharedService.setSharedData(tree, "menuEntries"); + this.common.sharedService.setSharedData("home", "homemenuentries"); + // this.common.navigateForward("/eit/homepage"); + // this.common.openEITPage(); + } - private handleMenuEntiresResult(result) { - if (this.common.validResponse(result)) { - if (this.common.hasData(result.GetMenuEntriesList)) { - this.sortMenuEntires(result.GetMenuEntriesList); + private handleMenuEntiresResult(result) { + if (this.common.validResponse(result)) { + if (this.common.hasData(result.GetMenuEntriesList)) { + for(let i=0;i { - this.camera = granted as boolean; - if (this.camera) { - this.scanCode(); - } - } - ); - } + private attendance() { + this.permissions.requestCameraAutherization().then(granted => { + this.camera = granted as boolean; + if (this.camera) { + this.scanCode(); + } + }); + } - scanCode() { - this.barcodeScanner.scan().then(barcodeData => { + scanCode() { + this.barcodeScanner + .scan() + .then(barcodeData => { this.scannedResult = barcodeData; this.deviceID = this.device.uuid; this.swipeAttendance(); - }).catch(err => { - console.log('Error', err); + }) + .catch(err => { + console.log("Error", err); }); - } - - swipeAttendance() { - const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest(); - request.Latitude = this.lat; - request.Longitude = this.longt; - request.QRValue = this.scannedResult.text; - request.UID = this.deviceID; - request.UserName = this.userData.EMPLOYEE_NUMBER; - console.log(JSON.stringify(request)); - this.attendanceService - .attendanceSwipeScanner(request, () => { - console.log('Error inside in swipe attendance'); - }) - .subscribe((result: Response) => { - if (this.common.validResponse(result)) { - this.common.presentAlert(this.ts.trPK('home', 'swipeAlertSuccess')); - this.showAttendanceTracking(); - } else { - this.common.presentAlert(this.ts.trPK('home', 'swipeAlertFailed')); - } - }); - } + } - openPersonalInfo() { - this.common.openProfile(); - } + swipeAttendance() { + const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest(); + request.Latitude = this.lat; + request.Longitude = this.longt; + request.QRValue = this.scannedResult.text; + request.UID = this.deviceID; + request.UserName = this.userData.EMPLOYEE_NUMBER; + console.log(JSON.stringify(request)); + this.attendanceService + .attendanceSwipeScanner(request, () => { + console.log("Error inside in swipe attendance"); + }) + .subscribe((result: Response) => { + if (this.common.validResponse(result)) { + this.common.presentAlert(this.ts.trPK("home", "swipeAlertSuccess")); + this.showAttendanceTracking(); + } + // else { + // this.common.presentAlert(this.ts.trPK('home', 'swipeAlertFailed')); + // } + }); + } + openPersonalInfo() { + this.common.openProfile(); + } -/*************************************Dashboards Services**********************************************************8 */ + /*************************************Dashboards Services**********************************************************8 */ showOrganizationSalaries() { - this.DS.getOrganizationSalaries() .subscribe((result: OrganizationSalariesResponse ) => { - }); + this.DS.getOrganizationSalaries().subscribe( + (result: OrganizationSalariesResponse) => {} + ); } showOpenMissingSwipes() { - this.DS.getOpenMissingSwipes() .subscribe((result: OpenMissingSwipesResponse) => { - if (this.common.validResponse(result)) { - const key = 'GetOpenMissingSwipesList'; - this.statsButtons[2].statsValue = result[key].P_OPEN_MISSING_SWIPES; + this.DS.getOpenMissingSwipes().subscribe( + (result: OpenMissingSwipesResponse) => { + if (this.common.validResponse(result)) { + const key = "GetOpenMissingSwipesList"; + this.statsButtons[1].statsValue = result[key].P_OPEN_MISSING_SWIPES; + } } - }); + ); } showPerformanceAppraisal() { - this.DS.getPerformanceAppraisal() .subscribe((result: PerformanceAppraisalResponse) => { - }); + this.DS.getPerformanceAppraisal().subscribe( + (result: PerformanceAppraisalResponse) => {} + ); } convertInSeconds(time: any) { const hours = parseInt(time[0], 10); const minutes = parseInt(time[1], 10); let seconds = parseInt(time[2], 10); - seconds = seconds + (hours * 60 * 60) + (minutes * 60); + seconds = seconds + hours * 60 * 60 + minutes * 60; return seconds; } - convertAndAssignTime(data) { +convertAndAssignTime(data) { console.log(data); this.remainingTime = this.convertInSeconds(data.P_REMAINING_HOURS.split(':')); this.scheduledTime = this.convertInSeconds(data.P_SCHEDULED_HOURS.split(':')); - this.isCheckedIn = this.remainingTime === this.scheduledTime ? false : true; - this.initTimer(); - console.log('remainingTime: ' + this.remainingTime); - console.log('scheduledTime: ' + this.scheduledTime); - console.log('isCheckedIn: ' + this.isCheckedIn); - } + this.spentHours = this.convertInSeconds(data.P_SPENT_HOURS.split(':')); + this.isCheckedIn = this.spentHours === 0 ? false : true; + if (this.isCheckedIn) { + this.initTimer(); + } +} - showAttendanceTracking() { - this.DS.getAttendanceTracking() .subscribe((result: AttendanceTrackingResponse) => { +showAttendanceTracking() { + const request = { + P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER + }; + this.DS.getAttendanceTracking(request).subscribe((result: AttendanceTrackingResponse) => { if (this.common.validResponse(result)) { const key = 'GetAttendanceTrackingList'; this.convertAndAssignTime(result[key]); } }); - } +} - openPeriodDateDashbored() { - this.DS.getOpenPeriodDates( () => {console.log('Error '); } ).subscribe((result: OpenPeriodDatesResponse) => { +openPeriodDateDashbored() { + this.DS.getOpenPeriodDates(() => { console.log('Error '); }).subscribe((result: OpenPeriodDatesResponse) => { if (this.common.validResponse(result)) { console.log('response'); } }); } - openNotificationsDashbored() { // work list - this.DS.getOpenNotifications( () => { console.log('Error '); }).subscribe((result: GetOpenNotificationsResponse) => { + openNotificationsDashbored() { + // work list + this.DS.getOpenNotifications(() => { + console.log("Error "); + }).subscribe((result: GetOpenNotificationsResponse) => { if (this.common.validResponse(result)) { const key = 'P_OPEN_NTF_NUMBER'; - this.statsButtons[0].statsValue = result[key]; + this.countAllNotification = result[key]; + this.ITGCountAllNotification(); + this.common.sharedService.setSharedData( + result, + 'worklistNotifications' + ); } }); } + ITGCountAllNotification() { + this.workListService.getITGDetails().subscribe((result: any) => { + this.statsButtons[0].statsValue = + this.countAllNotification + result.TotalCount; + }); + } + getSubordinatesLeaves() { const request: GetSubordinatesLeavesRequest = new GetSubordinatesLeavesRequest(); - request.P_DATE_FROM = '/Date(1578603600000+0300)/'; // test - request.P_DATE_TO = '/Date(1576011600000+0300)/'; // test - this.DS.getSubordinatesLeaves( request, () => {console.log('Error '); } ).subscribe((result: GetSubordinatesLeavesResponse) => { + request.P_DATE_FROM = "/Date(1578603600000+0300)/"; // test + request.P_DATE_TO = "/Date(1576011600000+0300)/"; // test + this.DS.getSubordinatesLeaves(request, () => { + console.log("Error "); + }).subscribe((result: GetSubordinatesLeavesResponse) => { if (this.common.validResponse(result)) { console.log('response'); console.log(result); } }); - } - getSubordinatesAttStatus() { +getSubordinatesAttStatus() { const request: GetSubordinatesAttdStatusRequest = new GetSubordinatesAttdStatusRequest(); - request.P_SCHEDULE_DATE_FROM = '/Date(1578603600000+0300)/'; // test - request.P_SCHEDULE_DATE_TO = '/Date(1576011600000+0300)/'; // test - this.DS.getSubordinatesAttStatus( request, () => {console.log('Error '); }).subscribe((result: GetSubordinatesAttdStatusResponse) => { + request.P_SCHEDULE_DATE_FROM = "/Date(1578603600000+0300)/"; // test + request.P_SCHEDULE_DATE_TO = "/Date(1576011600000+0300)/"; // test + this.DS.getSubordinatesAttStatus(request, () => { + console.log("Error "); + }).subscribe((result: GetSubordinatesAttdStatusResponse) => { if (this.common.validResponse(result)) { console.log('response'); console.log(result); @@ -546,57 +633,95 @@ export class HomePage implements OnInit { } openPage(subMenu) { + console.log("openPage"); let selMenu: MenuResponse = new MenuResponse(); - selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); + selMenu = this.common.sharedService.getSharedData( + MenuResponse.SHARED_DATA, + false + ); selMenu.GetMenuEntriesList = subMenu; this.common.sharedService.setSharedData(selMenu, MenuResponse.SHARED_DATA); if (subMenu.REQUEST_TYPE === 'ABSENCE') { this.common.openAbsencePage(); } else if (subMenu.REQUEST_TYPE === 'EIT') { this.common.openEitListPage(); - } - if (subMenu.REQUEST_TYPE === 'PAYSLIP') { + } else if (subMenu.REQUEST_TYPE === 'PAYSLIP') { this.common.openPayslipPage(); + } else if (subMenu.MENU_ENTRY_TYPE === 'MENU') { + this.common.sharedService.setSharedData( + selMenu.GetMenuEntriesList, + 'menuEntries' + ); + this.common.openEITPage(); + } + if (subMenu.REQUEST_TYPE === 'TIME_CARD') { + this.common.openTimeCardPage(); } } getAccrualBalance() { - const today = new Date(); - const day = today.getDate(); - const month = today.getMonth() + 1; - const year = today.getFullYear(); - const todayDate = month + '/' + day + '/' + year; - const effectiveDate = todayDate; - const request = { - P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER, - P_EFFECTIVE_DATE: effectiveDate - }; - this.accrualService - .getAccrualBalances(request) - .subscribe((result: any) => { - if (this.common.validResponse(result)) { - let totalTicketsLeft = 0; - for (const accrualBalance of result.GetAccrualBalancesList) { - if (accrualBalance.ACCURAL_PLAN_NAME === 'HMG Annual Vacation Accrual Plan') { - this.statsButtons[3].statsValue = accrualBalance.ACCRUAL_NET_ENTITLEMENT; - } else { - totalTicketsLeft = totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT; - } - } - this.statsButtons[4].statsValue = totalTicketsLeft; + const today = new Date(); + const day = today.getDate(); + const month = today.getMonth() + 1; + const year = today.getFullYear(); + const todayDate = month + "/" + day + "/" + year; + const effectiveDate = todayDate; + const request = { + P_SELECTED_EMPLOYEE_NUMBER: this.userData.EMPLOYEE_NUMBER, + P_EFFECTIVE_DATE: effectiveDate + }; + this.accrualService.getAccrualBalances(request).subscribe((result: any) => { + if (this.common.validResponse(result)) { + let totalTicketsLeft = 0; + this.accrualBalancesList = result.GetAccrualBalancesList; + for (const accrualBalance of result.GetAccrualBalancesList) { + if ( + accrualBalance.ACCURAL_PLAN_NAME === + "HMG Annual Vacation Accrual Plan" + ) { + this.statsButtons[2].statsValue = + accrualBalance.ACCRUAL_NET_ENTITLEMENT; + this.common.sharedService.setSharedData( + accrualBalance, + "leaveAccrualBalance" + ); + this.common.sharedService.setSharedData( + request, + "leaveAccrualBalanceDate" + ); + this.common.sharedService.setSharedData( + this.accrualBalancesList, + "tickitsbalance" + ); + } else { + totalTicketsLeft = + totalTicketsLeft + accrualBalance.ACCRUAL_NET_ENTITLEMENT; } - }); + } + this.statsButtons[3].statsValue = totalTicketsLeft; + } + }); } - openattentracking() { +openattentracking() { this.common.openAttenTrackingpage(); - } +} - openProfilePage() { +openProfilePage() { this.common.openEditProfile(); } + openStatsButton(link: any) { + // console.log(link); + if (link == "1") { + this.common.openNotificationPage(); + } else if (link == "2") { + this.openPage(this.missingSwipeRequestObject); + } else if (link == "3") { + this.openPage(this.leaveRequestObject); + } else if (link =="4") { + this.openPage(this.ticketRequestObject); + } + } } - - diff --git a/Mohem/src/app/my-team/details/details.component.html b/Mohem/src/app/my-team/details/details.component.html index d15c22b6..c6d09459 100644 --- a/Mohem/src/app/my-team/details/details.component.html +++ b/Mohem/src/app/my-team/details/details.component.html @@ -1,158 +1,281 @@ + + + + + + EMPLOYEE DETAIL + + - - - - - - - {{headerTitle}} - - - - -
- - - -
{{employee.EMPLOYEE_NAME}}
-
- -
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+
+ +
+ + + Attendance + + + Team Members + + + About + + +
+ +
+
+

+ {{ts.trPK('myTeam','todayAttendance')}} +

+ + +
+ {{ts.trPK('myTeam','checkIn')}} +

{{attendanceTrackingList.P_SWIPE_IN | slice:0:-3}}

+

--:--

+
+
+ +
+ {{ts.trPK('myTeam','checkOut')}} +

{{attendanceTrackingList.P_SWIPE_OUT | slice:0:-3}}

+

--:--

+
+
+ +
+ {{ts.trPK('myTeam','late')}} +

{{attendanceTrackingList.P_LATE_IN_HOURS | slice:0:-3}}

+
+
+
+
+ +
+
+ + + + + + {{month}} {{year}} + + + + + +
+
+ +
+
+ {{ts.trPK('myTeam','attendance-statistics')}} +
+
+
+
+ {{ts.trPK('attendance','present')}} + {{attendedDays}} +
+
+ {{ts.trPK('attendance','absent')}} + {{absentDays}} +
+
+
+
+

{{totalAttendancePrecentage}}

+ {{ts.trPK('absenceList','days')}}
- - -
- {{ts.trPK('myTeam','requestFor')}} - {{employee.EMPLOYEE_NAME}} + +
-
- - - - - - -

{{subordinate.EMPLOYEE_NAME}}

-

{{subordinate.POSITION_NAME}}

- {{subordinate.NUM_OF_SUBORDINATES}} -
-
- - - - - + + + +
+ {{ts.trPK('attendance-tracking','schedule')}} +

{{timeCardSummaryData.SCHEDULE_DAYS}}

+
+
+ + +
+ {{ts.trPK('attendance-tracking','off-days')}} +

{{timeCardSummaryData.OFF_DAYS}}

+
+
+ + +
+ {{ts.trPK('attendance-tracking','non-analyzed')}} +

{{timeCardSummaryData.UNAUTHORIZED_LEAVE}}

+
+
+ + +
+ {{ts.trPK('attendance-tracking','shortage-hours')}} +

{{timeCardSummaryData.SHORTAGE_HRS}}

+
+
+
+ +
+ {{ts.trPK('attendance','monthly-attendance-calendar')}} + + +
+
- - \ No newline at end of file + +
+
+ + + + {{ts.trPK('searchForReplacment','name')}} + {{ts.trPK('searchForReplacment','userName')}} + {{ts.trPK('searchForReplacment','email')}} + + + + + + + + + + +
+ +
+ + + Clear Search + + + +
+ + + + + + + + + +
+ +
+ + +

Employee ID

+

{{employee.EMPLOYEE_NUMBER}}

+
+ +

Category

+

{{employee.EMPLOYMENT_CATEGORY_MEANING}}

+
+ +

Address

+

{{employee.LOCATION_NAME}}

+
+ +

Phone Number

+

{{employee.EMPLOYEE_MOBILE_NUMBER}}

+
+ +

Business Group

+

{{employee.ORGANIZATION_NAME}}

+
+ +

Job

+

{{employee.JOB_NAME}}

+
+ +

Payroll

+

{{employee.PAYROLL_NAME}}

+
+ +

Organization Email Address

+

{{employee.EMPLOYEE_EMAIL_ADDRESS}}

+
+ +

Position

+

{{employee.POSITION_NAME}}

+
+ +

Grade

+

{{employee.GRADE_NAME}}

+
+
+
+ +
+ + \ No newline at end of file diff --git a/Mohem/src/app/my-team/details/details.component.scss b/Mohem/src/app/my-team/details/details.component.scss index 5b22677a..48caae91 100644 --- a/Mohem/src/app/my-team/details/details.component.scss +++ b/Mohem/src/app/my-team/details/details.component.scss @@ -1 +1,415 @@ -.search-icons{font-size:.7cm} \ No newline at end of file +ion-content { + --ion-background-color: whitesmoke; +} +ion-title{ + color: white; + position: absolute; + top: 0; + text-align: center; + left: 15%; + right: 15%; + font-size: 0.42cm; + font-weight: bold; + height: 100%; +} +.contentBg{ + padding: 0px 20px; +} + +.contentBg:before { + position: absolute; + content: ""; + background: #22c6b3; + height: 140px; + width: 100%; + left: 0; + top: 0px; + z-index: 1; +} + + .user-info{ + text-align: center; + margin-bottom: 15px; + .user-image-container{ + position: relative; + width: 80px; + height: 80px; + display: block; + margin: 0 auto; + // &:before{ + // position: absolute; + // content: ""; + // width: 20px; + // height: 20px; + // border-radius: 20px; + // border: 1px solid white; + // top: 0; + // right: 0; + // background-color: red; + // z-index: 9; + // } + // &.present:before{ + // background-color: green !important; + // } + } + .user-image{ + overflow: hidden; + position: relative; + display: block; + width: 100%; + height: 100%; + border-radius: 80px; + border: 1px solid #ccc; + margin: 0px auto 6px; + } + h1{ + margin: 0; + padding: 0; + font-family: WorkSans-Bold; + font-size: 18px; + margin-bottom: 4px; + } + span{ + font-size: 14px; + display: block; + color: #888 + } + } + $actionBtnSize : 36px; + .user-actions{ + text-align: center; + .action-button{ + font-size: 11px; + white-space: nowrap; + color: #888; + .action-button-icon{ + width: $actionBtnSize; + height: $actionBtnSize; + border-radius: $actionBtnSize; + margin: 0 auto; + display: block; + background-color: #22c6b3; + line-height: $actionBtnSize; + margin-bottom: 3px; + img{ + margin: 0 auto; + vertical-align: middle; + } + } + } + } +.employee-information-indetail{ + background: white; + margin-top: 15px; + border-radius: 20px; + margin-bottom: 15px; + ion-col{ + padding: 15px; + border-bottom: 1px solid #ccc; + } + h2{ + font-size: 13px; + font-family: WorkSans-Bold; + margin: 0; + } + p{ + font-size: 13px; + margin: 0; + } +} + +.segments-container { + border-radius: 100px; + overflow: hidden; + margin-top: 15px; + background: white; + color: black; +} + +.active-Segment { + font-size: 0.3cm !important; + background: #22c6b3 !important; + text-transform: none; + --color-checked: none; + border-radius: 100px; + border:0; + } + .active-Segment ion-label{ + font-size: 11px; + color: white !important; + } + .normal-Segment ion-label{ + color: black !important; + font-size: 11px; + } + .normal-Segment { + font-size: 0.3cm !important; + text-transform: none; + --color-checked: none; + border: 0; + } + .colum-container{ + padding: 15px; + border-bottom: 1px solid #ccc; + } + + ///////////////////////// Team Members css //////////////////////@extend + +.filters-row { + margin-top: 10px; +} + +.search-dropdown{ + background: #22c6b3; + ion-select { + .select-text{ + margin-left: -10px; + } + .select-icon{ + .select-icon-inner{ + opacity: 1; + color: white; + margin-top: -1px; + } + } + } +} + +.input-container{ + background: white; + ion-input{ + border-bottom-color: transparent; + } +} + +.search-container{ + margin-top: 15px; + ion-col{ + background: white; + border-radius: 12px; + padding-right: 10px; + flex: none; + ion-icon{ + margin-right: 3px; + font-size: 14px; + margin-left: 3px; + vertical-align: middle; + } + span{ + font-size: 12px; + vertical-align: middle; + } + } +} + + +/////////////////////////////////////////////////////// Attendance /////////////////////// +.header{ + margin-top: 20px; +} + +.slidPrev{ + margin-left: 10px; + background: transparent; +} + +.slidNext{ + background: transparent; + margin-top: -1px; + margin-left: 43px; +} +.activeArrow{ + height: 20px; + width: 20px; + color: #22c6b3; +} +.disabledArrow{ + height: 20px; + width: 20px; + color: gray; +} + +.result-graph { + position: relative; + background: white; + margin-top: 20px; + padding-bottom: 20px; + border-radius: 20px; + z-index: 1; + margin-bottom: 10px; +} +.request-heading { + span { + text-align: left; + display: block; + padding-top: 8px; + margin-bottom: 10px; + margin-left: 10px; + } +} +.result-text-container { + padding: 0; + margin: 0; + position: absolute; + left: 50%; + top: 50%; + display: block; + text-align: center; + transform: translate(-50%, -50%); + h2 { + font-size: 38px; + font-family: WorkSans-Bold; + margin: 0 auto; + line-height: 36px; + } + span { + width: 125px; + display: block; + margin: 0 auto; + font-size: 12px; + font-family: workSans-Regular; + } + } + .today-graph { + width: 100%; + max-height: 4cm; + } + +.green-label{ + font-size: 12px; + margin-top: -13px; +} + +.green-amount{ + font-size: 17px; + font-family: WorkSans-Bold; + margin-top: -3px; +} + +.blue-label{ + font-size: 12px; + margin-top: -13px; +} + +.blue-amount{ + font-size: 17px; + font-family: WorkSans-Bold; + margin-top: -4px; +} + +.labelGrid{ + background-color: white !important; + border-radius: 20px !important; + height: 88px !important; + border: 1px solid #d6d4d4; + position: relative; + padding: 10px; + + label { + font-size: 9px; + line-height: 11px !important; + display: block; + } + h2 { + font-size: 25px; + font-weight: bold; + display: block; + text-align: right; + margin:0; + position: absolute; + bottom: 0; + left:0; + width: 100%; + padding: 10px; + } +} + +.bodyGrid{ + margin-top: 7px !important; + margin-left: 15px !important; + margin-right: 15px !important; + background-color: white !important; + border-radius: 20px !important; + height: 321px !important; + border: 1px solid #d6d4d4 !important; +} +.attendance-information{ + background: white; + border-radius: 20px; + padding: 10px; + h2{ + padding: 0; + margin: 0; + font-size: 22px; + } + span{ + font-size: 11px; + } +} + +.month-year-span{ + font-size: 20px; + font-family: WorkSans-Bold; +} + +.green-label-container{ + border-top: 5px solid #22c6b3; + padding: 1px 0px; + margin: 15px 0px +} + +.blue-label-container{ + border-top: 5px solid #094875; + padding: 1px 0px; + margin: 15px 0px +} +.span-one{ + display: block; + font-size: 12px; + color: black; +} +.span-two{ + display: block; + font-size: 22px; + font-family: WorkSans-Bold; +} +.graph-container{ + margin-left: -50px; + position: relative; + margin-right: 50px; +} +.label-container{ + position: absolute; + width: 20%; + right: 30px; + top: 50%; + margin-top: -60px; +} +.attendance-summary .attendance-information { + span{ + height: 32px; + display: block; + line-height: 14px; + } + h2{ + text-align: right; + font-family: WorkSans-Bold; + } + +} +.calendar-container{ + background: white; + margin-bottom: 100px; + margin-top: 20px; + border-radius: 20px; + span{ + text-align: left; + display: block; + padding-top: 8px; + margin-bottom: 10px; + margin-left: 10px; + } +} + + + diff --git a/Mohem/src/app/my-team/details/details.component.ts b/Mohem/src/app/my-team/details/details.component.ts index 25693833..8f430397 100644 --- a/Mohem/src/app/my-team/details/details.component.ts +++ b/Mohem/src/app/my-team/details/details.component.ts @@ -1,36 +1,99 @@ -import { Component, OnInit,ViewChild } from "@angular/core"; -import { Location } from "@angular/common"; -import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; -import { CommonService } from "src/app/hmg-common/services/common/common.service"; -import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; -import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response"; -import { MyTeamService } from "../service/my-team.service"; -import { MenuService } from "src/app/hmg-common/services/menu/menuservice.service"; -import { ModalController } from "@ionic/angular"; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Location } from '@angular/common'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { MyTeamService } from '../service/my-team.service'; +import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service'; +import { ModalController } from '@ionic/angular'; import { IonInfiniteScroll } from '@ionic/angular'; +import * as moment from 'moment'; +import { TimeCardService } from 'src/app/time-card/service/time-card.service'; +import { GetDayAndHoursDetailsRequest } from 'src/app/time-card/service/models/get-day-hours-type-details.request'; +import { GetTimeCardSummaryRequest } from 'src/app/time-card/service/models/get-time-card-summary.request'; +import { DashboredService } from 'src/app/hmg-common/services/dashbored/dashbored.service'; +import { AttendanceTrackingResponse } from 'src/app/hmg-common/services/dashbored/attendance-tracking.response'; @Component({ - selector: "app-details", - templateUrl: "./details.component.html", - styleUrls: ["./details.component.scss"] + selector: 'app-details', + templateUrl: './details.component.html', + styleUrls: ['./details.component.scss'] }) export class DetailsComponent implements OnInit { - public static opendEmployeesARR='opend_employees_arr'; + public static opendEmployeesARR = 'opend_employees_arr'; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; - pageNum: number = 1; - pageLimit: number = 50; - modalFlag: any = false; + public activeSegment = 'Attendance'; + pageNum = 1; + pageLimit = 50; empSubordinate: any; employee: any; - IsReachEnd: boolean = false; + isReachEnd = false; searchKey: any; - public searchKeySelect: any; + public isSearch = false; + public searchKeySelect = 'Name'; + public getEmployeeSubordinatesRequestObject: any; infiniteRequest: any; - isSpecialist: boolean = false; + isSpecialist = false; selMenu: MenuResponse = new MenuResponse(); - public opendEmployees :any=[]; - public headerTitle: string = ""; + public opendEmployees: any = []; + public headerTitle = ''; + public userImage: any = '../assets/imgs/profile.png'; + public menuType: any; + public selEmp: string; + public dateFrom: any = new Date(); + public dateTo: any = new Date(); + public respID: number; + public timeCardSummaryData: any = []; + public dayHoursData: any = []; + public selectedShift: any; + public dayAndHoursPageNumber = 1; + public monthName: any; + public yearDate: any; + public absentDays: number; + public attendedDays: number; + public futrueDays = 0; + public totalAttendancePrecentage = 0; + public arrDaysAttendance: any = []; + public arrDaysAbsent: any = []; + public arrDaysOff: any = []; + public normalDays: any = []; + public monthTitle: string = moment().format('MMMM'); + public yearTitle: string; + public activeMonth: any; + public currentMonthName = this.getMonthName(new Date().getMonth() + 1); + public showData = false; + public currentYear = new Date().getFullYear(); + public attendanceTrackingList: any = []; + public currentDate = new Date(); + public dayHoursTypeDetailsList = []; + month: any; + year: any; + preMonth: number; + nextMonth: any; + + public options = { + cutoutPercentage: 80, + tooltips: { enabled: false }, + legend: { display: false } + }; + + public data = {}; + + public slideOptsOne = { + slidesPerView: 4, + spaceBetween: 10 + }; + + public previousActiveIndex = 0; + public currentActiveIndex = 0; + public searchNameOrUserName = ''; + public searchEmail = ''; + public showEmailInput = false; + public showUserNameOrNameInput = true; + constructor( + public timeCardService: TimeCardService, public menuService: MenuService, public common: CommonService, public myTeamService: MyTeamService, @@ -38,58 +101,281 @@ export class DetailsComponent implements OnInit { public modalController: ModalController, private location: Location, public authService: AuthenticationService, - ) { - console.log("Constuctor called"); - } + public dashboardService: DashboredService, + ) { } + ngOnInit() { this.intializeMemberDetail(); + this.showAttendanceTracking(); + } + + showAttendanceTracking() { + this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false); + const request = { + P_SELECTED_EMPLOYEE_NUMBER: this.employee.EMPLOYEE_NUMBER + }; + this.dashboardService.getAttendanceTracking(request).subscribe((result: AttendanceTrackingResponse) => { + if (this.common.validResponse(result)) { + const key = 'GetAttendanceTrackingList'; + this.attendanceTrackingList = result[key]; + } + }); + } + + public segmentChanged(event: any) { + this.activeSegment = event.detail.value; + if (this.activeSegment === 'Attendance') { + this.normalDays = []; + this.initAttendance(); + } + } + + initAttendance() { + this.showData = false; + this.nextMonth = new Date().getMonth() + 2; + this.preMonth = new Date().getMonth() - 2; + if (this.preMonth < 0) { + this.preMonth = this.preMonth * - 1; + } else { + this.preMonth = this.preMonth * - 1; + } + this.calendarConfig(this.getMonthName(new Date().getMonth() + 1) , new Date().getFullYear()); + } + + calendarConfig(month?, year?) { + this.arrDaysOff = []; + this.arrDaysAttendance = []; + this.arrDaysAbsent = []; + this.month = month; + this.year = year; + this.getTimeCardSummaryDetails(month, year); + this.getDayHoursTypeDetails(month, year); + } + + public getDayHoursTypeDetails(month?, year?) { + console.log('getDayHoursTypeDetails'); + const dayAndHoursReqObj = new GetDayAndHoursDetailsRequest(); + this.monthName = month; + this.yearDate = year; + this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); + this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); + this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); + this.menuType = this.selMenu.List_Menu.MENU_TYPE; + + dayAndHoursReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.employee.EMPLOYEE_NUMBER; + dayAndHoursReqObj.P_MENU_TYPE = 'M'; + dayAndHoursReqObj.P_SELECTED_RESP_ID = this.respID; + dayAndHoursReqObj.SearchMonth = this.monthName; + dayAndHoursReqObj.SearchYear = this.yearDate; + dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber; + dayAndHoursReqObj.P_PAGE_LIMIT = 100; + + this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj).subscribe((result) => { + if (this.common.validResponse(result)) { + console.log(result.GetDayHoursTypeDetailsList); + this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs'); + this.countAllAttendDays(result.GetDayHoursTypeDetailsList); + this.dayHoursTypeDetailsList = result.GetDayHoursTypeDetailsList; + } + }); + + } + + nextSlide() { + this.normalDays = []; + if (this.currentMonthName !== this.month) { + this.showData = false; + if (this.nextMonth > 12) { + this.currentYear = this.currentYear + 1; + this.nextMonth = 1; + } + this.currentDate = new Date(this.currentYear, (this.nextMonth - 1), 1); + this.calendarConfig(this.getMonthName(this.nextMonth) , this.currentYear); + this.nextMonth = this.nextMonth + 1; + this.preMonth = this.nextMonth - 2; + } + } + + previousSlide() { + this.normalDays = []; + this.showData = false; + if (this.preMonth === 0) { + this.currentYear = this.currentYear - 1; + this.preMonth = 12; + } + this.currentDate = new Date(this.currentYear, (this.preMonth - 1), 1); + console.log(this.currentDate); + this.calendarConfig(this.getMonthName(this.preMonth) , this.currentYear); + this.preMonth = this.preMonth - 1; + this.nextMonth = this.preMonth + 2; + } + + + changeMonthTitle(title) { + this.monthTitle = title; + this.getTimeCardSummaryDetails(); + } + changeYear(year) { + this.yearTitle = year; } - intializeMemberDetail(userID?){ - + countAllAttendDays(allDays) { + // tslint:disable-next-line:prefer-for-of + for (let i = 0; i < allDays.length; i++) { + // tslint:disable-next-line: triple-equals + if (allDays[i].ATTENDED_FLAG == 'Y') { + allDays[i].present = true; + allDays[i].absent = false; + allDays[i].daysOff = false; + allDays[i].schedule = false; + this.arrDaysAttendance.push({ + startTime: new Date(allDays[i].SCHEDULE_DATE), + endTime: new Date(allDays[i].SCHEDULE_DATE) + }); + // tslint:disable-next-line: triple-equals + } else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].ABSENT_FLAG == 'Y') { + allDays[i].present = false; + allDays[i].absent = true; + allDays[i].daysOff = false; + allDays[i].schedule = false; + this.arrDaysAbsent.push({ + startTime: new Date(allDays[i].SCHEDULE_DATE), + endTime: new Date(allDays[i].SCHEDULE_DATE), + isoTime: '09:00:00', + allDay: false + }); + // tslint:disable-next-line: triple-equals + } else if (allDays[i].ATTENDED_FLAG == 'N' && allDays[i].DAY_TYPE === 'OFF') { + allDays[i].present = false; + allDays[i].absent = false; + allDays[i].daysOff = true; + allDays[i].schedule = false; + this.arrDaysOff.push({ + startTime: new Date(allDays[i].SCHEDULE_DATE), + endTime: new Date(allDays[i].SCHEDULE_DATE) + }); + } else { + allDays[i].present = false; + allDays[i].absent = false; + allDays[i].daysOff = false; + allDays[i].schedule = true; + this.normalDays.push({ + startTime: new Date(allDays[i].SCHEDULE_DATE), + endTime: new Date(allDays[i].SCHEDULE_DATE) + }); + } + } + this.showData = true; + console.log(this.arrDaysOff); + console.log(this.arrDaysAttendance); + console.log(this.arrDaysAbsent); + console.log(this.normalDays); + } + + public getTimeCardSummaryDetails(month?, year?) { + const timeCardSummaryReqObj = new GetTimeCardSummaryRequest(); + this.monthName = month; + this.yearDate = year; + + this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); + this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); + this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); + this.menuType = this.selMenu.List_Menu.MENU_TYPE; + + timeCardSummaryReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.employee.EMPLOYEE_NUMBER; + timeCardSummaryReqObj.P_MENU_TYPE = 'M'; + timeCardSummaryReqObj.P_SELECTED_RESP_ID = this.respID; + timeCardSummaryReqObj.SearchMonth = this.monthName; + timeCardSummaryReqObj.SearchYear = this.yearDate; + + this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj).subscribe((result) => { + if (this.common.validResponse(result)) { + + this.timeCardSummaryData = result.GetTimeCardSummaryList[0]; + this.absentDays = this.timeCardSummaryData.ABSENT_DAYS; + this.attendedDays = this.timeCardSummaryData.ATTENDED_DAYS; + + // this.totalAttendancePrecentage = this.timeCardSummaryData.PERIOD_DAYS - this.timeCardSummaryData.OFF_DAYS; + // if (this.absentDays === 0 && this.attendedDays === 0) { + // this.futrueDays = this.totalAttendancePrecentage; + // } + this.totalAttendancePrecentage = this.absentDays + this.attendedDays; + if (this.totalAttendancePrecentage > 0) { + this.data = { + datasets: [ + { + data: [this.absentDays, this.attendedDays], + backgroundColor: [ + '#094875', + '#22c6b3' + ], + borderWidth: 2 + }] + }; + } + } + }); + } + + public getMonthName(value: any): any { + switch (value) { + case 1: + return 'January'; + case 2: + return 'February'; + case 3: + return 'March'; + case 4: + return 'April'; + case 5: + return 'May'; + case 6: + return 'June'; + case 7: + return 'July'; + case 8: + return 'August'; + case 9 : + return 'September'; + case 10: + return 'October'; + case 11: + return 'November'; + case 12: + return 'December'; + + } + } + + intializeMemberDetail(userID?) { + this.empSubordinate = []; + this.activeSegment = 'About'; this.pageLimit = 50; this.pageNum = 1; - this.employee = this.common.sharedService.getSharedData( - MyTeamService.EMPLOYEE_SHARED_DATA, - false - ); - let employees = this.common.sharedService.getSharedData( DetailsComponent.opendEmployeesARR, false); - if( employees ){ + this.employee = this.common.sharedService.getSharedData(MyTeamService.EMPLOYEE_SHARED_DATA, false); + const employees = this.common.sharedService.getSharedData( DetailsComponent.opendEmployeesARR, false); + if ( employees ) { this.opendEmployees.push(this.employee); this.common.sharedService.setSharedData(this.opendEmployees, DetailsComponent.opendEmployeesARR); } - //this.opendEmployees = employees; - - console.log(this.employee); - this.selMenu = this.common.sharedService.getSharedData( - MenuResponse.SHARED_DATA, - false - ); - this.headerTitle = this.selMenu.List_Menu.MENU_NAME; - - - this.isSpecialist = this.common.sharedService.getSharedData( - 'isSpecialist', - false - ) ? true :false; - - // this.isSpecialist = this.navParams.get("isSpecialist") - // ? this.navParams.get("isSpecialist") - // : false; - - if (this.employee) this.getEmpSubordinate(userID); + this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); + this.headerTitle = this.selMenu.List_Menu.MENU_NAME; + this.isSpecialist = this.common.sharedService.getSharedData('isSpecialist', false) ? true : false; + if (this.employee) { + this.getEmpSubordinate(userID); + } } goback() { - //this.location.back(); const user = this.authService.getAuthenticatedUser(); - if(this.employee.SUPERVISOR_NUMBER==user.EMPLOYEE_NUMBER || this.opendEmployees.length == 1){ - this.opendEmployees=[]; + if (this.employee.SUPERVISOR_NUMBER === user.EMPLOYEE_NUMBER || this.opendEmployees.length === 1) { + this.opendEmployees = []; this.common.openMyTeamPage(); - }else{ - for(let i=0;i { - this.handleEmpResult(result); - }); + this.getEmployeeSubordinatesRequestObject = body; + this.myTeamService.getEmployeeSubordinates(body).subscribe((result: any) => { + console.log('one'); + if (this.common.validResponse(result)) { + this.handleEmpResult(result.GetEmployeeSubordinatesList); + } + }); } handleEmpResult(result) { - //let employeeSubordinate=resFlag.GetEmployeeSubordinatesList; - //this.nav.push("MyTeamPage",{empSubordinate:employeeSubordinate}); - if (this.common.validResponse(result)) { - if (this.common.hasData(result.GetEmployeeSubordinatesList)) { - this.empSubordinate = result.GetEmployeeSubordinatesList; - // this.pageNum++; - this.infiniteRequest.P_PAGE_NUM= this.pageNum++; - let lastItemIndex = this.empSubordinate.length - 1; - if (result.GetEmployeeSubordinatesList[lastItemIndex]) { - let lastitem = result.GetEmployeeSubordinatesList[lastItemIndex]; - if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { - this.IsReachEnd = true; - } else { - this.IsReachEnd = false; - } + const lastItemIndex = result.length - 1; + const lastItem = result[lastItemIndex]; + if (lastItem) { + if (lastItem.NO_OF_ROWS === lastItem.ROW_NUM) { + this.isReachEnd = true; + if (this.infiniteScroll) { + this.infiniteScroll.complete(); } } else { - this.empSubordinate = []; + this.isReachEnd = false; + if (this.infiniteScroll) { + this.infiniteScroll.complete(); + } } } - } - doInfinite(infiniteScroll) { - if (!this.IsReachEnd && this.infiniteRequest) { - // this.infiniteRequest.P_PAGE_NUM = this.pageNum; - this.myTeamService - .getEmployeeSubordinates(this.infiniteRequest) - .subscribe( - (result: any) => { - if (this.common.validResponse(result)) { - this.infiniteRequest.P_PAGE_NUM= this.pageNum++; - - if (this.common.hasData(result.GetEmployeeSubordinatesList)) { - result.GetEmployeeSubordinatesList.forEach(vr => { - if (vr.ROW_NUM == vr.NO_OF_ROWS) { - this.IsReachEnd = true; - } else { - this.IsReachEnd = false; - } - this.empSubordinate.push(vr); - // this.pro.GetVacationRulesList.push(vr); - }); - } else { - this.IsReachEnd = true; - } - } - //this.P_PAGE_NUM++; - if (infiniteScroll) this.infiniteScroll.complete(); - - // console.log(resFlag); - }, - Error => console.log(Error), - () => this.infiniteScroll.complete() - ); + if (this.common.hasData(result)) { + this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM++; + if (this.empSubordinate.length === 0) { + this.empSubordinate = result; + } else { + this.empSubordinate = this.empSubordinate.concat(result); + } } else { - if (infiniteScroll) this.infiniteScroll.complete(); + this.empSubordinate = []; + } +} + +doInfinite(infiniteScroll) { + if (!this.isReachEnd) { + this.myTeamService.getEmployeeSubordinates(this.getEmployeeSubordinatesRequestObject).subscribe((result: any) => { + console.log('two'); + if (this.common.validResponse(result)) { + this.handleEmpResult(result.GetEmployeeSubordinatesList); + } + this.infiniteScroll.complete(); + }); + } else { + if (this.infiniteScroll) { + this.infiniteScroll.complete(); } } +} + getDetails(index) { - //this.empSubordinate[index].isModal = true; - this.common.sharedService.setSharedData( - this.empSubordinate[index], - MyTeamService.EMPLOYEE_SHARED_DATA - ); + this.common.sharedService.setSharedData(this.empSubordinate[index], MyTeamService.EMPLOYEE_SHARED_DATA); this.intializeMemberDetail(); - // this.presentModal(); - } - async presentModal() { - //this.modalFlag = true; - const modal = await this.modalController.create({ - component: DetailsComponent, - keyboardClose: true, - animated: false - }); - let dismissed = modal.onDidDismiss(); - dismissed.then(() => { - this.modalFlag = false; - }); - return await modal.present(); } + getMenuEntries(item) { - let selEmpNo: String = null; - let respID: any = -999; - let menuType: string = "M"; + let selEmpNo = null; + const respID: any = -999; + let menuType = 'M'; let nationality: string; - if (this.isSpecialist == true) { - // respID = this.sharedData.getSharedData( - // MenuResponse.SHARED_SEL_RESP_ID, - // true - // ); - menuType = "S"; + if (this.isSpecialist === true) { + menuType = 'S'; } selEmpNo = item.EMPLOYEE_NUMBER; nationality = item.NATIONALITY_CODE; const body = { - P_MENU_TYPE: menuType, //to check + P_MENU_TYPE: menuType, // to check P_SELECTED_EMPLOYEE_NUMBER: selEmpNo, P_SELECTED_RESP_ID: respID, NationalityCode: nationality }; - //set emp and resp id - this.common.sharedService.setSharedData(selEmpNo, MenuResponse.SHARED_SEL_EMP); - this.common.sharedService.setSharedData( + // set emp and resp id + this.common.sharedService.setSharedData(selEmpNo, MenuResponse.SHARED_SEL_EMP); + this.common.sharedService.setSharedData( body.P_SELECTED_RESP_ID, MenuResponse.SHARED_SEL_RESP_ID ); @@ -283,35 +518,29 @@ export class DetailsComponent implements OnInit { } sortMenuEntires(list) { - this.close().then(() => { - }); - let tree = this.common.list_to_tree(list); - this.common.sharedService.setSharedData(tree, "menuEntries"); - // this.common.navigateForward("/eit/homepage"); + const tree = this.common.list_to_tree(list); + this.common.sharedService.setSharedData(tree, 'menuEntries'); + this.common.sharedService.setSharedData("myteam", "homemenuentries"); this.common.openEITPage(); - // let tree = this.common.list_to_tree(list); - // this.navCtrl.push("MenuEntriesPage", { menuEntries: tree }); } - public async close() { - const modal = await this.modalController.getTop(); - if (modal) { - modal.dismiss(); - } - } goToSubordinate() { - this.selMenu.search=true; + this.selMenu.search = true; this.common.sharedService.setSharedData( this.selMenu, MenuResponse.SHARED_DATA ); - + this.common.openMyTeamPage(); - //this.navCtrl.push("MySubordinatePage", { isSearch: true }); } - dismiss() { - this.modalController.dismiss({ - dismissed: true - }); + + showSelectedField(value: any) { + if (this.searchKeySelect === 'User Name' || this.searchKeySelect === 'User Name') { + this.showEmailInput = false; + this.showUserNameOrNameInput = true; + } else if (this.searchKeySelect === 'Email') { + this.showUserNameOrNameInput = false; + this.showEmailInput = true; + } } } diff --git a/Mohem/src/app/my-team/home/home.component.html b/Mohem/src/app/my-team/home/home.component.html index bb64c178..350c763e 100644 --- a/Mohem/src/app/my-team/home/home.component.html +++ b/Mohem/src/app/my-team/home/home.component.html @@ -1,76 +1,83 @@ - - - - - - - - {{headerTitle}} - - - - + + + + + {{ts.trPK('myTeam','myTeam-header')}} + + + +
+
+
+ {{ts.trPK('myTeam','todayAttendance')}} +
+
+

{{totalEmployees}}

+ {{ts.trPK('myTeam','total')}}
{{ts.trPK('myTeam','team-members')}}
+
+ +
+ + - - - - - {{ts.trPK('general','search')}} +
+ + - {{ts.trPK('searchForReplacment','name')}} - {{ts.trPK('searchForReplacment','userName')}} - {{ts.trPK('searchForReplacment','email')}} - - - - - - - - - - - - - -

{{subordinate.EMPLOYEE_NAME}}

-

{{subordinate.POSITION_NAME}}

- {{subordinate.NUM_OF_SUBORDINATES}} -
-
- + [(ngModel)]="searchKeySelect" (ionChange)="showSelectedField($event)"> + {{ts.trPK('searchForReplacment','name')}} + {{ts.trPK('searchForReplacment','userName')}} + {{ts.trPK('searchForReplacment','email')}} + +
+ + + + + + + +
+
- +
+ + + Clear Search + + + +
+ + + + + - - - +
+ + + -
- -
- {{ts.trPK('general','search')}} -
-
\ No newline at end of file + \ No newline at end of file diff --git a/Mohem/src/app/my-team/home/home.component.scss b/Mohem/src/app/my-team/home/home.component.scss index d24aa6cf..650979e9 100644 --- a/Mohem/src/app/my-team/home/home.component.scss +++ b/Mohem/src/app/my-team/home/home.component.scss @@ -1,6 +1,163 @@ -.search-icons{font-size:.7cm} -.badge{ - padding: 10px; - border-radius: 50%; - width: 50px; -} \ No newline at end of file +ion-title{ + color: white; + position: absolute; + top: 0; + text-align: center; + left: 15%; + right: 15%; + font-size: 0.42cm; + font-weight: bold; + height: 100%; +} + +.contentBg{ + padding: 0px 20px; +} + +.contentBg:before { + position: absolute; + content: ""; + background: #22c6b3; + height: 140px; + width: 100%; + left: 0; + top: 0px; + z-index: 1; +} +ion-content { + --ion-background-color: whitesmoke; +} +.request-heading { + span { + text-align: center; + display: block; + padding-top: 8px; + font-family: workSans-Regular; + } +} + +.result-graph { + position: relative; + background: white; + margin-top: 20px; + padding-bottom: 20px; + border-radius: 20px; + z-index: 1; + } + .result-text-container { + padding: 0; + margin: 0; + position: absolute; + left: 50%; + top: 50%; + display: block; + text-align: center; + transform: translate(-50%, -50%); + h2 { + font-size: 38px; + font-family: WorkSans-Bold; + margin: 0 auto; + line-height: 36px; + } + span { + width: 125px; + display: block; + margin: 0 auto; + font-size: 12px; + font-family: workSans-Regular; + } + } + .today-graph { + width: 100%; + max-height: 4cm; + } + +.swiper-container { + margin: 0 !important; + width: 100% !important; +} +.filters-row { + margin-top: 10px; +} +.search-input { + margin-top: 15px; + background: white; + border-radius: 15px; + ion-input { + border-bottom-color: transparent; + } +} +.search-dropdown{ + background: #22c6b3; + ion-select { + .select-text{ + margin-left: -10px; + } + .select-icon{ + .select-icon-inner{ + opacity: 1; + color: white; + margin-top: -1px; + } + } + } +} +.input-container{ + background: white; + ion-input{ + border-bottom-color: transparent; + } +} + +.user-image-container{ + position: relative; + width: 80px; + height: 80px; + display: block; + margin: 0 auto; + &:before{ + position: absolute; + content: ""; + width: 20px; + height: 20px; + border-radius: 20px; + border: 1px solid white; + top: 0; + right: 0; + background-color: red; + z-index: 9; + } + &.present:before{ + background-color: green !important; + } +} +.user-image{ + overflow: hidden; + position: relative; + display: block; + width: 100%; + height: 100%; + border-radius: 80px; + border: 1px solid #ccc; + margin: 0px auto 6px; +} + +.search-container{ + margin-top: 15px; + ion-col{ + background: white; + border-radius: 12px; + padding-right: 10px; + flex: none; + ion-icon{ + margin-right: 3px; + font-size: 14px; + margin-left: 3px; + vertical-align: middle; + } + span{ + font-size: 12px; + vertical-align: middle; + } + } +} diff --git a/Mohem/src/app/my-team/home/home.component.ts b/Mohem/src/app/my-team/home/home.component.ts index c0f8c7e8..46d4048a 100644 --- a/Mohem/src/app/my-team/home/home.component.ts +++ b/Mohem/src/app/my-team/home/home.component.ts @@ -1,32 +1,87 @@ -import { Component, OnInit, ViewChild } from "@angular/core"; -import { Location } from "@angular/common"; -import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; -import { CommonService } from "src/app/hmg-common/services/common/common.service"; -import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; -import { MenuResponse } from "src/app/hmg-common/services/menu/models/menu-response"; -import { MyTeamService } from "../service/my-team.service"; -import { ModalController, IonInfiniteScroll } from "@ionic/angular"; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Location } from '@angular/common'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import { MyTeamService } from '../service/my-team.service'; +import { ModalController, IonInfiniteScroll } from '@ionic/angular'; import { DetailsComponent } from '../details/details.component'; @Component({ - selector: "app-home", - templateUrl: "./home.component.html", - styleUrls: ["./home.component.scss"] + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.scss'] }) export class HomeComponent implements OnInit { @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; - pageNum: number = 1; - pageLimit: number = 50; - empSubordinate: any; - employee: any; - public headerTitle: string = ""; - IsReachEnd: boolean = false; - searchKey: any; - public isSearch: boolean = false; - public searchKeySelect: any; - infiniteRequest: any; - selMenu: any; - selEmpNo: any; + public pageNum = 1; + public pageLimit = 50; + public empSubordinate = []; + public employee: any; + public isReachEnd = false; + public searchKey: any; + public isSearch = false; + public searchKeySelect = 'Name'; + public getEmployeeSubordinatesRequestObject: any; + public selMenu: any; + public selEmpNo: any; + public totalEmployees = 0; + + public options = { + cutoutPercentage: 80, + tooltips: { enabled: false }, + legend: { display: false } + }; + public data = { + datasets: [ + { + data: [100], + backgroundColor: [ + '#22c6b3' + ], + borderWidth: 5 + }] + }; + // public filters = [ + // { + // value: 0, + // name: 'All', + // active: true, + // color: '#124375' + // }, + // { + // value: 0, + // name: 'Present', + // active: false, + // color: '#18a169' + // }, + // { + // value: 0, + // name: 'Absent', + // active: false, + // color: '#38c9b3' + // }, + // { + // value: 0, + // name: 'Late', + // active: false, + // color: '#114475' + // } + // ]; + + public slideOptsOne = { + slidesPerView: 4, + spaceBetween: 10 + }; + + public previousActiveIndex = 0; + public currentActiveIndex = 0; + public searchNameOrUserName = ''; + public searchEmail = ''; + public showEmailInput = false; + public showUserNameOrNameInput = true; + constructor( public ts: TranslatorService, public authService: AuthenticationService, @@ -40,63 +95,44 @@ export class HomeComponent implements OnInit { this.common.sharedService.setSharedData( [], DetailsComponent.opendEmployeesARR); this.setIntitial(); } + + // activeFilter(index: number) { + // this.previousActiveIndex = this.currentActiveIndex; + // this.currentActiveIndex = index; + // this.filters[this.previousActiveIndex].active = false; + // this.filters[this.currentActiveIndex].active = true; + // } + goback() { this.location.back(); } - getData() {} + setIntitial() { - this.selMenu = this.common.sharedService.getSharedData( - MenuResponse.SHARED_DATA, - false - ); - this.headerTitle = this.selMenu.List_Menu.MENU_NAME; + this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); this.selEmpNo = this.selMenu.userid; this.isSearch = this.selMenu.search ? this.selMenu.search : this.isSearch; - // this.isSearch=this.navParams.get("isSearch")?this.navParams.get("isSearch") : false; - if (!this.isSearch) this.getEmpSubordinate(); + if (!this.isSearch) { + this.getEmpSubordinate(); + } + } + + searchEmployee() { + this.isSearch = true; + this.empSubordinate = []; + this.getEmpSubordinate(); } + getEmpSubordinate() { - console.log("getEmpSubordinate my team home"); this.pageNum = 1; - this.IsReachEnd = false; - let searchEmpNum = ""; - let searchEmpName = ""; - let searchEmpEmail = ""; - if (this.searchKey) { - switch (this.searchKeySelect) { - case "1": { - searchEmpName = this.searchKey; - searchEmpNum = ""; - searchEmpEmail = ""; + this.isReachEnd = false; + const searchEmpNum = (this.searchKeySelect === 'User Name') ? this.searchNameOrUserName : ''; + const searchEmpName = (this.searchKeySelect === 'Name') ? this.searchNameOrUserName : ''; + const searchEmpEmail = (this.searchKeySelect === 'Email') ? this.searchEmail : ''; - break; - } - case "2": { - searchEmpNum = this.searchKey; - searchEmpName = ""; - searchEmpEmail = ""; - break; - } - case "3": { - searchEmpEmail = this.searchKey; - searchEmpNum = ""; - searchEmpName = ""; - break; - } - default: { - searchEmpNum = ""; - searchEmpName = ""; - searchEmpEmail = ""; - break; - } - } - } else { - searchEmpNum = ""; - searchEmpName = ""; - searchEmpEmail = ""; - } if (this.isSearch) { this.selEmpNo = null; + } else { + this.selEmpNo = this.selMenu.userid; } const body = { @@ -107,172 +143,85 @@ export class HomeComponent implements OnInit { P_PAGE_NUM: this.pageNum, P_PAGE_LIMIT: this.pageLimit }; - this.infiniteRequest = body; - this.myTeamService - .getEmployeeSubordinates(body) - .subscribe((result: any) => { - this.handleEmpResult(result); - }); + this.getEmployeeSubordinatesRequestObject = body; + this.myTeamService.getEmployeeSubordinates(body).subscribe((result: any) => { + if (this.common.validResponse(result)) { + this.totalEmployees = result.P_NUM_OF_SUBORDINATES; + this.handleEmpResult(result.GetEmployeeSubordinatesList); + } + }); } handleEmpResult(result) { - if (this.common.validResponse(result)) { - if (this.common.hasData(result.GetEmployeeSubordinatesList)) { - - this.empSubordinate = result.GetEmployeeSubordinatesList; - this.infiniteRequest.P_PAGE_NUM++; - const lastItemIndex = this.empSubordinate.length - 1; - if (result.GetEmployeeSubordinatesList[lastItemIndex]) { - const lastitem = result.GetEmployeeSubordinatesList[lastItemIndex]; - if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { - this.IsReachEnd = true; - } else { - this.IsReachEnd = false; + const lastItemIndex = result.length - 1; + const lastItem = result[lastItemIndex]; + if (lastItem) { + if (lastItem.NO_OF_ROWS === lastItem.ROW_NUM) { + this.isReachEnd = true; + if (this.infiniteScroll) { + this.infiniteScroll.complete(); } + } else { + this.isReachEnd = false; + if (this.infiniteScroll) { + this.infiniteScroll.complete(); + } + } + } + if (this.common.hasData(result)) { + this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM++; + if (this.empSubordinate.length === 0) { + this.empSubordinate = result; + } else { + this.empSubordinate = this.empSubordinate.concat(result); } } else { this.empSubordinate = []; } - } - } - - - - - - - - doInfinite1(infiniteScroll) { - console.log("test"); - if (!this.IsReachEnd && this.infiniteRequest) { - console.log("not ReachEnd"); - - this.infiniteRequest.P_PAGE_NUM = this.pageNum; - this.myTeamService - .getEmployeeSubordinates(this.infiniteRequest) - .subscribe( - (result: any) => { - if (this.common.validResponse(result)) { - this.pageNum++; - if (this.common.hasData(result.GetEmployeeSubordinatesList)) { - result.GetEmployeeSubordinatesList.forEach(vr => { - if (vr.ROW_NUM == vr.NO_OF_ROWS) { - this.IsReachEnd = true; - } else { - this.IsReachEnd = false; - } - this.empSubordinate.push(vr); - // this.pro.GetVacationRulesList.push(vr); - }); - } else { - this.IsReachEnd = true; - } - } - //this.P_PAGE_NUM++; - if (infiniteScroll) { - infiniteScroll.complete(); - } - // console.log(resFlag); - }, - Error => console.log(Error), - () => infiniteScroll.complete() - ); - } else { - if (infiniteScroll) { - infiniteScroll.complete(); - } - } } - doInfinite(infiniteScroll) { - //this.pageNum= this.pageNum + 1; - console.log("test doInfinite"); - if (!this.IsReachEnd) { - console.log("test doInfinite not ReachEnd"); - - this.myTeamService - .getEmployeeSubordinates(this.infiniteRequest).subscribe( - (result: any) => { + if (!this.isReachEnd) { + this.myTeamService.getEmployeeSubordinates(this.getEmployeeSubordinatesRequestObject).subscribe((result: any) => { if (this.common.validResponse(result)) { - this.infiniteRequest.P_PAGE_NUM++; - if (this.common.hasData(result.GetEmployeeSubordinatesList)) { - result.GetEmployeeSubordinatesList.forEach(element => { - if (element.ROW_NUM == element.NO_OF_ROWS) { - this.IsReachEnd = true; - } else { - this.IsReachEnd = false; - } - this.empSubordinate.push(element); - }); - } // if list length >0 - else { - this.IsReachEnd = true; - } - } // if response == 1 - //this.pageNum++; + this.handleEmpResult(result.GetEmployeeSubordinatesList); + } this.infiniteScroll.complete(); - } - ); + }); } else { - if (this.infiniteScroll) + if (this.infiniteScroll) { this.infiniteScroll.complete(); + } } - } //end infiniteScroll - - - + } + clearSearch() { + this.isSearch = false; + this.getEmployeeSubordinatesRequestObject.P_PAGE_NUM = 1; + this.empSubordinate = []; + this.isReachEnd = false; + this.searchNameOrUserName = ''; + this.searchEmail = ''; + this.getEmpSubordinate(); + } getDetails(index) { - this.common.sharedService.setSharedData( - this.empSubordinate[index], - MyTeamService.EMPLOYEE_SHARED_DATA - ); - - this.common.sharedService.setSharedData( - this.selMenu, - MenuResponse.SHARED_DATA - ); - this.close().then(() => { - this.common.openMyTeamDetails(); - }); - - //this.modalController.dismiss(); - //this.navCtrl.push("MyTeamPage",{employee:this.empSubordinate[index]}); - } - public async close() { - const modal = await this.modalController.getTop(); - if (modal) { - modal.dismiss(); - } - } - toggleSearch() { - this.isSearch = !this.isSearch; + this.common.sharedService.setSharedData(this.empSubordinate[index], MyTeamService.EMPLOYEE_SHARED_DATA); + this.common.sharedService.setSharedData(this.selMenu, MenuResponse.SHARED_DATA); + this.common.openMyTeamDetails(); } + goToSubordinate() { - //this.navCtrl.push("MySubordinatePage",{isSearch:true}); - //this.getEmpSubordinate(); - this.presentModal(); - } - async presentModal() { - const modal = await this.modalController.create({ - component: HomeComponent, - keyboardClose: true, - animated: false, - componentProps: { isSearch: true } - }); - modal.cssClass="full-modal"; - let dismissed = modal.onDidDismiss(); - dismissed.then(() => { - this.isSearch = false; - }); - return await modal.present(); + // this.presentModal(); } - dismiss() { - this.modalController.dismiss({ - dismissed: true - }); + + showSelectedField(value: any) { + if (this.searchKeySelect === 'User Name' || this.searchKeySelect === 'User Name') { + this.showEmailInput = false; + this.showUserNameOrNameInput = true; + } else if (this.searchKeySelect === 'Email') { + this.showUserNameOrNameInput = false; + this.showEmailInput = true; + } } - } diff --git a/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.html b/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.html index 2011e9ce..df78feca 100644 --- a/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.html +++ b/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.html @@ -1,18 +1,36 @@ - -
-
+ + + + + + Confirmation + + + + + +
-
- + +
+
+
+
+
+ +
+ - - {{ts.trPK('general','confirm')}} + + {{ts.trPK('general','confirm')}} - - {{ts.trPK('general','cancel')}} + + {{ts.trPK('general','cancel')}} diff --git a/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.scss b/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.scss index 0519ecba..1c9a4523 100644 --- a/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.scss +++ b/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.scss @@ -1 +1,14 @@ - \ No newline at end of file +.dynamicFields{ + width: 93%; + border: #dbdbdb solid 1px; + border-radius: 16px; + margin: 10px; + padding: 10px; + +} + +.msgConfirm{ + text-align: center; + font-size: 20px !important; + // font-weight: bold; +} diff --git a/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.ts b/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.ts index 666e31b9..7750f3d9 100644 --- a/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.ts +++ b/Mohem/src/app/notification/apply-action-modal/apply-action-modal.component.ts @@ -4,6 +4,7 @@ import { CommonService } from 'src/app/hmg-common/services/common/common.service import { WorklistMainService } from '../service/work-list.main.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; import { TextAreaInput } from 'src/app/uI-elements/text-area.input'; +import { WorkListActionRequest } from '../models/NotificationActionReq'; @Component({ selector: 'app-apply-action-modal', @@ -15,51 +16,57 @@ export class ApplyActionModalComponent implements OnInit { getpassResAttr: any; getPassNotificationDetails: any; getPassNotification: any; + confirmMsg: string; + getPassActionMode: any; + P_RESPOND_ATTRIBUTES_TBL: any; + selEmployeeID: any; + hideForwordEmployee: any; + private WorkListActionObj: WorkListActionRequest; + messageSuccess: boolean; + constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService,public worklistMainService: WorklistMainService, ) { - this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo'); - this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr'); - this.getPassNotification = this.cs.sharedService.getSharedData('ApplyActionModalPage'); + this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo',false); + this.getpassResAttr = this.cs.sharedService.getSharedData('notificationDynamicAttributeArr' ,false); + this.getPassNotification = this.cs.sharedService.getSharedData('ApplyActionModalPage',false); + this.getPassActionMode = this.cs.sharedService.getSharedData('passActionMode',false); + this.WorkListActionObj = new WorkListActionRequest(); + } ngOnInit() { - document.getElementById("notificationDynamicFields").innerHTML=""; + document.getElementById("notificationDynamicFieldsModal").innerHTML=""; console.log(this.getPassNotificationDetails); //this.applyAction(this.getPassNotificationDetails); this.notificationDynamicFields(this.getpassResAttr); - } + console.log("confirmMsg" + this.confirmMsg) + if (this.getPassActionMode === "APPROVED") { + this.confirmMsg = this.ts.trPK('worklistMain', 'approveMsg') + } + else if (this.getPassActionMode === "REJECTED") { + this.confirmMsg = this.ts.trPK('worklistMain', 'rejectMsg') - applyAction() { - this.worklistMainService - .actionButton(this.getPassNotification) - .subscribe((result: any) => { - this.handleApplayActionResult(result); - }); - } + } + else if (this.getPassActionMode === "DEL") { + this.confirmMsg = this.ts.trPK('worklistMain', 'delMsg') + + } + else if (this.getPassActionMode === "CLOSE") { + this.confirmMsg = this.ts.trPK('worklistMain', 'closeMsg') + + } - handleApplayActionResult(result) { - if (this.cs.validResponse(result)) { - if (result.MessageStatus == 1) { - // this.navCtrl.push("HomePage"); - //this.common.openHome(); - //this.common.openNotificationPage(); - // for( var i = 0; i < this.notificationArray.length; i++){ - // if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) { - // this.notificationArray.splice(i, 1); - // } - // } - ////////////// this.getNotificationCountAfterSubmit(); - ///////////// this.nextNotfification(); - } - } // valid it } + + + notificationDynamicFields(notificationAttr){ - const containerId = 'notificationDynamicFields'; + const containerId = 'notificationDynamicFieldsModal'; for(let i=0;i { + this.handleApplayActionResult(result); + }); + } + + + handleApplayActionResult(result) { + if (this.cs.validResponse(result)) { + if (result.MessageStatus == 1) { + // this.navCtrl.push("HomePage"); + //this.common.openHome(); + //this.common.openNotificationPage(); + // for( var i = 0; i < this.notificationArray.length; i++){ + // if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) { + // this.notificationArray.splice(i, 1); + // } + // } + + this.messageSuccess = true; + + setTimeout(() => { + this.messageSuccess = false; + }, 5000); + this.cs.openNotificationPage(); + + // this.getNotificationCountAfterSubmit(); + //this.nextNotfification(); + } + } // valid it + } } diff --git a/Mohem/src/app/notification/home/home.component.html b/Mohem/src/app/notification/home/home.component.html index 06bc2bfd..3a4e61fb 100644 --- a/Mohem/src/app/notification/home/home.component.html +++ b/Mohem/src/app/notification/home/home.component.html @@ -1,227 +1,94 @@ - - {{ts.trPK('home','worklist')}} - - - + + + + + WORK LIST - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
+
+
+ Open Request Analysis +
+
+

{{totalRequestCount}}

+ TOTAL
OPEN REQUEST
+
+ +
+ + + + + + + + + + + + Clear Search + + + + + Advanced Search + + + - - - - - - - - - - - - + + + + + + {{segment.name}} + + + - - - -
- - -
{{notificationList.BEGIN_DATE | dateString }}
-
- - -
-
-
- - {{notificationList.SUBJECT}} - - -
- -
-
- - - There is no Notification - - - - - - -
-
- - - - - +
+
+ + +
+ No Data Available +
+
+ -
- - {{ts.trPK('worklist','search')}} - - - - - - - -
- - {{ts.trPK('worklist','view')}} - - {{ts.trPK('worklist','openNot')}} - {{ts.trPK('worklist','fyi')}} - {{ts.trPK('worklist','toDo')}} - {{ts.trPK('worklist','all')}} - {{ts.trPK('worklist','meNot')}} - - - -
-
- - {{ts.trPK('worklist','searchby')}} - - {{ts.trPK('worklist','from')}} - {{ts.trPK('worklist','subject')}} - {{ts.trPK('worklist','sent')}} - {{ts.trPK('worklist','itemType')}} - {{ts.trPK('worklist','none')}} - - - -
-
- - {{ts.trPK('worklist','sent')}} - - -
-
- - - - -
-
-
- - {{ts.trPK('worklist','search')}} - - {{ts.trPK('general','close')}} -
- - Call details ITG - Call count ITG - -
-
-
-
-
\ No newline at end of file diff --git a/Mohem/src/app/notification/home/home.component.scss b/Mohem/src/app/notification/home/home.component.scss index bd5af293..19ac087d 100644 --- a/Mohem/src/app/notification/home/home.component.scss +++ b/Mohem/src/app/notification/home/home.component.scss @@ -216,4 +216,205 @@ ion-input ,ion-datetime{ .emptyItem{ white-space: normal; padding-left: 10%; -} \ No newline at end of file +} + +///////////////////////////////////////////NEW DESIGN///////////////////////////////////// + + +.profile-image-container{ + position: relative; + z-index: 999; + img { + width: 32px; + float: right; + border-radius: 20px; + height: 32px; + margin-right: 10px; + } +} +ion-title{ + color: white; + position: absolute; + top: 0; + text-align: center; + left: 15%; + right: 15%; + font-size: 0.42cm; + font-weight: bold; + height: 100%; +} + +.contentBg:before { + position: absolute; + content: ""; + background: #22c6b3; + height: 140px; + width: 100%; + left: 0; + top: 0px; + z-index: 1; +} +ion-content { + --ion-background-color: whitesmoke; +} +.request-heading { + span { + text-align: center; + display: block; + padding-top: 8px; + font-family: workSans-Regular; + } +} + +.result-graph { + position: relative; + background: white; + margin-right: 20px; + margin-left: 20px; + margin-top: 20px; + padding-bottom: 20px; + border-radius: 20px; + z-index: 1; + } + .result-text-container { + padding: 0; + margin: 0; + position: absolute; + left: 50%; + top: 50%; + display: block; + text-align: center; + transform: translate(-50%, -50%); + h2 { + font-size: 38px; + font-family: WorkSans-Bold; + margin: 0 auto; + line-height: 36px; + } + span { + width: 125px; + display: block; + margin: 0 auto; + font-size: 12px; + font-family: workSans-Regular; + } + } + .today-graph { + width: 100%; + max-height: 4cm; + } + + .swiper-container { + margin: 0 !important; + width: 100% !important; + } +.filters-row { + margin-top: 10px; + margin-left: 20px; +} +.work-list-container { + position: relative; + padding-left: 60px; + clear: both; + min-height: 200px; + margin-bottom: 80px; + padding-top: 15px; +} +.work-list-container:before{ + content: ""; + position: absolute; + height: 100%; + width: 4px; + left: 30px; + top: 15px; + background-color: #dddddd; +} +.search-container{ + margin-top: 15px; + display: block; + padding: 0 20px; + ion-col{ + background: white; + border-radius: 12px; + padding-right: 10px; + flex: none; + ion-icon{ + margin-right: 3px; + font-size: 14px; + margin-left: 3px; + vertical-align: middle; + } + span{ + font-size: 12px; + vertical-align: middle; + } + } +} +.date-span { + position: relative; + display: block; + margin-bottom: 10px; +} +.date-span:before{ + content: ""; + position: absolute; + left: -35px; + border-radius: 50%; + width: 15px; + height: 15px; + background-color: #38c9b3; + top: 1px; +} +.date-data{ + background-color: white; + padding: 1px; + border-radius: 20px; + font-family: WorkSans-Regular; + padding-left: 15px; + margin-right: 20px; + margin-bottom: 15px; + p{ + font-size: 14px; + } +} +.no-data-available { + background: white; + font-family: WorkSans-Regular; + padding: 30px; + position: absolute; + left: 50%; + margin-left: -100px; + margin-top: 100px; +} +.disable-filter { + pointer-events: none; + opacity: .3; +} +.total-result { + margin-top: 55px; + padding-left: 20px; + color: #888; + font-size: 15px; +} +.text-span{ + font-size: 14px; + color: #888; + background-color: white; + width: 93%; + height: 30px; + border: 1px solid; + border-radius: 15px; +} + +.text-span-active{ + font-size: 14px; + color: #888; + background-color:#22c6b3; + width: 93%; + height: 30px; + border: 1px solid; + border-radius: 15px; +} +.slideCss{ + width: 200px !important; +} diff --git a/Mohem/src/app/notification/home/home.component.ts b/Mohem/src/app/notification/home/home.component.ts index 2a1eb375..7b9e3d72 100644 --- a/Mohem/src/app/notification/home/home.component.ts +++ b/Mohem/src/app/notification/home/home.component.ts @@ -1,336 +1,458 @@ -import { Component, OnInit, ViewChild } from "@angular/core"; -import { CommonService } from "src/app/hmg-common/services/common/common.service"; -import { TranslatorService } from "src/app/hmg-common/services/translator/translator.service"; -import { WorkListRequest } from "../models/workListRequest"; -import * as moment from "moment"; -import { WorKListResponse } from "../models/workListResponse"; -import { WorklistService } from "../service/worklist.service"; +import { Component, OnInit, ViewChild } from '@angular/core'; +import { ModalController } from '@ionic/angular'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { WorkListRequest } from '../models/workListRequest'; +import * as moment from 'moment'; +import { WorklistService } from '../service/worklist.service'; import { IonInfiniteScroll } from '@ionic/angular'; import { WorklistMainService } from '../service/work-list.main.service'; +import { WorklistAdvancedSearchComponent } from '../worklist-advanced-search/worklist-advanced-search.component'; +import { DatePipe } from '@angular/common'; + @Component({ - selector: "app-home", - templateUrl: "./home.component.html", - styleUrls: ["./home.component.scss"] + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.scss'] }) export class HomeComponent implements OnInit { - // @ViewChild(Navbar) navBar: Navbar; + public static REQUSET_NAME = 'requst_name'; + public static REQUSET_INFO = 'requset_info'; + public static ALL_REQUEST = 'all_request'; public static NOTIFICATION_DATA = 'notification_data'; public static NOTIFICATION_ARR = 'notification_arr'; @ViewChild(IonInfiniteScroll) infiniteScroll: IonInfiniteScroll; private WorkListObj: WorkListRequest; - WorkListResObj: any; //WorKListResponse; - notificationType: string = "1"; - pageNum: number = 1; + WorkListResObj: any; + notificationType = '1'; + pageNum = 1; rowsNo: number; noOfrows: number; - selectedValue: string = ""; - FromUserName: string = ""; - ItemKeyDisplayName: string = ""; - SentDate: string = ""; - Subject: string = ""; - inputSearch: string = ""; - HideDateInput: boolean = false; - HideTextInput: boolean = false; - InputDate: string; + selectedValue = ''; + FromUserName = ''; + ItemKeyDisplayName = ''; + SentDate = ''; + Subject = ''; + inputSearch = ''; + inputDate: string; filteredNotificationList: any; - IsReachEnd: boolean = false; - public noData: boolean = false; - public isAll: boolean = true; - public isPR: boolean = false; - public isPO: boolean = false; - public isMR: boolean = false; - public isHR: boolean = false; - public isITG: boolean = false; - public isSearch: boolean = false; + isReachEnd = false; + public isAll = true; + public isPR = false; + public isPO = false; + public isMR = false; + public isHR = false; + public noData = false; + public isITG = false; + public isSearch = false; public direction = 'ltr'; + public ITGCount = 0; + public ITGSegment: {name: string, code: any, data: any, style: boolean} [] = []; + public ITGAllItem: any = []; + public selectedITGToActive = false; + public ITGItem: any = []; + public activeSegment: any; + + public currentActiveIndex = 0; + public previousActiveIndex = 0; + public worklistNotifications: any; + public totalRequestCount = 0; + public newWorkListResponse = []; + public showFormattedData = {}; + public selectedFilter = 'ALL'; + public showSearchButton = false; + public itemType = ''; + public options = { + cutoutPercentage: 80, + tooltips: { enabled: false }, + legend: { display: false } + }; + public data = { + datasets: [ + { + data: [0, 0, 0, 0, 0], + backgroundColor: [ + '#18a169', + '#38c9b3', + '#114475', + '#3cb9d5', + '#cc3232' + ], + borderWidth: 5 + }] + }; + public filters = [ + { + value: 0, + name: 'All', + active: true, + color: '#124375', + key: 'ALL', + disable: false + }, + { + value: 0, + name: 'HR', + active: false, + color: '#18a169', + key: 'HRSSA', + disable: false + }, + { + value: 0, + name: 'PO', + active: false, + color: '#38c9b3', + key: 'POAPPRV', + disable: false + }, + { + value: 0, + name: 'PR', + active: false, + color: '#114475', + key: 'REQAPPRV', + disable: false + }, + { + value: 0, + name: 'MR', + active: false, + color: '#3cb9d5', + key: 'INVMOA', + disable: false + }, + { + value: 0, + name: 'ITG', + active: false, + color: '#cc3232', + key: 'ITG', + disable: false + } + ]; + public slideOptsOne = { + slidesPerView: 4.3, + spaceBetween: 10 + }; constructor( - public common: CommonService, - public ts: TranslatorService, - public WorklistService: WorklistService, - public workListService: WorklistMainService, - ) { - this.WorkListObj = new WorkListRequest(); - this.WorkListObj.P_NOTIFICATION_TYPE = "1"; - this.WorkListObj.P_SEARCH_FROM_USER = ""; - this.WorkListObj.P_SEARCH_SUBJECT = ""; - this.WorkListObj.P_SEARCH_SENT_DATE = ""; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ""; - this.WorkListObj.P_PAGE_NUM = 0; - this.WorkListObj.P_PAGE_LIMIT = 50; //number + public common: CommonService, + public ts: TranslatorService, + public WorklistService: WorklistService, + public workListService: WorklistMainService, + public modalController: ModalController + ) { + this.WorkListObj = new WorkListRequest(); + this.WorkListObj.P_NOTIFICATION_TYPE = '1'; + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_PAGE_NUM = 0; + this.WorkListObj.P_PAGE_LIMIT = 50; } ngOnInit() { - this.direction = TranslatorService.getCurrentDirection(); - } - ionViewDidLoad() { - // this.navBar.backButtonClick = () => { - // // you can set a full custom history here if you want - // let pages = [ - // { - // page: "HomePage" - // } - // ]; - // this.navCtrl.setPages(pages); - // }; - } - - ionViewWillEnter() { + // this.direction = TranslatorService.getCurrentDirection(); + this.worklistNotifications = this.common.sharedService.getSharedData('worklistNotifications', false); + this.Details(); + this.Count(); + this.assignDataToFilters(); this.getAllPushNotificationFun(); + this.totalRequestCount = this.worklistNotifications.P_OPEN_NTF_NUMBER; } - getValueSelected(Value) { - this.selectedValue = Value.detail.value; - if (this.selectedValue == "1") { - this.HideDateInput = false; - this.HideTextInput = true; - } else if (this.selectedValue == "2") { - this.HideDateInput = false; - this.HideTextInput = true; - } else if (this.selectedValue == "3") { - this.HideDateInput = true; - this.HideTextInput = false; - } else if (this.selectedValue == "4") { - this.HideDateInput = false; - this.HideTextInput = true; - } else if (this.selectedValue == "5") { - this.HideDateInput = false; - this.HideTextInput = false; + + assignDataToFilters() { + this.filters[0].value = this.worklistNotifications.P_OPEN_NTF_NUMBER; + const openNotificationsArray = this.worklistNotifications.GetOpenNotificationsList; + for (const notification of openNotificationsArray) { + if (notification.ITEM_TYPE === 'HRSSA') { + this.filters[1].value = notification.OPEN_NTF_NUMBER; + this.data.datasets[0].data[0] = notification.OPEN_NTF_NUMBER; + } else if (notification.ITEM_TYPE === 'POAPPRV') { + this.filters[2].value = notification.OPEN_NTF_NUMBER; + this.data.datasets[0].data[1] = notification.OPEN_NTF_NUMBER; + } else if (notification.ITEM_TYPE === 'REQAPPRV') { + this.filters[3].value = notification.OPEN_NTF_NUMBER; + this.data.datasets[0].data[2] = notification.OPEN_NTF_NUMBER; + } else if (notification.ITEM_TYPE === 'INVMOA') { + this.filters[4].value = notification.OPEN_NTF_NUMBER; + this.data.datasets[0].data[3] = notification.OPEN_NTF_NUMBER; + } else if (notification.ITEM_TYPE === 'ITG') { + this.filters[5].value = notification.OPEN_NTF_NUMBER; + this.data.datasets[0].data[4] = notification.OPEN_NTF_NUMBER; + } } } - getAllPushNotificationFun() { - this.WorkListObj.P_PAGE_NUM = 1; - this.IsReachEnd = false; - if (this.selectedValue == "1") { - this.WorkListObj.P_SEARCH_FROM_USER = this.inputSearch; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ""; - this.WorkListObj.P_SEARCH_SENT_DATE = ""; - this.WorkListObj.P_SEARCH_SUBJECT = ""; - } else if (this.selectedValue == "2") { - this.WorkListObj.P_SEARCH_FROM_USER = ""; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ""; - this.WorkListObj.P_SEARCH_SENT_DATE = ""; - this.WorkListObj.P_SEARCH_SUBJECT = this.inputSearch; - } else if (this.selectedValue == "3") { - this.WorkListObj.P_SEARCH_FROM_USER = ""; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ""; - if (this.InputDate) - this.WorkListObj.P_SEARCH_SENT_DATE = moment(this.InputDate).format( - "DD-MMM-YYYY" - ); - else this.WorkListObj.P_SEARCH_SENT_DATE = ""; - this.WorkListObj.P_SEARCH_SUBJECT = ""; - } else if (this.selectedValue == "4") { - this.WorkListObj.P_SEARCH_FROM_USER = ""; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.inputSearch; - this.WorkListObj.P_SEARCH_SENT_DATE = ""; - this.WorkListObj.P_SEARCH_SUBJECT = ""; - } else if (this.selectedValue == "5") { - this.WorkListObj.P_SEARCH_FROM_USER = ""; - this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ""; - this.WorkListObj.P_SEARCH_SENT_DATE = ""; - this.WorkListObj.P_SEARCH_SUBJECT = ""; - } - this.WorklistService.getWorkList(this.WorkListObj).subscribe( - (result: WorKListResponse) => { - this.handleWorkListResult(result); + activeFilter(index: number) { + if (this.currentActiveIndex !== index) { + this.showFormattedData = {}; + this.previousActiveIndex = this.currentActiveIndex; + this.currentActiveIndex = index; + this.filters[this.previousActiveIndex].active = false; + this.filters[this.currentActiveIndex].active = true; + if (this.filters[this.currentActiveIndex].value !== 0) { + const selectedKey = this.filters[this.currentActiveIndex].key; + this.resetData(); + this.itemType = (selectedKey !== 'ITG' && selectedKey !== 'ALL') ? this.filters[this.currentActiveIndex].key : ''; + this.getAllPushNotificationFun(); } - ); - } //End getNotifications + this.selectedFilter = this.filters[this.currentActiveIndex].key; + } + } - private handleWorkListResult(result) { - if (this.common.validResponse(result)) { - // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); - if (this.common.hasData(result.GetWorkList)) { - this.WorkListObj.P_PAGE_NUM++; - this.WorkListResObj = result.GetWorkList; - this.filteredNotificationList = this.WorkListResObj; - this.common.sharedService.setSharedData(this.WorkListResObj, HomeComponent.NOTIFICATION_ARR); - let lastItemIndex = this.WorkListResObj.length - 1; - if (result.GetWorkList[lastItemIndex]) { - let lastitem = result.GetWorkList[lastItemIndex]; - if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { - this.IsReachEnd = true; - } else { - this.IsReachEnd = false; - } - // this.navCtrl.push('SmsAuthenticatePage'); - } + openProfilePage() { + this.common.openProfile(); + } + + disableFilters() { + for (const filter of this.filters) { + if (filter.key === this.itemType) { + filter.disable = false; + filter.active = true; + this.selectedFilter = filter.name; + } else if (this.itemType === '') { + filter.disable = false; + filter.active = false; } else { - this.WorkListResObj = []; + filter.disable = true; + filter.active = false; } } + if (this.itemType === '') { + this.filters[0].active = true; + } } - openNotificationDetail(obj) { - console.log(obj); - this.common.sharedService.setSharedData(obj, HomeComponent.NOTIFICATION_DATA); - //this.common.openWorklistMainPage(); - if(obj.REQUEST_TYPE == "PR"){ - this.common.openWorklistMainPRPage(); - } - else if(obj.REQUEST_TYPE == "PO"){ - this.common.openWorklistMainPOPage(); - } - else if(obj.REQUEST_TYPE == "MO"){ - this.common.openWorklistMainMRPage(); + async openSearchModal() { + const modal = await this.modalController.create({ + component: WorklistAdvancedSearchComponent, + cssClass: 'advanced-search-modal', + backdropDismiss: false, + componentProps: {} + }); + modal.onDidDismiss().then(result => { + if (result.data) { + if (result.data.notificationType !== '' || result.data.selectedValue !== '' || result.data.itemType !== '') { + this.showSearchButton = true; + this.itemType = result.data.itemType; + this.notificationType = result.data.notificationType; + this.selectedValue = result.data.selectedValue; + this.inputDate = result.data.inputDate; + this.inputSearch = result.data.inputSearch; + this.WorkListObj.P_PAGE_NUM = 1; + this.newWorkListResponse = []; + this.showFormattedData = {}; + this.selectedFilter = 'ALL'; + this.filters[this.currentActiveIndex].active = false; + this.currentActiveIndex = 0; + this.previousActiveIndex = 0; + this.filters[this.currentActiveIndex].active = true; + if (this.itemType !== '') { + this.disableFilters(); + } + this.getAllPushNotificationFun(); + } } - - else{ - this.common.openWorklistMainPage(); - - } - - //this.navCtrl.push("WorkListMainPage", { passNotificationList: obj }); - } - onChangeView(selectedValue: any) { - this.WorkListObj.P_NOTIFICATION_TYPE = selectedValue.detail.value; + }); + return await modal.present(); } - doInfinite(infiniteScroll) { - //this.pageNum= this.pageNum + 1; + getAllPushNotificationFun() { + this.WorkListObj.P_PAGE_NUM = 1; + this.isReachEnd = false; + this.WorkListObj.P_SEARCH_FROM_USER = this.selectedValue === '1' ? this.inputSearch : ''; + this.WorkListObj.P_SEARCH_SUBJECT = this.selectedValue === '2' ? this.inputSearch : ''; + this.WorkListObj.P_SEARCH_SENT_DATE = (this.inputDate && this.selectedValue === '3') + ? moment(this.inputDate).format('DD-MMM-YYYY') : ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = this.selectedValue === '4' ? this.inputSearch : ''; ; + this.WorkListObj.P_ITEM_TYPE = this.itemType !== '' ? this.itemType : ''; + this.WorkListObj.P_NOTIFICATION_TYPE = this.notificationType !== '' ? this.notificationType : '1'; + if (this.selectedValue === '5') { + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; + } - if (!this.IsReachEnd) { - this.WorklistService.getWorkList(this.WorkListObj).subscribe( - (result: any) => { - if (this.common.validResponse(result)) { - this.WorkListObj.P_PAGE_NUM++; - if (this.common.hasData(result.GetWorkList)) { - result.GetWorkList.forEach(element => { - if (element.ROW_NUM == element.NO_OF_ROWS) { - this.IsReachEnd = true; - } else { - this.IsReachEnd = false; - } - this.WorkListResObj.push(element); - }); - } // if list length >0 - else { - this.IsReachEnd = true; - } - } // if response == 1 - //this.pageNum++; - this.infiniteScroll.complete(); + this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => { + if (this.common.validResponse(result)) { + this.handleWorkListResult(result.GetWorkList); + } } ); - } else { - if (this.infiniteScroll) this.infiniteScroll.complete(); - } - } //end infiniteScroll - - Count() { - this.workListService.getITGCount() - .subscribe((result: any) => { - console.log("ENAD ITG COUNT:") - console.log(result); - }); } - filterNotificationByRequestType(reqType) { - let filterdType = []; - if (reqType == "All") { - this.filteredNotificationList = this.WorkListResObj; - if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == "") { - this.noData = true; - return false; - } else { - this.noData = false; - return false; + categorizeData(arrayToCategorize: any) { + const datePipe = new DatePipe('en-US'); + const formattedData = {}; + for (const workList of arrayToCategorize) { + workList.FORMATTED_DATE = datePipe.transform(new Date(workList.BEGIN_DATE), 'MMMM dd, y'); + if (!(workList.FORMATTED_DATE in formattedData)) { + formattedData[workList.FORMATTED_DATE] = new Array(); + formattedData[workList.FORMATTED_DATE].push(workList); + } else { + formattedData[workList.FORMATTED_DATE].push(workList); + } } - } - for (let i = 0; i < this.WorkListResObj.length; i++) { - if(reqType=="HR"){ - if ("EIT" == this.WorkListResObj[i].REQUEST_TYPE || "ABSENCE" == this.WorkListResObj[i].REQUEST_TYPE) { - filterdType.push(this.WorkListResObj[i]); + return formattedData; + } + + sortArray(arrayToSort: any) { + return arrayToSort.sort((a: any, b: any) => + new Date(b.BEGIN_DATE).getTime() - new Date(a.BEGIN_DATE).getTime() + ); + } + + private handleWorkListResult(result: any) { + const lastItemIndex = result.length - 1; + const lastitem = result[lastItemIndex]; + if (lastitem) { + if (lastitem.NO_OF_ROWS === lastitem.ROW_NUM) { + this.isReachEnd = true; + if (this.infiniteScroll) { + this.infiniteScroll.complete(); } - }else{ - if (reqType == this.WorkListResObj[i].REQUEST_TYPE) { - filterdType.push(this.WorkListResObj[i]); + } else { + this.isReachEnd = false; + if (this.infiniteScroll) { + this.infiniteScroll.complete(); } } - } - - this.filteredNotificationList = filterdType; - if (this.filteredNotificationList == [] || this.filteredNotificationList == null || this.filteredNotificationList == "") { - this.noData = true; - return false; + if (this.common.hasData(result)) { + this.WorkListObj.P_PAGE_NUM++; + if (this.newWorkListResponse.length === 0) { + this.newWorkListResponse = result; + } else { + this.newWorkListResponse = this.newWorkListResponse.concat(result); + } + this.newWorkListResponse = this.sortArray(this.newWorkListResponse); + console.log(this.newWorkListResponse); + this.showFormattedData = this.categorizeData(this.newWorkListResponse); + this.common.sharedService.setSharedData(this.newWorkListResponse, HomeComponent.NOTIFICATION_ARR); } else { - this.noData = false; - return false; + this.newWorkListResponse = []; } } - Details() { - this.workListService.getITGDetails() - .subscribe((result: any) => { - console.log("ENAD ITG Details:") - console.log(result); - }); + openNotificationDetail(obj) { + this.common.sharedService.setSharedData(obj[0], HomeComponent.NOTIFICATION_DATA); + if (obj.REQUEST_TYPE === 'PR') { + this.common.openWorklistMainPRPage(); + } else if (obj[0].REQUEST_TYPE === 'PO') { + this.common.openWorklistMainPOPage(); + } else if (obj[0].REQUEST_TYPE === 'MO') { + this.common.openWorklistMainMRPage(); + } else { + this.common.openWorklistMainPage(); + } } + isEmptyObject() { + return (this.showFormattedData && (Object.keys(this.showFormattedData).length > 0) || this.ITGItem.length > 0); + } - AllNotification() { - this.filterNotificationByRequestType("All"); - this.isAll = true; - this.isPR = false; - this.isPO = false; - this.isMR = false; - this.isHR = false; - this.isITG = false; + resetData() { + if (this.infiniteScroll) { + this.infiniteScroll.complete(); + } + this.showSearchButton = false; + this.notificationType = '1'; + this.selectedValue = ''; + this.inputDate = ''; + this.inputSearch = ''; + this.newWorkListResponse = []; + this.showFormattedData = {}; + this.WorkListObj.P_SEARCH_FROM_USER = ''; + this.WorkListObj.P_SEARCH_ITEM_TYPE_DSP_NAME = ''; + this.WorkListObj.P_SEARCH_SENT_DATE = ''; + this.WorkListObj.P_SEARCH_SUBJECT = ''; } - PRNotification() { - this.filterNotificationByRequestType("PR"); - this.isAll = false; - this.isPR = true; - this.isPO = false; - this.isMR = false; - this.isHR = false; - this.isITG = false; + + clearSearch() { + this.itemType = ''; + this.selectedFilter = 'ALL'; + this.disableFilters(); + this.resetData(); + this.getAllPushNotificationFun(); } - PONotification() { - this.filterNotificationByRequestType("PO"); - this.isAll = false; - this.isPR = false; - this.isPO = true; - this.isMR = false; - this.isHR = false; - this.isITG = false; + doInfinite(infiniteScroll) { + if (!this.isReachEnd && this.selectedFilter !== 'ITG') { + this.WorklistService.getWorkList(this.WorkListObj).subscribe((result) => { + if (this.common.validResponse(result)) { + this.handleWorkListResult(result.GetWorkList); + } + }); + } else { + if (this.infiniteScroll) { + this.infiniteScroll.complete(); + } + } } - MRNotification() { - this.filterNotificationByRequestType("MO"); - this.isAll = false; - this.isPR = false; - this.isPO = false; - this.isMR = true; - this.isHR = false; - this.isITG = false; + + Count() { + this.workListService.getITGCount() + .subscribe((result: any) => { + for (let i = 0; i < result.RequestType.length; i++) { + this.ITGSegment[i] = { + name: result.RequestType[i].RequestTypeName, + code: result.RequestType[i].RequestTypeCode, + data: result.RequestType[i].RequestDetails, + style: false + }; + } + this.setActive(this.ITGSegment[0].code); + }); } - HRNotification() { - this.filterNotificationByRequestType("HR"); - this.isAll = false; - this.isPR = false; - this.isPO = false; - this.isMR = false; - this.isHR = true; - this.isITG = false; + + Details() { + this.workListService.getITGDetails() + .subscribe((result: any) => { + this.totalRequestCount = this.totalRequestCount + result.TotalCount; + this.filters[5].value = result.TotalCount; + }); } + ITGNotification() { - // this.Details(); - this.isAll = false; - this.isPR = false; - this.isPO = false; - this.isMR = false; - this.isHR = false; - this.isITG = true; + // this.Details(); + this.isAll = false; + this.isPR = false; + this.isPO = false; + this.isMR = false; + this.isHR = false; + this.isITG = true; } searchBtn() { - this.isSearch = !this.isSearch; + this.isSearch = !this.isSearch; } - + setActive(selectedSegment) { + this.ITGItem = []; + let count = 0; + this.activeSegment = selectedSegment; + // tslint:disable-next-line: prefer-for-of + for (let i = 0; i < this.ITGSegment.length; i++) { + if (this.ITGSegment[i].code === selectedSegment) { + this.ITGSegment[i].style = true; + this.ITGItem[count] = this.ITGSegment[i].data; + count++; + } else { + this.ITGSegment[i].style = false; + } + } + } + + openITG(segmentInfo) { + this.common.sharedService.setSharedData(segmentInfo, HomeComponent.REQUSET_INFO); + this.common.sharedService.setSharedData(this.activeSegment, HomeComponent.REQUSET_NAME); + this.common.sharedService.setSharedData(this.ITGItem, HomeComponent.ALL_REQUEST); + this.common.openWorklistITGPage(); + } } diff --git a/Mohem/src/app/notification/item-history/item-history.component.html b/Mohem/src/app/notification/item-history/item-history.component.html index c68df82b..1ac2132a 100644 --- a/Mohem/src/app/notification/item-history/item-history.component.html +++ b/Mohem/src/app/notification/item-history/item-history.component.html @@ -21,8 +21,8 @@
{{ts.trPK('worklistMain','info')}}
--> - -
+ +

{{ 'general, empty' | translate}}

diff --git a/Mohem/src/app/notification/models/itgFormDetailsRequest.ts b/Mohem/src/app/notification/models/itgFormDetailsRequest.ts new file mode 100644 index 00000000..41054f12 --- /dev/null +++ b/Mohem/src/app/notification/models/itgFormDetailsRequest.ts @@ -0,0 +1,12 @@ +import { Request } from 'src/app/hmg-common/services/models/request'; + +export class itgRequest extends Request { + public RequestType: string; + public ItemID: number; + public TaskID: number; + public EmployeeNumber: string; + public Comments: string; + public IsSubTask: boolean; + public NewUserEMPId: string; + public AdditionalFields?: [{}]; +} diff --git a/Mohem/src/app/notification/models/workListRequest.ts b/Mohem/src/app/notification/models/workListRequest.ts index 018942ab..1885e441 100644 --- a/Mohem/src/app/notification/models/workListRequest.ts +++ b/Mohem/src/app/notification/models/workListRequest.ts @@ -1,18 +1,13 @@ -// import { Request } from './request'; import { Request } from 'src/app/hmg-common/services/models/request'; export class WorkListRequest extends Request{ public static SHARED_DATA = 'login-request'; - // Channel: Channel, //channel - // LanguageID: LanguageID,//langlist - // P_USER_NAME:userName,//string - // P_SESSION_ID:sessionID,//number - public P_NOTIFICATION_TYPE: string;//string - public P_SEARCH_FROM_USER:string;//string - public P_SEARCH_SUBJECT:string;//string - public P_SEARCH_SENT_DATE:string;//string - public P_SEARCH_ITEM_TYPE_DSP_NAME:string;//string - public P_PAGE_NUM:number;//number - public P_PAGE_LIMIT:number;//number - + public P_NOTIFICATION_TYPE: string; + public P_SEARCH_FROM_USER: string; + public P_SEARCH_SUBJECT: string; + public P_SEARCH_SENT_DATE: string; + public P_SEARCH_ITEM_TYPE_DSP_NAME: string; + public P_PAGE_NUM: number; + public P_PAGE_LIMIT: number; + public P_ITEM_TYPE : string; } \ No newline at end of file diff --git a/Mohem/src/app/notification/more-action-modal/more-action-modal.component.html b/Mohem/src/app/notification/more-action-modal/more-action-modal.component.html new file mode 100644 index 00000000..8a39b98e --- /dev/null +++ b/Mohem/src/app/notification/more-action-modal/more-action-modal.component.html @@ -0,0 +1,44 @@ + + + + + + + + +

More Action

+
+
+ + + {{button.BUTTON_LABEL}} + + + + +
+
+ +
+ + + + + {{ts.trPK('general','ok')}} + + + + + {{ts.trPK('general','cancel')}} + + + + +
\ No newline at end of file diff --git a/Mohem/src/app/notification/more-action-modal/more-action-modal.component.scss b/Mohem/src/app/notification/more-action-modal/more-action-modal.component.scss new file mode 100644 index 00000000..5ad05c9d --- /dev/null +++ b/Mohem/src/app/notification/more-action-modal/more-action-modal.component.scss @@ -0,0 +1,27 @@ +.rowBtn{ + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.Header{ + // color: black !important; + // font-size: 16px !important; + // font-weight: bold !important;; + // margin: 0; + // position: absolute; + // left: 50%; + // top: 50%; + // transform: translate(-58px, 2px); + color: black !important; + font-size: 16px !important; + font-weight: bold !important; + margin: auto; +} + +.labelRadio{ + color: black !important; + font-weight: bold !important; +} + diff --git a/Mohem/src/app/notification/more-action-modal/more-action-modal.component.spec.ts b/Mohem/src/app/notification/more-action-modal/more-action-modal.component.spec.ts new file mode 100644 index 00000000..20fcff12 --- /dev/null +++ b/Mohem/src/app/notification/more-action-modal/more-action-modal.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MoreActionModalComponent } from './more-action-modal.component'; + +describe('MoreActionModalComponent', () => { + let component: MoreActionModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MoreActionModalComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MoreActionModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/more-action-modal/more-action-modal.component.ts b/Mohem/src/app/notification/more-action-modal/more-action-modal.component.ts new file mode 100644 index 00000000..3a52bbc2 --- /dev/null +++ b/Mohem/src/app/notification/more-action-modal/more-action-modal.component.ts @@ -0,0 +1,44 @@ +import { Component, OnInit } from '@angular/core'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { ModalController } from '@ionic/angular'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; + +@Component({ + selector: 'app-more-action-modal', + templateUrl: './more-action-modal.component.html', + styleUrls: ['./more-action-modal.component.scss'], +}) +export class MoreActionModalComponent implements OnInit { + actionBtns :any =[]; + radioButtonValue: any; + constructor( private ts: TranslatorService,private modalCtrl: ModalController, private cs: CommonService){} + + ngOnInit() { + console.log("modal"); + this.actionBtns = this.cs.sharedService.getSharedData("passActionMore" , false); + console.log("modal"); + + } + closeModal() { + this.modalCtrl.dismiss(); + } + + radioSelect(v) { + this.radioButtonValue = v; + console.log("radio selected"+v); + } + + OkBtnModal() { + if (!this.radioButtonValue) { + let msg: string = this.ts.trPK("replacementRoll", "msg"); + this.cs.presentAlert(msg); + return; + } else { + let data = this.radioButtonValue; + this.modalCtrl.dismiss(data); + } + } + + + +} diff --git a/Mohem/src/app/notification/notification.module.ts b/Mohem/src/app/notification/notification.module.ts index df9194f2..caa8cc34 100644 --- a/Mohem/src/app/notification/notification.module.ts +++ b/Mohem/src/app/notification/notification.module.ts @@ -25,8 +25,12 @@ import { WorklistMainPoComponent } from './worklist-main-po/worklist-main-po.com import { ItemHistoryComponent } from './item-history/item-history.component'; import { QutationAnalysisComponent } from './qutation-analysis/qutation-analysis.component'; import { WorklistMainMRComponent } from './worklist-main-mr/worklist-main-mr.component'; -// import { WorklistMainComponent } from './worklist-main/worklist-main.component'; +import { WorklistAdvancedSearchComponent } from './worklist-advanced-search/worklist-advanced-search.component'; +import { WorkListMainItgComponent } from './work-list-main-itg/work-list-main-itg.component'; +// import { WorklistMainComponent } from './worklist-main/worklist-main.component'; +import {MoreActionModalComponent} from './more-action-modal/more-action-modal.component' +import { WorkListReplacementItgComponent } from './work-list-replacement-itg/work-list-replacement-itg.component'; const routes: Routes = [ @@ -43,8 +47,8 @@ const routes: Routes = [ component: WorkListAttachViewComponent }, { - path:'worklist-main', - component:WorklistMainComponent + path: 'worklist-main', + component: WorklistMainComponent }, { path: 'work-list-replacement-roll', @@ -76,28 +80,40 @@ const routes: Routes = [ }, { - path:'worklist-main-PR', - component:WorklistMainPRComponent + path: 'worklist-main-PR', + component: WorklistMainPRComponent }, { - path:'apply-action-modal', - component:ApplyActionModalComponent + path: 'apply-action-modal', + component: ApplyActionModalComponent }, { - path:'worklist-main-PO', - component:WorklistMainPoComponent + path: 'worklist-main-PO', + component: WorklistMainPoComponent }, { - path:'item-history-PO', - component:ItemHistoryComponent + path: 'item-history-PO', + component: ItemHistoryComponent }, { - path:'qutation-analysis-PO', - component:QutationAnalysisComponent + path: 'qutation-analysis-PO', + component: QutationAnalysisComponent }, { - path:'worklist-main-MR', - component:WorklistMainMRComponent + path: 'worklist-main-MR', + component: WorklistMainMRComponent + }, + { + path: 'worklist-main-ITG', + component: WorkListMainItgComponent + }, + { + path: 'more-action-modal', + component: MoreActionModalComponent + }, + { + path: 'worklist-replacement-itg', + component: WorkListReplacementItgComponent } ] } @@ -119,6 +135,7 @@ const routes: Routes = [ WorkListReplacementRollComponent, WorkListRfcComponent, ViewNoteModalComponent, + MoreActionModalComponent, ApplyActionModalComponent, ViewReplacementModalComponent, WorkListActionHistoryComponent, @@ -128,9 +145,15 @@ const routes: Routes = [ WorklistMainPoComponent, ItemHistoryComponent, QutationAnalysisComponent, - WorklistMainMRComponent + WorklistMainMRComponent, + WorklistAdvancedSearchComponent, + WorkListMainItgComponent, + WorkListReplacementItgComponent // WorklistMainComponent ], - providers:[WorklistService,WorklistMainService, WorklistAttachService] + entryComponents: [ + WorklistAdvancedSearchComponent + ], + providers: [WorklistService, WorklistMainService, WorklistAttachService] }) export class NotificationPageModule {} diff --git a/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.html b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.html index 69ab83e9..92236371 100644 --- a/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.html +++ b/Mohem/src/app/notification/qutation-analysis/qutation-analysis.component.html @@ -22,7 +22,7 @@ --> -
+

{{ 'general, empty' | translate}}

diff --git a/Mohem/src/app/notification/service/work-list.main.service.ts b/Mohem/src/app/notification/service/work-list.main.service.ts index 99799c56..720f5c1e 100644 --- a/Mohem/src/app/notification/service/work-list.main.service.ts +++ b/Mohem/src/app/notification/service/work-list.main.service.ts @@ -19,6 +19,7 @@ import { MOItemHistoryRes } from "../models/MOItemHistoryRes"; import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes'; import { Request } from 'src/app/hmg-common/services/models/request'; import { LoginModel } from '../../authentication/models/LoginModel'; +import { itgRequest } from '../models/itgFormDetailsRequest'; @Injectable() export class WorklistMainService { @@ -44,9 +45,11 @@ export class WorklistMainService { public static getQutationAnalysisUrl = "Services/ERP.svc/REST/GET_QUOTATION_ANALYSIS"; public static getITGFormTaskCount = - 'http://10.80.100.124:7086/Services/COCWS.svc/REST/ITGGetTaskCountRequestType'; + 'Services/COCWS.svc/REST/ITGGetTaskCountRequestType'; public static getITGFormTaskDetails = - 'http://10.80.100.124:7086/Services/COCWS.svc/REST/ITGFormsPendingTasks'; + 'Services/COCWS.svc/REST/ITGFormsPendingTasks'; + public static getITGFormDetails = + 'Services/COCWS.svc/REST/ITGGetFormDetials'; @@ -241,7 +244,7 @@ export class WorklistMainService { const request = new Request; console.log(request) this.authService.authenticateRequest(request); - return this.api.postToken( + return this.api.post( WorklistMainService.getITGFormTaskCount, request, onError, @@ -249,12 +252,25 @@ export class WorklistMainService { ); } + public getITGFormDetails(request:itgRequest, onError?: any, errorLabel?: string): Observable { + this.authService.authenticateRequest(request); + request.EmployeeNumber = request.P_USER_NAME; + console.log(request); + return this.api.post( + WorklistMainService.getITGFormDetails, + request, + onError, + errorLabel + ); + } + + public getITGDetails( onError?: any, errorLabel?: string): Observable { const request = new Request; console.log(request) this.authService.authenticateRequest(request); - return this.api.postToken( + return this.api.post( WorklistMainService.getITGFormTaskDetails, request, onError, @@ -262,4 +278,19 @@ export class WorklistMainService { ); } + + public getITGActionRequest(itgrequest:itgRequest,actionURL:string, onError?: any, errorLabel?: string): Observable { + this.authService.authenticateRequest(itgrequest); + itgrequest.EmployeeNumber = itgrequest.P_USER_NAME; + console.log(itgrequest); + console.log(actionURL); + return this.api.post( + actionURL, + itgrequest, + onError, + errorLabel + ); + } + + } diff --git a/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.scss b/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.scss index b4736409..d28c9952 100644 --- a/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.scss +++ b/Mohem/src/app/notification/view-replacement-modal/view-replacement-modal.component.scss @@ -9,3 +9,7 @@ ion-content { padding-top: 30px !important; border: solid 1px #dedede; } +:host(.activated) .item-native { + background: var(--red) !important; + color: var(--grey) !important; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-attach-view/work-list-attach-view.component.html b/Mohem/src/app/notification/work-list-attach-view/work-list-attach-view.component.html index 635bbcb9..f38acc02 100644 --- a/Mohem/src/app/notification/work-list-attach-view/work-list-attach-view.component.html +++ b/Mohem/src/app/notification/work-list-attach-view/work-list-attach-view.component.html @@ -1,5 +1,5 @@ - + {{'workListMain, suppDoc' | translate}} diff --git a/Mohem/src/app/notification/work-list-attach-view/work-list-attach-view.component.scss b/Mohem/src/app/notification/work-list-attach-view/work-list-attach-view.component.scss index e69de29b..d98a85be 100644 --- a/Mohem/src/app/notification/work-list-attach-view/work-list-attach-view.component.scss +++ b/Mohem/src/app/notification/work-list-attach-view/work-list-attach-view.component.scss @@ -0,0 +1,3 @@ +.header-toolbar-new{ + --background: #22c6b3; + } \ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-attach/work-list-attach.component.ts b/Mohem/src/app/notification/work-list-attach/work-list-attach.component.ts index c73997b3..5a43d43c 100644 --- a/Mohem/src/app/notification/work-list-attach/work-list-attach.component.ts +++ b/Mohem/src/app/notification/work-list-attach/work-list-attach.component.ts @@ -32,6 +32,7 @@ export class WorkListAttachComponent implements OnInit { // modal.present(); this.cs.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage') + const modal = await this.modalCtrl.create({ component: WorkListAttachViewComponent }); diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html new file mode 100644 index 00000000..fa90523a --- /dev/null +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.html @@ -0,0 +1,151 @@ + + + {{ts.trPK('worklistMain','title')}} + + + + + + + + + + + {{segmentVal.name}} + + + + + + + + + +
+ +
+
+ + + +
+ + +
+
+
+
+
+ + + + + + + + + + + + +
+ +
+
+ + +
+
+

{{approvalInfo.Action}}

+
+
+

{{approvalInfo.Name}}

+ +
+
+
+
+
+
+
+
+ + + + + + + +

Comment

+
+ + + + {{object.Label}} + + + {{value}} + + + + {{value}} + + +
+
+
+
+
+
+ + + + + + + + + + + + + {{action.name}} + + + + + + Skip + + + + + + + + + \ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.scss b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.scss new file mode 100644 index 00000000..8abe3c97 --- /dev/null +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.scss @@ -0,0 +1,13 @@ + + +.timeline-thumb { + height: 30px !important; + left: 54px !important; +} + +.timeline-icon{ + width: 30px !important; +} +.timeline:before{ + position: fixed !important; +} \ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.spec.ts b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.spec.ts new file mode 100644 index 00000000..87da8f0d --- /dev/null +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorkListMainItgComponent } from './work-list-main-itg.component'; + +describe('WorkListMainItgComponent', () => { + let component: WorkListMainItgComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorkListMainItgComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorkListMainItgComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts new file mode 100644 index 00000000..96518745 --- /dev/null +++ b/Mohem/src/app/notification/work-list-main-itg/work-list-main-itg.component.ts @@ -0,0 +1,342 @@ +import { Component, OnInit } from '@angular/core'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { HomeComponent } from '../home/home.component'; +import { WorklistMainService } from '../service/work-list.main.service'; +import { itgRequest } from '../models/itgFormDetailsRequest'; +import { ModalController } from '@ionic/angular'; +import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component'; +import { WorkListReplacementItgComponent } from '../work-list-replacement-itg/work-list-replacement-itg.component'; + + +@Component({ + selector: 'app-work-list-main-itg', + templateUrl: './work-list-main-itg.component.html', + styleUrls: ['./work-list-main-itg.component.scss'], +}) +export class WorkListMainItgComponent implements OnInit { + + public static APPROVAL = "Services/COCWS.svc/REST/ITGApproveRequest" + public static REJECT = 'Services/COCWS.svc/REST/ITGRejectRequest' + public static DELEGATE = 'Services/COCWS.svc/REST/ITGDelegateRequest'; + public static REQUEST_INFORMATION = 'Services/COCWS.svc/REST/ITGRequestInformation'; + public static ANSWER = 'Services/COCWS.svc/REST/ITGAnswer'; + public static GRANT = 'Services/COCWS.svc/REST/ITGGrantAccess'; + + public request_info: any; + public request_name: any; + public all_request: any; + public request = new itgRequest(); + public activeSegment: any = "info"; + public request_details: any; + public segmentsArray: { name: string, number: number }[] = []; + public segmentData: { name: string, data: any }[] = []; + public header: any = []; + public rows: any = []; + public workList: any; + public commentText: string; + public replcamentID: string; + public actionSelected: any; + public options: any; + public index: number = 0; + public grantDATA: any; + public grantInfo: any; + public grantFieldsConditionalValue: any = []; + public filteredGrantFieldsConditionalValue: any = []; + public grantFieldsLabel: any = []; + public grantFieldsValue: any = []; + public grantRequest: any = []; + public ExchangeServerSelected: any; + public ExchangeServerDBSelected: any; + public actionBTN: { name: string, image: string, isAvailable: boolean }[] = []; + constructor( + public common: CommonService, + public ts: TranslatorService, + public workListService: WorklistMainService, + public modalCtrl: ModalController) { } + + ngOnInit() { + this.request_info = this.common.sharedService.getSharedData(HomeComponent.REQUSET_INFO); + this.request_name = this.common.sharedService.getSharedData(HomeComponent.REQUSET_NAME); + this.all_request = this.common.sharedService.getSharedData(HomeComponent.ALL_REQUEST); + this.all_request = this.all_request[0]; + this.changeITGForm(this.request_info, this.request_name); + } + + + + changeITGForm(data, requestName) { + this.request_info = data; + this.request_name = requestName; + this.request.RequestType = this.request_name; + this.request.ItemID = this.request_info.ItemID; + this.request.TaskID = this.request_info.ID; + this.request.Comments = this.request_info.Comments; + this.request.NewUserEMPId = this.request_info.NewUserEMPId; + this.workListService.getITGFormDetails(this.request).subscribe((result: any) => { + this.request_details = result.ITGRequest; + this.grantInfo = result.ITGRequest.GrantFields; + let count = 0; + for (let i = 0; i < result.ITGRequest.FieldGoups.length; i++) { + this.segmentsArray[i] = { name: result.ITGRequest.FieldGoups[i].Title, number: i }; + this.segmentData[i] = { name: result.ITGRequest.FieldGoups[i].Title, data: result.ITGRequest.FieldGoups[i].Fields} + } + this.segmentsArray[this.segmentsArray.length] = { name: 'Approval Level', number: this.segmentsArray.length } + this.workList = this.request_details.WFHistory; + this.options = this.request_details.AllowedActions; + this.activeSegment = this.segmentsArray[0].name; + for (let i = 0; i < this.options.length; i++) { + this.imageURL(this.options[i].Action); + this.actionBTN[i] = { name: this.options[i].Action, image: this.imageURL(this.options[i].Action), isAvailable: this.options[i].IsAvailable } + } + + if (this.grantInfo) { + let count = 0; + this.grantFieldsConditionalValue = []; + for (let i = 0; i < this.grantInfo.length; i++) { + if (this.grantInfo[i].Value) { + for (let j = 0; j < this.grantInfo[i].Value.length; j++) { + this.grantFieldsValue[j] = this.grantInfo[i].Value[j]; + } + } + if (this.grantInfo[i].ConditionalValue) { + for (let j = 0; j < this.grantInfo[i].ConditionalValue.length; j++) { + this.grantFieldsConditionalValue[count] = this.grantInfo[i].ConditionalValue[j]; + count++; + } + } + } + } + //result.ITGRequest.FieldGoups.Fields + }); + } + + imageURL(actionName) { + if (actionName == "Approve") { + return "../assets/imgs/action-approve.png" + } + if (actionName == "Reject") { + return "../assets/imgs/action-reject.png" + } + if (actionName == "RequestInformation") { + return "../assets/imgs/action-info.png" + } + if (actionName == "Grant") { + return "../assets/imgs/action-info.png" + } + if (actionName == "Delegate") { + return "../assets/imgs/action-info.png" + } + } + + public segmentChangedClick(event: any) { + this.activeSegment = event.detail.value; + } + + skip() { + for (let i = 0; i < this.all_request.length; i++) { // search for the request that clicked on all request + if (this.request_info.ID == this.all_request[i].ID) { // check if the ID for the request is found. + this.index = i + 1; + if (this.index !== this.all_request.length) { // check if its last one to redirecte to home otherwise to next request. + this.clearDataArray(); + this.changeITGForm(this.all_request[this.index], this.request_name); + break; + } else { + this.common.openNotificationPage(); + break; + } + } else { + this.common.openNotificationPage(); + break; + } + } + } + + clearDataArray() { + this.commentText = ''; + this.actionSelected = ''; + this.segmentsArray = []; + this.segmentData = []; + this.workList = []; + this.actionBTN = []; + } + + + + actionService(action, comments?, grantRequests?) { + let url: string; + let request = new itgRequest(); + request.RequestType = this.request_name; + request.ItemID = this.request_info.ItemID; + request.TaskID = this.request_info.ID; + request.Comments = this.commentText; + request.Comments = this.request_info.Comments; + request.EmployeeNumber = this.request_info.EmployeeNumber; + request.NewUserEMPId = this.replcamentID; + this.common.confirmAlertDialogAction( + () => { + if (action == 1) { //approved + url = WorkListMainItgComponent.APPROVAL; + this.workListService.getITGActionRequest(request, url) + .subscribe((result: any) => { + // this.common.openNotificationPage(); + this.skip(); + }); + } else if (action == 2) {//reject + url = WorkListMainItgComponent.REJECT; + this.workListService.getITGActionRequest(request, url) + .subscribe((result: any) => { + // this.common.openNotificationPage(); + this.skip(); + }); + } else if (action == 3) {//request more info + request.NewUserEMPId = this.replcamentID; + url = WorkListMainItgComponent.REQUEST_INFORMATION; + if (!comments) { + this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment')); + } else { + this.workListService.getITGActionRequest(request, url) + .subscribe((result: any) => { + // this.common.openNotificationPage(); + this.skip(); + }); + } + } else if (action == 4) {//delegate + request.NewUserEMPId = this.replcamentID; + url = WorkListMainItgComponent.DELEGATE; + this.workListService.getITGActionRequest(request, url) + .subscribe((result: any) => { + // this.common.openNotificationPage(); + this.skip(); + }); + } else if (action == 5) { //answer + url = WorkListMainItgComponent.ANSWER; + if (!comments) { + this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment')); + } else { + this.workListService.getITGActionRequest(request, url) + .subscribe((result: any) => { + // this.common.openNotificationPage(); + this.skip(); + }); + } + } else if (action == 6) { //grant + url = WorkListMainItgComponent.GRANT; + if (!comments) { + this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment')); + } + else { + if (this.grantRequest) { + request.AdditionalFields = this.grantRequest; + this.workListService.getITGActionRequest(request, url) + .subscribe((result: any) => { + // this.common.openNotificationPage(); + this.skip(); + }); + } else { + this.common.presentAlert(this.ts.trPK('worklist', 'empty-comment')); + } + } + + } + }, this.ts.trPK('general', 'ok'), + () => { this.actionSelected = '' }, this.ts.trPK('general', 'cancel'), + this.ts.trPK('vacation-rule', 'confirmation'), + this.confirmMsg(action)); + + + } + + confirmMsg(action) { + if (action === 1) { + return this.ts.trPK('worklist', 'approveMsg'); + } + if (action === 2) { + return this.ts.trPK('worklist', 'rejectMsg'); + } + if (action === 3) { + return this.ts.trPK('worklist', 'requestInformationMsg'); + } + if (action === 4) { + return this.ts.trPK('worklist', 'delegateMsg'); + } + if (action === 5) { + return this.ts.trPK('worklist', 'answerMsg'); + } + if (action === 6) { + return this.ts.trPK('worklist', 'grantMsg'); + } + + } + + selectAtion(actionSelected) { + this.actionSelected = actionSelected; + if (this.actionSelected == "Answer") { + this.actionService(5, this.commentText) + } + if (this.actionSelected == "Approve") { + this.actionService(1, this.commentText); + } + if (this.actionSelected == "Delegate") { + // this.actionService(4, this.commentText) + // this.common.openWorklistRollReplacement(); + this.presentModal(4); + } + if (this.actionSelected === 'Doable') { + } + if (this.actionSelected === 'Grant') { + this.actionService(6, this.commentText, this.grantRequest); + } + if (this.actionSelected === 'NotDoable') { + } + if (this.actionSelected === 'Question') { + } + if (this.actionSelected === 'Reject') { + this.actionService(2, this.commentText); + } + if (this.actionSelected === 'RequestInformation') { + this.presentModal(3); + } + + } + + + + async presentModal(actionNumber) { + const modal = await this.modalCtrl.create({ + component: WorkListReplacementItgComponent, + backdropDismiss: false, + }); + modal.cssClass = 'replaceRoll-modal'; + modal.onDidDismiss() + .then((data) => { + this.replcamentID = data.data.empData.USER_NAME; + + if (actionNumber == 3) { + this.actionService(3, this.commentText); + } else if (actionNumber == 4) { + this.actionService(4); + } + + }); + return await modal.present(); + } + + filterGrantDB(valueSelected, object, selectedOption?) { + let count = 0; + this.filteredGrantFieldsConditionalValue = []; + this.grantRequest.push({ Key: object.FieldName, Value: valueSelected }); + for (let i = 0; i < this.grantInfo.length; i++) { + if (selectedOption === this.grantInfo[i].ConditionalFieldName) { + for (let j = 0; j < this.grantFieldsConditionalValue.length; j++) { + if (valueSelected === this.grantFieldsConditionalValue[j].Key) { + this.filteredGrantFieldsConditionalValue[count] = this.grantInfo[i].ConditionalValue[j].Value[0]; + count++; + } + } + } + } + } + + +} diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html new file mode 100644 index 00000000..d4538af0 --- /dev/null +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.html @@ -0,0 +1,60 @@ + + + + {{ 'vacation-rule, search-employee' | translate}} + + + + + + + + + +
+ + + {{'vacation-rule, search-by' | translate}} + + {{'vacation-rule, search-by-name' | translate}} + {{'vacation-rule, search-by-username' | translate}} + {{'vacation-rule, search-by-email' | translate}} + + + + + + + + + + + + + + + + {{employee.EMPLOYEE_DISPLAY_NAME}}
{{employee.USER_NAME}}
+ {{employee.EMAIL_ADDRESS}}
+ +
+
+
+ +
+ + +
+ {{'general, save' | translate}} + +
+
\ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.spec.ts b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.spec.ts new file mode 100644 index 00000000..7dc3e986 --- /dev/null +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorkListReplacementItgComponent } from './work-list-replacement-itg.component'; + +describe('WorkListReplacementItgComponent', () => { + let component: WorkListReplacementItgComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorkListReplacementItgComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorkListReplacementItgComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts new file mode 100644 index 00000000..da811721 --- /dev/null +++ b/Mohem/src/app/notification/work-list-replacement-itg/work-list-replacement-itg.component.ts @@ -0,0 +1,131 @@ +import { Component, OnInit } from '@angular/core'; +import { ModalController } from '@ionic/angular'; +import { ReplacementServiceRequest } from 'src/app/vacation-rule/model/replacement-Service.request'; +import { VacationRuleServiceService } from 'src/app/vacation-rule/service/vacation-rule-service.service'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; + + +@Component({ + selector: 'app-work-list-replacement-itg', + templateUrl: './work-list-replacement-itg.component.html', + styleUrls: ['./work-list-replacement-itg.component.scss'], +}) +export class WorkListReplacementItgComponent implements OnInit { + P_SEARCH_USER_NAME: string = ""; + P_SEARCH_EMPLOYEE_DISPLAY_NAME: string = ""; + P_SEARCH_EMAIL_ADDRESS: string = ""; + P_PAGE_NUM: number = 1; + P_PAGE_LIMIT: number = 50; + ReplacementList: any = []; + IsReachEnd: boolean = false; + selEmp: string = null; + callback: any; + searchKey: any = ""; + searchKeySelect: string = ""; + replacmentRequest: any = ""; + isAbs: boolean = false; + isSave: boolean = false; + + constructor(public vacationRuleService: VacationRuleServiceService, + public ts: TranslatorService, + public cs: CommonService, + public modalController: ModalController) { } + + ngOnInit() {} + + SearchReplacementList() { + this.ReplacementList = []; + this.IsReachEnd = false; + this.P_PAGE_NUM = 1; + if (this.searchKey) { + switch (this.searchKeySelect) { + case '1': { + + this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.searchKey; + this.P_SEARCH_USER_NAME = ""; + this.P_SEARCH_EMAIL_ADDRESS = ""; + + break; + } + case '2': { + this.P_SEARCH_USER_NAME = this.searchKey; + this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + this.P_SEARCH_EMAIL_ADDRESS = ""; + break; + } + case '3': { + this.P_SEARCH_EMAIL_ADDRESS = this.searchKey; + this.P_SEARCH_USER_NAME = ""; + this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + break; + } + default: { + this.P_SEARCH_USER_NAME = ""; + this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + this.P_SEARCH_EMAIL_ADDRESS = ""; + break; + } + } + } else { + this.P_SEARCH_USER_NAME = ""; + this.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + this.P_SEARCH_EMAIL_ADDRESS = ""; + } + + const request = new ReplacementServiceRequest(); + request.P_SEARCH_USER_NAME = this.P_SEARCH_USER_NAME; + request.P_SEARCH_EMPLOYEE_DISPLAY_NAME = this.P_SEARCH_EMPLOYEE_DISPLAY_NAME; + request.P_SEARCH_EMAIL_ADDRESS = this.P_SEARCH_EMAIL_ADDRESS; + request.P_PAGE_NUM = this.P_PAGE_NUM; + request.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; + + this.vacationRuleService.getReplacementList(request). + subscribe((result: any) => { + this.handleReplacment(result); + }); + } + + handleReplacment(result) { + if (this.cs.validResponse(result)) { + if (this.cs.hasData(result.ReplacementList)) { + this.ReplacementList = result.ReplacementList; + this.P_PAGE_NUM++; + let lastItemIndex = this.ReplacementList.length - 1; + if (result.ReplacementList[lastItemIndex]) { + let lastitem = result.ReplacementList[lastItemIndex]; + if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + } + } + } + } + + doInfinite(infiniteScroll) { + + } + + closePage() { + this.isSave = true; + let data: any = null; + if (this.isSave == true) { + if (this.selEmp) { + data = this.ReplacementList[this.selEmp]; + } else { + data = null; + } + if (typeof this.callback == 'function') { + this.callback(data); + } + + this.modalController.dismiss({ + 'dismissed': true, + empData: data + }); + } + } +} diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html index ea8e644f..af4562cd 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.html @@ -1,13 +1,13 @@ - - - {{ 'replacementRoll, title' | translate}} + + + {{ 'replacementRoll, title' | translate}} - + - + {{'replacementRoll, searchBy' | translate}} - - + + + + + + - - - - + -
- {{"replacementRoll, question" | translate}} : - {{pQuestion}} ? - {{"replacementRoll, answer" | translate}} - - {{"replacementRoll, enterNote" | translate}} - - - - -
+ - - - - {{employee.EMPLOYEE_DISPLAY_NAME}}
{{employee.USER_NAME}}
+ + + + + + + + +
+
+
+ + + + +
- + + +
+ +
+ +
+ + + {{employee.EMPLOYEE_DISPLAY_NAME}} +
{{employee.USER_NAME}}
+ {{employee.EMAIL_ADDRESS}} +
+
+
+ +
+ + +
+ -
-
+ +
+ {{"replacementRoll, question" | translate}} : + {{pQuestion}} ? + {{"replacementRoll, answer" | translate}} + + {{"replacementRoll, enterNote" | translate}} + + + + +
+
- + {{'general, submit' | translate}} + + + {{'general, cancel' | translate}}
\ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss index e4e64f20..4032c4d2 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.scss @@ -9,8 +9,120 @@ button.item-button.button.button-md.button-clear.button-clear-md { min-width: 200px; } -ion-item { - margin-top: 5%; - margin-right: 7%; - width: 100%; +// ion-item { +// margin-top: 5%; +// margin-right: 7%; +// width: 100%; +// } +.ionItem{ + border: #e4e4e4 solid; + /* margin: 6px; */ + /* padding: 11px; */ + height: 85px; + width: 164px; + border-radius: 5px; + text-align: center; + } + + +.profileImageDiv{ + text-align: center; + margin-bottom: -27px; + z-index: 3; + position: relative; + top: 0; + +} +.profileImage{ + width:60px !important; + // margin-left: -25px; + // margin-right: 22px; +} + +.activated{ + border: #209a83 0.02cm solid ; +} +.deactivated{ border: #e4e4e4 0.02cm solid; +} +.repContentDiv{ + text-align: center; + width: 85%; + font-size: 14px; + border: #e4e4e4 solid; + border-radius: 5px; + padding: 20px 8px 8px 8px; + margin-top: -9px; + margin-right: -35px + +} +.selIEmpDiv{ + text-align: right; + margin-bottom: -26px; + margin-right: 0px; + z-index: 3; + position: relative; + top: 0; +} + +.selIEmpImage{ + width:22px !important + +} + +.noteInput{ + border: solid var(--gray) 1px; + border-radius: 15px; + margin: 8px 17px 0px 17px; + padding: 10px 2px 10px 2px; +} +.filterInput{ + border: solid var(--gray) 1px; + border-radius: 21px; + padding-left: 10px !important; +} +.filterBtn{ + background: var(--newgreen); + --background: var (--newgreen); + border-radius: 50%; + height: 60px; + width: 60px; +} + + + +*{ + box-sizing: border-box; +} + +.square-container{ + // padding: 8px; + width:100%; +} +.square{ + // width:calc(100% / 2); + width:50%; + float:left; + position: relative; + // padding-bottom: calc(100% / 2); +} + +.square .content{ + width: calc(100% - 16px) !important; + height: calc(100% - 16px) !important; + margin: 8px; + padding: 16px; + // position: absolute; + color: white; + border-radius: 9px; + text-align: center; + min-height: 92px; + // background-color: #0095ff; + // box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26); +} + + + + + + diff --git a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts index 3bd1c428..1ef4b3dd 100644 --- a/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts +++ b/Mohem/src/app/notification/work-list-replacement-roll/work-list-replacement-roll.component.ts @@ -36,6 +36,8 @@ export class WorkListReplacementRollComponent implements OnInit { private WorkListReplacmentEmployeeObj: WorkListReplacmentEmployeeRequest = new WorkListReplacmentEmployeeRequest(); private WorkListActionObj: WorkListActionRequest; getpassResAttr: any = []; + active: any; + demoeAttach:any=[]; constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService, public modalCtrl: ModalController) { this.P_PAGE_NUM = 1; @@ -51,15 +53,17 @@ export class WorkListReplacementRollComponent implements OnInit { this.WorkListReplacmentEmployeeObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; this.WorkListActionObj = new WorkListActionRequest(); - this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; + this.WorkListActionObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID;//26919060; this.WorkListActionObj.P_FORWARD_TO_USER_NAME = ""; this.WorkListActionObj.P_ACTION_MODE = ""; this.WorkListActionObj.P_COMMENTS = ""; - this.WorkListActionObj.RespondAttributeList = this.getpassResAttr; + this.WorkListActionObj.RespondAttributeList =[];// this.getpassResAttr; this.WorkListActionObj.P_APPROVER_INDEX = null; } - ngOnInit() { } + ngOnInit() { + + } getreplacmentemployee() { this.ReplacementList = []; @@ -163,6 +167,13 @@ export class WorkListReplacementRollComponent implements OnInit { this.selectedValue = Value; } + + + select(selectEmp,index){ + console.log(selectEmp.EMPLOYEE_DISPLAY_NAME); + this.selEmp=selectEmp + this.active=index; + } clear() { this.selEmpName = ""; this.selectedUserInf = null; @@ -188,10 +199,15 @@ export class WorkListReplacementRollComponent implements OnInit { } submitAction() { + this.selEmp + if (this.selEmp && this.isAnswer == false) { - this.selectedUserInf = this.ReplacementList[this.selEmp]; + // this.selectedUserInf = this.ReplacementList[this.selEmp]; + this.selectedUserInf = this.selEmp; + console.log("selEmp "+ this.selEmp.USER_NAME); if (this.selectedUserInf && this.selectedUserInf.USER_NAME) { + console.log("userInfo "+this.selectedUserInf.USER_NAME); if (this.userNote) { this.WorkListActionObj.P_FORWARD_TO_USER_NAME = this.selectedUserInf.USER_NAME; this.WorkListActionObj.P_ACTION_MODE = this.getPassActionMode; @@ -290,4 +306,12 @@ export class WorkListReplacementRollComponent implements OnInit { } } + public col(){ + alert("test"); + } + + closeModal() { + this.modalCtrl.dismiss(); + } + } diff --git a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.html b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.html index f29ecac0..708c0462 100644 --- a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.html +++ b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.html @@ -1,39 +1,72 @@ - - - {{ 'workListMain, rfc' | translate}} + + {{ 'workListMain, rfc' | translate}} +
- {{"replacementRoll.msgRFC" | translate}} + {{'replacementRoll , msgRFC' | translate}}
- + + + + + + + +
+
+
+ + +
+ +
+ +
+ +
+ + {{rfcEmployeeList.EMPLOYEE_DISPLAY_NAME}} +
{{rfcEmployeeList.ACTION}} +
+
+
+ +
+
-
- - - - -
- +
+
+ + + + + +
+
- - {{'general, submit' | translate}} -
+ + {{'general, submit' | translate}} + + + {{'general, cancel' | translate}} +
\ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss index 129d608e..6b2ebadc 100644 --- a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss +++ b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.scss @@ -4,4 +4,131 @@ min-height: 45px; min-width: 200px; } + button.item-button.button.button-md.button-clear.button-clear-md { + background-color: transparent; + } + + .footer-button { + border-radius: 3px; + padding: 0 1.1em; + min-height: 45px; + min-width: 200px; + } + + // ion-item { + // margin-top: 5%; + // margin-right: 7%; + // width: 100%; + // } + .ionItem{ + border: #e4e4e4 solid; + /* margin: 6px; */ + /* padding: 11px; */ + height: 85px; + width: 164px; + border-radius: 5px; + text-align: center; + + } + + + .profileImageDiv{ + text-align: center; + margin-bottom: -27px; + z-index: 3; + position: relative; + top: 0; + + } + .profileImage{ + width:60px !important; + // margin-left: -25px; + // margin-right: 22px; + } + + .activated{ + border: #209a83 0.02cm solid ; + } + .deactivated{ border: #e4e4e4 0.02cm solid; + } + .repContentDiv{ + text-align: center; + width: 85%; + font-size: 14px; + border: #e4e4e4 solid; + border-radius: 5px; + padding: 20px 8px 8px 8px; + margin-top: -9px; + margin-right: -35px + + } + .selIEmpDiv{ + text-align: right; + margin-bottom: -26px; + margin-right: 0px; + z-index: 3; + position: relative; + top: 0; + } + + .selIEmpImage{ + width:22px !important + + } + + .noteInput{ + border: solid var(--gray) 1px; + border-radius: 15px; + margin: 8px 17px 0px 17px; + padding: 10px 2px 10px 2px; + } + .filterInput{ + border: solid var(--gray) 1px; + border-radius: 21px; + padding-left: 10px !important; + } + .filterBtn{ + background: var(--newgreen); + --background: var (--newgreen); + border-radius: 50%; + height: 60px; + width: 60px; + } + + + + *{ + box-sizing: border-box; + } + + .square-container{ + // padding: 8px; + width:100%; + } + .square{ + // width:calc(100% / 2); + width:50%; + float:left; + position: relative; + // padding-bottom: calc(100% / 2); + } + + .square .content{ + width: calc(100% - 16px) !important; + height: calc(100% - 16px) !important; + margin: 8px; + padding: 16px; + // position: absolute; + color: white; + border-radius: 9px; + text-align: center; + // background-color: #0095ff; + // box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26); + } + + + + + + \ No newline at end of file diff --git a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts index 56e32a62..c22eba21 100644 --- a/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts +++ b/Mohem/src/app/notification/work-list-rfc/work-list-rfc.component.ts @@ -6,6 +6,7 @@ import { WorKListRFCEmployeeResponse } from '../models/RFC-EmployeeRes'; import { WorklistService } from '../service/worklist.service'; import { CommonService } from 'src/app/hmg-common/services/common/common.service'; import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; +import { ModalController } from '@ionic/angular'; @Component({ selector: 'app-work-list-rfc', @@ -29,8 +30,15 @@ export class WorkListRfcComponent implements OnInit { getpassResAttr: any = []; P_PAGE_NUM: number = 1; P_PAGE_LIMIT: number = 100; - - constructor(public worklistService: WorklistService, private cs: CommonService, private ts: TranslatorService, public workListMainService: WorklistMainService) { + active: any; + + constructor( + public worklistService: WorklistService, + private cs: CommonService, + private ts: TranslatorService, + public workListMainService: WorklistMainService, + public modalCtrl: ModalController + ) { this.getPassNotificationDetails = this.cs.sharedService.getSharedData('passNotificationInfo'); this.getpassResAttr = this.cs.sharedService.getSharedData('passResAttr'); @@ -153,5 +161,22 @@ export class WorkListRfcComponent implements OnInit { infiniteScroll.target.complete(); } }//end infiniteScroll + closeModal() { + this.modalCtrl.dismiss(); + } + + select(selectEmp,index){ + console.log(selectEmp.USER_NAME); + console.log(selectEmp.SEQ); + this.radioButtonValue=selectEmp.USER_NAME + this.seqNo = selectEmp.SEQ; +////////////////////////////////////////////////////////////// + // let emp: any = this.RFCEmployeeListListRes[v]; + // this.seqNo = emp.SEQ; + // this.radioButtonValue = emp.USER_NAME; + + + this.active=index; + } } diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html new file mode 100644 index 00000000..e0b313d3 --- /dev/null +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.html @@ -0,0 +1,66 @@ + +
+

Advanced Search

+ +
+ + +
+ + {{ts.trPK('worklist','view')}} + + {{ts.trPK('worklist','openNot')}} + {{ts.trPK('worklist','fyi')}} + {{ts.trPK('worklist','toDo')}} + {{ts.trPK('worklist','all')}} + {{ts.trPK('worklist','meNot')}} + + + + + {{ts.trPK('worklist','searchby')}} + + {{ts.trPK('worklist','from')}} + {{ts.trPK('worklist','subject')}} + {{ts.trPK('worklist','sent')}} + {{ts.trPK('worklist','itemType')}} + {{ts.trPK('worklist','none')}} + + +
+
+ + {{ts.trPK('worklist','sent')}} + + +
+
+ + + + +
+
+ + + Item Type + + HR + PO + PR + MR + + + +
+ SEARCH +
+
+
+ + + \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.scss b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.scss new file mode 100644 index 00000000..36f26405 --- /dev/null +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.scss @@ -0,0 +1,40 @@ +.search-header{ + display: inline-block; + h2 { + display: inline-block; + margin-left: 20px; + font-family: WorkSans-Regular; + font-size: 18px; + margin-top: 12px; + } + ion-icon { + display: inline-block; + font-size: 23px; + position: absolute; + right: 15px; + top: 8px; + } +} +.search-container { + margin-right: 15px; + margin-left: 15px; + padding-bottom: 100px; + margin-top: 5px; + ion-item{ + border: 2px solid #eaeaea; + border-radius: 25px; + margin-bottom: 20px; + } +} +.search-button{ + background: #3dcab3; + height: 50px; + text-align: center; + font-family: WorkSans-Regular; + border-radius: 22px; + margin-top: 20px; + line-height: 50px; + span{ + color: white; + } +} \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.spec.ts b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.spec.ts new file mode 100644 index 00000000..5ea13f34 --- /dev/null +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WorklistAdvancedSearchComponent } from './worklist-advanced-search.component'; + +describe('WorklistAdvancedSearchComponent', () => { + let component: WorklistAdvancedSearchComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WorklistAdvancedSearchComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WorklistAdvancedSearchComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts new file mode 100644 index 00000000..5f393e89 --- /dev/null +++ b/Mohem/src/app/notification/worklist-advanced-search/worklist-advanced-search.component.ts @@ -0,0 +1,65 @@ +import { Component, OnInit } from '@angular/core'; +import { ModalController } from '@ionic/angular'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; + +@Component({ + selector: 'app-worklist-advanced-search', + templateUrl: './worklist-advanced-search.component.html', + styleUrls: ['./worklist-advanced-search.component.scss'], +}) +export class WorklistAdvancedSearchComponent implements OnInit { + + public hideDateInput = false; + public hideTextInput = false; + public inputDate = ''; + public inputSearch = ''; + public selectedValue = ''; + public notificationType = ''; + public itemType = ''; + + constructor( + public modalController: ModalController, + public ts: TranslatorService + ) { } + + ngOnInit() {} + + public dismissModal() { + this.modalController.dismiss(); + } + + public search() { + console.log(this.itemType); + this.modalController.dismiss({ + notificationType: this.notificationType, + selectedValue: this.selectedValue, + inputDate: this.inputDate, + inputSearch: this.inputSearch, + itemType: this.itemType + }); + } + + onChangeView(selectedValue: any) { + this.notificationType = selectedValue.detail.value; + } + + getValueSelected(value) { + this.selectedValue = value.detail.value; + if (this.selectedValue === '1') { + this.hideDateInput = false; + this.hideTextInput = true; + } else if (this.selectedValue === '2') { + this.hideDateInput = false; + this.hideTextInput = true; + } else if (this.selectedValue === '3') { + this.hideDateInput = true; + this.hideTextInput = false; + } else if (this.selectedValue === '4') { + this.hideDateInput = false; + this.hideTextInput = true; + } else if (this.selectedValue === '5') { + this.hideDateInput = false; + this.hideTextInput = false; + } + } +} diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html index 886bf8d7..e4f7e7a5 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.html @@ -1,184 +1,199 @@ - - + + {{ts.trPK('worklistMain','title')}} - - - - - {{ts.trPK('worklistMain','info')}} - - - - {{ts.trPK('worklistMain','itemReq')}} - - - - - {{'worklistMain, actionHis' | translate}} - - - - - - {{'general, attachment' | translate}} - - - - - + + +
{{getPassNotificationDetails.SUBJECT}}
+ + + + + + + + {{ts.trPK('worklistMain','itemReq')}} + + + + + {{'worklistMain, action' | translate}} + + + + {{'general, file' | translate}} + + + + + {{ts.trPK('worklistMain','info')}} + + + + + - - -
{{pInformation}}
- - + + +
{{pInformation}}
+ + + - - - - - - - - -
+ + +
- - -
-
+ + + +
- - - -
+ + + +
- - -
-
- - - -
+ + +
- - -
-
- - - -
+ + +
- - -
-
- - - -
+ + +
+
+ + + + + + +
- - -
-
+ + + + +
- - - -
+ + +
+
+ + + + + +
- - -
-
+ +
+ - + -
+
- - + + - - -
+ + +
- -
-
+ + +
-
-
+
+
- -
- - -
{{totalH}}
-
{{valueH}}
+ +
+ + +
{{totalH}}
+
{{valueH}}
-
- -
{{taxH}}
-
{{taxvalueH}}
+
+ +
{{taxH}}
+
{{taxvalueH}}
-
-
+ + -
-
+
+
-
- + + -
+ - -
+ +
-
-
+
+
-
- - -
- - - - - - + + + -
-

{{ 'general, empty' | translate}}

-
- +
+

{{ 'general, empty' | translate}}

+
+ -
- +
+ - -
+ + + - + + +
+ + + - + + - - - - -
- + + + + + +
+ - {{notificationList.ITEM_CODE}} -
- - - -
- - {{notificationList.UOM}} -
-
- - - - - -
- - {{notificationList.QUANTITY}} + {{notificationList.QUANTITY}} -
- - -
- - {{notificationList.DATE_REQUIRED}} -
-
- - + {{notificationList.DATE_REQUIRED}} +
+
+ - - - -
- - {{notificationList.LINE_STATUS}} -
+ {{notificationList.LINE_STATUS}} + - - -
- - {{notificationList.STATUS_DATE}} -
- -
+ {{notificationList.STATUS_DATE}} + - + + - - -
- - {{notificationList.TRANSACTION_TYPE_NAME}} -
+ {{notificationList.TRANSACTION_TYPE_NAME}} + - - -
- - {{notificationList.OPERATING_UNIT}} -
+ {{notificationList.OPERATING_UNIT}} + -
- + + + + +
+ + {{notificationList.ORGANIZATION_CODE}} +
+ + +
+ + {{notificationList.ORGANIZATION_NAME}} +
+
+ - - -
- - {{notificationList.ORGANIZATION_CODE}} -
+ + +
+ + {{notificationList.FROM_SUBINVENTORY}} +
- - -
- - {{notificationList.ORGANIZATION_NAME}} -
-
- - + {{notificationList.FROM_LOCATOR}} + + + - - -
- - {{notificationList.FROM_SUBINVENTORY}} -
+ {{notificationList.TO_SUBINVENTORY}} + - - -
- - {{notificationList.FROM_LOCATOR}} -
+ {{notificationList.TO_LOCATOR}} + -
+ - + - - -
- - {{notificationList.TO_SUBINVENTORY}} -
+ {{notificationList.SHIP_TO_LOCATION}} + - - -
- - {{notificationList.TO_LOCATOR}} -
+
-
- +
+
+
+ + +
+ + + - - -
- - {{notificationList.SHIP_TO_LOCATION}} -
+ + - + + + + +
+

{{ 'general, empty' | translate}}

+
+
+ +
+ +
+ - + - - - - + +
--> - - +
+ + +
+
+ + {{actionHistory.NAME}} + -
-

{{ 'general, empty' | translate}}

-
-
- -
- +
+
+
+ Note: {{actionHistory.NOTE}} +
+
-
- - -
+
-
- + -
-
- - {{actionHistory.ACTION}} - {{actionHistory.NAME}} - - - {{actionHistory.NOTIFICATION_DATE| dateString }} - - -
- -
+
- - - - - - - - - -
-

{{ 'general, notAttch' | translate}}

-
-
- - -
- - -
- -
-
-
-
- -
-
- -
- - {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} -
- -
-
-
- + + + {{actionHistory.ACTION}} + + + {{actionHistory.NOTIFICATION_DATE| dateString }} + +
-
-
+
+
- - + + + + + + + - +
+

{{ 'general, notAttch' | translate}}

+
+
+ + + +
+ +
+
+
+
+ +
+
+ +
+ + {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} + +
+
+
+
+ + - - @@ -548,14 +564,32 @@ - - + + + + + +
+ + +
+
Transaction Successful
+
+ + + + + + {{'actionHis, action' | translate}} @@ -568,7 +602,6 @@
- @@ -577,11 +610,60 @@ - + --> + + + + + + + + + + + + Approve + + + + Reject + + + + Request + + + + Skip + + + + More + + + diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss index db039aed..dc67036f 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.scss @@ -1,8 +1,108 @@ -.itemHISBtn{ - padding: 5px; - color: var(--light); - background: var(--darkgray); - border-radius: 3px; - width: 85%; - height: 40px; -} \ No newline at end of file +// .itemHISBtn{ +// padding: 5px; +// color: var(--light); +// background: var(--darkgray); +// border-radius: 3px; +// width: 85%; +// height: 40px; +// } + + +// .rowBtn{ +// display: flex; +// flex-direction: row; +// justify-content: center; +// align-items: center; +// background: white; +// } + + + +// .rowBorder{ +// border-bottom: solid 0.03cm var(--grayBG); + +// } +// .colBorder{ +// border-right: solid 0.03cm var(--grayBG); + +// } + +// .dateActionHistory{ +// text-align: end; +// // margin-top: -25px; +// } + + +// .actionBtn{ +// --border-radius: 50% !important; +// height: 55px; +// width: 55px; +// --background: var(--newgreen); // will be dynamic +// background: transparent; +// margin:10px; +// } + +// .itemAttch{ +// border-radius: 11px; +// margin: 8px; +// --min-height: 60px; +// --max-height: 60px; +// } + +// .less { +// max-height: 54px; +// } + +// .noDataDiv{ +// background: #ffffff; +// height: 11%; +// text-align: center; +// padding-top: 1px; +// border-radius: 10px; +// margin: 10px; +// } + +// .container { +// font-size: 14px; +// line-height: 14px; +// height: 15px; +// overflow: hidden; +// text-align: justify; +// } + +// .show { +// overflow: visible; +// height: auto; +// } + +// .showMore{ +// padding: 0px; +// background: transparent; +// color: blue; +// text-decoration: underline; +// font-size: 14px; +// } +// .succssfullMSG{ +// height: 100%; +// width: 100%; +// background: var(--newgreen); +// color: white; +// font-weight: bold; +// font-size: 20px; +// text-align: center; +// vertical-align: middle; +// padding-top: 30px; +// } + +// .succssfullIcon{ +// width: 60%; +// text-align: center; +// height: 60%; +// } +// .subjectNotification{ +// text-align: center; +// padding-top: 10px; +// font-weight: bold; +// } + + \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts index 54aca8b4..ea228809 100644 --- a/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts +++ b/Mohem/src/app/notification/worklist-main-mr/worklist-main-mr.component.ts @@ -28,6 +28,9 @@ import { ViewNoteModalComponent } from '../view-note-modal/view-note-modal.compo import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes'; import { WorkListAttachViewComponent } from '../work-list-attach-view/work-list-attach-view.component'; import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component'; +import { MoreActionModalComponent } from '../more-action-modal/more-action-modal.component'; +import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component'; +import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component'; @Component({ selector: 'app-worklist-main-mr', @@ -41,7 +44,7 @@ export class WorklistMainMRComponent implements OnInit { private WorkListActionObj: WorkListActionRequest; private WorkListActionHistoryObj: WorkListActionHistoryRequest; private WorkListAttachObj: WorkListButtonRequest; - private PRList:PRNotificatonBodyList + private PRList: PRNotificatonBodyList public static PASS_NOTIFICATION_INFO = "passNotificationInfo"; public static PASS_ACTION_MODE = "passActionMode"; getPassNotificationDetails: any; @@ -65,13 +68,13 @@ export class WorklistMainMRComponent implements OnInit { selEmployeeID: any; actionType: string = ""; notificationArray: any; - notificationDynamicAttributeArr:any; + notificationDynamicAttributeArr: any; private textInput: TextInput; private textArea: TextAreaInput; notificationCount: any; - attachmentRes:any; - PRHeader:any;//change the tpye later - PRLines:any;//change the tpye later + attachmentRes: any; + PRHeader: any;//change the tpye later + PRLines: any;//change the tpye later IsReachEnd: boolean = false; P_PAGE_NUM: number = 1; P_PAGE_LIMIT: number = 100; @@ -84,6 +87,19 @@ export class WorklistMainMRComponent implements OnInit { confirmMsg: string; delMsg: string; closeMsg: string; + activeSegment: any = "info"; + lines_note_limit: any = 24; + orgNote: string; + truncating: boolean; + selectedIndex: any; + showLessBtn: boolean; + showMoreBtn: boolean; + notiActionBtnMore: any = []; + messageSuccess: boolean = false; + approveDis: boolean = false; + rejectDis: boolean = false; + requestDis: boolean = false; + constructor( @@ -98,55 +114,31 @@ export class WorklistMainMRComponent implements OnInit { public worklistService: WorklistService ) { - //this.getPassNotificationDetails = this.common.sharedService.getSharedData('passNotificationInfo'); + //this.getPassNotificationDetails = this.common.sharedService.getSharedData('passNotificationInfo'); this.WorkListActionHistoryObj = new WorkListActionHistoryRequest(); this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; - // this.WorkListActionHistoryObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; - } + // this.WorkListActionHistoryObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; + } - ngOnInit() { + ngOnInit() { this.WorkListAttachObj = new WorkListButtonRequest(); this.intializeNotificationDetail(); - let segment = document.querySelector('ion-segment'); - let slides = document.querySelector('ion-slides'); - - segment.addEventListener('ionChange', (ev) => onSegmentChange(ev)); - slides.addEventListener('ionSlideDidChange', (ev) => onSlideDidChange(ev)); - - // On Segment change slide to the matching slide - function onSegmentChange(ev) { - console.log("ev.detail.value"+ev.detail.value); - slideTo(ev.detail.value); - } - - function slideTo(index) { - console.log("index: "+index); - slides.slideTo(index); - } - - // On Slide change update segment to the matching value - async function onSlideDidChange(ev) { - var index = await slides.getActiveIndex(); - console.log("index: "+index); - clickSegment(index); - } - - function clickSegment(index) { - - segment.value = index; - } - } - + public segmentChanged(event: any) { + this.activeSegment = event.detail.value; + console.log(" event.detail.value: " + event.detail.value); + } intializeNotificationDetail() { - document.getElementById("notificationDynamicFields").innerHTML=""; + if (this.messageSuccess) { + document.getElementById("notificationDynamicFields").innerHTML = ""; + } console.log("intializeNotificationDetail"); this.getPassNotificationDetails = this.common.sharedService.getSharedData( HomeComponent.NOTIFICATION_DATA, @@ -190,38 +182,38 @@ export class WorklistMainMRComponent implements OnInit { this.getEITNotificationDetails(this.WorkListBodyObj); } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { this.getAbsenceNotificationDetails(this.WorkListBodyObj); - } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PO"){ - this.getPONotificationDetails(this.WorkListBodyObj); - } else if (this.getPassNotificationDetails.REQUEST_TYPE == "MO"){ + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PO") { + this.getPONotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "MO") { this.getMONotificationDetails(this.WorkListBodyObj); - } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR"){ - this.getPRNotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR") { + this.getPRNotificationDetails(this.WorkListBodyObj); } } - getPRNotificationDetails(notificationBodyObj){ + getPRNotificationDetails(notificationBodyObj) { this.worklistMainService - .getPRNotificationBody(notificationBodyObj) - .subscribe((result: PRNotificatonBodyResponse) => { - this.handleWorkListBodyResult(result, "PR"); - }); + .getPRNotificationBody(notificationBodyObj) + .subscribe((result: PRNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "PR"); + }); } - - getMONotificationDetails(notificationBodyObj){ - this.worklistMainService + + getMONotificationDetails(notificationBodyObj) { + this.worklistMainService .getMONotificationBody(notificationBodyObj) .subscribe((result: MONotificatonBodyResponse) => { - this.handleWorkListBodyResult(result, "MO"); + this.handleWorkListBodyResult(result, "MO"); }); - } - - getPONotificationDetails(notificationBodyObj){ + } + + getPONotificationDetails(notificationBodyObj) { this.worklistMainService - .getPONotificationBody(notificationBodyObj) - .subscribe((result: PONotificatonBodyResponse) => { - console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); - this.handleWorkListBodyResult(result, "PO"); - }); + .getPONotificationBody(notificationBodyObj) + .subscribe((result: PONotificatonBodyResponse) => { + console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); + this.handleWorkListBodyResult(result, "PO"); + }); } getEITNotificationDetails(notificationBodyObj) { @@ -246,17 +238,17 @@ export class WorklistMainMRComponent implements OnInit { this.pInformation = result.P_INFORMATION; this.pQuestion = result.P_QUESTION; if (Type == "MO") { - if (result.GetMoNotificationBodyList) { - this.notificationBodyRes = - result.GetMoNotificationBodyList; + if (result.GetMoNotificationBodyList) { + this.notificationBodyRes = + result.GetMoNotificationBodyList; + } + } - } - } } //End handleWorkListBodyResult - + getNotificationButtons(notificationButtonsObj) { this.worklistMainService .getNotificationButtons(notificationButtonsObj) @@ -270,6 +262,20 @@ export class WorklistMainMRComponent implements OnInit { // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); if (result.GetNotificationButtonsList != null) { this.notificationButtonRes = result.GetNotificationButtonsList; + this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore"); + console.log("test" + this.notificationButtonRes.length); + for (let i = 0; i < this.notificationButtonRes.length; i++) { + if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED") { + this.approveDis = true; + } else + if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED") { + this.rejectDis = true; + } else + if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { + this.requestDis = true; + } // if result == null + } // valid it + } // if result == null } // valid it } // End handleWorkListButtonsResult @@ -285,14 +291,12 @@ export class WorklistMainMRComponent implements OnInit { handleApplayActionResult(result) { if (this.common.validResponse(result)) { if (result.MessageStatus == 1) { - // this.navCtrl.push("HomePage"); - //this.common.openHome(); - //this.common.openNotificationPage(); - // for( var i = 0; i < this.notificationArray.length; i++){ - // if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) { - // this.notificationArray.splice(i, 1); - // } - // } + + this.messageSuccess = true; + + setTimeout(() => { + this.messageSuccess = false; + }, 5000); this.getNotificationCountAfterSubmit(); this.nextNotfification(); } @@ -320,11 +324,14 @@ export class WorklistMainMRComponent implements OnInit { } } - actionButton() { - let ButtonAction: string = this.actionType; + actionButton(action) { + console.log("actionButton" + action); + alert("don't forget"); + //let ButtonAction: string = this.actionType; + let ButtonAction: string = action; var responseAttrDic = this.notExampleJsonObject; this.P_RESPOND_ATTRIBUTES_TBL = []; - for (let i=0;i { - this.applyAction(this.WorkListActionObj); - }, this.ts.trPK('general', 'ok'), - () => {}, this.ts.trPK('general', 'cancel'), - this.ts.trPK('vacation-rule', 'confirmation'), - this.confirmMsg); + } + this.openApplyModal(this.WorkListActionObj); + + // this.common.confirmAlertDialogAction( + // () => { + // this.applyAction(this.WorkListActionObj); + // }, this.ts.trPK('general', 'ok'), + // () => { }, this.ts.trPK('general', 'cancel'), + // this.ts.trPK('vacation-rule', 'confirmation'), + // this.confirmMsg); + + ////////////////////////////////////////////////////////// - - // alert.onDidDismiss((data) => { // if (data == true) { // this.continueDelete(attach); // } // }); - - //this.openApplyModal(this.WorkListActionObj); - - + + // this.openApplyModal(this.WorkListActionObj); + + ////////////this.applyAction(this.WorkListActionObj); } @@ -423,14 +433,10 @@ export class WorklistMainMRComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainMRComponent.PASS_RES_ATTR ); - this.common.openWorklistRFCPage(); + // this.common.openWorklistRFCPage(); + this.openRFCModal(); } else if (ButtonAction == "ANSWER_INFO") { - // this.navCtrl.push("WorkListReplacmentRollPage", { - // pQuestion: this.pQuestion, - // passNotificationInfo: this.getPassNotificationDetails, - // passActionMode: ButtonAction, - // passResAttr: this.P_RESPOND_ATTRIBUTES_TBL - // }); + this.common.sharedService.setSharedData(this.pQuestion, "pQuestion"); this.common.sharedService.setSharedData( this.getPassNotificationDetails, @@ -444,7 +450,8 @@ export class WorklistMainMRComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainMRComponent.PASS_RES_ATTR ); - this.common.openWorklistRollReplacement(); + //this.common.openWorklistRollReplacement(); + this.openReplacementRoll(); } else if ( ButtonAction == "DELEGATE" || ButtonAction == "REQUEST_INFO" || @@ -470,7 +477,8 @@ export class WorklistMainMRComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainMRComponent.PASS_RES_ATTR ); - this.common.openWorklistRollReplacement(); + // this.common.openWorklistRollReplacement(); + this.openReplacementRoll(); } else if ( ButtonAction == "UPDATE_ACTION" || ButtonAction == "CONTINUE_ACTION" @@ -562,29 +570,29 @@ export class WorklistMainMRComponent implements OnInit { this.hideForwordEmployee = result.NotificationRespondRolesList[0]; } this.notificationDynamicFields(result.NotificationGetRespondAttributesList); - this.NotificationGetRespondAttributesList=result.NotificationGetRespondAttributesList; + this.NotificationGetRespondAttributesList = result.NotificationGetRespondAttributesList; this.common.sharedService.setSharedData( this.NotificationGetRespondAttributesList, WorklistMainMRComponent.PASS_RES_ATTR ); - this.notificationDynamicAttributeArr=result.NotificationGetRespondAttributesList; + this.notificationDynamicAttributeArr = result.NotificationGetRespondAttributesList; if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema); } // valid it } // End handleWorkListButtonsResult - notificationDynamicFields(notificationAttr){ + notificationDynamicFields(notificationAttr) { const containerId = 'notificationDynamicFields'; - for(let i=0;i { @@ -675,21 +683,23 @@ export class WorklistMainMRComponent implements OnInit { this.IsReachEnd = false; } } + this.turnCateFun(this.actionHistoryRes); + } } } - async openNoteDetail(note,sender) { + async openNoteDetail(note, sender) { // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note }); // modalPage.present(); - console.log("note"+note); + console.log("note" + note); this.common.sharedService.setSharedData(note, 'ViewNoteModalPage') - this.common.sharedService.setSharedData(sender,'ViewNoteModalPageSender') + this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender') const modal = await this.modalCtrl.create({ component: ViewNoteModalComponent, - backdropDismiss:false, + backdropDismiss: false, }); modal.cssClass = 'note-modal'; @@ -731,7 +741,7 @@ export class WorklistMainMRComponent implements OnInit { } }//end infiniteScroll -//**********Attachment *****************// + //**********Attachment *****************// async OpenAttachFiles(value, Type) { @@ -752,7 +762,7 @@ export class WorklistMainMRComponent implements OnInit { // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note }); // modalPage.present(); // console.log("note"+note); - this.common.sharedService.setSharedData( this.getPassNotificationDetails,WorklistMainMRComponent.PASS_NOTIFICATION_INFO); + this.common.sharedService.setSharedData(this.getPassNotificationDetails, WorklistMainMRComponent.PASS_NOTIFICATION_INFO); this.common.sharedService.setSharedData(WorkListActionObj, 'ApplyActionModalPage') // this.common.sharedService.setSharedData( // this.WorkListActionObj, @@ -761,23 +771,23 @@ export class WorklistMainMRComponent implements OnInit { const modal = await this.modalCtrl.create({ component: ApplyActionModalComponent, - backdropDismiss:false, + backdropDismiss: false, }); modal.cssClass = 'note-modal'; - + modal.onDidDismiss() .then((data) => { console.log(data); // Here's your selected user! - }); + }); - // data => { - // console.log('MODAL DATA', data); - // }); + // data => { + // console.log('MODAL DATA', data); + // }); // const { data } = await this.modalCtrl.onWillDismiss(); // console.log(data); return await modal.present(); - + } @@ -820,7 +830,7 @@ export class WorklistMainMRComponent implements OnInit { loadMoreNotificationBody() { console.log("loadMoreNotificationBody MR"); if (!this.IsReachEnd) { - console.log("this.IsReachEnd"+ this.IsReachEnd); + console.log("this.IsReachEnd" + this.IsReachEnd); this.worklistMainService.getMONotificationBody(this.WorkListBodyObj). subscribe((result: any) => { @@ -836,9 +846,9 @@ export class WorklistMainMRComponent implements OnInit { this.IsReachEnd = false; } this.notificationBodyRes.push(element); - }, (Error) => console.log(Error), () => - //infiniteScroll.target.complete() - console.log("test") + }, (Error) => console.log(Error), () => + //infiniteScroll.target.complete() + console.log("test") ); }// if list length >0 else { @@ -846,7 +856,7 @@ export class WorklistMainMRComponent implements OnInit { } }// if response == 1 //this.pageNum++; - // infiniteScroll.target.complete(); + // infiniteScroll.target.complete(); }); } else { @@ -872,25 +882,148 @@ export class WorklistMainMRComponent implements OnInit { this.IsReachEnd = false; } this.actionHistoryRes.push(element); - }, (Error) => console.log(Error), () => - //infiniteScroll.target.complete() - console.log("TEST")); + }, (Error) => console.log(Error), () => + //infiniteScroll.target.complete() + console.log("TEST")); }// if list length >0 else { this.IsReachEnd = true; } }// if response == 1 //this.pageNum++; - // infiniteScroll.target.complete(); + // infiniteScroll.target.complete(); }); } else { //if (infiniteScroll) - //infiniteScroll.target.complete(); + //infiniteScroll.target.complete(); } }//end infiniteScroll + async openMoreActions() { + + const modal = await this.modalCtrl.create({ + component: MoreActionModalComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'note-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + // this.selectedAction = data.data; + this.actionType = data.data.BUTTON_ACTION; + console.log(this.actionType); + ///call Action button + this.actionButton(this.actionType); + } + }); + + return await modal.present(); + + + + + } + + + /////////////////////////////////////////// + + public checkLines(note) { + console.log(note.split("\n").length); + console.log(note.length); + + if (note && note != null) { + + + return (note.length > this.lines_note_limit) ? true : false; + + + + } + + + + return false; + }; + + + public turnCateFun(actionHis) { + for (let i = 0; i < actionHis.length; i++) { + actionHis[i].visible = false; + + } + + this.actionHistoryRes = actionHis; + console.log("test"); + } + + + async openReplacementRoll() { + + const modal = await this.modalCtrl.create({ + component: WorkListReplacementRollComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'replaceRoll-modal'; + + modal.onDidDismiss().then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + + } + }); + + return await modal.present(); + + + + + } + + async openRFCModal() { + + + + + const modal = await this.modalCtrl.create({ + component: WorkListRfcComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'replaceRoll-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + + } + }); + + return await modal.present(); + + + + + } + } diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html index b29116a2..403721ff 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.html @@ -1,38 +1,55 @@ - - + + {{ts.trPK('worklistMain','title')}} - - - - {{ts.trPK('worklistMain','info')}} - - - {{ts.trPK('worklistMain','line_details')}} - - - - {{'worklistMain, actionHis' | translate}} + + + +
+ +
+
Transaction Successful
+
+ + +
{{getPassNotificationDetails.SUBJECT}}
+ + + + + + {{ts.trPK('worklistMain','line_details')}} + + + + {{'worklistMain, action' | translate}} + + + + {{'general, file' | translate}} - - - - {{'general, attachment' | translate}} - + + {{ts.trPK('worklistMain','info')}} + -
-
- - - + + + + +
{{pInformation}}
@@ -40,8 +57,8 @@ - - + + @@ -49,8 +66,8 @@ - - + - - + +
-
+ @@ -81,16 +98,16 @@
- - + +
-
- + @@ -98,40 +115,40 @@ - - - + + +
-
+ +
- - + +
-
- +
@@ -139,15 +156,15 @@
- - + +
-
- +
@@ -155,15 +172,15 @@
- - + +
-
- + @@ -172,16 +189,16 @@ - - + +
-
- + @@ -190,15 +207,15 @@ - - + +
-
- +
@@ -206,15 +223,15 @@
- - + +
-
- + @@ -223,16 +240,16 @@ - - + +
-
- +
@@ -241,15 +258,15 @@
- - + +
-
- +
@@ -257,26 +274,17 @@
- - + +
-
- + @@ -286,14 +294,17 @@
- - + +
+
- + @@ -348,39 +359,39 @@ - - - -

{{ 'general, empty' | translate}}

- - -
- - - - + + + + + + + + +
+ + - - - - - - - - + + +
{{Lines.ITEM_CODE}}
- +
@@ -390,8 +401,8 @@
- - + +
@@ -410,9 +421,9 @@
- + - +
@@ -431,9 +442,9 @@
- + - +
@@ -452,9 +463,9 @@
- + - +
@@ -474,9 +485,9 @@
- + - +
@@ -496,9 +507,9 @@
- + - +
@@ -506,12 +517,8 @@ {{Lines.REQUESTOR}}
- + + @@ -519,7 +526,7 @@
- + @@ -528,18 +535,11 @@
- - - - + @@ -549,10 +549,7 @@
@@ -560,32 +557,36 @@
-
- +
+ + + + -
-
- + + + - - - + + + -
+

{{ 'general, empty' | translate}}

- +
-
+ -
-
+
+ +
+ {{actionHistory.NAME}} + + +
+
+
+
+ Note: {{actionHistory.NOTE}} +
+
+ + +
+ +
+ Note: {{actionHistory.NOTE}} + + +
+ + +
+
+ +
+ + {{actionHistory.ACTION}} - {{actionHistory.NAME}} - + - {{actionHistory.NOTIFICATION_DATE| dateString }} + {{actionHistory.NOTIFICATION_DATE| dateString }}
- + - - - - - -
-

{{ 'general, notAttch' | translate}}

-
+ + + +
+

{{ 'general, notAttch' | translate}}

+
- -
- - -
- -
-
-
-
- -
-
- -
- - {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} -
+ + +
+ +
+
+
+
+ +
+
+ +
+ + {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} + + + +
+ +
+ + +
+ + + - -
- + + +
+
+
+
+ -
- - - +
+ +
+
Transaction Successful
+
- + - - + - + + + + + + + + + + + + + + + Approve + + + + + Reject + + + + + Request + + + + Skip + + + + + More + + + + \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss index db039aed..a321bdf4 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.scss @@ -1,8 +1,110 @@ -.itemHISBtn{ - padding: 5px; - color: var(--light); - background: var(--darkgray); - border-radius: 3px; - width: 85%; - height: 40px; -} \ No newline at end of file +// .itemHISBtn{ +// padding: 5px; +// color: var(--light); +// background: var(--darkgray); +// border-radius: 3px; +// width: 85%; +// height: 40px; +// } + + +// .rowBtn{ +// display: flex; +// flex-direction: row; +// justify-content: center; +// align-items: center; +// background: white; +// } + + + +// .rowBorder{ +// border-bottom: solid 0.03cm var(--grayBG); + +// } +// .colBorder{ +// border-right: solid 0.03cm var(--grayBG); + +// } + +// .dateActionHistory{ +// text-align: end; +// // margin-top: -25px; +// } + + +// .actionBtn{ +// --border-radius: 50% !important; +// height: 55px; +// width: 55px; +// --background: var(--newgreen); // will be dynamic +// background: transparent; +// margin:10px; +// } + +// .itemAttch{ +// border-radius: 11px; +// margin: 8px; +// --min-height: 60px; +// --max-height: 60px; +// } + +// .less { +// max-height: 54px; +// } + +// .noDataDiv{ +// background: #ffffff; +// height: 11%; +// text-align: center; +// padding-top: 1px; +// border-radius: 10px; +// margin: 10px; +// } + + +// .container { +// font-size: 14px; +// line-height: 14px; +// height: 16px; +// overflow: hidden; +// text-align: justify; +// } + +// .show { +// overflow: visible; +// height: auto; +// } + +// .showMore{ +// padding: 0px; +// background: transparent; +// color: blue; +// text-decoration: underline; +// font-size: 14px; +// } + +// .succssfullMSG{ +// height: 100%; +// width: 100%; +// background: var(--newgreen); +// color: white; +// font-weight: bold; +// font-size: 20px; +// text-align: center; +// vertical-align: middle; +// padding-top: 30px; +// } + +// .succssfullIcon{ +// width: 60%; +// text-align: center; +// height: 60%; +// } + +// .subjectNotification{ +// text-align: center; +// padding-top: 10px; +// font-weight: bold; +// } + \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts index 558f1976..73abbf7c 100644 --- a/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts +++ b/Mohem/src/app/notification/worklist-main-po/worklist-main-po.component.ts @@ -32,6 +32,9 @@ import { POItemHistoryRes } from '../models/POItemHistoryRes'; import { POItemHistoryRequest } from '../models/POItemHistoryReq'; import { QuotationAnalysisResponse } from '../models/quotationAnalysisRes'; import { QuotationAnalysisRequest } from '../models/quotationAnalysisReq'; +import { MoreActionModalComponent } from '../more-action-modal/more-action-modal.component' +import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component'; +import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component'; @Component({ selector: 'app-worklist-main-po', @@ -44,12 +47,14 @@ export class WorklistMainPoComponent implements OnInit { private WorkListActionObj: WorkListActionRequest; private WorkListActionHistoryObj: WorkListActionHistoryRequest; private WorkListAttachObj: WorkListButtonRequest; - private PRList:PRNotificatonBodyList + private PRList: PRNotificatonBodyList; + public static PASS_NOTIFICATION_INFO = "passNotificationInfo"; public static PASS_PO_INFO = "passPOInfo"; public static PASS_PO_HEADER_ID = "passPOHeader"; - public static PASS_ACTION_MODE = "passActionMode"; + public static PASS_ACTION_MORE = "passActioMore"; + getPassNotificationDetails: any; public static PASS_RES_ATTR = "passResAttr"; TransactionID: number = -999; @@ -71,13 +76,13 @@ export class WorklistMainPoComponent implements OnInit { selEmployeeID: any; actionType: string = ""; notificationArray: any; - notificationDynamicAttributeArr:any; + notificationDynamicAttributeArr: any; private textInput: TextInput; private textArea: TextAreaInput; notificationCount: any; - attachmentRes:any; - PRHeader:any;//change the tpye later - PRLines:any;//change the tpye later + attachmentRes: any; + PRHeader: any;//change the tpye later + PRLines: any;//change the tpye later IsReachEnd: boolean = false; P_PAGE_NUM: number = 1; P_PAGE_LIMIT: number = 100; @@ -95,6 +100,22 @@ export class WorklistMainPoComponent implements OnInit { PO_NUMBER: any; itemHistoryRes: any; QutationAnalysisRes: any; + activeSegment: any = "info"; + lines_note_limit: number = 24; + notiActionBtnMore: any = []; + demoeAttach: any = []; + orgNote: any; + truncating: boolean = true; + hidden: boolean = true; + selectedIndex = -1; + showLessBtn: boolean; + showMoreBtn: boolean = true; + selectedAction: any = []; + messageSuccess: boolean = false; + approveDis: boolean = false; + rejectDis: boolean = false; + requestDis: boolean = false; + constructor( public common: CommonService, @@ -106,7 +127,7 @@ export class WorklistMainPoComponent implements OnInit { public worklistAttachService: WorklistAttachService, private modalCtrl: ModalController, public worklistService: WorklistService, - ) { + ) { this.WorkListActionHistoryObj = new WorkListActionHistoryRequest(); this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; @@ -118,43 +139,13 @@ export class WorklistMainPoComponent implements OnInit { this.intializeNotificationDetail(); - let segment = document.querySelector('ion-segment'); - let slides = document.querySelector('ion-slides'); - - segment.addEventListener('ionChange', (ev) => onSegmentChange(ev)); - slides.addEventListener('ionSlideDidChange', (ev) => onSlideDidChange(ev)); - - // On Segment change slide to the matching slide - function onSegmentChange(ev) { - console.log("ev.detail.value"+ev.detail.value); - slideTo(ev.detail.value); - } - - function slideTo(index) { - console.log("index: "+index); - - slides.slideTo(index); - } - - // On Slide change update segment to the matching value - async function onSlideDidChange(ev) { - var index = await slides.getActiveIndex(); - console.log("index: "+index); - clickSegment(index); - } - - function clickSegment(index) { - - segment.value = index; - } - - - }//ngOn intializeNotificationDetail() { - document.getElementById("notificationDynamicFields").innerHTML=""; + if (this.messageSuccess) { + document.getElementById("notificationDynamicFields").innerHTML = ""; + } console.log("intializeNotificationDetail"); this.getPassNotificationDetails = this.common.sharedService.getSharedData( HomeComponent.NOTIFICATION_DATA, @@ -194,18 +185,24 @@ export class WorklistMainPoComponent implements OnInit { this.getActionHistory(this.WorkListActionHistoryObj); this.getAttachmentNotification(this.WorkListAttachObj); - - if (this.getPassNotificationDetails.REQUEST_TYPE == "PO"){ - this.getPONotificationDetails(this.WorkListBodyObj); - } + + if (this.getPassNotificationDetails.REQUEST_TYPE == "PO") { + this.getPONotificationDetails(this.WorkListBodyObj); + } + } + + public segmentChanged(event: any) { + this.activeSegment = event.detail.value; + console.log(" event.detail.value: " + event.detail.value); } - getPONotificationDetails(notificationBodyObj){ + + getPONotificationDetails(notificationBodyObj) { this.worklistMainService - .getPONotificationBody(notificationBodyObj) - .subscribe((result: PONotificatonBodyResponse) => { - console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); - this.handleWorkListBodyResult(result, "PO"); - }); + .getPONotificationBody(notificationBodyObj) + .subscribe((result: PONotificatonBodyResponse) => { + console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); + this.handleWorkListBodyResult(result, "PO"); + }); } handleWorkListBodyResult(result, Type) { @@ -224,64 +221,64 @@ export class WorklistMainPoComponent implements OnInit { this.notificationBodyRes = result.GetAbsenceCollectionNotificationBodyList; } - }else if (Type == "PR") { + } else if (Type == "PR") { if (result.GetPrNotificationBodyList) { console.log("PR"); - this.PRHeader=result.GetPrNotificationBodyList.PRHeader; - this.PRLines=result.GetPrNotificationBodyList.PRLines; - for( var i = 0; i < this.PRHeader.length; i++){ - if(this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total'){ - this.totalH=this.PRHeader[i].HDR_ATTRIBUTE_NAME; - this.valueH=this.PRHeader[i].HDR_ATTRIBUTE_VALUE; + this.PRHeader = result.GetPrNotificationBodyList.PRHeader; + this.PRLines = result.GetPrNotificationBodyList.PRLines; + for (var i = 0; i < this.PRHeader.length; i++) { + if (this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total') { + this.totalH = this.PRHeader[i].HDR_ATTRIBUTE_NAME; + this.valueH = this.PRHeader[i].HDR_ATTRIBUTE_VALUE; - //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'" - } - if(this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax'){ - this.taxH=this.PRHeader[i].HDR_ATTRIBUTE_NAME; - this.taxvalueH=this.PRHeader[i].HDR_ATTRIBUTE_VALUE; + //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'" + } + if (this.PRHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax') { + this.taxH = this.PRHeader[i].HDR_ATTRIBUTE_NAME; + this.taxvalueH = this.PRHeader[i].HDR_ATTRIBUTE_VALUE; + } + + // HDR_ATTRIBUTE_VALUE } - - // HDR_ATTRIBUTE_VALUE - } this.notificationBodyRes = result.GetPrNotificationBodyList; } - - }else if (Type == "PO") { - if (result.GetPoNotificationBodyList) { - console.log("PO"); - this.POHeader=result.GetPoNotificationBodyList.POHeader; - this.POLines=result.GetPoNotificationBodyList.POLines; - for( var i = 0; i < this.POHeader.length; i++){ - this.PO_NUMBER=this.POHeader[i].PO_NUMBER; + } else if (Type == "PO") { + if (result.GetPoNotificationBodyList) { + console.log("PO"); - if(this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total'){ - this.totalH=this.POHeader[i].HDR_ATTRIBUTE_NAME; - this.valueH=this.POHeader[i].HDR_ATTRIBUTE_VALUE; + this.POHeader = result.GetPoNotificationBodyList.POHeader; + this.POLines = result.GetPoNotificationBodyList.POLines; + for (var i = 0; i < this.POHeader.length; i++) { + this.PO_NUMBER = this.POHeader[i].PO_NUMBER; - //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'" - } - if(this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax'){ - this.taxH=this.POHeader[i].HDR_ATTRIBUTE_NAME; - this.taxvalueH=this.POHeader[i].HDR_ATTRIBUTE_VALUE; + if (this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Requisition Total') { + this.totalH = this.POHeader[i].HDR_ATTRIBUTE_NAME; + this.valueH = this.POHeader[i].HDR_ATTRIBUTE_VALUE; + + //this. header.HDR_ATTRIBUTE_NAME != 'Non-Recoverable Tax'" + } + if (this.POHeader[i].HDR_ATTRIBUTE_NAME === 'Non-Recoverable Tax') { + this.taxH = this.POHeader[i].HDR_ATTRIBUTE_NAME; + this.taxvalueH = this.POHeader[i].HDR_ATTRIBUTE_VALUE; + + } + // HDR_ATTRIBUTE_VALUE + } + this.notificationBodyRes = + result.GetPoNotificationBodyList; } - - // HDR_ATTRIBUTE_VALUE - } - this.notificationBodyRes = - result.GetPoNotificationBodyList; - } - }// - } + }// + } } //End handleWorkListBodyResult - - - + + + getNotificationButtons(notificationButtonsObj) { this.worklistMainService .getNotificationButtons(notificationButtonsObj) @@ -292,14 +289,31 @@ export class WorklistMainPoComponent implements OnInit { handleWorkListButtonsResult(result) { if (this.common.validResponse(result)) { + this.notiActionBtnMore = [] // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); if (result.GetNotificationButtonsList != null) { this.notificationButtonRes = result.GetNotificationButtonsList; - } // if result == null - } // valid it - } // End handleWorkListButtonsResult + this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore"); + console.log("test" + this.notificationButtonRes.length); + for (let i = 0; i < this.notificationButtonRes.length; i++) { + if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED") { + this.approveDis = true; + } else + if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED") { + this.rejectDis = true; + } else + if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { + this.requestDis = true; + } // if result == null + } // valid it + + } // valid it + } // End handleWorkListButtonsResult + + } applyAction(WorkListActionObj) { + console.log("applyactio"); this.worklistMainService .actionButton(WorkListActionObj) .subscribe((result: any) => { @@ -310,14 +324,14 @@ export class WorklistMainPoComponent implements OnInit { handleApplayActionResult(result) { if (this.common.validResponse(result)) { if (result.MessageStatus == 1) { - // this.navCtrl.push("HomePage"); - //this.common.openHome(); - //this.common.openNotificationPage(); - // for( var i = 0; i < this.notificationArray.length; i++){ - // if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) { - // this.notificationArray.splice(i, 1); - // } - // } + + + this.messageSuccess = true; + + setTimeout(() => { + this.messageSuccess = false; + }, 5000); + this.getNotificationCountAfterSubmit(); this.nextNotfification(); } @@ -345,11 +359,16 @@ export class WorklistMainPoComponent implements OnInit { } } - actionButton() { - let ButtonAction: string = this.actionType; + actionButton(action) { + + console.log("actionButton" + action); + alert("don't forget"); + //let ButtonAction: string = this.actionType; + let ButtonAction: string = action; + var responseAttrDic = this.notExampleJsonObject; this.P_RESPOND_ATTRIBUTES_TBL = []; - for (let i=0;i { this.applyAction(this.WorkListActionObj); - }, this.ts.trPK('general', 'ok'), - () => {}, this.ts.trPK('general', 'cancel'), + }, this.ts.trPK('general', 'ok'), + () => { }, this.ts.trPK('general', 'cancel'), this.ts.trPK('vacation-rule', 'confirmation'), - this.confirmMsg); + this.confirmMsg); + + - - // alert.onDidDismiss((data) => { // if (data == true) { // this.continueDelete(attach); // } // }); - + //this.openApplyModal(this.WorkListActionObj); - - + + ////////////this.applyAction(this.WorkListActionObj); } @@ -448,7 +467,8 @@ export class WorklistMainPoComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainPoComponent.PASS_RES_ATTR ); - this.common.openWorklistRFCPage(); + //this.common.openWorklistRFCPage(); + this.openRFCModal(); } else if (ButtonAction == "ANSWER_INFO") { // this.navCtrl.push("WorkListReplacmentRollPage", { // pQuestion: this.pQuestion, @@ -469,7 +489,8 @@ export class WorklistMainPoComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainPoComponent.PASS_RES_ATTR ); - this.common.openWorklistRollReplacement(); + // this.common.openWorklistRollReplacement(); + this.openRepRolModal(); } else if ( ButtonAction == "DELEGATE" || ButtonAction == "REQUEST_INFO" || @@ -495,7 +516,8 @@ export class WorklistMainPoComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainPoComponent.PASS_RES_ATTR ); - this.common.openWorklistRollReplacement(); + // this.common.openWorklistRollReplacement(); + this.openRepRolModal(); } else if ( ButtonAction == "UPDATE_ACTION" || ButtonAction == "CONTINUE_ACTION" @@ -587,29 +609,29 @@ export class WorklistMainPoComponent implements OnInit { this.hideForwordEmployee = result.NotificationRespondRolesList[0]; } this.notificationDynamicFields(result.NotificationGetRespondAttributesList); - this.NotificationGetRespondAttributesList=result.NotificationGetRespondAttributesList; + this.NotificationGetRespondAttributesList = result.NotificationGetRespondAttributesList; this.common.sharedService.setSharedData( this.NotificationGetRespondAttributesList, WorklistMainPoComponent.PASS_RES_ATTR ); - this.notificationDynamicAttributeArr=result.NotificationGetRespondAttributesList; + this.notificationDynamicAttributeArr = result.NotificationGetRespondAttributesList; if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema); } // valid it } // End handleWorkListButtonsResult - notificationDynamicFields(notificationAttr){ + notificationDynamicFields(notificationAttr) { const containerId = 'notificationDynamicFields'; - for(let i=0;i { @@ -689,6 +711,7 @@ export class WorklistMainPoComponent implements OnInit { if (this.common.validResponse(result)) { if (this.common.hasData(result.GetActionHistoryList)) { this.actionHistoryRes = result.GetActionHistoryList; + this.P_PAGE_NUM++; this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; let lastItemIndex = this.actionHistoryRes.length - 1; @@ -701,20 +724,22 @@ export class WorklistMainPoComponent implements OnInit { } } } + this.turnCateFun(this.actionHistoryRes); + } } - async openNoteDetail(note,sender) { + async openNoteDetail(note, sender) { // let modalPage = this.modalCtrl.create('ViewNoteModalPage', { textNote: note }); // modalPage.present(); - console.log("note"+note); + console.log("note" + note); this.common.sharedService.setSharedData(note, 'ViewNoteModalPage') - this.common.sharedService.setSharedData(sender,'ViewNoteModalPageSender') + this.common.sharedService.setSharedData(sender, 'ViewNoteModalPageSender') const modal = await this.modalCtrl.create({ component: ViewNoteModalComponent, - backdropDismiss:false, + backdropDismiss: false, }); modal.cssClass = 'note-modal'; @@ -755,7 +780,7 @@ export class WorklistMainPoComponent implements OnInit { } }//end infiniteScroll -//**********Attachment *****************// + //**********Attachment *****************// async OpenAttachFiles(value, Type) { @@ -774,9 +799,9 @@ export class WorklistMainPoComponent implements OnInit { console.log(itemID); this.IsReachEnd = false; const request = new POItemHistoryRequest(); - request.P_ITEM_ID=parseInt(itemID); - request.P_PAGE_LIMIT=100; - request.P_PAGE_NUM=1; + request.P_ITEM_ID = parseInt(itemID); + request.P_PAGE_LIMIT = 100; + request.P_PAGE_NUM = 1; this.worklistMainService.getPOItemHistory(request). subscribe((result: POItemHistoryRes) => { // this.common.sharedService.setSharedData( @@ -788,7 +813,7 @@ export class WorklistMainPoComponent implements OnInit { WorklistMainPoComponent.PASS_PO_INFO ); //open page - // this.common.openItemHistoryPage(); + // this.common.openItemHistoryPage(); this.handleItemHistoryResult(result); }); } @@ -801,21 +826,22 @@ export class WorklistMainPoComponent implements OnInit { } } - else{ + else { this.common.presentAlert( this.ts.trPK("general", "empty") - ); } + ); + } } - getQutationAnalysis(headerID,itemID) { - console.log(itemID+headerID); + getQutationAnalysis(headerID, itemID) { + console.log(itemID + headerID); this.IsReachEnd = false; const request = new QuotationAnalysisRequest(); - request.P_ITEM_ID=parseInt(itemID); - request.P_PO_HEADER_ID=headerID; - request.P_PAGE_LIMIT=100; - request.P_PAGE_NUM=1; + request.P_ITEM_ID = parseInt(itemID); + request.P_PO_HEADER_ID = headerID; + request.P_PAGE_LIMIT = 100; + request.P_PAGE_NUM = 1; this.worklistMainService.getQutationAnalysis(request). subscribe((result: QuotationAnalysisResponse) => { this.common.sharedService.setSharedData( @@ -827,7 +853,7 @@ export class WorklistMainPoComponent implements OnInit { WorklistMainPoComponent.PASS_PO_HEADER_ID ); //open page - + this.handleQutationAnalysisResult(result); }); @@ -840,10 +866,10 @@ export class WorklistMainPoComponent implements OnInit { //open page //set sheard data // - - this.common.openQutationAnalysisPage(); - + this.common.openQutationAnalysisPage(); + + // this.QutationAnalysisRes = result.GetQutationAnalysisList; // this.P_PAGE_NUM++; // let lastItemIndex = this.QutationAnalysisRes.length - 1; @@ -856,18 +882,19 @@ export class WorklistMainPoComponent implements OnInit { // } // } }//hasData - else{ - this.common.presentAlert( - this.ts.trPK("general", "empty") - ); } + else { + this.common.presentAlert( + this.ts.trPK("general", "empty") + ); + } } } - + loadMoreNotificationBody() { console.log("loadMoreNotificationBody PO"); if (!this.IsReachEnd) { - console.log("this.IsReachEnd"+ this.IsReachEnd); + console.log("this.IsReachEnd" + this.IsReachEnd); this.worklistMainService.getPONotificationBody(this.WorkListBodyObj). subscribe((result: any) => { @@ -882,9 +909,9 @@ export class WorklistMainPoComponent implements OnInit { this.IsReachEnd = false; } this.notificationBodyRes.push(element); - }, (Error) => console.log(Error), () => - //infiniteScroll.target.complete() - console.log("test") + }, (Error) => console.log(Error), () => + //infiniteScroll.target.complete() + console.log("test") ); }// if list length >0 else { @@ -892,7 +919,7 @@ export class WorklistMainPoComponent implements OnInit { } }// if response == 1 //this.pageNum++; - // infiniteScroll.target.complete(); + // infiniteScroll.target.complete(); }); } else { @@ -918,25 +945,155 @@ export class WorklistMainPoComponent implements OnInit { this.IsReachEnd = false; } this.actionHistoryRes.push(element); - }, (Error) => console.log(Error), () => - //infiniteScroll.target.complete() - console.log("TEST")); + }, (Error) => console.log(Error), () => + //infiniteScroll.target.complete() + console.log("TEST")); }// if list length >0 else { this.IsReachEnd = true; } }// if response == 1 //this.pageNum++; - // infiniteScroll.target.complete(); + // infiniteScroll.target.complete(); }); } else { //if (infiniteScroll) - //infiniteScroll.target.complete(); + //infiniteScroll.target.complete(); } }//end infiniteScroll + async openMoreActions() { + + const modal = await this.modalCtrl.create({ + component: MoreActionModalComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'note-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + // this.selectedAction = data.data; + this.actionType = data.data.BUTTON_ACTION; + console.log(this.actionType); + ///call Action button + this.actionButton(this.actionType); + } + }); + + return await modal.present(); + + + + + } + + /////////////////////////////////////////// + + public checkLines(note) { + console.log(note.split("\n").length); + console.log(note.length); + + if (note && note != null) { + + + return (note.length > this.lines_note_limit) ? true : false; + + + + } + + + + return false; + }; + + + public turnCateFun(actionHis) { + for (let i = 0; i < actionHis.length; i++) { + actionHis[i].visible = false; + + } + // actionHis.map((obj) => { + // obj.visible = false; + // // or via brackets + // // obj['total'] = 2; + // return obj; + // }) + this.actionHistoryRes = actionHis; + console.log("test"); + } + + async openRepRolModal() { + + + + + const modal = await this.modalCtrl.create({ + component: WorkListReplacementRollComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'replaceRoll-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + + } + }); + + return await modal.present(); + + + + + } + + async openRFCModal() { + + + + + const modal = await this.modalCtrl.create({ + component: WorkListRfcComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'replaceRoll-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + + } + }); + + return await modal.present(); + + + + + } + } diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html index d3b32a89..123bdcba 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.html @@ -1,186 +1,184 @@ - - + + {{ts.trPK('worklistMain','title')}} - - - - - - {{ts.trPK('worklistMain','info')}} - - - - {{ts.trPK('worklistMain','itemReq')}} - - - - - {{'worklistMain, actionHis' | translate}} - - - - - - {{'general, attachment' | translate}} - - - - - + + +
{{getPassNotificationDetails.SUBJECT}}
+ + + + + + {{ts.trPK('worklistMain','itemReq')}} + + + {{'worklistMain, action' | translate}} + + + {{'general, file' | translate}} - - + -
{{pInformation}}
+ + {{ts.trPK('worklistMain','info')}} + +
- - - - - - - -
- - -
-
+ + - - - -
+ + +
- - -
-
+ + + - - - -
+ + + +
- - -
-
- - - -
+ +
+ + + +
- - -
-
- - - -
- - - -
-
- - - -
- - + + + +
+ + - -
-
+ +
+
- + + + - - - + --> -
+ - - +
- - -
+ + - -
- + + +
-
-
+ + +
+
+
- -
- - -
{{totalH}}
-
{{valueH}}
-
- -
{{taxH}}
-
{{taxvalueH}}
+ +
+ + +
{{totalH}}
+
{{valueH}}
-
-
+ + +
{{taxH}}
+
{{taxvalueH}}
-
-
+
+
+
+
-
- -
+ + + - -
-
-
+ +
+
- - - + + - - - - + - + + +
+

{{ 'general, empty' | translate}}

+
+ -
-

{{ 'general, empty' | translate}}

-
- -
- - -
- + + + + + + +
+ + - + - - - - -
- + + + +
+ - {{Lines.COST_CENTER}} -
- - - -
- - {{Lines.ITEM_CODE}} -
-
- + {{Lines.ITEM_CODE}} +
+
+ + + +
- - -
- - {{Lines.UOM}} -
- + {{Lines.UOM}} +
- - -
- - {{Lines.UNIT_PRICE}} -
-
- + + +
+ {{Lines.UNIT_PRICE}} - - -
- - {{Lines.LINE_AMOUNT}} -
+
+
+ + + +
- + {{Lines.LINE_AMOUNT}} +
- - -
- - {{Lines.QUANTITY}} -
-
-
- + + +
- + {{Lines.QUANTITY}} +
+ +
- - - - - - - - -
-

{{ 'general, empty' | translate}}

-
-
- -
- + + -
- - + + + + -
+
+

{{ 'general, empty' | translate}}

+
+
+ +
+ + +
+ + -
- +
--> + +
+ + -
-
- - {{actionHistory.ACTION}} - {{actionHistory.NAME}} - - - {{actionHistory.NOTIFICATION_DATE| dateString }} - - -
- -
+
+ + + {{actionHistory.NAME}} + - +
+
+
+
+ Note: {{actionHistory.NOTE}} +
+
- - - - - - -
-

{{ 'general, notAttch' | translate}}

-
-
- - -
- - -
- -
-
-
-
- -
-
- +
+ +
+ Note: {{actionHistory.NOTE}} + + +
+ + +
- - {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} -
- -
-
- -
- + + + + +
+ + + {{actionHistory.ACTION}} + + + + {{actionHistory.NOTIFICATION_DATE| dateString }} + + +
+ +
+ + + + + + + + +
+

{{ 'general, notAttch' | translate}}

+
+ +
+ + + +
+ +
+
- - - +
+ +
+
+ +
+ + {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} - + +
+ +
- - - +
+ +
@@ -418,14 +417,28 @@ - - + +
+ + +
+
Transaction Successful
+
+ + + + + + {{'actionHis, action' | translate}} @@ -438,7 +451,6 @@ - @@ -447,10 +459,59 @@ -
- - - + + --> + + + + + + + + + + + Approve + + + + + Reject + + + + + Request + + + + Skip + + + + + More + + + diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss index db039aed..74a23cee 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.scss @@ -1,8 +1,106 @@ -.itemHISBtn{ - padding: 5px; - color: var(--light); - background: var(--darkgray); - border-radius: 3px; - width: 85%; - height: 40px; -} \ No newline at end of file +// .itemHISBtn{ +// padding: 5px; +// color: var(--light); +// background: var(--darkgray); +// border-radius: 3px; +// width: 85%; +// height: 40px; +// } + + +// .rowBtn{ +// display: flex; +// flex-direction: row; +// justify-content: center; +// align-items: center; +// background: white; +// } + + + +// .rowBorder{ +// border-bottom: solid 0.03cm var(--grayBG); + +// } +// .colBorder{ +// border-right: solid 0.03cm var(--grayBG); + +// } + +// .dateActionHistory{ +// text-align: end; +// // margin-top: -25px; +// } + + +// .actionBtn{ +// --border-radius: 50% !important; +// height: 55px; +// width: 55px; +// --background: var(--newgreen); // will be dynamic +// background: transparent; +// margin:10px; +// } + +// .itemAttch{ +// border-radius: 11px; +// margin: 8px; +// --min-height: 60px; +// --max-height: 60px; +// } + +// .less { +// max-height: 54px; +// } + +// .noDataDiv{ +// background: #ffffff; +// height: 11%; +// text-align: center; +// padding-top: 1px; +// border-radius: 10px; +// margin: 10px; +// } + +// .container { +// font-size: 14px; +// line-height: 14px; +// height: 16px; +// overflow: hidden; +// text-align: justify; +// } + +// .show { +// overflow: visible; +// height: auto; +// } + +// .showMore{ +// padding: 0px; +// background: transparent; +// color: blue; +// text-decoration: underline; +// font-size: 14px; +// } +// .succssfullMSG{ +// height: 100%; +// width: 100%; +// background: var(--newgreen); +// color: white; +// font-weight: bold; +// font-size: 20px; +// text-align: center; +// vertical-align: middle; +// padding-top: 30px; +// } + +// .succssfullIcon{ +// width: 60%; +// text-align: center; +// height: 60%; +// } +// .subjectNotification{ +// text-align: center; +// padding-top: 10px; +// font-weight: bold; +// } \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts index bfb8ab5f..a71d4621 100644 --- a/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts +++ b/Mohem/src/app/notification/worklist-main-pr/worklist-main-pr.component.ts @@ -28,6 +28,10 @@ import { ViewNoteModalComponent } from '../view-note-modal/view-note-modal.compo import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes'; import { WorkListAttachViewComponent } from '../work-list-attach-view/work-list-attach-view.component'; import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component'; +import { MoreActionModalComponent } from '../more-action-modal/more-action-modal.component'; +import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component'; +import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component'; + @Component({ selector: 'app-worklist-main-pr', templateUrl: './worklist-main-pr.component.html', @@ -83,6 +87,19 @@ export class WorklistMainPRComponent implements OnInit { confirmMsg: string; delMsg: string; closeMsg: string; + truncating: boolean; + orgNote: any; + lines_note_limit: any = 24; + selectedIndex: any; + showLessBtn: boolean; + showMoreBtn: boolean; + demoeAttach: any = []; + notiActionBtnMore: any = []; + messageSuccess: boolean = false; + activeSegment: any = "info"; + approveDis: boolean; + rejectDis: boolean; + requestDis: boolean; constructor( @@ -109,43 +126,19 @@ export class WorklistMainPRComponent implements OnInit { this.intializeNotificationDetail(); - let segment = document.querySelector('ion-segment'); - let slides = document.querySelector('ion-slides'); - segment.addEventListener('ionChange', (ev) => onSegmentChange(ev)); - slides.addEventListener('ionSlideDidChange', (ev) => onSlideDidChange(ev)); - // On Segment change slide to the matching slide - function onSegmentChange(ev) { - console.log("ev.detail.value" + ev.detail.value); - slideTo(ev.detail.value); - } - function slideTo(index) { - console.log("index: " + index); + } - slides.slideTo(index); - } - // On Slide change update segment to the matching value - async function onSlideDidChange(ev) { - var index = await slides.getActiveIndex(); - console.log("index: " + index); - clickSegment(index); - } - function clickSegment(index) { - segment.value = index; + intializeNotificationDetail() { + if (this.messageSuccess) { + document.getElementById("notificationDynamicFields").innerHTML = ""; } - - - } - - - intializeNotificationDetail() { - document.getElementById("notificationDynamicFields").innerHTML = ""; console.log("intializeNotificationDetail"); this.getPassNotificationDetails = this.common.sharedService.getSharedData( HomeComponent.NOTIFICATION_DATA, @@ -197,6 +190,10 @@ export class WorklistMainPRComponent implements OnInit { this.getPRNotificationDetails(this.WorkListBodyObj); } } + public segmentChanged(event: any) { + this.activeSegment = event.detail.value; + console.log(" event.detail.value: " + event.detail.value); + } getPRNotificationDetails(notificationBodyObj) { this.worklistMainService @@ -298,7 +295,20 @@ export class WorklistMainPRComponent implements OnInit { // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); if (result.GetNotificationButtonsList != null) { this.notificationButtonRes = result.GetNotificationButtonsList; - } // if result == null + this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore"); + console.log("test" + this.notificationButtonRes.length); + for (let i = 0; i < this.notificationButtonRes.length; i++) { + if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED") { + this.approveDis = true; + } else + if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED") { + this.rejectDis = true; + } else + if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { + this.requestDis = true; + } // if result == null + } // valid it + } } // valid it } // End handleWorkListButtonsResult @@ -313,14 +323,14 @@ export class WorklistMainPRComponent implements OnInit { handleApplayActionResult(result) { if (this.common.validResponse(result)) { if (result.MessageStatus == 1) { - // this.navCtrl.push("HomePage"); - //this.common.openHome(); - //this.common.openNotificationPage(); - // for( var i = 0; i < this.notificationArray.length; i++){ - // if ( this.notificationArray[i].ROW_NUM === this.getPassNotificationDetails.ROW_NUM) { - // this.notificationArray.splice(i, 1); - // } - // } + + // show succsfull popup + this.messageSuccess = true; + + setTimeout(() => { + this.messageSuccess = false; + }, 5000); + this.getNotificationCountAfterSubmit(); this.nextNotfification(); } @@ -348,8 +358,14 @@ export class WorklistMainPRComponent implements OnInit { } } - actionButton() { - let ButtonAction: string = this.actionType; + actionButton(action) { + + console.log("actionButton" + action); + alert("don't forget"); + //let ButtonAction: string = this.actionType; + let ButtonAction: string = action; + + var responseAttrDic = this.notExampleJsonObject; this.P_RESPOND_ATTRIBUTES_TBL = []; for (let i = 0; i < this.notificationDynamicAttributeArr.length; i++) { @@ -451,7 +467,8 @@ export class WorklistMainPRComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainPRComponent.PASS_RES_ATTR ); - this.common.openWorklistRFCPage(); + // this.common.openWorklistRFCPage(); + this.openRFCModal(); } else if (ButtonAction == "ANSWER_INFO") { // this.navCtrl.push("WorkListReplacmentRollPage", { // pQuestion: this.pQuestion, @@ -472,7 +489,8 @@ export class WorklistMainPRComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainPRComponent.PASS_RES_ATTR ); - this.common.openWorklistRollReplacement(); + // this.common.openWorklistRollReplacement(); + this.openRepRolModal(); } else if ( ButtonAction == "DELEGATE" || ButtonAction == "REQUEST_INFO" || @@ -498,7 +516,8 @@ export class WorklistMainPRComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainPRComponent.PASS_RES_ATTR ); - this.common.openWorklistRollReplacement(); + // this.common.openWorklistRollReplacement(); + this.openRepRolModal(); } else if ( ButtonAction == "UPDATE_ACTION" || ButtonAction == "CONTINUE_ACTION" @@ -703,6 +722,8 @@ export class WorklistMainPRComponent implements OnInit { } } } + this.turnCateFun(this.actionHistoryRes); + } } @@ -876,9 +897,136 @@ export class WorklistMainPRComponent implements OnInit { //infiniteScroll.target.complete(); } }//end infiniteScroll + //////////////////////////////////////////////////////// + + public checkLines(note) { + console.log(note.split("\n").length); + console.log(note.length); + + if (note && note != null) { -} + return (note.length > this.lines_note_limit) ? true : false; + } + + + + return false; + }; + + + public turnCateFun(actionHis) { + for (let i = 0; i < actionHis.length; i++) { + actionHis[i].visible = false; + + } + // actionHis.map((obj) => { + // obj.visible = false; + // // or via brackets + // // obj['total'] = 2; + // return obj; + // }) + this.actionHistoryRes = actionHis; + console.log("test"); + } + + + async openMoreActions() { + + + + + const modal = await this.modalCtrl.create({ + component: MoreActionModalComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'note-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + // this.selectedAction = data.data; + this.actionType = data.data.BUTTON_ACTION; + console.log(this.actionType); + this.actionButton(this.actionType); + ///call Action button + } + }); + + return await modal.present(); + + + + + } + async openRepRolModal() { + + + + + const modal = await this.modalCtrl.create({ + component: WorkListReplacementRollComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'replaceRoll-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + + } + }); + + return await modal.present(); + + + + + } + async openRFCModal() { + + + + + const modal = await this.modalCtrl.create({ + component: WorkListRfcComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'replaceRoll-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + + } + }); + + return await modal.present(); + + + + + } + +} \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.html b/Mohem/src/app/notification/worklist-main/worklist-main.component.html index c9965cd0..0d87349f 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.html +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.html @@ -1,136 +1,534 @@ - - - {{ts.trPK('worklistMain','title')}} - - - - + + + {{ts.trPK('worklistMain','title')}} + + + + - -
{{pInformation}}
- - - -
{{ts.trPK('worklistMain','info')}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
+ + + +
{{getPassNotificationDetails.SUBJECT}}
+ + + + + {{ts.trPK('worklistMain','title')}} + + + + {{'worklistMain, action' | translate}} + + + + {{'general, file' | translate}} + + + + {{ts.trPK('worklistMain','info')}} + + + + + + + +
{{pInformation}}
+ + +
+ + + + + +
+ + + + + +
+ +
+
+
+
+ +
+
+ + +
Employee will also on leave
+ + + + + +
+ + + + + +
+ + + + +
+
+
+ + + + +
+
+ + + +
+ +
+ + +
+ +
+
+
+ +
+ +
+ + + + + + + +
+ + + + +
+ + +
+ + + +
+ + +
+
+ + + + +
+ + +
+ + + +
+ + +
+
+ + + +
+ + +
+ + + +
+ + +
+
+ + + +
+ +
+
+
+ + + + +
+ + + + + + +
Employee Detail
+ +
+ + + +
+ +
+
+ + + +
+ +
+
+ + + +
+ +
+
+ + + +
+ +
+
+ + + +
+ +
+
+ + + +
+ +
+
+ + + +
+ +
+
+ + + +
+ +
+
+ + + +
+ +
+
+ + + +
+ + +
+
+ + + +
+ + +
+
+
+
+ +
+
+
+ + + + + +
+

{{ 'general, empty' | translate}}

+
+
+ +
+ + +
+
+ +
+
+ + + {{actionHistory.NAME}} + + +
+
+
+ Note: {{actionHistory.NOTE}} +
+
+ + +
+ +
+ Note: {{actionHistory.NOTE}} + + +
+ + +
+
+ {{actionHistory.ACTION}} + + + + {{actionHistory.NOTIFICATION_DATE| dateString }} +
+
+
+
+
+
+ + + +
+
+ +
+ + +
+

{{ 'general, notAttch' | translate}}

+
+
+ + + +
+ +
+
+
+
+ +
+
+ +
+ + {{attachList.SEQ_NUM }}. {{attachList.FILE_NAME}} + + + +
+ +
+ + +
+
+ + +
-
+
- -
- - {{'actionHis, action' | translate}} - - {{notificationButtons.BUTTON_LABEL}} - - - +
+ + + + +
+
+
+
- -
- {{ts.trPK('general','submit')}} -
-
- {{'worklistMain, skip' | translate}} -
-
\ No newline at end of file +
+ + +
+
Transaction Successful
+
+ + + + + + + + + + + + + + + + Approve + + + + + Reject + + + + + Request + + + + Skip + + + + + More + + + + + + + + \ No newline at end of file diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss index afa6f886..813ab8cb 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.scss +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.scss @@ -69,4 +69,202 @@ color: var(--secondary); border: 2px solid var(--gray); min-width: auto; - } \ No newline at end of file + } +//////////////////////// + .itemHISBtn{ + padding: 5px; + color: var(--light); + background: var(--darkgray); + border-radius: 3px; + width: 85%; + height: 40px; + } + + + .rowBtn{ + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + background: white; + } + + + + .rowBorder{ + border-bottom: solid 0.02cm var(--grayBG); + + + } + .colBorder{ + border-right: solid 0.02cm var(--grayBG); + + } + + .dateActionHistory{ + text-align: end; + // margin-top: -25px; + margin-top: -3px; + } + + + .actionBtn{ + --border-radius: 50% !important; + height: 55px; + width: 55px; + --background: var(--newgreen); // will be dynamic + background: transparent; + margin:10px; + } + + .itemAttch{ + border-radius: 11px; + margin: 8px; + --min-height: 60px; + --max-height: 60px; + } + + .less { + max-height: 54px; + } + + .noDataDiv{ + background: #ffffff; + height: 11%; + text-align: center; + padding-top: 1px; + border-radius: 10px; + margin: 10px; + } + + .container { + font-size: 14px; + line-height: 14px; + height: 15px; + overflow: hidden; + text-align: justify; + } + + .show { + overflow: visible; + height: auto; + } + + .showMore{ + padding: 0px; + background: transparent; + color: blue; + text-decoration: underline; + font-size: 14px; + } + + .succssfullMSG{ + height: 100%; + width: 100%; + background: var(--newgreen); + color: white; + font-weight: bold; + font-size: 20px; + text-align: center; + vertical-align: middle; + padding-top: 30px; + } + + .succssfullIcon{ + width: 60%; + text-align: center; + height: 60%; + } + //////////////////////////////// + .subOrdinateList{ + // margin: 10px; + // border-top-left-radius: 45px; + // border-bottom-left-radius: 45px; + // border: var(--cusgray) 1px solid !important; + --background: transparent; + margin-left: -15px; + margin-right: 6px; +} +.status{ + text-align: center; +background: green; +border-radius: 10px; +font-size: 12px; +height: 40px; +color: white; +} +.rowHeader{ + border-bottom: 1px solid var(--cusgray); + padding-bottom: 10px; + margin-bottom: -17px; +} + +.container{ + position:relative; +} +.overflow-hid-div{ + overflow:hidden; + margin-left:50px; + width:200px; + height: 200px; + background-color:red; + +} +.inner{ + width:50px; + height: 50px; + background-color:green; + position: absolute; + left:25px; + top:25px; + +} +.gridSubordinates{ + margin-left: 38px; + border-top-left-radius: 28px; + border-bottom-left-radius: 40px; + // padding-left: 8px; + background:var(--light); + border-top-right-radius: 16px; + border-bottom-right-radius: 16px; +} + +.subOrdinateDiv{ + z-index: 4; + margin-left: -32px; + position: absolute; + top: -2px; +} +.subOrdinateImg{ + width: 85px; + border: #e4e4e4 solid 2px; + -moz-border-radius: 50%; + border-radius: 50%; + border: 3px solid #f0efef; +} + +.subOrdinateRow{ + margin-left: 55px; +} + +.label{ +font-size: 14px; +} + +.subjectNotification{ + text-align: center; + padding-top: 10px; + font-weight: bold; +} + +.submitterInfo{ + padding-top: 10px; + padding-bottom: 10px; +} +ion-card{ + color: black !important; +} +//// +.tabBar{ + height:70px +} diff --git a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts index 983ffb57..938e09aa 100644 --- a/Mohem/src/app/notification/worklist-main/worklist-main.component.ts +++ b/Mohem/src/app/notification/worklist-main/worklist-main.component.ts @@ -15,10 +15,29 @@ import { HomeComponent } from "src/app/notification/home/home.component"; import { TextInput } from 'src/app/uI-elements/text.input'; import { TextAreaInput } from 'src/app/uI-elements/text-area.input'; import { MenuService } from 'src/app/hmg-common/services/menu/menuservice.service'; -import { Events } from '@ionic/angular'; +import { Events, ModalController } from '@ionic/angular'; import { PONotificatonBodyResponse } from '../models/PONotificationBodyRes'; import { MONotificatonBodyResponse } from '../models/MONotificationBodyRes'; import { PRNotificatonBodyResponse } from '../models/PRNotificationBodyRes'; +import { NotificationGetAttachResponse } from 'src/app/eit/models/NotificationGetAttachRes'; +import { WorklistAttachService } from 'src/app/absence/service/work-list-attach.service'; +import { WorkListActionHistoryRequest } from '../models/ActionHistoryReq'; +import { WorkListActionHistoryResponse } from '../models/ActionHistoryRes'; +import { WorklistService } from '../service/worklist.service'; +import { MoreActionModalComponent } from '../more-action-modal/more-action-modal.component'; +import { WorkListAttachViewComponent } from '../work-list-attach-view/work-list-attach-view.component'; +import { GetSubordinatesLeavesRequest } from '../../hmg-common/services/dashbored/models/GetSubordinatesLeavesRequest'; +import { DashboredService } from '../../hmg-common/services/dashbored/dashbored.service' +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; +import { AuthenticatedUser } from 'src/app/hmg-common/services/authentication/models/authenticated-user'; +import { WorklistsubmitterInfoResponse } from '../models/WorklistsubmitterInfoRes'; +import { WorkListSubmitterInfoRequest } from '../models/WorklistsubmitterInfoReq'; +import { WorkListReplacementRollComponent } from '../work-list-replacement-roll/work-list-replacement-roll.component'; +import { WorkListRfcComponent } from '../work-list-rfc/work-list-rfc.component'; +import { ApplyActionModalComponent } from '../apply-action-modal/apply-action-modal.component'; + + + @Component({ selector: "app-worklist-main", templateUrl: "./worklist-main.component.html", @@ -51,29 +70,85 @@ export class WorklistMainComponent implements OnInit { selEmployeeID: any; actionType: string = ""; notificationArray: any; - notificationDynamicAttributeArr:any; + notificationDynamicAttributeArr: any; private textInput: TextInput; private textArea: TextAreaInput; + private WorkListAttachObj: WorkListButtonRequest; + P_PAGE_NUM: number = 1; + P_PAGE_LIMIT: number = 100; notificationCount: any; + activeSegment: any = "info"; + lines_note_limit: any = 24; + attachmentRes: any; + private WorkListActionHistoryObj: WorkListActionHistoryRequest; + IsReachEnd: boolean = false; + notiActionBtnMore: any = []; + messageSuccess: boolean = false; + confirmMsg: string; + newArr: any = []; + selEmp: any; + subordinatesleaveList: any; + private WorkListSubmitterInfoObj: WorkListSubmitterInfoRequest; + submitterInfoRes: any; + approveDis: boolean = false; + rejectDis: boolean = false; + requestDis: boolean = false; + moreDisabled: boolean = true; + constructor( + public worklistService: WorklistService, public common: CommonService, public ts: TranslatorService, public worklistMainService: WorklistMainService, public elementRef: ElementRef, public menuService: MenuService, public events: Events, - ) { } + public worklistAttachService: WorklistAttachService, + private modalCtrl: ModalController, + public dashboredService: DashboredService, + public authService: AuthenticationService + + + ) { + this.WorkListActionHistoryObj = new WorkListActionHistoryRequest(); + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + } ngOnInit() { + + this.selEmp = this.common.sharedService.getSharedData( + MenuResponse.SHARED_SEL_EMP, + false + ); + if (this.selEmp) { } else { + this.authService.loadAuthenticatedUser().subscribe((user: AuthenticatedUser) => { + if (user) { + this.selEmp = user.ASSIGNMENT_NUMBER; + + } + }); + } + + console.log(" this.selEmp" + this.selEmp); this.intializeNotificationDetail(); + + + } + public segmentChanged(event: any) { + this.activeSegment = event.detail.value; + console.log(" event.detail.value: " + event.detail.value); } intializeNotificationDetail() { - document.getElementById("notificationDynamicFields").innerHTML=""; + if (this.messageSuccess) { + document.getElementById("notificationDynamicFields").innerHTML = ""; + } this.getPassNotificationDetails = this.common.sharedService.getSharedData( HomeComponent.NOTIFICATION_DATA, false ); + console.log(this.getPassNotificationDetails.ROW_NUM); this.notificationArray = this.common.sharedService.getSharedData( HomeComponent.NOTIFICATION_ARR, @@ -81,6 +156,8 @@ export class WorklistMainComponent implements OnInit { ); this.WorkListBodyObj = new WorkListBodyRequest(); this.WorkListButtonsObj = new WorkListButtonRequest(); + this.WorkListAttachObj = new WorkListButtonRequest(); + this.WorkListSubmitterInfoObj = new WorkListSubmitterInfoRequest(); this.WorkListActionObj = new WorkListActionRequest(); @@ -96,45 +173,65 @@ export class WorklistMainComponent implements OnInit { this.WorkListActionObj.P_ACTION_MODE = ""; this.WorkListActionObj.P_COMMENTS = ""; this.WorkListActionObj.P_APPROVER_INDEX = null; + + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + this.WorkListActionHistoryObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + this.WorkListActionHistoryObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; + this.WorkListAttachObj.P_NOTIFICATION_ID = this.getPassNotificationDetails.NOTIFICATION_ID; + + + this.WorkListSubmitterInfoObj.P_PAGE_LIMIT = this.P_PAGE_LIMIT; + this.WorkListSubmitterInfoObj.P_PAGE_NUM = 1; + this.WorkListSubmitterInfoObj.P_SELECTED_EMPLOYEE_NUMBER = this.getPassNotificationDetails.SELECTED_EMPLOYEE_NUMBER; + this.WorkListSubmitterInfoObj.P_SELECTED_RESP_ID = -999; + this.WorkListSubmitterInfoObj.P_SEARCH_EMAIL_ADDRESS = ""; + this.WorkListSubmitterInfoObj.P_SEARCH_EMPLOYEE_DISPLAY_NAME = ""; + this.WorkListSubmitterInfoObj.P_SEARCH_USER_NAME = ""; + + this.getsubmitterInfo(this.WorkListSubmitterInfoObj); + + this.getNotificationButtons(this.WorkListButtonsObj); this.getNotificationResAttr(this.WorkListButtonsObj); + this.getAttachmentNotification(this.WorkListAttachObj); + this.getActionHistory(this.WorkListActionHistoryObj); if (this.getPassNotificationDetails.REQUEST_TYPE == "EIT") { this.getEITNotificationDetails(this.WorkListBodyObj); } else if (this.getPassNotificationDetails.REQUEST_TYPE == "ABSENCE") { this.getAbsenceNotificationDetails(this.WorkListBodyObj); - } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PO"){ - this.getPONotificationDetails(this.WorkListBodyObj); - } else if (this.getPassNotificationDetails.REQUEST_TYPE == "MO"){ + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PO") { + this.getPONotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "MO") { this.getMONotificationDetails(this.WorkListBodyObj); - } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR"){ - this.getPRNotificationDetails(this.WorkListBodyObj); + } else if (this.getPassNotificationDetails.REQUEST_TYPE == "PR") { + this.getPRNotificationDetails(this.WorkListBodyObj); } } - getPRNotificationDetails(notificationBodyObj){ + getPRNotificationDetails(notificationBodyObj) { this.worklistMainService - .getPRNotificationBody(notificationBodyObj) - .subscribe((result: PRNotificatonBodyResponse) => { - this.handleWorkListBodyResult(result, "PR"); - }); + .getPRNotificationBody(notificationBodyObj) + .subscribe((result: PRNotificatonBodyResponse) => { + this.handleWorkListBodyResult(result, "PR"); + }); } - - getMONotificationDetails(notificationBodyObj){ - this.worklistMainService + + getMONotificationDetails(notificationBodyObj) { + this.worklistMainService .getMONotificationBody(notificationBodyObj) .subscribe((result: MONotificatonBodyResponse) => { //this.handleWorkListBodyResult(result, "MO"); }); - } - - getPONotificationDetails(notificationBodyObj){ + } + + getPONotificationDetails(notificationBodyObj) { this.worklistMainService - .getPONotificationBody(notificationBodyObj) - .subscribe((result: PONotificatonBodyResponse) => { - // console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); - // this.handleWorkListBodyResult(result, "PO"); - }); + .getPONotificationBody(notificationBodyObj) + .subscribe((result: PONotificatonBodyResponse) => { + // console.log(result.GetPoNotificationBodyList.POHeader[0].BUYER); + // this.handleWorkListBodyResult(result, "PO"); + }); } getEITNotificationDetails(notificationBodyObj) { @@ -167,8 +264,17 @@ export class WorklistMainComponent implements OnInit { if (result.GetAbsenceCollectionNotificationBodyList) { this.notificationBodyRes = result.GetAbsenceCollectionNotificationBodyList; + + // getDimensions(this.notificationBodyRes) { + let obj = (this.notificationBodyRes[0].Collection_Notification).filter(function (list) { + return list.SEGMENT_NAME === "END_DATE" || list.SEGMENT_NAME === "START_DATE"; + }); + + // return obj; + // } + this.getSubordinatesleave(obj) } - }else if (Type == "PR") { + } else if (Type == "PR") { if (result.GetAbsenceCollectionNotificationBodyList) { this.notificationBodyRes = result.GetAbsenceCollectionNotificationBodyList; @@ -178,7 +284,7 @@ export class WorklistMainComponent implements OnInit { } //End handleWorkListBodyResult - + getNotificationButtons(notificationButtonsObj) { this.worklistMainService .getNotificationButtons(notificationButtonsObj) @@ -192,8 +298,27 @@ export class WorklistMainComponent implements OnInit { // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); if (result.GetNotificationButtonsList != null) { this.notificationButtonRes = result.GetNotificationButtonsList; - } // if result == null - } // valid it + this.common.sharedService.setSharedData(this.notificationButtonRes, "passActionMore"); + console.log("test" + this.notificationButtonRes.length); + for (let i = 0; i < this.notificationButtonRes.length; i++) { + if (this.notificationButtonRes[i].BUTTON_ACTION == "APPROVED") { + this.approveDis = true; + } else + if (this.notificationButtonRes[i].BUTTON_ACTION == "REJECTED") { + this.rejectDis = true; + } else + if (this.notificationButtonRes[i].BUTTON_ACTION == "REQUEST_INFO") { + this.requestDis = true; + } // if result == null + else ( + this.notificationButtonRes[i].BUTTON_ACTION != "APPROVED" && this.notificationButtonRes[i].BUTTON_ACTION != "REJECTED" && this.notificationButtonRes[i].BUTTON_ACTION != "REQUEST_INFO") + { + this.moreDisabled = false; + + } + } // valid it + } + } } // End handleWorkListButtonsResult applyAction(WorkListActionObj) { @@ -215,6 +340,13 @@ export class WorklistMainComponent implements OnInit { // this.notificationArray.splice(i, 1); // } // } + + this.messageSuccess = true; + + setTimeout(() => { + this.messageSuccess = false; + }, 5000); + this.getNotificationCountAfterSubmit(); this.nextNotfification(); } @@ -242,11 +374,12 @@ export class WorklistMainComponent implements OnInit { } } - actionButton() { - let ButtonAction: string = this.actionType; + actionButton(action) { + //let ButtonAction: string = this.actionType; + let ButtonAction: string = action; var responseAttrDic = this.notExampleJsonObject; this.P_RESPOND_ATTRIBUTES_TBL = []; - for (let i=0;i { + this.applyAction(this.WorkListActionObj); + }, this.ts.trPK('general', 'ok'), + () => { }, this.ts.trPK('general', 'cancel'), + this.ts.trPK('vacation-rule', 'confirmation'), + this.confirmMsg) + + // this.openApplyModal(this.WorkListActionObj); + + } + + + if (ButtonAction == "RFC") { // alert("Return For Correction"); this.WorkListActionObj.P_ACTION_MODE = ButtonAction; - // this.navCtrl.push("WorkListRfcPage", { - // passNotificationInfo: this.getPassNotificationDetails, - // passActionMode: ButtonAction, - // passResAttr: this.P_RESPOND_ATTRIBUTES_TBL - // }); + this.common.sharedService.setSharedData( this.getPassNotificationDetails, WorklistMainComponent.PASS_NOTIFICATION_INFO @@ -301,7 +476,8 @@ export class WorklistMainComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainComponent.PASS_RES_ATTR ); - this.common.openWorklistRFCPage(); + //this.common.openWorklistRFCPage(); + this.openRFCModal(); } else if (ButtonAction == "ANSWER_INFO") { // this.navCtrl.push("WorkListReplacmentRollPage", { // pQuestion: this.pQuestion, @@ -322,7 +498,8 @@ export class WorklistMainComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainComponent.PASS_RES_ATTR ); - this.common.openWorklistRollReplacement(); + //this.common.openWorklistRollReplacement(); + this.openRepRolModal(); } else if ( ButtonAction == "DELEGATE" || ButtonAction == "REQUEST_INFO" || @@ -348,7 +525,8 @@ export class WorklistMainComponent implements OnInit { this.P_RESPOND_ATTRIBUTES_TBL, WorklistMainComponent.PASS_RES_ATTR ); - this.common.openWorklistRollReplacement(); + // this.common.openWorklistRollReplacement(); + this.openRepRolModal(); } else if ( ButtonAction == "UPDATE_ACTION" || ButtonAction == "CONTINUE_ACTION" @@ -440,22 +618,26 @@ export class WorklistMainComponent implements OnInit { this.hideForwordEmployee = result.NotificationRespondRolesList[0]; } this.notificationDynamicFields(result.NotificationGetRespondAttributesList); - this.notificationDynamicAttributeArr=result.NotificationGetRespondAttributesList; + this.notificationDynamicAttributeArr = result.NotificationGetRespondAttributesList; + this.common.sharedService.setSharedData( + this.notificationDynamicAttributeArr, + "notificationDynamicAttributeArr" + ); if (result.P_Schema) this.schemaNotific = JSON.parse(result.P_Schema); } // valid it } // End handleWorkListButtonsResult - notificationDynamicFields(notificationAttr){ + notificationDynamicFields(notificationAttr) { const containerId = 'notificationDynamicFields'; - for(let i=0;i { + this.handleWorkListAttachResult(result); + }); + } + + handleWorkListAttachResult(result) { + if (this.common.validResponse(result)) { + // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); + if (result.GetAttachementList != null) { + this.attachmentRes = result.GetAttachementList; + } // if result == null + } // valid it + } + + getActionHistory(WorkListActionHistoryObj) { + this.IsReachEnd = false; + this.worklistService.getActionHistory(WorkListActionHistoryObj). + subscribe((result: WorkListActionHistoryResponse) => { + this.handleWorkListActionHistoryResult(result); + }); + + + } + handleWorkListActionHistoryResult(result) { + console.log( "1"+ this.IsReachEnd); + if (this.common.validResponse(result)) { + if (this.common.hasData(result.GetActionHistoryList)) { + this.actionHistoryRes = result.GetActionHistoryList; + this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + let lastItemIndex = this.actionHistoryRes.length - 1; + if (result.GetActionHistoryList[lastItemIndex]) { + let lastitem = result.GetActionHistoryList[lastItemIndex]; + if (lastitem.NO_OF_ROWS == lastitem.ROW_NUM) { + this.IsReachEnd = true; + console.log( "2"+ this.IsReachEnd); + + } else { + this.IsReachEnd = false; + console.log( "3"+ this.IsReachEnd); + + } + } + this.turnCateFun(this.actionHistoryRes); + + } + } + } + + public checkLines(note) { + + + if (note && note != null) { + + + return (note.length > this.lines_note_limit) ? true : false; + + + } + + + + return false; + }; + + + public turnCateFun(actionHis) { + for (let i = 0; i < actionHis.length; i++) { + actionHis[i].visible = false; + + } + + this.actionHistoryRes = actionHis; + console.log("test"); + } + + async openMoreActions() { + + + + + const modal = await this.modalCtrl.create({ + component: MoreActionModalComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'note-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + // this.selectedAction = data.data; + this.actionType = data.data.BUTTON_ACTION; + console.log(this.actionType); + ///call Action button + this.actionButton(this.actionType); + } + }); + + return await modal.present(); + + + + + } + async OpenAttachFiles(value, Type) { + + + this.common.sharedService.setSharedData({ displayData: value, TypeData: Type }, 'WorkListAttachViewPage') + const modal = await this.modalCtrl.create({ + component: WorkListAttachViewComponent + }); + + return await modal.present(); + } + + + ///calling getSubleave + + getSubordinatesleave(list) { + + console.log(list); + let to; + let from; + for (let i = 0; i < list.length; i++) { + if (list[i].SEGMENT_NAME == "END_DATE") + to = list[i].DATE_VALUE; + + else if (list[i].SEGMENT_NAME == "START_DATE") { + from = list[i].DATE_VALUE; + } + } + console.log(new Date(to)); + console.log(new Date(from)); + + + + + const request = new GetSubordinatesLeavesRequest(); + request.P_DATE_FROM = "/Date(" + Date.parse(from) + ")/";//new Date(from); + request.P_DATE_TO = "/Date(" + Date.parse(to) + ")/" //new Date(to); + request.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; + // ="'/Date(" + Date.parse(from) + ")'" + + + this.dashboredService.getSubordinatesLeaves(request). + subscribe((result: any) => { + + this.handleSubordinatesLeavesResult(result); + }); + } + public handleSubordinatesLeavesResult(result) { + if (this.common.validResponse(result)) { + // GetSubordinatesLeavesList it used in dashbored + // if (this.common.hasData(result.GetSubordinatesLeavesList)) { + if (this.common.hasData(result.SubordinatesOnLeavesList)) { + + this.subordinatesleaveList = result.SubordinatesOnLeavesList; + + } + } + } + + getsubmitterInfo(notificationSubmitterInfoObj) { + this.worklistMainService.getSubmitterInfo(notificationSubmitterInfoObj). + subscribe((result: WorklistsubmitterInfoResponse) => { + this.handleSubmitterInfoResult(result); + }); + } + handleSubmitterInfoResult(result) { + if (this.common.validResponse(result)) { + // this.sharedData.setSharedData(result, WorKListResponse.SHARED_DATA); + if (this.common.hasData(result.MemberInformationList)) { + //if (result.MemberInformationList != null) { + this.submitterInfoRes = result.MemberInformationList; + } // if result == null + } // valid it + }// End handleWorkListButtonsResult + + async openRepRolModal() { + + const modal = await this.modalCtrl.create({ + component: WorkListReplacementRollComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'replaceRoll-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + + } + }); + + return await modal.present(); + + + + + } + + async openRFCModal() { + + + + + const modal = await this.modalCtrl.create({ + component: WorkListRfcComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'replaceRoll-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data.data); + + if (data.data == "cancel" || data.data == undefined) { + return; + } else { + + + } + }); + + return await modal.present(); + + + + + } + + + async openApplyModal(WorkListActionObj) { + + this.common.sharedService.setSharedData(this.getPassNotificationDetails, WorklistMainComponent.PASS_NOTIFICATION_INFO); + this.common.sharedService.setSharedData(WorkListActionObj, 'ApplyActionModalPage') + // this.common.sharedService.setSharedData( + // this.WorkListActionObj, + // WorklistMainPRComponent.PASS_NOTIFICATION_INFO + // ); + + const modal = await this.modalCtrl.create({ + component: ApplyActionModalComponent, + backdropDismiss: false, + + }); + modal.cssClass = 'note-modal'; + + modal.onDidDismiss() + .then((data) => { + console.log(data); // Here's your selected user! + }); + + + return await modal.present(); + + } + + + + loadMoreActionHistory() { + console.log("doInfinite action history MR"); + + if (!this.IsReachEnd) { + this.worklistService.getActionHistory(this.WorkListActionHistoryObj). + subscribe((result: any) => { + if (this.common.validResponse(result)) { + if (result.GetActionHistoryList != undefined) { + this.P_PAGE_NUM++; + this.WorkListActionHistoryObj.P_PAGE_NUM = this.P_PAGE_NUM; + + (result.GetActionHistoryList).forEach(element => { + if (element.ROW_NUM == element.NO_OF_ROWS) { + this.IsReachEnd = true; + } else { + this.IsReachEnd = false; + } + this.actionHistoryRes.push(element); + }, (Error) => console.log(Error), () => + //infiniteScroll.target.complete() + console.log("TEST")); + }// if list length >0 + else { + this.IsReachEnd = true; + } + }// if response == 1 + //this.pageNum++; + // infiniteScroll.target.complete(); + + }); + } else { + //if (infiniteScroll) + //infiniteScroll.target.complete(); + } + }//end infiniteScroll + } diff --git a/Mohem/src/app/payslip/home/home.component.html b/Mohem/src/app/payslip/home/home.component.html index 8a72c56a..142a36a5 100644 --- a/Mohem/src/app/payslip/home/home.component.html +++ b/Mohem/src/app/payslip/home/home.component.html @@ -1,7 +1,6 @@ - + + + + + {{ts.trPK('payslip','monthly-payslip')}} + + +
- +
diff --git a/Mohem/src/app/payslip/home/home.component.scss b/Mohem/src/app/payslip/home/home.component.scss index 7dde3934..11086df0 100644 --- a/Mohem/src/app/payslip/home/home.component.scss +++ b/Mohem/src/app/payslip/home/home.component.scss @@ -58,19 +58,20 @@ color: var(--red); } - +.header-toolbar-new{ + --background: #22c6b3; +} .colorBG{ --background: #f0efef; } .header-div { - - background-color: #22C6B3; - text-transform: capitalize; - height: 180px; - position: relative; - display: block; - margin-bottom: -28px; + background-color: #22C6B3; + text-transform: capitalize; + height: 119px; + position: relative; + display: block; + margin-bottom: -28px; } .Title{ text-align: center; @@ -142,8 +143,8 @@ border-radius: 20px !important; padding-top: 13px; padding-bottom: 14px; - margin-left: 30px; - margin-right: 32px; + margin-left: 26px; + margin-right: 28px; margin-top: -2px; margin-bottom: 10px; padding-right: 21px; @@ -214,7 +215,7 @@ margin-top: -13px; .header{ - margin-top: -126px; + margin-top: -119px; } .bgcolor { diff --git a/Mohem/src/app/pipes/json-date/json-date.ts b/Mohem/src/app/pipes/json-date/json-date.ts new file mode 100644 index 00000000..9be7121a --- /dev/null +++ b/Mohem/src/app/pipes/json-date/json-date.ts @@ -0,0 +1,21 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +/** + * Generated class for the JsonDatePipe pipe. + * + * See https://angular.io/api/core/Pipe for more info on Angular Pipes. + */ +@Pipe({ + name: 'jsonDate', +}) +export class JsonDatePipe implements PipeTransform { + /** + * Takes a value and makes it lowercase. + */ + transform(value: string): any { + if(value) + return new Date(parseInt(value.substr(6))); + else + return value; + } +} diff --git a/Mohem/src/app/pipes/pipes.module.ts b/Mohem/src/app/pipes/pipes.module.ts index de2e17a1..c754645c 100644 --- a/Mohem/src/app/pipes/pipes.module.ts +++ b/Mohem/src/app/pipes/pipes.module.ts @@ -1,11 +1,13 @@ import { NgModule } from '@angular/core'; import { DateStringPipe } from './date-string/date-string'; import { FilterLangPipe } from './filter-lang/filter-lang'; +import { TurncatePipe } from './turncate/turncate.pipe'; @NgModule({ declarations: [DateStringPipe, - FilterLangPipe], + FilterLangPipe, + TurncatePipe], imports: [], exports: [DateStringPipe, - FilterLangPipe] + FilterLangPipe,TurncatePipe] }) export class PipesModule {} diff --git a/Mohem/src/app/pipes/turncate/turncate.pipe.spec.ts b/Mohem/src/app/pipes/turncate/turncate.pipe.spec.ts new file mode 100644 index 00000000..5275fc6d --- /dev/null +++ b/Mohem/src/app/pipes/turncate/turncate.pipe.spec.ts @@ -0,0 +1,8 @@ +import { TurncatePipe } from './turncate.pipe'; + +describe('TurncatePipe', () => { + it('create an instance', () => { + const pipe = new TurncatePipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/pipes/turncate/turncate.pipe.ts b/Mohem/src/app/pipes/turncate/turncate.pipe.ts new file mode 100644 index 00000000..992d3782 --- /dev/null +++ b/Mohem/src/app/pipes/turncate/turncate.pipe.ts @@ -0,0 +1,27 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'turncate' +}) +export class TurncatePipe implements PipeTransform { + + transform(value: any, args?: any): any { + console.log("args" + args); + + let limit = args.length > 0 ? parseInt(args[0], 10) : 10; + let trail = args.length > 1 ? args[1] : '...'; + + console.log("limit" + limit); + + console.log("parseInt(args[0], 10)" + parseInt(args[0], 10)); + console.log("trail" + trail); + console.log("limit" + limit); + console.log("parseInt(args[0], 10)" + parseInt(args[0], 10)); + + return value.length > limit ? value.substring(0, limit) + trail : value; } + + + + + +} diff --git a/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.html b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.html index 6bb094f2..3d11570b 100644 --- a/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.html +++ b/Mohem/src/app/profile/performance-evaluation/performance-evaluation.component.html @@ -5,7 +5,7 @@

{{ts.trPK('userProfile','performance')}}

-
+
diff --git a/Mohem/src/app/time-card/home/home.component.html b/Mohem/src/app/time-card/home/home.component.html index afc16a36..f853e899 100644 --- a/Mohem/src/app/time-card/home/home.component.html +++ b/Mohem/src/app/time-card/home/home.component.html @@ -1,3 +1,34 @@ -

- home works! -

+ + + + + + Time and Attendance + + + + +
+ + + + + + + + +

{{timeCard.heading}}

+ {{timeCard.description}} +
+ + + +
+
+
+
+
+
diff --git a/Mohem/src/app/time-card/home/home.component.scss b/Mohem/src/app/time-card/home/home.component.scss index e69de29b..1477aa51 100644 --- a/Mohem/src/app/time-card/home/home.component.scss +++ b/Mohem/src/app/time-card/home/home.component.scss @@ -0,0 +1,59 @@ +ion-header{ + overflow: hidden; +} +ion-content{ + --ion-background-color: #f2f2f3; +} + +ion-card-content { + padding: 0px; +} + +ion-card { + box-shadow: none !important; + background-color: white; + margin-bottom: 15px; +} +ion-header { + background: #f2f2f3; +} +ion-title{ + text-align: center; + font-family: WorkSans-Bold; + font-size: 18px; +} +.time-card-home-container{ + margin-right: 10px; + margin-left: 10px; + margin-top: 20px +} +.header-toolbar-new{ + --background: linear-gradient(90deg, rgba(132,198,143,1) 0%, rgba(41,183,197,1) 100%); + border-bottom-right-radius: 30px; + border-bottom-left-radius: 30px; +} + +.time-card-image{ + padding: 10px; +} +.time-card-details{ + padding: 0px; + margin-top: 25px; + line-height: 10px; +} + +.time-card-heading{ + font-weight: bold; + font-size: 13px; + color: #666666; + font-family: WorkSans-Bold; +} + +.time-card-description{ + font-size: 10px; +} + +.time-card-rightIcon{ + padding: 8px; + margin-top: 18px; +} diff --git a/Mohem/src/app/time-card/home/home.component.ts b/Mohem/src/app/time-card/home/home.component.ts index a7aad8ad..a33764ae 100644 --- a/Mohem/src/app/time-card/home/home.component.ts +++ b/Mohem/src/app/time-card/home/home.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; @Component({ selector: 'app-home', @@ -7,8 +8,38 @@ import { Component, OnInit } from '@angular/core'; }) export class HomeComponent implements OnInit { - constructor() { } + public timeCardOptions: any = [ + { + imageName: 'MyTimeCard.png', + heading: 'My Time Card', + description: 'View your attendance records.', + pageLink: '/time-card/time-card-details' + }, + { + imageName: 'Timeback.png', + heading: 'Time Back', + description: 'View and use your extra work time.', + pageLink: '/time-card/home' + }, + { + imageName: 'MissingSwipe.png', + heading: 'Missing Swipe', + description: 'Resolve swipe and attendance records', + pageLink: '/time-card/home' + }, + { + imageName: 'WorkOnBreak.png', + heading: 'Work on Break', + description: 'Record your work time in during break.', + pageLink: '/time-card/home' + } + ]; + + constructor(public common: CommonService) {} ngOnInit() {} + public openDetailPage(path) { + this.common.navigatePage(path); + } } diff --git a/Mohem/src/app/time-card/select-period/select-period.component.html b/Mohem/src/app/time-card/select-period/select-period.component.html new file mode 100644 index 00000000..0bc9515f --- /dev/null +++ b/Mohem/src/app/time-card/select-period/select-period.component.html @@ -0,0 +1,61 @@ + + +
+ + + +
+ Date From + +
+
+ + +
+ Date To + +
+
+
+
+ +
+ + {{filter.name}} + +
+ + + + + Shift type + + + {{shift.SHT_TYPE_DESC}} + + + + + + Search +
diff --git a/Mohem/src/app/time-card/select-period/select-period.component.scss b/Mohem/src/app/time-card/select-period/select-period.component.scss new file mode 100644 index 00000000..038155ad --- /dev/null +++ b/Mohem/src/app/time-card/select-period/select-period.component.scss @@ -0,0 +1,30 @@ +.footer-modal-button{ + position: absolute; + bottom: 0; + color: white; + width: 100%; + text-align: center; + } + .footer-modal-button button{ + font-size: 20px; + background: white; + line-height: 2; + } + .filters-container{ + display: inline-block; + text-align: center; + margin-top: 10px; + } + .filter-tag-button{ + display: inline-block; + border-radius: 5px; + border: 2px solid #A3D077; + color: #606161; + text-align: center; + font-size: 18px; + padding: 5px; + margin: 5px; + } + .filters-container .selected { + background-color: #d4f0e4; + } \ No newline at end of file diff --git a/Mohem/src/app/time-card/select-period/select-period.component.spec.ts b/Mohem/src/app/time-card/select-period/select-period.component.spec.ts new file mode 100644 index 00000000..bde45178 --- /dev/null +++ b/Mohem/src/app/time-card/select-period/select-period.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SelectPeriodComponent } from './select-period.component'; + +describe('SelectPeriodComponent', () => { + let component: SelectPeriodComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SelectPeriodComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SelectPeriodComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/time-card/select-period/select-period.component.ts b/Mohem/src/app/time-card/select-period/select-period.component.ts new file mode 100644 index 00000000..5ecc7a18 --- /dev/null +++ b/Mohem/src/app/time-card/select-period/select-period.component.ts @@ -0,0 +1,128 @@ +import { Component, OnInit } from '@angular/core'; +import { ModalController, NavParams } from '@ionic/angular'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { TimeCardService } from 'src/app/time-card/service/time-card.service'; + +@Component({ + selector: 'app-select-period', + templateUrl: './select-period.component.html', + styleUrls: ['./select-period.component.scss'], +}) +export class SelectPeriodComponent implements OnInit { + public shiftTypesArray: any = []; + public dateFrom: any; + public dateTo: any; + public selectedShiftType: any; + + public filtersArray: any = [ + { + name: 'Excess', + active: false, + key: 'P_EXCESS_FLAG', + value: '' + }, + { + name: 'Timeback', + active: false, + key: 'P_TIMEBACK_FLAG', + value: '' + }, + { + name: 'Comp Off', + active: false, + key: 'P_COMP_OFF_FLAG', + value: '' + }, + { + name: 'Non scheduled', + active: false, + key: 'P_NON_SCHEDULED_FLAG', + value: '' + }, + { + name: 'Late In', + active: false, + key: 'P_LATE_IN_FLAG', + value: '' + }, + { + name: 'Early Out', + active: false, + key: 'P_EARLY_OUT_FLAG', + value: '' + }, + { + name: 'Shortage', + active: false, + key: 'P_SHORTAGE_FLAG', + value: '' + }, + { + name: 'Missing Swipe', + active: false, + key: 'P_MISSING_SWIPE_FLAG', + value: '' + }, + { + name: 'Work On Break', + active: false, + key: 'P_ACTUAL_WOB_SEC', + value: '' + }, + { + name: 'Analyzed', + active: false, + key: 'P_ANALAYZED_FLAG', + value: '' + }, + { + name: 'Approved Timeback', + active: false, + key: 'P_APPR_TIMEBACK_FLAG', + value: '' + }, + ]; + constructor( + public modalController: ModalController, + public common: CommonService, + public timeCardService: TimeCardService, + public navParams: NavParams) { } + + ngOnInit() { + this.getShiftTypes(); + this.dateFrom = this.navParams.get('dateFrom'); + this.dateTo = this.navParams.get('dateTo'); + } + + public dismissModal() { + const selectedFilters: any = {}; + for (const filter of this.filtersArray) { + selectedFilters[filter.key] = filter; + } + this.modalController.dismiss({ + dismissed: true, + keySelectedFilters: selectedFilters, + selectedShiftType: this.selectedShiftType, + dateFrom: this.dateFrom, + dateTo: this.dateTo + }); + } + + public changeFiltersSelection(i: any) { + this.filtersArray[i].active = !this.filtersArray[i].active; + if (this.filtersArray[i].active) { + this.filtersArray[i].value = 'Y'; + } else { + this.filtersArray[i].value = ''; + } + } + + public getShiftTypes() { + this.timeCardService.getShiftType().subscribe((result) => { + if (this.common.validResponse(result)) { + this.shiftTypesArray = result.GetShiftTypesList; + } + }); + } + +} diff --git a/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts b/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts index 987dc09c..2bca5468 100644 --- a/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts +++ b/Mohem/src/app/time-card/service/models/get-day-hours-type-details.request.ts @@ -5,8 +5,8 @@ export class GetDayAndHoursDetailsRequest extends Request { public P_SELECTED_EMPLOYEE_NUMBER: string; public P_MENU_TYPE: string; public P_SELECTED_RESP_ID: number; - public P_SCHEDULE_DATE_FROM: DateTimeInput; - public P_SCHEDULE_DATE_TO: DateTimeInput; + public P_SCHEDULE_DATE_FROM: string; + public P_SCHEDULE_DATE_TO: string; public P_EXCESS_FLAG: string; public P_TIMEBACK_FLAG: string; public P_COMP_OFF_FLAG: string; @@ -21,4 +21,6 @@ export class GetDayAndHoursDetailsRequest extends Request { public P_ACTUAL_WOB_SEC: string; public P_PAGE_NUM: number; public P_PAGE_LIMIT: number; + public SearchMonth: string; + public SearchYear: number; } diff --git a/Mohem/src/app/time-card/service/models/get-swipes-request.ts b/Mohem/src/app/time-card/service/models/get-swipes-request.ts index 006f16e3..b0afbf15 100644 --- a/Mohem/src/app/time-card/service/models/get-swipes-request.ts +++ b/Mohem/src/app/time-card/service/models/get-swipes-request.ts @@ -3,7 +3,7 @@ import { DateTimeInput } from "src/app/uI-elements/date-time.input"; export class GetSwipesRequest extends Request { public P_SELECTED_EMPLOYEE_NUMBER: string; - public P_SCHEDULE_DATE: DateTimeInput; + public P_SCHEDULE_DATE: string; public P_PAGE_NUM: number; public P_PAGE_LIMIT: number; } diff --git a/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts b/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts index 7e5036f0..05aed6fa 100644 --- a/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts +++ b/Mohem/src/app/time-card/service/models/get-time-card-summary.request.ts @@ -5,8 +5,8 @@ export class GetTimeCardSummaryRequest extends Request { public P_SELECTED_EMPLOYEE_NUMBER: string; public P_MENU_TYPE: string; public P_SELECTED_RESP_ID: number; - public P_SCHEDULE_DATE_FROM: DateTimeInput; - public P_SCHEDULE_DATE_TO: DateTimeInput; + public P_SCHEDULE_DATE_FROM: string; + public P_SCHEDULE_DATE_TO: string; public P_EXCESS_FLAG: string; public P_TIMEBACK_FLAG: string; public P_COMP_OFF_FLAG: string; @@ -19,4 +19,6 @@ export class GetTimeCardSummaryRequest extends Request { public P_APPR_TIMEBACK_FLAG: string; public P_SHT_TYPE: string; public P_ACTUAL_WOB_SEC: string; + public SearchMonth: string; + public SearchYear: number; } diff --git a/Mohem/src/app/time-card/service/time-card.service.ts b/Mohem/src/app/time-card/service/time-card.service.ts index 7e8f2cc3..b4fba9fe 100644 --- a/Mohem/src/app/time-card/service/time-card.service.ts +++ b/Mohem/src/app/time-card/service/time-card.service.ts @@ -1,27 +1,27 @@ -import { Injectable } from "@angular/core"; -import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service"; -import { ConnectorService } from "src/app/hmg-common/services/connector/connector.service"; -import { Request } from "src/app/hmg-common/services/models/request"; +import { Injectable } from '@angular/core'; +import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service'; +import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service'; +import { Request } from 'src/app/hmg-common/services/models/request'; -import { Observable } from "rxjs"; -import { GetShiftTypeResponse } from "./models/get-shift-type.response"; -import { GetDayAndHoursDetailsResponse } from "./models/get-day-hours-type-details.response"; -import { GetTimeCardSummaryResponse } from "./models/get-time-card-summary.response"; -import { GetShiftDetailResponse } from "./models/get-shift-detail.response"; -import { GetSwipesResponse } from "./models/get-swipes-response"; +import { Observable } from 'rxjs'; +import { GetShiftTypeResponse } from './models/get-shift-type.response'; +import { GetDayAndHoursDetailsResponse } from './models/get-day-hours-type-details.response'; +import { GetTimeCardSummaryResponse } from './models/get-time-card-summary.response'; +import { GetShiftDetailResponse } from './models/get-shift-detail.response'; +import { GetSwipesResponse } from './models/get-swipes-response'; @Injectable({ - providedIn: "root" + providedIn: 'root' }) export class TimeCardService { - public static getShiftTypeUrl = "Services/ERP.svc/REST/GET_SHIFT_TYPES"; + public static getShiftTypeUrl = 'Services/ERP.svc/REST/GET_SHIFT_TYPES'; public static getTimeCardSummaryUrl = - "Services/ERP.svc/REST/GET_TIME_CARD_SUMMARY"; + 'Services/ERP.svc/REST/GET_TIME_CARD_SUMMARY'; public static getDayHourDetailsUrl = - "Services/ERP.svc/REST/GET_DAY_HOURS_TYPE_DETAILS"; + 'Services/ERP.svc/REST/GET_DAY_HOURS_TYPE_DETAILS'; public static getShiftDetailUrl = - "Services/ERP.svc/REST/GET_SCHEDULE_SHIFTS_DETAILS"; - public static getSwipeUrl = "Services/ERP.svc/REST/GET_SWIPES"; + 'Services/ERP.svc/REST/GET_SCHEDULE_SHIFTS_DETAILS'; + public static getSwipeUrl = 'Services/ERP.svc/REST/GET_SWIPES'; constructor( public con: ConnectorService, diff --git a/Mohem/src/app/time-card/shift-details/shift-details.component.html b/Mohem/src/app/time-card/shift-details/shift-details.component.html new file mode 100644 index 00000000..2e8a1ee3 --- /dev/null +++ b/Mohem/src/app/time-card/shift-details/shift-details.component.html @@ -0,0 +1,191 @@ + + + + + + Shift Details + + + + +
+ + +

Shift details

+

{{ shiftData.SCHEDULE_DATE | date }}

+ + + + Shift type + + + {{shiftData.SHT_TYPE_DESC}} + + + + + Shift + + + {{shiftData.SHT_NAME}} + + + + + Break + + + {{shiftData.BREAK_NAME}} + + + + + Work On Break + + + {{shiftData.ACTUAL_WOB_HRS}} + + + +

Actual Swipe(s)

+
+ + + Start + + + {{shiftData.SHT_ACTUAL_START_TIME}} + + + + + End + + + {{shiftData.SHT_ACTUAL_END_TIME}} + + + +

Approved Swipe(s)

+
+ + + Start + + + {{shiftData.APPROVED_START_TIME}} + + + + + Start Reason + + + {{shiftData.APPROVED_START_REASON_DESC}} + + + + + End + + + {{shiftData.APPROVED_END_TIME}} + + + + + End Reason + + + {{shiftData.APPROVED_END_REASON_DESC}} + + + + + Actual Hours + + + {{shiftData.SHT_ACTUAL_HRS}} + + +
+
+
+
+ +
+ + +

Employee Swipe(s)

+

{{ swipeData.SCHEDULE_DATE | date }}

+ + + + + Swipe Date + + + {{swipeData.SWIPE_DATE}} + + + + + Swipe Time + + + {{swipeData.SWIPE_TIME}} + + + + + Swipe Status + + + {{swipeData.SWIPE_STATUS}} + + + + + Machine Location + + + {{swipeData.MACHINE_LOCATION}} + + + + + Unit Number + + + {{swipeData.UNIT_NUMBER}} + + + + + Unit Name + + + {{swipeData.UNIT_NAME}} + + + + + Exclude + + + {{swipeData.EXCLUDE_FLAG}} + + + + + Error Message + + + {{swipeData.RETURN_MESSAGE}} + + + +
+
+
+
\ No newline at end of file diff --git a/Mohem/src/app/time-card/shift-details/shift-details.component.scss b/Mohem/src/app/time-card/shift-details/shift-details.component.scss new file mode 100644 index 00000000..976ada04 --- /dev/null +++ b/Mohem/src/app/time-card/shift-details/shift-details.component.scss @@ -0,0 +1,30 @@ +ion-header{ + overflow: hidden; + background: #f2f2f3; +} +ion-content{ + --ion-background-color: #f2f2f3; +} + +ion-card-content { + padding: 0px; +} + +ion-card { + box-shadow: none !important; + background-color: white; + margin: 10px; +} + +ion-title{ + text-align: center; + font-family: WorkSans-Bold; + font-size: 18px; + margin-right: 45px; +} + +.header-toolbar-new{ + --background: linear-gradient(90deg, rgba(132,198,143,1) 0%, rgba(41,183,197,1) 100%); + border-bottom-right-radius: 30px; + border-bottom-left-radius: 30px; +} diff --git a/Mohem/src/app/time-card/shift-details/shift-details.component.spec.ts b/Mohem/src/app/time-card/shift-details/shift-details.component.spec.ts new file mode 100644 index 00000000..808e6498 --- /dev/null +++ b/Mohem/src/app/time-card/shift-details/shift-details.component.spec.ts @@ -0,0 +1,27 @@ +import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ShiftDetailsComponent } from './shift-details.component'; + +describe('ShiftDetailsComponent', () => { + let component: ShiftDetailsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ShiftDetailsComponent ], + schemas: [CUSTOM_ELEMENTS_SCHEMA], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ShiftDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Mohem/src/app/time-card/shift-details/shift-details.component.ts b/Mohem/src/app/time-card/shift-details/shift-details.component.ts new file mode 100644 index 00000000..cd3cb9f2 --- /dev/null +++ b/Mohem/src/app/time-card/shift-details/shift-details.component.ts @@ -0,0 +1,75 @@ +import { Component, OnInit } from '@angular/core'; +import { TimeCardService } from 'src/app/time-card/service/time-card.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; +import { GetShiftDetailRequest } from 'src/app/time-card/service/models/get-shift-detail.request'; +import { GetSwipesRequest } from 'src/app/time-card/service/models/get-swipes-request'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import * as moment from 'moment'; + +@Component({ + selector: 'app-shift-details', + templateUrl: './shift-details.component.html', + styleUrls: ['./shift-details.component.scss'], +}) +export class ShiftDetailsComponent implements OnInit { + public selectedShift: any; + // public selectedShiftDay: any; + public shiftDetailsData: any = []; + public swipeDetailsData: any = []; + constructor( + public timeCardService: TimeCardService, + public common: CommonService, + public sharedData: SharedDataService) { } + + ngOnInit() { + this.selectedShift = this.sharedData.getSharedData('selectedShift', false); + console.log(this.selectedShift); + if (this.selectedShift.origin === 'shiftDetails') { + this.getScheduleShiftDetails(); + } else if (this.selectedShift.origin === 'shiftSwipes') { + this.getSwipesDetails(); + } + + // this.selectedShiftDay = this.sharedData.getSharedData('selectedShiftDay', false); + // console.log(this.selectedShiftDay); + // if (this.selectedShiftDay.origin === 'shiftDetails') { + // this.getScheduleShiftDetails(); + // } else if (this.selectedShiftDay.origin === 'shiftSwipes') { + // this.getSwipesDetails(); + // } + } + + getScheduleShiftDetails() { + console.log("getScheduleShiftDetails"); + const GetShiftDetailRequestObject = new GetShiftDetailRequest(); + GetShiftDetailRequestObject.P_RTP_ID = this.selectedShift.RTP_ID; + GetShiftDetailRequestObject.P_PAGE_NUM = 1; + GetShiftDetailRequestObject.P_PAGE_LIMIT = 10; + console.log(GetShiftDetailRequestObject); + this.timeCardService.getShiftDetail(GetShiftDetailRequestObject).subscribe((result) => { + if (this.common.validResponse(result)) { + console.log(result); + this.shiftDetailsData = result.GetScheduleShiftsDetailsList; + // this.common.sharedService.setSharedData(this.shiftDetailsData,'shiftDetailsData'); + } + }) + } + + getSwipesDetails() { + console.log("getSwipesDetails"); + + const GetSwipesRequestObject = new GetSwipesRequest(); + GetSwipesRequestObject.P_SELECTED_EMPLOYEE_NUMBER = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); + GetSwipesRequestObject.P_SCHEDULE_DATE = this.common.convertISODateToJsonDate(this.selectedShift.SCHEDULE_DATE); + GetSwipesRequestObject.P_PAGE_NUM = 1; + GetSwipesRequestObject.P_PAGE_LIMIT = 10; + this.timeCardService.getSwipes(GetSwipesRequestObject).subscribe((result) => { + if (this.common.validResponse(result)) { + console.log(result); + this.swipeDetailsData = result.GetSwipesList; + } + }); + } + +} diff --git a/Mohem/src/app/time-card/time-card-details/time-card-details.component.html b/Mohem/src/app/time-card/time-card-details/time-card-details.component.html index 633c94d1..87f13add 100644 --- a/Mohem/src/app/time-card/time-card-details/time-card-details.component.html +++ b/Mohem/src/app/time-card/time-card-details/time-card-details.component.html @@ -1,3 +1,148 @@ -

- time-card-details works! -

+ + +
+ + + + {{ts.trPK('attendance','monthly-attendance')}} +
+
+
+
+ + + + + +

{{month}}

+
+ +

{{year}}

+
+ + + +
+
+ + + +
+
+
+ + {{ts.trPK('attendance-tracking','attendance-statistics')}} + +
+ +
+

{{totalAttendancePrecentage}}

+

{{ts.trPK('absenceList','days')}}

+
+ +
+ +
+ + + + + + + + +
+
+ + + + + + + + +
+
+
+
+
+
+
+
+ + + + + + + + + +

+ {{timeCardSummaryData.SCHEDULE_DAYS}}

+

0

+
+
+
+
+ + + + + + + + + +

+ {{timeCardSummaryData.OFF_DAYS}}

+

0

+
+
+
+
+ + + +

+ {{timeCardSummaryData.UNAUTHORIZED_LEAVE}}

+

0

+
+
+ + + +

+ {{timeCardSummaryData.SHORTAGE_HRS}}

+

0

+
+
+
+
+
+
+ +

{{ts.trPK('attendance','monthly-attendance-calendar')}}

+ + +
+
+
\ No newline at end of file diff --git a/Mohem/src/app/time-card/time-card-details/time-card-details.component.scss b/Mohem/src/app/time-card/time-card-details/time-card-details.component.scss index e69de29b..77f4f263 100644 --- a/Mohem/src/app/time-card/time-card-details/time-card-details.component.scss +++ b/Mohem/src/app/time-card/time-card-details/time-card-details.component.scss @@ -0,0 +1,487 @@ +ion-header{ + overflow: hidden; + background: #f2f2f3; +} +ion-content{ + --ion-background-color: #f2f2f3; +} + +ion-card-content { + padding: 0px; +} + +ion-card { + box-shadow: none !important; + background-color: white; + margin: 10px -15px; + margin-bottom: 20px; +} + +ion-title{ + text-align: center; + font-family: WorkSans-Bold; + font-size: 18px; + margin-right: 35px; +} + +///////////////////////////////here +.slidPrev{ + // margin-top: 8px; + margin-left: 10px; + background: transparent; +} + +.slidNext{ + background: transparent; + margin-top: -1px; + margin-left: 43px; +} +.activeArrow{ + height: 20px; + width: 20px; +color: white; +} +.disabledArrow{ + height: 20px; + width: 20px; +color: gray; +// margin-right: 5px; +} + +.header-toolbar-new{ + --background: linear-gradient(90deg, rgba(132,198,143,1) 0%, rgba(41,183,197,1) 100%); + border-bottom-right-radius: 30px; + border-bottom-left-radius: 30px; +} + +.active-Segment { + border-radius: 5px !important; + font-size: 0.3cm !important; + background: white !important; + color: #fff !important; + font-weight: bold !important; + border: 1px solid white !important; + text-transform: none; + --color-checked: none; + } + .active-Segment ion-label{ + // color: #A3D077 !important; + color: #11975F !important; + font-size: 11px; + } + .normal-Segment ion-label{ + // color: #A3D077 !important; + color: white !important; + font-size: 11px; + } + .normal-Segment { + border-radius: 5px !important; + font-size: 0.3cm !important; + background: #A3D077 !important; + color: #fff !important; + font-weight: bold !important; + border: 1px solid white !important; + text-transform: none; + --color-checked: none; + } + .time-card-details-container{ + margin-right: 20px; + margin-left: 20px; + } + + .card-summary-heading{ + margin-left: 10px; + margin-top: 12px; + color: #606161; + font-family: WorkSans-Bold; + } + .card-summary-heading-hours{ + color: #606161; + font-family: WorkSans-Bold; + } + + .card-summary-heading-hours-extended-heading{ + color: #D3D3D3; + font-family: WorkSans-Bold; + } + + ///////////////////////////////// + + .time-card-details { + background: white; + margin: 20px; + border-radius: 5px; + } + + .time-card-details-heading-two { + color: #606161; + font-family: WorkSans-Bold; + } + .time-card-details-heading-two h2 { + margin-top: 15px; + font-size: 15px; + } + + .time-card-span img{ + height: 30px; + margin-top: -5px; + margin-left: 10px; + } + .dayhours-button-container{ + width: 100%; + padding-right: 5px; + padding-left: 5px; + } + + .dayhours-button{ + width: 50%; + height: 35px; + font-size: 15px; + color: white; + background: #606161; + } + + ///////////////////////////////////// +.footer-modal-button{ + position: absolute; + bottom: 0; + color: white; + width: 100%; + text-align: center; +} +.footer-modal-button button{ + font-size: 20px; + background: white; + line-height: 2; + margin: -42px auto 0; + display: block; +} + +//////////////////////////// +.right-slider-icon{ + float: right; + height: 100%; + width: 15%; + position: fixed; + right: -5%; + top: 31%; +} + +.left-slider-icon{ + width: 15%; + position: fixed; + top: 32%; + left: -4%; + height: 100%; +} + + +//////////////////////////////////////////ENAD CODE//////////////////////////////////////////// + + +.colorBG{ + --background: #f0efef; + } + +.header-div { + + background-color: #22C6B3; + text-transform: capitalize; + height: 180px; + position: relative; + display: block; + margin-bottom: -28px; +} +.Title{ + text-align: center !important; + color: white !important; + margin-top: -86px !important; + font-size: 17px !important; + font-family: workSans-Regular; +} + +.header{ + margin-top: -221px; +} + +.chart-modal .modal-Wrapper { + --background: rgb(116, 108, 108) !important; + --border-color:white!important ; + width: 85%!important ; + height: 40px !important ; + + } + + .navbar{ + font-size: 10px !important; + --background: #22C6B3 !important; + color: aliceblue !important; +// margin-top: 10px !important; + + } + + .menu{ + // margin-left:330px !important; + margin-top: 0px !important; + font-size: 35px !important; + background: #22C6B3; + color: aliceblue; + margin-left: 0px !important; + + } + + .person{ + + margin-left:100px !important; + margin-top: 0px !important; + font-size: 23px !important; + background: #22C6B3 !important; + color: aliceblue !important; + + } + + .grid{ +margin-bottom: 550px !important; +margin-top: 20px !important; +margin-left: 15px !important; +margin-right: 15px !important; +background-color:white !important; +border-radius: 20px !important; +height: 250px !important; + } + + .headerGrid{ + margin-top: 5px !important; + margin-left: 15px !important; + margin-right: 15px !important; + background-color: white !important; + border-radius: 20px !important; +height: 250px !important; +border: 1px solid #d6d4d4; + } + + .green-label{ + font-size: 12px; + margin-top: -13px; + } + + .green-amount{ + font-size: 17px; + font-family: WorkSans-Bold; + margin-top: -3px; + } + + .blue-label{ + font-size: 12px; + margin-top: -13px; + } + + .blue-amount{ + font-size: 17px; + font-family: WorkSans-Bold; + margin-top: -4px; + } + +.today-graph{ + display:block !important; + height: 150px !important; + width: 300 !important; + margin-left: -70px !important; +} + .bodyGrid{ + // margin-bottom: 550px !important; + // margin-top: 7px !important; + // margin-left: 15px !important; + // margin-right: 15px !important; + // background-color:white !important; + // border-radius: 20px !important; + // height: 270px !important; + // border: 1px solid #d6d4d4 !important; + + margin-top: 7px !important; + margin-left: 15px !important; + margin-right: 15px !important; + background-color: white !important; + border-radius: 20px !important; + height: 321px !important; + border: 1px solid #d6d4d4 !important; + + } + .labelGrid{ + // margin-top: -30px !important; + // background-color:white !important; + // border-radius: 20px !important; + // height: 100px !important; + // border: 1px solid #d6d4d4; + margin-top: -30px !important; + background-color: white !important; + border-radius: 23px !important; + height: 100px !important; + border: 1px solid #d6d4d4; + padding-right: 0px; + } + +.ionSliders{ + margin: 0px !important; + padding: 0px !important; + +} + + + .ionSlide{ + margin-top: 5px !important; + margin-left: 190px !important; + color: black !important; + + } + .dateLable{ + + margin-left: 90px !important; + color: black !important; + font-size: small !important; + margin-top: 15px !important; + } +// h1{ +// font-size: 15px !important; +// text-align: center !important; +// } +.arrowDropright{ + margin-left:100px !important; + font-size: 20px !important; + color: rgb(168, 165, 165) !important; + margin-top: 15px !important; + +} +.arrowDropleft{ + font-size: 20px !important; + margin-left: 10px !important; + margin-top: 15px !important; + color: rgb(116, 108, 108) !important; +} + + .ionLable{ + font-size: 10px !important; + } + + .number{ + + font-size: 18px !important; + font-weight: bolder !important; + color: black !important; + } + + .header-div{ + background:var(--primary); + background: -moz-linear-gradient(45deg, var(--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); + background: -webkit-linear-gradient(45deg, (--primary) 0%, var(--secondary) 36%,var(--secondary) 59%, var(--customnavy) 100%); + background: #22C6B3; + // background: linear-gradient(90deg, #85C48D 0%, #85C48D 13%, #2BB5C6 98%, #2BB5C6 100%); + color:var(--light); + text-transform: capitalize; + + display: block; + position: relative; + height: 210px; + margin-bottom:60px; + // border-radius: 0px 0px 70px 70px; + } + + .request-heading { + + span { + + // text-align: center; + + // display: block; + + // padding-top: 8px; + + // font-family: workSans-Regular; + // text-align: center; + display: block; + padding-top: 8px; + /* font-family: workSans-Regular; */ + margin-left: -157px; + margin-top: -19px; + padding-bottom: 16px; + + } + + } + + + + .result-graph { + + position: relative; + + background: white; + + margin-right: 20px; + + margin-left: 20px; + + margin-top: 20px; + + padding-bottom: 20px; + + border-radius: 20px; + + } + + + + .result-text-container { + + padding: 0; + + margin: 0; + + position: absolute; + + left: 38%; + top: 60%; + + display: block; + + text-align: center; + + transform: translate(-50%, -50%); + + h2 { + + font-size: 25px; + + font-family: WorkSans-Bold; + color: black !important; + margin: 0 auto; + + line-height: 36px; + + } + p { + + font-size: 20px; + color: black !important; + // font-family: WorkSans-Bold; + + margin: 0 auto; + + line-height: 36px; + + } + + span { + + width: 125px; + + display: block; + + margin: 0 auto; + + font-size: 12px; + color: black !important; + font-family: workSans-Regular; + } + } + \ No newline at end of file diff --git a/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts b/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts index 8fa456db..0599e497 100644 --- a/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts +++ b/Mohem/src/app/time-card/time-card-details/time-card-details.component.ts @@ -1,4 +1,15 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ViewChild, Input } from '@angular/core'; +import { TimeCardService } from 'src/app/time-card/service/time-card.service'; +import { CommonService } from 'src/app/hmg-common/services/common/common.service'; +import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service'; +import { ModalController, IonSlides } from '@ionic/angular'; +import { SelectPeriodComponent } from '../select-period/select-period.component'; +import { GetDayAndHoursDetailsRequest } from 'src/app/time-card/service/models/get-day-hours-type-details.request'; +import { GetTimeCardSummaryRequest } from 'src/app/time-card/service/models/get-time-card-summary.request'; +import { MenuResponse } from 'src/app/hmg-common/services/menu/models/menu-response'; +import * as moment from 'moment'; +import { getDate } from 'date-fns'; +import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service'; @Component({ selector: 'app-time-card-details', @@ -6,9 +17,372 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./time-card-details.component.scss'], }) export class TimeCardDetailsComponent implements OnInit { + slideView: any; + sliderOne: any; + @ViewChild('slides') slides: IonSlides; + @ViewChild('slideWithNav') slideWithNav: IonSlides; + slideOptsOne = { + initialSlide: 0, + slidesPerView: 1, + autoplay: true + }; + month: any; + year: any; + preMonth: number; + nextMonth: any; + constructor( + public timeCardService: TimeCardService, + public common: CommonService, + public modalController: ModalController, + public sharedData: SharedDataService, + public ts: TranslatorService + ) { } + @ViewChild('sliderRef') protected sliderRef: IonSlides; - constructor() { } + public activeSegment: any = 'time-card-summary'; + public showMore: any = true; + public menuType: any; + public selEmp: string; + public dateFrom: any = new Date(); + public dateTo: any = new Date(); + public selMenu: MenuResponse = new MenuResponse(); + public respID: number; + public timeCardSummaryData: any = []; + public dayHoursData: any = []; + public selectedShift: any; + public rightIconActive = false; + public leftIconActive = false; + public loadMore = false; + public dayAndHoursPageNumber = 1; + public selectedFilters: any = {}; + public selectedShiftFilter: any; + public loadMoreDateHoursData = false; + public monthName: any; + public yearDate: any; + public absentDays: number; + public attendedDays: number; + public futrueDays = 0; + public totalAttendancePrecentage = 0; + public arrDaysAttendance: any = []; + public arrDaysAbsent: any = []; + public arrDaysOff: any = []; + public monthTitle: string = moment().format('MMMM'); + public yearTitle: string; + public isChange = false; + public activeMonth: any; + public currentMonthName = this.getMonthName(new Date().getMonth() + 1); + public showData = false; + public currentYear = new Date().getFullYear(); + public options = { + cutoutPercentage: 80, + tooltips: { enabled: false }, + legend: { display: false } + }; - ngOnInit() {} + public data = { + datasets: [ + { + data: [120, 50], + backgroundColor: [ + '#22c6b3', + '#094875', + ], + borderWidth: 2 + }] + }; + ngOnInit() { + this.nextMonth = new Date().getMonth() + 2; + this.preMonth = new Date().getMonth() - 2; + if (this.preMonth < 0) { + this.preMonth = this.preMonth * - 1; + } else { + this.preMonth = this.preMonth * - 1; + } + this.calendarConfig(this.getMonthName(new Date().getMonth() + 1) , new Date().getFullYear()); + } + + calendarConfig(month?, year?) { + this.arrDaysOff = []; + this.arrDaysAttendance = []; + this.arrDaysAbsent = []; + this.month = month; + this.year = year; + this.getTimeCardSummaryDetails(month, year); + this.getDayHoursTypeDetails(month, year); + } + + public segmentChanged(event: any) { + console.log('segmentChanged'); + this.activeSegment = event.detail.value; + if (this.activeSegment === 'time-card-details' && this.dayHoursData.length === 0) { + this.getDayHoursTypeDetails(); + } else { + this.rightIconActive = true; + this.leftIconActive = false; + } + } + + public toggleButton() { + this.showMore = !this.showMore; + } + + public getDayHoursTypeDetails(month?, year?) { + const dayAndHoursReqObj = new GetDayAndHoursDetailsRequest(); + this.monthName = month; + this.yearDate = year; + this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); + this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); + this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); + this.menuType = this.selMenu.List_Menu.MENU_TYPE; + + dayAndHoursReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; + dayAndHoursReqObj.P_MENU_TYPE = this.menuType; + dayAndHoursReqObj.P_SELECTED_RESP_ID = this.respID; + dayAndHoursReqObj.SearchMonth = this.monthName; + dayAndHoursReqObj.SearchYear = this.yearDate; + dayAndHoursReqObj.P_PAGE_NUM = this.dayAndHoursPageNumber; + dayAndHoursReqObj.P_PAGE_LIMIT = 100; + + if (Object.keys(this.selectedFilters).length !== 0) { + dayAndHoursReqObj.P_SHT_TYPE = this.selectedShiftFilter; + dayAndHoursReqObj.P_EXCESS_FLAG = this.selectedFilters['P_EXCESS_FLAG'.toString()].value; + dayAndHoursReqObj.P_TIMEBACK_FLAG = this.selectedFilters['P_TIMEBACK_FLAG'.toString()].value; + dayAndHoursReqObj.P_COMP_OFF_FLAG = this.selectedFilters['P_COMP_OFF_FLAG'.toString()].value; + dayAndHoursReqObj.P_NON_SCHEDULED_FLAG = this.selectedFilters['P_NON_SCHEDULED_FLAG'.toString()].value; + dayAndHoursReqObj.P_LATE_IN_FLAG = this.selectedFilters['P_LATE_IN_FLAG'.toString()].value; + dayAndHoursReqObj.P_EARLY_OUT_FLAG = this.selectedFilters['P_EARLY_OUT_FLAG'.toString()].value; + dayAndHoursReqObj.P_SHORTAGE_FLAG = this.selectedFilters['P_SHORTAGE_FLAG'.toString()].value; + dayAndHoursReqObj.P_MISSING_SWIPE_FLAG = this.selectedFilters['P_MISSING_SWIPE_FLAG'.toString()].value; + dayAndHoursReqObj.P_ACTUAL_WOB_SEC = this.selectedFilters['P_ACTUAL_WOB_SEC'.toString()].value; + dayAndHoursReqObj.P_ANALAYZED_FLAG = this.selectedFilters['P_ANALAYZED_FLAG'.toString()].value; + dayAndHoursReqObj.P_APPR_TIMEBACK_FLAG = this.selectedFilters['P_APPR_TIMEBACK_FLAG'.toString()].value; + } + + this.timeCardService.getDayHoursTypeDetails(dayAndHoursReqObj).subscribe((result) => { + if (this.common.validResponse(result)) { + console.log(result.GetDayHoursTypeDetailsList); + this.common.sharedService.setSharedData(result.GetDayHoursTypeDetailsList, 'RTP_IDs'); + this.countAllAttendDays(result.GetDayHoursTypeDetailsList); + this.loadMoreDateHoursData = false; + const daysDataLength = result.GetDayHoursTypeDetailsList.length; + this.loadMore = daysDataLength === 10 ? true : false; + if (this.dayAndHoursPageNumber > 1 && daysDataLength !== 0) { + this.rightIconActive = true; + this.dayHoursData = this.dayHoursData.concat(result.GetDayHoursTypeDetailsList); + setTimeout(() => { + this.nextSlide(); + }, 1000); + } else if (this.dayAndHoursPageNumber === 1 && daysDataLength <= 10 && daysDataLength !== 0) { + this.rightIconActive = true; + this.dayHoursData = result.GetDayHoursTypeDetailsList; + } + } + }); + + } + + countAllAttendDays(allDays) { + // tslint:disable-next-line:prefer-for-of + for (let i = 0; i < allDays.length; i++) { + if (allDays[i].DAY_TYPE === 'Off') { + // offDay + this.arrDaysOff.push({ + startTime: new Date(allDays[i].SCHEDULE_DATE), + endTime: new Date(allDays[i].SCHEDULE_DATE) + }); + } else if (allDays[i].DAY_TYPE === 'SCHEDULED') { + // attendace + this.arrDaysAttendance.push({ + startTime: new Date(allDays[i].SCHEDULE_DATE), + endTime: new Date(allDays[i].SCHEDULE_DATE) + }); + } else { + // absent + this.arrDaysAbsent.push({ + startTime: new Date(allDays[i].SCHEDULE_DATE), + endTime: new Date(allDays[i].SCHEDULE_DATE), + isoTime: '09:00:00', + allDay: false + }); + } + } + this.showData = true; + } + + public getTimeCardSummaryDetails(month?, year?) { + console.log('getTimeCardSummaryDetails'); + const timeCardSummaryReqObj = new GetTimeCardSummaryRequest(); + if (this.isChange) { + this.monthName = month; + console.log('' + this.monthName); + this.yearDate = year; + console.log('' + this.yearDate); + + } else { + this.monthName = month; + this.yearDate = year; + } + + this.selEmp = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_EMP, false); + this.respID = this.common.sharedService.getSharedData(MenuResponse.SHARED_SEL_RESP_ID, false); + this.selMenu = this.common.sharedService.getSharedData(MenuResponse.SHARED_DATA, false); + this.menuType = this.selMenu.List_Menu.MENU_TYPE; + + timeCardSummaryReqObj.P_SELECTED_EMPLOYEE_NUMBER = this.selEmp; + timeCardSummaryReqObj.P_MENU_TYPE = this.menuType; + timeCardSummaryReqObj.P_SELECTED_RESP_ID = this.respID; + timeCardSummaryReqObj.SearchMonth = this.monthName; + timeCardSummaryReqObj.SearchYear = this.yearDate; + + if (Object.keys(this.selectedFilters).length !== 0) { + timeCardSummaryReqObj.P_SHT_TYPE = this.selectedShiftFilter; + timeCardSummaryReqObj.P_EXCESS_FLAG = this.selectedFilters['P_EXCESS_FLAG'.toString()].value; + timeCardSummaryReqObj.P_TIMEBACK_FLAG = this.selectedFilters['P_TIMEBACK_FLAG'.toString()].value; + timeCardSummaryReqObj.P_COMP_OFF_FLAG = this.selectedFilters['P_COMP_OFF_FLAG'.toString()].value; + timeCardSummaryReqObj.P_NON_SCHEDULED_FLAG = this.selectedFilters['P_NON_SCHEDULED_FLAG'.toString()].value; + timeCardSummaryReqObj.P_LATE_IN_FLAG = this.selectedFilters['P_LATE_IN_FLAG'.toString()].value; + timeCardSummaryReqObj.P_EARLY_OUT_FLAG = this.selectedFilters['P_EARLY_OUT_FLAG'.toString()].value; + timeCardSummaryReqObj.P_SHORTAGE_FLAG = this.selectedFilters['P_SHORTAGE_FLAG'.toString()].value; + timeCardSummaryReqObj.P_MISSING_SWIPE_FLAG = this.selectedFilters['P_MISSING_SWIPE_FLAG'.toString()].value; + timeCardSummaryReqObj.P_ACTUAL_WOB_SEC = this.selectedFilters['P_ACTUAL_WOB_SEC'.toString()].value; + timeCardSummaryReqObj.P_ANALAYZED_FLAG = this.selectedFilters['P_ANALAYZED_FLAG'.toString()].value; + timeCardSummaryReqObj.P_APPR_TIMEBACK_FLAG = this.selectedFilters['P_APPR_TIMEBACK_FLAG'.toString()].value; + } + this.timeCardService.getTimeCardSummary(timeCardSummaryReqObj).subscribe((result) => { + if (this.common.validResponse(result)) { + + this.timeCardSummaryData = result.GetTimeCardSummaryList[0]; + this.absentDays = this.timeCardSummaryData.ABSENT_DAYS; + this.attendedDays = this.timeCardSummaryData.ATTENDED_DAYS; + this.totalAttendancePrecentage = this.timeCardSummaryData.PERIOD_DAYS - this.timeCardSummaryData.OFF_DAYS; + this.options = { + cutoutPercentage: 80, + tooltips: { enabled: false }, + legend: { display: false } + }; + if (this.absentDays === 0 && this.attendedDays === 0) { + this.futrueDays = this.totalAttendancePrecentage; + } + this.data = { + datasets: [ + { + data: [this.absentDays, this.attendedDays, this.futrueDays], + backgroundColor: [ + '#094875', + '#22c6b3', + '#9e9e9e' + ], + borderWidth: 2 + }] + }; + } + }); + } + + async openSelectPeriodModal() { + const modal = await this.modalController.create({ + component: SelectPeriodComponent, + cssClass: 'select-period-custom-modal', + componentProps: { + dateFrom: this.dateFrom, + dateTo: this.dateTo + } + }); + modal.onDidDismiss().then(result => { + this.loadMore = false; + this.rightIconActive = false; + this.leftIconActive = false; + this.dayHoursData = []; + this.timeCardSummaryData = []; + this.dayAndHoursPageNumber = 1; + this.loadMoreDateHoursData = false; + this.dateFrom = result.data.dateFrom; + this.dateTo = result.data.dateTo; + this.selectedFilters = result.data.keySelectedFilters; + this.selectedShiftFilter = result.data.selectedShiftType; + if (this.dateFrom && this.dateTo) { + this.getDayHoursTypeDetails(); + this.getTimeCardSummaryDetails(); + } + }); + return await modal.present(); + } + +showShiftDetails(origin: string) { + this.sliderRef.getActiveIndex().then((index: number) => { + this.selectedShift = this.dayHoursData[index]; + this.selectedShift.origin = origin; + this.sharedData.setSharedData(this.selectedShift, 'selectedShift'); + this.common.navigatePage('/time-card/shift-details'); + }); +} + +nextSlide() { + if (this.currentMonthName !== this.month) { + this.showData = false; + if (this.nextMonth > 12) { + this.currentYear = this.currentYear + 1; + this.nextMonth = 1; + } + this.calendarConfig(this.getMonthName(this.nextMonth) , this.currentYear); + this.nextMonth = this.nextMonth + 1; + this.preMonth = this.nextMonth - 2; + } +} + +previousSlide() { + this.showData = false; + if (this.preMonth === 0) { + this.currentYear = this.currentYear - 1; + this.preMonth = 12; + } + this.calendarConfig(this.getMonthName(this.preMonth) , this.currentYear); + this.preMonth = this.preMonth - 1; + this.nextMonth = this.preMonth + 2; +} + +changeMonthTitle(title) { + this.monthTitle = title; + this.isChange = true; + this.getTimeCardSummaryDetails(); +} + +changeYear(year) { + this.yearTitle = year; +} + +getHeaderMonth(date: any) { + return this.getMonthName(date.getMonth() + 1) + ' ' + date.getFullYear(); +} + +public getMonthName(value: any): any { + switch (value) { + case 1: + return 'January'; + case 2: + return 'February'; + case 3: + return 'March'; + case 4: + return 'April'; + case 5: + return 'May'; + case 6: + return 'June'; + case 7: + return 'July'; + case 8: + return 'August'; + case 9 : + return 'September'; + case 10: + return 'October'; + case 11: + return 'November'; + case 12: + return 'December'; + + } +} } diff --git a/Mohem/src/app/time-card/time-card.module.ts b/Mohem/src/app/time-card/time-card.module.ts index e79e452f..6ea5c17b 100644 --- a/Mohem/src/app/time-card/time-card.module.ts +++ b/Mohem/src/app/time-card/time-card.module.ts @@ -8,6 +8,11 @@ import { IonicModule } from '@ionic/angular'; import { TimeCardPage } from './time-card.page'; import { TimeCardDetailsComponent } from './time-card-details/time-card-details.component'; import { HomeComponent } from './home/home.component'; +import { SelectPeriodComponent } from './select-period/select-period.component'; +import { ShiftDetailsComponent } from './shift-details/shift-details.component'; +import { HmgCommonModule } from '../hmg-common/hmg-common.module'; + + const routes: Routes = [ { @@ -21,6 +26,10 @@ const routes: Routes = [ { path: 'time-card-details', component: TimeCardDetailsComponent + }, + { + path: 'shift-details', + component: ShiftDetailsComponent } ] } @@ -31,12 +40,18 @@ const routes: Routes = [ CommonModule, FormsModule, IonicModule, - RouterModule.forChild(routes) + RouterModule.forChild(routes), + HmgCommonModule ], declarations: [ TimeCardPage, HomeComponent, - TimeCardDetailsComponent - ] + TimeCardDetailsComponent, + SelectPeriodComponent, + ShiftDetailsComponent + ], + entryComponents: [ + SelectPeriodComponent + ], }) export class TimeCardPageModule {} diff --git a/Mohem/src/app/uI-elements/date-time.input.ts b/Mohem/src/app/uI-elements/date-time.input.ts index aa5c15d8..9225c9fc 100644 --- a/Mohem/src/app/uI-elements/date-time.input.ts +++ b/Mohem/src/app/uI-elements/date-time.input.ts @@ -42,8 +42,8 @@ export class DateTimeInput extends UiElement { // timeValue=arrayDate[1]; // } const template = - "" + - " " + this.label + "" + + "" + + " " + this.label + "" + // "
" + this.value + "
" + "" + // " "+ diff --git a/Mohem/src/app/uI-elements/date.input.ts b/Mohem/src/app/uI-elements/date.input.ts index 9e486e9e..a813416e 100644 --- a/Mohem/src/app/uI-elements/date.input.ts +++ b/Mohem/src/app/uI-elements/date.input.ts @@ -41,8 +41,8 @@ export class DateInput extends UiElement { // " "+ // "
"; - "" + - " " + this.label + "" + + "" + + " " + this.label + "" + // "
" + this.value + "
" + "" + // " "+ diff --git a/Mohem/src/app/uI-elements/number.input.ts b/Mohem/src/app/uI-elements/number.input.ts index da23b7c8..e8b68ee9 100644 --- a/Mohem/src/app/uI-elements/number.input.ts +++ b/Mohem/src/app/uI-elements/number.input.ts @@ -26,8 +26,8 @@ export class NumberInput extends UiElement { // " " + // "
"; - "" + - "" + this.label + "" + + " " + + "" + this.label + "" + " " + " "; diff --git a/Mohem/src/app/uI-elements/select.input.ts b/Mohem/src/app/uI-elements/select.input.ts index ea1346c7..f2797d44 100644 --- a/Mohem/src/app/uI-elements/select.input.ts +++ b/Mohem/src/app/uI-elements/select.input.ts @@ -23,7 +23,7 @@ export class SelectInput extends UiElement { if (this.disabled == "N") { this.disabled = "disabled" } else { this.disabled = "" } if (this.hidden == "N") { this.hidden = "display:none;" } else { this.hidden = "" } const template = - "
" + + "
" + " " + " " + // "
"; - "" + - "" + this.label + "" + + "" + + "" + this.label + "" + "" + this.value + "" + ""; diff --git a/Mohem/src/app/uI-elements/text.input.ts b/Mohem/src/app/uI-elements/text.input.ts index 5a31a96c..9a8632fe 100644 --- a/Mohem/src/app/uI-elements/text.input.ts +++ b/Mohem/src/app/uI-elements/text.input.ts @@ -24,9 +24,9 @@ export class TextInput extends UiElement { if (this.hidden === "N") { this.hidden = "display:none;" } else { this.hidden = "" } const template = // "
" + - "" + - " " + this.label + "" + - " " + + "" + + " " + this.label + "" + + " " + " "; return template; diff --git a/Mohem/src/app/uI-elements/time.input.ts b/Mohem/src/app/uI-elements/time.input.ts index 8f20eb5d..ace25328 100644 --- a/Mohem/src/app/uI-elements/time.input.ts +++ b/Mohem/src/app/uI-elements/time.input.ts @@ -31,8 +31,8 @@ export class TimeInput extends UiElement { this.formatDate(); } const template = - "
" + - " " + + "
" + + " " + // " "+ "
"+this.value+"
"+ "
"; diff --git a/Mohem/src/assets/imgs/action-approve.png b/Mohem/src/assets/imgs/action-approve.png new file mode 100644 index 00000000..05268bab Binary files /dev/null and b/Mohem/src/assets/imgs/action-approve.png differ diff --git a/Mohem/src/assets/imgs/action-info.png b/Mohem/src/assets/imgs/action-info.png new file mode 100644 index 00000000..f0e6f7e7 Binary files /dev/null and b/Mohem/src/assets/imgs/action-info.png differ diff --git a/Mohem/src/assets/imgs/action-more.png b/Mohem/src/assets/imgs/action-more.png new file mode 100644 index 00000000..de9aa0e7 Binary files /dev/null and b/Mohem/src/assets/imgs/action-more.png differ diff --git a/Mohem/src/assets/imgs/action-reject.png b/Mohem/src/assets/imgs/action-reject.png new file mode 100644 index 00000000..866f068c Binary files /dev/null and b/Mohem/src/assets/imgs/action-reject.png differ diff --git a/Mohem/src/assets/imgs/action-skip.png b/Mohem/src/assets/imgs/action-skip.png new file mode 100644 index 00000000..74e21661 Binary files /dev/null and b/Mohem/src/assets/imgs/action-skip.png differ diff --git a/Mohem/src/assets/imgs/attach-icon.png b/Mohem/src/assets/imgs/attach-icon.png new file mode 100644 index 00000000..6af9188a Binary files /dev/null and b/Mohem/src/assets/imgs/attach-icon.png differ diff --git a/Mohem/src/assets/imgs/call_icon.png b/Mohem/src/assets/imgs/call_icon.png new file mode 100644 index 00000000..b7f0e83d Binary files /dev/null and b/Mohem/src/assets/imgs/call_icon.png differ diff --git a/Mohem/src/assets/imgs/create_request_icon.png b/Mohem/src/assets/imgs/create_request_icon.png new file mode 100644 index 00000000..b6da2a40 Binary files /dev/null and b/Mohem/src/assets/imgs/create_request_icon.png differ diff --git a/Mohem/src/assets/imgs/green_call_icon.png b/Mohem/src/assets/imgs/green_call_icon.png new file mode 100644 index 00000000..13768143 Binary files /dev/null and b/Mohem/src/assets/imgs/green_call_icon.png differ diff --git a/Mohem/src/assets/imgs/message_icon.png b/Mohem/src/assets/imgs/message_icon.png new file mode 100644 index 00000000..956dd4a0 Binary files /dev/null and b/Mohem/src/assets/imgs/message_icon.png differ diff --git a/Mohem/src/assets/imgs/time-card/ArrowDown.png b/Mohem/src/assets/imgs/time-card/ArrowDown.png new file mode 100644 index 00000000..19693c85 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/ArrowDown.png differ diff --git a/Mohem/src/assets/imgs/time-card/ArrowRight.png b/Mohem/src/assets/imgs/time-card/ArrowRight.png new file mode 100644 index 00000000..e04b5a21 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/ArrowRight.png differ diff --git a/Mohem/src/assets/imgs/time-card/ArrowUp.png b/Mohem/src/assets/imgs/time-card/ArrowUp.png new file mode 100644 index 00000000..faaa61e8 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/ArrowUp.png differ diff --git a/Mohem/src/assets/imgs/time-card/Asset 18.png b/Mohem/src/assets/imgs/time-card/Asset 18.png new file mode 100644 index 00000000..df97a248 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Asset 18.png differ diff --git a/Mohem/src/assets/imgs/time-card/Asset 19.png b/Mohem/src/assets/imgs/time-card/Asset 19.png new file mode 100644 index 00000000..585150ba Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Asset 19.png differ diff --git a/Mohem/src/assets/imgs/time-card/Asset 20.png b/Mohem/src/assets/imgs/time-card/Asset 20.png new file mode 100644 index 00000000..661cb83e Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Asset 20.png differ diff --git a/Mohem/src/assets/imgs/time-card/Asset 21.png b/Mohem/src/assets/imgs/time-card/Asset 21.png new file mode 100644 index 00000000..e03be489 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Asset 21.png differ diff --git a/Mohem/src/assets/imgs/time-card/EarlyOut.png b/Mohem/src/assets/imgs/time-card/EarlyOut.png new file mode 100644 index 00000000..d7c3e48e Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/EarlyOut.png differ diff --git a/Mohem/src/assets/imgs/time-card/ExcessTime.png b/Mohem/src/assets/imgs/time-card/ExcessTime.png new file mode 100644 index 00000000..2f7105e1 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/ExcessTime.png differ diff --git a/Mohem/src/assets/imgs/time-card/LateIn.png b/Mohem/src/assets/imgs/time-card/LateIn.png new file mode 100644 index 00000000..829cf045 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/LateIn.png differ diff --git a/Mohem/src/assets/imgs/time-card/MissingSwipe.png b/Mohem/src/assets/imgs/time-card/MissingSwipe.png new file mode 100644 index 00000000..ec7ffcf5 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/MissingSwipe.png differ diff --git a/Mohem/src/assets/imgs/time-card/MyTimeCard.png b/Mohem/src/assets/imgs/time-card/MyTimeCard.png new file mode 100644 index 00000000..9ff482cc Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/MyTimeCard.png differ diff --git a/Mohem/src/assets/imgs/time-card/Notification.png b/Mohem/src/assets/imgs/time-card/Notification.png new file mode 100644 index 00000000..a4ff12a7 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Notification.png differ diff --git a/Mohem/src/assets/imgs/time-card/PlannedOT.png b/Mohem/src/assets/imgs/time-card/PlannedOT.png new file mode 100644 index 00000000..188e7306 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/PlannedOT.png differ diff --git a/Mohem/src/assets/imgs/time-card/Remarks.png b/Mohem/src/assets/imgs/time-card/Remarks.png new file mode 100644 index 00000000..e1a07b3d Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Remarks.png differ diff --git a/Mohem/src/assets/imgs/time-card/Shift Hours.png b/Mohem/src/assets/imgs/time-card/Shift Hours.png new file mode 100644 index 00000000..9d2000b6 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Shift Hours.png differ diff --git a/Mohem/src/assets/imgs/time-card/SwipeIn.png b/Mohem/src/assets/imgs/time-card/SwipeIn.png new file mode 100644 index 00000000..82b381e1 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/SwipeIn.png differ diff --git a/Mohem/src/assets/imgs/time-card/SwipeOut.png b/Mohem/src/assets/imgs/time-card/SwipeOut.png new file mode 100644 index 00000000..a84e1c9d Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/SwipeOut.png differ diff --git a/Mohem/src/assets/imgs/time-card/TimeBackIcon.png b/Mohem/src/assets/imgs/time-card/TimeBackIcon.png new file mode 100644 index 00000000..42f13fb5 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/TimeBackIcon.png differ diff --git a/Mohem/src/assets/imgs/time-card/Timeback.png b/Mohem/src/assets/imgs/time-card/Timeback.png new file mode 100644 index 00000000..287f57ab Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/Timeback.png differ diff --git a/Mohem/src/assets/imgs/time-card/TotalHours.png b/Mohem/src/assets/imgs/time-card/TotalHours.png new file mode 100644 index 00000000..f1ec0e8c Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/TotalHours.png differ diff --git a/Mohem/src/assets/imgs/time-card/WorkOnBreak.png b/Mohem/src/assets/imgs/time-card/WorkOnBreak.png new file mode 100644 index 00000000..f1f1faa2 Binary files /dev/null and b/Mohem/src/assets/imgs/time-card/WorkOnBreak.png differ diff --git a/Mohem/src/assets/localization/i18n.json b/Mohem/src/assets/localization/i18n.json index 89a3f9d1..b8a673d6 100644 --- a/Mohem/src/assets/localization/i18n.json +++ b/Mohem/src/assets/localization/i18n.json @@ -466,6 +466,10 @@ "en": "Attachment", "ar": "مرفق" }, + "file": { + "en": "file", + "ar": "ملف" + }, "select-attachment": { "en": "Select Attachment", "ar": "إختر مرفق" @@ -1037,6 +1041,22 @@ "attendance": { "ar": "الحضور", "en": "Attendance" + }, + "monthly-attendance": { + "ar": "الحضور الشهري", + "en": "Monthly Attendance" + }, + "monthly-attendance-calendar": { + "ar": "تقويم الحضور الشهري", + "en": "Monthly Attendance Calendar" + }, + "present": { + "ar": "حضور", + "en": "Present" + }, + "absent": { + "ar": "غياب", + "en": "Absent" } }, "vacation-rule": { @@ -1220,6 +1240,22 @@ "en": "Accrual Balances", "ar": "رصيد حساب المستحقات" }, + "accrualNet": { + "en": "Accrual Net", + "ar": "صافي الاستحقاق" + }, + "accrualUsed": { + "en": "Accrual Used", + "ar": "الاستحقاق المستخدم" + }, + "accrualYearly": { + "en": "Accrual Yearly", + "ar": "الاستحقاق السنوي" + }, + "totalNumber": { + "en": "TOTAL NUMBERS", + "ar": "المجموع" + }, "createAbsence": { "en": "Create Absence", "ar": "إنشاء إجازة" @@ -1271,6 +1307,26 @@ "attachList": { "en": "Attachment List", "ar": "قائمة المرفقات" + }, + "adult": { + "en": "Adult", + "ar": "بالغ" + }, + "child": { + "en": "Child", + "ar": "طفل" + }, + "infants": { + "en": "Infants", + "ar": "رضيع" + }, + "tickets": { + "en": "Tickets", + "ar": "تذاكر" + }, + "tickets-balance": { + "en": "Ticket Balance", + "ar": "رصيد التذاكر" } }, "accrualBalances": { @@ -1291,6 +1347,38 @@ "requestFor": { "en": "Request for", "ar": "اطلب ل" + }, + "todayAttendance": { + "en": "Today's Attendance", + "ar": "Today's Attendance" + }, + "checkIn": { + "en": "Check-In", + "ar": "CheckIn" + }, + "checkOut": { + "en": "Check-Out", + "ar": "CheckOut" + }, + "late": { + "en": "Late", + "ar": "Late" + }, + "attendance-statistics": { + "en": "Attendance Statistics", + "ar": "Attendance Statistics" + }, + "myTeam-header": { + "en": "MY TEAM", + "ar": "MY TEAM" + }, + "total": { + "en": "TOTAL", + "ar": "TOTAL" + }, + "team-members": { + "en": "TEAM MEMBERS", + "ar": "TEAM MEMBERS" } }, "searchForReplacment": { @@ -1597,7 +1685,7 @@ }, "msg":{ "en": "Select a replacement", - "ar":"اختيار بديل" + "ar":"اختر بديل" }, "title":{ "en": "Replacement Roll", @@ -1684,6 +1772,34 @@ "note": { "en":"Note", "ar":"مذكرة" + }, + "approveMsg":{ + "en":"are you sure that you want to approve this request?", + "ar":"هل انت متاكد من قبول هذا الطلب؟" + }, + "rejectMsg":{ + "en":"are you sure that you want to reject this request?", + "ar":"هل انت متاكد من رفض هذا الطلب؟" + }, + "delegateMsg":{ + "en":"are you sure that you want to delegate this request?", + "ar":"هل انت متاكد من تحويل هذا الطلب؟" + }, + "requestInformationMsg":{ + "en":"are you sure that you want to more information for this request?", + "ar":"هل انت متاكد من طلب مزيد من المعلومات لهذا الطلب؟" + }, + "grantMsg":{ + "en":"are you sure that you want to grant access for this request?", + "ar":"هل انت متاكد من انشاء صلاحيه لهذا الطلب؟" + }, + "answerMsg":{ + "en":"press on ok to continue", + "ar":"اضغط على موافق للاستمرار" + }, + "empty-comment":{ + "en":"you shoud add comment", + "ar":"يجب عليك اضافة تعليق" } }, "worklistMain": { @@ -1708,7 +1824,7 @@ "ar": "معلومات الموظف" }, "info":{ - "en": "Information", + "en": "Info", "ar":"تفاصيل" }, "notfDetails":{ @@ -1788,19 +1904,20 @@ "ar":"العناصر المطلوبة" }, "approveMsg":{ - "en": "Are you sure to approve this purchase requisition ?", + + "en": "

Are you sure to Approve this request ?

", "ar":"العناصر المطلوبة" }, "rejectMsg":{ - "en": "Are you sure to reject this purchase requisition ?", + "en": "

Are you sure to Reject this request ?

", "ar":"العناصر المطلوبة" }, "delMsg":{ - "en": "Are you sure to delete this purchase requisition ?", + "en": "

Are you sure to Delete this request ?

", "ar":"العناصر المطلوبة" }, "closeMsg":{ - "en": "Are you sure to close this purchase requisition ?", + "en": "

Are you sure to Close this request ?

", "ar":"العناصر المطلوبة" }, "Supplier":{ @@ -2068,7 +2185,6 @@ "en": "Line Details", "ar":"Line Details" } - }, "payslip": { @@ -2185,26 +2301,56 @@ }, "check-in":{ "en": "Check In", - "ar":"Check In" + "ar":"وقت الدخول" }, "check-out":{ "en": "Check Out", - "ar":"Check Out" + "ar":"وقت الخروج" }, "regular":{ "en": "Regular", - "ar":"Regular" + "ar":"المنتظم" }, "late-in":{ "en": "Late In", - "ar":"Late In" + "ar":"القدوم المتأخر" + }, + "shortage":{ + "en": "Shortage", + "ar":"ساعات التقصير" + }, + "excess":{ + "en": "Excess", + "ar":"فائض" + }, + "early-out":{ + "en": "Early Out", + "ar":"الخروج المبكر" }, "today-time-left":{ - "en": "TODAY TIME LEFT", - "ar":"TODAY TIME LEFT" + "en": "TODAY'S TIME LEFT", + "ar":"TODAY'S TIME LEFT" + }, + "shortage-hours":{ + "en": "Shortage Hours", + "ar":"ساعات التقصير" + }, + "schedule":{ + "en": "Schedule", + "ar":"ايام العمل" + }, + "off-days":{ + "en": "Off Days", + "ar":"ايام الراحه" + }, + "non-analyzed":{ + "en": "Non Analyzed", + "ar":"لايوجد تحليل" + }, + "attendance-statistics":{ + "en": "Attendance Statistics", + "ar":"احصائيات الحضور" }, - - "confirm-alert1":{ "en": "Are you sure, you want to", "ar":"Are you sure, you want to" @@ -2218,8 +2364,8 @@ "ar":"You did't complate today shift" }, "shift-time":{ - "en":"SHIFT TIME", - "ar":"SHIFT TIME" + "en":"Shift Time", + "ar":"وقت التناوب" } }, "sms": { diff --git a/Mohem/src/imgs/attach-icon.png b/Mohem/src/imgs/attach-icon.png new file mode 100644 index 00000000..6af9188a Binary files /dev/null and b/Mohem/src/imgs/attach-icon.png differ diff --git a/Mohem/src/theme/styles.scss b/Mohem/src/theme/styles.scss index ba5e7566..c0626ee3 100644 --- a/Mohem/src/theme/styles.scss +++ b/Mohem/src/theme/styles.scss @@ -95,6 +95,8 @@ ion-label{ .btnBack{ background: transparent !important; } + + /***************/ .attachImg{ max-width: 30px; @@ -393,11 +395,164 @@ ion-col.colBold,ion-col.colBold>label{ // padding:0px; // } + + + +.floating-form { + width:320px; +} + +// /**** floating-Lable style start ****/ +// .floating-label { +// position:relative; +// margin-bottom:20px; +// } +// .floating-input , .floating-select { +// font-size:14px; +// padding:4px 4px; +// display:block; +// width:100%; +// height:30px; +// background-color: transparent; +// border:none; +// border-bottom:1px solid #757575; +// } + +// .floating-input:focus , .floating-select:focus { +// outline:none; +// border-bottom:2px solid #5264AE; +// } + +// label { +// color:#999; +// font-size:14px; +// font-weight:normal; +// position:absolute; +// pointer-events:none; +// left:5px; +// top:5px; +// transition:0.2s ease all; +// -moz-transition:0.2s ease all; +// -webkit-transition:0.2s ease all; +// } + +// .floating-input:focus ~ label, .floating-input:not(:placeholder-shown) ~ label { +// top:-18px; +// font-size:14px; +// color:#5264AE; +// } + +// .floating-select:focus ~ label , .floating-select:not([value=""]):valid ~ label { +// top:-18px; +// font-size:14px; +// color:#5264AE; +// } + +// /* active state */ +// .floating-input:focus ~ .bar:before, .floating-input:focus ~ .bar:after, .floating-select:focus ~ .bar:before, .floating-select:focus ~ .bar:after { +// width:50%; +// } + +// *, *:before, *:after { +// -webkit-box-sizing: border-box; +// -moz-box-sizing: border-box; +// box-sizing: border-box; +// } + +// .floating-textarea { +// min-height: 30px; +// max-height: 260px; +// overflow:hidden; +// overflow-x: hidden; +// } + +// /* highlighter */ +// .highlight { +// position:absolute; +// height:50%; +// width:100%; +// top:15%; +// left:0; +// pointer-events:none; +// opacity:0.5; +// } + +// /* active state */ +// .floating-input:focus ~ .highlight , .floating-select:focus ~ .highlight { +// -webkit-animation:inputHighlighter 0.3s ease; +// -moz-animation:inputHighlighter 0.3s ease; +// animation:inputHighlighter 0.3s ease; +// } + +// /* animation */ +// @-webkit-keyframes inputHighlighter { +// from { background:#5264AE; } +// to { width:0; background:transparent; } +// } +// @-moz-keyframes inputHighlighter { +// from { background:#5264AE; } +// to { width:0; background:transparent; } +// } +// @keyframes inputHighlighter { +// from { background:#5264AE; } +// to { width:0; background:transparent; } +// } + +// /**** floating-Lable style end ****/ + + + + + + + + + + + + + + + + + + + + +/*** Body style start ***/ + +// html { +// font-family: "Helvetica Neue", Helvetica, "Noto Sans", sans-serif, Arial, sans-serif; +// font-size: 12px; +// line-height: 1.42857143; +// color: #949494; +// background-color: #ffffff; +// } +/*** Body style end ***/ + + +/*** daniel - Fork me friend - style ***/ +// .floating-credit { position:fixed; bottom:10px;right:10px; color:#aaa; font-size:13px;font-family:arial,sans-serif; } +// .floating-credit a { text-decoration:none; color:#000000; font-weight:bold; } +// .floating-credit a:hover { border-bottom:1px dotted #f8f8f8; } +// .floating-heading { position:fixed; color:#aaa; font-size:20px; font-family:arial,sans-serif; } +/*** daniel - Fork me friend - style ***/ + +/**************************TEST********************888/ + + /*****************dynamic form*******************/ +.dynamicField{ + border-radius: 30px; + border: 1px solid #a2a5a6!important; + margin-bottom: 20px; +} + + .daynamicForm-Label{ font-size: 16px; // margin-left: 15px; - color: var(--customnavy); + color: #a2a5a6 !important; display: block; overflow: hidden; -webkit-box-flex: 1; @@ -410,6 +565,7 @@ ion-col.colBold,ion-col.colBold>label{ white-space: normal; // padding-top: 10px; padding: 5px 0px; + padding-left: 10px !important; margin: 10px auto; :root[dir="ltr"]{ font-family: var(--fontFamilySemiBoldEN) !important; @@ -522,11 +678,13 @@ img.flipImg{ font-weight: 400; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); - width: 100%; + width: 80%; padding: 6px 0px; background-color: var(--light); border-bottom: var(--cusgray) solid 1px; border-radius: 0px; + margin-left: 20px; + margin-top: -10px; // -webkit-appearance: none; // -moz-appearance: none; text-indent: 1px; @@ -771,6 +929,19 @@ color: var(--dark); background: rgba(0, 0, 0, 0.5) !important; padding: 60% 10% !important; + padding: 30% 10% !important; + --height: 12cm !important; + // --width: 80% !important; + --border-radius: 0.4cm; + +} + +.replaceRoll-modal { + + padding: 30% 1% !important; + --height: 15cm !important; + --width: 100% !important; + --border-radius: 0.4cm; } @@ -821,7 +992,7 @@ color: var(--dark); } .cancelBtn { - background:var(--red) !important; + background:var(--darkblue) !important; white-space: normal !important; color:var(--light) !important; text-transform: capitalize !important; @@ -832,9 +1003,11 @@ color: var(--dark); min-width: 5px !important; width: 10px !important; margin: 8px !important; + --background:transparent; + } .confirmBtn { - background:var(--green) !important; + background:var(--newgreen) !important; white-space: normal !important; color:var(--light) !important; text-transform: capitalize !important; @@ -845,16 +1018,17 @@ color: var(--dark); min-width: 5px !important; width: 10px !important; margin: 8px !important; + --background:transparent; } .checkOutOkBtn{ - margin-left: 55px !important; - margin-right: 55px !important; + /* margin-left: 50px !important; */ + /* margin-right: 55px !important; */ margin-top: 10px !important; - margin-bottom: 10px !important; + /* margin-bottom: 10px !important; */ border-radius: 5px !important; - height: 32px !important; - min-height: 30px !important; + height: 40px !important; + min-height: 40px !important; background: var(--lightblue) !important; -webkit-box-flex: 1; flex: 1 1 auto; @@ -862,17 +1036,19 @@ color: var(--dark); border-right: 0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2); color: white !important; border: none !important; + width: 80%; + --background: var(--lightblue) !important; } .checkOutCancelBtn{ - margin-left: 55px !important; - margin-right: 55px !important; - margin-top: 10px !important; - margin-bottom: 10px !important; + /* margin-left: 55px !important; */ + /* margin-right: 55px !important; */ + /* margin-top: 10px !important; */ + /* margin-bottom: 10px !important; */ border-radius: 5px !important; - height: 32px !important; - min-height: 30px !important; + height: 40px !important; + min-height: 40px !important; background: var(--darkblue) !important; -webkit-box-flex: 1; flex: 1 1 auto; @@ -880,6 +1056,8 @@ color: var(--dark); border-right: 0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2); color: white !important; border: none !important; + width: 80%; + --background: var(--darkblue) !important; } .buttonClassWhite { @@ -954,6 +1132,52 @@ border:0px width: 315px !important; } + +.active-Segment { + border-radius: 25px !important; + // font-size: 0.3cm !important; + background: var(--newgreen) !important; + color: var(--light) !important; + font-weight: bold !important; + text-transform: none; + border: none; +} + +.normal-Segment { + border-radius: 10px !important; + // font-size: 0.3cm !important; + background: rgba(255, 255, 255, 0) !important; + color: var(--dark) !important; + font-weight: bold !important; + text-transform: none; + border: none; +} + +.active-Segment, +.normal-Segment { + flex: 1 100%; +} + +.ion-segment-all { + height: 50px !important; + background: white !important; + border-radius: 25px !important; + border: 1px solid #cccccc; + margin-top: 10px; +} + + + + + +.more-modal { + background: rgba(0, 0, 0, 0.5) !important; + padding: 30% 10% !important; + --height: 12cm !important; + --border-radius: 0.4cm; + +} + // .swiper-container-horizontal>.swiper-pagination-bullets, .swiper-pagination-custom, .swiper-pagination-fraction { // /* bottom: 10px; */ // left: 0; @@ -966,6 +1190,11 @@ border:0px // max-width: 40% !important; // } +.advanced-search-modal { + --height: 9cm !important; + --width: 88% !important; + --border-radius: 0.6cm; +} .slideFullWidth { margin-left:-15px; margin-right:-15px; @@ -990,7 +1219,6 @@ border:0px } .alert-button-inner.sc-ion-alert-md { - justify-content: center !important; } .replaceRoll-modal { @@ -1001,7 +1229,194 @@ border:0px --border-radius: 0.4cm; } +.header-md:after { + height: 0px !important; + display: none !important; +} .header-toolbar-new { --background: #22c6b3; background: #22c6b3; -} \ No newline at end of file +} + + +.boldText{ + color: var(--dark) !important; + font-weight: bold; + font-size: 20px; +} +.boldP{ + + font-size: 20px; +} +// .select-text{ +// --margin-left: -10px; +// margin-left:0; +// } +// .search-dropdown{ +// background: #22c6b3; +// ion-select { +// .select-text{ +// margin-left: -10px; +// } +// .select-icon{ +// .select-icon-inner{ +// opacity: 1; +// color: white; +// margin-top: -1px; +// } +// } +// } +// } + +.monthview-primary-with-event, .absent, .present, .dayoff { + + background-color: #fff !important; + z-index: 1; + color: #fff !important; + position: relative; + +} + +.advanced-search-modal { + --height: 12cm !important; + --width: 80% !important; + --border-radius: 0.4cm; +} + +.calendar-modal { + --height: 15cm !important; + --width: 88% !important; + --border-radius: 0.4cm; + + // height: 544px !important; + // width: 332px !important; +} + + +.monthview-datetable { + *{ + font-size: 12px !important; + font-weight: normal !important; + } + + thead th { + border:none !important; + color:#888; + } + tbody td{ + border:none !important; + line-height: 40px !important; + background: none !important; + padding: 0 !important; + + &.text-muted { + visibility: hidden; + } + + &.monthview-selected { + color: black; + } + + &.monthview-selected.present, + &.present { + color:#fff !important; + &:before { + background-color: #22c6b3 !important; + } + } + + &.monthview-selected.absent, + &.absent { + color:#fff !important; + &:before { + background-color:#1a586d !important; + } + } + + &.monthview-selected.dayoff, + &.dayoff { + color:#555 !important; + &:before { + background-color:#e5e5e5 !important; + } + } + + &.monthview-selected.scheduleDay, + &.scheduleDay { + color: #000 !important; + &:before { + background-color: #fff !important; + border: 1px solid #ccc !important; + } + } + + &:before { + content: ""; + width: 40px; + height: 40px; + display: block; + border-radius: 100px; + text-align: center; + margin: 9px auto -40px; + } + } +} + +.table-bordered{ + border:none !important; +} +// .monthview-primary-with-event::after, .absent::after, .present::after, .dayoff::after { +// content: " "; +// width: 80%; +// height: 3px; +// background: #77cfb8; +// position: absolute; +// bottom: 0; +// left: 0; +// right: 0; +// margin: auto; +// height: 100%; +// color: #fff; +// z-index: -1; +// border-radius: 50%; +// } +// .absent::after{ +// background: #094875; +// } + +// .present::after{ +// background: #77cfb8; +// } +// .dayoff::after{ +// background: gray; +// } + + +[dir=ltr] .monthview-container .swiper-slide, + +[dir=rtl] .monthview-container .swiper-slide { + + margin: 0 !important; + +} + + + +table.monthview-datetable th small { + + font-size: 60%; + +} + +.modal-wrapper{ + border-radius: 20px !important; +} + +// .replaceRoll-modal { + +// padding: 30% 1% !important; +// --height: 15cm !important; +// --width: 100% !important; +// --border-radius: 0.4cm; + +// } diff --git a/Mohem/src/theme/worklist.scss b/Mohem/src/theme/worklist.scss index 7a8ec184..57aa1748 100644 --- a/Mohem/src/theme/worklist.scss +++ b/Mohem/src/theme/worklist.scss @@ -4,7 +4,7 @@ } .footerSearchBtn{ - padding: 0px !important; + padding: 50px !important; background: #f0efef !important; } @@ -17,6 +17,7 @@ background: #f0efef; margin-top: 20px; width: 95%; + margin-left:9px } .gridItemReq{ @@ -31,8 +32,9 @@ text-align: left; } .itemReqDiv{ - padding-bottom: 10px; - padding-top: 10px; + padding:10px; + // padding-bottom: 10px; + // padding-top: 10px; } .arrowIcon{ width: 18px !important; @@ -49,13 +51,13 @@ margin-left: 10px !important; border-top-right-radius: 7px } .cardContent{ - width:100%; - margin-top: 33px + // width:100%; + // margin-top: 33px } .colItemReq{ - color: var(--dark); - font-weight: bold; - font-size: 16px; + color: var(--darkblue); + font-weight: bold !important;; + font-size: 16px ; text-align: left; display: contents; font-family: var(--ion-font-family,inherit); @@ -64,10 +66,6 @@ margin-left: 10px !important; white-space: normal; overflow: hidden; box-sizing: border-box; - - - - } .colItemReqHeader{ @@ -171,6 +169,7 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated .timeline { position: relative; margin: 15px 0 0 0; + // border-bottom: solid 1px var(--cusgray); } .timeline:before { @@ -180,9 +179,9 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated top: 0; bottom: 0; width: 4px; - background: #e4e4e4; + // background: #e4e4e4; z-index: 1; - left: 66px; + left: 35px; /* margin-left: -10px; */ /* z-index: 1; */ } @@ -190,10 +189,10 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated .timeline .timeline-thumb { border-radius: 500px; - width: 40px !important; + width: 70px !important; z-index: 2; position: absolute; - left: 48px; + left: 0px; // :root[dir="ltr"]{ // left: 37px; // } @@ -205,7 +204,7 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated } .timeline .timeline-thumb.timeline-icon { - height: 40px; + height: 67px; // text-align: center; // color: white; // border: 5px solid #CBD0D3; @@ -215,7 +214,7 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated .timeline .timeline-item { - width: 50px; + width: 40px; } @@ -255,49 +254,101 @@ ion-label.labelValue.sc-ion-label-md-h.sc-ion-label-md-s.md.hydrated .bg-blue-dot { border: var(--blue) solid 1px; - background: var(--gray); + + background-repeat: no-repeat; + background-image: url("/assets/imgs/profile.png"); + background-size: 100% 100%; } .bg-orange-dot { border: var(--orange) solid 1px; - background: var(--gray); + // background: var(--gray); + background-repeat: no-repeat; + background-image: url("/assets/imgs/profile.png"); + background-size: 100% 100%; } .bg-red-dot { border: var(--red) solid 1px; - background: var(--gray); + // background: var(--gray); + background-repeat: no-repeat; + background-image: url("/assets/imgs/profile.png"); + background-size: 100% 100%; } .bg-green-dot { border: var(--green) solid 1px; - background: var(--gray); + // background: var(--gray); + background-repeat: no-repeat; + background-image: url("/assets/imgs/profile.png"); + background-size: 100% 100%; } .bg-blue-txt { - color: var(--blue) !important; + color: var(--light) !important; font-weight:bold; + background: var( --blue); + border-radius: 9px; + text-align: center; + margin-top: 10px; + position: relative; + width: auto; + height: 100%; + display: inline-block !important; + padding: 0px 7px 0px 7px; + } .bg-orange-txt { font-weight:bold; - color: var(--orange) !important; + color: var(--light) !important; + background: var( --orange); + border-radius: 9px; + text-align: center; + width: 30%; + margin-top: 10px; + position: relative; + width: auto; + height: 100%; + display: inline-block !important; + padding: 0px 7px 0px 7px; + } .bg-red-txt { font-weight:bold; + color: var(--light) !important; + background: var( --red); + border-radius: 9px; + text-align: center; + width: 30%; + margin-top: 10px; + position: relative; + width: auto; + height: 100%; + display: inline-block !important; + padding: 0px 7px 0px 7px; - color: var(--red) !important; - } .bg-green-txt { font-weight:bold; + color: var(--light) !important; + background: var( --green); + border-radius: 9px; + text-align: center; + width: 30%; + margin-top: 10px; + position: relative; + width: auto; + height: 100%; + display: inline-block !important; + padding: 0px 7px 0px 7px; - color: var(--green) !important; } @@ -312,7 +363,7 @@ ion-item{ background-color: transparent; .item-date{ width: 55px; - font-size: 14px; + font-size: 14px !important; font-weight: bold; text-align: center; @@ -326,7 +377,7 @@ ion-item{ ion-label , [item-end]{ white-space: normal; - font-size: 14px; + font-size: 14px !important; // :root[dir="ltr"]{ // margin-left: 10px; // } @@ -342,7 +393,7 @@ ion-item{ --flex:none; } ion-input ,ion-datetime{ -border-bottom: #dedede 1px solid; +// border-bottom: #dedede 1px solid; } .left { .timeline:before{ @@ -368,3 +419,158 @@ left: 66px; } +.itemHISBtn{ + padding: 5px; + color: var(--light); + background: var(--darkgray); + border-radius: 3px; + width: 85%; + height: 40px; +} + + +.rowBtn{ + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + background: white; +} + + + +.rowBorder{ + border-bottom: solid 0.02cm var(--grayBG); + +} +.colBorder{ + border-right: solid 0.02cm var(--grayBG); + +} + +.dateActionHistory{ + text-align: end; + // margin-top: -25px; +} + + +.actionBtn{ + --border-radius: 50% !important; + height: 55px; + width: 55px; + --background: var(--newgreen); // will be dynamic + background: transparent; + margin:10px; +} + +.itemAttch{ + border-radius: 11px; + margin: 8px; + --min-height: 60px; + --max-height: 60px; +} + +.less { + max-height: 54px; + } + + .noDataDiv{ + background: #ffffff; + height: 11%; + text-align: center; + padding-top: 1px; + border-radius: 10px; + margin: 10px; + } + + .containerNote { + font-size: 14px; + line-height: 14px; + height: 15px; + overflow: hidden; + text-align: justify; + } + + .show { + overflow: visible; + height: auto; + } + + .showMore{ + padding: 0px; + background: transparent; + color: blue; + text-decoration: underline; + font-size: 14px; + } + .succssfullMSG{ + height: 100%; + width: 100%; + background: var(--newgreen); + color: white; + font-weight: bold; + font-size: 20px; + text-align: center; + vertical-align: middle; + padding-top: 30px; + } + + .succssfullIcon{ + width: 60%; + text-align: center; + height: 60%; + } + .subjectNotification{ + text-align: center; + padding-top: 10px; + font-weight: bold; + } + .tabBar{ + height:70px + } + .empImge{ + border-radius: 50%; + width:100%; + height: 100%; + border: #dedede solid 1px; + + } + .empImgeRep { + border-radius: 50% !important; + width: 80px; + height: 80px; + border: #dedede solid 1px; + } + .empImgeSub{ + border-radius: 50%; + width: 85px; + height: 85px; + border: #dedede solid 1px; + + } + + ion-card{ + color:black !important; + } + + .line{ + padding-bottom:87px; + } + + ion-segment-button ion-label { + max-width: 100px; + overflow: hidden; + padding: 10px; + font-size: 14px; + color: black !important; + } + + .colItems ion-label { + color: black !important; + + } + .approvalTitle{ + font-weight: bold; + font-size: 16px; + text-align: left; + }