mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer
This commit is contained in:
+2
-1
@@ -84,7 +84,8 @@
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "app:build"
|
||||
"browserTarget": "app:build",
|
||||
"proxyConfig": "src/proxy.conf.json"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
|
||||
+4
-104
@@ -3,7 +3,7 @@
|
||||
<name>gabinete digital</name>
|
||||
<description>An awesome Ionic/Cordova app.</description>
|
||||
<author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
|
||||
<content src="index.html" />
|
||||
<content original-src="index.html" src="http://localhost:8100" />
|
||||
<access origin="*" />
|
||||
<allow-navigation href="*" />
|
||||
<allow-navigation href="*" />
|
||||
@@ -46,115 +46,15 @@
|
||||
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
|
||||
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
|
||||
</platform>
|
||||
<platform name="ios">
|
||||
<allow-intent href="itms:*" />
|
||||
<allow-intent href="itms-apps:*" />
|
||||
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
|
||||
<icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
|
||||
<icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
|
||||
<icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
|
||||
<icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
|
||||
<icon height="20" src="resources/ios/icon/icon-20.png" width="20" />
|
||||
<icon height="40" src="resources/ios/icon/icon-20@2x.png" width="40" />
|
||||
<icon height="60" src="resources/ios/icon/icon-20@3x.png" width="60" />
|
||||
<icon height="48" src="resources/ios/icon/icon-24@2x.png" width="48" />
|
||||
<icon height="55" src="resources/ios/icon/icon-27.5@2x.png" width="55" />
|
||||
<icon height="29" src="resources/ios/icon/icon-29.png" width="29" />
|
||||
<icon height="58" src="resources/ios/icon/icon-29@2x.png" width="58" />
|
||||
<icon height="87" src="resources/ios/icon/icon-29@3x.png" width="87" />
|
||||
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
|
||||
<icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
|
||||
<icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
|
||||
<icon height="88" src="resources/ios/icon/icon-44@2x.png" width="88" />
|
||||
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
|
||||
<icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
|
||||
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
|
||||
<icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
|
||||
<icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
|
||||
<icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
|
||||
<icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
|
||||
<icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
|
||||
<icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
|
||||
<icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
|
||||
<icon height="172" src="resources/ios/icon/icon-86@2x.png" width="172" />
|
||||
<icon height="196" src="resources/ios/icon/icon-98@2x.png" width="196" />
|
||||
<icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
|
||||
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
|
||||
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
|
||||
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
|
||||
<splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
|
||||
<splash height="1125" src="resources/ios/splash/Default-Landscape-2436h.png" width="2436" />
|
||||
<splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
|
||||
<splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
|
||||
<splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
|
||||
<splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
|
||||
<splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
|
||||
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
|
||||
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
|
||||
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
|
||||
<splash height="2436" src="resources/ios/splash/Default-2436h.png" width="1125" />
|
||||
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
|
||||
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
|
||||
<icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
|
||||
<icon height="20" src="resources/ios/icon/icon-20.png" width="20" />
|
||||
<icon height="40" src="resources/ios/icon/icon-20@2x.png" width="40" />
|
||||
<icon height="60" src="resources/ios/icon/icon-20@3x.png" width="60" />
|
||||
<icon height="29" src="resources/ios/icon/icon-29.png" width="29" />
|
||||
<icon height="58" src="resources/ios/icon/icon-29@2x.png" width="58" />
|
||||
<icon height="87" src="resources/ios/icon/icon-29@3x.png" width="87" />
|
||||
<icon height="48" src="resources/ios/icon/icon-24@2x.png" width="48" />
|
||||
<icon height="55" src="resources/ios/icon/icon-27.5@2x.png" width="55" />
|
||||
<icon height="88" src="resources/ios/icon/icon-44@2x.png" width="88" />
|
||||
<icon height="172" src="resources/ios/icon/icon-86@2x.png" width="172" />
|
||||
<icon height="196" src="resources/ios/icon/icon-98@2x.png" width="196" />
|
||||
<icon height="216" src="resources/ios/icon/icon-108@2x.png" width="216" />
|
||||
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
|
||||
<icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
|
||||
<icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
|
||||
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
|
||||
<icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
|
||||
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
|
||||
<icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
|
||||
<icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
|
||||
<icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
|
||||
<icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
|
||||
<icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
|
||||
<icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
|
||||
<icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
|
||||
<icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
|
||||
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
|
||||
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
|
||||
<splash height="2688" src="resources/ios/splash/Default-2688h~iphone.png" width="1242" />
|
||||
<splash height="1242" src="resources/ios/splash/Default-Landscape-2688h~iphone.png" width="2688" />
|
||||
<splash height="1792" src="resources/ios/splash/Default-1792h~iphone.png" width="828" />
|
||||
<splash height="828" src="resources/ios/splash/Default-Landscape-1792h~iphone.png" width="1792" />
|
||||
<splash height="2436" src="resources/ios/splash/Default-2436h.png" width="1125" />
|
||||
<splash height="1125" src="resources/ios/splash/Default-Landscape-2436h.png" width="2436" />
|
||||
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
|
||||
<splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
|
||||
<splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
|
||||
<splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
|
||||
<splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
|
||||
<splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
|
||||
<splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
|
||||
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
|
||||
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
|
||||
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
|
||||
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
|
||||
</platform>
|
||||
<plugin name="cordova-plugin-statusbar" spec="2.4.2" />
|
||||
<plugin name="cordova-plugin-device" spec="2.0.2" />
|
||||
<plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
|
||||
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
|
||||
<mfp:android>
|
||||
<mfp:sdkChecksum>1109370933</mfp:sdkChecksum>
|
||||
<mfp:sdkChecksum>3077110622</mfp:sdkChecksum>
|
||||
<mfp:appChecksum>3619450036</mfp:appChecksum>
|
||||
<mfp:security>
|
||||
<mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
|
||||
</mfp:security>
|
||||
</mfp:android>
|
||||
<mfp:ios>
|
||||
<mfp:sdkChecksum>246097737</mfp:sdkChecksum>
|
||||
<mfp:sdkChecksum>1979143311</mfp:sdkChecksum>
|
||||
<mfp:appChecksum>1328564293</mfp:appChecksum>
|
||||
<mfp:security>
|
||||
<mfp:testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3" />
|
||||
@@ -181,7 +81,7 @@
|
||||
</mfp:windows10>
|
||||
<mfp:appChecksum>0</mfp:appChecksum>
|
||||
</mfp:windows>
|
||||
<mfp:platformVersion>8.0.0.00-20210308-063916</mfp:platformVersion>
|
||||
<mfp:platformVersion>8.0.0.00-20210905-154328</mfp:platformVersion>
|
||||
<mfp:clientCustomInit enabled="false" />
|
||||
<mfp:server runtime="mfp" url="http://gpr-dev-10.gabinetedigital.local:9080" />
|
||||
<mfp:serverUri url="" />
|
||||
|
||||
+11
-1
@@ -3,5 +3,15 @@
|
||||
"integrations": {
|
||||
"cordova": {}
|
||||
},
|
||||
"type": "angular"
|
||||
"type": "angular",
|
||||
"proxies":[
|
||||
{
|
||||
"path": "/mfp/api/imfpush/",
|
||||
"proxyUrl": "http://gpr-dev-10.gabinetedigital.local:9080/mfp/api/imfpush/"
|
||||
},
|
||||
{
|
||||
"path": "/mfp/api",
|
||||
"proxyUrl": "http://gpr-dev-10.gabinetedigital.local:9080/mfp/api"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Generated
+7377
-12815
File diff suppressed because it is too large
Load Diff
+16
-11
@@ -42,18 +42,19 @@
|
||||
"@fullcalendar/interaction": "^5.3.0",
|
||||
"@ionic-native/camera": "^5.31.1",
|
||||
"@ionic-native/core": "^5.0.7",
|
||||
"@ionic-native/file": "^5.30.0",
|
||||
"@ionic-native/file": "^5.36.0",
|
||||
"@ionic-native/file-path": "^5.30.0",
|
||||
"@ionic-native/fingerprint-aio": "^4.20.0",
|
||||
"@ionic-native/http": "^5.31.1",
|
||||
"@ionic-native/in-app-browser": "^5.28.0",
|
||||
"@ionic-native/ionic-webview": "^5.35.0",
|
||||
"@ionic-native/local-notifications": "^4.20.0",
|
||||
"@ionic-native/network": "^5.35.0",
|
||||
"@ionic-native/media": "^5.36.0",
|
||||
"@ionic-native/network": "^5.36.0",
|
||||
"@ionic-native/screen-orientation": "^5.35.0",
|
||||
"@ionic-native/splash-screen": "^5.31.1",
|
||||
"@ionic-native/sqlite": "^5.31.1",
|
||||
"@ionic-native/sqlite-porter": "^5.31.1",
|
||||
"@ionic-native/sqlite": "^5.36.0",
|
||||
"@ionic-native/sqlite-porter": "^4.20.0",
|
||||
"@ionic-native/status-bar": "^5.0.0",
|
||||
"@ionic-native/wheel-selector": "^5.31.1",
|
||||
"@ionic/angular": "^5.5.4",
|
||||
@@ -92,18 +93,20 @@
|
||||
"ionic-selectable": "^4.7.1",
|
||||
"ionic2-alpha-scroll": "^2.0.1",
|
||||
"ionic2-calendar": "^0.6.6",
|
||||
"ionicons": "^5.5.3",
|
||||
"jest-puppeteer": "^5.0.4",
|
||||
"jetifier": "^1.6.6",
|
||||
"lite-server": "^2.6.1",
|
||||
"moment": "^2.29.1",
|
||||
"ng2-pdf-viewer": "^7.0.1",
|
||||
"ngx-cookie-service": "^12.0.3",
|
||||
"ngx-socket-io": "^3.2.0",
|
||||
"pdfjs": "^2.4.6",
|
||||
"pdfjs-dist": "^2.9.359",
|
||||
"puppeteer": "^10.1.0",
|
||||
"rxjs": "~6.6.3",
|
||||
"rxjs-compat": "^6.6.7",
|
||||
"sharp": "^0.25.4",
|
||||
"sharp": "^0.29.1",
|
||||
"socket.io-client": "^2.3.0",
|
||||
"ts-jest": "^27.0.3",
|
||||
"tslib": "^2.0.0",
|
||||
@@ -118,19 +121,19 @@
|
||||
"@angular/compiler": "^12.1.2",
|
||||
"@angular/compiler-cli": "^12.1.2",
|
||||
"@angular/language-service": "^12.1.2",
|
||||
"@ionic/angular-toolkit": "^3.0.0",
|
||||
"@ionic/angular-toolkit": "^4.0.0",
|
||||
"@ionic/lab": "3.1.7",
|
||||
"@types/jasmine": "~3.6.0",
|
||||
"@types/jasminewd2": "~2.0.3",
|
||||
"@types/jest": "^26.0.24",
|
||||
"@types/node": "^12.11.1",
|
||||
"codelyzer": "^6.0.0",
|
||||
"cordova-android": "^9.0.0",
|
||||
"cordova-android": "^9.1.0",
|
||||
"cordova-browser": "^6.0.0",
|
||||
"cordova-ios": "^6.2.0",
|
||||
"cordova-plugin-androidx": "^3.0.0",
|
||||
"cordova-plugin-androidx-adapter": "^1.1.3",
|
||||
"cordova-plugin-compat": "^1.2.0",
|
||||
"cordova-plugin-crosswalk-webview": "git+https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview.git",
|
||||
"cordova-plugin-device": "^2.0.2",
|
||||
"cordova-plugin-dialogs": "^2.0.2",
|
||||
"cordova-plugin-file": "^6.0.2",
|
||||
@@ -139,6 +142,7 @@
|
||||
"cordova-plugin-inappbrowser": "^4.0.0",
|
||||
"cordova-plugin-ionic-keyboard": "^2.2.0",
|
||||
"cordova-plugin-ionic-webview": "^5.0.0",
|
||||
"cordova-plugin-media": "^5.0.3",
|
||||
"cordova-plugin-mfp": "^8.0.2021031007",
|
||||
"cordova-plugin-mfp-jsonstore": "^8.0.2021062408",
|
||||
"cordova-plugin-mfp-push": "^8.0.2021062405",
|
||||
@@ -160,7 +164,8 @@
|
||||
"ts-jest-puppeteer": "0.0.5",
|
||||
"ts-node": "~8.3.0",
|
||||
"tslint": "~6.1.0",
|
||||
"typescript": "^4.3.5"
|
||||
"typescript": "^4.3.5",
|
||||
"uk.co.workingedge.cordova.plugin.sqliteporter": "^1.1.1"
|
||||
},
|
||||
"description": "An Ionic project",
|
||||
"cordova": {
|
||||
@@ -184,7 +189,7 @@
|
||||
},
|
||||
"platforms": [
|
||||
"browser",
|
||||
"ios"
|
||||
"android"
|
||||
]
|
||||
},
|
||||
"main": "karma.conf.js",
|
||||
@@ -193,4 +198,4 @@
|
||||
"url": "git+https://Kayaya@bitbucket.org/equilibriumito/gabinete-digital.git"
|
||||
},
|
||||
"license": "ISC"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { DespachoStore } from '../store/despacho-store.service';
|
||||
import { LoaderService } from 'src/app/store/loader.service'
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { PermissionService } from '../services/worker/permission.service';
|
||||
import { SortService } from '../services/functions/sort.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -31,7 +32,8 @@ export class DespachoService {
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
public p: PermissionService,
|
||||
public LoaderService: LoaderService
|
||||
public LoaderService: LoaderService,
|
||||
private sortService: SortService,
|
||||
) { }
|
||||
|
||||
arquivar(note:string, documents:AttachmentList, serialnumber) {
|
||||
@@ -251,7 +253,7 @@ export class DespachoService {
|
||||
|
||||
});
|
||||
|
||||
despachoList = this.sortArrayISODate(despachoList).reverse();
|
||||
despachoList = this.sortService.sortArrayByDate(despachoList).reverse();
|
||||
|
||||
if(updateStore) {
|
||||
this.despachoStore.reset(despachoList);
|
||||
@@ -270,20 +272,21 @@ export class DespachoService {
|
||||
let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||
|
||||
let despachosPr;
|
||||
let despachos = this.sortService.sortArrayByDate(result);
|
||||
switch (SessionStore.user.Profile) {
|
||||
case 'MDGPR':
|
||||
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
break;
|
||||
case 'PR':
|
||||
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any) {
|
||||
/* sortArrayISODate(myArray: any) {
|
||||
return myArray.sort(function(a, b) {
|
||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||
});
|
||||
}
|
||||
} */
|
||||
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import {MatDatepickerModule} from '@angular/material/datepicker';
|
||||
import {MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core';
|
||||
import { NgxMatDateFormats, NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
import { Network } from '@ionic-native/network/ngx';
|
||||
import { File } from '@ionic-native/file/ngx';
|
||||
|
||||
|
||||
import {
|
||||
@@ -55,7 +56,8 @@ import { fab } from '@fortawesome/free-brands-svg-icons'
|
||||
|
||||
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
||||
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
||||
|
||||
import { SQLite } from '@ionic-native/sqlite/ngx';
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
|
||||
@NgModule({
|
||||
declarations: [AppComponent],
|
||||
@@ -107,7 +109,10 @@ import { PdfViewerModule } from 'ng2-pdf-viewer';
|
||||
WebsocketService,
|
||||
ChatService,
|
||||
ScreenOrientation,
|
||||
Network
|
||||
Network,
|
||||
File,
|
||||
SQLite,
|
||||
CookieService
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
|
||||
+33
-18
@@ -16,9 +16,13 @@ import { ExpedienteGdStore } from '../store/expedientegd-store.service';
|
||||
import { InativityService } from '../services/inativity.service';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { StorageService } from '../services/storage.service';
|
||||
import { File } from '@ionic-native/file/ngx';
|
||||
import { WebNotificationPopupService } from '../services/notification/web-notification-popup.service';
|
||||
import { DocumentCounterService } from '../services/worker/document-counter.service';
|
||||
import { PermissionService } from '../services/worker/permission.service';
|
||||
import { Network } from '@ionic-native/network/ngx';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -61,6 +65,8 @@ export class HomePage implements OnInit {
|
||||
|
||||
synchro = synchro
|
||||
|
||||
status: string = "";
|
||||
audioName: string = "";
|
||||
constructor(
|
||||
private zone: NgZone,
|
||||
private router: Router,
|
||||
@@ -74,7 +80,9 @@ export class HomePage implements OnInit {
|
||||
private despachoRule: DespachoService,
|
||||
private inativityService: InativityService,
|
||||
private storageService: StorageService,
|
||||
private webNotificationPopupService: WebNotificationPopupService) {
|
||||
private webNotificationPopupService: WebNotificationPopupService,
|
||||
private network: Network,
|
||||
private backgroundservice: BackgroundService) {
|
||||
|
||||
this.webNotificationPopupService.askNotificationPermission()
|
||||
|
||||
@@ -85,7 +93,7 @@ export class HomePage implements OnInit {
|
||||
window['platform'] = platform
|
||||
window['inactivity/function'] = () => {
|
||||
|
||||
if(window.location.pathname != '/inactivity') {
|
||||
if (window.location.pathname != '/inactivity') {
|
||||
|
||||
const pathname = window.location.pathname
|
||||
SessionStore.setUrlBeforeInactivity(pathname)
|
||||
@@ -100,27 +108,31 @@ export class HomePage implements OnInit {
|
||||
this.router.navigate([url])
|
||||
}
|
||||
|
||||
refreshing() {}
|
||||
refreshing() { }
|
||||
|
||||
ngOnInit() {
|
||||
/* this.network.checkNetworkConnection;
|
||||
this.network.checkNetworkDisconnection; */
|
||||
// console.log('Active route ', this.router.url)
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
/* this.webnotification.webconnection();
|
||||
this.webnotification.onReceviNotificationWeb(); */
|
||||
window.addEventListener('online', () => {
|
||||
console.log('Became online')
|
||||
this.backgroundservice.online()
|
||||
});
|
||||
window.addEventListener('offline', () => {
|
||||
console.log('Became offline')
|
||||
this.backgroundservice.offline()
|
||||
});
|
||||
this.webnotification.webconnection();
|
||||
this.webnotification.register();
|
||||
} else {
|
||||
this.mobilefirstConnect();
|
||||
this.notificationsService.getAndpostToken2();
|
||||
this.notificationsService.onReceviNotification();
|
||||
}
|
||||
|
||||
this.updateList()
|
||||
|
||||
var myWorker = new Worker(new URL('./nice.worker.js', import.meta.url) );
|
||||
var myWorker = new Worker(new URL('./nice.worker.js', import.meta.url));
|
||||
|
||||
myWorker.onmessage = function(oEvent) {
|
||||
myWorker.onmessage = function (oEvent) {
|
||||
console.log('Worker said : ' + oEvent.data);
|
||||
}
|
||||
|
||||
@@ -129,8 +141,10 @@ export class HomePage implements OnInit {
|
||||
|
||||
mobilefirstConnect() {
|
||||
|
||||
if(window['WLAuthorizationManager']) {
|
||||
if(window['WLAuthorizationManager'].obtainAccessToken) {
|
||||
console.log("Mobileconecct");
|
||||
|
||||
if (window['WLAuthorizationManager']) {
|
||||
if (window['WLAuthorizationManager'].obtainAccessToken) {
|
||||
window['WLAuthorizationManager'].obtainAccessToken("").then((token) => {
|
||||
|
||||
console.log('MobileFirst Server connect: Success ' + token);
|
||||
@@ -167,12 +181,13 @@ export class HomePage implements OnInit {
|
||||
this.notificationsService.registerCallback(
|
||||
'despachos',
|
||||
() => {
|
||||
this.despachoRule.getList({updateStore: true})
|
||||
this.despachoRule.getList({ updateStore: true })
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
synchro.registerCallback('Online',()=>{
|
||||
synchro.registerCallback('Online', () => {
|
||||
console.log('Onlineee')
|
||||
|
||||
})
|
||||
|
||||
@@ -183,18 +198,18 @@ export class HomePage implements OnInit {
|
||||
|
||||
synchro.conected
|
||||
|
||||
synchro.registerCallback('Notification', (DataArray)=> {
|
||||
synchro.registerCallback('Notification', (DataArray) => {
|
||||
|
||||
this.webNotificationPopupService.sendNotification(DataArray)
|
||||
|
||||
this.storageService.get('Notifications').then((data:any)=>{
|
||||
data.push(DataArray)
|
||||
this.storageService.store("Notifications", data)
|
||||
}).catch(()=>{
|
||||
}).catch(() => {
|
||||
|
||||
const a = []
|
||||
a.push(DataArray)
|
||||
this.storageService.store("Notifications",a)
|
||||
this.storageService.store("Notifications", a)
|
||||
})
|
||||
|
||||
}, 'any')
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Message')?.invalid && validateFrom ">
|
||||
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Message')?.invalid && validateFrom || validateField ">
|
||||
<ion-textarea class="add-border" placeholder="Descrição" [(ngModel)]="postData.DispatchFolder.Message"></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Add scrolls -->
|
||||
<div class="d-flex flex-column height-100 overflow-y-auto">
|
||||
|
||||
|
||||
<div class="container-div width-100">
|
||||
<div class="ion-item-class-2 width-100">
|
||||
<div class="ion-icon-class">
|
||||
@@ -29,11 +29,11 @@
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Priority')?.invalid && validateFrom" >
|
||||
|
||||
<ion-select
|
||||
placeholder="Prazo*"
|
||||
[(ngModel)]="postData.Priority"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar"
|
||||
<ion-select
|
||||
placeholder="Prazo*"
|
||||
[(ngModel)]="postData.Priority"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar"
|
||||
required
|
||||
class="d-block d-md-none"
|
||||
>
|
||||
@@ -62,19 +62,19 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom ">
|
||||
<!-- <ion-item
|
||||
<!-- <ion-item
|
||||
class="ion-no-border ion-no-padding ion-no-margin d-block d-md-none">
|
||||
<ion-select
|
||||
[(ngModel)]="selectedTypes"
|
||||
(ngModelChange)="onSelectedTypesChanged($event)"
|
||||
(ngModelChange)="onSelectedTypesChanged($event)"
|
||||
multiple="true" interface="alert" Cancel-text="Cancelar" required>
|
||||
<ion-select-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item> -->
|
||||
|
||||
|
||||
<mat-form-field
|
||||
floatLabel="never"
|
||||
appearance="fill"
|
||||
appearance="fill"
|
||||
class="width-100 d-block"
|
||||
appearance="none">
|
||||
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de evento*">
|
||||
@@ -135,21 +135,21 @@
|
||||
</div>
|
||||
<div class="attach-document pl-10">
|
||||
<ion-label>Anexar Documentos</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<div class="list " *ngFor="let document of documents; let i = index" >
|
||||
<div class="list " *ngFor="let document of documents; let i = index" >
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<p class="d-flex ion-justify-content-between">
|
||||
<span class="attach-title-item">{{document.Assunto}}</span>
|
||||
<span class="app-name">{{document.appName}}</span>
|
||||
<p class="d-flex ion-justify-content-between">
|
||||
<span class="attach-title-item">{{document.Assunto}}</span>
|
||||
<span class="app-name">{{document.appName}}</span>
|
||||
<span class="close-button text-black cursor-pointer" (click)="removeAttachment(i)" >
|
||||
<ion-icon class="font-20" src="assets/images/icons-delete-25.svg"></ion-icon>
|
||||
</span>
|
||||
</p>
|
||||
</p>
|
||||
<p><span class="span-left">{{document.EntidadeOrganicaNome}}</span><span class="span-right"> {{document.Data | date: 'dd-MM-yyyy HH:mm'}} </span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
@@ -158,11 +158,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div *ngIf="postData" class="aside-right flex-column height-100">
|
||||
<app-empty-container
|
||||
[texto]="emptyTextDescription"
|
||||
*ngIf="!showAttendees"
|
||||
<app-empty-container
|
||||
[texto]="emptyTextDescription"
|
||||
*ngIf="!showAttendees"
|
||||
class="d-flex height-100 flex-column">
|
||||
</app-empty-container>
|
||||
<app-attendee-modal
|
||||
@@ -187,4 +187,4 @@
|
||||
<button class="btn-cancel" shape="round" (click)="cancelTask()">Cancelar</button>
|
||||
<button class="btn-ok" shape="round" (click)="saveTask()">Gravar</button>
|
||||
</div>
|
||||
</ion-footer>
|
||||
</ion-footer>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
padding: 30px 20px 0 20px !important;
|
||||
margin: 0;
|
||||
float: left;
|
||||
|
||||
|
||||
.title{
|
||||
font-family: Roboto;
|
||||
font-size: 25px;
|
||||
@@ -61,7 +61,7 @@
|
||||
.list-people{
|
||||
width: 256px;
|
||||
float: left;
|
||||
|
||||
|
||||
}
|
||||
.add-people{
|
||||
width: 45px;
|
||||
@@ -78,7 +78,7 @@
|
||||
font-size: 15px;
|
||||
color: #0d89d1;
|
||||
}
|
||||
|
||||
|
||||
.attach-title-item{
|
||||
width: 100%;
|
||||
font-size: 15px;
|
||||
@@ -127,7 +127,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.close-button {
|
||||
@@ -140,13 +140,13 @@
|
||||
.app-name {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
.close-button {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.app-name{
|
||||
background: #42b9f2;
|
||||
border-radius: 18px;
|
||||
|
||||
@@ -73,7 +73,8 @@ export class CreateProcessPage implements OnInit {
|
||||
profile: string;
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
validateFrom = false;
|
||||
validateField = false;
|
||||
|
||||
emptyTextDescription = "Sem intervenientes selecionados";
|
||||
showEmptyContainer = true;
|
||||
@@ -366,18 +367,24 @@ export class CreateProcessPage implements OnInit {
|
||||
}
|
||||
console.log('this.postData', this.postData, this.taskType);
|
||||
|
||||
try {
|
||||
await this.despachoService.createDespacho(this.postData).toPromise();
|
||||
await this.despachoService.CompleteTask({serialNumber: this.task.serialNumber}).toPromise();
|
||||
if(this.postData.DispatchFolder.Message){
|
||||
try {
|
||||
await this.despachoService.createDespacho(this.postData).toPromise();
|
||||
await this.despachoService.CompleteTask({serialNumber: this.task.serialNumber}).toPromise();
|
||||
|
||||
this.modalController.dismiss();
|
||||
this.toastService.successMessage('Despacho criado');
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
} finally {
|
||||
loader.remove()
|
||||
this.modalController.dismiss();
|
||||
this.toastService.successMessage('Despacho criado');
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
} finally {
|
||||
//loader.remove();
|
||||
}
|
||||
}
|
||||
|
||||
else{
|
||||
this.validateField = true;
|
||||
this.toastService.badRequest('Por favor adicione uma nota');
|
||||
}
|
||||
loader.remove();
|
||||
break;
|
||||
case '1': // Pedido de Parecer
|
||||
this.postData = {
|
||||
|
||||
@@ -11,6 +11,7 @@ import { JsonStore } from '../../services/jsonStore.service';
|
||||
import { StorageService } from '../../services/storage.service';
|
||||
import { NotificationsService } from '../../services/notifications.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { EventTrigger } from '../../services/eventTrigger.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-profile',
|
||||
@@ -43,6 +44,7 @@ export class ProfilePage implements OnInit {
|
||||
private notificationservice: NotificationsService,
|
||||
private platform: Platform,
|
||||
private notificationsService: NotificationsService,
|
||||
private eventtrigger: EventTrigger
|
||||
) {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
@@ -200,6 +202,10 @@ export class ProfilePage implements OnInit {
|
||||
|
||||
this.notificationservice.tempClearArray();
|
||||
this.deleteNotification(index);
|
||||
this.eventtrigger.publishSomeData({
|
||||
notification: "deleted"
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<fa-icon icon="chevron-left" class="menu-icon"></fa-icon>
|
||||
</div>
|
||||
|
||||
<div class="middle">
|
||||
<div class="middle add-ellipsis">
|
||||
{{file.title}}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -41,7 +41,9 @@ export class ViewDocumentPage implements OnInit {
|
||||
if(!this.file.title) {
|
||||
this.file.title = 'Sem Título'
|
||||
}
|
||||
|
||||
|
||||
console.log(this.task)
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -72,13 +74,17 @@ export class ViewDocumentPage implements OnInit {
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
if(res.data.component == 'openBookMeetingModal') {
|
||||
this.openBookMeetingModal()
|
||||
} else if(res.data.component == 'openExpedientActionsModal') {
|
||||
this.openExpedientActionsModal(res.data.taskAction)
|
||||
} else {
|
||||
console.log('component not found')
|
||||
|
||||
if(res.data) {
|
||||
if(res.data.component == 'openBookMeetingModal') {
|
||||
this.openBookMeetingModal()
|
||||
} else if(res.data.component == 'openExpedientActionsModal') {
|
||||
this.openExpedientActionsModal(res.data.taskAction)
|
||||
} else {
|
||||
console.log('component not found')
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@@ -106,7 +112,7 @@ export class ViewDocumentPage implements OnInit {
|
||||
}
|
||||
|
||||
// efetuar despacho
|
||||
|
||||
|
||||
async openExpedientActionsModal( taskAction: any) {
|
||||
|
||||
let classs;
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
|
||||
<calendar
|
||||
class="calendar-component"
|
||||
[eventSource]="CalendarStore.eventSource"
|
||||
[eventSource]="listToPresent"
|
||||
[calendarMode]="calendar.mode"
|
||||
[currentDate]="calendar.currentDate"
|
||||
(onEventSelected)="onEventSelected($event)"
|
||||
|
||||
+292
-201
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AlertController, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { AlertController, ModalController, PopoverController, Platform } from '@ionic/angular';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
@@ -12,6 +12,8 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
|
||||
import { Location } from '@angular/common'
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { synchro } from '../../../services/socket/synchro.service';
|
||||
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
||||
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
|
||||
import { ExpedientTaskModalPage } from '../../gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
@@ -46,6 +48,7 @@ export class ViewEventPage implements OnInit {
|
||||
dicIndex = 0;
|
||||
isModal = false
|
||||
header = true
|
||||
synch = synchro;
|
||||
task: ExpedientTaskModalPageNavParamsTask;
|
||||
LoadedDocument:any = null;
|
||||
|
||||
@@ -61,7 +64,11 @@ export class ViewEventPage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
private toastService: ToastService,
|
||||
private location: Location
|
||||
private location: Location,
|
||||
public platform: Platform,
|
||||
private sqliteservice: SqliteService
|
||||
|
||||
|
||||
)
|
||||
{
|
||||
this.isEventEdited = false;
|
||||
@@ -93,9 +100,23 @@ export class ViewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if(synchro.connected === true) {
|
||||
this.loadEvent();
|
||||
console.log('Onlineee view-event')
|
||||
} else {
|
||||
this.sqliteservice.getEventById(this.eventId).then((event) => {
|
||||
this.loadedEvent = event[0];
|
||||
console.log("Event ditails local,", event[0])
|
||||
})
|
||||
console.log('Offlineee')
|
||||
}
|
||||
|
||||
this.loadEvent();
|
||||
|
||||
/* this.sqliteservice.getEventById(this.eventId).then((event) => {
|
||||
this.loadedEvent = event[0];
|
||||
console.log("Event ditails local,", event[0])
|
||||
})
|
||||
this.loadEvent(); */
|
||||
|
||||
|
||||
window.onresize = (event) => {
|
||||
// if not mobile remove all component
|
||||
@@ -137,6 +158,8 @@ export class ViewEventPage implements OnInit {
|
||||
const loader = this.toastService.loading();
|
||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||
this.loadedEvent = res;
|
||||
this.sqliteservice.addEvent(res);
|
||||
console.log('Loaded one event', res)
|
||||
/* this.today = new Date(res.StartDate);
|
||||
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
|
||||
loader.remove()
|
||||
@@ -356,4 +379,26 @@ export class ViewEventPage implements OnInit {
|
||||
modal.onDidDismiss().then( async(res)=>{});
|
||||
|
||||
}
|
||||
|
||||
|
||||
getEventsFromLocalDb() {
|
||||
console.log("event id details ", this.eventId)
|
||||
|
||||
synchro.registerCallback('Online', () => {
|
||||
this.loadEvent();
|
||||
console.log('Onlineee view-event')
|
||||
|
||||
})
|
||||
|
||||
synchro.registerCallback('Offline', () => {
|
||||
this.platform.ready().then(() => {
|
||||
this.sqliteservice.getEventById(this.eventId).then((event) => {
|
||||
this.loadedEvent = event[0];
|
||||
console.log("Event ditails local,", event[0])
|
||||
})
|
||||
console.log('Offlineee')
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,6 +504,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
|
||||
this.chatService.getRoomMessages(roomId).subscribe(async res => {
|
||||
console.log("Chat message",res)
|
||||
|
||||
|
||||
if (res == 502) {
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||
|
||||
<ion-list>
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor="let event of toDayEventStorage.eventsList"
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor="let event of listToPresent"
|
||||
(click)="goToEvent(event.EventId)"
|
||||
>
|
||||
<div class="d-flex content-{{loggeduser.Profile}}-{{event.CalendarName}}">
|
||||
@@ -90,7 +90,7 @@
|
||||
</div>
|
||||
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||
<ion-list>
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor = "let task of expedienteGdStore.list"
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor = "let task of listToPresentexpediente"
|
||||
(click)="goToExpediente(task.SerialNumber)">
|
||||
<div class="item-exp d-flex">
|
||||
<div class="schedule-date">
|
||||
|
||||
@@ -12,10 +12,13 @@ import { EventDetailPage } from './event-detail/event-detail.page';
|
||||
import { ProcessesService } from '../../services/processes.service';
|
||||
import { DailyWorkTask } from '../../models/dailyworktask.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ToDayEventStorage } from 'src/app/store/to-day-event-storage.service';
|
||||
import { ToDayEventStorage } from 'src/app/store/to-day-event-storage.service';
|
||||
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { synchro } from '../../services/socket/synchro.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-events',
|
||||
@@ -29,16 +32,16 @@ export class EventsPage implements OnInit {
|
||||
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
|
||||
customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
|
||||
customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]);
|
||||
|
||||
/* Setting appropriate greeting according to the time */
|
||||
grettings = ["Bom dia", "Boa tarde", "Boa noite"];
|
||||
greetting='';
|
||||
greetting = '';
|
||||
|
||||
timeDate = this.today.getHours() + ":" + this.today.getMinutes();
|
||||
/* Set segment variable */
|
||||
segment:string;
|
||||
public profile:string;
|
||||
segment: string;
|
||||
public profile: string;
|
||||
currentEvent: any;
|
||||
|
||||
eventsList: Event[];
|
||||
@@ -52,81 +55,97 @@ export class EventsPage implements OnInit {
|
||||
combinedEvents: Event[];
|
||||
|
||||
customText = false;
|
||||
totalEvent=0;
|
||||
totalEvent = 0;
|
||||
currentHoursMinutes: Date | string;
|
||||
|
||||
showLoader: boolean;
|
||||
|
||||
taskslist:DailyWorkTask[] = [];
|
||||
expedientList:any;
|
||||
hideSearchBtn: boolean=false;
|
||||
taskslist: DailyWorkTask[] = [];
|
||||
expedientList: any;
|
||||
hideSearchBtn: boolean = false;
|
||||
|
||||
// shared data
|
||||
toDayEventStorage = ToDayEventStorage
|
||||
expedienteGdStore = ExpedienteGdStore
|
||||
|
||||
|
||||
pdfSrc = "https://www.tabularium.pt/file-upload/FSovLiyEa8Hqy2iDA/TK-Justificativo.pdf";
|
||||
listToPresent = [];
|
||||
listToPresentexpediente =[]
|
||||
|
||||
expedienteTaskPipe = new ExpedienteTaskPipe()
|
||||
|
||||
@Output() openExpedientListPage:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() openExpedientListPage: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
loggeduser: LoginUserRespose;
|
||||
|
||||
existingScreenOrientation: string;
|
||||
synch = synchro
|
||||
|
||||
constructor(
|
||||
private eventService: EventsService,
|
||||
private router: Router,
|
||||
private storageService:StorageService,
|
||||
private storageService: StorageService,
|
||||
public activatedRoute: ActivatedRoute,
|
||||
private alertController: AlertService,
|
||||
private authService: AuthService,
|
||||
private processes:ProcessesService,
|
||||
private processes: ProcessesService,
|
||||
/* private gabineteService: GabineteDigitalPage, */
|
||||
private modalController:ModalController,
|
||||
private modalController: ModalController,
|
||||
private screenOrientation: ScreenOrientation,
|
||||
public platform: Platform,
|
||||
) {
|
||||
this.existingScreenOrientation = this.screenOrientation.type;
|
||||
console.log(this.existingScreenOrientation);
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService
|
||||
) {
|
||||
this.existingScreenOrientation = this.screenOrientation.type;
|
||||
console.log(this.existingScreenOrientation);
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
this.prEventList = null;
|
||||
this.prEventList = null;
|
||||
|
||||
this.platform.resize.subscribe(async () => {
|
||||
//console.log('Resize event detected');
|
||||
// console.log('Resize event detected');
|
||||
this.platform.resize.subscribe(async () => {
|
||||
//console.log('Resize event detected');
|
||||
// console.log('Resize event detected');
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
/* if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
try {
|
||||
this.sqliteservice.databaseConn();
|
||||
} catch (error) {
|
||||
console.log("Error creating local database: ", error)
|
||||
}
|
||||
} */
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.segment = "Combinada";
|
||||
this.profile = "mdgpr";
|
||||
|
||||
this.showGreeting();
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.showGreeting();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == '/home/events') {
|
||||
this.RefreshEvents();
|
||||
setTimeout(()=>{
|
||||
this.LoadList();
|
||||
}, 1500)
|
||||
}
|
||||
});
|
||||
this.hideSearch();
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd && event.url == '/home/events') {
|
||||
this.RefreshEvents();
|
||||
setTimeout(() => {
|
||||
this.LoadList();
|
||||
}, 1500)
|
||||
}
|
||||
});
|
||||
this.hideSearch();
|
||||
}
|
||||
|
||||
this.getEventsFromLocalDb();
|
||||
|
||||
//this.checkScreenOrientation();
|
||||
|
||||
}
|
||||
|
||||
hideSearch(){
|
||||
if(this.router.url == '/home/events'){
|
||||
hideSearch() {
|
||||
if (this.router.url == '/home/events') {
|
||||
this.hideSearchBtn = true;
|
||||
}
|
||||
}
|
||||
@@ -142,28 +161,28 @@ export class EventsPage implements OnInit {
|
||||
}
|
||||
|
||||
// Lock to portrait
|
||||
lockToPortrait(){
|
||||
lockToPortrait() {
|
||||
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);
|
||||
console.log('set');
|
||||
}
|
||||
|
||||
// Lock to landscape
|
||||
lockToLandscape(){
|
||||
// Lock to landscape
|
||||
lockToLandscape() {
|
||||
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
|
||||
}
|
||||
|
||||
// Unlock screen orientation
|
||||
unlockScreenOrientation(){
|
||||
// Unlock screen orientation
|
||||
unlockScreenOrientation() {
|
||||
this.screenOrientation.unlock();
|
||||
}
|
||||
|
||||
checkScreenOrientation(){
|
||||
if( window.innerWidth < 701) {
|
||||
checkScreenOrientation() {
|
||||
if (window.innerWidth < 701) {
|
||||
this.lockToPortrait();
|
||||
console.log('was here');
|
||||
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.unlockScreenOrientation();
|
||||
}
|
||||
}
|
||||
@@ -174,43 +193,60 @@ export class EventsPage implements OnInit {
|
||||
|
||||
let date = new Date();
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let start = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
let end = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" 23:59:59";
|
||||
let start = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
let end = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " 23:59:59";
|
||||
|
||||
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
if (this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllMdOficialEvents(start, end).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise();
|
||||
|
||||
const list = mdOficialEvents.concat(mdPessoalEvents);
|
||||
console.log("getAllMdOficialPessoalEvents", list)
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
if(list.length > 0) {
|
||||
list.forEach(element => {
|
||||
this.sqliteservice.addEvent(element)
|
||||
});
|
||||
}
|
||||
}
|
||||
this.listToPresent = list
|
||||
|
||||
this.toDayEventStorage.reset(list)
|
||||
|
||||
if(this.toDayEventStorage.eventsList.length > 0){
|
||||
this.currentEvent = this.toDayEventStorage.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.toDayEventStorage.eventsList[0].StartDate;
|
||||
|
||||
if (list.length > 0) {
|
||||
this.currentEvent = list[0].Subject;
|
||||
this.currentHoursMinutes = list[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = this.toDayEventStorage.eventsList.length;
|
||||
this.totalEvent = list.length;
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
else if (this.loggeduser.Profile == 'PR') {
|
||||
|
||||
let prOficialEvents= await this.eventService.getAllPrOficialEvents(start, end).toPromise();
|
||||
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
|
||||
let prOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
|
||||
let prPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
|
||||
|
||||
const list = prOficialEvents.concat(prPessoalEvents);
|
||||
|
||||
this.toDayEventStorage.reset(list)
|
||||
|
||||
if(this.toDayEventStorage.eventsList.length > 0) {
|
||||
this.currentEvent = this.toDayEventStorage.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.toDayEventStorage.eventsList[0].StartDate;
|
||||
console.log("getAllPrOficialPessoalEvents", list)
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
if(list.length > 0) {
|
||||
list.forEach(element => {
|
||||
this.sqliteservice.addEvent(element)
|
||||
});
|
||||
}
|
||||
}
|
||||
if (list.length > 0) {
|
||||
this.currentEvent = list[0].Subject;
|
||||
this.currentHoursMinutes = list[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = this.toDayEventStorage.eventsList.length;
|
||||
this.listToPresent = list;
|
||||
this.totalEvent = list.length;
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
@@ -286,47 +322,97 @@ export class EventsPage implements OnInit {
|
||||
} */
|
||||
}
|
||||
|
||||
showGreeting(){
|
||||
if(this.today.getHours() >= 6 && this.today.getHours() < 12){
|
||||
getEventsFromLocalDb() {
|
||||
|
||||
if (synchro.connected === true) {
|
||||
this.showGreeting();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd && event.url == '/home/events') {
|
||||
this.RefreshEvents();
|
||||
setTimeout(() => {
|
||||
this.LoadList();
|
||||
}, 1500)
|
||||
}
|
||||
});
|
||||
this.hideSearch();
|
||||
} else {
|
||||
this.platform.ready().then(async () => {
|
||||
this.sqliteservice.getAllEvents().then((event:any[]) => {
|
||||
this.listToPresent = event
|
||||
this.totalEvent = this.listToPresent.length
|
||||
this.currentEvent = this.listToPresent[0].Subject
|
||||
this.currentHoursMinutes = this.listToPresent[0].StartDate
|
||||
console.log("All events from local,", event)
|
||||
})
|
||||
|
||||
this.sqliteservice.getprocessByworkflow("Expediente").then((process: any[]) => {
|
||||
var expedientlist = [];
|
||||
process.forEach((element) => {
|
||||
let task = {
|
||||
CreateDate: element.taskStartDate,
|
||||
DocumentsQty: element.totalDocuments,
|
||||
Senders: JSON.parse(element.workflowInstanceDataFields).Sender,
|
||||
SerialNumber: element.serialNumber,
|
||||
Status: JSON.parse(element.workflowInstanceDataFields).Status,
|
||||
Subject: JSON.parse(element.workflowInstanceDataFields).Subject,
|
||||
WorkflowName: element.workflowDisplayName,
|
||||
activityInstanceName: element.activityInstanceName,
|
||||
taskStartDate: element.taskStartDate,
|
||||
}
|
||||
expedientlist.push(task);
|
||||
})
|
||||
const ExpedienteTask = expedientlist.map(e => this.expedienteTaskPipe.transform(e))
|
||||
this.listToPresentexpediente = ExpedienteTask;
|
||||
|
||||
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
showGreeting() {
|
||||
if (this.today.getHours() >= 6 && this.today.getHours() < 12) {
|
||||
this.greetting = this.grettings[0];
|
||||
}
|
||||
else if(this.today.getHours() >= 12 && this.today.getHours() < 18){
|
||||
else if (this.today.getHours() >= 12 && this.today.getHours() < 18) {
|
||||
this.greetting = this.grettings[1];
|
||||
}
|
||||
else /* if(this.today.getHours() < 6 && this.today.getHours() >= 18) */{
|
||||
else /* if(this.today.getHours() < 6 && this.today.getHours() >= 18) */ {
|
||||
this.greetting = this.grettings[2];
|
||||
}
|
||||
}
|
||||
|
||||
gotTo(){
|
||||
gotTo() {
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
|
||||
changeProfile(){
|
||||
if(this.profile == "mdgpr"){
|
||||
changeProfile() {
|
||||
if (this.profile == "mdgpr") {
|
||||
console.log('pr');
|
||||
this.profile ="pr";
|
||||
this.profile = "pr";
|
||||
this.RefreshEvents();
|
||||
}
|
||||
else{
|
||||
else {
|
||||
console.log('mdgpr');
|
||||
this.profile ="mdgpr";
|
||||
this.profile = "mdgpr";
|
||||
this.RefreshEvents();
|
||||
}
|
||||
}
|
||||
|
||||
logout()
|
||||
{
|
||||
logout() {
|
||||
this.authService.ValidatedUser.BasicAuthKey = "";
|
||||
this.router.navigate(['/home/login']);
|
||||
}
|
||||
|
||||
async openEventDetail1(id:any){
|
||||
async openEventDetail1(id: any) {
|
||||
console.log(id);
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: EventDetailPage,
|
||||
componentProps: {
|
||||
componentProps: {
|
||||
eventId: id,
|
||||
},
|
||||
cssClass: 'event-detail',
|
||||
@@ -340,53 +426,63 @@ export class EventsPage implements OnInit {
|
||||
LoadList() {
|
||||
this.processes.GetTaskListExpediente(false).subscribe(result => {
|
||||
console.log("Expediente", result);
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
|
||||
} else {
|
||||
this.sqliteservice.addProcess(result)
|
||||
}
|
||||
|
||||
const ExpedienteTask = result.map( e=> this.expedienteTaskPipe.transform(e))
|
||||
const ExpedienteTask = result.map(e => this.expedienteTaskPipe.transform(e))
|
||||
|
||||
this.expedienteGdStore.reset(ExpedienteTask)
|
||||
console.log("Expediente 2", ExpedienteTask);
|
||||
|
||||
this.listToPresentexpediente = ExpedienteTask;
|
||||
});
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any){
|
||||
return myArray.sort(function(a, b) {
|
||||
sortArrayISODate(myArray: any) {
|
||||
return myArray.sort(function (a, b) {
|
||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||
});
|
||||
}
|
||||
|
||||
goToEvent(eventId:any){
|
||||
goToEvent(eventId: any) {
|
||||
this.router.navigate(['/home/events', eventId, 'events']);
|
||||
}
|
||||
|
||||
goToExpediente(SerialNumber:any) {
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
goToExpediente(SerialNumber: any) {
|
||||
if (this.loggeduser.Profile == 'MDGPR') {
|
||||
this.router.navigate(['/home/events/expediente', SerialNumber, 'events']);
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
else if (this.loggeduser.Profile == 'PR') {
|
||||
this.router.navigate(['/home/events/expedientes-pr', SerialNumber, 'events']);
|
||||
}
|
||||
}
|
||||
|
||||
viewExpedientListPage(){
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
if( window.innerWidth < 701){
|
||||
viewExpedientListPage() {
|
||||
if (this.loggeduser.Profile == 'MDGPR') {
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"expedientes": true,} };
|
||||
else {
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "expedientes": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
if( window.innerWidth < 701){
|
||||
else if (this.loggeduser.Profile == 'PR') {
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"expedientes-pr": true,} };
|
||||
else {
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "expedientes-pr": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
import { Event } from '../../../../models/event.model';
|
||||
import { MenuController, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { momentG } from 'src/plugin/momentG'
|
||||
import { momentG } from 'src/plugin/momentG'
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||
@@ -20,6 +20,9 @@ import { Location } from '@angular/common'
|
||||
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despacho-pr',
|
||||
templateUrl: './despacho-pr.page.html',
|
||||
@@ -29,7 +32,7 @@ export class DespachoPrPage implements OnInit {
|
||||
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
|
||||
customDate:any;
|
||||
customDate: any;
|
||||
|
||||
task: any;
|
||||
fulltask: any;
|
||||
@@ -52,34 +55,25 @@ export class DespachoPrPage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private despachoService: DespachoService
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if(params["params"].SerialNumber) {
|
||||
this.serialNumber = params["params"].SerialNumber;
|
||||
}
|
||||
if(params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
});
|
||||
private despachoService: DespachoService,
|
||||
private sqliteservice: SqliteService
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if (params["params"].SerialNumber) {
|
||||
this.serialNumber = params["params"].SerialNumber;
|
||||
}
|
||||
if (params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
});
|
||||
|
||||
console.log('DespachoPrPage SerialNumber', this.serialNumber)
|
||||
}
|
||||
console.log('DespachoPrPage SerialNumber', this.serialNumber)
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.profile = "mdgpr";
|
||||
console.log(this.serialNumber);
|
||||
|
||||
this.activateRoute.paramMap.subscribe(paramMap => {
|
||||
if (!paramMap.has('SerialNumber')) {
|
||||
return;
|
||||
}
|
||||
/* this.serialNumber = paramMap.get('SerialNumber'); */
|
||||
this.LoadTaskDetail(this.serialNumber);
|
||||
// this.LoadRelatedEvents(this.serialNumber);
|
||||
});
|
||||
this.LoadTaskDetail(this.serialNumber);
|
||||
// this.LoadRelatedEvents(this.serialNumber);
|
||||
this.getFromDB();
|
||||
}
|
||||
|
||||
close() {
|
||||
@@ -92,12 +86,12 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
|
||||
async LoadTaskDetail(serial: string) {
|
||||
this.processes.GetTask(serial).subscribe((res:fullTask) => {
|
||||
this.processes.GetTask(serial).subscribe((res: fullTask) => {
|
||||
this.task = {
|
||||
"SerialNumber": res.serialNumber,
|
||||
"Folio": res.workflowInstanceDataFields.Subject,
|
||||
"Senders": res.originator.email,
|
||||
"CreateDate": momentG(new Date(res.taskStartDate),'yyyy-MM-dd HH:mm:ss'),
|
||||
"CreateDate": momentG(new Date(res.taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||
"DocumentURL": res.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": res.workflowInstanceDataFields.Sender,
|
||||
"Note": res.workflowInstanceDataFields.TaskMessage || res.workflowInstanceDataFields.Note,
|
||||
@@ -114,32 +108,36 @@ export class DespachoPrPage implements OnInit {
|
||||
console.log(this.task);
|
||||
|
||||
console.log('GetTask', res);
|
||||
this.sqliteservice.updateProcess(res)
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
|
||||
|
||||
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users=>{
|
||||
this.intervenientes = users.filter(user=>{
|
||||
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users => {
|
||||
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialNumber), JSON.stringify(users)).then(() => {
|
||||
console.log('internen despacho pr ')
|
||||
})
|
||||
this.intervenientes = users.filter(user => {
|
||||
return user.Type == 'I';
|
||||
});
|
||||
this.cc = users.filter(user=>{
|
||||
this.cc = users.filter(user => {
|
||||
return user.Type == 'CC';
|
||||
}) || []
|
||||
|
||||
|
||||
if(!this.cc) {
|
||||
this.cc = []
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}, (error)=>{
|
||||
}, (error) => {
|
||||
try {
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
if (error.status == 0) {
|
||||
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
@@ -148,6 +146,71 @@ export class DespachoPrPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
if (synchro.connected === true) {
|
||||
this.activateRoute.paramMap.subscribe(paramMap => {
|
||||
if (!paramMap.has('SerialNumber')) {
|
||||
return;
|
||||
}
|
||||
/* this.serialNumber = paramMap.get('SerialNumber'); */
|
||||
this.LoadTaskDetail(this.serialNumber);
|
||||
// this.LoadRelatedEvents(this.serialNumber);
|
||||
});
|
||||
this.LoadTaskDetail(this.serialNumber);
|
||||
// this.LoadRelatedEvents(this.serialNumber);
|
||||
|
||||
} else {
|
||||
this.sqliteservice.getProcessById(this.serialNumber).then((process: any[]) => {
|
||||
console.log('OFFLINE', process)
|
||||
this.task = {
|
||||
"SerialNumber": process[0].serialNumber,
|
||||
"Folio": JSON.parse(process[0].workflowInstanceDataFields).Subject,
|
||||
"Senders": JSON.parse(process[0].originator).email,
|
||||
"CreateDate": momentG(new Date(process[0].taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||
"DocumentURL": JSON.parse(process[0].workflowInstanceDataFields).ViewerRequest,
|
||||
"Remetente": JSON.parse(process[0].workflowInstanceDataFields).Sender,
|
||||
"Note": JSON.parse(process[0].workflowInstanceDataFields).TaskMessage || JSON.parse(process[0].workflowInstanceDataFields).Note,
|
||||
"FolderId": JSON.parse(process[0].workflowInstanceDataFields).FolderID,
|
||||
"FsId": '361',
|
||||
"DocId": JSON.parse(process[0].workflowInstanceDataFields).DispatchDocId,
|
||||
"WorkflowName": process[0].workflowDisplayName,
|
||||
"DeadlineType": JSON.parse(process[0].workflowInstanceDataFields).DeadlineType,
|
||||
"activityInstanceName": process[0].activityInstanceName,
|
||||
}
|
||||
console.log("OFFLINE TASK", this.task)
|
||||
let fulltak = {
|
||||
Documents: JSON.parse(process[0].Documents),
|
||||
actions: JSON.parse(process[0].actions),
|
||||
activityInstanceName: process[0].activityInstanceName,
|
||||
formURL: process[0].formURL,
|
||||
originator: JSON.parse(process[0].originator),
|
||||
serialNumber: process[0].serialNumber,
|
||||
taskStartDate: process[0].taskStartDate,
|
||||
totalDocuments: process[0].totalDocuments,
|
||||
workflowDisplayName: process[0].workflowDisplayName,
|
||||
workflowID: process[0].workflowID,
|
||||
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||
workflowInstanceID: process[0].workflowInstanceID,
|
||||
workflowName: process[0].workflowName
|
||||
}
|
||||
this.fulltask = fulltak;
|
||||
console.log(this.task);
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
|
||||
this.intervenientes = JSON.parse(process[0].interveners).filter(user => {
|
||||
return user.Type == 'I';
|
||||
});
|
||||
this.cc = JSON.parse(process[0].interveners).filter(user => {
|
||||
return user.Type == 'CC';
|
||||
});
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async viewDocument(DocId:string, Document) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
@@ -162,12 +225,13 @@ export class DespachoPrPage implements OnInit {
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
|
||||
}
|
||||
|
||||
openMenu() {
|
||||
@@ -175,7 +239,7 @@ export class DespachoPrPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
async executado(note:string, documents:any) {
|
||||
async executado(note: string, documents: any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Conhecimento",
|
||||
@@ -183,7 +247,7 @@ export class DespachoPrPage implements OnInit {
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
"AttachmentList": documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
@@ -192,7 +256,7 @@ export class DespachoPrPage implements OnInit {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.toastService.successMessage()
|
||||
} catch(error) {
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
finally {
|
||||
@@ -201,7 +265,7 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async arquivar(note:string, documents:any){
|
||||
async arquivar(note: string, documents: any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Arquivo",
|
||||
@@ -209,7 +273,7 @@ export class DespachoPrPage implements OnInit {
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
"AttachmentList": documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
@@ -228,7 +292,7 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async generateDiploma(note:string, documents:any){
|
||||
async generateDiploma(note: string, documents: any) {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
@@ -250,7 +314,7 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async concluir(note:string, documents:any){
|
||||
async concluir(note: string, documents: any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Executado",
|
||||
@@ -258,7 +322,7 @@ export class DespachoPrPage implements OnInit {
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
"AttachmentList": documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
@@ -277,7 +341,7 @@ export class DespachoPrPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
async reexecutar(note:string, documents:any) {
|
||||
async reexecutar(note: string, documents: any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Reexecutar",
|
||||
@@ -285,7 +349,7 @@ export class DespachoPrPage implements OnInit {
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
"AttachmentList": documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
@@ -307,27 +371,27 @@ export class DespachoPrPage implements OnInit {
|
||||
return new Date(e).toDateString()
|
||||
}
|
||||
|
||||
sendExpedienteToPending(){
|
||||
this.processes.SetTaskToPending(this.serialNumber).subscribe(res=>{
|
||||
sendExpedienteToPending() {
|
||||
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
|
||||
this.popoverController.dismiss('close')
|
||||
this.toastService.successMessage('Processo enviado para pendentes')
|
||||
this.goBack()
|
||||
},()=>{
|
||||
}, () => {
|
||||
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
});
|
||||
}
|
||||
|
||||
async openAddNoteModal(actionName:string) {
|
||||
async openAddNoteModal(actionName: string) {
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'add-note-modal-no-height'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: AddNotePage,
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
showAttachmentBtn: true,
|
||||
},
|
||||
cssClass: classs,
|
||||
@@ -336,9 +400,9 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then( async (res) => {
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
console.log(res);
|
||||
if(res.data) {
|
||||
if (res.data) {
|
||||
|
||||
const DocumentToSave = res.data.documents.map((e) => {
|
||||
return {
|
||||
@@ -352,19 +416,19 @@ export class DespachoPrPage implements OnInit {
|
||||
Attachments: DocumentToSave,
|
||||
}
|
||||
|
||||
if(actionName == 'Executado'){
|
||||
if (actionName == 'Executado') {
|
||||
await this.executado(res.data.note, docs);
|
||||
}
|
||||
else if(actionName == 'Arquivar'){
|
||||
else if (actionName == 'Arquivar') {
|
||||
await this.arquivar(res.data.note, docs);
|
||||
}
|
||||
else if(actionName == 'Gerar Diploma'){
|
||||
else if (actionName == 'Gerar Diploma') {
|
||||
await this.generateDiploma(res.data.note, docs);
|
||||
}
|
||||
else if(actionName == 'Concluido'){
|
||||
else if (actionName == 'Concluido') {
|
||||
await this.concluir(res.data.note, docs);
|
||||
}
|
||||
else if(actionName == 'Reexecução'){
|
||||
else if (actionName == 'Reexecução') {
|
||||
await this.reexecutar(res.data.note, docs);
|
||||
}
|
||||
this.goBack();
|
||||
@@ -375,9 +439,9 @@ export class DespachoPrPage implements OnInit {
|
||||
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||
//this.modalController.dismiss();
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
@@ -391,9 +455,9 @@ export class DespachoPrPage implements OnInit {
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
modal.onDidDismiss().then(res => {
|
||||
console.log(res['data']);
|
||||
if(res['data']=='openDiscart'){
|
||||
if (res['data'] == 'openDiscart') {
|
||||
console.log('open discart');
|
||||
this.distartExpedientModal();
|
||||
}
|
||||
@@ -403,10 +467,10 @@ export class DespachoPrPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async distartExpedientModal2(task: any){
|
||||
async distartExpedientModal2(task: any) {
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
componentProps: {
|
||||
serialNumber: task.serialNumber,
|
||||
folderId: task.workflowInstanceDataFields.FolderID,
|
||||
action: 'discart',
|
||||
@@ -421,9 +485,9 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
async openBookMeetingModal(task: any) {
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
@@ -440,9 +504,9 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
async openDelegarModal(task: any) {
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
@@ -457,11 +521,11 @@ export class DespachoPrPage implements OnInit {
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
async distartExpedientModal(){
|
||||
async distartExpedientModal() {
|
||||
console.log(this.fulltask);
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
componentProps: {
|
||||
serialNumber: this.fulltask.serialNumber,
|
||||
folderId: this.fulltask.workflowInstanceDataFields.FolderID,
|
||||
action: 'complete',
|
||||
@@ -471,8 +535,8 @@ export class DespachoPrPage implements OnInit {
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
if(res['data']=='close'){
|
||||
modal.onDidDismiss().then(res => {
|
||||
if (res['data'] == 'close') {
|
||||
this.close();
|
||||
/* console.log('2Expedient Discard closed2');
|
||||
this.close();
|
||||
@@ -488,7 +552,7 @@ export class DespachoPrPage implements OnInit {
|
||||
componentProps: {
|
||||
task: this.task,
|
||||
fulltask: this.fulltask,
|
||||
taskAction:taskAction,
|
||||
taskAction: taskAction,
|
||||
showEnviarPendentes: false
|
||||
},
|
||||
translucent: true
|
||||
@@ -496,11 +560,11 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
await popover.present();
|
||||
|
||||
popover.onDidDismiss().then(( res =>{
|
||||
popover.onDidDismiss().then((res => {
|
||||
|
||||
if (res['data'] == 'close') {
|
||||
this.goBack()
|
||||
|
||||
if( res['data'] == 'close') {
|
||||
this.goBack()
|
||||
|
||||
}
|
||||
|
||||
}))
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="loggeduser.Profile =='MDGPR'" class="bottom-title d-flex"><h3 class="bottom-text">Presidente da República</h3></div>
|
||||
<!-- <div *ngIf="loggeduser.Profile =='MDGPR'" class="bottom-title d-flex">
|
||||
<h3 class="bottom-text">Presidente da República</h3>
|
||||
</div> -->
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
|
||||
@@ -32,8 +34,8 @@
|
||||
<div >
|
||||
<ion-list>
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of despachoprstore.list; let i = index"
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of listToPresent; let i = index"
|
||||
(click)="goToDespachoPr(task.SerialNumber)"
|
||||
>
|
||||
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
|
||||
@@ -66,14 +68,14 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div
|
||||
*ngIf="!skeletonLoader && despachoprstore.list.length == 0"
|
||||
<div
|
||||
*ngIf="!skeletonLoader && listToPresent.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
|
||||
<!-- <div *ngIf="skeletonLoader && despachoprstore.list.length == 0">
|
||||
<!-- <div *ngIf="skeletonLoader && listToPresent.length == 0">
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-thumbnail slot="end">
|
||||
|
||||
@@ -17,6 +17,10 @@ import { NavigationEnd, NavigationExtras, NavigationStart, Router } from '@angul
|
||||
import { __awaiter } from 'tslib';
|
||||
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despachos-pr',
|
||||
templateUrl: './despachos-pr.page.html',
|
||||
@@ -26,61 +30,49 @@ export class DespachosPrPage implements OnInit {
|
||||
|
||||
@ViewChild(CalendarComponent) myCal: CalendarComponent;
|
||||
|
||||
taskslist:DailyWorkTask[] = [];
|
||||
despachoList:any[] = [];
|
||||
deferimentoList:DailyWorkTask[] = [];
|
||||
taskslist: DailyWorkTask[] = [];
|
||||
despachoList: any[] = [];
|
||||
deferimentoList: DailyWorkTask[] = [];
|
||||
|
||||
taskList: customTask[] = [];
|
||||
|
||||
taskType: string;
|
||||
serialNumber:string;
|
||||
totalDocs:any;
|
||||
serialNumber: string;
|
||||
totalDocs: any;
|
||||
|
||||
profile:string;
|
||||
segment:string;
|
||||
profile: string;
|
||||
segment: string;
|
||||
|
||||
// @Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
loadedAttachments:any;
|
||||
loadedAttachments: any;
|
||||
dicIndex = 0;
|
||||
inicial = false
|
||||
|
||||
loggeduser: LoginUserRespose;
|
||||
skeletonLoader = true
|
||||
despachoprstore = DespachosprStore
|
||||
listToPresent = [];
|
||||
|
||||
constructor (
|
||||
private processes:ProcessesService,
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
private authService: AuthService,
|
||||
private router: Router,
|
||||
) {
|
||||
private sqliteservice: SqliteService,
|
||||
private sortService: SortService,
|
||||
) {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.profile = 'mdgpr';
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.profile = 'mdgpr';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
//Inicializar segment
|
||||
this.segment = "despachos";
|
||||
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
|
||||
this.LoadList()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.doRefresh()
|
||||
} else {
|
||||
this.LoadList()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.getFromDB();
|
||||
}
|
||||
|
||||
segmentChanged(ev: any) {
|
||||
@@ -88,15 +80,15 @@ export class DespachosPrPage implements OnInit {
|
||||
this.LoadList();
|
||||
}
|
||||
|
||||
goToDespachoPr(serialNumber:any){
|
||||
this.router.navigate(['/home/gabinete-digital/despachos-pr',serialNumber,'gabinete-digital']);
|
||||
goToDespachoPr(serialNumber: any) {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos-pr', serialNumber, 'gabinete-digital']);
|
||||
}
|
||||
|
||||
notImplemented(){
|
||||
notImplemented() {
|
||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||||
}
|
||||
|
||||
openExpedientDetailPage(data){
|
||||
openExpedientDetailPage(data) {
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
@@ -110,73 +102,130 @@ export class DespachosPrPage implements OnInit {
|
||||
console.log(result);
|
||||
|
||||
let despachosPr;
|
||||
let despachos = this.sortService.sortArrayByDate(result);
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
despachosPr = await result.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
break;
|
||||
case 'PR':
|
||||
console.log(result);
|
||||
|
||||
despachosPr = await result.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
break;
|
||||
}
|
||||
|
||||
console.log(despachosPr);
|
||||
despachosPr = despachosPr.filter(data => data.workflowInstanceDataFields.Status == "Active");
|
||||
|
||||
despachosPr.forEach( (element, index) => {
|
||||
despachosPr.forEach((element, index) => {
|
||||
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
"CreateDate": taskDate,
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
}
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
"CreateDate": taskDate,
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
}
|
||||
|
||||
this.despachoList.push(task);
|
||||
console.log(this.despachoList);
|
||||
});
|
||||
this.despachoprstore.reset(this.despachoList);
|
||||
this.listToPresent = this.despachoList
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any) {
|
||||
return myArray.sort(function(a, b) {
|
||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||
getFromDB() {
|
||||
if (synchro.connected === true) {
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
|
||||
this.LoadList()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.doRefresh()
|
||||
} else {
|
||||
this.LoadList()
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.sqliteservice.getAllProcess().then((all) => {
|
||||
console.log('DESPACHO PR ALL', all)
|
||||
})
|
||||
this.sqliteservice.getprocessByworkflow('Despacho do Presidente da República').then(async (process: any[]) => {
|
||||
console.log('DESPACHO PR', process)
|
||||
|
||||
let despachosPr;
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
break;
|
||||
case 'PR':
|
||||
console.log(process);
|
||||
|
||||
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||
break;
|
||||
}
|
||||
|
||||
despachosPr = despachosPr.filter(data => JSON.parse(data.workflowInstanceDataFields).Status == "Active");
|
||||
despachosPr.forEach((element, index) => {
|
||||
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": JSON.parse(element.workflowInstanceDataFields).Subject,
|
||||
"Senders": JSON.parse(element.workflowInstanceDataFields).Sender,
|
||||
"CreateDate": taskDate,
|
||||
"DocumentURL": JSON.parse(element.workflowInstanceDataFields).ViewerRequest,
|
||||
"Remetente": JSON.parse(element.workflowInstanceDataFields).Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"DocId": JSON.parse(element.workflowInstanceDataFields).DocIdDiferimento,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
}
|
||||
|
||||
this.despachoList.push(task);
|
||||
console.log(this.despachoList);
|
||||
});
|
||||
this.listToPresent = this.despachoList;
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
doRefresh() {
|
||||
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
this.LoadList();
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
|
||||
async viewExpedientDetail(serialNumber:any) {
|
||||
async viewExpedientDetail(serialNumber: any) {
|
||||
console.log(this.profile);
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop'
|
||||
}
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: DespachoPage,
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
enterAnimation: "",
|
||||
serialNumber: serialNumber,
|
||||
profile: this.profile,
|
||||
@@ -184,7 +233,7 @@ export class DespachosPrPage implements OnInit {
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
modal.onDidDismiss().then((res) => {
|
||||
console.log('refresh list');
|
||||
this.LoadList();
|
||||
});
|
||||
@@ -193,7 +242,7 @@ export class DespachosPrPage implements OnInit {
|
||||
|
||||
async openBookMeetingModal(task: customFullTask) {
|
||||
|
||||
const doc = this.loadedAttachments[ this.dicIndex];
|
||||
const doc = this.loadedAttachments[this.dicIndex];
|
||||
|
||||
task = {
|
||||
serialNumber: doc.SourceId,
|
||||
@@ -208,9 +257,9 @@ export class DespachosPrPage implements OnInit {
|
||||
}
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800) {
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
<h5 *ngIf="intervenientes">Intervenientes</h5>
|
||||
<ion-item class="ion-no-margin ion-no-padding">
|
||||
<ion-label>
|
||||
<div *ngFor="let interveniente of intervenientes">
|
||||
<p>{{interveniente.Name}}</p>
|
||||
<div *ngFor="let task of intervenientes">
|
||||
<p>{{task.Name}}</p>
|
||||
</div>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Event } from '../../../../models/event.model';
|
||||
import { MenuController, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { momentG } from 'src/plugin/momentG'
|
||||
import { momentG } from 'src/plugin/momentG'
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||
@@ -19,6 +19,10 @@ import { AttachmentList } from 'src/app/models/Excludetask';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despacho',
|
||||
templateUrl: './despacho.page.html',
|
||||
@@ -28,20 +32,22 @@ export class DespachoPage implements OnInit {
|
||||
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
|
||||
customDate:any;
|
||||
customDate: any;
|
||||
|
||||
// task: customTask;
|
||||
task;
|
||||
|
||||
attachments:any;
|
||||
attachments: any;
|
||||
fulltask: any;
|
||||
eventsList: Event[] = [];
|
||||
serialnumber: string;
|
||||
caller:string;
|
||||
caller: string;
|
||||
profile: string;
|
||||
intervenientes: any;
|
||||
cc: any = [];
|
||||
|
||||
synch = synchro;
|
||||
|
||||
constructor(private activateRoute: ActivatedRoute,
|
||||
private processes: ProcessesService,
|
||||
private iab: InAppBrowser,
|
||||
@@ -52,13 +58,17 @@ export class DespachoPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private despachoService: DespachoService,
|
||||
private location: Location,
|
||||
public p: PermissionService) {
|
||||
|
||||
public p: PermissionService,
|
||||
private sqliteservice: SqliteService,
|
||||
private platform: Platform
|
||||
|
||||
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if(params["params"].SerialNumber) {
|
||||
if (params["params"].SerialNumber) {
|
||||
this.serialnumber = params["params"].SerialNumber;
|
||||
}
|
||||
if(params["params"].caller) {
|
||||
if (params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
});
|
||||
@@ -71,8 +81,8 @@ export class DespachoPage implements OnInit {
|
||||
return;
|
||||
}
|
||||
});
|
||||
this.getFromDb()
|
||||
|
||||
this.LoadTaskDetail(this.serialnumber)
|
||||
}
|
||||
|
||||
close() {
|
||||
@@ -112,13 +122,13 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
|
||||
async LoadTaskDetail(serial: string) {
|
||||
this.processes.GetTask(serial).subscribe( (res: fullTask) => {
|
||||
|
||||
this.processes.GetTask(serial).subscribe((res: fullTask) => {
|
||||
console.log('despacho detail', res)
|
||||
this.task = {
|
||||
"SerialNumber": res.serialNumber,
|
||||
"Folio": res.workflowInstanceDataFields.Subject,
|
||||
"Senders": res.originator.email,
|
||||
"CreateDate": momentG(new Date(res.taskStartDate),'yyyy-MM-dd HH:mm:ss'),
|
||||
"CreateDate": momentG(new Date(res.taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||
"DocumentURL": res.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": res.workflowInstanceDataFields.Sender,
|
||||
"Note": res.workflowInstanceDataFields.TaskMessage || res.workflowInstanceDataFields.Note,
|
||||
@@ -131,27 +141,33 @@ export class DespachoPage implements OnInit {
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
"Status": res.workflowInstanceDataFields.Status,
|
||||
}
|
||||
|
||||
this.sqliteservice.updateProcess(res);
|
||||
this.fulltask = res;
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
|
||||
this.processes.GetTaskParticipants(this.task.FolderID).subscribe(users=>{
|
||||
this.processes.GetTaskParticipants(this.task.FolderID).subscribe(users => {
|
||||
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialnumber), JSON.stringify(users))
|
||||
console.log('interveniers online', users)
|
||||
|
||||
this.intervenientes = users.filter(user=>{
|
||||
this.intervenientes = users.filter(user => {
|
||||
console.log('interveniers online 2', users)
|
||||
return user.Type == 'I';
|
||||
});
|
||||
this.cc = users.filter(user=>{
|
||||
this.cc = users.filter(user => {
|
||||
console.log('interveniers online 3', users)
|
||||
return user.Type == 'CC';
|
||||
});
|
||||
});
|
||||
}, (error)=>{
|
||||
}, (error) => {
|
||||
try {
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
this.location.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
if (error.status == 0) {
|
||||
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
@@ -160,8 +176,85 @@ export class DespachoPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getFromDb() {
|
||||
if (synchro.connected === true) {
|
||||
this.LoadTaskDetail(this.serialnumber)
|
||||
}
|
||||
|
||||
if (synchro.connected === false) {
|
||||
this.platform.ready().then(() => {
|
||||
this.sqliteservice.getProcessById(this.serialnumber).then((process) => {
|
||||
|
||||
var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
||||
var intervine = JSON.parse(process[0].interveners)
|
||||
var origina
|
||||
if (process[0].originator === "undefined") {
|
||||
origina = ""
|
||||
} else {
|
||||
origina = JSON.parse(process[0].originator)
|
||||
}
|
||||
|
||||
console.log('sqlite', process)
|
||||
|
||||
this.task = {
|
||||
"SerialNumber": process[0].serialNumber,
|
||||
"Folio": workflow.Subject,
|
||||
"Senders": origina.email || process[0].originator,
|
||||
"CreateDate": momentG(new Date(process[0].taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||
"DocumentURL": workflow.ViewerRequest,
|
||||
"Remetente": workflow.Sender,
|
||||
"Note": workflow.TaskMessage || workflow.Note,
|
||||
"FolderId": workflow.FolderID,
|
||||
"FsId": workflow.FsId,
|
||||
"DocId": workflow.DocID,
|
||||
"DocumentsQty": process[0].DocumentsQty,
|
||||
"WorkflowName": process[0].workflowDisplayName,
|
||||
"DeadlineType": workflow.DeadlineType,
|
||||
"activityInstanceName": process[0].activityInstanceName,
|
||||
"Status": workflow.Status,
|
||||
}
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
|
||||
let fulltak = {
|
||||
Documents: JSON.parse(process[0].Documents),
|
||||
actions: JSON.parse(process[0].actions),
|
||||
activityInstanceName: process[0].activityInstanceName,
|
||||
formURL: process[0].formURL,
|
||||
originator: JSON.parse(process[0].originator),
|
||||
serialNumber: process[0].serialNumber,
|
||||
taskStartDate: process[0].taskStartDate,
|
||||
totalDocuments: process[0].totalDocuments,
|
||||
workflowDisplayName: process[0].workflowDisplayName,
|
||||
workflowID: process[0].workflowID,
|
||||
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||
workflowInstanceID: process[0].workflowInstanceID,
|
||||
workflowName: process[0].workflowName
|
||||
}
|
||||
this.fulltask = fulltak;
|
||||
|
||||
console.log('interveniers offline', intervine)
|
||||
this.intervenientes = intervine.filter(user => {
|
||||
console.log('interveniers offline 2', user)
|
||||
return user.Type == 'I';
|
||||
});
|
||||
this.cc = intervine.filter(user => {
|
||||
console.log('interveniers offline 3', user)
|
||||
return user.Type == 'CC';
|
||||
});
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async viewDocument(docId:string, Document) {
|
||||
|
||||
|
||||
console.log(this.fulltask)
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
@@ -188,7 +281,7 @@ export class DespachoPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
async executado(note:string, documents:any) {
|
||||
async executado(note: string, documents: any) {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
@@ -196,7 +289,7 @@ export class DespachoPage implements OnInit {
|
||||
await this.despachoService.executado(note, documents, this.serialnumber).toPromise();
|
||||
this.toastService.successMessage('Processo criado')
|
||||
this.close();
|
||||
} catch(error) {
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Processo não criado")
|
||||
}
|
||||
finally {
|
||||
@@ -204,12 +297,12 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async arquivar(note:string, documents: AttachmentList) {
|
||||
async arquivar(note: string, documents: AttachmentList) {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.despachoService.arquivar(note, documents,this.serialnumber).toPromise()
|
||||
await this.despachoService.arquivar(note, documents, this.serialnumber).toPromise()
|
||||
this.toastService.successMessage('Processo descartado')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
@@ -221,7 +314,7 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async reexecute(note:string, documents:any) {
|
||||
async reexecute(note: string, documents: any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Reexecução",
|
||||
@@ -229,7 +322,7 @@ export class DespachoPage implements OnInit {
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
"AttachmentList": documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
@@ -254,26 +347,26 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
async sendExpedienteToPending() {
|
||||
|
||||
this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res=>{
|
||||
this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res => {
|
||||
this.goBack();
|
||||
this.toastService.successMessage()
|
||||
},
|
||||
error => {
|
||||
this.toastService.badRequest("Processo não enviado para despacho")
|
||||
});
|
||||
error => {
|
||||
this.toastService.badRequest("Processo não enviado para despacho")
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async openAddNoteModal(actionName:string) {
|
||||
async openAddNoteModal(actionName: string) {
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'add-note-modal-no-height'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: AddNotePage,
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
showAttachmentBtn: true,
|
||||
},
|
||||
cssClass: classs,
|
||||
@@ -282,8 +375,8 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then( async (res) => {
|
||||
if(res.data){
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
if (res.data) {
|
||||
|
||||
const DocumentToSave = res.data.documents.map((e) => {
|
||||
return {
|
||||
@@ -297,16 +390,16 @@ export class DespachoPage implements OnInit {
|
||||
Attachments: DocumentToSave,
|
||||
}
|
||||
|
||||
if(actionName == 'Executado'){
|
||||
if (actionName == 'Executado') {
|
||||
|
||||
await this.executado(res.data.note, docs);
|
||||
this.goBack();
|
||||
}
|
||||
else if(actionName == 'Arquivar'){
|
||||
else if (actionName == 'Arquivar') {
|
||||
await this.arquivar(res.data.note, docs);
|
||||
this.goBack();
|
||||
}
|
||||
else if(actionName == 'Reexecução'){
|
||||
else if (actionName == 'Reexecução') {
|
||||
await this.reexecute(res.data.note, docs);
|
||||
this.goBack();
|
||||
}
|
||||
@@ -317,9 +410,9 @@ export class DespachoPage implements OnInit {
|
||||
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800) {
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
@@ -333,10 +426,10 @@ export class DespachoPage implements OnInit {
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
console.log(res['data']);
|
||||
|
||||
if(res['data']=='openDiscart'){
|
||||
if (res['data'] == 'openDiscart') {
|
||||
await this.distartExpedientModal();
|
||||
}
|
||||
|
||||
@@ -346,9 +439,9 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
async openBookMeetingModal(task: any) {
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
@@ -365,9 +458,9 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
async openDelegarModal(task: any) {
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
@@ -379,7 +472,7 @@ export class DespachoPage implements OnInit {
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
modal.onDidDismiss().then(res => {
|
||||
this.goBack();
|
||||
});
|
||||
}
|
||||
@@ -388,7 +481,7 @@ export class DespachoPage implements OnInit {
|
||||
console.log(this.fulltask);
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
componentProps: {
|
||||
serialNumber: this.fulltask.serialNumber,
|
||||
folderId: this.fulltask.workflowInstanceDataFields.FolderID,
|
||||
action: 'complete',
|
||||
@@ -398,8 +491,8 @@ export class DespachoPage implements OnInit {
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
if(res['data']=='close'){
|
||||
modal.onDidDismiss().then(res => {
|
||||
if (res['data'] == 'close') {
|
||||
this.close();
|
||||
/* console.log('2Expedient Discard closed2');
|
||||
this.close();
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<ion-list>
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of despachoStore.list; let i = index"
|
||||
*ngFor = "let task of listToPresent; let i = index"
|
||||
(click)="GoToDespacho(task.SerialNumber)"
|
||||
>
|
||||
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
|
||||
@@ -68,13 +68,13 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
*ngIf="!skeletonLoader && despachoStore.list.length == 0"
|
||||
*ngIf="!skeletonLoader && listToPresent.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="skeletonLoader && despachoStore.list.length == 0">
|
||||
<div *ngIf="skeletonLoader && listToPresent.length == 0">
|
||||
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
|
||||
@@ -3,6 +3,11 @@ import { NavigationStart, Router } from '@angular/router';
|
||||
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||
import { DespachoStore } from 'src/app/store/despacho-store.service';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { isThisHour } from 'date-fns';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despachos',
|
||||
templateUrl: './despachos.page.html',
|
||||
@@ -12,29 +17,21 @@ import { DespachoStore } from 'src/app/store/despacho-store.service';
|
||||
export class DespachosPage implements OnInit {
|
||||
|
||||
despachoStore = DespachoStore;
|
||||
synch = synchro;
|
||||
listToPresent = [];
|
||||
|
||||
constructor (
|
||||
constructor(
|
||||
private router: Router,
|
||||
private despachoRule: DespachoService
|
||||
) {}
|
||||
private despachoRule: DespachoService,
|
||||
private sqliteservice: SqliteService,
|
||||
private platform: Platform
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
|
||||
this.LoadList()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.refreshing()
|
||||
} else {
|
||||
this.LoadList()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.getFromDb()
|
||||
}
|
||||
|
||||
async refreshing() {
|
||||
@@ -49,7 +46,60 @@ export class DespachosPage implements OnInit {
|
||||
|
||||
async LoadList() {
|
||||
|
||||
await this.despachoRule.getList({updateStore: true})
|
||||
await this.despachoRule.getList({ updateStore: true }).then((pre) => {
|
||||
this.listToPresent = pre;
|
||||
console.log('despachooo', pre)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
getFromDb() {
|
||||
if (synchro.connected === true) {
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
|
||||
this.LoadList()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.refreshing()
|
||||
} else {
|
||||
this.LoadList()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (synchro.connected === false) {
|
||||
this.platform.ready().then(() => {
|
||||
this.sqliteservice.getDespachosProcess('Tarefa de Despacho').then((process: any[]) => {
|
||||
var listtopresent = [];
|
||||
process.forEach(element => {
|
||||
var workflow = JSON.parse(element.workflowInstanceDataFields);
|
||||
let task = {
|
||||
"CreateDate": element.taskStartDate,
|
||||
"DocId": workflow.DispatchDocID,
|
||||
"DocumentURL": undefined,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"FolderID": workflow.FolderID,
|
||||
"Folio": workflow.Subject,
|
||||
"Remetente": undefined,
|
||||
"Senders": workflow.Sender,
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Status": workflow.Status,
|
||||
"WorkflowName": element.workflowDisplayName
|
||||
}
|
||||
|
||||
listtopresent.push(task);
|
||||
|
||||
});
|
||||
|
||||
this.listToPresent = listtopresent;
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
get skeletonLoader(): boolean {
|
||||
@@ -64,9 +114,8 @@ export class DespachosPage implements OnInit {
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
async GoToDespacho(serialNumber:any) {
|
||||
console.log('Despachos serial',serialNumber)
|
||||
this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']);
|
||||
async GoToDespacho(serialNumber: any) {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos', serialNumber, 'gabinete-digital']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-2
@@ -149,12 +149,13 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
|
||||
}
|
||||
|
||||
getDocumentDetails(forlderId:string, applicationId:string) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { DiplomaPage } from 'src/app/pages/gabinete-digital/diplomas/diploma/diploma.page';
|
||||
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-diplomas-assinar',
|
||||
@@ -31,6 +32,7 @@ export class DiplomasAssinarPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
private router: Router,
|
||||
private sortService: SortService,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -39,7 +41,7 @@ export class DiplomasAssinarPage implements OnInit {
|
||||
const pathname = location.pathname + location.search
|
||||
|
||||
this.LoadList()
|
||||
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
|
||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
@@ -78,8 +80,7 @@ export class DiplomasAssinarPage implements OnInit {
|
||||
this.diplomasList = [];
|
||||
|
||||
let diplomasAssinar = diplomas.reverse().filter(data => data.activityInstanceName == "Assinar Diploma");
|
||||
console.log(diplomasAssinar);
|
||||
|
||||
diplomasAssinar = this.sortService.sortArrayByDate(diplomasAssinar);
|
||||
diplomasAssinar.forEach(element => {
|
||||
let task: customTask = this.customTaskPipe.transform(element)
|
||||
this.diplomasList.push(task);
|
||||
|
||||
@@ -13,6 +13,9 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Location } from '@angular/common';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-diploma',
|
||||
templateUrl: './diploma.page.html',
|
||||
@@ -43,6 +46,7 @@ export class DiplomaPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private sqliteservice: SqliteService
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
// console.log(params["params"]);
|
||||
@@ -60,7 +64,7 @@ export class DiplomaPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.profile = "mdgpr";
|
||||
this.LoadTaskDetail(this.serialNumber);
|
||||
this.getFromDb();
|
||||
}
|
||||
|
||||
goBack() {
|
||||
@@ -126,11 +130,15 @@ export class DiplomaPage implements OnInit {
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
}
|
||||
this.fulltask = res;
|
||||
this.sqliteservice.updateProcess(res)
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||
|
||||
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users=>{
|
||||
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialNumber), JSON.stringify(users)).then(() => {
|
||||
console.log('internen diploma ')
|
||||
})
|
||||
this.intervenientes = users.filter(user=>{
|
||||
return user.Type == 'I';
|
||||
});
|
||||
@@ -156,6 +164,62 @@ export class DiplomaPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
getFromDb() {
|
||||
if(synchro.connected === true) {
|
||||
this.LoadTaskDetail(this.serialNumber);
|
||||
} else {
|
||||
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
||||
|
||||
this.task = {
|
||||
"SerialNumber": process[0].serialNumber,
|
||||
"Folio": JSON.parse(process[0].workflowInstanceDataFields).Subject,
|
||||
"Senders": JSON.parse(process[0].originator).email,
|
||||
"CreateDate": momentG(new Date(process[0].taskStartDate),'yyyy-MM-dd HH:mm:ss'),
|
||||
"DocumentURL": JSON.parse(process[0].workflowInstanceDataFields).ViewerRequest,
|
||||
"Remetente": JSON.parse(process[0].workflowInstanceDataFields).Sender,
|
||||
"Note": JSON.parse(process[0].workflowInstanceDataFields).TaskMessage || JSON.parse(process[0].workflowInstanceDataFields).Note,
|
||||
"FolderId": JSON.parse(process[0].workflowInstanceDataFields).FolderID,
|
||||
"FsId": '361',
|
||||
"DocId": JSON.parse(process[0].workflowInstanceDataFields).DispatchDocId,
|
||||
"WorkflowName": process[0].workflowDisplayName,
|
||||
"DeadlineType": JSON.parse(process[0].workflowInstanceDataFields).DeadlineType,
|
||||
"activityInstanceName": process[0].activityInstanceName,
|
||||
}
|
||||
|
||||
let fulltak = {
|
||||
Documents: JSON.parse(process[0].Documents),
|
||||
actions: JSON.parse(process[0].actions),
|
||||
activityInstanceName: process[0].activityInstanceName,
|
||||
formURL: process[0].formURL,
|
||||
originator: JSON.parse(process[0].originator),
|
||||
serialNumber: process[0].serialNumber,
|
||||
taskStartDate: process[0].taskStartDate,
|
||||
totalDocuments: process[0].totalDocuments,
|
||||
workflowDisplayName: process[0].workflowDisplayName,
|
||||
workflowID: process[0].workflowID,
|
||||
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||
workflowInstanceID: process[0].workflowInstanceID,
|
||||
workflowName: process[0].workflowName
|
||||
}
|
||||
this.fulltask = fulltak
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||
|
||||
this.intervenientes = JSON.parse(process[0].interveners).filter(user=>{
|
||||
return user.Type == 'I';
|
||||
});
|
||||
this.cc = JSON.parse(process[0].interveners).filter(user=>{
|
||||
return user.Type == 'CC';
|
||||
});
|
||||
|
||||
this.attachments = JSON.parse(process[0].Documents)
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async viewDocument(DocId:string, Document) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
@@ -170,12 +234,13 @@ export class DiplomaPage implements OnInit {
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
|
||||
}
|
||||
|
||||
getDocumentDetails(forlderId:string, applicationId:string) {
|
||||
|
||||
@@ -3,34 +3,40 @@ import { ActivatedRoute, NavigationEnd, NavigationError, NavigationExtras, Navig
|
||||
import { DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-diplomas',
|
||||
templateUrl: './diplomas.page.html',
|
||||
styleUrls: ['./diplomas.page.scss'],
|
||||
})
|
||||
export class DiplomasPage implements OnInit, OnDestroy {
|
||||
list:DailyWorkTask[] = [];
|
||||
diplomasList:DailyWorkTask[] = [];
|
||||
diplomasAssinadoList:DailyWorkTask[] = [];
|
||||
list: DailyWorkTask[] = [];
|
||||
diplomasList: DailyWorkTask[] = [];
|
||||
diplomasAssinadoList: DailyWorkTask[] = [];
|
||||
showLoader: boolean;
|
||||
totalDocs:any;
|
||||
serialNumber:string;
|
||||
totalDocs: any;
|
||||
serialNumber: string;
|
||||
|
||||
segment:string;
|
||||
segment: string;
|
||||
|
||||
skeletonLoader = true
|
||||
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
private processes: ProcessesService,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private sqliteservice: SqliteService,
|
||||
private sortService: SortService,
|
||||
) {
|
||||
this.diplomasList = [];
|
||||
//Inicializar segment
|
||||
this.segment = 'validar';
|
||||
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
if(params['validar'] == 'true') {
|
||||
if (params['validar'] == 'true') {
|
||||
this.segment = 'validar';
|
||||
} else if (params['assinados'] == 'true') {
|
||||
this.segment = 'assinados';
|
||||
@@ -43,27 +49,14 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
||||
//this.segment = 'validar';
|
||||
this.activatedRoute.queryParams.subscribe(params => {
|
||||
|
||||
if(params['segment'] == 'validar') {
|
||||
if (params['segment'] == 'validar') {
|
||||
this.segment = 'validar';
|
||||
} else if (params['segment'] == 'assinados') {
|
||||
this.segment = 'assinados';
|
||||
}
|
||||
});
|
||||
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
|
||||
this.LoadList()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.refreshing()
|
||||
} else {
|
||||
this.LoadList()
|
||||
}
|
||||
}
|
||||
});
|
||||
this.getFromDb()
|
||||
|
||||
}
|
||||
|
||||
@@ -141,7 +134,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
||||
});
|
||||
} */
|
||||
|
||||
async getTotalDocs(DocId:any) {
|
||||
async getTotalDocs(DocId: any) {
|
||||
let res = await this.processes.GetDocumentDetails(DocId, '361').toPromise();
|
||||
console.log(res.DocumentsTotal);
|
||||
return res.DocumentsTotal;
|
||||
@@ -155,7 +148,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
||||
this.LoadList();
|
||||
}
|
||||
|
||||
goToDiploma(serialNumber:any) {
|
||||
goToDiploma(serialNumber: any) {
|
||||
this.router.navigate(['/home/gabinete-digital/diplomas', serialNumber, 'gabinete-digital']);
|
||||
}
|
||||
|
||||
@@ -177,7 +170,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
||||
diplomasList.push(task);
|
||||
|
||||
});
|
||||
this.diplomasList = this.sortArrayISODate(diplomasList.reverse());
|
||||
this.diplomasList = this.sortService.sortArrayByDate(diplomasList).reverse();
|
||||
|
||||
|
||||
let diplomasAssinados = diplomas.reverse().filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||
@@ -188,20 +181,63 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
||||
diplomasAssinadoList.push(task);
|
||||
});
|
||||
console.log('diplomasAssinados', diplomasAssinados)
|
||||
this.diplomasAssinadoList = this.sortArrayISODate(diplomasAssinadoList).reverse();
|
||||
this.diplomasAssinadoList = this.sortService.sortArrayByDate(diplomasAssinadoList).reverse();
|
||||
|
||||
}
|
||||
|
||||
getFromDb() {
|
||||
if (synchro.connected === true) {
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
|
||||
this.LoadList()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.refreshing()
|
||||
} else {
|
||||
this.LoadList()
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.sqliteservice.getprocessByworkflow("Despacho do Presidente da República").then((process: any[]) => {
|
||||
|
||||
let diplomasValidar = process.filter(data => data.activityInstanceName == "Revisar Diploma");
|
||||
let diplomasList = [];
|
||||
diplomasValidar.forEach(async element => {
|
||||
|
||||
let task = this.pipeTaskOffline(element)
|
||||
diplomasList.push(task);
|
||||
|
||||
});
|
||||
this.diplomasList = this.sortService.sortArrayByDate(diplomasList).reverse();
|
||||
|
||||
let diplomasAssinados = process.reverse().filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||
let diplomasAssinadoList = []
|
||||
diplomasAssinados.forEach(async element => {
|
||||
|
||||
let task = this.pipeTaskOffline(element)
|
||||
diplomasAssinadoList.push(task);
|
||||
});
|
||||
console.log('diplomasAssinados', diplomasAssinados)
|
||||
this.diplomasAssinadoList = this.sortService.sortArrayByDate(diplomasAssinadoList).reverse();
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pipeTask(element) {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
|
||||
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
return {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
"CreateDate": taskDate,
|
||||
"CreateDate": new Date(element.taskStartDate),
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
@@ -212,12 +248,28 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any) {
|
||||
return myArray.sort(function(a, b) {
|
||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||
});
|
||||
pipeTaskOffline(element) {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
return {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": JSON.parse(element.workflowInstanceDataFields).Subject,
|
||||
"Senders": JSON.parse(element.workflowInstanceDataFields).Sender,
|
||||
"CreateDate": new Date(element.taskStartDate),
|
||||
"DocumentURL": JSON.parse(element.workflowInstanceDataFields).ViewerRequest,
|
||||
"Remetente": JSON.parse(element.workflowInstanceDataFields).Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"DocId": JSON.parse(element.workflowInstanceDataFields).DocIdDiferimento,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
"Status": JSON.parse(element.workflowInstanceDataFields).Status,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
async refreshing() {
|
||||
setTimeout(() => {
|
||||
this.LoadList();
|
||||
|
||||
@@ -73,15 +73,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="loadedAttachments" class="bottom-content width-100">
|
||||
<div *ngIf="loadedEvent.Documents" class="bottom-content width-100">
|
||||
<ion-list>
|
||||
<h5>Documentos Anexados</h5>
|
||||
<ion-item class="ion-no-margin ion-no-padding cursor-pointer"
|
||||
*ngFor="let attach of loadedAttachments"
|
||||
(click)="viewDocument(attach.SourceId)">
|
||||
*ngFor="let attachment of loadedEvent.Documents"
|
||||
(click)="viewDocument(attachment.DocId, attachment)">
|
||||
<ion-label>
|
||||
<p class="attach-title-item d-block">{{attach.SourceName}}</p>
|
||||
<p><span class="span-left">{{attach.Stakeholders}}</span><span class="span-right">{{ attach.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</span></p>
|
||||
<p *ngIf="attachment.Assunto" class="attach-title-item">{{ attachment.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
|
||||
<p *ngIf="!attachment.Assunto" class="attach-title-item">{{ attachment.DocNumber }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
|
||||
<p><span class="span-left">{{attachment.Sender}}</span><span class="span-right">{{ attachment.DocDate | date: 'dd/MM/yy' }}</span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
|
||||
@@ -11,6 +11,11 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Location } from '@angular/common';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
|
||||
import { SqliteService } from '../../../../services/sqlite.service';
|
||||
import { synchro } from '../../../../services/socket/synchro.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
|
||||
@Component({
|
||||
selector: 'app-approve-event',
|
||||
@@ -19,10 +24,10 @@ import { Location } from '@angular/common';
|
||||
})
|
||||
export class ApproveEventPage implements OnInit {
|
||||
event: Event;
|
||||
loadedEvent:any = false
|
||||
loadedAttachments:any;
|
||||
customDate:any;
|
||||
today:any;
|
||||
loadedEvent: any = false
|
||||
loadedAttachments: any;
|
||||
customDate: any;
|
||||
today: any;
|
||||
show: boolean = false;
|
||||
|
||||
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
@@ -30,17 +35,21 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
serialNumber:string;
|
||||
caller:string;
|
||||
attachments:any;
|
||||
|
||||
@Input() InstanceId:string;
|
||||
|
||||
@Output() approveEventDismiss = new EventEmitter<any>();
|
||||
@Output() closeEventToApprove = new EventEmitter<any>();
|
||||
@Output() AproveEventEditEvent = new EventEmitter<any>();
|
||||
|
||||
synch = synchro;
|
||||
|
||||
constructor(
|
||||
private router:Router,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private modalController: ModalController,
|
||||
private processes:ProcessesService,
|
||||
private processes: ProcessesService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private popoverController: PopoverController,
|
||||
private menu: MenuController,
|
||||
@@ -49,14 +58,16 @@ export class ApproveEventPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private sqliteservice: SqliteService,
|
||||
private platform: Platform
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
// console.log(params["params"]);
|
||||
|
||||
if(params["params"].serialNumber) {
|
||||
if (params["params"].serialNumber) {
|
||||
this.serialNumber = params["params"].serialNumber;
|
||||
}
|
||||
if(params["params"].caller){
|
||||
if (params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
});
|
||||
@@ -70,8 +81,8 @@ export class ApproveEventPage implements OnInit {
|
||||
ngOnInit() {
|
||||
console.log(this.serialNumber);
|
||||
console.log(this.caller);
|
||||
this.getProcessFromDB();
|
||||
|
||||
this.getTask();
|
||||
}
|
||||
|
||||
goBack() {
|
||||
@@ -89,6 +100,86 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
addProcessToDB(data) {
|
||||
this.platform.ready().then(() => {
|
||||
this.sqliteservice.updateProcess(data);
|
||||
});
|
||||
}
|
||||
|
||||
getProcessFromDB() {
|
||||
|
||||
if (synchro.connected === true) {
|
||||
this.getTask();
|
||||
}
|
||||
|
||||
synchro.registerCallback('Offline', () => {
|
||||
this.platform.ready().then(() => {
|
||||
|
||||
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
||||
console.log('event aprove serial', process)
|
||||
|
||||
var doc;
|
||||
var action = [];
|
||||
var origi = [];
|
||||
var wordafi = {};
|
||||
if (process[0].Documents === "null" || process[0].Documents === "undefined") {
|
||||
doc = []
|
||||
} else {
|
||||
doc = JSON.parse(process[0].Documents)
|
||||
}
|
||||
|
||||
if (process[0].actions === "null" || process[0].actions === "undefined") {
|
||||
action = []
|
||||
} else {
|
||||
action = JSON.parse(process[0].Documents)
|
||||
}
|
||||
|
||||
if (process[0].originator === "null" || process[0].originator === "undefined") {
|
||||
origi = []
|
||||
} else {
|
||||
origi = JSON.parse(process[0].Documents)
|
||||
}
|
||||
if (process[0].workflowInstanceDataFields === "null" || process[0].workflowInstanceDataFields === "undefined") {
|
||||
wordafi = []
|
||||
} else {
|
||||
wordafi = JSON.parse(process[0].workflowInstanceDataFields)
|
||||
}
|
||||
|
||||
let task = {
|
||||
"Documents": doc,
|
||||
"actions": action,
|
||||
"activityInstanceName": process[0].activityInstanceName,
|
||||
"formURL": process[0].formURL,
|
||||
"originator": origi,
|
||||
"serialNumber": process[0].serialNumber,
|
||||
"taskStartDate": process[0].taskStartDate,
|
||||
"totalDocuments": process[0].totalDocuments,
|
||||
"workflowDisplayName": process[0].workflowDisplayName,
|
||||
"workflowID": process[0].workflowID,
|
||||
"workflowInstanceDataFields": wordafi,
|
||||
"workflowInstanceFolio": process[0].workflowInstanceFolio,
|
||||
"workflowInstanceID": process[0].workflowInstanceID,
|
||||
"workflowName": process[0].workflowInstanceID
|
||||
|
||||
}
|
||||
|
||||
this.loadedEvent = task
|
||||
console.log('offline event',this.loadedEvent);
|
||||
|
||||
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
|
||||
|
||||
this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]);
|
||||
|
||||
let instanceId = this.loadedEvent.workflowInstanceDataFields.InstanceId;
|
||||
this.loadedAttachments = this.loadedEvent.Documents;
|
||||
console.log('Attatara', this.loadedAttachments)
|
||||
|
||||
})
|
||||
})
|
||||
console.log('Offlineee')
|
||||
})
|
||||
}
|
||||
|
||||
async getTask() {
|
||||
this.loadedEvent = await this.processes.GetTask(this.serialNumber).toPromise();
|
||||
console.log(this.loadedEvent);
|
||||
@@ -96,12 +187,9 @@ export class ApproveEventPage implements OnInit {
|
||||
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
|
||||
|
||||
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
|
||||
|
||||
let instanceId = this.loadedEvent.workflowInstanceDataFields.InstanceId;
|
||||
this.getAttachments(instanceId);
|
||||
}
|
||||
|
||||
async approveTask(serialNumber:string) {
|
||||
async approveTask(serialNumber: string) {
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
console.log(body);
|
||||
|
||||
@@ -131,12 +219,12 @@ export class ApproveEventPage implements OnInit {
|
||||
}); */
|
||||
}
|
||||
|
||||
async emendTask(serialNumber:string){
|
||||
async emendTask(serialNumber: string) {
|
||||
console.log('Desktop');
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: EmendMessageModalPage,
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
},
|
||||
cssClass: 'emend-message-modal',
|
||||
backdropDismiss: false
|
||||
@@ -145,41 +233,42 @@ export class ApproveEventPage implements OnInit {
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss()
|
||||
.then( async (res) => {
|
||||
console.log(res.data);
|
||||
.then(async (res) => {
|
||||
console.log(res.data);
|
||||
|
||||
if(res.data !== ''){
|
||||
let body = { "serialNumber": serialNumber,
|
||||
"action": "Emendar",
|
||||
if (res.data !== '') {
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Emendar",
|
||||
"dataFields": {
|
||||
"ReviewUserComment": res.data,
|
||||
"ReviewUserComment": res.data,
|
||||
}
|
||||
}
|
||||
console.log(body);
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise();
|
||||
this.toastService.successMessage('Pedido enviado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest();
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
console.log(body);
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise();
|
||||
this.toastService.successMessage('Pedido enviado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest();
|
||||
} finally {
|
||||
loader.remove()
|
||||
else {
|
||||
//this.alertService.presentAlert('Operação cancelada!');
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
//this.alertService.presentAlert('Operação cancelada!');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//this.openEmendMessageModal(serialNumber);
|
||||
//this.goBack();
|
||||
}
|
||||
|
||||
async rejeitar(serialNumber:string){
|
||||
async rejeitar(serialNumber: string) {
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
const loader = this.toastService.loading()
|
||||
@@ -195,34 +284,36 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async getAttachments(instanceId:string) {
|
||||
|
||||
try {
|
||||
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(instanceId).toPromise();
|
||||
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
viewDocument(sourceId){
|
||||
this.processes.GetDocumentUrl(sourceId, '8').subscribe(res=>{
|
||||
/* console.log(res); */
|
||||
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
const browser = this.iab.create(url,"_blank");
|
||||
browser.show();
|
||||
async viewDocument(DocId:string, Document) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: Document.Assunto,
|
||||
url: '',
|
||||
title_link: '',
|
||||
},
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.loadedEvent.FolderId,
|
||||
task: this.loadedEvent
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
}
|
||||
|
||||
async openOptions(ev:any) {
|
||||
async openOptions(ev: any) {
|
||||
const popover = await this.popoverController.create({
|
||||
component: EventActionsPopoverPage,
|
||||
cssClass: 'events-options',
|
||||
event: ev,
|
||||
translucent: true,
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
serialNumber: ev.serialNumber,
|
||||
InstanceId: ev.workflowInstanceDataFields.InstanceId,
|
||||
},
|
||||
@@ -233,10 +324,10 @@ export class ApproveEventPage implements OnInit {
|
||||
openMenu() {
|
||||
this.menu.open();
|
||||
}
|
||||
async openEmendMessageModal(serialNumber:string) {
|
||||
async openEmendMessageModal(serialNumber: string) {
|
||||
const modal = await this.modalController.create({
|
||||
component: EmendMessageModalPage,
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
},
|
||||
cssClass: 'emend-message-modal',
|
||||
backdropDismiss: false
|
||||
@@ -244,13 +335,14 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then( async (res) => {
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
console.log(res.data);
|
||||
|
||||
if(res.data !== ''){
|
||||
let body = { "serialNumber": serialNumber,
|
||||
"action": "Emendar",
|
||||
"dataFields": {
|
||||
if (res.data !== '') {
|
||||
let body = {
|
||||
"serialNumber": serialNumber,
|
||||
"action": "Emendar",
|
||||
"dataFields": {
|
||||
"ReviewUserComment": res.data,
|
||||
}
|
||||
}
|
||||
@@ -264,18 +356,18 @@ export class ApproveEventPage implements OnInit {
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest();
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
else {
|
||||
//this.alertService.presentAlert('Operação cancelada!');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
goToEventsToApprove(){
|
||||
goToEventsToApprove() {
|
||||
let navigationExtras: NavigationExtras = {
|
||||
queryParams: {
|
||||
"eventos": true,
|
||||
@@ -290,7 +382,7 @@ export class ApproveEventPage implements OnInit {
|
||||
component: EditEventToApproveComponent,
|
||||
componentProps: {
|
||||
serialNumber: serialNumber,
|
||||
InstanceId:this.InstanceId
|
||||
InstanceId: this.InstanceId
|
||||
},
|
||||
cssClass: 'modal modal-desktop',
|
||||
// backdropDismiss: false
|
||||
|
||||
@@ -8,6 +8,11 @@ import { NavigationStart, Router } from '@angular/router';
|
||||
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
|
||||
import { Location } from '@angular/common';
|
||||
|
||||
import { SqliteService } from '../../../services/sqlite.service';
|
||||
import { synchro } from '../../../services/socket/synchro.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-list',
|
||||
templateUrl: './event-list.page.html',
|
||||
@@ -29,32 +34,23 @@ export class EventListPage implements OnInit {
|
||||
skeletonLoader = true
|
||||
eventaprovacaostore = EventoAprovacaoStore;
|
||||
|
||||
synch = synchro;
|
||||
|
||||
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private router: Router,
|
||||
private location: Location
|
||||
private location: Location,
|
||||
private sqliteservice: SqliteService,
|
||||
private platform: Platform,
|
||||
private sortService: SortService,
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.segment = 'MDGPR';
|
||||
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
|
||||
this.LoadToApproveEvents()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.refreshing()
|
||||
} else {
|
||||
this.LoadToApproveEvents()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.getEventToAproveFromDB();
|
||||
|
||||
window.onresize = (event) => {
|
||||
// if not mobile remove all component
|
||||
@@ -65,6 +61,42 @@ export class EventListPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
getEventToAproveFromDB() {
|
||||
|
||||
if( synchro.connected === true) {
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
|
||||
this.LoadToApproveEvents()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.refreshing()
|
||||
} else {
|
||||
this.LoadToApproveEvents()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
synchro.registerCallback('Offline', () => {
|
||||
this.platform.ready().then(() => {
|
||||
|
||||
this.sqliteservice.getListOfEventAprove('Agenda Oficial MDGPR','Agenda Pessoal MDGPR' ).then((event: any[]) => {
|
||||
this.eventsMDGPRList = event
|
||||
console.log("All evento to aprove from db ", event)
|
||||
})
|
||||
|
||||
this.sqliteservice.getListOfEventAprove('Agenda Oficial PR','Agenda Pessoal PR' ).then((event: any[]) => {
|
||||
this.eventsPRList = event
|
||||
console.log("All evento to aprove from db ", event)
|
||||
})
|
||||
})
|
||||
console.log('Offlineee')
|
||||
})
|
||||
}
|
||||
|
||||
segmentChanged(ev: any) {
|
||||
this.LoadToApproveEvents();
|
||||
}
|
||||
@@ -78,20 +110,22 @@ export class EventListPage implements OnInit {
|
||||
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
|
||||
let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
|
||||
this.eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
|
||||
console.log(this.eventsMDGPRList);
|
||||
|
||||
this.eventaprovacaostore.resetmd(this.eventsMDGPRList);
|
||||
this.eventaprovacaostore.resetmd(this.sortService.sortArrayByDate(this.eventsMDGPRList).reverse());
|
||||
}
|
||||
else if(this.segment == 'PR'){
|
||||
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise();
|
||||
let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
||||
this.eventsPRList = prEventsOficial.concat(prEventsPessoal);
|
||||
this.eventaprovacaostore.resetpr(this.eventsPRList);
|
||||
this.eventaprovacaostore.resetpr(this.sortService.sortArrayByDate(this.eventsPRList).reverse());
|
||||
}
|
||||
this.showLoader = false;
|
||||
this.skeletonLoader = false
|
||||
}
|
||||
|
||||
getEventToaproveFromDB() {
|
||||
|
||||
}
|
||||
|
||||
async openApproveModal(eventSerialNumber, event){
|
||||
const modal = await this.modalController.create({
|
||||
component: ApproveEventModalPage,
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon class="icon-time" slot="start" name="time-outline"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Priority')?.invalid && validateFrom ">
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Priority')?.invalid && validateFrom || validateField ">
|
||||
<ion-select
|
||||
placeholder="Prazo*"
|
||||
[(ngModel)]="postData.Priority"
|
||||
|
||||
+23
-16
@@ -88,7 +88,8 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
toppings = new FormControl();
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
validateFrom = false;
|
||||
validateField = false;
|
||||
|
||||
get toppingsValues() {
|
||||
return this.toppings.value;
|
||||
@@ -133,7 +134,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
SubjectTypes: this.selectedTypes,
|
||||
NumberPDPP: this.task.workflowInstanceDataFields.DispatchNumber,
|
||||
};
|
||||
|
||||
|
||||
this.postData.DispatchFolder = this.dispatchFolder;
|
||||
this.postData.UsersSelected = this.participants;
|
||||
/* By Default TypeDeadline should be 'Normal' */
|
||||
@@ -187,7 +188,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
this.validateFrom = true;
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
@@ -277,7 +278,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
||||
} else { // 8
|
||||
docs.Attachments.push({
|
||||
ApplicationId: 8,
|
||||
@@ -429,17 +430,23 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
|
||||
await this.toastService.successMessage('Processo efetuado');
|
||||
this.modalController.dismiss(action_despacho_pr);
|
||||
} catch (error) {
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
if(this.postData.DispatchFolder.Message){
|
||||
try {
|
||||
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
|
||||
await this.toastService.successMessage('Processo efetuado');
|
||||
this.modalController.dismiss(action_despacho_pr);
|
||||
} catch (error) {
|
||||
|
||||
console.log('this.taskResult', this.taskResult);
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
} finally {
|
||||
//loader.remove()
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.validateField = true;
|
||||
this.toastService.badRequest('Por favor adicione uma nota');
|
||||
}
|
||||
loader.remove();
|
||||
break;
|
||||
|
||||
case '1': // parecer
|
||||
@@ -463,7 +470,6 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
|
||||
await this.toastService.successMessage('Pedido enviado');
|
||||
this.modalController.dismiss(action_parecer_pr);
|
||||
@@ -471,8 +477,9 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
+138
-83
@@ -9,7 +9,7 @@ import { ModalController, PopoverController } from '@ionic/angular';
|
||||
import { ExpedientTaskModalPage } from '../expedient-task-modal/expedient-task-modal.page';
|
||||
import { BookMeetingModalPage } from '../book-meeting-modal/book-meeting-modal.page';
|
||||
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
||||
import { momentG } from 'src/plugin/momentG'
|
||||
import { momentG } from 'src/plugin/momentG'
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
@@ -26,6 +26,10 @@ import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-detail',
|
||||
templateUrl: './expediente-detail.page.html',
|
||||
@@ -36,22 +40,25 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
|
||||
customDate:any;
|
||||
customDate: any;
|
||||
|
||||
task: expedienteTask;
|
||||
fulltask: any;
|
||||
eventsList: Event[];
|
||||
serialNumber: string;
|
||||
caller:string;
|
||||
caller: string;
|
||||
profile: string;
|
||||
intervenientes: any;
|
||||
cc: any = [];
|
||||
documents:SearchList[] = [];
|
||||
attachments:any;
|
||||
documents: SearchList[] = [];
|
||||
attachments: any;
|
||||
|
||||
hideSendToPendentes = true
|
||||
searchDocumentPipe = new SearchDocumentPipe()
|
||||
|
||||
synch = synchro
|
||||
onlinecheck: boolean;
|
||||
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
private iab: InAppBrowser,
|
||||
@@ -66,20 +73,22 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
private attachmentsService: AttachmentsService,
|
||||
public p: PermissionService,
|
||||
private taskService: TaskService,
|
||||
private expedienteService: ExpedienteService
|
||||
private expedienteService: ExpedienteService,
|
||||
public platform: Platform,
|
||||
private sqliteservice: SqliteService,
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
if(params["params"].SerialNumber) {
|
||||
if (params["params"].SerialNumber) {
|
||||
this.serialNumber = params["params"].SerialNumber;
|
||||
}
|
||||
if(params["params"].caller) {
|
||||
if (params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.LoadTaskDetail(this.serialNumber);
|
||||
this.getFromDB();
|
||||
|
||||
}
|
||||
|
||||
@@ -91,16 +100,60 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
this.toastService.presentToast('Não foi possível fazer login');
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
|
||||
async approve(note:string, documents:any) {
|
||||
if(synchro.connected === true) {
|
||||
this.LoadTaskDetail(this.serialNumber);
|
||||
}
|
||||
|
||||
|
||||
synchro.registerCallback('Offline', () => {
|
||||
this.platform.ready().then(() => {
|
||||
this.onlinecheck = false;
|
||||
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
||||
console.log("expedient ditail", process)
|
||||
|
||||
var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
||||
var origina
|
||||
if (process[0].originator === "undefined") {
|
||||
origina = ""
|
||||
} else {
|
||||
origina = JSON.parse(process[0].originator)
|
||||
}
|
||||
|
||||
this.task = {
|
||||
"SerialNumber": process[0].serialNumber,
|
||||
"Folio": workflow.Subject,
|
||||
"Senders": origina.email || process[0].originator,
|
||||
"CreateDate": momentG(new Date(process[0].taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||
"DocumentURL": workflow.ViewerRequest,
|
||||
"Remetente": workflow.Sender,
|
||||
"Note": workflow.TaskMessage || workflow.Note,
|
||||
"FolderId": workflow.FolderID,
|
||||
"FsId": workflow.FsId,
|
||||
"DocId": workflow.DocID,
|
||||
"WorkflowName": process[0].workflowDisplayName,
|
||||
"Status": workflow.Status,
|
||||
"DispatchNumber": workflow.DispatchNumber,
|
||||
"AttachmentsProcessLastInstanceID": workflow.AttachmentsProcessLastInstanceID,
|
||||
"InstanceID": workflow.InstanceID
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
async approve(note: string, documents: any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Aprovar",
|
||||
"ActionTypeId": 100000004 ,
|
||||
"ActionTypeId": 100000004,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
"AttachmentList": documents,
|
||||
}
|
||||
|
||||
console.log(body);
|
||||
@@ -111,15 +164,15 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.close();
|
||||
this.toastService.successMessage('Processo aprovado')
|
||||
} catch(error) {
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não aprovado')
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async sendToReview(note:string, documents:any) {
|
||||
async sendToReview(note: string, documents: any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Retificar",
|
||||
@@ -127,7 +180,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
"AttachmentList": documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
@@ -136,7 +189,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.toastService.successMessage()
|
||||
} catch(error) {
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
} finally {
|
||||
loader.remove()
|
||||
@@ -144,16 +197,16 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
async openAddNoteModal(actionName:string) {
|
||||
async openAddNoteModal(actionName: string) {
|
||||
let classs;
|
||||
if( window.innerWidth < 701) {
|
||||
if (window.innerWidth < 701) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'add-note-modal'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: AddNotePage,
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
showAttachmentBtn: false,
|
||||
},
|
||||
cssClass: classs,
|
||||
@@ -164,7 +217,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
modal.onDidDismiss().then(res => {
|
||||
console.log(res);
|
||||
if(res.data){
|
||||
if (res.data) {
|
||||
const DocumentToSave = res.data.documents.map((e) => {
|
||||
return {
|
||||
ApplicationId: e.ApplicationType,
|
||||
@@ -177,10 +230,10 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
Attachments: DocumentToSave,
|
||||
}
|
||||
|
||||
if(actionName == 'Aprovar'){
|
||||
if (actionName == 'Aprovar') {
|
||||
this.approve(res.data.note, docs);
|
||||
}
|
||||
else if(actionName == 'Revisão'){
|
||||
else if (actionName == 'Revisão') {
|
||||
this.sendToReview(res.data.note, docs);
|
||||
}
|
||||
this.goBack();
|
||||
@@ -230,14 +283,14 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
sendExpedienteToPending() {
|
||||
this.processes.SetTaskToPending(this.serialNumber).subscribe(res=>{
|
||||
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
|
||||
console.log(res);
|
||||
this.toastService.successMessage('Processo enviado para pendentes')
|
||||
this.goBack();
|
||||
},
|
||||
(error)=>{
|
||||
this.toastService.badRequest('Processo não enviado para pendentes')
|
||||
});
|
||||
(error) => {
|
||||
this.toastService.badRequest('Processo não enviado para pendentes')
|
||||
});
|
||||
}
|
||||
|
||||
async LoadTaskDetail(serial: string) {
|
||||
@@ -249,7 +302,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
"SerialNumber": res.serialNumber,
|
||||
"Folio": res.workflowInstanceDataFields.Subject,
|
||||
"Senders": res.originator.email,
|
||||
"CreateDate": momentG(new Date(res.taskStartDate),'yyyy-MM-dd HH:mm:ss'),
|
||||
"CreateDate": momentG(new Date(res.taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||
"DocumentURL": res.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": res.workflowInstanceDataFields.Sender,
|
||||
"Note": res.workflowInstanceDataFields.TaskMessage || res.workflowInstanceDataFields.Note,
|
||||
@@ -264,16 +317,17 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
this.fulltask = res;
|
||||
this.sqliteservice.updateProcess(res)
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
|
||||
|
||||
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users=>{
|
||||
this.intervenientes = users.filter(user=>{
|
||||
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users => {
|
||||
this.intervenientes = users.filter(user => {
|
||||
return user.Type == 'I';
|
||||
});
|
||||
this.cc = users.filter(user=>{
|
||||
this.cc = users.filter(user => {
|
||||
return user.Type == 'CC';
|
||||
});
|
||||
})
|
||||
@@ -281,14 +335,14 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
console.log('this.task', this.task.InstanceID)
|
||||
console.log('this.task.DocumentURL', this.task.DocumentURL)
|
||||
|
||||
}, (error)=>{
|
||||
}, (error) => {
|
||||
try {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
if (error.status == 0) {
|
||||
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
@@ -320,7 +374,8 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
@@ -336,7 +391,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
getAttachments(serialNumber) {
|
||||
console.log(serialNumber);
|
||||
|
||||
this.attachmentsService.getAttachmentsBySerial(serialNumber).subscribe(res=>{
|
||||
this.attachmentsService.getAttachmentsBySerial(serialNumber).subscribe(res => {
|
||||
this.attachments = res;
|
||||
console.log('res', res);
|
||||
});
|
||||
@@ -357,45 +412,45 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
}
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async (res)=> {
|
||||
if(res){
|
||||
const data = res.data;
|
||||
this.documents.push(data.selected);
|
||||
this.documents.forEach((element: any) => {
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
if (res) {
|
||||
const data = res.data;
|
||||
this.documents.push(data.selected);
|
||||
this.documents.forEach((element: any) => {
|
||||
|
||||
let body = {
|
||||
"InstanceID": this.task.InstanceID,
|
||||
"WorkflowDisplayName": this.task.WorkflowName,
|
||||
"FolderID": this.task.FolderId,
|
||||
"DispatchNumber": this.task.DispatchNumber,
|
||||
"AttachmentsProcessLastInstanceID": this.task.AttachmentsProcessLastInstanceID,
|
||||
"Attachments": []
|
||||
}
|
||||
let body = {
|
||||
"InstanceID": this.task.InstanceID,
|
||||
"WorkflowDisplayName": this.task.WorkflowName,
|
||||
"FolderID": this.task.FolderId,
|
||||
"DispatchNumber": this.task.DispatchNumber,
|
||||
"AttachmentsProcessLastInstanceID": this.task.AttachmentsProcessLastInstanceID,
|
||||
"Attachments": []
|
||||
}
|
||||
|
||||
const Attachments = this.searchDocumentPipe.transformToAttachment(element)
|
||||
body.Attachments = Attachments;
|
||||
const Attachments = this.searchDocumentPipe.transformToAttachment(element)
|
||||
body.Attachments = Attachments;
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
this.attachmentsService.AddAttachment(body).subscribe((res)=> {
|
||||
this.toastService.successMessage()
|
||||
}, ()=> {
|
||||
this.toastService.badRequest()
|
||||
}, ()=> {
|
||||
loader.remove()
|
||||
});
|
||||
this.attachmentsService.AddAttachment(body).subscribe((res) => {
|
||||
this.toastService.successMessage()
|
||||
}, () => {
|
||||
this.toastService.badRequest()
|
||||
}, () => {
|
||||
loader.remove()
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
@@ -408,9 +463,9 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async(res)=>{
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
let body = res['data'];
|
||||
if(res['data']) {
|
||||
if (res['data']) {
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
@@ -421,47 +476,47 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
loader.remove()
|
||||
}
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async distartExpedientModal(body:any) {
|
||||
async distartExpedientModal(body: any) {
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
componentProps: {
|
||||
},
|
||||
cssClass: 'discart-expedient-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then( async (res)=>{
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
console.log(res['data']);
|
||||
|
||||
if(body == 'descartar') {
|
||||
if(res['data']== 'Yes') {
|
||||
if (body == 'descartar') {
|
||||
if (res['data'] == 'Yes') {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.expedienteService.discard({SerialNumber: this.task.SerialNumber}).toPromise()
|
||||
await this.expedienteService.discard({ SerialNumber: this.task.SerialNumber }).toPromise()
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
else if (res['data'] == 'No') {
|
||||
//Do nothing
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(res['data']== 'Yes') {
|
||||
else {
|
||||
if (res['data'] == 'Yes') {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
@@ -475,7 +530,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
}
|
||||
else if(res['data'] == 'No') {
|
||||
else if (res['data'] == 'No') {
|
||||
console.log('Update');
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
@@ -484,7 +539,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
}
|
||||
@@ -496,9 +551,9 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
console.log(task);
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth < 701){
|
||||
if (window.innerWidth < 701) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
@@ -510,12 +565,12 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
modal.onDidDismiss().then(res => {
|
||||
this.goBack();
|
||||
});
|
||||
}
|
||||
|
||||
goToEvent(eventId:any) {
|
||||
goToEvent(eventId: any) {
|
||||
this.router.navigate(['/home/events', eventId, 'expediente']);
|
||||
}
|
||||
|
||||
@@ -545,7 +600,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
componentProps: {
|
||||
task: this.task,
|
||||
fulltask: this.fulltask,
|
||||
taskAction:taskAction,
|
||||
taskAction: taskAction,
|
||||
},
|
||||
translucent: true
|
||||
});
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
|
||||
<ion-list>
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of expedienteGdStore.list"
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of listToPresent"
|
||||
(click)="goToExpediente(task.SerialNumber)"
|
||||
>
|
||||
<div class="item width-100">
|
||||
@@ -65,13 +65,13 @@
|
||||
</ion-list>
|
||||
|
||||
<div
|
||||
*ngIf="!skeletonLoader && expedienteGdStore.list.length == 0 && expedienteGdStore.list.length == 0"
|
||||
*ngIf="!skeletonLoader && listToPresent.length == 0 && listToPresent.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="skeletonLoader && expedienteGdStore.list.length == 0">
|
||||
<div *ngIf="skeletonLoader && listToPresent.length == 0">
|
||||
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
|
||||
@@ -4,6 +4,9 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { synchro } from '../../../services/socket/synchro.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente',
|
||||
@@ -12,40 +15,33 @@ import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
})
|
||||
export class ExpedientePage implements OnInit {
|
||||
|
||||
segment:string;
|
||||
segment: string;
|
||||
skeletonLoader = true
|
||||
//profile:string;
|
||||
showLoader:boolean;
|
||||
showLoader: boolean;
|
||||
|
||||
taskslist = [];
|
||||
serialNumber:string;
|
||||
serialNumber: string;
|
||||
|
||||
expedienteGdStore = ExpedienteGdStore
|
||||
expedienteTaskPipe = new ExpedienteTaskPipe()
|
||||
|
||||
onlinecheck: boolean;
|
||||
|
||||
listToPresent;
|
||||
synch = synchro
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
private processes: ProcessesService,
|
||||
private router: Router,
|
||||
private toastService: ToastService
|
||||
) {}
|
||||
private toastService: ToastService,
|
||||
public platform: Platform,
|
||||
private sqliteservice: SqliteService,
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
this.getEventsFromLocalDb();
|
||||
console.log("segrsgre")
|
||||
|
||||
this.LoadList()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.refreshing()
|
||||
} else {
|
||||
this.LoadList()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async LoadList() {
|
||||
@@ -54,17 +50,19 @@ export class ExpedientePage implements OnInit {
|
||||
try {
|
||||
const expediente: object[] = await this.processes.GetTaskListExpediente(false).toPromise()
|
||||
const result = expediente
|
||||
|
||||
|
||||
this.taskslist = new Array();
|
||||
let res = result.reverse().filter((data: any) => data.workflowInstanceDataFields.Status == "Active");
|
||||
|
||||
res.forEach((element: any) => {
|
||||
|
||||
let task = this.expedienteTaskPipe.transform(element)
|
||||
let task = this.expedienteTaskPipe.transform(element)
|
||||
this.taskslist.push(task);
|
||||
this.sqliteservice.addProcess(task);
|
||||
});
|
||||
|
||||
this.expedienteGdStore.reset(this.taskslist);
|
||||
|
||||
this.listToPresent = this.taskslist
|
||||
console.log('expediente list', this.listToPresent)
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
@@ -92,9 +90,80 @@ export class ExpedientePage implements OnInit {
|
||||
this.router.navigate(['/home/gabinete-digital']);
|
||||
}
|
||||
|
||||
goToExpediente(serialNumber:any){
|
||||
goToExpediente(serialNumber: any) {
|
||||
//console.log('ABRE');
|
||||
this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']);
|
||||
this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']);
|
||||
}
|
||||
|
||||
SqliteAddExpediente(list) {
|
||||
list.forEach((expediente) => {
|
||||
let data = {
|
||||
serialNumber: expediente.serialNumber,
|
||||
workflowInstanceFolio: expediente.workflowInstanceFolio,
|
||||
Documents: expediente.Documents,
|
||||
actions: expediente.actions,
|
||||
activityInstanceName: expediente.activityInstanceName,
|
||||
formURL: expediente.formURL,
|
||||
originator: expediente.originator,
|
||||
taskStartDate: expediente.taskStartDate,
|
||||
totalDocuments: expediente.totalDocuments,
|
||||
workflowDisplayName: expediente.workflowDisplayName,
|
||||
workflowID: expediente.workflowID,
|
||||
workflowInstanceDataFields: expediente.workflowInstanceDataFields,
|
||||
workflowInstanceID: expediente.workflowInstanceID,
|
||||
workflowName: expediente.workflowName
|
||||
}
|
||||
|
||||
this.sqliteservice.addExpediente(data);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
getEventsFromLocalDb() {
|
||||
|
||||
if (synchro.connected === true) {
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
|
||||
this.LoadList()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.refreshing()
|
||||
} else {
|
||||
this.LoadList()
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.taskslist = new Array();
|
||||
this.sqliteservice.getprocessByworkflow("Expediente").then((expediente: any[]) => {
|
||||
console.log("All expedientes from local,", expediente)
|
||||
|
||||
expediente.forEach((element) => {
|
||||
|
||||
var workflow = JSON.parse(element.workflowInstanceDataFields);
|
||||
|
||||
let exped = {
|
||||
"CreateDate": element.taskStartDate,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"Senders": workflow.Senders,
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Status": workflow.Status,
|
||||
"Subject": workflow.Subject,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName
|
||||
}
|
||||
|
||||
this.taskslist.push(exped)
|
||||
|
||||
});
|
||||
|
||||
this.listToPresent = this.taskslist
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -210,12 +210,13 @@ export class ExpedientePrPage implements OnInit {
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
|
||||
}
|
||||
|
||||
attachDocument() {
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
<fa-icon class="icon-selected" icon="align-justify"></fa-icon>
|
||||
</div>
|
||||
<p class="text-center exp-card-title ">Todas as tarefas</p>
|
||||
<p class="text-center exp-card-content">{{ totalDocumentStore.count }} <span class="title1">Documentos</span></p>
|
||||
<p class="text-center exp-card-content">{{ allProcessesList.length }} <span class="title1">Documentos</span></p>
|
||||
</div>
|
||||
|
||||
<div (click)="openEventsToApprovePage();selectedElement='approval'" [class.active]="selectedElement == 'approval'" class="box-hover exp-card d-flex flex-column" *ngIf="loggeduser.Profile == 'MDGPR'" >
|
||||
|
||||
@@ -25,39 +25,43 @@ import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
|
||||
|
||||
import { SqliteService } from '../../services/sqlite.service';
|
||||
import { synchro } from '../../services/socket/synchro.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
|
||||
@Component({
|
||||
selector: 'app-gabinete-digital',
|
||||
templateUrl: './gabinete-digital.page.html',
|
||||
styleUrls: ['./gabinete-digital.page.scss'],
|
||||
})
|
||||
|
||||
export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
segment:string;
|
||||
segmentVista:string;
|
||||
segment: string;
|
||||
segmentVista: string;
|
||||
showLoader: boolean;
|
||||
public profile:string;
|
||||
public profile: string;
|
||||
|
||||
allProcessesList: any = new Array();
|
||||
skeletonLoader: boolean;
|
||||
|
||||
count_exp_dailywork=0;
|
||||
count_exp_pr =0
|
||||
count_desp_dailywork=0;
|
||||
count_desp_pending=0;
|
||||
count_par_dailywork=0;
|
||||
count_par_pending=0;
|
||||
count_def_dailywork=0;
|
||||
count_def_pending=0;
|
||||
count_exp_pp : string;
|
||||
count_exp_pd : string;
|
||||
count_dip_apr : string;
|
||||
count_dip_as_pr =0
|
||||
count_dip_pv=0;
|
||||
count_exp_dailywork = 0;
|
||||
count_exp_pr = 0
|
||||
count_desp_dailywork = 0;
|
||||
count_desp_pending = 0;
|
||||
count_par_dailywork = 0;
|
||||
count_par_pending = 0;
|
||||
count_def_dailywork = 0;
|
||||
count_def_pending = 0;
|
||||
count_exp_pp: string;
|
||||
count_exp_pd: string;
|
||||
count_dip_apr: string;
|
||||
count_dip_as_pr = 0
|
||||
count_dip_pv = 0;
|
||||
count_dip_as = 0;
|
||||
count_de_pr = 0;
|
||||
count_ev_apr=0;
|
||||
count_ev_md=0;
|
||||
count_ev_apr = 0;
|
||||
count_ev_md = 0;
|
||||
count_total_pending = 0;
|
||||
count_desp_pr_active = 0;
|
||||
count_all_processes = 0;
|
||||
@@ -66,7 +70,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
desktopComponent: any = {
|
||||
showEventList: false,
|
||||
showExpediente : false,
|
||||
showExpediente: false,
|
||||
}
|
||||
|
||||
showAllProcesses = false;
|
||||
@@ -84,7 +88,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
showSignedDiploma = false;
|
||||
emptyTextDescription = 'Sem opção selecionada';
|
||||
|
||||
serialNumber:string;
|
||||
serialNumber: string;
|
||||
|
||||
loggeduser: LoginUserRespose;
|
||||
mdgpr = "MDGPR";
|
||||
@@ -105,6 +109,8 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
//
|
||||
// pipe
|
||||
|
||||
synch = synchro;
|
||||
|
||||
|
||||
customTaskPipe = new CustomTaskPipe()
|
||||
|
||||
@@ -113,7 +119,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
@ViewChild(EventsToApprovePage) eventsToApprove: EventsToApprovePage;
|
||||
|
||||
constructor(
|
||||
private processesbackend:ProcessesService,
|
||||
private processesbackend: ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
@@ -122,27 +128,27 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
public waitForDomService: WaitForDomService,
|
||||
private notificationsService: NotificationsService,
|
||||
private despachoRule: DespachoService,
|
||||
private sqliteservice: SqliteService,
|
||||
private platform: Platform,
|
||||
private changeProfileService: ChangeProfileService
|
||||
) {
|
||||
) {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
window.onresize = (event) => {
|
||||
// if not mobile remove all component
|
||||
if (window.innerWidth < 701) {
|
||||
this.modalController.dismiss();
|
||||
this.segmentVista = "listview";
|
||||
}
|
||||
else {
|
||||
this.segmentVista = "boxview";
|
||||
}
|
||||
};
|
||||
this.checkRoutes();
|
||||
|
||||
|
||||
window.onresize = (event) => {
|
||||
// if not mobile remove all component
|
||||
if( window.innerWidth < 701){
|
||||
this.modalController.dismiss();
|
||||
this.segmentVista = "listview";
|
||||
}
|
||||
else{
|
||||
this.segmentVista = "boxview";
|
||||
}
|
||||
};
|
||||
this.checkRoutes();
|
||||
|
||||
|
||||
// this.eventoaprovacaostore.resetmd([])
|
||||
// this.eventoaprovacaostore.resetpr([])
|
||||
// this.eventoaprovacaostore.resetmd([])
|
||||
// this.eventoaprovacaostore.resetpr([])
|
||||
|
||||
}
|
||||
|
||||
@@ -165,52 +171,30 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
if( window.innerWidth < 701) {
|
||||
if (window.innerWidth < 701) {
|
||||
this.segmentVista = "listview";
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.segmentVista = "boxview"
|
||||
}
|
||||
|
||||
const pathname = window.location.pathname
|
||||
this.getAllProcessFromDB()
|
||||
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == pathname) {
|
||||
|
||||
this.waitForDomService.selector({
|
||||
selector: 'app-gabinete-digital ion-content .aside-wrapper',
|
||||
callback: ()=> {
|
||||
this.checkRoutes();
|
||||
this.LoadCounts();
|
||||
this.loadAllProcesses();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
this.hideRefreshButton();
|
||||
|
||||
this.waitForDomService.selector({
|
||||
selector: 'app-gabinete-digital ion-content .aside-wrapper',
|
||||
callback: ()=> {
|
||||
this.loadAllProcesses();
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
async loadAllProcesses() {
|
||||
let allProcessesList = await this.processesbackend.GetTasksList("", false).toPromise();
|
||||
let allProcessesList = await this.processesbackend.GetTasksList("", false).toPromise();
|
||||
|
||||
if(!this.p.userRole(['PR'])) {
|
||||
allProcessesList = allProcessesList.filter( element => element.activityInstanceName != 'Assinar Diplomas')
|
||||
if (!this.p.userRole(['PR'])) {
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Assinar Diplomas')
|
||||
} else if (this.p.userRole(['PR'])) {
|
||||
allProcessesList = allProcessesList.filter( element => element.activityInstanceName != 'Diploma Assinado')
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Diploma Assinado')
|
||||
}
|
||||
|
||||
console.log('allProcessesList', allProcessesList);
|
||||
|
||||
this.addProcessToDB(allProcessesList)
|
||||
this.skeletonLoader = true;
|
||||
|
||||
this.allProcessesList = [];
|
||||
@@ -218,13 +202,14 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
allProcessesList.forEach(element => {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
"CreateDate": taskDate,
|
||||
//"CreateDate": taskDate,
|
||||
"CreateDate": new Date(element.taskStartDate),
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
@@ -237,69 +222,158 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
"customDate": this.setFormatDate(new Date(element.workflowInstanceDataFields.StartDate), new Date(element.workflowInstanceDataFields.EndDate), element.workflowInstanceDataFields.IsAllDayEvent),
|
||||
}
|
||||
|
||||
this.allProcessesList.push(task);
|
||||
this.allProcessesList = removeDuplicate( this.allProcessesList)
|
||||
this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse();
|
||||
this.allProcessesList.push(task);
|
||||
this.allProcessesList = removeDuplicate(this.allProcessesList)
|
||||
this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse();
|
||||
|
||||
|
||||
|
||||
this.totalDocumentStore.resetCount( this.allProcessesList.length)
|
||||
});
|
||||
|
||||
this.skeletonLoader = false;
|
||||
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any){
|
||||
return myArray.sort(function(a, b) {
|
||||
addProcessToDB(data) {
|
||||
this.platform.ready().then(() => {
|
||||
data.forEach(element => {
|
||||
|
||||
let process = {
|
||||
"serialNumber": element.serialNumber,
|
||||
"workflowInstanceFolio": element.workflowInstanceFolio,
|
||||
"Documents": element.Documents,
|
||||
"actions": element.actions,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
"formURL": element.formURL,
|
||||
"originator": element.originator,
|
||||
"taskStartDate": element.taskStartDate,
|
||||
"totalDocuments": element.totalDocuments,
|
||||
"workflowDisplayName": element.workflowDisplayName,
|
||||
"workflowID": element.workflowID,
|
||||
"workflowInstanceDataFields": element.workflowInstanceDataFields,
|
||||
"workflowInstanceID": element.workflowInstanceID,
|
||||
"workflowName": element.workflowName
|
||||
}
|
||||
|
||||
this.sqliteservice.addProcess(process);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getAllProcessFromDB() {
|
||||
|
||||
if (synchro.connected === true ) {
|
||||
const pathname = window.location.pathname
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd && event.url == pathname) {
|
||||
|
||||
this.waitForDomService.selector({
|
||||
selector: 'app-gabinete-digital ion-content .aside-wrapper',
|
||||
callback: () => {
|
||||
this.checkRoutes();
|
||||
this.LoadCounts();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
this.hideRefreshButton();
|
||||
|
||||
this.waitForDomService.selector({
|
||||
selector: 'app-gabinete-digital ion-content .aside-wrapper',
|
||||
callback: () => {
|
||||
this.loadAllProcesses();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.hideRefreshButton();
|
||||
|
||||
this.sqliteservice.getAllProcess().then((allprocess: any[]) => {
|
||||
allprocess.forEach(element => {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
|
||||
var workflowInstanceDataFields = JSON.parse(element.workflowInstanceDataFields);
|
||||
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": workflowInstanceDataFields.Subject,
|
||||
"Senders": workflowInstanceDataFields.Sender,
|
||||
"CreateDate": taskDate,
|
||||
"DocumentURL": workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"DocId": workflowInstanceDataFields.DispatchDocId,
|
||||
"FolderID": workflowInstanceDataFields.FolderID,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
"Status": workflowInstanceDataFields.Status,
|
||||
"Agenda": workflowInstanceDataFields.Agenda,
|
||||
"customDate": this.setFormatDate(new Date(workflowInstanceDataFields.StartDate), new Date(workflowInstanceDataFields.EndDate), workflowInstanceDataFields.IsAllDayEvent),
|
||||
}
|
||||
|
||||
this.allProcessesList.push(task);
|
||||
this.allProcessesList = removeDuplicate(this.allProcessesList)
|
||||
this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse();
|
||||
|
||||
});
|
||||
console.log("All process from db ", allprocess)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any) {
|
||||
return myArray.sort(function (a, b) {
|
||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||
});
|
||||
}
|
||||
|
||||
setFormatDate(start:any, end:any, allday:boolean){
|
||||
setFormatDate(start: any, end: any, allday: boolean) {
|
||||
let customDate;
|
||||
/* start = new Date();
|
||||
end= new Date("2021-08-04T18:01:04.753Z"); */
|
||||
//end = new Date("2021-09-04T18:01:04.753Z");
|
||||
|
||||
const totalSeconds = Math.floor((end - (start))/1000);;
|
||||
const totalMinutes = Math.floor(totalSeconds/60);
|
||||
const totalHours = Math.floor(totalMinutes/60);
|
||||
const totalDays = Math.floor(totalHours/24);
|
||||
const totalSeconds = Math.floor((end - (start)) / 1000);;
|
||||
const totalMinutes = Math.floor(totalSeconds / 60);
|
||||
const totalHours = Math.floor(totalMinutes / 60);
|
||||
const totalDays = Math.floor(totalHours / 24);
|
||||
|
||||
const hours = totalHours - ( totalDays * 24 );
|
||||
const minutes = totalMinutes - ( totalDays * 24 * 60 ) - ( hours * 60 );
|
||||
const seconds = totalSeconds - ( totalDays * 24 * 60 * 60 ) - ( hours * 60 * 60 ) - ( minutes * 60 );
|
||||
const hours = totalHours - (totalDays * 24);
|
||||
const minutes = totalMinutes - (totalDays * 24 * 60) - (hours * 60);
|
||||
const seconds = totalSeconds - (totalDays * 24 * 60 * 60) - (hours * 60 * 60) - (minutes * 60);
|
||||
|
||||
let diffDays = totalDays;
|
||||
let diffMinutes = minutes;
|
||||
|
||||
if(totalDays == 0){
|
||||
if(allday){
|
||||
customDate = this.getCustomDate(start)+", "+this.getCustomHours(start)+" (todo dia)";
|
||||
if (totalDays == 0) {
|
||||
if (allday) {
|
||||
customDate = this.getCustomDate(start) + ", " + this.getCustomHours(start) + " (todo dia)";
|
||||
console.log(customDate);
|
||||
return customDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
//customDate = this.getCustomDate(start)+","+this.getCustomHours(start)+" ("+minutes+" mins)";
|
||||
customDate = this.getCustomDate(start)+", "+this.getCustomHours(start)+" | "+this.getCustomHours(end);
|
||||
customDate = this.getCustomDate(start) + ", " + this.getCustomHours(start) + " | " + this.getCustomHours(end);
|
||||
return customDate;
|
||||
}
|
||||
}
|
||||
else{
|
||||
customDate = this.getCustomDate(start)+","+this.getCustomHours(start)+
|
||||
" (termina:"+ this.getCustomDate(end)+","+this.getCustomHours(end)+")";
|
||||
else {
|
||||
customDate = this.getCustomDate(start) + "," + this.getCustomHours(start) +
|
||||
" (termina:" + this.getCustomDate(end) + "," + this.getCustomHours(end) + ")";
|
||||
return customDate;
|
||||
}
|
||||
}
|
||||
|
||||
getCustomDate(thedate: Date){
|
||||
getCustomDate(thedate: Date) {
|
||||
return thedate.getDate() + "/" +
|
||||
(thedate.getMonth()+1) + "/" +
|
||||
thedate.getFullYear();
|
||||
(thedate.getMonth() + 1) + "/" +
|
||||
thedate.getFullYear();
|
||||
}
|
||||
getCustomHours(thedate: Date){
|
||||
getCustomHours(thedate: Date) {
|
||||
return thedate.getHours() + ":" +
|
||||
thedate.getMinutes();
|
||||
thedate.getMinutes();
|
||||
}
|
||||
|
||||
goToProcess(serialNumber:string, workflowName:string, activityName:string){
|
||||
@@ -312,42 +386,42 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
if(activityName == 'Tarefa de Despacho' || activityName == 'Concluir Despacho'){
|
||||
this.router.navigate(['/home/gabinete-digital/despachos-pr',serialNumber,'gabinete-digital']);
|
||||
}
|
||||
else if(activityName == 'Revisar Diploma' || activityName == 'Assinar Diploma'){
|
||||
this.router.navigate(['/home/gabinete-digital/diplomas',serialNumber,'gabinete-digital']);
|
||||
else if (activityName == 'Revisar Diploma' || activityName == 'Assinar Diploma') {
|
||||
this.router.navigate(['/home/gabinete-digital/diplomas', serialNumber, 'gabinete-digital']);
|
||||
}
|
||||
else if(activityName == 'Diploma Assinado'){
|
||||
this.router.navigate(['/home/gabinete-digital/diplomas-assinar',serialNumber,'gabinete-digital']);
|
||||
else if (activityName == 'Diploma Assinado') {
|
||||
this.router.navigate(['/home/gabinete-digital/diplomas-assinar', serialNumber, 'gabinete-digital']);
|
||||
}
|
||||
}
|
||||
else if(workflowName == 'Pedido de Parecer' || workflowName == 'Pedido de Deferimento') {
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']);
|
||||
else if (workflowName == 'Pedido de Parecer' || workflowName == 'Pedido de Deferimento') {
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos', serialNumber, 'gabinete-digital']);
|
||||
}
|
||||
else if(workflowName == 'Expediente') {
|
||||
this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']);
|
||||
else if (workflowName == 'Expediente') {
|
||||
this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']);
|
||||
}
|
||||
else if(workflowName == 'Expediente' && this.loggeduser.Profile == 'PR') {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']);
|
||||
else if (workflowName == 'Expediente' && this.loggeduser.Profile == 'PR') {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr', serialNumber, 'gabinete-digital']);
|
||||
}
|
||||
else if (workflowName == "Pedido de Parecer do Presidente") {
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']);
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos', serialNumber, 'gabinete-digital']);
|
||||
}
|
||||
/* else if (workflowName == "Expediente") {
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']);
|
||||
} */
|
||||
else if(workflowName == 'Agenda Pessoal PR' || workflowName == 'Agenda Oficial PR' || workflowName == 'Agenda Oficial MDGPR' || workflowName == 'Agenda Pessoal MDGPR') {
|
||||
this.router.navigate(['/home/gabinete-digital/event-list/approve-event',serialNumber, 'gabinete-digital']);
|
||||
else if (workflowName == 'Agenda Pessoal PR' || workflowName == 'Agenda Oficial PR' || workflowName == 'Agenda Oficial MDGPR' || workflowName == 'Agenda Pessoal MDGPR') {
|
||||
this.router.navigate(['/home/gabinete-digital/event-list/approve-event', serialNumber, 'gabinete-digital']);
|
||||
}
|
||||
else {
|
||||
else {
|
||||
console.log('cant find page for this task')
|
||||
}
|
||||
}
|
||||
|
||||
onSegmentVistaChange(){
|
||||
onSegmentVistaChange() {
|
||||
|
||||
}
|
||||
|
||||
checkUser(){
|
||||
this.selectedElement='allProcessesTag';
|
||||
checkUser() {
|
||||
this.selectedElement = 'allProcessesTag';
|
||||
this.showAllProcesses = true;
|
||||
/* switch(this.loggeduser.Profile){
|
||||
case 'MDGPR':
|
||||
@@ -359,77 +433,77 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
} */
|
||||
}
|
||||
|
||||
hideRefreshButton(){
|
||||
hideRefreshButton() {
|
||||
window.onresize = (event) => {
|
||||
if( window.innerWidth < 701) {
|
||||
if (window.innerWidth < 701) {
|
||||
this.hideRefreshBtn = false;
|
||||
this.hideInMobile = false;
|
||||
this.segmentVista = "listview";
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.hideRefreshBtn = true;
|
||||
this.hideInMobile = true;
|
||||
this.segmentVista = "boxview";
|
||||
}
|
||||
}
|
||||
if(window.innerWidth < 701){
|
||||
if (window.innerWidth < 701) {
|
||||
this.hideRefreshBtn = false;
|
||||
this.hideInMobile = false;
|
||||
this.segmentVista = "listview";
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.hideRefreshBtn = true;
|
||||
this.hideInMobile = true;
|
||||
this.segmentVista = "boxview";
|
||||
}
|
||||
}
|
||||
|
||||
checkRoutes(){
|
||||
checkRoutes() {
|
||||
this.closeAllDesktopComponents();
|
||||
if(this.router.url == '/home/gabinete-digital?processes=true'){
|
||||
if (this.router.url == '/home/gabinete-digital?processes=true') {
|
||||
this.openAllProcessesPage();
|
||||
this.selectedElement='allProcessesTag';
|
||||
this.selectedElement = 'allProcessesTag';
|
||||
}
|
||||
if(this.router.url == '/home/gabinete-digital?eventos=true'){
|
||||
if (this.router.url == '/home/gabinete-digital?eventos=true') {
|
||||
this.openEventsToApprovePage();
|
||||
this.selectedElement='approval';
|
||||
this.selectedElement = 'approval';
|
||||
}
|
||||
else if(this.router.url == '/home/gabinete-digital?expedientes=true'){
|
||||
else if (this.router.url == '/home/gabinete-digital?expedientes=true') {
|
||||
this.openExpedientListPage();
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.selectedElement='Correspondence';
|
||||
if (this.loggeduser.Profile == 'MDGPR') {
|
||||
this.selectedElement = 'Correspondence';
|
||||
}
|
||||
else{
|
||||
this.selectedElement='Expediente Presidente'
|
||||
else {
|
||||
this.selectedElement = 'Expediente Presidente'
|
||||
}
|
||||
}
|
||||
else if(this.router.url == '/home/gabinete-digital?pendentes=true'){
|
||||
else if (this.router.url == '/home/gabinete-digital?pendentes=true') {
|
||||
this.openPendentesPage('');
|
||||
this.selectedElement='Pending';
|
||||
this.selectedElement = 'Pending';
|
||||
}
|
||||
else if(this.router.url == '/home/gabinete-digital?despachos=true'){
|
||||
else if (this.router.url == '/home/gabinete-digital?despachos=true') {
|
||||
this.openDespachosPage('');
|
||||
this.selectedElement='Dispatches';
|
||||
this.selectedElement = 'Dispatches';
|
||||
}
|
||||
else if(this.router.url == '/home/gabinete-digital?pedidos=true'){
|
||||
else if (this.router.url == '/home/gabinete-digital?pedidos=true') {
|
||||
this.openPedidosPage('parecer');
|
||||
this.selectedElement='RequestsForOpinion';
|
||||
this.selectedElement = 'RequestsForOpinion';
|
||||
}
|
||||
else if(this.router.url == '/home/gabinete-digital?expedientespr=true'){
|
||||
else if (this.router.url == '/home/gabinete-digital?expedientespr=true') {
|
||||
this.openExpedientesPrPage();
|
||||
this.selectedElement='Expediente Presidente'
|
||||
this.selectedElement = 'Expediente Presidente'
|
||||
}
|
||||
else if(this.router.url == '/home/gabinete-digital?despachospr=true'){
|
||||
else if (this.router.url == '/home/gabinete-digital?despachospr=true') {
|
||||
this.openDespachosPrPage('');
|
||||
this.selectedElement='DispatchesPr'
|
||||
this.selectedElement = 'DispatchesPr'
|
||||
}
|
||||
else if(this.router.url == '/home/gabinete-digital?diplomas=true'){
|
||||
else if (this.router.url == '/home/gabinete-digital?diplomas=true') {
|
||||
this.openDiplomasPage('validar');
|
||||
this.selectedElement='DiplomasPorValidar';
|
||||
this.selectedElement = 'DiplomasPorValidar';
|
||||
}
|
||||
else if(this.router.url == '/home/gabinete-digital?diplomasassinar=true'){
|
||||
this. openDiplomasAssinarPage();
|
||||
this.selectedElement='DiplomasAssinar';
|
||||
else if (this.router.url == '/home/gabinete-digital?diplomasassinar=true') {
|
||||
this.openDiplomasAssinarPage();
|
||||
this.selectedElement = 'DiplomasAssinar';
|
||||
}
|
||||
else if (this.router.url == '/home/gabinete-digital?parecer=true') {
|
||||
this.openPedidosPage('parecer')
|
||||
@@ -437,7 +511,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
else if (this.router.url == '/home/gabinete-digital?deferimento=true') {
|
||||
this.openPedidosPage('deferimento')
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.checkUser();
|
||||
}
|
||||
}
|
||||
@@ -464,15 +538,15 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
let allPreocesses_ = await this.processesbackend.GetTasksList("", false).toPromise();
|
||||
let count_all_processes = Object.keys(allPreocesses_).length;
|
||||
this.totalDocumentStore.resetCount(count_all_processes)
|
||||
|
||||
|
||||
let expedientes = await this.processesbackend.GetTaskListExpediente(false).toPromise();
|
||||
expedientes = expedientes.filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||
this.expedientegbstore.count = expedientes.length
|
||||
|
||||
|
||||
let despachos = await this.despachoRule.getList({updateStore: true})
|
||||
if(despachos) {
|
||||
let despachos = await this.despachoRule.getList({ updateStore: true })
|
||||
if (despachos) {
|
||||
this.despachoStore.reset(despachos)
|
||||
}
|
||||
|
||||
@@ -488,7 +562,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
this.count_def_dailywork = Object.keys(deferimentos.filter(data => data.workflowInstanceDataFields.Status == "Active")).length;
|
||||
this.pedidosstore.countdeferimento = this.count_def_dailywork;
|
||||
|
||||
let pendentes =await this.processesbackend.GetPendingTasks(false).toPromise();
|
||||
let pendentes = await this.processesbackend.GetPendingTasks(false).toPromise();
|
||||
this.count_total_pending = Object.keys(pendentes).length;
|
||||
this.pendentesstore.count = this.count_total_pending;
|
||||
|
||||
@@ -538,7 +612,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
this.count_dip_as_pr = Object.keys(diplomasAssinados).length;
|
||||
this.deplomasStore.resetDiplomasAssinadoList(diplomasAssinados)
|
||||
|
||||
this.processesbackend.GetToApprovedEvents('Agenda','true').subscribe(res=>{
|
||||
this.processesbackend.GetToApprovedEvents('Agenda', 'true').subscribe(res => {
|
||||
this.count_ev_apr = res;
|
||||
});
|
||||
|
||||
@@ -554,56 +628,56 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
console.log(event);
|
||||
|
||||
// this.closeAllDesktopComponents();
|
||||
/* switch(this.loggeduser.Profile){
|
||||
case 'MDGPR':
|
||||
this.selectedElement='Correspondence';
|
||||
this.showExpedients = true;
|
||||
this.expedientesPage.doRefresh();
|
||||
break;
|
||||
case 'PR':
|
||||
this.selectedElement='ExpedientesPr';
|
||||
this.showExpedientesPr = true;
|
||||
break;
|
||||
} */
|
||||
/* switch(this.loggeduser.Profile){
|
||||
case 'MDGPR':
|
||||
this.selectedElement='Correspondence';
|
||||
this.showExpedients = true;
|
||||
this.expedientesPage.doRefresh();
|
||||
break;
|
||||
case 'PR':
|
||||
this.selectedElement='ExpedientesPr';
|
||||
this.showExpedientesPr = true;
|
||||
break;
|
||||
} */
|
||||
this.LoadCounts();
|
||||
this.loadAllProcesses();
|
||||
//this.refreshExpedientes();
|
||||
|
||||
if(event){
|
||||
if (event) {
|
||||
setTimeout(() => {
|
||||
event.target.complete();
|
||||
}, 2000);
|
||||
}
|
||||
else{
|
||||
else {
|
||||
console.log('null');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
selectedElementF(element:string) {
|
||||
selectedElementF(element: string) {
|
||||
if (window.innerWidth > 701) {
|
||||
return element == this.selectedElement
|
||||
return element == this.selectedElement
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
openAllProcessesPage() {
|
||||
this.closeAllDesktopComponents();
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"processes": true,}};
|
||||
if( window.innerWidth < 701) {
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "processes": true, } };
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital']);
|
||||
}
|
||||
else {
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showAllProcesses = true;
|
||||
this.selectedElement="allProcessesTag";
|
||||
this.selectedElement = "allProcessesTag";
|
||||
}
|
||||
}
|
||||
|
||||
openEventsToApprovePage() {
|
||||
this.closeAllDesktopComponents();
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"eventos": true,}};
|
||||
if( window.innerWidth < 701) {
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "eventos": true, } };
|
||||
if (window.innerWidth < 701) {
|
||||
//this.openEventsToApproveList(profile);
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
}
|
||||
@@ -616,26 +690,26 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
openExpedientListPage() {
|
||||
this.closeAllDesktopComponents();
|
||||
switch(this.loggeduser.Profile){
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
if( window.innerWidth < 701) {
|
||||
if (window.innerWidth < 701) {
|
||||
//this.openExpedientList();
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
}
|
||||
else {
|
||||
this.selectedElement='Correspondence'
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"expedientes": true,}};
|
||||
this.selectedElement = 'Correspondence'
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "expedientes": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showExpedients = true;
|
||||
}
|
||||
break;
|
||||
case 'PR':
|
||||
if( window.innerWidth < 701) {
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||
}
|
||||
else {
|
||||
this.selectedElement='ExpedientesPr'
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"expedientes": true,}};
|
||||
this.selectedElement = 'ExpedientesPr'
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "expedientes": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showExpedientesPr = true;
|
||||
}
|
||||
@@ -644,20 +718,20 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
}
|
||||
|
||||
openPedidosPage(segment:string) {
|
||||
openPedidosPage(segment: string) {
|
||||
this.closeAllDesktopComponents();
|
||||
|
||||
let navigationExtras: NavigationExtras;
|
||||
|
||||
if (segment == 'deferimento') {
|
||||
navigationExtras= { queryParams: {"deferimento": true,}};
|
||||
navigationExtras = { queryParams: { "deferimento": true, } };
|
||||
this.segment = 'deferimento'
|
||||
} else if (segment == 'parecer') {
|
||||
navigationExtras = { queryParams: {"parecer": true,}};
|
||||
navigationExtras = { queryParams: { "parecer": true, } };
|
||||
this.segment = 'parecer'
|
||||
}
|
||||
|
||||
if( window.innerWidth < 701) {
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos'], navigationExtras);
|
||||
}
|
||||
else {
|
||||
@@ -667,78 +741,78 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
if (segment == 'deferimento') {
|
||||
this.selectedElement = 'RequestForApproval'
|
||||
} else if (segment == 'parecer') {
|
||||
this.selectedElement='RequestsForOpinion'
|
||||
this.selectedElement = 'RequestsForOpinion'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
openDespachosPage(segment?:string) {
|
||||
openDespachosPage(segment?: string) {
|
||||
this.closeAllDesktopComponents();
|
||||
if( window.innerWidth < 701){
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos']);
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = {queryParams: {"despachos": true,}};
|
||||
else {
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "despachos": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showDespachos = true;
|
||||
}
|
||||
}
|
||||
|
||||
openDespachosPrPage(segment?:string) {
|
||||
openDespachosPrPage(segment?: string) {
|
||||
this.closeAllDesktopComponents();
|
||||
if( window.innerWidth < 701){
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos-pr']);
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = {queryParams: {"despachospr": true,}};
|
||||
else {
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "despachospr": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showDespachosPr = true;
|
||||
}
|
||||
}
|
||||
|
||||
openPendentesPage(segment?:string){
|
||||
openPendentesPage(segment?: string) {
|
||||
this.closeAllDesktopComponents();
|
||||
if( window.innerWidth < 701){
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/pendentes']);
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"pendentes": true,}};
|
||||
else {
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "pendentes": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showPendentes = true;
|
||||
}
|
||||
}
|
||||
|
||||
openExpedientesPrPage(segment?:string){
|
||||
openExpedientesPrPage(segment?: string) {
|
||||
this.closeAllDesktopComponents();
|
||||
if( window.innerWidth < 701) {
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||
}
|
||||
else {
|
||||
this.selectedElement='ExpedientesPr'
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"expedientespr": true,}};
|
||||
this.selectedElement = 'ExpedientesPr'
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "expedientespr": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showExpedientesPr = true;
|
||||
}
|
||||
}
|
||||
|
||||
openDiplomasPage(segment:string) {
|
||||
openDiplomasPage(segment: string) {
|
||||
let navigationExtras: NavigationExtras;
|
||||
|
||||
if (segment == 'validar') {
|
||||
navigationExtras= { queryParams: {"validar": true,}};
|
||||
navigationExtras = { queryParams: { "validar": true, } };
|
||||
} else if (segment == 'assinados') {
|
||||
navigationExtras = { queryParams: {"assinados": true,}};
|
||||
navigationExtras = { queryParams: { "assinados": true, } };
|
||||
}
|
||||
|
||||
this.segment = segment;
|
||||
|
||||
if( window.innerWidth < 701){
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/diplomas'], navigationExtras);
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.closeAllDesktopComponents();
|
||||
this.segment = segment;
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"diplomas": true,}};
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "diplomas": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showDiplomas = true;
|
||||
}
|
||||
@@ -746,14 +820,14 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
openDiplomasAssinarPage() {
|
||||
this.closeAllDesktopComponents();
|
||||
if( window.innerWidth < 701){
|
||||
this.router.navigate(['/home/gabinete-digital/diplomas-assinar']);
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"diplomasassinar": true,}};
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showDiplomasAssinar = true;
|
||||
}
|
||||
if (window.innerWidth < 701) {
|
||||
this.router.navigate(['/home/gabinete-digital/diplomas-assinar']);
|
||||
}
|
||||
else {
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "diplomasassinar": true, } };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
this.showDiplomasAssinar = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,10 @@ import { ForwardPage } from 'src/app/modals/forward/forward.page';
|
||||
|
||||
import { Location } from '@angular/common';
|
||||
import { PedidoService } from 'src/app/Rules/pedido.service';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
|
||||
import { PermissionService } from 'src/app/services/worker/permission.service';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
|
||||
@@ -31,10 +35,10 @@ export class PedidoPage implements OnInit {
|
||||
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
|
||||
customDate:any;
|
||||
customDate: any;
|
||||
|
||||
task: any;
|
||||
attachments:any;
|
||||
attachments: any;
|
||||
fulltask: any;
|
||||
eventsList: Event[];
|
||||
serialnumber: string;
|
||||
@@ -56,31 +60,32 @@ export class PedidoPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
public p: PermissionService,
|
||||
private location: Location,
|
||||
private pedidoService: PedidoService
|
||||
) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
private pedidoService: PedidoService,
|
||||
private sqliteservice: SqliteService,
|
||||
) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
// console.log(params["params"]);
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
// console.log(params["params"]);
|
||||
|
||||
if(params["params"].SerialNumber) {
|
||||
this.serialnumber = params["params"].SerialNumber;
|
||||
}
|
||||
if(params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
if (params["params"].SerialNumber) {
|
||||
this.serialnumber = params["params"].SerialNumber;
|
||||
}
|
||||
if (params["params"].caller) {
|
||||
this.caller = params["params"].caller;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.LoadTaskDetail(this.serialnumber);
|
||||
this.getfromDb()
|
||||
}
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
notImplemented(){
|
||||
notImplemented() {
|
||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||||
}
|
||||
|
||||
@@ -92,12 +97,13 @@ export class PedidoPage implements OnInit {
|
||||
this.processes.GetTask(this.serialnumber).subscribe(res => {
|
||||
|
||||
this.fulltask = res
|
||||
console.log('FULLTAK ONLINe', this.fulltask);
|
||||
|
||||
if(res.workflowDisplayName == 'Pedido de Parecer' || res.workflowDisplayName == 'Pedido de Parecer do Presidente'){
|
||||
if (res.workflowDisplayName == 'Pedido de Parecer' || res.workflowDisplayName == 'Pedido de Parecer do Presidente') {
|
||||
|
||||
let date = new Date(res.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
|
||||
this.task = {
|
||||
"SerialNumber": res.serialNumber,
|
||||
@@ -117,12 +123,13 @@ export class PedidoPage implements OnInit {
|
||||
"Status": res.workflowInstanceDataFields.Status,
|
||||
}
|
||||
console.log(this.task);
|
||||
this.sqliteservice.updateProcess(res);
|
||||
}
|
||||
else if(res.workflowDisplayName == 'Pedido de Deferimento'){
|
||||
else if (res.workflowDisplayName == 'Pedido de Deferimento') {
|
||||
|
||||
let date = new Date(res.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
|
||||
this.task = {
|
||||
"SerialNumber": res.serialNumber,
|
||||
@@ -141,28 +148,32 @@ export class PedidoPage implements OnInit {
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
"Status": res.workflowInstanceDataFields.Status,
|
||||
}
|
||||
this.sqliteservice.updateProcess(res);
|
||||
}
|
||||
|
||||
let thedate = new Date(res.taskStartDate);
|
||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
|
||||
this.processes.GetTaskParticipants(res.workflowInstanceDataFields.FolderID).subscribe(users=>{
|
||||
this.intervenientes = users.filter(user=>{
|
||||
this.processes.GetTaskParticipants(res.workflowInstanceDataFields.FolderID).subscribe(users => {
|
||||
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialnumber), JSON.stringify(users)).then(() =>{
|
||||
console.log('Pedido ')
|
||||
})
|
||||
this.intervenientes = users.filter(user => {
|
||||
return user.Type == 'I';
|
||||
});
|
||||
this.cc = users.filter(user=>{
|
||||
this.cc = users.filter(user => {
|
||||
return user.Type == 'CC';
|
||||
});
|
||||
});
|
||||
this.getDocumentDetails(res.workflowInstanceDataFields.FolderID, '361');
|
||||
}, (error)=>{
|
||||
}, (error) => {
|
||||
try {
|
||||
this.goBack()
|
||||
this.close()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
} finally {
|
||||
if (error.status == 0) {
|
||||
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
@@ -172,10 +183,104 @@ export class PedidoPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getDocumentDetails(forlderId:string, applicationId:string){
|
||||
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
|
||||
getfromDb() {
|
||||
if (synchro.connected === true) {
|
||||
this.LoadTaskDetail(this.serialnumber);
|
||||
}
|
||||
|
||||
if (synchro.connected === false) {
|
||||
this.sqliteservice.getProcessById(this.serialnumber).then((process) => {
|
||||
|
||||
console.log('PROCESS BY ID', process,this.serialnumber )
|
||||
|
||||
let fulltak = {
|
||||
Documents: JSON.parse(process[0].Documents),
|
||||
actions: JSON.parse(process[0].actions),
|
||||
activityInstanceName: process[0].activityInstanceName,
|
||||
formURL: process[0].formURL,
|
||||
originator: JSON.parse(process[0].originator),
|
||||
serialNumber: process[0].serialNumber,
|
||||
taskStartDate: process[0].taskStartDate,
|
||||
totalDocuments: process[0].totalDocuments,
|
||||
workflowDisplayName: process[0].workflowDisplayName,
|
||||
workflowID: process[0].workflowID,
|
||||
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||
workflowInstanceID: process[0].workflowInstanceID,
|
||||
workflowName: process[0].workflowName
|
||||
}
|
||||
|
||||
this.fulltask = fulltak;
|
||||
console.log('FULLTAK OFFLINE', this.fulltask);
|
||||
|
||||
if (process[0].workflowDisplayName == 'Pedido de Parecer' || process[0].workflowDisplayName == 'Pedido de Parecer do Presidente') {
|
||||
let date = new Date(process[0].taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
|
||||
this.task = {
|
||||
"SerialNumber": process[0].serialNumber,
|
||||
"Folio": JSON.parse(process[0].workflowInstanceDataFields).Subject,
|
||||
"Senders": JSON.parse(process[0].workflowInstanceDataFields).Sender,
|
||||
"CreateDate": taskDate,
|
||||
"DocumentURL": JSON.parse(process[0].workflowInstanceDataFields).ViewerRequest,
|
||||
"Remetente": JSON.parse(process[0].workflowInstanceDataFields).Sender,
|
||||
"Note": JSON.parse(process[0].workflowInstanceDataFields).TaskMessage,
|
||||
"FolderId": JSON.parse(process[0].workflowInstanceDataFields).FolderID,
|
||||
"FsId": '361',
|
||||
"DocId": JSON.parse(process[0].workflowInstanceDataFields).DocIdDeferimento,
|
||||
"WorkflowName": process[0].workflowDisplayName,
|
||||
"DeadlineType": JSON.parse(process[0].workflowInstanceDataFields).DeadlineType,
|
||||
"ProcessInstanceID": JSON.parse(process[0].workflowInstanceDataFields).InstanceID,
|
||||
"activityInstanceName": process[0].activityInstanceName,
|
||||
"Status": JSON.parse(process[0].workflowInstanceDataFields).Status,
|
||||
}
|
||||
|
||||
this.attachments = JSON.parse(process[0].Documents);
|
||||
} else if (process[0].workflowDisplayName == 'Pedido de Deferimento') {
|
||||
|
||||
let date = new Date(process[0].taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
this.task = {
|
||||
"SerialNumber": process[0].serialNumber,
|
||||
"Folio": JSON.parse(process[0].workflowInstanceDataFields).Subject,
|
||||
"Senders": JSON.parse(process[0].workflowInstanceDataFields).Sender,
|
||||
"CreateDate": taskDate,
|
||||
"DocumentURL": JSON.parse(process[0].workflowInstanceDataFields).ViewerRequest,
|
||||
"Remetente": JSON.parse(process[0].workflowInstanceDataFields).Sender,
|
||||
"Note": JSON.parse(process[0].workflowInstanceDataFields).TaskMessage,
|
||||
"FolderId": JSON.parse(process[0].workflowInstanceDataFields).FolderID,
|
||||
"FsId": '361',
|
||||
"DocId": JSON.parse(process[0].workflowInstanceDataFields).DocIdDeferimento,
|
||||
"WorkflowName": process[0].workflowDisplayName,
|
||||
"DeadlineType": JSON.parse(process[0].workflowInstanceDataFields).DeadlineType,
|
||||
"ProcessInstanceID": JSON.parse(process[0].workflowInstanceDataFields).InstanceID,
|
||||
"activityInstanceName": process[0].activityInstanceName,
|
||||
"Status": JSON.parse(process[0].workflowInstanceDataFields).Status,
|
||||
}
|
||||
this.attachments = JSON.parse(process[0].Documents);
|
||||
}
|
||||
|
||||
let thedate = new Date(process[0].taskStartDate);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
|
||||
this.intervenientes = JSON.parse(process[0].interveners).filter(user => {
|
||||
return user.Type == 'I';
|
||||
});
|
||||
this.cc = JSON.parse(process[0].interveners).filter(user => {
|
||||
return user.Type == 'CC';
|
||||
});
|
||||
this.getDocumentDetails(JSON.parse(process[0].workflowInstanceDataFields).FolderID, '361');
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
getDocumentDetails(forlderId: string, applicationId: string) {
|
||||
this.processes.GetDocumentDetails(forlderId, applicationId).subscribe(res => {
|
||||
this.attachments = res.Documents;
|
||||
// console.log(res['Documents']);
|
||||
console.log(res['Documents']);
|
||||
})
|
||||
}
|
||||
|
||||
@@ -193,12 +298,13 @@ export class PedidoPage implements OnInit {
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
|
||||
}
|
||||
|
||||
openMenu() {
|
||||
@@ -214,17 +320,17 @@ export class PedidoPage implements OnInit {
|
||||
task: this.task,
|
||||
serialNumber: this.task.SerialNumber,
|
||||
fulltask: this.fulltask,
|
||||
taskAction:taskAction,
|
||||
taskAction: taskAction,
|
||||
showEnviarPendentes: false
|
||||
},
|
||||
translucent: true
|
||||
});
|
||||
await popover.present();
|
||||
|
||||
popover.onDidDismiss().then(( res =>{
|
||||
popover.onDidDismiss().then((res => {
|
||||
|
||||
if( res['data'] == 'close') {
|
||||
this.goBack()
|
||||
this.goBack()
|
||||
}
|
||||
|
||||
// alert(JSON.stringify(res)+' nada')
|
||||
@@ -232,7 +338,7 @@ export class PedidoPage implements OnInit {
|
||||
}))
|
||||
}
|
||||
|
||||
async repreciar(note:string, documents:any) {
|
||||
async repreciar(note: string, documents: any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Reapreciação",
|
||||
@@ -240,7 +346,7 @@ export class PedidoPage implements OnInit {
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
"AttachmentList": documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
@@ -252,17 +358,18 @@ export class PedidoPage implements OnInit {
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
}
|
||||
|
||||
async arquivar(note:string, documents:any) {
|
||||
async arquivar(note: string, documents: any) {
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.pedidoService.arquivar({serialNumber: this.serialnumber,
|
||||
await this.pedidoService.arquivar({
|
||||
serialNumber: this.serialnumber,
|
||||
documents,
|
||||
note
|
||||
}).toPromise()
|
||||
@@ -277,7 +384,7 @@ export class PedidoPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async assignar(note:string, documents:any) {
|
||||
async assignar(note: string, documents: any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialnumber,
|
||||
"action": "Reencaminhar",
|
||||
@@ -285,7 +392,7 @@ export class PedidoPage implements OnInit {
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
},
|
||||
"AttachmentList" :documents,
|
||||
"AttachmentList": documents,
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
@@ -296,16 +403,16 @@ export class PedidoPage implements OnInit {
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sendExpedienteToPending() {
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res => {
|
||||
this.goBack();
|
||||
},()=>{
|
||||
}, () => {
|
||||
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
});
|
||||
@@ -314,9 +421,9 @@ export class PedidoPage implements OnInit {
|
||||
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800) {
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
@@ -329,7 +436,7 @@ export class PedidoPage implements OnInit {
|
||||
cssClass: classs,
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
modal.onDidDismiss().then(res => {
|
||||
console.log('Modal closed');
|
||||
this.goBack();
|
||||
});
|
||||
@@ -337,9 +444,9 @@ export class PedidoPage implements OnInit {
|
||||
|
||||
async openBookMeetingModal(task: any) {
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
@@ -370,12 +477,12 @@ export class PedidoPage implements OnInit {
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
async distartExpedientModal(){
|
||||
console.log(this.fulltask);
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
componentProps: {
|
||||
serialNumber: this.fulltask.SerialNumber,
|
||||
folderId: this.fulltask.workflowInstanceDataFields.FolderID,
|
||||
action: 'complete',
|
||||
@@ -385,8 +492,8 @@ export class PedidoPage implements OnInit {
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
if(res['data']=='close'){
|
||||
modal.onDidDismiss().then(res => {
|
||||
if (res['data'] == 'close') {
|
||||
this.close();
|
||||
/* console.log('2Expedient Discard closed2');
|
||||
this.close();
|
||||
@@ -400,9 +507,9 @@ export class PedidoPage implements OnInit {
|
||||
console.log(task);
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
@@ -420,9 +527,9 @@ export class PedidoPage implements OnInit {
|
||||
async openForwardModal(task: any) {
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800) {
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'modal modal-desktop showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
@@ -441,9 +548,9 @@ export class PedidoPage implements OnInit {
|
||||
console.log(task);
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'book-meeting-modal modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'add-note-modal-no-height showAsideOptions'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
@@ -456,21 +563,21 @@ export class PedidoPage implements OnInit {
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res=>{
|
||||
modal.onDidDismiss().then(res => {
|
||||
this.goBack();
|
||||
});
|
||||
}
|
||||
|
||||
async openAddNoteModal(actionName:string) {
|
||||
async openAddNoteModal(actionName: string) {
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
classs = 'modal modal-desktop'
|
||||
} else {
|
||||
} else {
|
||||
classs = 'add-note-modal-no-height'
|
||||
}
|
||||
const modal = await this.modalController.create({
|
||||
component: AddNotePage,
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
showAttachmentBtn: true,
|
||||
},
|
||||
cssClass: classs,
|
||||
@@ -480,8 +587,8 @@ export class PedidoPage implements OnInit {
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then( async (res) => {
|
||||
const DocumentToSave = await res.data.documents.map( async (e) => {
|
||||
modal.onDidDismiss().then(async (res) => {
|
||||
const DocumentToSave = await res.data.documents.map(async (e) => {
|
||||
return {
|
||||
ApplicationId: e.ApplicationType,
|
||||
SourceId: e.Id,
|
||||
@@ -492,16 +599,16 @@ export class PedidoPage implements OnInit {
|
||||
Attachments: DocumentToSave,
|
||||
}
|
||||
|
||||
if(res.data){
|
||||
if(actionName == 'Solicitar Reapreciação') {
|
||||
if (res.data) {
|
||||
if (actionName == 'Solicitar Reapreciação') {
|
||||
await this.repreciar(res.data.note, docs);
|
||||
this.goBack();
|
||||
}
|
||||
else if(actionName == 'Arquivar') {
|
||||
else if (actionName == 'Arquivar') {
|
||||
await this.arquivar(res.data.note, docs);
|
||||
this.goBack();
|
||||
}
|
||||
else if(actionName == 'Assignar') {
|
||||
else if (actionName == 'Assignar') {
|
||||
await this.assignar(res.data.note, docs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,13 +38,13 @@
|
||||
|
||||
<div class="width-100" [ngSwitch]="segment">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
||||
<div *ngIf="pedidosstorage.listparecer">
|
||||
<div *ngIf="listToPresentparecerList">
|
||||
<ion-list *ngSwitchCase="'parecer'">
|
||||
<!-- *ngFor = "let task of pedidosstorage.listparecer; let i = index"
|
||||
(click)="viewExpedientDetail(task.SerialNumber)" -->
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of pedidosstorage.listparecer"
|
||||
*ngFor = "let task of listToPresentparecerList"
|
||||
(click)="goToPedido(task.SerialNumber)"
|
||||
>
|
||||
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
|
||||
@@ -77,11 +77,11 @@
|
||||
</ion-list>
|
||||
|
||||
</div>
|
||||
<div *ngIf="pedidosstorage.listdeferimento">
|
||||
<div *ngIf="listToPresentdeferimentoList">
|
||||
<ion-list *ngSwitchCase="'deferimento'">
|
||||
<div
|
||||
class="expediente ion-no-padding ion-no-margin cursor-pointer"
|
||||
*ngFor = "let task of pedidosstorage.listdeferimento"
|
||||
*ngFor = "let task of listToPresentdeferimentoList"
|
||||
(click)="goToPedido(task.SerialNumber)"
|
||||
>
|
||||
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
|
||||
|
||||
@@ -7,6 +7,11 @@ import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { PedidosStore } from 'src/app/store/pedidos-store.service';
|
||||
import { ModalService } from 'src/app/services/modal.service';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-pedidos',
|
||||
templateUrl: './pedidos.page.html',
|
||||
@@ -18,6 +23,8 @@ export class PedidosPage implements OnInit {
|
||||
|
||||
taskslist:DailyWorkTask[] = [];
|
||||
parecerList:any[] = [];
|
||||
listToPresentparecerList: any[] = [];
|
||||
listToPresentdeferimentoList: any[] = [];
|
||||
fulltask:any;
|
||||
|
||||
parecerListResult:customTask[] = [];
|
||||
@@ -38,7 +45,9 @@ export class PedidosPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private modalService: ModalService
|
||||
private modalService: ModalService,
|
||||
private sqliteservice: SqliteService,
|
||||
private sortService: SortService,
|
||||
) {
|
||||
//Inicializar segment
|
||||
this.segment = 'parecer';
|
||||
@@ -57,21 +66,7 @@ export class PedidosPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.LoadList()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationStart && '/home/gabinete-digital/pedidos?parecer=true'.startsWith(event.url) ||
|
||||
event instanceof NavigationStart && '/home/gabinete-digital/pedidos?deferimento=true'.startsWith(event.url)
|
||||
) {
|
||||
|
||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.refreshing()
|
||||
} else {
|
||||
this.LoadList()
|
||||
}
|
||||
}
|
||||
});
|
||||
this.getFromDb();
|
||||
}
|
||||
|
||||
goBack() {
|
||||
@@ -131,7 +126,7 @@ export class PedidosPage implements OnInit {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
"CreateDate": taskDate,
|
||||
"CreateDate": new Date(element.taskStartDate),
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
@@ -141,7 +136,8 @@ export class PedidosPage implements OnInit {
|
||||
}
|
||||
this.parecerList.push(task);
|
||||
});
|
||||
this.pedidosstorage.resetparecer(this.parecerList);
|
||||
this.sqliteservice.addProcess(this.parecerList);
|
||||
this.listToPresentparecerList = this.sortService.sortArrayISODate(this.parecerList);
|
||||
|
||||
}
|
||||
else if(this.segment == 'deferimento') {
|
||||
@@ -166,7 +162,7 @@ export class PedidosPage implements OnInit {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
"CreateDate": taskDate,
|
||||
"CreateDate": new Date(element.taskStartDate),
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
@@ -181,14 +177,92 @@ export class PedidosPage implements OnInit {
|
||||
|
||||
|
||||
});
|
||||
this.pedidosstorage.resetdeferimento(this.deferimentoList);
|
||||
|
||||
this.sqliteservice.addProcess(this.deferimentoList);
|
||||
this.listToPresentdeferimentoList = this.sortService.sortArrayISODate(this.deferimentoList);
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getFromDb() {
|
||||
if(synchro.connected === true) {
|
||||
this.LoadList()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationStart && '/home/gabinete-digital/pedidos?parecer=true'.startsWith(event.url) ||
|
||||
event instanceof NavigationStart && '/home/gabinete-digital/pedidos?deferimento=true'.startsWith(event.url)
|
||||
) {
|
||||
|
||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.refreshing()
|
||||
} else {
|
||||
this.LoadList()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(synchro.connected === false) {
|
||||
let parecerlist = [];
|
||||
let deferimentolist = []
|
||||
this.sqliteservice.getprocessByworkflowpedido("Pedido de Parecer", "Pedido de Parecer do Presidente").then((process: any[]) => {
|
||||
|
||||
process.forEach((element) => {
|
||||
if(JSON.parse(element.workflowInstanceDataFields).Status == "Active") {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": JSON.parse(element.workflowInstanceDataFields).Subject,
|
||||
"Senders": JSON.parse(element.workflowInstanceDataFields).Sender,
|
||||
"CreateDate": taskDate,
|
||||
"DocumentURL": JSON.parse(element.workflowInstanceDataFields).ViewerRequest,
|
||||
"Remetente": JSON.parse(element.workflowInstanceDataFields).Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"DocId": JSON.parse(element.workflowInstanceDataFields).DocIdDiferimento,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
}
|
||||
parecerlist.push(task)
|
||||
}
|
||||
})
|
||||
this.listToPresentparecerList = this.sortService.sortArrayISODate(parecerlist);
|
||||
console.log('parecer',process)
|
||||
})
|
||||
|
||||
this.sqliteservice.getprocessByworkflow("Pedido de Deferimento").then((process: any[]) => {
|
||||
process.forEach((element) => {
|
||||
if(JSON.parse(element.workflowInstanceDataFields).Status == "Active") {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": JSON.parse(element.workflowInstanceDataFields).Subject,
|
||||
"Senders": JSON.parse(element.workflowInstanceDataFields).Sender,
|
||||
"CreateDate": taskDate,
|
||||
"DocumentURL": JSON.parse(element.workflowInstanceDataFields).ViewerRequest,
|
||||
"Remetente": JSON.parse(element.workflowInstanceDataFields).Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"DocId": JSON.parse(element.workflowInstanceDataFields).DocIdDiferimento,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
}
|
||||
deferimentolist.push(task)
|
||||
}
|
||||
})
|
||||
this.listToPresentdeferimentoList = this.sortService.sortArrayISODate(deferimentolist);
|
||||
console.log('deferimento',process)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
segmentChanged(ev: any) {
|
||||
this.LoadList();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</ion-refresher>
|
||||
|
||||
<app-task-list class="height-100"
|
||||
[taskList] = pendentesstore.list
|
||||
[taskList] = listToPresent
|
||||
[skeletonLoader] = skeletonLoader
|
||||
(viewTaskDetail)="viewTaskDetails($event)"
|
||||
> </app-task-list>
|
||||
|
||||
@@ -10,6 +10,11 @@ import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-pendentes',
|
||||
@@ -20,46 +25,38 @@ export class PendentesPage implements OnInit {
|
||||
@ViewChild(CalendarComponent) myCal: CalendarComponent;
|
||||
|
||||
taskType: string;
|
||||
serialNumber:string;
|
||||
totalDocs:any;
|
||||
serialNumber: string;
|
||||
totalDocs: any;
|
||||
showLoader: boolean;
|
||||
loggeduser: LoginUserRespose;
|
||||
|
||||
@Input() profile:string;
|
||||
segment:string;
|
||||
@Input() profile: string;
|
||||
segment: string;
|
||||
skeletonLoader = true
|
||||
pendentesstore = PendentesStore;
|
||||
customTaskPipe = new CustomTaskPipe()
|
||||
listToPresent = [];
|
||||
|
||||
synch = synchro
|
||||
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
private processes: ProcessesService,
|
||||
private alertService: AlertService,
|
||||
private router: Router,
|
||||
private authService: AuthService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.profile = 'mdgpr';
|
||||
}
|
||||
private sqliteservice: SqliteService,
|
||||
private platform: Platform,
|
||||
private sortService: SortService,
|
||||
) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.profile = 'mdgpr';
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
//Inicializar segment
|
||||
this.segment = "despachos";
|
||||
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
|
||||
this.LoadList()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
|
||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.refreshing()
|
||||
} else {
|
||||
this.LoadList()
|
||||
}
|
||||
}
|
||||
});
|
||||
this.getFromDb();
|
||||
|
||||
}
|
||||
|
||||
@@ -87,18 +84,61 @@ export class PendentesPage implements OnInit {
|
||||
pendentesList.push(task);
|
||||
});
|
||||
|
||||
pendentesList = removeDuplicate( pendentesList)
|
||||
pendentesList = this.sortArrayISODate(pendentesList);
|
||||
|
||||
this.pendentesstore.reset(pendentesList);
|
||||
pendentesList = removeDuplicate(pendentesList)
|
||||
pendentesList = this.sortService.sortArrayByDate(pendentesList);
|
||||
this.listToPresent = pendentesList;
|
||||
this.skeletonLoader = false;
|
||||
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any) {
|
||||
return myArray.sort(function(a, b) {
|
||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||
});
|
||||
getFromDb() {
|
||||
|
||||
if (synchro.connected === true) {
|
||||
const location = window.location
|
||||
const pathname = location.pathname + location.search
|
||||
|
||||
this.LoadList()
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
|
||||
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.refreshing()
|
||||
} else {
|
||||
this.LoadList()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
synchro.registerCallback('Offline', () => {
|
||||
this.platform.ready().then(() => {
|
||||
this.sqliteservice.getAllProcess().then((process: any[]) => {
|
||||
var pendingList = []
|
||||
process.forEach(element => {
|
||||
var workflow = JSON.parse(element.workflowInstanceDataFields);
|
||||
if (workflow.Status === "Pending") {
|
||||
let task = {
|
||||
"CreateDate": new Date(element.taskStartDate),
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"FolderID": workflow.FolderID,
|
||||
"Folio": workflow.Subject,
|
||||
"Senders": workflow.Sender,
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Status": workflow.Status,
|
||||
"WorkflowName": element.workflowDisplayName
|
||||
|
||||
}
|
||||
pendingList.push(task)
|
||||
}
|
||||
});
|
||||
|
||||
pendingList = this.sortService.sortArrayISODate(pendingList);
|
||||
this.listToPresent = pendingList;
|
||||
console.log('pendentes', pendingList)
|
||||
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
async refreshing() {
|
||||
@@ -115,24 +155,24 @@ export class PendentesPage implements OnInit {
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
async viewTaskDetails({ SerialNumber, WorkflowName, activityInstanceName }:customTask) {
|
||||
if(WorkflowName == 'Despacho') {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos',SerialNumber,'gabinete-digital']);
|
||||
async viewTaskDetails({ SerialNumber, WorkflowName, activityInstanceName }: customTask) {
|
||||
if (WorkflowName == 'Despacho') {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos', SerialNumber, 'gabinete-digital']);
|
||||
}
|
||||
else if(WorkflowName == 'Pedido de Parecer' || WorkflowName == 'Pedido de Deferimento' || WorkflowName == 'Pedido de Parecer do Presidente') {
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos',SerialNumber,'gabinete-digital']);
|
||||
else if (WorkflowName == 'Pedido de Parecer' || WorkflowName == 'Pedido de Deferimento' || WorkflowName == 'Pedido de Parecer do Presidente') {
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos', SerialNumber, 'gabinete-digital']);
|
||||
}
|
||||
else if(WorkflowName == 'Expediente') {
|
||||
this.router.navigate(['/home/gabinete-digital/expediente',SerialNumber,'gabinete-digital']);
|
||||
else if (WorkflowName == 'Expediente') {
|
||||
this.router.navigate(['/home/gabinete-digital/expediente', SerialNumber, 'gabinete-digital']);
|
||||
}
|
||||
else if(WorkflowName == 'Expediente' && this.loggeduser.Profile == 'PR') {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr',SerialNumber,'gabinete-digital']);
|
||||
else if (WorkflowName == 'Expediente' && this.loggeduser.Profile == 'PR') {
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr', SerialNumber, 'gabinete-digital']);
|
||||
}
|
||||
else if (activityInstanceName == "Tarefa de Parecer") {
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos',SerialNumber,'gabinete-digital']);
|
||||
this.router.navigate(['/home/gabinete-digital/pedidos', SerialNumber, 'gabinete-digital']);
|
||||
}
|
||||
else if(activityInstanceName == "Tarefa de Despacho") {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos',SerialNumber,'gabinete-digital']);
|
||||
else if (activityInstanceName == "Tarefa de Despacho") {
|
||||
this.router.navigate(['/home/gabinete-digital/despachos', SerialNumber, 'gabinete-digital']);
|
||||
}
|
||||
else {
|
||||
console.log('cant find page for this task', WorkflowName, activityInstanceName)
|
||||
@@ -144,4 +184,4 @@ export class PendentesPage implements OnInit {
|
||||
return new Date(e).toDateString()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,9 @@ export class LoginPage implements OnInit {
|
||||
) {
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
ngOnInit() {
|
||||
|
||||
}
|
||||
|
||||
//Function to validade the login inputs
|
||||
validateUsername() {
|
||||
@@ -93,7 +95,7 @@ export class LoginPage implements OnInit {
|
||||
await this.authService.SetSession(attempt, this.userattempt);
|
||||
await this.authService.loginChat(this.userattempt);
|
||||
this.getToken();
|
||||
SessionStore.setInativity(true)
|
||||
SessionStore.setInativity(true);
|
||||
|
||||
this.goback()
|
||||
} else {
|
||||
|
||||
@@ -6,6 +6,8 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ImageModalPage } from '../gallery/image-modal/image-modal.page';
|
||||
import { NewPublicationPage } from '../new-publication/new-publication.page';
|
||||
import { Location } from '@angular/common';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -25,7 +27,8 @@ export class PublicationDetailPage implements OnInit {
|
||||
private publications:PublicationsService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private location: Location ) {
|
||||
private location: Location,
|
||||
private sqliteservice: SqliteService ) {
|
||||
|
||||
this.publicationId = this.navParams.get('publicationId');
|
||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||
@@ -77,6 +80,14 @@ export class PublicationDetailPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
if(synchro.connected === true) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
close() {
|
||||
this.location.back()
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<div class="aside overflow-y-auto d-flex flex-wrap width-100">
|
||||
<!-- <ion-list class="width-100"> -->
|
||||
<ion-item-sliding disabled="{{showSlidingOptions}}" class="width-100 cursor-pointer"
|
||||
*ngFor="let viagem of publicationTravelFolderService.list">
|
||||
*ngFor="let viagem of publicationsTravelFolderList">
|
||||
<ion-item lines="none"
|
||||
class="item width-100 d-flex ion-no-border ion-no-margin ion-no-padding"
|
||||
[class.item-active]="viagem.ProcessId == idSelected"
|
||||
@@ -73,7 +73,7 @@
|
||||
</ion-item-sliding>
|
||||
|
||||
<ion-item-sliding disabled="{{showSlidingOptions}}" class="width-100"
|
||||
*ngFor="let evento of publicationEventFolderStorage.list">
|
||||
*ngFor="let evento of publicationsEventFolderList">
|
||||
<ion-item lines="none"
|
||||
class="item cursor-pointer width-100 d-flex ion-no-border ion-no-margin ion-no-padding"
|
||||
[class.item-active]="evento.ProcessId == idSelected"
|
||||
|
||||
@@ -13,6 +13,8 @@ import { EditActionPage } from './edit-action/edit-action.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { PublicationEventFolderStorage } from 'src/app/store/publication-event-folder.service';
|
||||
import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-folder.service';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-publications',
|
||||
@@ -28,11 +30,11 @@ export class PublicationsPage implements OnInit {
|
||||
actionsListStorage: PublicationFolder[] = new Array();
|
||||
publicationsTravelFolderList: PublicationFolder[];
|
||||
|
||||
theDate:any;
|
||||
theEndDate:any;
|
||||
customDate:any;
|
||||
theDate: any;
|
||||
theEndDate: any;
|
||||
customDate: any;
|
||||
months: string[];
|
||||
days:string[];
|
||||
days: string[];
|
||||
|
||||
publicationEventFolderStorage = PublicationEventFolderStorage
|
||||
publicationTravelFolderService = PublicationTravelFolderStore
|
||||
@@ -61,41 +63,33 @@ export class PublicationsPage implements OnInit {
|
||||
private modalController: ModalController,
|
||||
private animationController: AnimationController,
|
||||
private publications: PublicationsService,
|
||||
private toastService: ToastService
|
||||
) {
|
||||
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
const pathname = window.location.pathname
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == pathname) {
|
||||
this.getActions();
|
||||
}
|
||||
});
|
||||
|
||||
this.hideRefreshButton();
|
||||
private toastService: ToastService,
|
||||
private sqliteservice: SqliteService
|
||||
) {
|
||||
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
}
|
||||
|
||||
hideRefreshButton(){
|
||||
ngOnInit() {
|
||||
this.getFromDB();
|
||||
}
|
||||
|
||||
hideRefreshButton() {
|
||||
window.onresize = (event) => {
|
||||
if( window.innerWidth < 801) {
|
||||
if (window.innerWidth < 801) {
|
||||
this.hideRefreshBtn = false;
|
||||
this.showSlidingOptions = false;
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.hideRefreshBtn = true;
|
||||
this.showSlidingOptions = true;
|
||||
}
|
||||
}
|
||||
if(window.innerWidth < 801){
|
||||
if (window.innerWidth < 801) {
|
||||
this.hideRefreshBtn = false;
|
||||
this.showSlidingOptions = false;
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.hideRefreshBtn = true;
|
||||
this.showSlidingOptions = true;
|
||||
}
|
||||
@@ -120,12 +114,14 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
getDate(date) {
|
||||
this.theDate = new Date(date);
|
||||
return this.theDate.getDate() +" de " + ( this.months[this.theDate.getMonth()])+" de " +this.theDate.getFullYear()
|
||||
return this.theDate.getDate() + " de " + (this.months[this.theDate.getMonth()]) + " de " + this.theDate.getFullYear()
|
||||
}
|
||||
|
||||
getActions() {
|
||||
this.showLoader = true;
|
||||
this.publications.GetPublicationFolderList().subscribe(res=>{
|
||||
this.publications.GetPublicationFolderList().subscribe(res => {
|
||||
|
||||
console.log('accoes', res)
|
||||
|
||||
this.publicationsEventFolderList = new Array();
|
||||
this.publicationsTravelFolderList = new Array();
|
||||
@@ -140,46 +136,93 @@ export class PublicationsPage implements OnInit {
|
||||
ActionType: data.ActionType,
|
||||
}
|
||||
|
||||
if(data.ActionType == "Evento") {
|
||||
this.sqliteservice.addactions(folder);
|
||||
|
||||
if (data.ActionType == "Evento") {
|
||||
console.log('Evento', folder)
|
||||
this.publicationsEventFolderList.push(folder);
|
||||
}
|
||||
else{
|
||||
else {
|
||||
console.log('Viagem', folder)
|
||||
this.publicationsTravelFolderList.push(folder);
|
||||
}
|
||||
this.showLoader = false;
|
||||
|
||||
this.publicationEventFolderStorage.reset(this.publicationsEventFolderList)
|
||||
this.publicationTravelFolderService.reset(this.publicationsTravelFolderList)
|
||||
/* this.publicationEventFolderStorage.reset(this.publicationsEventFolderList)
|
||||
this.publicationTravelFolderService.reset(this.publicationsTravelFolderList) */
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async editAction(folderId?: string){
|
||||
getFromDB() {
|
||||
|
||||
if (synchro.connected === true) {
|
||||
const pathname = window.location.pathname
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd && event.url == pathname) {
|
||||
this.getActions();
|
||||
}
|
||||
});
|
||||
|
||||
this.hideRefreshButton();
|
||||
} else {
|
||||
this.sqliteservice.getAllActions().then((actions: any[]) => {
|
||||
|
||||
console.log('offline publi', actions)
|
||||
|
||||
this.publicationsEventFolderList = new Array();
|
||||
this.publicationsTravelFolderList = new Array();
|
||||
|
||||
actions.forEach(data => {
|
||||
let folder: PublicationFolder = {
|
||||
ProcessId: data.ProcessId,
|
||||
Description: data.Description,
|
||||
Detail: data.Detail,
|
||||
DateBegin: data.DateBegin,
|
||||
DateEnd: data.DateEnd,
|
||||
ActionType: data.ActionType,
|
||||
}
|
||||
|
||||
if (data.ActionType == "Evento") {
|
||||
this.publicationsEventFolderList.push(folder);
|
||||
}
|
||||
else {
|
||||
this.publicationsTravelFolderList.push(folder);
|
||||
}
|
||||
this.showLoader = false;
|
||||
});
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async editAction(folderId?: string) {
|
||||
const modal = await this.modalController.create({
|
||||
component: EditActionPage,
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
folderId: folderId,
|
||||
},
|
||||
cssClass: 'new-action modal modal-desktop',
|
||||
backdropDismiss: true
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(()=>{
|
||||
modal.onDidDismiss().then(() => {
|
||||
this.getActions();
|
||||
});
|
||||
//this.refreshing()
|
||||
}
|
||||
|
||||
async deleteAction(id?: string){
|
||||
async deleteAction(id?: string) {
|
||||
|
||||
const loader = this.toastService.loading();
|
||||
|
||||
try {
|
||||
await this.publications.DeletePresidentialAction(id).toPromise();
|
||||
this.toastService.successMessage()
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
finally {
|
||||
@@ -189,21 +232,21 @@ export class PublicationsPage implements OnInit {
|
||||
this.refreshing()
|
||||
}
|
||||
|
||||
async AddPublicationFolder(item?:any) {
|
||||
async AddPublicationFolder(item?: any) {
|
||||
|
||||
this.closeDesktopComponent();
|
||||
if(window.innerWidth <= 1024) {
|
||||
if (window.innerWidth <= 1024) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: NewActionPage,
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
item: item,
|
||||
},
|
||||
cssClass: 'new-action modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(()=>{
|
||||
modal.onDidDismiss().then(() => {
|
||||
this.getActions();
|
||||
});
|
||||
} else {
|
||||
@@ -212,12 +255,12 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
goToPublicationsList(folderId: string){
|
||||
goToPublicationsList(folderId: string) {
|
||||
this.folderId = folderId
|
||||
this.idSelected = folderId;
|
||||
|
||||
if( window.innerWidth <= 800){
|
||||
this.router.navigate(['/home/publications',folderId]);
|
||||
if (window.innerWidth <= 800) {
|
||||
this.router.navigate(['/home/publications', folderId]);
|
||||
} else {
|
||||
this.closeDesktopComponent();
|
||||
this.folderId = folderId
|
||||
@@ -256,14 +299,14 @@ export class PublicationsPage implements OnInit {
|
||||
this.closeDesktopComponent();
|
||||
|
||||
// OpenModal
|
||||
if( window.innerWidth <= 800){
|
||||
if (window.innerWidth <= 800) {
|
||||
/* let item = this.publicationFolderList; */
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewPublicationsPage,
|
||||
//enterAnimation,
|
||||
//leaveAnimation,
|
||||
componentProps:{
|
||||
folderId:folderId,
|
||||
componentProps: {
|
||||
folderId: folderId,
|
||||
},
|
||||
cssClass: 'new-action modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
@@ -281,7 +324,7 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
// called from publications details
|
||||
// Emittter
|
||||
goBackToViewPublications(){
|
||||
goBackToViewPublications() {
|
||||
|
||||
this.closeDesktopComponent();
|
||||
this.desktopComponent.showViewPublication = true;
|
||||
@@ -289,21 +332,21 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
// called from publications details
|
||||
// Emitters
|
||||
goBackToPubications(){
|
||||
goBackToPubications() {
|
||||
this.closeDesktopComponent();
|
||||
this.desktopComponent.showViewPublication = true;
|
||||
}
|
||||
|
||||
// called from edit publication (Emitters only)
|
||||
// Emitters
|
||||
async goBacktoPublicationDetails(){
|
||||
async goBacktoPublicationDetails() {
|
||||
this.closeDesktopComponent();
|
||||
this.desktopComponent.showPublicationDetail = true;
|
||||
|
||||
}
|
||||
|
||||
// add new publication or edit publicaton
|
||||
async addNewPublication({publicationType, folderId, publication}){
|
||||
async addNewPublication({ publicationType, folderId, publication }) {
|
||||
|
||||
this.closeDesktopComponent();
|
||||
|
||||
@@ -319,7 +362,7 @@ export class PublicationsPage implements OnInit {
|
||||
this.desktopComponent.showAddNewPublication = true;
|
||||
}
|
||||
|
||||
async openPublicationDetails(publicationId: string){
|
||||
async openPublicationDetails(publicationId: string) {
|
||||
|
||||
this.publicationId = publicationId;
|
||||
|
||||
@@ -328,11 +371,11 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async updateDesktopComponent(e?:any){
|
||||
async updateDesktopComponent(e?: any) {
|
||||
this.getActions();
|
||||
}
|
||||
|
||||
async closeDesktopComponent (xx?: any){
|
||||
async closeDesktopComponent(xx?: any) {
|
||||
|
||||
this.desktopComponent = {
|
||||
showViewPublication: false,
|
||||
@@ -380,10 +423,10 @@ export class PublicationsPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(res => {
|
||||
if(res['data']=='edit') {
|
||||
if (res['data'] == 'edit') {
|
||||
this.closeDesktopComponent();
|
||||
this.desktopComponent.showEditActions = true;
|
||||
} else if (res['data']=='delete') {
|
||||
} else if (res['data'] == 'delete') {
|
||||
setTimeout(() => {
|
||||
this.getActions();
|
||||
}, 1000)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<ion-list>
|
||||
<!-- [routerLink]="['/home/publications/view-publications/publication-detail', publication.publicationId]" -->
|
||||
<div class="post-item"
|
||||
*ngFor="let publication of publicationListStorage.documents[folderId]"
|
||||
*ngFor="let publication of getpublication"
|
||||
(click)="goToPublicationDetail(publication.DocumentId)"
|
||||
>
|
||||
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
|
||||
|
||||
@@ -10,6 +10,8 @@ import { PublicationListStorage } from 'src/app/store/publication-list.service';
|
||||
import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-folder.service';
|
||||
import { NewPublicationPage } from '../new-publication/new-publication.page';
|
||||
import { PublicationDetailPage } from './publication-detail/publication-detail.page';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -22,7 +24,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
publicationList: Publication[] = new Array();
|
||||
item: PublicationFolder;
|
||||
folderId:string;
|
||||
folderId: string;
|
||||
error: any;
|
||||
|
||||
publicationListStorage = PublicationListStorage
|
||||
@@ -31,18 +33,22 @@ export class ViewPublicationsPage implements OnInit {
|
||||
publicationTravelFolderService = PublicationTravelFolderStore
|
||||
|
||||
publicationPipe = new PublicationPipe()
|
||||
publicationDitails: any;
|
||||
getpublication = [];
|
||||
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private publications: PublicationsService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router) {
|
||||
private router: Router,
|
||||
private sqliteservice: SqliteService) {
|
||||
|
||||
this.item = new PublicationFolder();
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
console.log(params);
|
||||
|
||||
if(params["params"]) {
|
||||
if (params["params"]) {
|
||||
this.folderId = params["params"].folderId;
|
||||
// console.log(params["params"]);
|
||||
}
|
||||
@@ -53,20 +59,17 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
if(typeof(this.folderId) == 'object') {
|
||||
if (typeof (this.folderId) == 'object') {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
}
|
||||
|
||||
this.getPublicationDetail();
|
||||
setTimeout(() => {
|
||||
this.getPublications();
|
||||
}, 5000);
|
||||
this.getFromDB();
|
||||
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
|
||||
if(typeof(this.folderId) == 'object') {
|
||||
if (typeof (this.folderId) == 'object') {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
}
|
||||
|
||||
@@ -74,7 +77,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.getPublications();
|
||||
}
|
||||
|
||||
doRefresh =(event) => {
|
||||
doRefresh = (event) => {
|
||||
setTimeout(() => {
|
||||
this.getPublicationDetail();
|
||||
this.getPublications();
|
||||
@@ -96,7 +99,9 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
setTimeout(() => {
|
||||
let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list)
|
||||
this.item = allActions.find((e)=> e.ProcessId == this.folderId);
|
||||
this.item = allActions.find((e) => e.ProcessId == this.folderId);
|
||||
this.publicationDitails = this.item
|
||||
console.log('item', this.item)
|
||||
}, 100);
|
||||
|
||||
}
|
||||
@@ -104,37 +109,86 @@ export class ViewPublicationsPage implements OnInit {
|
||||
getPublications() {
|
||||
this.showLoader = true;
|
||||
const folderId = this.folderId
|
||||
this.publications.GetPublications(this.folderId).subscribe(res=>{
|
||||
|
||||
this.publications.GetPublications(this.folderId).subscribe(res => {
|
||||
console.log(this.folderId)
|
||||
|
||||
this.publicationList = new Array();
|
||||
|
||||
|
||||
res.forEach(element => {
|
||||
console.log('getPublications', element)
|
||||
let item: Publication = this.publicationPipe.itemList(element)
|
||||
this.publicationList.push(item);
|
||||
});
|
||||
this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList));
|
||||
|
||||
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
this.getpublication = this.publicationList;
|
||||
|
||||
this.showLoader = false;
|
||||
},
|
||||
(error)=>{
|
||||
if(error.status == '404'){
|
||||
this.error = 'Sem publicações disponíveis!';
|
||||
this.publicationList= [];
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
}
|
||||
(error) => {
|
||||
if (error.status == '404') {
|
||||
this.error = 'Sem publicações disponíveis!';
|
||||
this.publicationList = [];
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
this.showLoader = false;
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async AddPublication(publicationType:any, folderId:any) {
|
||||
getFromDB() {
|
||||
if (synchro.connected === true) {
|
||||
this.getPublicationDetail();
|
||||
setTimeout(() => {
|
||||
this.getPublications();
|
||||
}, 5000);
|
||||
|
||||
} else {
|
||||
|
||||
this.sqliteservice.getActionById(this.folderId).then((publications) => {
|
||||
console.log('publications', publications)
|
||||
let item = {
|
||||
ActionType: publications[0].ActionType,
|
||||
DateBegin: publications[0].DateBegin,
|
||||
DateEnd: publications[0].DateEnd,
|
||||
Description: publications[0].Description,
|
||||
Detail: publications[0].Detail,
|
||||
ProcessId: publications[0].ProcessId
|
||||
}
|
||||
this.publicationDitails = item;
|
||||
|
||||
let publicationArray = [];
|
||||
JSON.parse(publications[0].publications).forEach(element => {
|
||||
let publicationlis = {
|
||||
DateIndex: element.DateIndex,
|
||||
DatePublication: element.DatePublication,
|
||||
DocumentId: element.DocumentId,
|
||||
FileBase64: element.FileBase64,
|
||||
FileExtension: element.FileExtension,
|
||||
Message: element.Message,
|
||||
OrganicEntityId: element.OrganicEntityId,
|
||||
OriginalFileName: element.OriginalFileName,
|
||||
ProcessId: element.ProcessId
|
||||
}
|
||||
publicationArray.push(publicationlis);
|
||||
|
||||
});
|
||||
|
||||
this.getpublication = publicationArray;
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
async AddPublication(publicationType: any, folderId: any) {
|
||||
const modal = await this.modalController.create({
|
||||
component: NewPublicationPage,
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
publicationType: publicationType,
|
||||
folderId: folderId,
|
||||
},
|
||||
@@ -142,19 +196,19 @@ export class ViewPublicationsPage implements OnInit {
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(()=>{
|
||||
modal.onDidDismiss().then(() => {
|
||||
this.doRefresh(event);
|
||||
});
|
||||
}
|
||||
|
||||
goToPublicationDetail(publicationId:string){
|
||||
goToPublicationDetail(publicationId: string) {
|
||||
this.router.navigate(['/home/publications/view-publications', this.folderId, publicationId]);
|
||||
}
|
||||
|
||||
async viewPublicationDetail(publicationId:string) {
|
||||
async viewPublicationDetail(publicationId: string) {
|
||||
const modal = await this.modalController.create({
|
||||
component: PublicationDetailPage,
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
publicationId: publicationId,
|
||||
folderId: this.folderId,
|
||||
},
|
||||
@@ -162,7 +216,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
// backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(()=>{
|
||||
modal.onDidDismiss().then(() => {
|
||||
this.getPublications();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import { AuthConnstants } from '../config/auth-constants';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { AESEncrypt } from '../services/aesencrypt.service';
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -27,6 +28,7 @@ export class AuthService {
|
||||
private storageService:StorageService,
|
||||
public alertController: AlertController,
|
||||
private aesencrypt: AESEncrypt,
|
||||
private cookieService: CookieService,
|
||||
) {
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
@@ -102,8 +104,10 @@ export class AuthService {
|
||||
console.log('Login to Rocket chat OK');
|
||||
this.ValidatedUserChat = responseChat;
|
||||
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
||||
localStorage.setItem('Meteor.loginToken', JSON.stringify(responseChat['data'].userId));
|
||||
localStorage.setItem('Meteor.userId', JSON.stringify(responseChat['data'].authToken));
|
||||
localStorage.setItem('Meteor.loginToken', responseChat['data'].authToken);
|
||||
localStorage.setItem('Meteor.userId',responseChat['data'].userId);
|
||||
this.cookieService.set('rc_token', responseChat['data'].authToken);
|
||||
this.cookieService.set('rc_uid', responseChat['data'].userId);
|
||||
this.storageService.store(AuthConnstants.AUTH, responseChat);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EventTrigger } from './eventTrigger.service';
|
||||
|
||||
describe('EventsService', () => {
|
||||
let service: EventTrigger;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(EventTrigger);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
|
||||
|
||||
export class EventTrigger {
|
||||
|
||||
private eventSubject = new Subject<any>()
|
||||
|
||||
publishSomeData(data: any){
|
||||
this.eventSubject.next(data)
|
||||
}
|
||||
|
||||
getObservable(): Subject<any>{
|
||||
return this.eventSubject
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { AttachmentsPage } from './attachments.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: AttachmentsPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class AttachmentsPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { AttachmentsPageRoutingModule } from './attachments-routing.module';
|
||||
|
||||
import { AttachmentsPage } from './attachments.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
AttachmentsPageRoutingModule
|
||||
],
|
||||
declarations: [AttachmentsPage]
|
||||
})
|
||||
export class AttachmentsPageModule {}
|
||||
@@ -0,0 +1,62 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button (click)="close()" defaultHref="" icon="chevron-back"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title>Anexos do evento</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
<div *ngIf="loadedEventAttachments">
|
||||
<ion-list>
|
||||
<ion-item-sliding>
|
||||
<ion-item class="main-item" lines="none" *ngFor="let att of loadedEventAttachments" (click)="viewDocument(att.Link)">
|
||||
<ion-icon style="zoom:1.5" class="ion-icon-attach" name="attach"></ion-icon>
|
||||
<ion-label class="div-content-attachment">
|
||||
<h3 class="h3">{{ att.SourceName }}</h3>
|
||||
<p>{{ att.Description }}</p>
|
||||
<p>{{ att.CreateDate }}</p>
|
||||
<p class="item-list-small">{{ att.Stakeholders }}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</ion-list>
|
||||
</div>
|
||||
<!-- Skeleton screen -->
|
||||
<div *ngIf="!loadedEventAttachments">
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-avatar slot="start">
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
</ion-avatar>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-avatar slot="start">
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
</ion-avatar>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,57 @@
|
||||
ion-back-button {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* CONTENT */
|
||||
ion-content{
|
||||
--background: #f2f2f2;
|
||||
}
|
||||
.div-attach-results{
|
||||
background: none;
|
||||
}
|
||||
ion-list, ion-item-sliding{
|
||||
background: none;
|
||||
|
||||
}
|
||||
.item-list-small{
|
||||
font-size: 14px;
|
||||
overflow: auto;
|
||||
}
|
||||
.ion-item-class{
|
||||
padding: 0;
|
||||
|
||||
}
|
||||
.label-text{
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
//DIV
|
||||
.main-item{
|
||||
margin: 15px;
|
||||
/* border: 1px solid #ccc; */
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 4px 8px 0 #ccc, 0 6px 20px 0 #f2f2f2;
|
||||
}
|
||||
.div-content-attachment{
|
||||
margin:0;
|
||||
padding: 10px;
|
||||
}
|
||||
.div-content-attachment h3{
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
ion-item ion-icon{
|
||||
--border-color: red;
|
||||
}
|
||||
|
||||
/* Custom Skeleton Line Height and Margin */
|
||||
.custom-skeleton ion-skeleton-text {
|
||||
line-height: 13px;
|
||||
}
|
||||
|
||||
.custom-skeleton ion-skeleton-text:last-child {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { AttachmentsPage } from './attachments.page';
|
||||
|
||||
describe('AttachmentsPage', () => {
|
||||
let component: AttachmentsPage;
|
||||
let fixture: ComponentFixture<AttachmentsPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AttachmentsPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AttachmentsPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,47 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
|
||||
@Component({
|
||||
selector: 'app-attachments',
|
||||
templateUrl: './attachments.page.html',
|
||||
styleUrls: ['./attachments.page.scss'],
|
||||
})
|
||||
export class AttachmentsPage implements OnInit {
|
||||
|
||||
loadedEventAttachments: Attachment[];
|
||||
pageId: string;
|
||||
|
||||
constructor(
|
||||
private attachamentsService: AttachmentsService,
|
||||
private iab: InAppBrowser,
|
||||
private modalCtrl: ModalController,
|
||||
private navParams: NavParams) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.loadAttachments(this.navParams.get('eventId'));
|
||||
}
|
||||
|
||||
loadAttachments(eventid:string)
|
||||
{
|
||||
this.attachamentsService.getAttachmentsById(eventid).subscribe(attachments => {
|
||||
this.loadedEventAttachments = attachments;
|
||||
this.pageId = eventid;
|
||||
});
|
||||
}
|
||||
|
||||
async viewDocument(documenturl:string)
|
||||
{
|
||||
const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
const browser = this.iab.create(url,"_blank");
|
||||
browser.show();
|
||||
}
|
||||
close(){
|
||||
this.modalCtrl.dismiss(null);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { AttendeesPageModal } from './attendees.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: AttendeesPageModal
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class AttendeesPageRoutingModule {}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { AttendeesPageRoutingModule } from './attendees-routing.module';
|
||||
|
||||
import { AttendeesPageModal } from './attendees.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
AttendeesPageRoutingModule
|
||||
],
|
||||
declarations: [AttendeesPageModal],
|
||||
exports: [AttendeesPageModal]
|
||||
})
|
||||
export class AttendeesPageModule {}
|
||||
@@ -0,0 +1,87 @@
|
||||
<ion-header class="ion-no-border px-20">
|
||||
<ion-toolbar class="px-10">
|
||||
<ion-title class="pa-0">Adicionar intervenientes</ion-title>
|
||||
</ion-toolbar>
|
||||
<ion-searchbar class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content class="height-100 overflow-y-auto">
|
||||
|
||||
<ion-item-group class="d-flex flex-column height-100 ">
|
||||
<ion-list lines="none" class="flex-grow-1 overflow-y-auto height-100" >
|
||||
<ion-item-sliding class="px-20">
|
||||
<div *ngFor="let attendee of contacts;">
|
||||
<ion-item (click)="selectContact(attendee)" class="cursor-pointer" lines="none" *ngIf="filterSearchList(attendee)" >
|
||||
<div class="pr-10">
|
||||
<ion-icon class="font-35" src="assets/images/icons-userprofile.svg"></ion-icon>
|
||||
</div>
|
||||
<ion-label>
|
||||
<h3>{{ attendee.Name }}</h3>
|
||||
<p>{{ attendee.EmailAddress }}</p>
|
||||
</ion-label>
|
||||
<div>
|
||||
<ion-icon class="font-35" src="assets/images/icons-add-25.svg"></ion-icon>
|
||||
</div>
|
||||
</ion-item>
|
||||
</div>
|
||||
|
||||
</ion-item-sliding>
|
||||
</ion-list>
|
||||
<hr/>
|
||||
|
||||
<ion-list lines="none" *ngIf="taskParticipants?.length >= 1 && adding == 'intervenient' " class="flex-grow-1 overflow-y-auto height-100 pb-0" >
|
||||
<div class="px-20 font-15 pt-20" style="border-top:1px solid #ebebeb;font-weight: 500;" *ngIf="taskParticipants.length >= 1 || taskParticipantsCc.length >= 1" > Destinatário</div>
|
||||
<ion-item-sliding class="px-20">
|
||||
<ion-item lines="none" *ngFor="let attendee of taskParticipants;" class="d-flex">
|
||||
<div class="pr-10">
|
||||
<ion-icon class="font-35" src="assets/images/icons-userprofile.svg"></ion-icon>
|
||||
</div>
|
||||
<ion-label>
|
||||
<h3>{{ attendee.Name }}</h3>
|
||||
<p>{{ attendee.EmailAddress }}</p>
|
||||
</ion-label>
|
||||
<div class="cursor-pointer" (click)="remove(attendee)">
|
||||
<ion-icon class="font-35" src="assets/images/icons-delete-25.svg"></ion-icon>
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</ion-list>
|
||||
<ion-list lines="none" *ngIf="taskParticipantsCc?.length >= 1 && adding == 'CC' " class="flex-grow-1 overflow-y-auto height-100 pb-0" >
|
||||
<div class="px-20 font-15 pt-20" style="border-top:1px solid #ebebeb;font-weight: 500;" *ngIf="taskParticipants.length >= 1 || taskParticipantsCc.length >= 1" > Destinatário</div>
|
||||
|
||||
<ion-item-sliding class="px-20">
|
||||
<ion-item lines="none" *ngFor="let attendee of taskParticipantsCc;" class="d-flex">
|
||||
<div class="pr-10">
|
||||
<ion-icon class="font-35" src="assets/images/icons-userprofile.svg"></ion-icon>
|
||||
</div>
|
||||
<ion-label>
|
||||
<h3>{{ attendee.Name }}</h3>
|
||||
<p>{{ attendee.EmailAddress }}</p>
|
||||
</ion-label>
|
||||
<div class="cursor-pointer" (click)="remove(attendee)">
|
||||
<ion-icon class="font-35" src="assets/images/icons-delete-25.svg"></ion-icon>
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</ion-list>
|
||||
</ion-item-group>
|
||||
|
||||
</ion-content>
|
||||
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar class="d-flex">
|
||||
<ion-buttons class="flex-grow-1" slot="start">
|
||||
<button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
|
||||
<ion-label>Cancelar</ion-label>
|
||||
<ion-icon name="close" slot="start"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
<ion-buttons class="flex-grow-1" slot="end">
|
||||
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
|
||||
<ion-label>Gravar</ion-label>
|
||||
<ion-icon name="checkmark" slot="start"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
@@ -0,0 +1,3 @@
|
||||
ion-item{
|
||||
border-bottom:1px solid #ccc;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { AttendeesPageModal } from './attendees.page';
|
||||
|
||||
describe('AttendeesPage', () => {
|
||||
let component: AttendeesPageModal;
|
||||
let fixture: ComponentFixture<AttendeesPageModal>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ AttendeesPageModal ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(AttendeesPageModal);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,142 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-attendees',
|
||||
templateUrl: './attendees.page.html',
|
||||
styleUrls: ['./attendees.page.scss'],
|
||||
})
|
||||
export class AttendeesPageModal implements OnInit {
|
||||
|
||||
// Defined by the API
|
||||
contacts: EventPerson[];
|
||||
showLoader: boolean = false;
|
||||
selectedContact: EventPerson[] =[];
|
||||
eventPersons: EventPerson[];
|
||||
adding: "intervenient" | "CC";
|
||||
currentPath = window.location.pathname;
|
||||
|
||||
taskParticipants:EventPerson[] = [];
|
||||
taskParticipantsCc:EventPerson[] = [];
|
||||
|
||||
constructor(
|
||||
private modalCtrl: ModalController,
|
||||
private contactsService: ContactsService,
|
||||
private navParams: NavParams,
|
||||
private modalController: ModalController) {
|
||||
|
||||
this.adding = this.navParams.get('adding');
|
||||
this.taskParticipants = this.navParams.get('taskParticipants');
|
||||
this.taskParticipantsCc = this.navParams.get('taskParticipantsCc');
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.fetchContacts("");
|
||||
|
||||
if(this.taskParticipants == null || this.taskParticipants == undefined){
|
||||
this.taskParticipants = [];
|
||||
}
|
||||
|
||||
if(this.taskParticipantsCc == null || this.taskParticipantsCc == undefined){
|
||||
this.taskParticipantsCc = [];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ngOnChanges(event) {}
|
||||
|
||||
save(){
|
||||
|
||||
this.modalController.dismiss({
|
||||
'taskParticipants': this.taskParticipants,
|
||||
'taskParticipantsCc': this.taskParticipantsCc
|
||||
});
|
||||
}
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss(false);
|
||||
}
|
||||
|
||||
onChange(evt: any) {
|
||||
this.fetchContacts(evt.detail.value);
|
||||
}
|
||||
|
||||
filterSearchList(itm: EventPerson): boolean {
|
||||
|
||||
const result = this.taskParticipants.concat( this.taskParticipantsCc).find((contact, index)=>{
|
||||
|
||||
if(contact.Name.toLocaleLowerCase() == itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() == itm.EmailAddress.toLocaleLowerCase()){
|
||||
index = index;
|
||||
return contact;
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
return undefined == result;
|
||||
|
||||
}
|
||||
|
||||
remove(itm: EventPerson){
|
||||
|
||||
if(this.adding == "intervenient"){
|
||||
|
||||
this.taskParticipants = this.taskParticipants.filter((contact, index) =>{
|
||||
|
||||
if(contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()){
|
||||
return contact;
|
||||
}
|
||||
return false;
|
||||
|
||||
});
|
||||
|
||||
} else if (this.adding == "CC") {
|
||||
|
||||
this.taskParticipantsCc = this.taskParticipantsCc.filter((contact, index) =>{
|
||||
|
||||
if(contact.Name.toLocaleLowerCase() != itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() != itm.EmailAddress.toLocaleLowerCase()){
|
||||
return contact;
|
||||
}
|
||||
return false;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async selectContact(itm: EventPerson){
|
||||
if(this.adding == "intervenient"){
|
||||
itm.IsRequired = true;
|
||||
this.taskParticipants.push(itm);
|
||||
|
||||
} else if (this.adding == "CC") {
|
||||
itm.IsRequired = false;
|
||||
this.taskParticipantsCc.push(itm);
|
||||
}
|
||||
}
|
||||
|
||||
async fetchContacts(filter: string) {
|
||||
this.showLoader = true;
|
||||
|
||||
this.contactsService.getContacts(filter).subscribe(result =>
|
||||
{
|
||||
if (this.eventPersons != null)
|
||||
{
|
||||
this.eventPersons.forEach(attendee => {
|
||||
const index: number = result.findIndex((cont) => {
|
||||
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
|
||||
});
|
||||
|
||||
result.splice(index, 1);
|
||||
});
|
||||
}
|
||||
|
||||
this.contacts = result;
|
||||
this.showLoader = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EditEventPage } from './edit-event.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EditEventPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class EditEventPageRoutingModule {}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EditEventPageRoutingModule } from './edit-event-routing.module';
|
||||
|
||||
import { EditEventPage } from './edit-event.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
EditEventPageRoutingModule
|
||||
],
|
||||
declarations: [EditEventPage],
|
||||
exports: [EditEventPage]
|
||||
})
|
||||
export class EditEventPageModule {}
|
||||
@@ -0,0 +1,202 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="{{ backURL }}"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title class="header-title">Visualizar Evento</ion-title>
|
||||
<ion-buttons slot="end">
|
||||
<button (click)="deleteConfirm()" class="ion-icon-delete">
|
||||
<ion-icon name="trash"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
<div *ngIf="loadedEvent">
|
||||
<ion-item-group>
|
||||
<ion-item-sliding>
|
||||
<ion-item>
|
||||
<ion-label class="capitalizeText" position="stacked">Assunto</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]="loadedEvent.Subject" type="text" required></ion-input>
|
||||
</ion-item>
|
||||
<!-- Error messages -->
|
||||
<span class="error ion-padding" *ngIf="errorControl.subject.errors?.required">
|
||||
Campo obrigatório
|
||||
</span>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Descrição</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]='loadedEvent.Body.Text'></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Localização</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]='loadedEvent.Location'></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Calendário</ion-label>
|
||||
<ion-select class="capitalizeText" placeholder="{{loadedEvent.CalendarName}}" [(ngModel)]="loadedEvent.CalendarName" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
|
||||
<ion-select-option Pessoal="Reunião">Pessoal</ion-select-option>
|
||||
<ion-select-option Oficial="Viagem">Oficial</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Tipo do evento</ion-label>
|
||||
<ion-select placeholder="{{loadedEvent.EventType}}" [(ngModel)]="loadedEvent.EventType" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
|
||||
<ion-select-option value="Reunião">Reunião</ion-select-option>
|
||||
<ion-select-option value="Viagem">Viagem</ion-select-option>
|
||||
<ion-select-option value="Conferência">Conferência</ion-select-option>
|
||||
<ion-select-option value="Encontro">Encontro</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Data Início</ion-label>
|
||||
<ion-datetime value="{{loadedEvent.StartDate}}" [(ngModel)]="loadedEvent.StartDate" min="2020" max="2100"
|
||||
displayFormat="D MMM YYYY H:mm" minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Data Fim</ion-label>
|
||||
<ion-datetime value="{{loadedEvent.EndDate}}" [(ngModel)]="loadedEvent.EndDate" min="2020" max="2100"
|
||||
displayFormat="D MMM YYYY HH:mm" minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
<div class="div-attach" >
|
||||
<ion-item>
|
||||
<ion-buttons slot="end" (click)="openAttendees()">
|
||||
<ion-label color="secondary">Editar</ion-label>
|
||||
</ion-buttons>
|
||||
<ion-label class="attach-label">Participantes</ion-label>
|
||||
</ion-item>
|
||||
<div *ngIf="loadedEvent.Attendees">
|
||||
<div *ngFor="let attendee of loadedEvent.Attendees; let i=index">
|
||||
<div *ngIf="i<1">
|
||||
<ion-list >
|
||||
<ion-item class="attendees" lines="none" >
|
||||
<ion-icon class="attendees-icon" name="person" slot="start"></ion-icon>
|
||||
<ion-label class="capitalizeText" class="attendees-list">{{attendee.Name}}</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div *ngIf="loadedEvent.Attendees.length > 1">
|
||||
<button class="see-more-button" fill="none" shape="round" (click)="openAttendees()">
|
||||
<ion-label color="secondary">Ver mais...</ion-label>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-attach">
|
||||
<ion-item>
|
||||
<ion-buttons slot="end" (click)="showAlert()">
|
||||
<ion-label color="secondary">Editar</ion-label>
|
||||
</ion-buttons>
|
||||
<ion-label class="attach-label">Anexos</ion-label>
|
||||
</ion-item>
|
||||
<div *ngIf="loadedEventAttachments">
|
||||
<div *ngFor="let att of loadedEventAttachments; let j=index">
|
||||
<div *ngIf="j<2">
|
||||
<ion-list *ngIf="loadedEvent.HasAttachments">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-item lines="none" (click)="viewDocument(att.Link)">
|
||||
<ion-icon name="attach" slot="start"></ion-icon>
|
||||
<ion-label>
|
||||
<p>{{ att.Description }}</p>
|
||||
<p>{{ att.CreateDate }}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="loadedEventAttachments.length > 1">
|
||||
<button class="see-more-button" fill="none" shape="round" (click)="openAttachments()"><!-- [routerLink]="['/home/attachments', loadedEvent.EventId]" -->
|
||||
<ion-label color="secondary">Ver mais...</ion-label>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<ion-list *ngIf="!loadedEvent.HasAttachments">
|
||||
<ion-item lines="none" >
|
||||
<ion-label>
|
||||
Sem anexos
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-item-sliding>
|
||||
</ion-item-group>
|
||||
</div>
|
||||
<!-- Skeleton screen -->
|
||||
<div *ngIf="!loadedEvent">
|
||||
<div class="ion-padding custom-skeleton">
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 88%"></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 70%"></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</div>
|
||||
|
||||
<ion-list>
|
||||
<ion-list-header>
|
||||
<ion-label>
|
||||
<ion-skeleton-text animated style="width: 20%"></ion-skeleton-text>
|
||||
</ion-label>
|
||||
</ion-list-header>
|
||||
<ion-item>
|
||||
<ion-avatar slot="start">
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
</ion-avatar>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-thumbnail slot="start">
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
</ion-thumbnail>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-skeleton-text animated style="width: 27px; height: 27px" slot="start"></ion-skeleton-text>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<ion-toolbar>
|
||||
<div class="event-detail-buttons">
|
||||
<button class="btn-ok" fill="clear" color="#fff" shape="round" (click)="Save()">Gravar</button>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
|
||||
.content{
|
||||
padding: 30px 20px 0 20px !important;
|
||||
margin: 0;
|
||||
float: left;
|
||||
border-left: 1px solid #d8d8d8 !important;
|
||||
}
|
||||
.main-header{
|
||||
font-family: Roboto;
|
||||
background-color: #fff;
|
||||
overflow:hidden;
|
||||
color:#000;
|
||||
transform: translate3d(0, 1px, 0);
|
||||
|
||||
.title-content{
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
background: #fff;
|
||||
.middle{
|
||||
padding: 0!important;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
}
|
||||
.ion-item-container{
|
||||
margin: 15px auto;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.ion-item-container-no-border{
|
||||
width: 100%;
|
||||
margin: 0px auto;
|
||||
padding: 0 !important;
|
||||
overflow: auto;
|
||||
}
|
||||
.container-div{
|
||||
margin-bottom: 15px;
|
||||
float: left;
|
||||
overflow: auto;
|
||||
}
|
||||
.ion-item-class-2{
|
||||
margin: 0px auto;
|
||||
}
|
||||
.ion-icon-class{
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
float: left;
|
||||
padding: 10px;
|
||||
font-size: 25px;
|
||||
}
|
||||
ion-select{
|
||||
padding-left: 5px;
|
||||
margin-left: 0;
|
||||
}
|
||||
.ion-input-class{
|
||||
width: calc(100% - 45px);
|
||||
height: 45px;
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
padding-left: 5px;
|
||||
padding-right: 10px;
|
||||
float: left;
|
||||
}
|
||||
.ion-input-class-no-height{
|
||||
border: 1px solid #ebebeb;
|
||||
border-radius: 5px;
|
||||
overflow: auto;
|
||||
}
|
||||
.list-people{
|
||||
//width: 256px;
|
||||
float: left;
|
||||
|
||||
}
|
||||
.add-people{
|
||||
width: 45px;
|
||||
float: right;
|
||||
overflow: auto;
|
||||
font-size: 25px;
|
||||
padding: 10px;
|
||||
}
|
||||
.list-people-title{
|
||||
/* font-size: 13px; */
|
||||
color: #797979;
|
||||
}
|
||||
.attach-document{
|
||||
font-size: 15px;
|
||||
color: #0d89d1;
|
||||
margin: 5px 5px 5px 10px;
|
||||
padding: 5px;
|
||||
float: left;
|
||||
}
|
||||
.attach-icon{
|
||||
width: 37px;
|
||||
font-size: 35px;
|
||||
float: left;
|
||||
}
|
||||
.attach-title-item{
|
||||
width: 100%;
|
||||
font-size: 15px;
|
||||
color:#0d89d1;
|
||||
}
|
||||
/* SPAN */
|
||||
.span-left{
|
||||
float: left;
|
||||
font-size: 15x;
|
||||
}
|
||||
.span-right{
|
||||
text-align: right;
|
||||
float: right;
|
||||
font-size: 13px;
|
||||
}
|
||||
.container-footer{
|
||||
margin:0 auto;
|
||||
overflow: auto;
|
||||
}
|
||||
.button-cancel {
|
||||
width: 170px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #e0e9ee;
|
||||
--color: #061b52;
|
||||
margin:10px;
|
||||
}
|
||||
.button-save {
|
||||
width: 170px;
|
||||
height: 44px;
|
||||
border-radius: 22.5px;
|
||||
--background: #42b9fe;
|
||||
--color:#ffffff;
|
||||
margin:10px;
|
||||
}
|
||||
|
||||
.text-input{
|
||||
width: 100%;
|
||||
border: 1px solid #ebebeb;
|
||||
margin: 0px 15px 15px 0px;
|
||||
padding: 0 !important;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* Error Messages */
|
||||
.error{
|
||||
color:red;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.span-color{
|
||||
color:red;
|
||||
}
|
||||
|
||||
|
||||
.buttons{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 20px;
|
||||
overflow: auto;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EditEventPage } from './edit-event.page';
|
||||
|
||||
describe('EditEventPage', () => {
|
||||
let component: EditEventPage;
|
||||
let fixture: ComponentFixture<EditEventPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditEventPage ],
|
||||
imports: [
|
||||
IonicModule.forRoot(),
|
||||
HttpClientModule
|
||||
]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(EditEventPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,245 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { Event } from '../../../models/event.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { AlertController, ModalController } from '@ionic/angular';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { AttachmentsPage } from '../attachments/attachments.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-event',
|
||||
templateUrl: './edit-event.page.html',
|
||||
styleUrls: ['./edit-event.page.scss'],
|
||||
})
|
||||
|
||||
export class EditEventPage implements OnInit {
|
||||
|
||||
loadedEvent: Event;
|
||||
loadedEventAttachments: Attachment[];
|
||||
pageId: string;
|
||||
showLoader: boolean;
|
||||
backURL: string;
|
||||
ionicForm: FormGroup;
|
||||
isSubmitted = false;
|
||||
|
||||
minDate: Date;
|
||||
|
||||
profile:string;
|
||||
|
||||
constructor(
|
||||
public formBuilder: FormBuilder,
|
||||
public alertController: AlertController,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private eventsService: EventsService,
|
||||
private modalCtrl: ModalController,
|
||||
private alertService: AlertService,
|
||||
private attachamentsService: AttachmentsService,
|
||||
private route: Router,
|
||||
private iab: InAppBrowser) {
|
||||
this.loadedEvent = new Event();
|
||||
this.loadedEvent.Body = new EventBody();
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.loadEvent();
|
||||
this.loadAttachments();
|
||||
this.ionicForm = this.formBuilder.group({
|
||||
subject: ['', [Validators.required]]
|
||||
})
|
||||
}
|
||||
|
||||
get errorControl() {
|
||||
return this.ionicForm.controls;
|
||||
}
|
||||
|
||||
loadEvent(){
|
||||
let eventid: string;
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>
|
||||
{
|
||||
if (!paramMap.has("eventId")){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
this.pageId = paramMap.get('eventId');
|
||||
eventid = paramMap.get('eventId');
|
||||
console.log(eventid);
|
||||
|
||||
}
|
||||
if (paramMap.has("caller")){
|
||||
this.backURL = "/home/" + paramMap.get('caller');
|
||||
}
|
||||
}
|
||||
);
|
||||
this.eventsService.getEvent(eventid).subscribe(response => {
|
||||
this.loadedEvent = response;
|
||||
});
|
||||
}
|
||||
|
||||
async openAttendees(){
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: AttendeesPageModal,
|
||||
componentProps: {
|
||||
eventAttendees: this.loadedEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getEventAttendees(): EventPerson[]
|
||||
{
|
||||
return this.loadedEvent.Attendees;
|
||||
}
|
||||
|
||||
setEventAttendees(newattendes: EventPerson[])
|
||||
{
|
||||
this.loadedEvent.Attendees = newattendes;
|
||||
}
|
||||
|
||||
async deleteConfirm()
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Apagar evento!',
|
||||
message: 'Deseja <strong>apagar</strong> o evento da agenda ' + this.loadedEvent.CalendarName + '?',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Não',
|
||||
role: 'cancel',
|
||||
cssClass: 'secondary',
|
||||
handler: () => { }
|
||||
}, {
|
||||
text: 'Sim',
|
||||
handler: () => {
|
||||
this.Delete();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
Delete()
|
||||
{
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento removido',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
setTimeout(()=>{
|
||||
alert.dismiss();
|
||||
}, 1500);
|
||||
|
||||
this.router.navigate(['/home/events']);
|
||||
});
|
||||
}
|
||||
|
||||
Save()
|
||||
{
|
||||
if (this.ionicForm.valid){
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>{
|
||||
if (paramMap.has("profile")){
|
||||
console.log(paramMap.get('profile'));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento actualizado',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
setTimeout(()=>{
|
||||
alert.dismiss();
|
||||
}, 1500);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
showAlert(){
|
||||
this.alertService.presentAlert("Funcionalidade em desenvolvimento");
|
||||
}
|
||||
|
||||
loadAttachments()
|
||||
{
|
||||
/* console.log(this.pageId); */
|
||||
|
||||
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
||||
this.loadedEventAttachments = res;
|
||||
console.log(res);
|
||||
|
||||
});
|
||||
}
|
||||
async viewDocument(documenturl:string)
|
||||
{
|
||||
const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
const browser = this.iab.create(url,"_blank");
|
||||
browser.show();
|
||||
}
|
||||
|
||||
back()
|
||||
{
|
||||
//this.back();
|
||||
}
|
||||
doRefresh(event){
|
||||
/* this.RefreshEvents(); */
|
||||
event.target.complete();
|
||||
setTimeout(() => {
|
||||
event.target.complete();
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
navigateTo(ev){
|
||||
this.route.navigate(['/home/events',ev]);
|
||||
}
|
||||
async openAttachments(){
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: AttachmentsPage,
|
||||
componentProps: {
|
||||
eventId: this.pageId,
|
||||
attachments: this.loadedEventAttachments
|
||||
},
|
||||
cssClass: 'attachments',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EventDetailModalPage } from './event-detail-modal.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EventDetailModalPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class EventDetailModalPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EventDetailModalPageRoutingModule } from './event-detail-modal-routing.module';
|
||||
|
||||
import { EventDetailModalPage } from './event-detail-modal.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
EventDetailModalPageRoutingModule
|
||||
],
|
||||
declarations: [EventDetailModalPage]
|
||||
})
|
||||
export class EventDetailModalPageModule {}
|
||||
@@ -0,0 +1,215 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="{{ backURL }}"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title>Visualizar Evento</ion-title>
|
||||
<ion-buttons slot="end">
|
||||
<button (click)="deleteConfirm()" class="ion-icon-delete">
|
||||
<ion-icon name="trash"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
<div *ngIf="loadedEvent">
|
||||
<ion-item-group>
|
||||
<ion-item-sliding>
|
||||
<!-- <form [formGroup]="ionicForm" novalidate>
|
||||
<ion-item>
|
||||
<ion-label class="capitalizeText" position="stacked">Assunto</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]="loadedEvent.Subject" formControlName="subject" type="text" required></ion-input>
|
||||
</ion-item>
|
||||
//Error messages
|
||||
<span class="error ion-padding" *ngIf="errorControl.subject.errors?.required">
|
||||
Campo obrigatório
|
||||
</span>
|
||||
</form> -->
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Descrição</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]='loadedEvent.Body.Text'></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Localização</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]='loadedEvent.Location'></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Calendário</ion-label>
|
||||
<ion-select class="capitalizeText" placeholder="{{loadedEvent.CalendarName}}" [(ngModel)]="loadedEvent.CalendarName" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
|
||||
<ion-select-option Pessoal="Reunião">Pessoal</ion-select-option>
|
||||
<ion-select-option Oficial="Viagem">Oficial</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Tipo do evento</ion-label>
|
||||
<ion-select placeholder="{{loadedEvent.EventType}}" [(ngModel)]="loadedEvent.EventType" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
|
||||
<ion-select-option value="Reunião">Reunião</ion-select-option>
|
||||
<ion-select-option value="Viagem">Viagem</ion-select-option>
|
||||
<ion-select-option value="Conferência">Conferência</ion-select-option>
|
||||
<ion-select-option value="Encontro">Encontro</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Data Início</ion-label>
|
||||
<ion-datetime value="{{loadedEvent.StartDate}}" [(ngModel)]="loadedEvent.StartDate" min="2020" max="2100"
|
||||
displayFormat="D MMM YYYY H:mm" minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Data Fim</ion-label>
|
||||
<ion-datetime value="{{loadedEvent.EndDate}}" [(ngModel)]="loadedEvent.EndDate" min="2020" max="2100"
|
||||
displayFormat="D MMM YYYY HH:mm" minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
<div class="div-attach" >
|
||||
<ion-item>
|
||||
<ion-buttons slot="end" (click)="openAttendees()">
|
||||
<ion-label color="secondary">Editar</ion-label>
|
||||
</ion-buttons>
|
||||
<ion-label class="attach-label">Participantes</ion-label>
|
||||
</ion-item>
|
||||
<div *ngIf="loadedEvent.Attendees">
|
||||
<div *ngFor="let attendee of loadedEvent.Attendees; let i=index">
|
||||
<div *ngIf="i<1">
|
||||
<ion-list >
|
||||
<ion-item class="attendees" lines="none" >
|
||||
<ion-icon class="attendees-icon" name="person" slot="start"></ion-icon>
|
||||
<ion-label class="capitalizeText" class="attendees-list">{{attendee.Name}}</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div *ngIf="loadedEvent.Attendees.length > 1">
|
||||
<button class="see-more-button" fill="none" shape="round" (click)="openAttendees()">
|
||||
<ion-label color="secondary">Ver mais...</ion-label>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-attach">
|
||||
<ion-item>
|
||||
<ion-buttons slot="end" (click)="showAlert()">
|
||||
<ion-label color="secondary">Editar</ion-label>
|
||||
</ion-buttons>
|
||||
<ion-label class="attach-label">Anexos</ion-label>
|
||||
</ion-item>
|
||||
<div *ngIf="loadedEventAttachments">
|
||||
<div *ngFor="let att of loadedEventAttachments; let j=index">
|
||||
<div *ngIf="j<2">
|
||||
<ion-list *ngIf="loadedEvent.HasAttachments">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-item lines="none" (click)="viewDocument(att.Link)">
|
||||
<ion-icon name="attach" slot="start"></ion-icon>
|
||||
<ion-label>
|
||||
<p>{{ att.Description }}</p>
|
||||
<p>{{ att.CreateDate }}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="loadedEventAttachments.length > 1">
|
||||
<button class="see-more-button" fill="none" shape="round" (click)="openAttachments()"><!-- [routerLink]="['/home/attachments', loadedEvent.EventId]" -->
|
||||
<ion-label color="secondary">Ver mais...</ion-label>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Skeleton Attachment -->
|
||||
<ion-list *ngIf="!loadedEventAttachments">
|
||||
<ion-item lines="none" >
|
||||
<ion-icon name="attach" slot="start"></ion-icon>
|
||||
<ion-label>
|
||||
<p> <ion-skeleton-text animated></ion-skeleton-text></p>
|
||||
<p> <ion-skeleton-text animated></ion-skeleton-text></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
<!-- No attachment message -->
|
||||
<ion-list *ngIf="!loadedEvent.HasAttachments">
|
||||
<ion-item lines="none" >
|
||||
<ion-label>
|
||||
Sem anexos
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-item-sliding>
|
||||
</ion-item-group>
|
||||
</div>
|
||||
<!-- Skeleton screen -->
|
||||
<div *ngIf="!loadedEvent">
|
||||
<div class="ion-padding custom-skeleton">
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 88%"></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 70%"></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</div>
|
||||
|
||||
<ion-list>
|
||||
<ion-list-header>
|
||||
<ion-label>
|
||||
<ion-skeleton-text animated style="width: 20%"></ion-skeleton-text>
|
||||
</ion-label>
|
||||
</ion-list-header>
|
||||
<ion-item>
|
||||
<ion-avatar slot="start">
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
</ion-avatar>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-thumbnail slot="start">
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
</ion-thumbnail>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-skeleton-text animated style="width: 27px; height: 27px" slot="start"></ion-skeleton-text>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<ion-toolbar>
|
||||
<div class="event-detail-buttons">
|
||||
<ion-button shape="round" (click)="Save()">Gravar</ion-button>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
ion-item-group{
|
||||
margin: 15px;
|
||||
}
|
||||
.div-item{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin: 10px 0 5px 0;
|
||||
}
|
||||
.div-up{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
.div-up h3{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 17px;
|
||||
width: 100%;
|
||||
}
|
||||
.div-icon{
|
||||
width: 10%;
|
||||
font-size: 22px;
|
||||
float: left;
|
||||
color: #808080;
|
||||
}
|
||||
.div-icon ion-icon{
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
|
||||
}
|
||||
.div-content-attachment{
|
||||
width: 85%;
|
||||
float: left;
|
||||
padding: 0 0 0 12px;
|
||||
}
|
||||
.ion-icon-attach{
|
||||
color: #666666;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.btn-attach{
|
||||
margin: 15px 0 0 0;
|
||||
--color: #333;
|
||||
--border-color:#333;
|
||||
}
|
||||
.div-card-button{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
}
|
||||
ion-card{
|
||||
margin: 2.5% !important;
|
||||
width: 45%;
|
||||
float: left;
|
||||
}
|
||||
.center{
|
||||
text-align: center;
|
||||
float: center;
|
||||
}
|
||||
|
||||
/* FFOTER */
|
||||
.event-detail-buttons{
|
||||
width: 90%;
|
||||
margin: 10px auto;
|
||||
}
|
||||
.event-detail-buttons ion-button{
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.ion-icon-delete{
|
||||
font-size: 22px;
|
||||
color: red;
|
||||
background-color: white;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.error{
|
||||
color:red;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
/* .event-detail-buttons{
|
||||
margin-bottom: 80px;
|
||||
margin-top: 10px;
|
||||
} */
|
||||
.attendees-icon{
|
||||
font-size: 14px;
|
||||
}
|
||||
.see-more-button{
|
||||
text-transform: initial;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EventDetailModalPage } from './event-detail-modal.page';
|
||||
|
||||
describe('EventDetailModalPage', () => {
|
||||
let component: EventDetailModalPage;
|
||||
let fixture: ComponentFixture<EventDetailModalPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EventDetailModalPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(EventDetailModalPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,245 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AlertController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { AttachmentsPage } from '../attachments/attachments.page';
|
||||
import { AttendeesPageModal } from '../attendees/attendees.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-detail-modal',
|
||||
templateUrl: './event-detail-modal.page.html',
|
||||
styleUrls: ['./event-detail-modal.page.scss'],
|
||||
})
|
||||
export class EventDetailModalPage implements OnInit {
|
||||
|
||||
loadedEvent: Event;
|
||||
loadedEventAttachments: Attachment[];
|
||||
pageId: string;
|
||||
showLoader: boolean;
|
||||
backURL: string;
|
||||
ionicForm: FormGroup;
|
||||
isSubmitted = false;
|
||||
|
||||
minDate: Date;
|
||||
|
||||
profile:string;
|
||||
|
||||
constructor(
|
||||
public formBuilder: FormBuilder,
|
||||
public alertController: AlertController,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private eventsService: EventsService,
|
||||
private modalCtrl: ModalController,
|
||||
private alertService: AlertService,
|
||||
private attachamentsService: AttachmentsService,
|
||||
private route: Router,) {
|
||||
this.loadedEvent = new Event();
|
||||
this.loadedEvent.Body = new EventBody();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.loadEvent();
|
||||
this.loadAttachments();
|
||||
this.ionicForm = this.formBuilder.group({
|
||||
subject: ['', [Validators.required]]
|
||||
})
|
||||
|
||||
// this.setDefaultTime()
|
||||
}
|
||||
|
||||
// setDefaultTime() {
|
||||
// this.loadedEvent.StartDate = new Date()
|
||||
// this.loadedEvent.EndDate = (new Date(new Date().getTime() + 15 * 60000))
|
||||
// }
|
||||
|
||||
get errorControl() {
|
||||
return this.ionicForm.controls;
|
||||
}
|
||||
|
||||
loadEvent(){
|
||||
let eventid: string;
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>
|
||||
{
|
||||
if (!paramMap.has("eventId")){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
this.pageId = paramMap.get('eventId');
|
||||
eventid = paramMap.get('eventId');
|
||||
console.log(eventid);
|
||||
|
||||
}
|
||||
if (paramMap.has("caller")){
|
||||
this.backURL = "/home/" + paramMap.get('caller');
|
||||
}
|
||||
}
|
||||
);
|
||||
this.eventsService.getEvent(eventid).subscribe(response => {
|
||||
this.loadedEvent = response;
|
||||
});
|
||||
}
|
||||
|
||||
async openAttendees(){
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: AttendeesPageModal,
|
||||
componentProps: {
|
||||
eventAttendees: this.loadedEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getEventAttendees(): EventPerson[]
|
||||
{
|
||||
return this.loadedEvent.Attendees;
|
||||
}
|
||||
|
||||
setEventAttendees(newattendes: EventPerson[])
|
||||
{
|
||||
this.loadedEvent.Attendees = newattendes;
|
||||
}
|
||||
|
||||
async deleteConfirm()
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Apagar evento!',
|
||||
message: 'Deseja <strong>apagar</strong> o evento da agenda ' + this.loadedEvent.CalendarName + '?',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Não',
|
||||
role: 'cancel',
|
||||
cssClass: 'secondary',
|
||||
handler: () => { }
|
||||
}, {
|
||||
text: 'Sim',
|
||||
handler: () => {
|
||||
this.Delete();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
Delete()
|
||||
{
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento removido',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
setTimeout(()=>{
|
||||
alert.dismiss();
|
||||
}, 1500);
|
||||
|
||||
this.router.navigate(['/home/events']);
|
||||
});
|
||||
}
|
||||
|
||||
Save()
|
||||
{
|
||||
if (this.ionicForm.valid)
|
||||
{
|
||||
|
||||
this.eventsService.putEvent(this.loadedEvent, 2, 3, "md").subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento actualizado',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
setTimeout(()=>{
|
||||
alert.dismiss();
|
||||
}, 1500);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
showAlert(){
|
||||
this.alertService.presentAlert("Funcionalidade em desenvolvimento");
|
||||
}
|
||||
|
||||
loadAttachments()
|
||||
{
|
||||
/* this.attachamentsService.getEventAttachments(this.pageId).subscribe(attachments => {
|
||||
this.loadedEventAttachments = attachments;
|
||||
}); */
|
||||
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
||||
console.log(res);
|
||||
|
||||
},(error) => {
|
||||
console.log(error);
|
||||
|
||||
});
|
||||
}
|
||||
async viewDocument(documenturl:string)
|
||||
{
|
||||
const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
/* const browser = this.iab.create(url,"_blank");
|
||||
browser.show(); */
|
||||
}
|
||||
|
||||
back()
|
||||
{
|
||||
//this.back();
|
||||
}
|
||||
doRefresh(event){
|
||||
/* this.RefreshEvents(); */
|
||||
event.target.complete();
|
||||
setTimeout(() => {
|
||||
event.target.complete();
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
navigateTo(ev){
|
||||
this.route.navigate(['/home/events',ev]);
|
||||
}
|
||||
async openAttachments() {
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: AttachmentsPage,
|
||||
componentProps: {
|
||||
eventId: this.pageId,
|
||||
attachments: this.loadedEventAttachments
|
||||
},
|
||||
cssClass: 'attachments',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EventDetailPage } from './event-detail.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EventDetailPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class EventDetailPageRoutingModule {}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EventDetailPageRoutingModule } from './event-detail-routing.module';
|
||||
|
||||
import { EventDetailPage } from './event-detail.page';
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ReactiveFormsModule,
|
||||
EventDetailPageRoutingModule
|
||||
],
|
||||
declarations: [EventDetailPage]
|
||||
})
|
||||
export class EventDetailPageModule {}
|
||||
@@ -0,0 +1,215 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="{{ backURL }}"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title class="header-title">Visualizar Evento</ion-title>
|
||||
<ion-buttons slot="end">
|
||||
<button (click)="deleteConfirm()" class="ion-icon-delete">
|
||||
<ion-icon name="trash"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
<div *ngIf="loadedEvent">
|
||||
<ion-item-group>
|
||||
<ion-item-sliding>
|
||||
<form [formGroup]="ionicForm" novalidate>
|
||||
<ion-item>
|
||||
<ion-label class="capitalizeText" position="stacked">Assunto</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]="loadedEvent.Subject" formControlName="subject" type="text" required></ion-input>
|
||||
</ion-item>
|
||||
<!-- Error messages -->
|
||||
<span class="error ion-padding" *ngIf="errorControl.subject.errors?.required">
|
||||
Campo obrigatório
|
||||
</span>
|
||||
</form>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Descrição</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]='loadedEvent.Body.Text'></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Localização</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]='loadedEvent.Location'></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Calendário</ion-label>
|
||||
<ion-select class="capitalizeText" placeholder="{{loadedEvent.CalendarName}}" [(ngModel)]="loadedEvent.CalendarName" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
|
||||
<ion-select-option Pessoal="Reunião">Pessoal</ion-select-option>
|
||||
<ion-select-option Oficial="Viagem">Oficial</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Tipo do evento</ion-label>
|
||||
<ion-select placeholder="{{loadedEvent.EventType}}" [(ngModel)]="loadedEvent.EventType" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
|
||||
<ion-select-option value="Reunião">Reunião</ion-select-option>
|
||||
<ion-select-option value="Viagem">Viagem</ion-select-option>
|
||||
<ion-select-option value="Conferência">Conferência</ion-select-option>
|
||||
<ion-select-option value="Encontro">Encontro</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Data Início</ion-label>
|
||||
<ion-datetime value="{{loadedEvent.StartDate}}" [(ngModel)]="loadedEvent.StartDate" min="2020" max="2100"
|
||||
displayFormat="D MMM YYYY H:mm" minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Data Fim</ion-label>
|
||||
<ion-datetime value="{{loadedEvent.EndDate}}" [(ngModel)]="loadedEvent.EndDate" min="2020" max="2100"
|
||||
displayFormat="D MMM YYYY HH:mm" minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
<div class="div-attach" >
|
||||
<ion-item>
|
||||
<ion-buttons slot="end" (click)="openAttendees()">
|
||||
<ion-label color="secondary">Editar</ion-label>
|
||||
</ion-buttons>
|
||||
<ion-label class="attach-label">Participantes</ion-label>
|
||||
</ion-item>
|
||||
<div *ngIf="loadedEvent.Attendees">
|
||||
<div *ngFor="let attendee of loadedEvent.Attendees; let i=index">
|
||||
<div *ngIf="i<1">
|
||||
<ion-list >
|
||||
<ion-item class="attendees" lines="none" >
|
||||
<ion-icon class="attendees-icon" name="person" slot="start"></ion-icon>
|
||||
<ion-label class="capitalizeText" class="attendees-list">{{attendee.Name}}</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div *ngIf="loadedEvent.Attendees.length > 1">
|
||||
<button class="see-more-button" fill="none" shape="round" (click)="openAttendees()">
|
||||
<ion-label color="secondary">Ver mais...</ion-label>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-attach">
|
||||
<ion-item>
|
||||
<ion-buttons slot="end" (click)="showAlert()">
|
||||
<ion-label color="secondary">Editar</ion-label>
|
||||
</ion-buttons>
|
||||
<ion-label class="attach-label">Anexos</ion-label>
|
||||
</ion-item>
|
||||
<div *ngIf="loadedEventAttachments">
|
||||
<div *ngFor="let att of loadedEventAttachments; let j=index">
|
||||
<div *ngIf="j<2">
|
||||
<ion-list *ngIf="loadedEvent.HasAttachments">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-item lines="none" (click)="viewDocument(att.Link)">
|
||||
<ion-icon name="attach" slot="start"></ion-icon>
|
||||
<ion-label>
|
||||
<p>{{ att.Description }}</p>
|
||||
<p>{{ att.CreateDate }}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="loadedEventAttachments.length > 1">
|
||||
<button class="see-more-button" fill="none" shape="round" (click)="openAttachments()"><!-- [routerLink]="['/home/attachments', loadedEvent.EventId]" -->
|
||||
<ion-label color="secondary">Ver mais...</ion-label>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Skeleton Attachment -->
|
||||
<!-- <ion-list *ngIf="!loadedEventAttachments">
|
||||
<ion-item lines="none" >
|
||||
<ion-icon name="attach" slot="start"></ion-icon>
|
||||
<ion-label>
|
||||
<p> <ion-skeleton-text animated></ion-skeleton-text></p>
|
||||
<p> <ion-skeleton-text animated></ion-skeleton-text></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list> -->
|
||||
<!-- No attachment message -->
|
||||
<ion-list *ngIf="!loadedEvent.HasAttachments">
|
||||
<ion-item lines="none" >
|
||||
<ion-label>
|
||||
Sem anexos
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-item-sliding>
|
||||
</ion-item-group>
|
||||
</div>
|
||||
<!-- Skeleton screen -->
|
||||
<div *ngIf="!loadedEvent">
|
||||
<div class="ion-padding custom-skeleton">
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 88%"></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 70%"></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</div>
|
||||
|
||||
<ion-list>
|
||||
<ion-list-header>
|
||||
<ion-label>
|
||||
<ion-skeleton-text animated style="width: 20%"></ion-skeleton-text>
|
||||
</ion-label>
|
||||
</ion-list-header>
|
||||
<ion-item>
|
||||
<ion-avatar slot="start">
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
</ion-avatar>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-thumbnail slot="start">
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
</ion-thumbnail>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-skeleton-text animated style="width: 27px; height: 27px" slot="start"></ion-skeleton-text>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<ion-toolbar>
|
||||
<div class="event-detail-buttons">
|
||||
<button class="btn-ok" fill="clear" color="#fff" shape="round" (click)="Save()">Gravar</button>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
ion-item-group{
|
||||
margin: 15px;
|
||||
}
|
||||
.div-item{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin: 10px 0 5px 0;
|
||||
}
|
||||
.div-up{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
.div-up h3{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 17px;
|
||||
width: 100%;
|
||||
}
|
||||
.div-icon{
|
||||
width: 10%;
|
||||
font-size: 22px;
|
||||
float: left;
|
||||
color: #808080;
|
||||
}
|
||||
.div-icon ion-icon{
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
|
||||
}
|
||||
.div-content-attachment{
|
||||
width: 85%;
|
||||
float: left;
|
||||
padding: 0 0 0 12px;
|
||||
}
|
||||
.ion-icon-attach{
|
||||
color: #666666;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.btn-attach{
|
||||
margin: 15px 0 0 0;
|
||||
--color: #333;
|
||||
--border-color:#333;
|
||||
}
|
||||
.div-card-button{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
}
|
||||
ion-card{
|
||||
margin: 2.5% !important;
|
||||
width: 45%;
|
||||
float: left;
|
||||
}
|
||||
.center{
|
||||
text-align: center;
|
||||
float: center;
|
||||
}
|
||||
|
||||
/* FFOTER */
|
||||
.event-detail-buttons{
|
||||
width: 90%;
|
||||
margin: 10px auto;
|
||||
}
|
||||
.event-detail-buttons ion-button{
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.ion-icon-delete{
|
||||
font-size: 22px;
|
||||
color: red;
|
||||
background-color: white;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.error{
|
||||
color:red;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
/* .event-detail-buttons{
|
||||
margin-bottom: 80px;
|
||||
margin-top: 10px;
|
||||
} */
|
||||
.attendees-icon{
|
||||
font-size: 14px;
|
||||
}
|
||||
.see-more-button{
|
||||
text-transform: initial;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.header-content{
|
||||
overflow: auto;
|
||||
margin: 0 auto;
|
||||
padding-top: 25px;
|
||||
}
|
||||
.header-icon-left{
|
||||
width: 36px;
|
||||
font-size: 33px;
|
||||
color: #42b9fe;
|
||||
float: left;
|
||||
border: 1px solid red;
|
||||
}
|
||||
.header-title{
|
||||
width: 300px;
|
||||
font-family: Roboto;
|
||||
font-size: 25px;
|
||||
margin: 0 5px 0 5px;
|
||||
padding: 0;
|
||||
color:#000;
|
||||
float: left;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EventDetailPage } from './event-detail.page';
|
||||
|
||||
describe('EventDetailPage', () => {
|
||||
let component: EventDetailPage;
|
||||
let fixture: ComponentFixture<EventDetailPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EventDetailPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(EventDetailPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,244 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { Event } from '../../../models/event.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { AlertController, ModalController } from '@ionic/angular';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { AttachmentsPage } from '../attachments/attachments.page';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-detail',
|
||||
templateUrl: './event-detail.page.html',
|
||||
styleUrls: ['./event-detail.page.scss'],
|
||||
})
|
||||
export class EventDetailPage implements OnInit {
|
||||
|
||||
loadedEvent: Event;
|
||||
loadedEventAttachments: Attachment[];
|
||||
pageId: string;
|
||||
showLoader: boolean;
|
||||
backURL: string;
|
||||
ionicForm: FormGroup;
|
||||
isSubmitted = false;
|
||||
|
||||
minDate: Date;
|
||||
|
||||
profile:string;
|
||||
|
||||
|
||||
constructor(
|
||||
public formBuilder: FormBuilder,
|
||||
public alertController: AlertController,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private eventsService: EventsService,
|
||||
private modalCtrl: ModalController,
|
||||
private alertService: AlertService,
|
||||
private attachamentsService: AttachmentsService,
|
||||
private route: Router,
|
||||
private iab: InAppBrowser) {
|
||||
this.loadedEvent = new Event();
|
||||
this.loadedEvent.Body = new EventBody();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.loadEvent();
|
||||
this.loadAttachments();
|
||||
this.ionicForm = this.formBuilder.group({
|
||||
subject: ['', [Validators.required]]
|
||||
})
|
||||
}
|
||||
|
||||
get errorControl() {
|
||||
return this.ionicForm.controls;
|
||||
}
|
||||
|
||||
loadEvent(){
|
||||
let eventid: string;
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>
|
||||
{
|
||||
if (!paramMap.has("eventId")){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
this.pageId = paramMap.get('eventId');
|
||||
eventid = paramMap.get('eventId');
|
||||
console.log(eventid);
|
||||
|
||||
}
|
||||
if (paramMap.has("caller")){
|
||||
this.backURL = "/home/" + paramMap.get('caller');
|
||||
}
|
||||
}
|
||||
);
|
||||
this.eventsService.getEvent(eventid).subscribe(response => {
|
||||
this.loadedEvent = response;
|
||||
});
|
||||
}
|
||||
|
||||
async openAttendees(){
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: AttendeesPageModal,
|
||||
componentProps: {
|
||||
eventAttendees: this.loadedEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getEventAttendees(): EventPerson[]
|
||||
{
|
||||
return this.loadedEvent.Attendees;
|
||||
}
|
||||
|
||||
setEventAttendees(newattendes: EventPerson[])
|
||||
{
|
||||
this.loadedEvent.Attendees = newattendes;
|
||||
}
|
||||
|
||||
async deleteConfirm()
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Apagar evento!',
|
||||
message: 'Deseja <strong>apagar</strong> o evento da agenda ' + this.loadedEvent.CalendarName + '?',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Não',
|
||||
role: 'cancel',
|
||||
cssClass: 'secondary',
|
||||
handler: () => { }
|
||||
}, {
|
||||
text: 'Sim',
|
||||
handler: () => {
|
||||
this.Delete();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
Delete()
|
||||
{
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
|
||||
{
|
||||
/* const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento removido',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
await alert.present(); */
|
||||
|
||||
this.router.navigate(['/home/events']);
|
||||
});
|
||||
}
|
||||
|
||||
Save()
|
||||
{
|
||||
if (this.ionicForm.valid){
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>{
|
||||
if (paramMap.has("profile")){
|
||||
console.log(paramMap.get('profile'));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento actualizado',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
setTimeout(()=>{
|
||||
alert.dismiss();
|
||||
}, 1500);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
showAlert(){
|
||||
this.alertService.presentAlert("Funcionalidade em desenvolvimento");
|
||||
}
|
||||
|
||||
loadAttachments()
|
||||
{
|
||||
/* console.log(this.pageId); */
|
||||
|
||||
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
||||
this.loadedEventAttachments = res;
|
||||
console.log(res);
|
||||
|
||||
});
|
||||
}
|
||||
async viewDocument(documenturl:string)
|
||||
{
|
||||
const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
const browser = this.iab.create(url,"_blank");
|
||||
browser.show();
|
||||
}
|
||||
|
||||
back()
|
||||
{
|
||||
//this.back();
|
||||
}
|
||||
doRefresh(event){
|
||||
/* this.RefreshEvents(); */
|
||||
event.target.complete();
|
||||
setTimeout(() => {
|
||||
event.target.complete();
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
navigateTo(ev){
|
||||
this.route.navigate(['/home/events',ev]);
|
||||
}
|
||||
async openAttachments(){
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: AttachmentsPage,
|
||||
componentProps: {
|
||||
eventId: this.pageId,
|
||||
attachments: this.loadedEventAttachments
|
||||
},
|
||||
cssClass: 'attachments',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EventsPage } from './events.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EventsPage
|
||||
},
|
||||
{
|
||||
path: 'event-detail',
|
||||
loadChildren: () => import('./event-detail/event-detail.module').then( m => m.EventDetailPageModule)
|
||||
},
|
||||
{
|
||||
path: 'attachments',
|
||||
loadChildren: () => import('./attachments/attachments.module').then( m => m.AttachmentsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'attendees',
|
||||
loadChildren: () => import('./attendees/attendees.module').then( m => m.AttendeesPageModule)
|
||||
},
|
||||
{
|
||||
path: 'event-detail-modal',
|
||||
loadChildren: () => import('./event-detail-modal/event-detail-modal.module').then( m => m.EventDetailModalPageModule)
|
||||
},
|
||||
{
|
||||
path: 'edit-event',
|
||||
loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule)
|
||||
}
|
||||
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class EventsPageRoutingModule {}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
import { EventsPageRoutingModule } from './events-routing.module';
|
||||
import { EventsPage } from './events.page';
|
||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
EventsPageRoutingModule,
|
||||
HeaderPageModule,
|
||||
//
|
||||
PdfViewerModule
|
||||
],
|
||||
declarations: [EventsPage],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
export class EventsPageModule {}
|
||||
@@ -0,0 +1,121 @@
|
||||
<ion-header class="ion-no-border ">
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
|
||||
<ion-header class="ion-no-border text-white">
|
||||
<ion-label>
|
||||
<p class="time ion-text-center">{{customDate}}</p>
|
||||
</ion-label>
|
||||
<ion-label>
|
||||
<p *ngIf="totalEvent==1" class="event-number p-small ion-text-center"> <strong>{{totalEvent}}</strong> evento agendado para hoje</p>
|
||||
<p *ngIf="totalEvent!=1"class="event-number p-small ion-text-center"> <strong>{{totalEvent}}</strong> eventos agendados para hoje</p>
|
||||
</ion-label>
|
||||
<div class="next-meeting">
|
||||
<div class="meeting-time" *ngIf="currentHoursMinutes">{{currentHoursMinutes | date: 'HH:mm'}}</div>
|
||||
<div class="meeting-description" *ngIf="currentEvent"> "{{currentEvent}}"</div>
|
||||
</div>
|
||||
|
||||
</ion-header>
|
||||
|
||||
<!-- Default Refresher -->
|
||||
|
||||
<ion-content class="main " ng-controller="AppController">
|
||||
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
<div class="conteiner-box px-20 height-100" ng-swipe-up="swipe($event)">
|
||||
<div class="schedule height-100">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
|
||||
<div class="text">A sua Agenda</div>
|
||||
</div>
|
||||
<button class="btn-no-color" [routerLink]="['/home/agenda']">
|
||||
<ion-icon
|
||||
class="icon-next"
|
||||
slot="end"
|
||||
src="assets/images/icons-arrow-circle-arrow-right.svg"
|
||||
></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||
|
||||
<!-- {{ toDayEventStorage.eventsList | json}} -->
|
||||
|
||||
<ion-list>
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor="let event of toDayEventStorage.eventsList"
|
||||
(click)="goToEvent(event.EventId)"
|
||||
>
|
||||
<div class="d-flex content-{{loggeduser.Profile}}-{{event.CalendarName}}">
|
||||
|
||||
<div class="schedule-time">
|
||||
<div *ngIf="!event.IsAllDayEvent" class="time-start">{{event.StartDate | date: 'HH:mm'}}</div>
|
||||
<div *ngIf="!event.IsAllDayEvent" class="time-end">{{event.EndDate | date: 'HH:mm'}}</div>
|
||||
|
||||
<div *ngIf="event.IsAllDayEvent" class="time-start"> Todo </div>
|
||||
<div *ngIf="event.IsAllDayEvent" class="time-end text-center"> o dia </div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="schedule-details">
|
||||
<div class="location">{{event.Location}}</div>
|
||||
<div class="description">
|
||||
<p>{{event.Subject}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
|
||||
</ion-list>
|
||||
<!--
|
||||
<div class="resume">
|
||||
<div class="title">
|
||||
Resumo para Amnahã
|
||||
</div>
|
||||
<div class="event-num">4 eventos ageandados para amanhã</div>
|
||||
<div class="first-event-time">08:30 "Reunião Staff" no Palácio Presidencial</div>
|
||||
</div>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="schedule height-100">
|
||||
<div class="schedule-header">
|
||||
<div class="title">
|
||||
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
||||
<div class="text">Correspondência por ler</div>
|
||||
</div>
|
||||
<button (click)="viewExpedientListPage()" class="btn-no-color cursor-pointer">
|
||||
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg"></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||
<ion-list>
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor = "let task of expedienteGdStore.list"
|
||||
(click)="goToExpediente(task.SerialNumber)">
|
||||
<div class="item-exp d-flex">
|
||||
<div class="schedule-date">
|
||||
<div class="time-end">{{task.taskStartDate | date: 'dd-MM-yyyy'}}</div>
|
||||
<div class="time-start">{{task.taskStartDate | date: 'HH:mm'}}</div>
|
||||
</div>
|
||||
<div class="schedule-details pointer">
|
||||
<div class="description">{{ task.Subject }}</div>
|
||||
<div class="location">{{ task.Senders }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <pdf-viewer [src]="pdfSrc"
|
||||
[render-text]="true"
|
||||
style="display: block;"
|
||||
></pdf-viewer> -->
|
||||
|
||||
</ion-content>
|
||||
@@ -0,0 +1,526 @@
|
||||
@import '~src/function.scss';
|
||||
|
||||
/* HEADER */
|
||||
.bg-blue{
|
||||
--background:#0782c9;
|
||||
background:#0782c9;
|
||||
--background-color:#0782c9;
|
||||
background-color:#0782c9;
|
||||
color: #ffffff;
|
||||
--color: #ffffff;
|
||||
}
|
||||
ion-toolbar{
|
||||
--background: white;
|
||||
}
|
||||
.ion-text-header-top{
|
||||
width: 100%;
|
||||
--background: transparent;
|
||||
text-align: center;
|
||||
padding-top: 15px;
|
||||
color: #ffffff;
|
||||
|
||||
/* border: 1px solid red; */
|
||||
}
|
||||
.div-top-header{
|
||||
width: 400px;
|
||||
margin: 0 auto;
|
||||
background-color: #0782c9;
|
||||
overflow: auto;
|
||||
padding-top: 15px;
|
||||
border: 0!important;
|
||||
|
||||
.div-search{
|
||||
font-size: 45px;
|
||||
float: left;
|
||||
margin: 0 0 0 10px
|
||||
}
|
||||
.div-logo{
|
||||
background: transparent;
|
||||
width: 140px;
|
||||
margin: 5px 0 0px 71px;
|
||||
float: left;
|
||||
}
|
||||
.div-logo img{
|
||||
width: 100%;
|
||||
}
|
||||
.div-profile{
|
||||
font-size: 45px;
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.ion-text-header-top p{
|
||||
--background: transparent;
|
||||
color: #ffffff;
|
||||
}
|
||||
.ion-text-right{
|
||||
--background: transparent;
|
||||
color: #ffffff;
|
||||
}
|
||||
.header-large{
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 12.5pt;
|
||||
/* font-weight: 600; */
|
||||
background: transparent;
|
||||
color: #ffffff;
|
||||
}
|
||||
.header-xsmall{
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 9.7pt;
|
||||
font-weight: bold;
|
||||
padding-bottom: 3.5px;
|
||||
margin-bottom: 3.5px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
background: transparent;
|
||||
}
|
||||
.header-medium{
|
||||
font-size: 12pt;
|
||||
text-align: left;
|
||||
font-family: roboto;
|
||||
background: transparent;
|
||||
margin-right: 5px;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
.p-small{
|
||||
font-size: 13pt;
|
||||
margin-top: 13px;
|
||||
color:#000;
|
||||
margin-right: 25px !important;
|
||||
text-align: right;
|
||||
/* color: #ffffff; */
|
||||
}
|
||||
|
||||
/* CONTENT */
|
||||
.item-list-small{
|
||||
font-size: 14px;
|
||||
overflow: auto;
|
||||
}
|
||||
.ion-item-class{
|
||||
padding: 0;
|
||||
|
||||
}
|
||||
.label-text{
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
//DIV
|
||||
.div-item-Oficial{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
/* border-bottom: 1px solid #ccc; */
|
||||
margin: 10px 0 5px 0;
|
||||
background: #cab0dc;
|
||||
border-radius: 20px;
|
||||
padding: 10px;
|
||||
/* box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); */
|
||||
}
|
||||
.div-item-Pessoal{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
/* border-bottom: 1px solid #ccc; */
|
||||
margin: 10px 0 5px 0;
|
||||
background: #cbeecb;
|
||||
border-radius: 20px;
|
||||
padding: 10px;
|
||||
/* box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); */
|
||||
}
|
||||
.div-up{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
.div-up h3{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 17px;
|
||||
width: 100%;
|
||||
}
|
||||
.div-icon{
|
||||
width: 10%;
|
||||
font-size: 22px;
|
||||
float: left;
|
||||
color: #808080;
|
||||
}
|
||||
.div-icon ion-icon{
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
|
||||
}
|
||||
.div-content-Oficial{
|
||||
width: 85%;
|
||||
float: left;
|
||||
border-left: 4px solid #cab0dc;
|
||||
padding: 0 0 0 12px;
|
||||
}
|
||||
.div-content-Pessoal{
|
||||
width: 85%;
|
||||
float: left;
|
||||
border-left: 4px solid #cbeecb;
|
||||
padding: 0 0 0 12px;
|
||||
}
|
||||
.div-content-Oficial h3, .div-content-Pessoal h3{
|
||||
font-size: 14pt;
|
||||
/* border: 1px solid red; */
|
||||
}
|
||||
.div-content-Oficial p, .div-content-Pessoal p{
|
||||
font-size: 12pt;
|
||||
color: rgb(94, 92, 92);
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
.div-botton{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
margin: 10px 0 5px 0;
|
||||
}
|
||||
.div-botton-left{
|
||||
width: 10%;
|
||||
float: left;
|
||||
}
|
||||
.ion-icon-location{
|
||||
text-align: center;
|
||||
display: block;
|
||||
color: #000;
|
||||
font-size: 16px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.div-botton-middle{
|
||||
width: 75%;
|
||||
float: left;
|
||||
margin-top: 0.5px;
|
||||
}
|
||||
.div-botton-middle p{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.div-botton-right{
|
||||
width: 10%;
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.ion-icon-attach{
|
||||
color: #666666;
|
||||
font-size: 20px;
|
||||
}
|
||||
/* NEW CSS FOR TOGGLE BUTTON */
|
||||
.toggleBox{
|
||||
margin:20px 20px 0 0;
|
||||
}
|
||||
input[type="checkbox"]{
|
||||
position: relative;
|
||||
width: 96px;
|
||||
height: 34px;
|
||||
background: #ffffff;
|
||||
-webkit-appearance: none;
|
||||
border-radius: 20px;
|
||||
outline: none;
|
||||
transition: .4s;
|
||||
/* box-shadow: inset 0 0 5px rgba(0,0,0,0.2); */
|
||||
cursor: pointer;
|
||||
border:1px solid #e16817;
|
||||
}
|
||||
input:checked[type="checkbox"]{
|
||||
background: #e16817;
|
||||
}
|
||||
input[type="checkbox"]::before{
|
||||
z-index: 2;
|
||||
position: absolute;
|
||||
content: "";
|
||||
left: 0;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: #fff;
|
||||
border-radius: 50%;
|
||||
/* transform: scale(1.1); */
|
||||
box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
|
||||
border:1px solid #e16817;
|
||||
}
|
||||
input:checked[type="checkbox"]::before{
|
||||
left: 65px;
|
||||
|
||||
}
|
||||
.toggle{
|
||||
position: relative;
|
||||
display: inline;
|
||||
font-family: 'Montserrat', sans-serif;
|
||||
display: grid;
|
||||
text-align: center;
|
||||
}
|
||||
label{
|
||||
position: absolute;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
pointer-events: none;
|
||||
}
|
||||
.onbtn{
|
||||
top:10px;
|
||||
bottom: 15px;
|
||||
left: 15px;
|
||||
/* padding-top: 10px;
|
||||
border: 1px solid red; */
|
||||
}
|
||||
.ofbtn{
|
||||
top:10px;
|
||||
bottom: 15px;
|
||||
right: 14px;
|
||||
color: #e16817;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// new
|
||||
.main{
|
||||
padding: 0px em(20px);
|
||||
}
|
||||
|
||||
.event-number{
|
||||
color: white;
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
color: var(--white);
|
||||
|
||||
bold{
|
||||
font-family: Roboto;
|
||||
font-size: 25px;
|
||||
text-align: right;
|
||||
color: var(--white);
|
||||
}
|
||||
}
|
||||
.time{
|
||||
font-family: Roboto;
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
color: var(--white);
|
||||
line-height: unset;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.next-meeting{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin: 0px 20px;
|
||||
margin-top: 15px;
|
||||
|
||||
.meeting-time {
|
||||
font-size: em(25px);
|
||||
font-family: Roboto;
|
||||
font-weight: 300;
|
||||
color: var(--white);
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
.meeting-description {
|
||||
margin-top: 2px;
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
color: var(--white);
|
||||
}
|
||||
}
|
||||
|
||||
.conteiner-box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.schedule {
|
||||
max-width: 400px;
|
||||
font-family: Roboto;
|
||||
background-color: white;
|
||||
box-shadow: 0 0 10px 0 rgb(0 0 0 / 7%);
|
||||
border: solid 1px #e9e9e9;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 25px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: 100%;
|
||||
overflow: auto;
|
||||
padding-bottom: 25px;
|
||||
|
||||
.schedule-header{
|
||||
display: flex;
|
||||
margin-bottom: 20px;
|
||||
justify-content: space-between;
|
||||
padding: 20px 20px 0px 20px;
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.icon{
|
||||
color: #e8e8e8;
|
||||
height: 35px;
|
||||
width: 35px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.text{
|
||||
font-family: Roboto;
|
||||
font-size: 20px;
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
.icon-next {
|
||||
color: #e8e8e8;
|
||||
height: 35px;
|
||||
width: 35px;
|
||||
font-size: 35px;
|
||||
font-size: 35px;
|
||||
}
|
||||
}
|
||||
.content{
|
||||
//padding: 0px 20px 20px 20px;
|
||||
overflow: auto;
|
||||
|
||||
.item-exp{
|
||||
overflow: auto;
|
||||
//padding-top: 5px;
|
||||
//padding-bottom: 5px;
|
||||
padding: 5px 20px 5px 20px;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
ion-list{
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
.d-flex{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
ion-item{
|
||||
padding-bottom: 5px;
|
||||
margin-top: 5px;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
--background: transparent !important;
|
||||
|
||||
.schedule-time{
|
||||
margin-right: 10px;
|
||||
.time-start{
|
||||
color: #797979 !important;
|
||||
font-family: Roboto;
|
||||
font-size: 13px;
|
||||
}
|
||||
.time-end{
|
||||
color: #797979 !important;
|
||||
font-family: Roboto;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
.schedule-date{
|
||||
margin-right: 10px;
|
||||
width: 22%;
|
||||
color: #797979 !important;
|
||||
font-size: 13px;
|
||||
}
|
||||
.schedule-details{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
width: 78%;
|
||||
.location{
|
||||
font-family: Roboto;
|
||||
font-size: 13px;
|
||||
color: black;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
.description{
|
||||
width: 100%;
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
color: #0d89d1;
|
||||
}
|
||||
.description p{
|
||||
white-space: nowrap;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
}
|
||||
}
|
||||
.color{
|
||||
width: 5px;
|
||||
height: 40px;
|
||||
border-top-right-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
background-color: #f05d5e;
|
||||
}
|
||||
}
|
||||
ion-item:last-child{
|
||||
border-bottom: unset !important;
|
||||
padding-bottom: unset !important;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.resume{
|
||||
.title{
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
color: #797979;
|
||||
margin-bottom: 5px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.event-num, .first-event-time{
|
||||
font-family: Roboto;
|
||||
font-size: 15px;
|
||||
display: block;
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.d-flex {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.pointer{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@media only screen and (max-width: 856px) {
|
||||
|
||||
.content, .conteiner-box{
|
||||
height: unset !important;
|
||||
max-height: unset !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (min-width: 804px) {
|
||||
|
||||
.schedule:first-child {
|
||||
margin-right: 2%;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 478px) {
|
||||
.schedule{
|
||||
width: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (max-width: 478px) {
|
||||
.schedule{
|
||||
width: 360px;
|
||||
}
|
||||
}
|
||||
ion-title{
|
||||
border: 1px solid red;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EventsPage } from './events.page';
|
||||
|
||||
describe('EventsPage', () => {
|
||||
let component: EventsPage;
|
||||
let fixture: ComponentFixture<EventsPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EventsPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(EventsPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,386 @@
|
||||
import { Component, OnInit, LOCALE_ID, EventEmitter, Output, Renderer2, ElementRef } from '@angular/core';
|
||||
|
||||
import { Event } from '../../models/event.model';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { NavigationExtras, Router } from '@angular/router';
|
||||
import { ActivatedRoute, NavigationEnd } from '@angular/router';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
import { ModalController, Platform } from '@ionic/angular';
|
||||
import { EventDetailPage } from './event-detail/event-detail.page';
|
||||
import { ProcessesService } from '../../services/processes.service';
|
||||
import { DailyWorkTask } from '../../models/dailyworktask.model';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ToDayEventStorage } from 'src/app/store/to-day-event-storage.service';
|
||||
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-events',
|
||||
templateUrl: './events.page.html',
|
||||
styleUrls: ['./events.page.scss'],
|
||||
})
|
||||
export class EventsPage implements OnInit {
|
||||
/* Get current system date */
|
||||
today = new Date();
|
||||
|
||||
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
|
||||
customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
|
||||
|
||||
/* Setting appropriate greeting according to the time */
|
||||
grettings = ["Bom dia", "Boa tarde", "Boa noite"];
|
||||
greetting='';
|
||||
|
||||
timeDate = this.today.getHours() + ":" + this.today.getMinutes();
|
||||
/* Set segment variable */
|
||||
segment:string;
|
||||
public profile:string;
|
||||
currentEvent: any;
|
||||
|
||||
eventsList: Event[];
|
||||
maxSubjectLength = 30;
|
||||
officialeventsList: Event[];
|
||||
personaleventsList: Event[];
|
||||
|
||||
prEventList: Event[];
|
||||
mdEventList: Event[];
|
||||
|
||||
combinedEvents: Event[];
|
||||
|
||||
customText = false;
|
||||
totalEvent=0;
|
||||
currentHoursMinutes: Date | string;
|
||||
|
||||
showLoader: boolean;
|
||||
|
||||
taskslist:DailyWorkTask[] = [];
|
||||
expedientList:any;
|
||||
hideSearchBtn: boolean=false;
|
||||
|
||||
// shared data
|
||||
toDayEventStorage = ToDayEventStorage
|
||||
expedienteGdStore = ExpedienteGdStore
|
||||
|
||||
expedienteTaskPipe = new ExpedienteTaskPipe()
|
||||
|
||||
@Output() openExpedientListPage:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
loggeduser: LoginUserRespose;
|
||||
|
||||
existingScreenOrientation: string;
|
||||
|
||||
constructor(
|
||||
private eventService: EventsService,
|
||||
private router: Router,
|
||||
private storageService:StorageService,
|
||||
public activatedRoute: ActivatedRoute,
|
||||
private alertController: AlertService,
|
||||
private authService: AuthService,
|
||||
private processes:ProcessesService,
|
||||
/* private gabineteService: GabineteDigitalPage, */
|
||||
private modalController:ModalController,
|
||||
private screenOrientation: ScreenOrientation,
|
||||
public platform: Platform,
|
||||
) {
|
||||
this.existingScreenOrientation = this.screenOrientation.type;
|
||||
console.log(this.existingScreenOrientation);
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
|
||||
this.prEventList = null;
|
||||
|
||||
this.platform.resize.subscribe(async () => {
|
||||
//console.log('Resize event detected');
|
||||
// console.log('Resize event detected');
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.segment = "Combinada";
|
||||
this.profile = "mdgpr";
|
||||
|
||||
this.showGreeting();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == '/home/events') {
|
||||
this.RefreshEvents();
|
||||
this.LoadList();
|
||||
}
|
||||
});
|
||||
this.hideSearch();
|
||||
|
||||
//this.checkScreenOrientation();
|
||||
}
|
||||
|
||||
hideSearch(){
|
||||
if(this.router.url == '/home/events'){
|
||||
this.hideSearchBtn = true;
|
||||
}
|
||||
}
|
||||
|
||||
doRefresh(event) {
|
||||
this.RefreshEvents();
|
||||
this.LoadList();
|
||||
event.target.complete();
|
||||
}
|
||||
|
||||
onSegmentChange() {
|
||||
this.RefreshEvents();
|
||||
}
|
||||
|
||||
// Lock to portrait
|
||||
lockToPortrait(){
|
||||
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);
|
||||
console.log('set');
|
||||
}
|
||||
|
||||
// Lock to landscape
|
||||
lockToLandscape(){
|
||||
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
|
||||
}
|
||||
|
||||
// Unlock screen orientation
|
||||
unlockScreenOrientation(){
|
||||
this.screenOrientation.unlock();
|
||||
}
|
||||
|
||||
checkScreenOrientation(){
|
||||
if( window.innerWidth < 701) {
|
||||
this.lockToPortrait();
|
||||
console.log('was here');
|
||||
|
||||
}
|
||||
else{
|
||||
this.unlockScreenOrientation();
|
||||
}
|
||||
}
|
||||
|
||||
async RefreshEvents() {
|
||||
this.currentEvent = "";
|
||||
this.showLoader = true;
|
||||
|
||||
let date = new Date();
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let start = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
let end = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" 23:59:59";
|
||||
|
||||
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllMdOficialEvents(start, end).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise();
|
||||
|
||||
const list = mdOficialEvents.concat(mdPessoalEvents);
|
||||
|
||||
this.toDayEventStorage.reset(list)
|
||||
|
||||
if(this.toDayEventStorage.eventsList.length > 0){
|
||||
this.currentEvent = this.toDayEventStorage.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.toDayEventStorage.eventsList[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = this.toDayEventStorage.eventsList.length;
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
else if (this.loggeduser.Profile == 'PR') {
|
||||
|
||||
let prOficialEvents= await this.eventService.getAllPrOficialEvents(start, end).toPromise();
|
||||
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
|
||||
|
||||
const list = prOficialEvents.concat(prPessoalEvents);
|
||||
|
||||
this.toDayEventStorage.reset(list)
|
||||
|
||||
if(this.toDayEventStorage.eventsList.length > 0) {
|
||||
this.currentEvent = this.toDayEventStorage.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.toDayEventStorage.eventsList[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = this.toDayEventStorage.eventsList.length;
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* switch (this.segment)
|
||||
{
|
||||
case "Combinada":
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllMdOficialEvents(start, end).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise();
|
||||
|
||||
this.eventsList = mdOficialEvents.concat(mdPessoalEvents);
|
||||
|
||||
if(this.eventsList.length > 0){
|
||||
this.currentEvent = this.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.eventsList[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = this.eventsList.length;
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
let prOficialEvents= await this.eventService.getAllPrOficialEvents(start, end).toPromise();
|
||||
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
|
||||
this.eventsList = prOficialEvents.concat(prPessoalEvents);
|
||||
console.log(this.eventsList);
|
||||
console.log(this.eventsList);
|
||||
|
||||
if(this.eventsList.length > 0){
|
||||
this.currentEvent = this.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.eventsList[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = this.eventsList.length;
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
case "Pessoal":
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.eventService.getAllMdPessoalEvents(start, end).subscribe(res => {
|
||||
this.personaleventsList = res.filter(data => data.CalendarName == "Pessoal");
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrPessoalEvents(start, end).subscribe(res => {
|
||||
this.personaleventsList = res.filter(data => data.CalendarName == "Pessoal");
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
case "Oficial":
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.eventService.getAllMdOficialEvents(start, end).subscribe(res => {
|
||||
this.officialeventsList = res.filter(data => data.CalendarName == "Oficial");;
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrOficialEvents(start, end).subscribe(res => {
|
||||
this.officialeventsList = res.filter(data => data.CalendarName == "Oficial");;
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
break;
|
||||
} */
|
||||
}
|
||||
|
||||
showGreeting(){
|
||||
if(this.today.getHours() >= 6 && this.today.getHours() < 12){
|
||||
this.greetting = this.grettings[0];
|
||||
}
|
||||
else if(this.today.getHours() >= 12 && this.today.getHours() < 18){
|
||||
this.greetting = this.grettings[1];
|
||||
}
|
||||
else /* if(this.today.getHours() < 6 && this.today.getHours() >= 18) */{
|
||||
this.greetting = this.grettings[2];
|
||||
}
|
||||
}
|
||||
|
||||
gotTo(){
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
|
||||
changeProfile(){
|
||||
if(this.profile == "mdgpr"){
|
||||
console.log('pr');
|
||||
this.profile ="pr";
|
||||
this.RefreshEvents();
|
||||
}
|
||||
else{
|
||||
console.log('mdgpr');
|
||||
this.profile ="mdgpr";
|
||||
this.RefreshEvents();
|
||||
}
|
||||
}
|
||||
|
||||
logout()
|
||||
{
|
||||
this.authService.ValidatedUser.BasicAuthKey = "";
|
||||
this.router.navigate(['/home/login']);
|
||||
}
|
||||
|
||||
async openEventDetail1(id:any){
|
||||
console.log(id);
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: EventDetailPage,
|
||||
componentProps: {
|
||||
eventId: id,
|
||||
},
|
||||
cssClass: 'event-detail',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
|
||||
}
|
||||
|
||||
LoadList() {
|
||||
this.processes.GetTaskListExpediente(false).subscribe(result => {
|
||||
console.log("Expediente", result);
|
||||
|
||||
const ExpedienteTask = result.map( e=> this.expedienteTaskPipe.transform(e))
|
||||
|
||||
this.expedienteGdStore.reset(ExpedienteTask)
|
||||
});
|
||||
}
|
||||
|
||||
sortArrayISODate(myArray: any){
|
||||
return myArray.sort(function(a, b) {
|
||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||
});
|
||||
}
|
||||
|
||||
goToEvent(eventId:any){
|
||||
this.router.navigate(['/home/events', eventId, 'events']);
|
||||
}
|
||||
|
||||
goToExpediente(SerialNumber:any) {
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.router.navigate(['/home/events/expediente', SerialNumber, 'events']);
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
this.router.navigate(['/home/events/expedientes-pr', SerialNumber, 'events']);
|
||||
}
|
||||
}
|
||||
|
||||
viewExpedientListPage(){
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
if( window.innerWidth < 801){
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"expedientes": true,} };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
if( window.innerWidth < 801){
|
||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||
}
|
||||
else{
|
||||
let navigationExtras: NavigationExtras = { queryParams: {"expedientes-pr": true,} };
|
||||
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SortService } from './sort.service';
|
||||
|
||||
describe('SortService', () => {
|
||||
let service: SortService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(SortService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SortService {
|
||||
|
||||
constructor() { }
|
||||
|
||||
sortArrayISODate(myArray: any) {
|
||||
return myArray.sort(function (a, b) {
|
||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||
});
|
||||
}
|
||||
sortArrayByDate(myArray: any) {
|
||||
console.log(myArray[0].taskStartDate);
|
||||
return myArray.sort(function (a, b) {
|
||||
return (new Date(a.workflowInstanceDataFields.StartDate) < new Date(b.workflowInstanceDataFields.StartDate)) ? -1 : ((new Date(a.workflowInstanceDataFields.StartDate) > new Date(b.workflowInstanceDataFields.StartDate)) ? 1 : 0);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,10 @@ import { NavigationExtras,Router } from '@angular/router';
|
||||
import { ToastService } from '../services/toast.service';
|
||||
import { JsonStore } from './jsonStore.service';
|
||||
import { synchro } from './socket/synchro.service';
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { EventTrigger } from '../services/eventTrigger.service';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -41,7 +43,8 @@ export class NotificationsService {
|
||||
private toastService: ToastService,
|
||||
private zone: NgZone,
|
||||
private activeroute: ActivatedRoute,
|
||||
private jsonstore: JsonStore) {
|
||||
private jsonstore: JsonStore,
|
||||
private eventtrigger: EventTrigger) {
|
||||
|
||||
this.storageService.get("Notifications").then((value) => {
|
||||
|
||||
@@ -83,7 +86,7 @@ export class NotificationsService {
|
||||
getAndpostToken(username) {
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
console.log('Notifications not supported')
|
||||
//console.log('Notifications not supported')
|
||||
} else {
|
||||
|
||||
const geturl = environment.apiURL + 'notifications/token';
|
||||
@@ -102,11 +105,11 @@ export class NotificationsService {
|
||||
}
|
||||
);
|
||||
|
||||
window['MFPPush'].registerDevice(null, (successResponse) => {
|
||||
window['MFPPush'].registerDevice(null, async (successResponse) => {
|
||||
console.log("Successfully registered: " + JSON.stringify(successResponse));
|
||||
console.log('token: ', successResponse.deviceId)
|
||||
this.storageService.store(username, successResponse.deviceId);
|
||||
this.storageService.get(username).then(value => {
|
||||
await this.storageService.store(username, successResponse.deviceId);
|
||||
await this.storageService.get(username).then(value => {
|
||||
console.log('STORAGE TOKEN', value)
|
||||
this.storageService.get(AuthConnstants.USER).then(res => {
|
||||
console.log('USERID', res);
|
||||
@@ -136,87 +139,10 @@ export class NotificationsService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getAndpostToken2() {
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
console.log('Notifications not supported')
|
||||
} else {
|
||||
|
||||
const geturl = environment.apiURL + 'notifications/token';
|
||||
if(window['WLAuthorizationManager']) {
|
||||
if(window['WLAuthorizationManager'].obtainAccessToken) {
|
||||
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
|
||||
(token) => {
|
||||
console.log('Push Notification: Success ' + token);
|
||||
|
||||
window['MFPPush'].initialize(
|
||||
function (successResponse) {
|
||||
console.log("Push notification Successfully Service intialized: " + successResponse);
|
||||
},
|
||||
function (failureResponse) {
|
||||
console.log("Push notification failure Service intialized: " + failureResponse);
|
||||
}
|
||||
);
|
||||
|
||||
window['MFPPush'].registerDevice(null, (successResponse) => {
|
||||
console.log("Successfully registered: " + JSON.stringify(successResponse));
|
||||
console.log('token: ', successResponse.deviceId)
|
||||
/* this.storageService.store(username, successResponse.deviceId);
|
||||
this.storageService.get(username).then(value => {
|
||||
console.log('STORAGE TOKEN', value)
|
||||
this.storageService.get(AuthConnstants.USER).then(res => {
|
||||
console.log('USERID', res);
|
||||
const headers = { 'Authorization': 'Basic cGF1bG8ucGludG9AZ2FiaW5ldGVkaWdpdGFsLmxvY2FsOnRhYnRlc3RlQDAwNg==' };
|
||||
const body = {
|
||||
UserId: res.UserId,
|
||||
TokenId: successResponse.deviceId,
|
||||
Status: 1,
|
||||
Service: 1
|
||||
};
|
||||
this.http.post<Token>(`${geturl}`, body, { headers }).subscribe(data => {
|
||||
console.log('TOKEN USER MIDLE', data);
|
||||
})
|
||||
});
|
||||
|
||||
}); */
|
||||
},
|
||||
function (failureResponse) {
|
||||
console.log("Successfully failue: " + JSON.stringify(failureResponse));
|
||||
}
|
||||
);
|
||||
}, (error) => {
|
||||
console.log('Push notification recived: failure ' + error.responseText);
|
||||
console.log(JSON.stringify(error));
|
||||
}
|
||||
)
|
||||
} else {
|
||||
console.log('not called')
|
||||
}
|
||||
} else {
|
||||
console.log('not called')
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
removeDepartment(index): void {
|
||||
/* this.DataArray[this.DataArray.findIndex(item => item.index == index)];
|
||||
this.DataArray.splice( this.DataArray.findIndex(item => item.indexOf(index.to) === 'William'),1); */
|
||||
const indexx = this.DataArray.indexOf(index, 0);
|
||||
if (indexx > -1) {
|
||||
this.DataArray.splice(index, 1);
|
||||
console.log('This notificatio', this.DataArray);
|
||||
}
|
||||
}
|
||||
|
||||
tempClearArray(){
|
||||
this.DataArray = [];
|
||||
}
|
||||
@@ -245,6 +171,9 @@ export class NotificationsService {
|
||||
this.storageService.store("Notifications",this.DataArray)
|
||||
|
||||
console.log(message);
|
||||
this.eventtrigger.publishSomeData({
|
||||
notification: "recive"
|
||||
})
|
||||
var data = JSON.parse(message.payload);
|
||||
|
||||
synchro.$send(data)
|
||||
|
||||
@@ -3,8 +3,9 @@ import { SessionStore } from 'src/app/store/session.service';
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { BackgroundService } from '../background.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { EventTrigger } from '../eventTrigger.service'
|
||||
|
||||
export interface wss{
|
||||
export interface wss {
|
||||
|
||||
url: string,
|
||||
type: 'reflect' | 'emit'
|
||||
@@ -20,23 +21,24 @@ export interface wss{
|
||||
providedIn: 'root'
|
||||
})
|
||||
class SynchroService {
|
||||
[x: string]: any;
|
||||
[x: string]: any;
|
||||
|
||||
private connection!: WebSocket;
|
||||
private connection!: WebSocket;
|
||||
private id: string = uuidv4();
|
||||
public conected = false
|
||||
private url: string = ''
|
||||
callback = function(){}
|
||||
callback = function () { }
|
||||
private _connected = false;
|
||||
private eventtrigger: EventTrigger;
|
||||
private BackgroundService = new BackgroundService()
|
||||
callBacks: {
|
||||
type: 'Offline' | 'Online' | 'Onmessage' | 'Chat' | 'Notification' | 'Notifications' | '',
|
||||
type: 'Offline' | 'Online' | 'Onmessage' | 'Chat' | 'Notification' | 'Notifications' | '',
|
||||
object?: string
|
||||
funx: Function
|
||||
}[] = []
|
||||
private msgQueue = []
|
||||
|
||||
constructor() {
|
||||
constructor() {
|
||||
// alert(SessionStore.user.FullName)
|
||||
}
|
||||
|
||||
@@ -46,13 +48,13 @@ class SynchroService {
|
||||
|
||||
setUrl() {
|
||||
|
||||
let header ={
|
||||
id:'1234',
|
||||
let header = {
|
||||
id: '1234',
|
||||
bluePrint: '12312123',
|
||||
jwt: uuidv4()
|
||||
}
|
||||
|
||||
let wss: wss ={
|
||||
let wss: wss = {
|
||||
header,
|
||||
url: 'wss://sychro-offline.herokuapp.com/ws/some_url/',
|
||||
type: 'reflect'
|
||||
@@ -61,7 +63,7 @@ class SynchroService {
|
||||
this.url = `${wss.url}${wss.header.id}/${wss.header.jwt}/${wss.header.bluePrint}/${this.id}/`
|
||||
}
|
||||
|
||||
registerCallback(type: 'Offline' | 'Online' | 'Onmessage' | 'Chat' | 'Notifications' | 'Notification', funx: Function, object='') {
|
||||
registerCallback(type: 'Offline' | 'Online' | 'Onmessage' | 'Chat' | 'Notifications' | 'Notification', funx: Function, object = '') {
|
||||
this.callBacks.push({
|
||||
type,
|
||||
funx,
|
||||
@@ -69,32 +71,32 @@ class SynchroService {
|
||||
})
|
||||
}
|
||||
|
||||
connect() {
|
||||
connect() {
|
||||
|
||||
this.connection = new WebSocket(this.url);
|
||||
// bind function
|
||||
this.connection.onopen = this.onopen;
|
||||
this.connection.onmessage = this.onmessage;
|
||||
this.connection.onclose = this.onclose;
|
||||
this.connection.onerror = this.onerror;
|
||||
}
|
||||
this.connection = new WebSocket(this.url);
|
||||
// bind function
|
||||
this.connection.onopen = this.onopen;
|
||||
this.connection.onmessage = this.onmessage;
|
||||
this.connection.onclose = this.onclose;
|
||||
this.connection.onerror = this.onerror;
|
||||
}
|
||||
|
||||
private onopen = () =>{
|
||||
|
||||
|
||||
|
||||
if(!this.conected) {
|
||||
|
||||
private onopen = () => {
|
||||
|
||||
|
||||
|
||||
//if (this._connected === true) {
|
||||
this.BackgroundService.online()
|
||||
this.callBacks.forEach((e)=>{
|
||||
if(e.type == 'Online') {
|
||||
console.log('Online', this._connected)
|
||||
this.callBacks.forEach((e) => {
|
||||
if (e.type == 'Online') {
|
||||
e.funx()
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
console.log('open ======================= welcome to socket server')
|
||||
|
||||
this._connected = true
|
||||
|
||||
// send all saved data due to internet connection
|
||||
@@ -103,20 +105,20 @@ class SynchroService {
|
||||
object.splice(index, 1);
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public $send(object: any) {
|
||||
|
||||
if(!this._connected) { // save data to send when back online
|
||||
if (!this._connected) { // save data to send when back online
|
||||
this.msgQueue.push(object)
|
||||
}
|
||||
|
||||
let payload = {
|
||||
let payload = {
|
||||
message: JSON.stringify(object) || '{"person.adress.country":"1Angola"}',
|
||||
username: SessionStore.user.FullName,
|
||||
idConnection: this.id
|
||||
}
|
||||
|
||||
|
||||
|
||||
let sendData = JSON.stringify(payload);
|
||||
console.log(sendData)
|
||||
@@ -124,7 +126,7 @@ class SynchroService {
|
||||
this.connection.send(sendData);
|
||||
}
|
||||
|
||||
private onmessage = async (event: any)=> {
|
||||
private onmessage = async (event: any) => {
|
||||
|
||||
|
||||
let data = JSON.parse(event.data)
|
||||
@@ -133,30 +135,30 @@ class SynchroService {
|
||||
const idConnection = payload.idConnection
|
||||
const username = payload.username
|
||||
|
||||
if(idConnection != this.id ) {
|
||||
|
||||
if(window['platform'].is('desktop') || this.platform.is('mobileweb')) {}
|
||||
if (idConnection != this.id) {
|
||||
|
||||
if (window['platform'].is('desktop') || this.platform.is('mobileweb')) { }
|
||||
else return false
|
||||
|
||||
if(environment.production) return false
|
||||
if (environment.production) return false
|
||||
|
||||
this.callBacks.forEach((e)=> {
|
||||
this.callBacks.forEach((e) => {
|
||||
|
||||
if(payload.message[0]) {
|
||||
if(payload.message[0].Service && payload.message[0].Object && payload.message[0].IdObject) {
|
||||
if(e.type == '' && !e.object) {
|
||||
if(username == SessionStore.user.FullName) {
|
||||
if (payload.message[0]) {
|
||||
if (payload.message[0].Service && payload.message[0].Object && payload.message[0].IdObject) {
|
||||
if (e.type == '' && !e.object) {
|
||||
if (username == SessionStore.user.FullName) {
|
||||
e.funx(payload.message, data)
|
||||
}
|
||||
}
|
||||
|
||||
if(e.type == 'Notifications' ) {
|
||||
|
||||
if (e.type == 'Notifications') {
|
||||
e.funx(payload.message, data)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} else if(payload.message.Service && payload.message.Object && payload.message.IdObject) {
|
||||
if(e.type == 'Notification' && e.object == payload.message.Object || e.type == 'Notification' && e.object == 'any' ) {
|
||||
} else if (payload.message.Service && payload.message.Object && payload.message.IdObject) {
|
||||
if (e.type == 'Notification' && e.object == payload.message.Object || e.type == 'Notification' && e.object == 'any') {
|
||||
e.funx(payload.message, data)
|
||||
}
|
||||
}
|
||||
@@ -165,41 +167,44 @@ class SynchroService {
|
||||
|
||||
}
|
||||
this.callback()
|
||||
}
|
||||
}
|
||||
|
||||
private onclose=(event:any)=> {
|
||||
setTimeout(() => {
|
||||
if (event.wasClean) {
|
||||
console.log(`[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);
|
||||
} else {
|
||||
// e.g. server process killed or network down
|
||||
// event.code is usually 1006 in this case
|
||||
console.log('[close] Connection died');
|
||||
private onclose = (event: any) => {
|
||||
console.log('Websocket close')
|
||||
setTimeout(() => {
|
||||
if (event.wasClean) {
|
||||
console.log(`[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);
|
||||
} else {
|
||||
// e.g. server process killed or network down
|
||||
// event.code is usually 1006 in this case
|
||||
console.log('[close] Connection died');
|
||||
console.log('Reconnect')
|
||||
|
||||
|
||||
|
||||
if(this._connected) {
|
||||
|
||||
// if (this._connected === false) {
|
||||
this.BackgroundService.offline();
|
||||
this.callBacks.forEach((e)=>{
|
||||
if(e.type == 'Offline') {
|
||||
console.log('Offline', this._connected)
|
||||
this.callBacks.forEach((e) => {
|
||||
if (e.type == 'Offline') {
|
||||
e.funx()
|
||||
}
|
||||
})
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
// status
|
||||
this._connected = false
|
||||
// reconnect
|
||||
this.connect()
|
||||
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
private onerror=(event: any)=>{
|
||||
console.log(`[error] ${event.message}`);
|
||||
}
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
private onerror = (event: any) => {
|
||||
console.log(`[error] ${event.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SqliteService } from './sqlite.service';
|
||||
|
||||
describe('SqliteService', () => {
|
||||
let service: SqliteService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(SqliteService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,491 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { SQLite, SQLiteObject } from '@ionic-native/sqlite/ngx';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SqliteService {
|
||||
|
||||
private dbInstance: SQLiteObject;
|
||||
readonly db_name: string = "gabinetedigital.db";
|
||||
readonly events: string = "Events";
|
||||
readonly expedientes: string = "Expedientes";
|
||||
readonly allprocess: string = "ALLPROCESS";
|
||||
readonly actions: string = "ACTIONS";
|
||||
readonly publications: string = "PUBLICATIONS";
|
||||
EVENTS: Array<any>;
|
||||
EXPEDIENTES: Array<any>;
|
||||
ALLPROCESS: Array<any>;
|
||||
PROCESS: Array<any>;
|
||||
ALLACTIONS: Array<any>;
|
||||
|
||||
constructor(private platform: Platform,
|
||||
private sqlite: SQLite) {
|
||||
this.databaseConn();
|
||||
}
|
||||
|
||||
databaseConn() {
|
||||
this.platform.ready().then(async () => {
|
||||
await this.sqlite.create({
|
||||
name: this.db_name,
|
||||
location: 'default'
|
||||
}).then(async (sqLite: SQLiteObject) => {
|
||||
this.dbInstance = sqLite;
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.events} (
|
||||
EventId varchar(255) PRIMARY KEY,
|
||||
Subject varchar(255),
|
||||
HasAttachments BIT,
|
||||
Location varchar(255),
|
||||
CalendarId varchar(255),
|
||||
CalendarName varchar(255),
|
||||
StartDate varchar(255),
|
||||
EndDate varchar(255),
|
||||
EventType varchar(255),
|
||||
Attendees Text,
|
||||
IsMeeting BIT,
|
||||
IsRecurring BIT,
|
||||
IsAllDayEvent BIT,
|
||||
AppointmentState INTERGER,
|
||||
TimeZone varchar(255),
|
||||
Organizer Text,
|
||||
Category varchar(255),
|
||||
EventRecurrence Text,
|
||||
Attachments Text,
|
||||
Body Text,
|
||||
Profile varchar(255),
|
||||
HumanDate varchar(255)
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
console.log("Sucess Events Table created: ", res)
|
||||
})
|
||||
.catch((error) => console.log(JSON.stringify(error)));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.expedientes} (
|
||||
serialNumber varchar(255) PRIMARY KEY,
|
||||
workflowInstanceFolio varchar(255),
|
||||
Documents Text,
|
||||
actions Text,
|
||||
activityInstanceName varchar(255),
|
||||
formURL varchar(255),
|
||||
originator Text,
|
||||
taskStartDate varchar(255),
|
||||
totalDocuments INTERGER,
|
||||
workflowDisplayName varchar(255),
|
||||
workflowID INTERGER,
|
||||
workflowInstanceDataFields Text,
|
||||
workflowInstanceID INTERGER,
|
||||
workflowName varchar(255)
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
console.log("Sucess Espedientes Table created: ", res)
|
||||
})
|
||||
.catch((error) => console.log(JSON.stringify(error)));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.allprocess} (
|
||||
serialNumber varchar(255) PRIMARY KEY,
|
||||
workflowInstanceFolio varchar(255),
|
||||
Documents Text,
|
||||
actions Text,
|
||||
activityInstanceName varchar(255),
|
||||
formURL varchar(255),
|
||||
originator Text,
|
||||
taskStartDate varchar(255),
|
||||
totalDocuments INTERGER,
|
||||
workflowDisplayName varchar(255),
|
||||
workflowID INTERGER,
|
||||
workflowInstanceDataFields Text,
|
||||
workflowInstanceID INTERGER,
|
||||
workflowName varchar(255),
|
||||
interveners Text
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
console.log("Sucess AllProcess Table created: ", res)
|
||||
})
|
||||
.catch((error) => console.log(JSON.stringify(error)));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.actions} (
|
||||
ProcessId INTERGER PRIMARY KEY,
|
||||
ActionType varchar(255),
|
||||
DateBegin varchar(255),
|
||||
DateEnd varchar(255),
|
||||
Detail varchar(255),
|
||||
Description varchar(255),
|
||||
publications Text
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
console.log("Sucess action Table created: ", res)
|
||||
})
|
||||
.catch((error) => console.log(JSON.stringify(error)));
|
||||
})
|
||||
.catch((error) => console.log(JSON.stringify(error)));
|
||||
});
|
||||
}
|
||||
|
||||
//addactions
|
||||
public addactions(data) {
|
||||
console.log('Action insert', data)
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR IGNORE INTO ${this.actions} (ActionType,DateBegin,DateEnd,Description,Detail,ProcessId,publications)
|
||||
VALUES ('${data.ActionType}','${data.DateBegin}', '${data.DateEnd}','${data.Description}','${data.Detail}','${data.ProcessId}','${data.publications}')`, [])
|
||||
.then(() => {
|
||||
console.log("action add with Success");
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
});
|
||||
}
|
||||
|
||||
//addEvent
|
||||
public addEvent(data) {
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR IGNORE INTO ${this.events} (EventId,Subject,HasAttachments,Location,CalendarId,CalendarName,StartDate,EndDate,EventType,Attendees,IsMeeting,IsRecurring,IsAllDayEvent,AppointmentState,TimeZone,Organizer,Category,EventRecurrence,Attachments,Body,Profile,HumanDate )
|
||||
VALUES ('${data.EventId}','${data.Subject}','${data.HasAttachments}','${data.Location}','${data.CalendarId}','${data.CalendarName}','${data.StartDate}','${data.EndDate}','${data.EventType}','${data.Attendees}','${data.IsMeeting}','${data.IsRecurring}',
|
||||
'${data.IsAllDayEvent}','${data.AppointmentState}','${data.TimeZone}','${data.Organizer}','${data.Category}','${data.EventRecurrence}','${data.Attachments}','${data.Body}','${data.Profile}','${data.HumanDate}')`, [])
|
||||
.then(() => {
|
||||
console.log("event add with Success");
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e));
|
||||
});
|
||||
}
|
||||
|
||||
//addExpediente
|
||||
public addExpediente(data) {
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR REPLACE INTO ${this.expedientes} (serialNumber,workflowInstanceFolio,Documents,actions,activityInstanceName,formURL,originator,taskStartDate,totalDocuments,workflowDisplayName,workflowID,workflowInstanceDataFields,workflowInstanceID,workflowName)
|
||||
VALUES ('${data.serialNumber}','${data.workflowInstanceFolio}', '${data.Documents}','${data.actions}','${data.activityInstanceName}','${data.formURL}','${data.originator}','${data.taskStartDate}','${data.totalDocuments}','${data.workflowDisplayName}','${data.workflowID}',
|
||||
'${data.workflowInstanceDataFields}','${data.workflowInstanceID}','${data.workflowName}')`, [])
|
||||
.then(() => {
|
||||
console.log("expediente add with Success");
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
});
|
||||
}
|
||||
|
||||
//addprocess
|
||||
public addProcess(data) {
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR IGNORE INTO ${this.allprocess} (serialNumber,workflowInstanceFolio,Documents,actions,activityInstanceName,formURL,originator,taskStartDate,totalDocuments,workflowDisplayName,workflowID,workflowInstanceDataFields,workflowInstanceID,workflowName)
|
||||
VALUES ('${data.serialNumber}','${data.workflowInstanceFolio}', '${JSON.stringify(data.Documents)}','${JSON.stringify(data.actions)}','${data.activityInstanceName}','${data.formURL}','${JSON.stringify(data.originator)}','${data.taskStartDate}','${data.totalDocuments}','${data.workflowDisplayName}','${data.workflowID}',
|
||||
'${JSON.stringify(data.workflowInstanceDataFields)}','${data.workflowInstanceID}','${data.workflowName}')`, [])
|
||||
.then(() => {
|
||||
console.log("process add with Success");
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
});
|
||||
}
|
||||
|
||||
//updateActions
|
||||
public updateactions(id,data) {
|
||||
console.log("update action data", data )
|
||||
this.dbInstance.executeSql(`
|
||||
UPDATE ${this.actions} SET publications = ? WHERE ProcessId = ${id}`,[data])
|
||||
.then(() => {
|
||||
console.log("action update with Success");
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//updateprocess
|
||||
public updateProcess(data) {
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR REPLACE INTO ${this.allprocess} (serialNumber,workflowInstanceFolio,Documents,actions,activityInstanceName,formURL,originator,taskStartDate,totalDocuments,workflowDisplayName,workflowID,workflowInstanceDataFields,workflowInstanceID,workflowName)
|
||||
VALUES ('${data.serialNumber}','${data.workflowInstanceFolio}', '${JSON.stringify(data.Documents)}','${JSON.stringify(data.actions)}','${data.activityInstanceName}','${data.formURL}','${JSON.stringify(data.originator)}','${data.taskStartDate}','${data.totalDocuments}','${data.workflowDisplayName}','${data.workflowID}',
|
||||
'${JSON.stringify(data.workflowInstanceDataFields)}','${data.workflowInstanceID}','${data.workflowName}')`, [])
|
||||
.then(() => {
|
||||
console.log("process add with Success");
|
||||
|
||||
}, (e) => {
|
||||
console.log(JSON.stringify(e.err));
|
||||
});
|
||||
}
|
||||
|
||||
//updateAttachment
|
||||
updateUser(id, document,) {
|
||||
let data = [document];
|
||||
return this.dbInstance.executeSql(`UPDATE ${this.allprocess} SET Documents = ? WHERE serialNumber = ${id}`, [document]).then(() => {
|
||||
console.log("process attachment updated")
|
||||
})
|
||||
}
|
||||
//updateAttachment
|
||||
updateProcessInterveners(id, interveners,) {
|
||||
let data = [document];
|
||||
return this.dbInstance.executeSql(`UPDATE ${this.allprocess} SET interveners = ? WHERE serialNumber = ${id}`, [interveners]).then(() => {
|
||||
console.log("process interveners updated")
|
||||
})
|
||||
}
|
||||
//getAllEvents
|
||||
getAllEvents() {
|
||||
var hashattachment = false;
|
||||
var ismeeting = false;
|
||||
var isrecurring = false;
|
||||
var isallday = false;
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.events}`, []).then((res) => {
|
||||
this.EVENTS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
if (res.rows.item(i).HasAttachments === "true") {
|
||||
hashattachment = true
|
||||
}
|
||||
if (res.rows.item(i).IsMeeting === "true") {
|
||||
ismeeting = true
|
||||
}
|
||||
if (res.rows.item(i).IsRecurring === "true") {
|
||||
isrecurring = true
|
||||
}
|
||||
if (res.rows.item(i).IsAllDayEvent === "true") {
|
||||
isallday = true
|
||||
}
|
||||
let event = {
|
||||
EventId: res.rows.item(i).EventId,
|
||||
HasAttachments: hashattachment,
|
||||
Subject: res.rows.item(i).Subject,
|
||||
Location: res.rows.item(i).Location,
|
||||
CalendarId: res.rows.item(i).CalendarId,
|
||||
CalendarName: res.rows.item(i).CalendarName,
|
||||
StartDate: res.rows.item(i).StartDate,
|
||||
EndDate: res.rows.item(i).EndDate,
|
||||
EventType: res.rows.item(i).EventType,
|
||||
Attendees: res.rows.item(i).Attendees,
|
||||
IsMeeting: ismeeting,
|
||||
IsRecurring: isrecurring,
|
||||
IsAllDayEvent: isallday,
|
||||
AppointmentState: res.rows.item(i).AppointmentState,
|
||||
TimeZone: res.rows.item(i).TimeZone,
|
||||
Organizer: res.rows.item(i).Organizer,
|
||||
Category: res.rows.item(i).Category,
|
||||
EventRecurrence: res.rows.item(i).EventRecurrence,
|
||||
Attachments: res.rows.item(i).Attachments,
|
||||
Profile: res.rows.item(i).Profile,
|
||||
HumanDate: res.rows.item(i).HumanDate
|
||||
|
||||
}
|
||||
this.EVENTS.push(event);
|
||||
}
|
||||
|
||||
return this.EVENTS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all events error", JSON.stringify(e));
|
||||
});
|
||||
}
|
||||
|
||||
getAllExpedientes() {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.expedientes}`, []).then((res) => {
|
||||
this.EXPEDIENTES = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.EXPEDIENTES.push(res.rows.item(i));
|
||||
}
|
||||
return this.EXPEDIENTES;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all expedientes error", JSON.stringify(e));
|
||||
});
|
||||
}
|
||||
|
||||
getAllProcess() {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess}`, []).then((res) => {
|
||||
this.ALLPROCESS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLPROCESS.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all process error", JSON.stringify(e));
|
||||
});
|
||||
}
|
||||
|
||||
//getAllAtions
|
||||
getAllActions() {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.actions}`, []).then((res) => {
|
||||
this.ALLACTIONS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLACTIONS.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLACTIONS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all actions error", JSON.stringify(e));
|
||||
});
|
||||
}
|
||||
//getlistOfEventAprove
|
||||
getListOfEventAprove(process, type) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE workflowDisplayName = ? OR workflowDisplayName = ? `, [process, type]).then((res) => {
|
||||
this.ALLPROCESS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLPROCESS.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all process error", JSON.stringify(e));
|
||||
});
|
||||
}
|
||||
|
||||
//getDespachosProcess
|
||||
getDespachosProcess(process) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE activityInstanceName = ?`, [process]).then((res) => {
|
||||
this.ALLPROCESS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLPROCESS.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all process error", JSON.stringify(e));
|
||||
});
|
||||
}
|
||||
|
||||
//getprocessByworkflow
|
||||
getprocessByworkflow(process) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE workflowDisplayName = ? `, [process]).then((res) => {
|
||||
this.ALLPROCESS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLPROCESS.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all process error", JSON.stringify(e));
|
||||
});
|
||||
}
|
||||
|
||||
//getprocessByworkflowpedido
|
||||
getprocessByworkflowpedido(process, process2) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE workflowDisplayName = ? OR workflowDisplayName = ? `, [process, process2]).then((res) => {
|
||||
this.ALLPROCESS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLPROCESS.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get all process error", JSON.stringify(e));
|
||||
});
|
||||
}
|
||||
|
||||
getProcessById(serial) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE serialNumber = ? `, [serial]).then((res) => {
|
||||
this.PROCESS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.PROCESS.push(res.rows.item(i))
|
||||
}
|
||||
return this.PROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get process by serial error", JSON.stringify(e));
|
||||
});
|
||||
}
|
||||
|
||||
//getActionById
|
||||
getActionById(id) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.actions} WHERE ProcessId = ? `, [id]).then((res) => {
|
||||
this.ALLACTIONS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLACTIONS.push(res.rows.item(i))
|
||||
}
|
||||
return this.ALLACTIONS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get actions by processId error", JSON.stringify(e));
|
||||
});
|
||||
}
|
||||
|
||||
//getEventBy id
|
||||
getEventById(id) {
|
||||
|
||||
var hashattachment = false;
|
||||
var ismeeting = false;
|
||||
var isrecurring = false;
|
||||
var isallday = false;
|
||||
var body;
|
||||
var attendes;
|
||||
var organizer;
|
||||
var eventrecurrence;
|
||||
var attachment;
|
||||
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.events} WHERE EventId = ? `, [id]).then((res) => {
|
||||
this.EVENTS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
if (res.rows.item(i).HasAttachments === "true") {
|
||||
hashattachment = true
|
||||
}
|
||||
if (res.rows.item(i).IsMeeting === "true") {
|
||||
ismeeting = true
|
||||
}
|
||||
if (res.rows.item(i).IsRecurring === "true") {
|
||||
isrecurring = true
|
||||
}
|
||||
if (res.rows.item(i).IsAllDayEvent === "true") {
|
||||
isallday = true
|
||||
}
|
||||
/* if (res.rows.item(i).Body != "") {
|
||||
body = JSON.parse(res.rows.item(i).Body);
|
||||
}
|
||||
if (res.rows.item(i).Attendees !="") {
|
||||
attendes = JSON.parse(res.rows.item(i).Attendees);
|
||||
}
|
||||
if(res.rows.item(i).Organizer !=""){
|
||||
organizer = JSON.parse(res.rows.item(i).Organizer);
|
||||
}
|
||||
if(res.row.item(i).EventRecurrence != ""){
|
||||
eventrecurrence = JSON.parse(res.row.item(i).EventRecurrence);
|
||||
}
|
||||
if(res.row.item(i).Attachments != ""){
|
||||
attachment = JSON.parse(res.row.item(i).Attachments);
|
||||
}
|
||||
*/
|
||||
|
||||
let event = {
|
||||
EventId: res.rows.item(i).EventId,
|
||||
HasAttachments: hashattachment,
|
||||
Subject: res.rows.item(i).Subject,
|
||||
Location: res.rows.item(i).Location,
|
||||
CalendarId: res.rows.item(i).CalendarId,
|
||||
CalendarName: res.rows.item(i).CalendarName,
|
||||
StartDate: res.rows.item(i).StartDate,
|
||||
EndDate: res.rows.item(i).EndDate,
|
||||
EventType: res.rows.item(i).EventType,
|
||||
Attendees: res.rows.item(i).Attendees,
|
||||
IsMeeting: ismeeting,
|
||||
IsRecurring: isrecurring,
|
||||
IsAllDayEvent: isallday,
|
||||
Body: res.rows.item(i).Body,
|
||||
AppointmentState: res.rows.item(i).AppointmentState,
|
||||
TimeZone: res.rows.item(i).TimeZone,
|
||||
Organizer: res.rows.item(i).Organizer,
|
||||
Category: res.rows.item(i).Category,
|
||||
EventRecurrence: res.rows.item(i).EventRecurrence,
|
||||
Attachments: res.rows.item(i).Attachments
|
||||
}
|
||||
this.EVENTS.push(event);
|
||||
}
|
||||
|
||||
return this.EVENTS;
|
||||
}
|
||||
}, (e) => {
|
||||
console.log(" Get events by id error", JSON.stringify(e));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import { StorageService } from 'src/app/services/storage.service';
|
||||
import { AuthConnstants } from 'src/app/config/auth-constants';
|
||||
import { Token } from '../models/token.model';
|
||||
import { ModalController, AlertController, AnimationController, Platform } from '@ionic/angular';
|
||||
import { NavigationExtras,Router } from '@angular/router';
|
||||
import { NavigationExtras, Router } from '@angular/router';
|
||||
import { ToastService } from './toast.service';
|
||||
import MFPPush from 'ibm-mfp-web-push';
|
||||
|
||||
@@ -31,13 +31,27 @@ export class WebNotificationsService {
|
||||
|
||||
webconnection() {
|
||||
|
||||
var inicializeObj = {
|
||||
appId: "com.gpr.gabinetedigital",
|
||||
mfpContextRoot: "/mfp",
|
||||
/* serverUrl: "http://gpr-dev-10.gabinetedigital.local:9080",
|
||||
safariWebsitePushId: "http://gpr-dev-10.gabinetedigital.local:9080", */
|
||||
}
|
||||
|
||||
|
||||
MFPPush.initialize({
|
||||
appId: "com.gpr.gabinetedigital",
|
||||
mfpContextRoot: "/mfp",
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* MFPPush.initialize({
|
||||
appId: "com.gpr.gabinetedigital",
|
||||
mfpContextRoot: "/mfp",
|
||||
}); */
|
||||
|
||||
MFPPush.registerDevice()
|
||||
/* MFPPush.registerDevice()
|
||||
.then((res) => {
|
||||
console.log("WEB Successfully Registered Device...");
|
||||
|
||||
@@ -55,17 +69,129 @@ export class WebNotificationsService {
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("WEB Registration Failed" + err);
|
||||
});
|
||||
}); */
|
||||
}
|
||||
|
||||
async onReceviNotificationWeb() {
|
||||
register(){
|
||||
MFPPush.registerDevice()
|
||||
.then((res) => {
|
||||
console.log("WEB Successfully Registered Device...", res);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("WEB Registration Failed" + err);
|
||||
});
|
||||
}
|
||||
|
||||
async onReceviNotificationWeb() {
|
||||
|
||||
if (window['WLAuthorizationManager']) {
|
||||
if (window['WLAuthorizationManager'].obtainAccessToken) {
|
||||
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
|
||||
(token) => {
|
||||
console.log('Push Notification: Success ' + token);
|
||||
|
||||
MFPPush.initialize(
|
||||
function (successResponse) {
|
||||
console.log("Push notification Successfully intialized: " + successResponse);
|
||||
MFPPush.registerNotificationsCallback(notificationReceived);
|
||||
},
|
||||
function (failureResponse) {
|
||||
console.log("Push notification failure intialized: " + failureResponse);
|
||||
}
|
||||
);
|
||||
var notificationReceived = (message) => {
|
||||
console.log(message);
|
||||
var data = JSON.parse(message.payload);
|
||||
console.log(data.Service);
|
||||
console.log(data.IdObject);
|
||||
console.log(data.Object);
|
||||
|
||||
if (message.actionName) {
|
||||
//this.notificatinsRoutes(data);
|
||||
console.log("Web notification")
|
||||
} else {
|
||||
console.log("Web notification")
|
||||
//this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data);
|
||||
}
|
||||
|
||||
}
|
||||
}, (error) => {
|
||||
console.log('Push notification recived: failure ' + error.responseText);
|
||||
console.log(JSON.stringify(error));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* getTokenByUserIdAndId(user, userID) {
|
||||
const geturl = environment.apiURL + 'notifications/user/' + userID;
|
||||
|
||||
return this.http.get<Token[]>(`${geturl}`);
|
||||
} */
|
||||
|
||||
/* getAndpostToken(username) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
console.log('Notifications not supported')
|
||||
} else {
|
||||
|
||||
const geturl = environment.apiURL + 'notifications/token'; */
|
||||
/*
|
||||
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
|
||||
(token) => {
|
||||
console.log('Push Notification: Success ' + token);
|
||||
|
||||
if(window['WLAuthorizationManager']) {
|
||||
if(window['WLAuthorizationManager'].obtainAccessToken) {
|
||||
MFPPush.initialize(
|
||||
function (successResponse) {
|
||||
console.log("Push notification Successfully Service intialized: " + successResponse);
|
||||
},
|
||||
function (failureResponse) {
|
||||
console.log("Push notification failure Service intialized: " + failureResponse);
|
||||
}
|
||||
);
|
||||
|
||||
MFPPush.registerDevice(null, (successResponse) => {
|
||||
console.log("Successfully registered: " + JSON.stringify(successResponse));
|
||||
console.log('token: ', successResponse.deviceId)
|
||||
this.storageService.store(username, successResponse.deviceId);
|
||||
this.storageService.get(username).then(value => {
|
||||
console.log('STORAGE TOKEN', value)
|
||||
this.storageService.get(AuthConnstants.USER).then(res => {
|
||||
console.log('USERID', res);
|
||||
const headers = { 'Authorization': 'Basic cGF1bG8ucGludG9AZ2FiaW5ldGVkaWdpdGFsLmxvY2FsOnRhYnRlc3RlQDAwNg==' };
|
||||
const body = {
|
||||
UserId: res.UserId,
|
||||
TokenId: successResponse.deviceId,
|
||||
Status: 1,
|
||||
Service: 1
|
||||
};
|
||||
this.http.post<Token>(`${geturl}`, body, { headers }).subscribe(data => {
|
||||
console.log('TOKEN USER MIDLE', data);
|
||||
})
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
function (failureResponse) {
|
||||
console.log("Successfully failue: " + JSON.stringify(failureResponse));
|
||||
}
|
||||
);
|
||||
}, (error) => {
|
||||
console.log('Push notification recived: failure ' + error.responseText);
|
||||
console.log(JSON.stringify(error));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
} */
|
||||
/*
|
||||
async onReceviNotification() {
|
||||
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
|
||||
(token) => {
|
||||
console.log('Push Notification: Success ' + token);
|
||||
|
||||
|
||||
MFPPush.initialize(
|
||||
function (successResponse) {
|
||||
console.log("Push notification Successfully intialized: " + successResponse);
|
||||
@@ -81,122 +207,20 @@ async onReceviNotificationWeb() {
|
||||
console.log(data.Service);
|
||||
console.log(data.IdObject);
|
||||
console.log(data.Object);
|
||||
|
||||
|
||||
if(message.actionName){
|
||||
//this.notificatinsRoutes(data);
|
||||
console.log("Web notification")
|
||||
this.notificatinsRoutes(data);
|
||||
} else {
|
||||
console.log("Web notification")
|
||||
//this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data);
|
||||
this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}, (error) => {
|
||||
console.log('Push notification recived: failure ' + error.responseText);
|
||||
console.log(JSON.stringify(error));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* getTokenByUserIdAndId(user, userID) {
|
||||
const geturl = environment.apiURL + 'notifications/user/' + userID;
|
||||
|
||||
return this.http.get<Token[]>(`${geturl}`);
|
||||
} */
|
||||
|
||||
/* getAndpostToken(username) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
console.log('Notifications not supported')
|
||||
} else {
|
||||
|
||||
const geturl = environment.apiURL + 'notifications/token'; */
|
||||
/*
|
||||
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
|
||||
(token) => {
|
||||
console.log('Push Notification: Success ' + token);
|
||||
|
||||
MFPPush.initialize(
|
||||
function (successResponse) {
|
||||
console.log("Push notification Successfully Service intialized: " + successResponse);
|
||||
},
|
||||
function (failureResponse) {
|
||||
console.log("Push notification failure Service intialized: " + failureResponse);
|
||||
}
|
||||
);
|
||||
|
||||
MFPPush.registerDevice(null, (successResponse) => {
|
||||
console.log("Successfully registered: " + JSON.stringify(successResponse));
|
||||
console.log('token: ', successResponse.deviceId)
|
||||
this.storageService.store(username, successResponse.deviceId);
|
||||
this.storageService.get(username).then(value => {
|
||||
console.log('STORAGE TOKEN', value)
|
||||
this.storageService.get(AuthConnstants.USER).then(res => {
|
||||
console.log('USERID', res);
|
||||
const headers = { 'Authorization': 'Basic cGF1bG8ucGludG9AZ2FiaW5ldGVkaWdpdGFsLmxvY2FsOnRhYnRlc3RlQDAwNg==' };
|
||||
const body = {
|
||||
UserId: res.UserId,
|
||||
TokenId: successResponse.deviceId,
|
||||
Status: 1,
|
||||
Service: 1
|
||||
};
|
||||
this.http.post<Token>(`${geturl}`, body, { headers }).subscribe(data => {
|
||||
console.log('TOKEN USER MIDLE', data);
|
||||
})
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
function (failureResponse) {
|
||||
console.log("Successfully failue: " + JSON.stringify(failureResponse));
|
||||
}
|
||||
);
|
||||
}, (error) => {
|
||||
console.log('Push notification recived: failure ' + error.responseText);
|
||||
console.log(JSON.stringify(error));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
} */
|
||||
/*
|
||||
async onReceviNotification() {
|
||||
window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then(
|
||||
(token) => {
|
||||
console.log('Push Notification: Success ' + token);
|
||||
|
||||
MFPPush.initialize(
|
||||
function (successResponse) {
|
||||
console.log("Push notification Successfully intialized: " + successResponse);
|
||||
MFPPush.registerNotificationsCallback(notificationReceived);
|
||||
},
|
||||
function (failureResponse) {
|
||||
console.log("Push notification failure intialized: " + failureResponse);
|
||||
}
|
||||
);
|
||||
var notificationReceived = (message) => {
|
||||
console.log(message);
|
||||
var data = JSON.parse(message.payload);
|
||||
console.log(data.Service);
|
||||
console.log(data.IdObject);
|
||||
console.log(data.Object);
|
||||
|
||||
if(message.actionName){
|
||||
this.notificatinsRoutes(data);
|
||||
} else {
|
||||
this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data);
|
||||
}
|
||||
|
||||
}
|
||||
}, (error) => {
|
||||
console.log('Push notification recived: failure ' + error.responseText);
|
||||
console.log(JSON.stringify(error));
|
||||
}
|
||||
);
|
||||
} */
|
||||
} */
|
||||
|
||||
/* notificatinsRoutes = (data) => {
|
||||
if (data.Service === "agenda") {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<ion-icon src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="header-title flex-grow-1 cursor-pointer">
|
||||
<label>{{loadedEvent.workflowInstanceDataFields.Subject}} </label>
|
||||
<label>{{loadedEvent.workflowInstanceDataFields.Subject}} 11</label>
|
||||
</div>
|
||||
|
||||
<div (click)="editar(loadedEvent.serialNumber)" class="header-icon-right display-none-{{showAside}}">
|
||||
@@ -89,15 +89,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="loadedAttachments" class="bottom-content width-100">
|
||||
<div *ngIf="loadedEvent.Documents" class="bottom-content width-100">
|
||||
<ion-list>
|
||||
<h5>Documentos Anexados</h5>
|
||||
<h5>Documentos Anexados </h5>
|
||||
<ion-item class="ion-no-margin ion-no-padding"
|
||||
*ngFor="let attach of loadedAttachments"
|
||||
(click)="viewDocument(attach.SourceId)">
|
||||
*ngFor="let attachment of loadedEvent.Documents"
|
||||
(click)="viewDocument(attachment.DocId, attachment)">
|
||||
<ion-label>
|
||||
<p class="attach-title-item d-block">{{attach.SourceName}}</p>
|
||||
<p><span class="span-left">{{attach.Stakeholders}}</span><span class="span-right">{{ attach.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</span></p>
|
||||
<p class="attach-title-item d-block">{{attachment.Assunto}}</p>
|
||||
<p><span class="span-left">{{attachment.Sender}}</span><span class="span-right">{{ attachment.DocDate | date: 'dd-MM-yyyy HH:mm' }}</span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user